gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / gnucash.scm
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>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
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.
18 ;;;
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.
23 ;;;
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/>.
26
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))
60
61 (define-public gnucash
62 ;; TODO: Unbundle libraries such as guile-json found under the "borrowed/"
63 ;; directory.
64 (package
65 (name "gnucash")
66 (version "4.2")
67 (source
68 (origin
69 (method url-fetch)
70 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
71 version "/gnucash-" version ".tar.bz2"))
72 (sha256
73 (base32
74 "020k1mm909dcgs52ls4v7xx3yn8gqazi9awyr81l6y7pkq1spn2n"))))
75 (build-system cmake-build-system)
76 (inputs
77 `(("guile" ,guile-3.0)
78 ("boost" ,boost)
79 ("icu4c" ,icu4c)
80 ("glib" ,glib)
81 ("gtk" ,gtk+)
82 ("libdbi" ,libdbi)
83 ("libdbi-drivers" ,libdbi-drivers)
84 ("libofx" ,libofx)
85 ("libxml2" ,libxml2)
86 ("libxslt" ,libxslt)
87 ("webkitgtk" ,webkitgtk)
88 ("aqbanking" ,aqbanking)
89 ("python" ,python)
90 ("perl-date-manip" ,perl-date-manip)
91 ("perl-finance-quote" ,perl-finance-quote)
92 ("tzdata" ,tzdata-for-tests)))
93 (native-inputs
94 `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
95 ("intltool" ,intltool)
96 ("googlemock" ,(package-source googletest))
97 ("googletest" ,googletest)
98 ("gnucash-docs" ,gnucash-docs)
99 ("swig" ,swig)
100 ("pkg-config" ,pkg-config)))
101 (propagated-inputs
102 ;; dconf is required at runtime according to README.dependencies.
103 `(("dconf" ,dconf)))
104 (outputs '("out" "doc" "debug" "python"))
105 (arguments
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:)
111 (guix build utils))
112 #:imported-modules (,@%gnu-build-system-modules
113 (guix build cmake-build-system)
114 (guix build glib-or-gtk-build-system))
115 #:phases
116 (modify-phases %standard-phases
117 (add-after 'unpack 'unpack-gmock
118 (lambda* (#:key inputs #:allow-other-keys)
119 (mkdir "gmock")
120 (copy-recursively (assoc-ref inputs "googlemock") "gmock")
121 (setenv "GMOCK_ROOT" (string-append (getcwd) "/gmock/googlemock"))
122 #t))
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.
128 (setenv "TZDIR"
129 (string-append tzdata
130 "/share/zoneinfo"))
131 (substitute* "CMakeLists.txt"
132 (("set\\(SHELL /bin/bash\\)")
133 (string-append "set(SHELL " (which "bash") ")")))
134 #t)))
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
138 (lambda _
139 (substitute* "gnucash/price-quotes.scm"
140 (("\"perl\" \"-w\" ") ""))
141 #t))
142 ;; The qof test requires the en_US, en_GB, and fr_FR locales.
143 (add-before 'check 'install-locales
144 (lambda _
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")
149 #t))
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"))
158 #t)))
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
164 "lib/python"
165 ,(version-major+minor
166 (package-version python)))))
167 (mkdir-p (string-append python-output "/" python-bindings))
168 (copy-recursively
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")
177 "/bin/" prog)
178 `("GNC_DBD_DIR" =
179 (,(string-append
180 (assoc-ref inputs "libdbi-drivers")
181 "/lib/dbd")))
182 `("PERL5LIB" ":" prefix
183 ,(map (lambda (o)
184 (string-append o "/lib/perl5/site_perl/"
185 ,(package-version perl)))
186 (if (string=? prog "gnc-fq-helper")
187 (list
188 ,@(transitive-input-references
189 'inputs
190 (map (lambda (l)
191 (assoc l (package-inputs this-package)))
192 '("perl-finance-quote"
193 "perl-date-manip"))))
194 (list
195 ,@(transitive-input-references
196 'inputs
197 (map (lambda (l)
198 (assoc l (package-inputs this-package)))
199 '("perl-finance-quote")))))))))
200 '("gnucash"
201 "gnc-fq-check"
202 "gnc-fq-helper"
203 "gnc-fq-dump"))))
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")
210 (description
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.
216
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+)))
220
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.
223 (define gnucash-docs
224 (let ((revision "")) ;set to the empty string when no revision
225 (package
226 (name "gnucash-docs")
227 (version (package-version gnucash))
228 (source
229 (origin
230 (method url-fetch)
231 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
232 version "/gnucash-docs-" version revision ".tar.gz"))
233 (sha256
234 (base32
235 "1p1rbv0gyi07nh5pzhk3xm46w66kjyaipb6rpaq9yb9gil1nl7q5"))))
236 (build-system gnu-build-system)
237 ;; These are native-inputs because they are only required for building the
238 ;; documentation.
239 (native-inputs
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)
244 ("libxslt" ,libxslt)
245 ("docbook-xsl" ,docbook-xsl)
246 ("scrollkeeper" ,scrollkeeper)))
247 (home-page "https://www.gnucash.org/")
248 (synopsis "Documentation for GnuCash")
249 (description
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+)))))
255
256 (define-public gwenhywfar
257 (package
258 (name "gwenhywfar")
259 (version "4.99.25rc9")
260 (source
261 (origin
262 (method url-fetch)
263 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
264 "download/223/gwenhywfar-" version ".tar.gz"))
265 (sha256
266 (base32 "14ws780zfyv9qg41z42hlk8sh31w80w3v8n5riaslqhvvxqbfgkq"))))
267 (build-system gnu-build-system)
268 (arguments
269 `(#:configure-flags
270 (list "--disable-network-checks"
271 ;; GTK+3, GTK+2 and QT4 are supported.
272 "--with-guis=gtk3"
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"))))
277 (inputs
278 `(("libgcrypt" ,libgcrypt)
279 ("gnutls" ,gnutls)
280 ("openssl" ,openssl)
281 ("gtk+" ,gtk+)))
282 (native-inputs
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")
286 (description
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+)))
292
293 (define-public aqbanking
294 (package
295 (name "aqbanking")
296 (version "5.99.44beta")
297 (source
298 (origin
299 (method url-fetch)
300 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
301 "download/224/aqbanking-" version ".tar.gz"))
302 (sha256
303 (base32 "1cgj8g3wy53galp9pk50a85w0kmwfx3dwl93cbvq6sqb9izxmwdb"))))
304 (build-system gnu-build-system)
305 (arguments
306 `(;; Parallel building fails because aqhbci is required before it's
307 ;; built.
308 #:parallel-build? #f))
309 (propagated-inputs
310 `(("gwenhywfar" ,gwenhywfar)))
311 (inputs
312 `(("gmp" ,gmp)
313 ("xmlsec" ,xmlsec)
314 ("gnutls" ,gnutls)))
315 (native-inputs
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")
321 (description
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))))