1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 # google{test,mock} version
8 PYTHON_COMPAT=( python3_{5,6} )
10 inherit cmake-utils flag-o-matic gnome2-utils python-single-r1 xdg-utils
12 DESCRIPTION="A personal finance manager"
13 HOMEPAGE="http://www.gnucash.org/"
14 SRC_URI="https://github.com/Gnucash/${PN}/releases/download/${PV}/${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 IUSE="aqbanking chipcard debug doc examples gnome-keyring mysql nls ofx postgres python quotes -register2 sqlite +gui"
23 chipcard? ( aqbanking )
24 python? ( ${PYTHON_REQUIRED_USE} )"
26 # libdbi version requirement for sqlite taken from bug #455134
28 # dev-libs/boost must always be built with nls enabled.
29 # guile[deprecated] because of SCM_LIST*() use
31 >=dev-libs/glib-2.46.0:2
32 >=dev-libs/libxml2-2.7.0:2
34 >=dev-scheme/guile-2.2.0:12=[deprecated,regex]
35 dev-libs/boost:=[icu,nls]
39 >=net-libs/aqbanking-5[gtk,ofx?]
40 sys-libs/gwenhywfar[gtk]
41 chipcard? ( sys-libs/libchipcard )
43 gnome-keyring? ( >=app-crypt/libsecret-0.18 )
46 net-libs/webkit-gtk:4=
47 >=x11-libs/gtk+-3.14.0:3
51 dev-db/libdbi-drivers[mysql]
53 ofx? ( >=dev-libs/libofx-0.9.1 )
56 dev-db/libdbi-drivers[postgres]
58 python? ( ${PYTHON_DEPS} )
60 >=dev-perl/Finance-Quote-1.11
62 dev-perl/HTML-TableExtract
66 >=dev-db/libdbi-drivers-0.9.0[sqlite]
72 >=sys-devel/gettext-0.19.6
80 ~app-doc/gnucash-docs-${PV}
84 PATCHES=( "${FILESDIR}"/${PN}-3.2-no-gui.patch )
87 use python && python-single-r1_pkg_setup
92 local sql_on_off="OFF"
93 if use mysql || use postgres || use sqlite ; then
98 -DGMOCK_ROOT="${WORKDIR}"/googletest-release-${GV}/googlemock
99 -DGTEST_ROOT="${WORKDIR}"/googletest-release-${GV}/googletest
100 # Disable fallback to guile-2.0
101 -DCMAKE_DISABLE_FIND_PACKAGE_GUILE2=ON
102 -DCOMPILE_GSCHEMAS=OFF
103 -DDISABLE_NLS=$(usex !nls)
104 -DENABLE_REGISTER2=$(usex register2)
105 -DWITH_AQBANKING=$(usex aqbanking)
106 -DWITH_OFX=$(usex ofx)
107 -DWITH_PYTHON=$(usex python)
108 -DWITH_SQL=${sql_on_off}
109 -DWITH_GNUCASH=$(usex gui)
112 append-cflags -Wno-error
113 append-cxxflags -Wno-error
114 cmake-utils_src_configure
119 cp common/test-core/unittest_support.py \
120 "${BUILD_DIR}"/common/test-core/ || die
123 cd "${BUILD_DIR}" || die
124 XDG_DATA_HOME="${T}/$(whoami)" emake check
128 cmake-utils_src_install
130 rm "${ED%/}"/usr/share/doc/${PF}/README.dependencies || die
132 if use examples ; then
133 mv "${ED%/}"/usr/share/doc/gnucash \
134 "${ED%/}"/usr/share/doc/${PF}/examples || die
135 pushd "${ED%/}"/usr/share/doc/${PF}/examples/ > /dev/null || die
136 rm AUTHORS DOCUMENTERS LICENSE NEWS projects.html ChangeLog* \
137 *win32-bin.txt || die
138 popd > /dev/null || die
139 docompress -x /usr/share/doc/${PF}/examples/
141 rm -r "${ED%/}"/usr/share/doc/gnucash || die
144 use aqbanking && dodoc doc/README.HBCI
145 use ofx && dodoc doc/README.OFX
150 gnome2_icon_cache_update
151 gnome2_schemas_update
153 xdg_desktop_database_update
154 xdg_mimeinfo_database_update
156 ewarn "Backup all financial files or databases before using GnuCash >=2.7.0!"
158 ewarn "GnuCash 2.7.0 introduced large changes in its file format and database"
159 ewarn "schema that WILL prevent you from reverting back to GnuCash 2.6."
164 gnome2_icon_cache_update
165 gnome2_schemas_update
167 xdg_desktop_database_update
168 xdg_mimeinfo_database_update