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>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages gnucash)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system cmake)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages boost)
33 #:use-module (gnu packages check)
34 #:use-module (gnu packages cmake)
35 #:use-module (gnu packages docbook)
36 #:use-module (gnu packages documentation)
37 #:use-module (gnu packages gnome)
38 #:use-module (gnu packages gnupg)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages guile)
42 #:use-module (gnu packages icu4c)
43 #:use-module (gnu packages multiprecision)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages tls)
47 #:use-module (gnu packages web)
48 #:use-module (gnu packages webkit)
49 #:use-module (gnu packages xml))
51 (define-public gnucash
58 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
59 version "/gnucash-" version ".tar.bz2"))
62 "0grr5qi5rn1xvr7qx5d7mcxa2mcgycy2b325ry73bb485a6yv5l3"))
63 (patches (search-patches "gnucash-price-quotes-perl.patch"
64 "gnucash-disable-failing-tests.patch"
65 "gnucash-fix-test-transaction-failure.patch"))))
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"))
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 (invoke "tar" "xf" (assoc-ref inputs "googlemock")
107 "-C" "gmock" "--strip-components=1")
108 (setenv "GMOCK_ROOT" (string-append (getcwd) "/gmock/googlemock"))
110 (add-after 'unpack 'set-env-vars
111 (lambda* (#:key inputs #:allow-other-keys)
112 (let ((tzdata (assoc-ref inputs "tzdata")))
113 ;; At least one test is time-related and requires this
114 ;; environment variable.
116 (string-append tzdata
118 (substitute* "CMakeLists.txt"
119 (("set\\(SHELL /bin/bash\\)")
120 (string-append "set(SHELL " (which "bash") ")")))
122 ;; There are about 100 megabytes of documentation.
124 'install 'install-docs
125 (lambda* (#:key inputs outputs #:allow-other-keys)
126 (let ((docs (assoc-ref inputs "gnucash-docs"))
127 (doc-output (assoc-ref outputs "doc")))
128 (mkdir-p (string-append doc-output "/share"))
129 (symlink (string-append docs "/share/gnome")
130 (string-append doc-output "/share/gnome"))
133 'install-docs 'wrap-programs
134 (lambda* (#:key inputs outputs #:allow-other-keys)
135 (for-each (lambda (prog)
136 (wrap-program (string-append (assoc-ref outputs "out")
138 `("PERL5LIB" ":" prefix
140 (string-append o "/lib/perl5/site_perl/"
141 ,(package-version perl)))
142 (if (string=? prog "gnc-fq-helper")
144 ,@(transitive-input-references
148 '("perl-finance-quote"
149 "perl-date-manip"))))
151 ,@(transitive-input-references
155 '("perl-finance-quote")))))))))
160 (add-after 'install 'glib-or-gtk-compile-schemas
161 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
162 (add-after 'install 'glib-or-gtk-wrap
163 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
164 (home-page "https://www.gnucash.org/")
165 (synopsis "Personal and small business financial accounting software")
167 "GnuCash is personal and professional financial-accounting software.
168 It can be used to track bank accounts, stocks, income and expenses, based on
169 the double-entry accounting practice. It includes support for QIF/OFX/HBCI
170 import and transaction matching. It also automates several tasks, such as
171 financial calculations or scheduled transactions.")
172 (license license:gpl3+)))
174 ;; This package is not public, since we use it to build the "doc" output of
175 ;; the gnucash package (see above). It would be confusing if it were public.
178 (name "gnucash-docs")
179 (version (package-version gnucash))
183 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
184 version "/gnucash-docs-" version ".tar.gz"))
187 "10v4hw4lh888r8yv473pqrvzfjg8dwamk62sghs93rn88ndwm16c"))))
188 (build-system gnu-build-system)
189 ;; These are native-inputs because they are only required for building the
192 `(("libxml2" ,libxml2)
193 ;; The "check" target needs the docbook xml packages for validating the
194 ;; DocBook XML during the tests.
195 ("docbook-xml-4.4" ,docbook-xml-4.4)
196 ("docbook-xml-4.2" ,docbook-xml-4.2)
197 ("docbook-xml-4.1.2" ,docbook-xml-4.1.2)
199 ("docbook-xsl" ,docbook-xsl)
200 ("scrollkeeper" ,scrollkeeper)))
201 (home-page "https://www.gnucash.org/")
202 (synopsis "Documentation for GnuCash")
204 "User guide and other documentation for GnuCash in various languages.
205 This package exists because the GnuCash project maintains its documentation in
206 an entirely separate package from the actual GnuCash program. It is intended
207 to be read using the GNOME Yelp program.")
208 (license (list license:fdl1.1+ license:gpl3+))))
210 (define-public gwenhywfar
217 (uri (string-append "https://www.aquamaniac.de/sites/download/"
218 "download.php?package=01&release=208&file=02&"
219 "dummy=gwenhywfar-" version ".tar.gz"))
220 (file-name (string-append name "-" version ".tar.gz"))
223 "1c0g3f8jk6j693774ifslx2ds4ksabgbbalhhm9gk20kpamxm22s"))))
224 (build-system gnu-build-system)
227 (list "--disable-network-checks"
228 ;; GTK+3, GTK+2 and QT4 are supported.
230 (string-append "--with-openssl-includes="
231 (assoc-ref %build-inputs "openssl") "/include")
232 (string-append "--with-openssl-libs="
233 (assoc-ref %build-inputs "openssl") "/lib"))))
235 `(("libgcrypt" ,libgcrypt)
240 `(("pkg-config" ,pkg-config)))
241 (home-page "http://www.aquamaniac.de/sites/aqbanking/index.php")
242 (synopsis "Utility library for networking and security applications")
244 "This package provides a helper library for networking and security
245 applications and libraries. It is used by AqBanking.")
246 ;; The license includes an explicit additional permission to compile and
247 ;; distribute this library with the OpenSSL Toolkit.
248 (license license:lgpl2.1+)))
250 (define-public aqbanking
257 (uri (string-append "https://www.aquamaniac.de/sites/download/"
258 "download.php?package=03&release=217&file=02&"
259 "dummy=aqbanking-" version ".tar.gz"))
260 (file-name (string-append name "-" version ".tar.gz"))
263 "0s67mysskbiw1h1p0np4ph4351r7wq3nc873vylam7lsqi66xy0n"))))
264 (build-system gnu-build-system)
266 `(;; Parallel building fails because aqhbci is required before it's
270 (list (string-append "--with-gwen-dir="
271 (assoc-ref %build-inputs "gwenhywfar")))))
273 `(("gwenhywfar" ,gwenhywfar)))
279 `(("pkg-config" ,pkg-config)
280 ("libltdl" ,libltdl)))
281 (home-page "http://www.aquamaniac.de/sites/aqbanking/index.php")
282 (synopsis "Interface for online banking tasks")
284 "AqBanking is a modular and generic interface to online banking tasks,
285 financial file formats (import/export) and bank/country/currency information.
286 AqBanking uses backend plugins to actually perform the online tasks. HBCI,
287 OFX DirectConnect, YellowNet, GeldKarte, and DTAUS discs are currently
288 supported. AqBanking is used by GnuCash, KMyMoney, and QBankManager.")
289 ;; AqBanking is licensed under the GPLv2 or GPLv3
290 (license (list license:gpl2 license:gpl3))))