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 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages gnucash)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system cmake)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages boost)
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages cmake)
36 #:use-module (gnu packages docbook)
37 #:use-module (gnu packages documentation)
38 #:use-module (gnu packages gnome)
39 #:use-module (gnu packages gnupg)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages guile)
43 #:use-module (gnu packages icu4c)
44 #:use-module (gnu packages multiprecision)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages tls)
48 #:use-module (gnu packages web)
49 #:use-module (gnu packages webkit)
50 #:use-module (gnu packages xml))
52 (define-public gnucash
53 ;; TODO: Unbundle libraries such as guile-json found under the "borrowed/"
61 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
62 version "/gnucash-" version ".tar.bz2"))
65 "0ibp7g6aknvnkwkin97kv04ipksy3l18dsz9qysjb7h2nr8hnvbp"))))
66 (build-system cmake-build-system)
68 `(("guile" ,guile-2.2)
73 ("libgnomecanvas" ,libgnomecanvas)
76 ("webkitgtk" ,webkitgtk)
77 ("aqbanking" ,aqbanking)
78 ("perl-date-manip" ,perl-date-manip)
79 ("perl-finance-quote" ,perl-finance-quote)
80 ("tzdata" ,tzdata-for-tests)))
82 `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
83 ("intltool" ,intltool)
84 ("googlemock" ,(package-source googletest))
85 ("googletest" ,googletest)
86 ("gnucash-docs" ,gnucash-docs)
87 ("pkg-config" ,pkg-config)))
88 (outputs '("out" "doc" "debug"))
90 `(#:test-target "check"
92 (list "-DWITH_OFX=OFF" ; libofx is not available yet
93 "-DWITH_SQL=OFF") ; without dbi.h
94 #:make-flags '("GUILE_AUTO_COMPILE=0")
95 #:modules ((guix build cmake-build-system)
96 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
98 #:imported-modules (,@%gnu-build-system-modules
99 (guix build cmake-build-system)
100 (guix build glib-or-gtk-build-system))
102 (modify-phases %standard-phases
103 (add-after 'unpack 'unpack-gmock
104 (lambda* (#:key inputs #:allow-other-keys)
106 (copy-recursively (assoc-ref inputs "googlemock") "gmock")
107 (setenv "GMOCK_ROOT" (string-append (getcwd) "/gmock/googlemock"))
109 (add-after 'unpack 'set-env-vars
110 (lambda* (#:key inputs #:allow-other-keys)
111 (let ((tzdata (assoc-ref inputs "tzdata")))
112 ;; At least one test is time-related and requires this
113 ;; environment variable.
115 (string-append tzdata
117 (substitute* "CMakeLists.txt"
118 (("set\\(SHELL /bin/bash\\)")
119 (string-append "set(SHELL " (which "bash") ")")))
121 ;; After wrapping gnc-fq-check and gnc-fq-helper we can no longer
122 ;; execute them with perl, so execute them directly instead.
123 (add-after 'unpack 'fix-finance-quote-check
125 (substitute* "libgnucash/scm/price-quotes.scm"
126 (("\"perl\" \"-w\" ") ""))
128 ;; The test-stress-options unit test is known to fail, so we disable
129 ;; it (see: https://bugs.gnucash.org/show_bug.cgi?id=796877).
130 (add-after 'unpack 'disable-stress-options-test
132 (substitute* "gnucash/report/standard-reports/test/CMakeLists.txt"
133 (("test-stress-options.scm") ""))
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")
157 `("PERL5LIB" ":" prefix
159 (string-append o "/lib/perl5/site_perl/"
160 ,(package-version perl)))
161 (if (string=? prog "gnc-fq-helper")
163 ,@(transitive-input-references
166 (assoc l (package-inputs this-package)))
167 '("perl-finance-quote"
168 "perl-date-manip"))))
170 ,@(transitive-input-references
173 (assoc l (package-inputs this-package)))
174 '("perl-finance-quote")))))))))
179 (add-after 'install 'glib-or-gtk-compile-schemas
180 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
181 (add-after 'install 'glib-or-gtk-wrap
182 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
183 (home-page "https://www.gnucash.org/")
184 (synopsis "Personal and small business financial accounting software")
186 "GnuCash is personal and professional financial-accounting software.
187 It can be used to track bank accounts, stocks, income and expenses, based on
188 the double-entry accounting practice. It includes support for QIF/OFX/HBCI
189 import and transaction matching. It also automates several tasks, such as
190 financial calculations or scheduled transactions.
192 To make the GnuCash documentation available, its doc output must be
193 installed as well as Yelp, the Gnome help browser.")
194 (license license:gpl3+)))
196 ;; This package is not public, since we use it to build the "doc" output of
197 ;; the gnucash package (see above). It would be confusing if it were public.
199 (let ((revision "")) ;set to the empty string when no revision
201 (name "gnucash-docs")
202 (version (package-version gnucash))
206 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
207 version "/gnucash-docs-" version revision ".tar.gz"))
210 "0gjndyms413vilf5nqh39frs1691sxib8l7y9mbvcyirj1f8285k"))))
211 (build-system gnu-build-system)
212 ;; These are native-inputs because they are only required for building the
215 `(("libxml2" ,libxml2)
216 ;; The "check" target needs the docbook xml package for validating the
217 ;; DocBook XML during the tests.
218 ("docbook-xml" ,docbook-xml)
220 ("docbook-xsl" ,docbook-xsl)
221 ("scrollkeeper" ,scrollkeeper)))
222 (home-page "https://www.gnucash.org/")
223 (synopsis "Documentation for GnuCash")
225 "User guide and other documentation for GnuCash in various languages.
226 This package exists because the GnuCash project maintains its documentation in
227 an entirely separate package from the actual GnuCash program. It is intended
228 to be read using the GNOME Yelp program.")
229 (license (list license:fdl1.1+ license:gpl3+)))))
231 (define-public gwenhywfar
238 (uri (string-append "https://www.aquamaniac.de/sites/download/"
239 "download.php?package=01&release=208&file=02&"
240 "dummy=gwenhywfar-" version ".tar.gz"))
241 (file-name (string-append name "-" version ".tar.gz"))
244 "1c0g3f8jk6j693774ifslx2ds4ksabgbbalhhm9gk20kpamxm22s"))))
245 (build-system gnu-build-system)
248 (list "--disable-network-checks"
249 ;; GTK+3, GTK+2 and QT4 are supported.
251 (string-append "--with-openssl-includes="
252 (assoc-ref %build-inputs "openssl") "/include")
253 (string-append "--with-openssl-libs="
254 (assoc-ref %build-inputs "openssl") "/lib"))))
256 `(("libgcrypt" ,libgcrypt)
261 `(("pkg-config" ,pkg-config)))
262 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
263 (synopsis "Utility library for networking and security applications")
265 "This package provides a helper library for networking and security
266 applications and libraries. It is used by AqBanking.")
267 ;; The license includes an explicit additional permission to compile and
268 ;; distribute this library with the OpenSSL Toolkit.
269 (license license:lgpl2.1+)))
271 (define-public aqbanking
278 (uri (string-append "https://www.aquamaniac.de/sites/download/"
279 "download.php?package=03&release=217&file=02&"
280 "dummy=aqbanking-" version ".tar.gz"))
281 (file-name (string-append name "-" version ".tar.gz"))
284 "0s67mysskbiw1h1p0np4ph4351r7wq3nc873vylam7lsqi66xy0n"))))
285 (build-system gnu-build-system)
287 `(;; Parallel building fails because aqhbci is required before it's
291 (list (string-append "--with-gwen-dir="
292 (assoc-ref %build-inputs "gwenhywfar")))))
294 `(("gwenhywfar" ,gwenhywfar)))
300 `(("pkg-config" ,pkg-config)
301 ("libltdl" ,libltdl)))
302 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
303 (synopsis "Interface for online banking tasks")
305 "AqBanking is a modular and generic interface to online banking tasks,
306 financial file formats (import/export) and bank/country/currency information.
307 AqBanking uses backend plugins to actually perform the online tasks. HBCI,
308 OFX DirectConnect, YellowNet, GeldKarte, and DTAUS discs are currently
309 supported. AqBanking is used by GnuCash, KMyMoney, and QBankManager.")
310 ;; AqBanking is licensed under the GPLv2 or GPLv3
311 (license (list license:gpl2 license:gpl3))))