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>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages gnucash)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system cmake)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages base)
34 #:use-module (gnu packages boost)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages cmake)
37 #:use-module (gnu packages databases)
38 #:use-module (gnu packages docbook)
39 #:use-module (gnu packages documentation)
40 #:use-module (gnu packages finance)
41 #:use-module (gnu packages gettext)
42 #:use-module (gnu packages gnome)
43 #:use-module (gnu packages gnupg)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gtk)
46 #:use-module (gnu packages guile)
47 #:use-module (gnu packages icu4c)
48 #:use-module (gnu packages multiprecision)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages tls)
52 #:use-module (gnu packages web)
53 #:use-module (gnu packages webkit)
54 #:use-module (gnu packages xml))
56 (define-public gnucash
57 ;; TODO: Unbundle libraries such as guile-json found under the "borrowed/"
65 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
66 version "/gnucash-" version "b" ".tar.bz2"))
69 "0dvzm3bib7jcj685sklpzyy9mrak9mxyvih2k9fk4sl3v21wlphg"))))
70 (build-system cmake-build-system)
72 `(("guile" ,guile-2.2)
78 ("libdbi-drivers" ,libdbi-drivers)
79 ("libgnomecanvas" ,libgnomecanvas)
83 ("webkitgtk" ,webkitgtk)
84 ("aqbanking" ,aqbanking)
85 ("perl-date-manip" ,perl-date-manip)
86 ("perl-finance-quote" ,perl-finance-quote)
87 ("tzdata" ,tzdata-for-tests)))
89 `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
90 ("intltool" ,intltool)
91 ("googlemock" ,(package-source googletest))
92 ("googletest" ,googletest)
93 ("gnucash-docs" ,gnucash-docs)
94 ("pkg-config" ,pkg-config)))
96 ;; dconf is required at runtime according to README.dependencies.
98 (outputs '("out" "doc" "debug"))
100 `(#:test-target "check"
101 #:make-flags '("GUILE_AUTO_COMPILE=0")
102 #:modules ((guix build cmake-build-system)
103 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
105 #:imported-modules (,@%gnu-build-system-modules
106 (guix build cmake-build-system)
107 (guix build glib-or-gtk-build-system))
109 (modify-phases %standard-phases
110 (add-after 'unpack 'unpack-gmock
111 (lambda* (#:key inputs #:allow-other-keys)
113 (copy-recursively (assoc-ref inputs "googlemock") "gmock")
114 (setenv "GMOCK_ROOT" (string-append (getcwd) "/gmock/googlemock"))
116 (add-after 'unpack 'set-env-vars
117 (lambda* (#:key inputs #:allow-other-keys)
118 (let ((tzdata (assoc-ref inputs "tzdata")))
119 ;; At least one test is time-related and requires this
120 ;; environment variable.
122 (string-append tzdata
124 (substitute* "CMakeLists.txt"
125 (("set\\(SHELL /bin/bash\\)")
126 (string-append "set(SHELL " (which "bash") ")")))
128 ;; After wrapping gnc-fq-check and gnc-fq-helper we can no longer
129 ;; execute them with perl, so execute them directly instead.
130 (add-after 'unpack 'fix-finance-quote-check
132 (substitute* "libgnucash/scm/price-quotes.scm"
133 (("\"perl\" \"-w\" ") ""))
135 ;; The qof test requires the en_US, en_GB, and fr_FR locales.
136 (add-before 'check 'install-locales
138 (setenv "LOCPATH" (getcwd))
139 (invoke "localedef" "-i" "en_US" "-f" "UTF-8" "./en_US.UTF-8")
140 (invoke "localedef" "-i" "en_GB" "-f" "UTF-8" "./en_GB.UTF-8")
141 (invoke "localedef" "-i" "fr_FR" "-f" "UTF-8" "./fr_FR.UTF-8")
143 ;; There are about 100 megabytes of documentation.
144 (add-after 'install 'install-docs
145 (lambda* (#:key inputs outputs #:allow-other-keys)
146 (let ((docs (assoc-ref inputs "gnucash-docs"))
147 (doc-output (assoc-ref outputs "doc")))
148 (mkdir-p (string-append doc-output "/share"))
149 (symlink (string-append docs "/share/gnome")
150 (string-append doc-output "/share/gnome"))
152 (add-after 'install-docs 'wrap-programs
153 (lambda* (#:key inputs outputs #:allow-other-keys)
154 (for-each (lambda (prog)
155 (wrap-program (string-append (assoc-ref outputs "out")
159 (assoc-ref inputs "libdbi-drivers")
161 `("PERL5LIB" ":" prefix
163 (string-append o "/lib/perl5/site_perl/"
164 ,(package-version perl)))
165 (if (string=? prog "gnc-fq-helper")
167 ,@(transitive-input-references
170 (assoc l (package-inputs this-package)))
171 '("perl-finance-quote"
172 "perl-date-manip"))))
174 ,@(transitive-input-references
177 (assoc l (package-inputs this-package)))
178 '("perl-finance-quote")))))))))
183 (add-after 'install 'glib-or-gtk-compile-schemas
184 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
185 (add-after 'install 'glib-or-gtk-wrap
186 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
187 (home-page "https://www.gnucash.org/")
188 (synopsis "Personal and small business financial accounting software")
190 "GnuCash is personal and professional financial-accounting software.
191 It can be used to track bank accounts, stocks, income and expenses, based on
192 the double-entry accounting practice. It includes support for QIF/OFX/HBCI
193 import and transaction matching. It also automates several tasks, such as
194 financial calculations or scheduled transactions.
196 To make the GnuCash documentation available, its doc output must be
197 installed as well as Yelp, the Gnome help browser.")
198 (license license:gpl3+)))
200 ;; This package is not public, since we use it to build the "doc" output of
201 ;; the gnucash package (see above). It would be confusing if it were public.
203 (let ((revision "")) ;set to the empty string when no revision
205 (name "gnucash-docs")
206 (version (package-version gnucash))
210 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
211 version "/gnucash-docs-" version revision ".tar.gz"))
214 "19v6kchda724xkkgwlw5rg21jcpirhch12j9sr6ibnv61sd4ql52"))))
215 (build-system gnu-build-system)
216 ;; These are native-inputs because they are only required for building the
219 `(("libxml2" ,libxml2)
220 ;; The "check" target needs the docbook xml package for validating the
221 ;; DocBook XML during the tests.
222 ("docbook-xml" ,docbook-xml)
224 ("docbook-xsl" ,docbook-xsl)
225 ("scrollkeeper" ,scrollkeeper)))
226 (home-page "https://www.gnucash.org/")
227 (synopsis "Documentation for GnuCash")
229 "User guide and other documentation for GnuCash in various languages.
230 This package exists because the GnuCash project maintains its documentation in
231 an entirely separate package from the actual GnuCash program. It is intended
232 to be read using the GNOME Yelp program.")
233 (license (list license:fdl1.1+ license:gpl3+)))))
235 (define-public gwenhywfar
238 (version "4.99.25rc9")
242 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
243 "download/223/gwenhywfar-" version ".tar.gz"))
245 (base32 "14ws780zfyv9qg41z42hlk8sh31w80w3v8n5riaslqhvvxqbfgkq"))))
246 (build-system gnu-build-system)
249 (list "--disable-network-checks"
250 ;; GTK+3, GTK+2 and QT4 are supported.
252 (string-append "--with-openssl-includes="
253 (assoc-ref %build-inputs "openssl") "/include")
254 (string-append "--with-openssl-libs="
255 (assoc-ref %build-inputs "openssl") "/lib"))))
257 `(("libgcrypt" ,libgcrypt)
262 `(("pkg-config" ,pkg-config)))
263 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
264 (synopsis "Utility library for networking and security applications")
266 "This package provides a helper library for networking and security
267 applications and libraries. It is used by AqBanking.")
268 ;; The license includes an explicit additional permission to compile and
269 ;; distribute this library with the OpenSSL Toolkit.
270 (license license:lgpl2.1+)))
272 (define-public aqbanking
275 (version "5.99.44beta")
279 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
280 "download/224/aqbanking-" version ".tar.gz"))
282 (base32 "1cgj8g3wy53galp9pk50a85w0kmwfx3dwl93cbvq6sqb9izxmwdb"))))
283 (build-system gnu-build-system)
285 `(;; Parallel building fails because aqhbci is required before it's
287 #:parallel-build? #f))
289 `(("gwenhywfar" ,gwenhywfar)))
295 `(("pkg-config" ,pkg-config)
296 ("gettext-minimal", gettext-minimal)
297 ("libltdl" ,libltdl)))
298 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
299 (synopsis "Interface for online banking tasks")
301 "AqBanking is a modular and generic interface to online banking tasks,
302 financial file formats (import/export) and bank/country/currency information.
303 AqBanking uses backend plugins to actually perform the online tasks. HBCI,
304 OFX DirectConnect, YellowNet, GeldKarte, and DTAUS discs are currently
305 supported. AqBanking is used by GnuCash, KMyMoney, and QBankManager.")
306 ;; AqBanking is licensed under the GPLv2 or GPLv3
307 (license (list license:gpl2 license:gpl3))))