gnu: r-fields: Update to 11.4.
[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 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages gnucash)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system cmake)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages base)
34 #:use-module (gnu packages boost)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages cmake)
37 #:use-module (gnu packages databases)
38 #:use-module (gnu packages docbook)
39 #:use-module (gnu packages documentation)
40 #:use-module (gnu packages finance)
41 #:use-module (gnu packages gettext)
42 #:use-module (gnu packages gnome)
43 #:use-module (gnu packages gnupg)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gtk)
46 #:use-module (gnu packages guile)
47 #:use-module (gnu packages icu4c)
48 #:use-module (gnu packages multiprecision)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages tls)
52 #:use-module (gnu packages web)
53 #:use-module (gnu packages webkit)
54 #:use-module (gnu packages xml))
55
56 (define-public gnucash
57 ;; TODO: Unbundle libraries such as guile-json found under the "borrowed/"
58 ;; directory.
59 (package
60 (name "gnucash")
61 (version "3.8")
62 (source
63 (origin
64 (method url-fetch)
65 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
66 version "/gnucash-" version "b" ".tar.bz2"))
67 (sha256
68 (base32
69 "0dvzm3bib7jcj685sklpzyy9mrak9mxyvih2k9fk4sl3v21wlphg"))))
70 (build-system cmake-build-system)
71 (inputs
72 `(("guile" ,guile-2.2)
73 ("boost" ,boost)
74 ("icu4c" ,icu4c)
75 ("glib" ,glib)
76 ("gtk" ,gtk+)
77 ("libdbi" ,libdbi)
78 ("libdbi-drivers" ,libdbi-drivers)
79 ("libgnomecanvas" ,libgnomecanvas)
80 ("libofx" ,libofx)
81 ("libxml2" ,libxml2)
82 ("libxslt" ,libxslt)
83 ("webkitgtk" ,webkitgtk)
84 ("aqbanking" ,aqbanking)
85 ("perl-date-manip" ,perl-date-manip)
86 ("perl-finance-quote" ,perl-finance-quote)
87 ("tzdata" ,tzdata-for-tests)))
88 (native-inputs
89 `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
90 ("intltool" ,intltool)
91 ("googlemock" ,(package-source googletest))
92 ("googletest" ,googletest)
93 ("gnucash-docs" ,gnucash-docs)
94 ("pkg-config" ,pkg-config)))
95 (propagated-inputs
96 ;; dconf is required at runtime according to README.dependencies.
97 `(("dconf" ,dconf)))
98 (outputs '("out" "doc" "debug"))
99 (arguments
100 `(#:test-target "check"
101 #:make-flags '("GUILE_AUTO_COMPILE=0")
102 #:modules ((guix build cmake-build-system)
103 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
104 (guix build utils))
105 #:imported-modules (,@%gnu-build-system-modules
106 (guix build cmake-build-system)
107 (guix build glib-or-gtk-build-system))
108 #:phases
109 (modify-phases %standard-phases
110 (add-after 'unpack 'unpack-gmock
111 (lambda* (#:key inputs #:allow-other-keys)
112 (mkdir "gmock")
113 (copy-recursively (assoc-ref inputs "googlemock") "gmock")
114 (setenv "GMOCK_ROOT" (string-append (getcwd) "/gmock/googlemock"))
115 #t))
116 (add-after 'unpack 'set-env-vars
117 (lambda* (#:key inputs #:allow-other-keys)
118 (let ((tzdata (assoc-ref inputs "tzdata")))
119 ;; At least one test is time-related and requires this
120 ;; environment variable.
121 (setenv "TZDIR"
122 (string-append tzdata
123 "/share/zoneinfo"))
124 (substitute* "CMakeLists.txt"
125 (("set\\(SHELL /bin/bash\\)")
126 (string-append "set(SHELL " (which "bash") ")")))
127 #t)))
128 ;; After wrapping gnc-fq-check and gnc-fq-helper we can no longer
129 ;; execute them with perl, so execute them directly instead.
130 (add-after 'unpack 'fix-finance-quote-check
131 (lambda _
132 (substitute* "libgnucash/scm/price-quotes.scm"
133 (("\"perl\" \"-w\" ") ""))
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))
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"))
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 `("GNC_DBD_DIR" =
158 (,(string-append
159 (assoc-ref inputs "libdbi-drivers")
160 "/lib/dbd")))
161 `("PERL5LIB" ":" prefix
162 ,(map (lambda (o)
163 (string-append o "/lib/perl5/site_perl/"
164 ,(package-version perl)))
165 (if (string=? prog "gnc-fq-helper")
166 (list
167 ,@(transitive-input-references
168 'inputs
169 (map (lambda (l)
170 (assoc l (package-inputs this-package)))
171 '("perl-finance-quote"
172 "perl-date-manip"))))
173 (list
174 ,@(transitive-input-references
175 'inputs
176 (map (lambda (l)
177 (assoc l (package-inputs this-package)))
178 '("perl-finance-quote")))))))))
179 '("gnucash"
180 "gnc-fq-check"
181 "gnc-fq-helper"
182 "gnc-fq-dump"))))
183 (add-after 'install 'glib-or-gtk-compile-schemas
184 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
185 (add-after 'install 'glib-or-gtk-wrap
186 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
187 (home-page "https://www.gnucash.org/")
188 (synopsis "Personal and small business financial accounting software")
189 (description
190 "GnuCash is personal and professional financial-accounting software.
191 It can be used to track bank accounts, stocks, income and expenses, based on
192 the double-entry accounting practice. It includes support for QIF/OFX/HBCI
193 import and transaction matching. It also automates several tasks, such as
194 financial calculations or scheduled transactions.
195
196 To make the GnuCash documentation available, its doc output must be
197 installed as well as Yelp, the Gnome help browser.")
198 (license license:gpl3+)))
199
200 ;; This package is not public, since we use it to build the "doc" output of
201 ;; the gnucash package (see above). It would be confusing if it were public.
202 (define gnucash-docs
203 (let ((revision "")) ;set to the empty string when no revision
204 (package
205 (name "gnucash-docs")
206 (version (package-version gnucash))
207 (source
208 (origin
209 (method url-fetch)
210 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
211 version "/gnucash-docs-" version revision ".tar.gz"))
212 (sha256
213 (base32
214 "19v6kchda724xkkgwlw5rg21jcpirhch12j9sr6ibnv61sd4ql52"))))
215 (build-system gnu-build-system)
216 ;; These are native-inputs because they are only required for building the
217 ;; documentation.
218 (native-inputs
219 `(("libxml2" ,libxml2)
220 ;; The "check" target needs the docbook xml package for validating the
221 ;; DocBook XML during the tests.
222 ("docbook-xml" ,docbook-xml)
223 ("libxslt" ,libxslt)
224 ("docbook-xsl" ,docbook-xsl)
225 ("scrollkeeper" ,scrollkeeper)))
226 (home-page "https://www.gnucash.org/")
227 (synopsis "Documentation for GnuCash")
228 (description
229 "User guide and other documentation for GnuCash in various languages.
230 This package exists because the GnuCash project maintains its documentation in
231 an entirely separate package from the actual GnuCash program. It is intended
232 to be read using the GNOME Yelp program.")
233 (license (list license:fdl1.1+ license:gpl3+)))))
234
235 (define-public gwenhywfar
236 (package
237 (name "gwenhywfar")
238 (version "4.99.25rc9")
239 (source
240 (origin
241 (method url-fetch)
242 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
243 "download/223/gwenhywfar-" version ".tar.gz"))
244 (sha256
245 (base32 "14ws780zfyv9qg41z42hlk8sh31w80w3v8n5riaslqhvvxqbfgkq"))))
246 (build-system gnu-build-system)
247 (arguments
248 `(#:configure-flags
249 (list "--disable-network-checks"
250 ;; GTK+3, GTK+2 and QT4 are supported.
251 "--with-guis=gtk3"
252 (string-append "--with-openssl-includes="
253 (assoc-ref %build-inputs "openssl") "/include")
254 (string-append "--with-openssl-libs="
255 (assoc-ref %build-inputs "openssl") "/lib"))))
256 (inputs
257 `(("libgcrypt" ,libgcrypt)
258 ("gnutls" ,gnutls)
259 ("openssl" ,openssl)
260 ("gtk+" ,gtk+)))
261 (native-inputs
262 `(("pkg-config" ,pkg-config)))
263 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
264 (synopsis "Utility library for networking and security applications")
265 (description
266 "This package provides a helper library for networking and security
267 applications and libraries. It is used by AqBanking.")
268 ;; The license includes an explicit additional permission to compile and
269 ;; distribute this library with the OpenSSL Toolkit.
270 (license license:lgpl2.1+)))
271
272 (define-public aqbanking
273 (package
274 (name "aqbanking")
275 (version "5.99.44beta")
276 (source
277 (origin
278 (method url-fetch)
279 (uri (string-append "https://www.aquamaniac.de/rdm/attachments/"
280 "download/224/aqbanking-" version ".tar.gz"))
281 (sha256
282 (base32 "1cgj8g3wy53galp9pk50a85w0kmwfx3dwl93cbvq6sqb9izxmwdb"))))
283 (build-system gnu-build-system)
284 (arguments
285 `(;; Parallel building fails because aqhbci is required before it's
286 ;; built.
287 #:parallel-build? #f))
288 (propagated-inputs
289 `(("gwenhywfar" ,gwenhywfar)))
290 (inputs
291 `(("gmp" ,gmp)
292 ("xmlsec" ,xmlsec)
293 ("gnutls" ,gnutls)))
294 (native-inputs
295 `(("pkg-config" ,pkg-config)
296 ("gettext-minimal", gettext-minimal)
297 ("libltdl" ,libltdl)))
298 (home-page "https://www.aquamaniac.de/sites/aqbanking/index.php")
299 (synopsis "Interface for online banking tasks")
300 (description
301 "AqBanking is a modular and generic interface to online banking tasks,
302 financial file formats (import/export) and bank/country/currency information.
303 AqBanking uses backend plugins to actually perform the online tasks. HBCI,
304 OFX DirectConnect, YellowNet, GeldKarte, and DTAUS discs are currently
305 supported. AqBanking is used by GnuCash, KMyMoney, and QBankManager.")
306 ;; AqBanking is licensed under the GPLv2 or GPLv3
307 (license (list license:gpl2 license:gpl3))))