gnu: ansible: Update to 2.8.1.
[jackhill/guix/guix.git] / gnu / packages / gnucash.scm
CommitLineData
e55c1b67 1;;; GNU Guix --- Functional package management for GNU
aef8a9fb 2;;; Copyright © 2015, 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
8b94dffd 3;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
57818b6e 4;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
f3eeca56 5;;; Copyright © 2017 Chris Marusich <cmmarusich@gmail.com>
471ce31c 6;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
ae283c18 7;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
e55c1b67
RW
8;;;
9;;; This file is part of GNU Guix.
10;;;
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.
15;;;
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.
20;;;
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/>.
23
24(define-module (gnu packages gnucash)
c71c8b97 25 #:use-module ((guix licenses) #:prefix license:)
e55c1b67
RW
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
53e66fbc 29 #:use-module (guix build-system cmake)
e55c1b67 30 #:use-module (gnu packages)
445aa137 31 #:use-module (gnu packages autotools)
73ca145a 32 #:use-module (gnu packages base)
53e66fbc
RW
33 #:use-module (gnu packages boost)
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages cmake)
f3eeca56
CM
36 #:use-module (gnu packages docbook)
37 #:use-module (gnu packages documentation)
e55c1b67 38 #:use-module (gnu packages gnome)
5c881f32 39 #:use-module (gnu packages gnupg)
e55c1b67
RW
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages guile)
43 #:use-module (gnu packages icu4c)
445aa137 44 #:use-module (gnu packages multiprecision)
8b94dffd 45 #:use-module (gnu packages perl)
e55c1b67 46 #:use-module (gnu packages pkg-config)
5c881f32 47 #:use-module (gnu packages tls)
8b94dffd 48 #:use-module (gnu packages web)
e55c1b67
RW
49 #:use-module (gnu packages webkit)
50 #:use-module (gnu packages xml))
51
52(define-public gnucash
2a67ea73
MC
53 ;; TODO: Unbundle libraries such as guile-json found under the "borrowed/"
54 ;; directory.
e55c1b67
RW
55 (package
56 (name "gnucash")
d4cb92e7 57 (version "3.5")
e55c1b67
RW
58 (source
59 (origin
20626f62
MC
60 (method url-fetch)
61 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
62 version "/gnucash-" version ".tar.bz2"))
63 (sha256
64 (base32
d4cb92e7 65 "0ibp7g6aknvnkwkin97kv04ipksy3l18dsz9qysjb7h2nr8hnvbp"))))
53e66fbc 66 (build-system cmake-build-system)
e55c1b67 67 (inputs
53e66fbc
RW
68 `(("guile" ,guile-2.2)
69 ("boost" ,boost)
e55c1b67
RW
70 ("icu4c" ,icu4c)
71 ("glib" ,glib)
53e66fbc 72 ("gtk" ,gtk+)
e55c1b67
RW
73 ("libgnomecanvas" ,libgnomecanvas)
74 ("libxml2" ,libxml2)
75 ("libxslt" ,libxslt)
53e66fbc 76 ("webkitgtk" ,webkitgtk)
945939a5 77 ("aqbanking" ,aqbanking)
8b94dffd 78 ("perl-date-manip" ,perl-date-manip)
73ca145a
KK
79 ("perl-finance-quote" ,perl-finance-quote)
80 ("tzdata" ,tzdata-for-tests)))
e55c1b67 81 (native-inputs
20626f62 82 `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
e55c1b67 83 ("intltool" ,intltool)
53e66fbc
RW
84 ("googlemock" ,(package-source googletest))
85 ("googletest" ,googletest)
f3eeca56 86 ("gnucash-docs" ,gnucash-docs)
e55c1b67 87 ("pkg-config" ,pkg-config)))
2a67ea73 88 (outputs '("out" "doc" "debug"))
8b94dffd 89 (arguments
53e66fbc
RW
90 `(#:test-target "check"
91 #:configure-flags
20626f62
MC
92 (list "-DWITH_OFX=OFF" ; libofx is not available yet
93 "-DWITH_SQL=OFF") ; without dbi.h
73ca145a
KK
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:)
97 (guix build utils))
98 #:imported-modules (,@%gnu-build-system-modules
99 (guix build cmake-build-system)
100 (guix build glib-or-gtk-build-system))
8b94dffd
EB
101 #:phases
102 (modify-phases %standard-phases
53e66fbc
RW
103 (add-after 'unpack 'unpack-gmock
104 (lambda* (#:key inputs #:allow-other-keys)
105 (mkdir "gmock")
d5640c58 106 (copy-recursively (assoc-ref inputs "googlemock") "gmock")
53e66fbc
RW
107 (setenv "GMOCK_ROOT" (string-append (getcwd) "/gmock/googlemock"))
108 #t))
73ca145a
KK
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.
114 (setenv "TZDIR"
115 (string-append tzdata
116 "/share/zoneinfo"))
117 (substitute* "CMakeLists.txt"
118 (("set\\(SHELL /bin/bash\\)")
119 (string-append "set(SHELL " (which "bash") ")")))
120 #t)))
7c8ea31a
MC
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
124 (lambda _
125 (substitute* "libgnucash/scm/price-quotes.scm"
126 (("\"perl\" \"-w\" ") ""))
127 #t))
a2e7e956
MC
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
131 (lambda _
132 (substitute* "gnucash/report/standard-reports/test/CMakeLists.txt"
133 (("test-stress-options.scm") ""))
134 #t))
135 ;; The qof test requires the en_US, en_GB, and fr_FR locales.
136 (add-before 'check 'install-locales
137 (lambda _
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")
142 #t))
f3eeca56 143 ;; There are about 100 megabytes of documentation.
20626f62
MC
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"))
151 #t)))
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")
156 "/bin/" prog)
157 `("PERL5LIB" ":" prefix
158 ,(map (lambda (o)
159 (string-append o "/lib/perl5/site_perl/"
160 ,(package-version perl)))
161 (if (string=? prog "gnc-fq-helper")
162 (list
163 ,@(transitive-input-references
164 'inputs
165 (map (lambda (l)
adb6462c 166 (assoc l (package-inputs this-package)))
20626f62
MC
167 '("perl-finance-quote"
168 "perl-date-manip"))))
169 (list
170 ,@(transitive-input-references
171 'inputs
172 (map (lambda (l)
adb6462c 173 (assoc l (package-inputs this-package)))
20626f62
MC
174 '("perl-finance-quote")))))))))
175 '("gnucash"
176 "gnc-fq-check"
177 "gnc-fq-helper"
178 "gnc-fq-dump"))))
73ca145a
KK
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)))))
7c1adf00 183 (home-page "https://www.gnucash.org/")
e55c1b67
RW
184 (synopsis "Personal and small business financial accounting software")
185 (description
186 "GnuCash is personal and professional financial-accounting software.
187It can be used to track bank accounts, stocks, income and expenses, based on
188the double-entry accounting practice. It includes support for QIF/OFX/HBCI
189import and transaction matching. It also automates several tasks, such as
60bfefb6
MC
190financial calculations or scheduled transactions.
191
192To make the GnuCash documentation available, its doc output must be
193installed as well as Yelp, the Gnome help browser.")
c71c8b97 194 (license license:gpl3+)))
5c881f32 195
f3eeca56
CM
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.
198(define gnucash-docs
86d73d59 199 (let ((revision "")) ;set to the empty string when no revision
2a67ea73
MC
200 (package
201 (name "gnucash-docs")
202 (version (package-version gnucash))
203 (source
204 (origin
205 (method url-fetch)
206 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
ae283c18 207 version "/gnucash-docs-" version revision ".tar.gz"))
2a67ea73
MC
208 (sha256
209 (base32
86d73d59 210 "0gjndyms413vilf5nqh39frs1691sxib8l7y9mbvcyirj1f8285k"))))
2a67ea73
MC
211 (build-system gnu-build-system)
212 ;; These are native-inputs because they are only required for building the
213 ;; documentation.
214 (native-inputs
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)
219 ("libxslt" ,libxslt)
220 ("docbook-xsl" ,docbook-xsl)
221 ("scrollkeeper" ,scrollkeeper)))
222 (home-page "https://www.gnucash.org/")
223 (synopsis "Documentation for GnuCash")
224 (description
225 "User guide and other documentation for GnuCash in various languages.
f3eeca56
CM
226This package exists because the GnuCash project maintains its documentation in
227an entirely separate package from the actual GnuCash program. It is intended
228to be read using the GNOME Yelp program.")
2a67ea73 229 (license (list license:fdl1.1+ license:gpl3+)))))
f3eeca56 230
5c881f32
RW
231(define-public gwenhywfar
232 (package
233 (name "gwenhywfar")
aef8a9fb 234 (version "4.20.0")
5c881f32
RW
235 (source
236 (origin
237 (method url-fetch)
aef8a9fb
RW
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"))
5c881f32
RW
241 (file-name (string-append name "-" version ".tar.gz"))
242 (sha256
243 (base32
aef8a9fb 244 "1c0g3f8jk6j693774ifslx2ds4ksabgbbalhhm9gk20kpamxm22s"))))
5c881f32
RW
245 (build-system gnu-build-system)
246 (arguments
247 `(#:configure-flags
248 (list "--disable-network-checks"
aef8a9fb
RW
249 ;; GTK+3, GTK+2 and QT4 are supported.
250 "--with-guis=gtk3"
5c881f32
RW
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"))))
255 (inputs
256 `(("libgcrypt" ,libgcrypt)
257 ("gnutls" ,gnutls)
258 ("openssl" ,openssl)
aef8a9fb 259 ("gtk+" ,gtk+)))
5c881f32
RW
260 (native-inputs
261 `(("pkg-config" ,pkg-config)))
c582ab2a 262 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
5c881f32
RW
263 (synopsis "Utility library for networking and security applications")
264 (description
265 "This package provides a helper library for networking and security
266applications 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+)))
270
445aa137
RW
271(define-public aqbanking
272 (package
273 (name "aqbanking")
2f5ccf27 274 (version "5.7.8")
445aa137
RW
275 (source
276 (origin
277 (method url-fetch)
2f5ccf27
RW
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"))
445aa137
RW
281 (file-name (string-append name "-" version ".tar.gz"))
282 (sha256
283 (base32
2f5ccf27 284 "0s67mysskbiw1h1p0np4ph4351r7wq3nc873vylam7lsqi66xy0n"))))
445aa137
RW
285 (build-system gnu-build-system)
286 (arguments
287 `(;; Parallel building fails because aqhbci is required before it's
288 ;; built.
289 #:parallel-build? #f
290 #:configure-flags
291 (list (string-append "--with-gwen-dir="
292 (assoc-ref %build-inputs "gwenhywfar")))))
293 (propagated-inputs
294 `(("gwenhywfar" ,gwenhywfar)))
295 (inputs
296 `(("gmp" ,gmp)
297 ("xmlsec" ,xmlsec)
298 ("gnutls" ,gnutls)))
299 (native-inputs
300 `(("pkg-config" ,pkg-config)
301 ("libltdl" ,libltdl)))
c582ab2a 302 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
445aa137
RW
303 (synopsis "Interface for online banking tasks")
304 (description
305 "AqBanking is a modular and generic interface to online banking tasks,
306financial file formats (import/export) and bank/country/currency information.
307AqBanking uses backend plugins to actually perform the online tasks. HBCI,
308OFX DirectConnect, YellowNet, GeldKarte, and DTAUS discs are currently
309supported. AqBanking is used by GnuCash, KMyMoney, and QBankManager.")
310 ;; AqBanking is licensed under the GPLv2 or GPLv3
311 (license (list license:gpl2 license:gpl3))))