Gentoo Archives: gentoo-commits

From: Aaron Swenson <titanofold@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/gnucash/, app-office/gnucash/files/
Date: Wed, 29 Aug 2018 10:48:14
Message-Id: 1535539673.37c1feba2c76814bb66da36d7fd8916396a99037.titanofold@gentoo
1 commit: 37c1feba2c76814bb66da36d7fd8916396a99037
2 Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 29 10:47:53 2018 +0000
4 Commit: Aaron Swenson <titanofold <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 29 10:47:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37c1feba
7
8 app-office/gnucash: Add option to disable GUI
9
10 Thanks to Reimundo Heluani for working on this.
11
12 Closes: https://bugs.gentoo.org/651200
13 Package-Manager: Portage-2.3.40, Repoman-2.3.9
14
15 app-office/gnucash/files/gnucash-3.2-no-gui.patch | 14 ++
16 app-office/gnucash/gnucash-3.2-r1.ebuild | 173 ++++++++++++++++++++++
17 app-office/gnucash/metadata.xml | 4 +
18 3 files changed, 191 insertions(+)
19
20 diff --git a/app-office/gnucash/files/gnucash-3.2-no-gui.patch b/app-office/gnucash/files/gnucash-3.2-no-gui.patch
21 new file mode 100644
22 index 00000000000..896aafd17f1
23 --- /dev/null
24 +++ b/app-office/gnucash/files/gnucash-3.2-no-gui.patch
25 @@ -0,0 +1,14 @@
26 +diff --git a/CMakeLists.txt b/CMakeLists.txt
27 +index 5e10a09..cdbdb7a 100644
28 +--- a/CMakeLists.txt
29 ++++ b/CMakeLists.txt
30 +@@ -770,7 +770,9 @@ set(SCHEME_INSTALLED_CACHE_DIR ${PKGLIBDIR}/scm/ccache/${GUILE_EFFECTIVE_VERSION
31 + # The subdirectories
32 + add_subdirectory (borrowed)
33 + add_subdirectory (data)
34 ++if (WITH_GNUCASH)
35 + add_subdirectory (doc)
36 ++endif (WITH_GNUCASH)
37 + add_subdirectory (po)
38 + add_subdirectory (common)
39 + add_subdirectory (libgnucash)
40
41 diff --git a/app-office/gnucash/gnucash-3.2-r1.ebuild b/app-office/gnucash/gnucash-3.2-r1.ebuild
42 new file mode 100644
43 index 00000000000..64b817987f9
44 --- /dev/null
45 +++ b/app-office/gnucash/gnucash-3.2-r1.ebuild
46 @@ -0,0 +1,173 @@
47 +# Copyright 1999-2018 Gentoo Foundation
48 +# Distributed under the terms of the GNU General Public License v2
49 +
50 +EAPI=6
51 +
52 +# google{test,mock} version
53 +GV="1.8.0"
54 +PYTHON_COMPAT=( python3_{4,5,6} )
55 +
56 +inherit cmake-utils gnome2-utils python-single-r1 xdg-utils
57 +
58 +DESCRIPTION="A personal finance manager"
59 +HOMEPAGE="http://www.gnucash.org/"
60 +SRC_URI="https://github.com/Gnucash/${PN}/releases/download/${PV}/${P}.tar.bz2
61 + https://github.com/google/googletest/archive/release-${GV}.tar.gz -> gtest-${GV}.tar.gz"
62 +
63 +SLOT="0"
64 +LICENSE="GPL-2"
65 +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
66 +
67 +IUSE="aqbanking chipcard debug doc examples gnome-keyring mysql nls ofx postgres
68 + python quotes -register2 sqlite +gui"
69 +REQUIRED_USE="
70 + chipcard? ( aqbanking )
71 + python? ( ${PYTHON_REQUIRED_USE} )"
72 +
73 +# libdbi version requirement for sqlite taken from bug #455134
74 +#
75 +# dev-libs/boost must always be built with nls enabled.
76 +RDEPEND="
77 + >=dev-libs/glib-2.40.0:2
78 + >=dev-libs/libxml2-2.7.0:2
79 + >=sys-libs/zlib-1.1.4
80 + >=dev-scheme/guile-2.0.0:12=[regex]
81 + gui? (
82 + gnome-base/dconf
83 + net-libs/webkit-gtk:4=
84 + >=x11-libs/gtk+-3.14.0:3
85 + )
86 + dev-libs/boost:=[icu,nls]
87 + dev-libs/icu:=
88 + dev-libs/libxslt
89 + aqbanking? (
90 + >=net-libs/aqbanking-5[gtk,ofx?]
91 + sys-libs/gwenhywfar[gtk]
92 + chipcard? ( sys-libs/libchipcard )
93 + )
94 + gnome-keyring? ( >=app-crypt/libsecret-0.18 )
95 + mysql? (
96 + dev-db/libdbi
97 + dev-db/libdbi-drivers[mysql]
98 + )
99 + ofx? ( >=dev-libs/libofx-0.9.1 )
100 + postgres? (
101 + dev-db/libdbi
102 + dev-db/libdbi-drivers[postgres]
103 + )
104 + python? ( ${PYTHON_DEPS} )
105 + quotes? (
106 + >=dev-perl/Finance-Quote-1.11
107 + dev-perl/Date-Manip
108 + dev-perl/HTML-TableExtract
109 + )
110 + sqlite? (
111 + >=dev-db/libdbi-0.9.0
112 + >=dev-db/libdbi-drivers-0.9.0[sqlite]
113 + )
114 +"
115 +
116 +DEPEND="${RDEPEND}
117 + ~dev-cpp/gtest-${GV}
118 + >=sys-devel/gettext-0.19.6
119 + dev-lang/perl
120 + dev-perl/XML-Parser
121 + gui? ( gnome-base/gnome-common )
122 + sys-devel/libtool
123 + virtual/pkgconfig
124 +"
125 +
126 +PDEPEND="doc? (
127 + ~app-doc/gnucash-docs-${PV}
128 + gnome-extra/yelp
129 +)"
130 +
131 +pkg_setup() {
132 + use python && python-single-r1_pkg_setup
133 + xdg_environment_reset
134 +}
135 +
136 +src_prepare() {
137 + use gui || eapply "${FILESDIR}"/${PN}-3.2-no-gui.patch
138 + default
139 +}
140 +
141 +src_configure() {
142 + local sql_on_off="OFF"
143 + if use mysql || use postgres || use sqlite ; then
144 + sql_on_off="ON"
145 + fi
146 +
147 + local mycmakeargs=(
148 + -DGMOCK_ROOT="${WORKDIR}"/googletest-release-${GV}/googlemock
149 + -DGTEST_ROOT="${WORKDIR}"/googletest-release-${GV}/googletest
150 +
151 + -DDISABLE_NLS=$(usex !nls)
152 + -DENABLE_REGISTER2=$(usex register2)
153 + -DWITH_AQBANKING=$(usex aqbanking)
154 + -DWITH_OFX=$(usex ofx)
155 + -DWITH_PYTHON=$(usex python)
156 + -DWITH_SQL=${sql_on_off}
157 + -DWITH_GNUCASH=$(usex gui)
158 + )
159 +
160 + cmake-utils_src_configure
161 +}
162 +
163 +src_test() {
164 + if use python ; then
165 + cp common/test-core/unittest_support.py \
166 + "${BUILD_DIR}"/common/test-core/ || die
167 + fi
168 +
169 + cd "${BUILD_DIR}" || die
170 + XDG_DATA_HOME="${T}/$(whoami)" emake check
171 +}
172 +
173 +src_install() {
174 + cmake-utils_src_install
175 +
176 + rm "${ED%/}"/usr/share/doc/${PF}/README.dependencies || die
177 +
178 + if use gui ; then
179 + rm "${ED%/}"/usr/share/glib-2.0/schemas/gschemas.compiled || die
180 + fi
181 +
182 + if use examples ; then
183 + mv "${ED%/}"/usr/share/doc/gnucash \
184 + "${ED%/}"/usr/share/doc/${PF}/examples || die
185 + pushd "${ED%/}"/usr/share/doc/${PF}/examples/ > /dev/null || die
186 + rm AUTHORS DOCUMENTERS LICENSE NEWS projects.html ChangeLog* \
187 + *win32-bin.txt || die
188 + popd > /dev/null || die
189 + docompress -x /usr/share/doc/${PF}/examples/
190 + else
191 + rm -r "${ED%/}"/usr/share/doc/gnucash || die
192 + fi
193 +
194 + use aqbanking && dodoc doc/README.HBCI
195 + use ofx && dodoc doc/README.OFX
196 +}
197 +
198 +pkg_postinst() {
199 + if use gui ; then
200 + gnome2_icon_cache_update
201 + gnome2_schemas_update
202 + fi
203 + xdg_desktop_database_update
204 + xdg_mimeinfo_database_update
205 +
206 + ewarn "Backup all financial files or databases before using GnuCash >=2.7.0!"
207 + ewarn
208 + ewarn "GnuCash 2.7.0 introduced large changes in its file format and database"
209 + ewarn "schema that WILL prevent you from reverting back to GnuCash 2.6."
210 +}
211 +
212 +pkg_postrm() {
213 + if use gui ; then
214 + gnome2_icon_cache_update
215 + gnome2_schemas_update
216 + fi
217 + xdg_desktop_database_update
218 + xdg_mimeinfo_database_update
219 +}
220
221 diff --git a/app-office/gnucash/metadata.xml b/app-office/gnucash/metadata.xml
222 index f0b8ab6233e..3ce30180150 100644
223 --- a/app-office/gnucash/metadata.xml
224 +++ b/app-office/gnucash/metadata.xml
225 @@ -16,6 +16,10 @@
226 <flag name="chipcard">
227 Enable support for chipcard reading and processing.
228 </flag>
229 + <flag name="gui">
230 + Enable graphic interface (needs net-libs/webkit-gtk:4
231 + and x11-libs/gtk+:3)
232 + </flag>
233 <flag name="quotes">Enable Online Stock Quote retrieval</flag>
234 <flag name="register2">Use the new register (Experimental)</flag>
235 </use>