gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[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>
43412ab9 6;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
ae283c18 7;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
54a80b58 8;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
26ee22f0 9;;; Copyright © 2020 Prafulla Giri <pratheblackdiamond@gmail.com>
6760578c 10;;; Copyright © 2020 Christopher Lam <christopher.lck@gmail.com>
e55c1b67
RW
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)
c71c8b97 28 #:use-module ((guix licenses) #:prefix license:)
26ee22f0 29 #:use-module (guix utils)
e55c1b67
RW
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix build-system gnu)
53e66fbc 33 #:use-module (guix build-system cmake)
e55c1b67 34 #:use-module (gnu packages)
445aa137 35 #:use-module (gnu packages autotools)
73ca145a 36 #:use-module (gnu packages base)
53e66fbc
RW
37 #:use-module (gnu packages boost)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages cmake)
54a80b58 40 #:use-module (gnu packages databases)
f3eeca56
CM
41 #:use-module (gnu packages docbook)
42 #:use-module (gnu packages documentation)
dfb01912 43 #:use-module (gnu packages finance)
219fe54c 44 #:use-module (gnu packages gettext)
e55c1b67 45 #:use-module (gnu packages gnome)
5c881f32 46 #:use-module (gnu packages gnupg)
e55c1b67
RW
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages guile)
50 #:use-module (gnu packages icu4c)
445aa137 51 #:use-module (gnu packages multiprecision)
8b94dffd 52 #:use-module (gnu packages perl)
e55c1b67 53 #:use-module (gnu packages pkg-config)
26ee22f0 54 #:use-module (gnu packages python)
6760578c 55 #:use-module (gnu packages swig)
5c881f32 56 #:use-module (gnu packages tls)
8b94dffd 57 #:use-module (gnu packages web)
e55c1b67
RW
58 #:use-module (gnu packages webkit)
59 #:use-module (gnu packages xml))
60
61(define-public gnucash
2a67ea73
MC
62 ;; TODO: Unbundle libraries such as guile-json found under the "borrowed/"
63 ;; directory.
e55c1b67
RW
64 (package
65 (name "gnucash")
6760578c 66 (version "4.2")
e55c1b67
RW
67 (source
68 (origin
20626f62
MC
69 (method url-fetch)
70 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
6760578c 71 version "/gnucash-" version ".tar.bz2"))
20626f62
MC
72 (sha256
73 (base32
6760578c 74 "020k1mm909dcgs52ls4v7xx3yn8gqazi9awyr81l6y7pkq1spn2n"))))
53e66fbc 75 (build-system cmake-build-system)
e55c1b67 76 (inputs
6760578c 77 `(("guile" ,guile-3.0)
53e66fbc 78 ("boost" ,boost)
e55c1b67
RW
79 ("icu4c" ,icu4c)
80 ("glib" ,glib)
53e66fbc 81 ("gtk" ,gtk+)
54a80b58
GLV
82 ("libdbi" ,libdbi)
83 ("libdbi-drivers" ,libdbi-drivers)
dfb01912 84 ("libofx" ,libofx)
e55c1b67
RW
85 ("libxml2" ,libxml2)
86 ("libxslt" ,libxslt)
53e66fbc 87 ("webkitgtk" ,webkitgtk)
945939a5 88 ("aqbanking" ,aqbanking)
26ee22f0 89 ("python" ,python)
8b94dffd 90 ("perl-date-manip" ,perl-date-manip)
73ca145a
KK
91 ("perl-finance-quote" ,perl-finance-quote)
92 ("tzdata" ,tzdata-for-tests)))
e55c1b67 93 (native-inputs
20626f62 94 `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
e55c1b67 95 ("intltool" ,intltool)
53e66fbc
RW
96 ("googlemock" ,(package-source googletest))
97 ("googletest" ,googletest)
f3eeca56 98 ("gnucash-docs" ,gnucash-docs)
f765b88c 99 ("swig" ,swig)
e55c1b67 100 ("pkg-config" ,pkg-config)))
dfb01912
KK
101 (propagated-inputs
102 ;; dconf is required at runtime according to README.dependencies.
103 `(("dconf" ,dconf)))
26ee22f0 104 (outputs '("out" "doc" "debug" "python"))
8b94dffd 105 (arguments
53e66fbc 106 `(#:test-target "check"
26ee22f0 107 #:configure-flags '("-DWITH_PYTHON=ON")
73ca145a
KK
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))
8b94dffd
EB
115 #:phases
116 (modify-phases %standard-phases
53e66fbc
RW
117 (add-after 'unpack 'unpack-gmock
118 (lambda* (#:key inputs #:allow-other-keys)
119 (mkdir "gmock")
d5640c58 120 (copy-recursively (assoc-ref inputs "googlemock") "gmock")
53e66fbc
RW
121 (setenv "GMOCK_ROOT" (string-append (getcwd) "/gmock/googlemock"))
122 #t))
73ca145a
KK
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)))
7c8ea31a
MC
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 _
6760578c
CL
139 (substitute* "gnucash/price-quotes.scm"
140 (("\"perl\" \"-w\" ") ""))
7c8ea31a 141 #t))
a2e7e956
MC
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))
f3eeca56 150 ;; There are about 100 megabytes of documentation.
20626f62
MC
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)))
26ee22f0
PG
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)))))
20626f62
MC
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)
54a80b58
GLV
178 `("GNC_DBD_DIR" =
179 (,(string-append
180 (assoc-ref inputs "libdbi-drivers")
181 "/lib/dbd")))
20626f62
MC
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)
adb6462c 191 (assoc l (package-inputs this-package)))
20626f62
MC
192 '("perl-finance-quote"
193 "perl-date-manip"))))
194 (list
195 ,@(transitive-input-references
196 'inputs
197 (map (lambda (l)
adb6462c 198 (assoc l (package-inputs this-package)))
20626f62
MC
199 '("perl-finance-quote")))))))))
200 '("gnucash"
201 "gnc-fq-check"
202 "gnc-fq-helper"
203 "gnc-fq-dump"))))
73ca145a
KK
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)))))
7c1adf00 208 (home-page "https://www.gnucash.org/")
e55c1b67
RW
209 (synopsis "Personal and small business financial accounting software")
210 (description
211 "GnuCash is personal and professional financial-accounting software.
212It can be used to track bank accounts, stocks, income and expenses, based on
213the double-entry accounting practice. It includes support for QIF/OFX/HBCI
214import and transaction matching. It also automates several tasks, such as
60bfefb6
MC
215financial calculations or scheduled transactions.
216
217To make the GnuCash documentation available, its doc output must be
218installed as well as Yelp, the Gnome help browser.")
c71c8b97 219 (license license:gpl3+)))
5c881f32 220
f3eeca56
CM
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
86d73d59 224 (let ((revision "")) ;set to the empty string when no revision
2a67ea73
MC
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/"
ae283c18 232 version "/gnucash-docs-" version revision ".tar.gz"))
2a67ea73
MC
233 (sha256
234 (base32
6760578c 235 "1p1rbv0gyi07nh5pzhk3xm46w66kjyaipb6rpaq9yb9gil1nl7q5"))))
2a67ea73
MC
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.
f3eeca56
CM
251This package exists because the GnuCash project maintains its documentation in
252an entirely separate package from the actual GnuCash program. It is intended
253to be read using the GNOME Yelp program.")
2a67ea73 254 (license (list license:fdl1.1+ license:gpl3+)))))
f3eeca56 255
5c881f32
RW
256(define-public gwenhywfar
257 (package
258 (name "gwenhywfar")
c82eab7f 259 (version "4.99.25rc9")
5c881f32
RW
260 (source
261 (origin
262 (method url-fetch)
521bb336 263 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
c82eab7f 264 "download/223/gwenhywfar-" version ".tar.gz"))
5c881f32 265 (sha256
c82eab7f 266 (base32 "14ws780zfyv9qg41z42hlk8sh31w80w3v8n5riaslqhvvxqbfgkq"))))
5c881f32
RW
267 (build-system gnu-build-system)
268 (arguments
269 `(#:configure-flags
270 (list "--disable-network-checks"
aef8a9fb
RW
271 ;; GTK+3, GTK+2 and QT4 are supported.
272 "--with-guis=gtk3"
5c881f32
RW
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)
aef8a9fb 281 ("gtk+" ,gtk+)))
5c881f32
RW
282 (native-inputs
283 `(("pkg-config" ,pkg-config)))
c582ab2a 284 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
5c881f32
RW
285 (synopsis "Utility library for networking and security applications")
286 (description
287 "This package provides a helper library for networking and security
288applications 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
445aa137
RW
293(define-public aqbanking
294 (package
295 (name "aqbanking")
219fe54c 296 (version "5.99.44beta")
445aa137
RW
297 (source
298 (origin
299 (method url-fetch)
43412ab9 300 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
219fe54c 301 "download/224/aqbanking-" version ".tar.gz"))
445aa137 302 (sha256
219fe54c 303 (base32 "1cgj8g3wy53galp9pk50a85w0kmwfx3dwl93cbvq6sqb9izxmwdb"))))
445aa137
RW
304 (build-system gnu-build-system)
305 (arguments
306 `(;; Parallel building fails because aqhbci is required before it's
307 ;; built.
219fe54c 308 #:parallel-build? #f))
445aa137
RW
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)
1628d57b 317 ("gettext-minimal" ,gettext-minimal)
445aa137 318 ("libltdl" ,libltdl)))
c582ab2a 319 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
445aa137
RW
320 (synopsis "Interface for online banking tasks")
321 (description
322 "AqBanking is a modular and generic interface to online banking tasks,
323financial file formats (import/export) and bank/country/currency information.
324AqBanking uses backend plugins to actually perform the online tasks. HBCI,
325OFX DirectConnect, YellowNet, GeldKarte, and DTAUS discs are currently
326supported. AqBanking is used by GnuCash, KMyMoney, and QBankManager.")
327 ;; AqBanking is licensed under the GPLv2 or GPLv3
328 (license (list license:gpl2 license:gpl3))))