1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017 Chris Marusich <cmmarusich@gmail.com>
6 ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
8 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
9 ;;; Copyright © 2020 Prafulla Giri <pratheblackdiamond@gmail.com>
10 ;;; Copyright © 2020 Christopher Lam <christopher.lck@gmail.com>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages gnucash)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix utils)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system cmake)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages boost)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages cmake)
40 #:use-module (gnu packages databases)
41 #:use-module (gnu packages docbook)
42 #:use-module (gnu packages documentation)
43 #:use-module (gnu packages finance)
44 #:use-module (gnu packages gettext)
45 #:use-module (gnu packages gnome)
46 #:use-module (gnu packages gnupg)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages guile)
50 #:use-module (gnu packages icu4c)
51 #:use-module (gnu packages multiprecision)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages swig)
56 #:use-module (gnu packages tls)
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages webkit)
59 #:use-module (gnu packages xml))
61 (define-public gnucash
62 ;; TODO: Unbundle libraries such as guile-json found under the "borrowed/"
70 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
71 version "/gnucash-" version ".tar.bz2"))
74 "020k1mm909dcgs52ls4v7xx3yn8gqazi9awyr81l6y7pkq1spn2n"))))
75 (build-system cmake-build-system)
77 `(("guile" ,guile-3.0)
83 ("libdbi-drivers" ,libdbi-drivers)
87 ("webkitgtk" ,webkitgtk)
88 ("aqbanking" ,aqbanking)
90 ("perl-date-manip" ,perl-date-manip)
91 ("perl-finance-quote" ,perl-finance-quote)
92 ("tzdata" ,tzdata-for-tests)))
94 `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
95 ("intltool" ,intltool)
96 ("googlemock" ,(package-source googletest))
97 ("googletest" ,googletest)
98 ("gnucash-docs" ,gnucash-docs)
100 ("pkg-config" ,pkg-config)))
102 ;; dconf is required at runtime according to README.dependencies.
104 (outputs '("out" "doc" "debug" "python"))
106 `(#:test-target "check"
107 #:configure-flags '("-DWITH_PYTHON=ON")
108 #:make-flags '("GUILE_AUTO_COMPILE=0")
109 #:modules ((guix build cmake-build-system)
110 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
112 #:imported-modules (,@%gnu-build-system-modules
113 (guix build cmake-build-system)
114 (guix build glib-or-gtk-build-system))
116 (modify-phases %standard-phases
117 (add-after 'unpack 'unpack-gmock
118 (lambda* (#:key inputs #:allow-other-keys)
120 (copy-recursively (assoc-ref inputs "googlemock") "gmock")
121 (setenv "GMOCK_ROOT" (string-append (getcwd) "/gmock/googlemock"))
123 (add-after 'unpack 'set-env-vars
124 (lambda* (#:key inputs #:allow-other-keys)
125 (let ((tzdata (assoc-ref inputs "tzdata")))
126 ;; At least one test is time-related and requires this
127 ;; environment variable.
129 (string-append tzdata
131 (substitute* "CMakeLists.txt"
132 (("set\\(SHELL /bin/bash\\)")
133 (string-append "set(SHELL " (which "bash") ")")))
135 ;; After wrapping gnc-fq-check and gnc-fq-helper we can no longer
136 ;; execute them with perl, so execute them directly instead.
137 (add-after 'unpack 'fix-finance-quote-check
139 (substitute* "gnucash/price-quotes.scm"
140 (("\"perl\" \"-w\" ") ""))
142 ;; The qof test requires the en_US, en_GB, and fr_FR locales.
143 (add-before 'check 'install-locales
145 (setenv "LOCPATH" (getcwd))
146 (invoke "localedef" "-i" "en_US" "-f" "UTF-8" "./en_US.UTF-8")
147 (invoke "localedef" "-i" "en_GB" "-f" "UTF-8" "./en_GB.UTF-8")
148 (invoke "localedef" "-i" "fr_FR" "-f" "UTF-8" "./fr_FR.UTF-8")
150 ;; There are about 100 megabytes of documentation.
151 (add-after 'install 'install-docs
152 (lambda* (#:key inputs outputs #:allow-other-keys)
153 (let ((docs (assoc-ref inputs "gnucash-docs"))
154 (doc-output (assoc-ref outputs "doc")))
155 (mkdir-p (string-append doc-output "/share"))
156 (symlink (string-append docs "/share/gnome")
157 (string-append doc-output "/share/gnome"))
159 (add-after 'install 'split-python-bindings
160 (lambda* (#:key inputs outputs #:allow-other-keys)
161 (let* ((out (assoc-ref outputs "out"))
162 (python-output (assoc-ref outputs "python"))
163 (python-bindings (string-append
165 ,(version-major+minor
166 (package-version python)))))
167 (mkdir-p (string-append python-output "/" python-bindings))
169 (string-append out "/" python-bindings)
170 (string-append python-output "/" python-bindings))
171 (delete-file-recursively
172 (string-append out "/" python-bindings)))))
173 (add-after 'install-docs 'wrap-programs
174 (lambda* (#:key inputs outputs #:allow-other-keys)
175 (for-each (lambda (prog)
176 (wrap-program (string-append (assoc-ref outputs "out")
180 (assoc-ref inputs "libdbi-drivers")
182 `("PERL5LIB" ":" prefix
184 (string-append o "/lib/perl5/site_perl/"
185 ,(package-version perl)))
186 (if (string=? prog "gnc-fq-helper")
188 ,@(transitive-input-references
191 (assoc l (package-inputs this-package)))
192 '("perl-finance-quote"
193 "perl-date-manip"))))
195 ,@(transitive-input-references
198 (assoc l (package-inputs this-package)))
199 '("perl-finance-quote")))))))))
204 (add-after 'install 'glib-or-gtk-compile-schemas
205 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
206 (add-after 'install 'glib-or-gtk-wrap
207 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
208 (home-page "https://www.gnucash.org/")
209 (synopsis "Personal and small business financial accounting software")
211 "GnuCash is personal and professional financial-accounting software.
212 It can be used to track bank accounts, stocks, income and expenses, based on
213 the double-entry accounting practice. It includes support for QIF/OFX/HBCI
214 import and transaction matching. It also automates several tasks, such as
215 financial calculations or scheduled transactions.
217 To make the GnuCash documentation available, its doc output must be
218 installed as well as Yelp, the Gnome help browser.")
219 (license license:gpl3+)))
221 ;; This package is not public, since we use it to build the "doc" output of
222 ;; the gnucash package (see above). It would be confusing if it were public.
224 (let ((revision "")) ;set to the empty string when no revision
226 (name "gnucash-docs")
227 (version (package-version gnucash))
231 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
232 version "/gnucash-docs-" version revision ".tar.gz"))
235 "1p1rbv0gyi07nh5pzhk3xm46w66kjyaipb6rpaq9yb9gil1nl7q5"))))
236 (build-system gnu-build-system)
237 ;; These are native-inputs because they are only required for building the
240 `(("libxml2" ,libxml2)
241 ;; The "check" target needs the docbook xml package for validating the
242 ;; DocBook XML during the tests.
243 ("docbook-xml" ,docbook-xml)
245 ("docbook-xsl" ,docbook-xsl)
246 ("scrollkeeper" ,scrollkeeper)))
247 (home-page "https://www.gnucash.org/")
248 (synopsis "Documentation for GnuCash")
250 "User guide and other documentation for GnuCash in various languages.
251 This package exists because the GnuCash project maintains its documentation in
252 an entirely separate package from the actual GnuCash program. It is intended
253 to be read using the GNOME Yelp program.")
254 (license (list license:fdl1.1+ license:gpl3+)))))
256 (define-public gwenhywfar
259 (version "4.99.25rc9")
263 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
264 "download/223/gwenhywfar-" version ".tar.gz"))
266 (base32 "14ws780zfyv9qg41z42hlk8sh31w80w3v8n5riaslqhvvxqbfgkq"))))
267 (build-system gnu-build-system)
270 (list "--disable-network-checks"
271 ;; GTK+3, GTK+2 and QT4 are supported.
273 (string-append "--with-openssl-includes="
274 (assoc-ref %build-inputs "openssl") "/include")
275 (string-append "--with-openssl-libs="
276 (assoc-ref %build-inputs "openssl") "/lib"))))
278 `(("libgcrypt" ,libgcrypt)
283 `(("pkg-config" ,pkg-config)))
284 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
285 (synopsis "Utility library for networking and security applications")
287 "This package provides a helper library for networking and security
288 applications and libraries. It is used by AqBanking.")
289 ;; The license includes an explicit additional permission to compile and
290 ;; distribute this library with the OpenSSL Toolkit.
291 (license license:lgpl2.1+)))
293 (define-public aqbanking
296 (version "5.99.44beta")
300 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
301 "download/224/aqbanking-" version ".tar.gz"))
303 (base32 "1cgj8g3wy53galp9pk50a85w0kmwfx3dwl93cbvq6sqb9izxmwdb"))))
304 (build-system gnu-build-system)
306 `(;; Parallel building fails because aqhbci is required before it's
308 #:parallel-build? #f))
310 `(("gwenhywfar" ,gwenhywfar)))
316 `(("pkg-config" ,pkg-config)
317 ("gettext-minimal" ,gettext-minimal)
318 ("libltdl" ,libltdl)))
319 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
320 (synopsis "Interface for online banking tasks")
322 "AqBanking is a modular and generic interface to online banking tasks,
323 financial file formats (import/export) and bank/country/currency information.
324 AqBanking uses backend plugins to actually perform the online tasks. HBCI,
325 OFX DirectConnect, YellowNet, GeldKarte, and DTAUS discs are currently
326 supported. AqBanking is used by GnuCash, KMyMoney, and QBankManager.")
327 ;; AqBanking is licensed under the GPLv2 or GPLv3
328 (license (list license:gpl2 license:gpl3))))