1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 # google{test,mock} version
8 PYTHON_COMPAT=( python3_{4,5,6} )
10 inherit cmake-utils gnome2-utils python-single-r1 xdg-utils
12 DESCRIPTION="A personal finance manager"
13 HOMEPAGE="http://www.gnucash.org/"
14 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
15 https://github.com/google/googletest/archive/release-${GV}.tar.gz -> gtest-${GV}.tar.gz"
19 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
21 # Add doc back in for 3.0 and bump app-doc/gnucash-docs
22 IUSE="aqbanking chipcard debug examples gnome-keyring mysql nls ofx postgres
23 python quotes -register2 sqlite"
25 chipcard? ( aqbanking )
26 python? ( ${PYTHON_REQUIRED_USE} )"
28 # libdbi version requirement for sqlite taken from bug #455134
30 # dev-libs/boost must always be built with nls enabled.
32 >=dev-libs/glib-2.40.0:2
33 >=dev-libs/libxml2-2.7.0:2
34 >=dev-scheme/guile-2.0.0:12=[regex]
36 >=x11-libs/gtk+-3.14.0:3
37 dev-libs/boost:=[icu,nls]
41 net-libs/webkit-gtk:4=
43 >=net-libs/aqbanking-5[gtk,ofx?]
44 sys-libs/gwenhywfar[gtk]
45 chipcard? ( sys-libs/libchipcard )
47 gnome-keyring? ( >=app-crypt/libsecret-0.18 )
50 dev-db/libdbi-drivers[mysql]
52 ofx? ( >=dev-libs/libofx-0.9.1 )
55 dev-db/libdbi-drivers[postgres]
57 python? ( ${PYTHON_DEPS} )
59 >=dev-perl/Finance-Quote-1.11
61 dev-perl/HTML-TableExtract
65 >=dev-db/libdbi-drivers-0.9.0[sqlite]
71 >=sys-devel/gettext-0.19.6
74 gnome-base/gnome-common
81 # ~app-doc/gnucash-docs-${PV}
85 #PATCHES=( "${FILESDIR}"/${PN}-2.7.4-fix-tests-for-32bit-platforms.patch )
88 use python && python-single-r1_pkg_setup
93 local sql_on_off="OFF"
94 if use mysql || use postgres || use sqlite ; then
99 -DGMOCK_ROOT="${WORKDIR}"/googletest-release-${GV}/googlemock
100 -DGTEST_ROOT="${WORKDIR}"/googletest-release-${GV}/googletest
102 -DDISABLE_NLS=$(usex !nls)
103 -DENABLE_REGISTER2=$(usex register2)
104 -DWITH_AQBANKING=$(usex aqbanking)
105 -DWITH_OFX=$(usex ofx)
106 -DWITH_PYTHON=$(usex python)
107 -DWITH_SQL=${sql_on_off}
110 cmake-utils_src_configure
115 cp common/test-core/unittest_support.py \
116 "${BUILD_DIR}"/common/test-core/ || die
119 cd "${BUILD_DIR}" || die
120 XDG_DATA_HOME="${T}/$(whoami)" emake check
124 cmake-utils_src_install
126 rm "${ED%/}"/usr/share/doc/${PF}/README.dependencies || die
127 rm "${ED%/}"/usr/share/glib-2.0/schemas/gschemas.compiled || die
129 if use examples ; then
130 mv "${ED%/}"/usr/share/doc/gnucash \
131 "${ED%/}"/usr/share/doc/${PF}/examples || die
132 pushd "${ED%/}"/usr/share/doc/${PF}/examples/ > /dev/null || die
133 rm AUTHORS DOCUMENTERS LICENSE NEWS projects.html ChangeLog* \
134 *win32-bin.txt || die
135 popd > /dev/null || die
136 docompress -x /usr/share/doc/${PF}/examples/
138 rm -r "${ED%/}"/usr/share/doc/gnucash || die
141 use aqbanking && dodoc doc/README.HBCI
142 use ofx && dodoc doc/README.OFX
146 gnome2_icon_cache_update
147 gnome2_schemas_update
148 xdg_desktop_database_update
149 xdg_mimeinfo_database_update
151 ewarn "Backup all financial files or databases before using GnuCash >=2.7.0!"
153 ewarn "GnuCash 2.7.0 introduced large changes in its file format and database"
154 ewarn "schema that WILL prevent you from reverting back to GnuCash 2.6."
158 gnome2_icon_cache_update
159 gnome2_schemas_update
160 xdg_desktop_database_update
161 xdg_mimeinfo_database_update