gnu: nnn: Don't use NAME in source URI.
[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")
2a67ea73 57 (version "3.4")
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
2a67ea73 65 "1ms2wg4sh5gq3rpjmmnp85rh5nc9ahca1imxkvhz4d3yiwy8hm52"))
a2e7e956 66 (patches (search-patches "gnucash-fix-test-transaction-failure.patch"))))
53e66fbc 67 (build-system cmake-build-system)
e55c1b67 68 (inputs
53e66fbc
RW
69 `(("guile" ,guile-2.2)
70 ("boost" ,boost)
e55c1b67
RW
71 ("icu4c" ,icu4c)
72 ("glib" ,glib)
53e66fbc 73 ("gtk" ,gtk+)
e55c1b67
RW
74 ("libgnomecanvas" ,libgnomecanvas)
75 ("libxml2" ,libxml2)
76 ("libxslt" ,libxslt)
53e66fbc 77 ("webkitgtk" ,webkitgtk)
945939a5 78 ("aqbanking" ,aqbanking)
8b94dffd 79 ("perl-date-manip" ,perl-date-manip)
73ca145a
KK
80 ("perl-finance-quote" ,perl-finance-quote)
81 ("tzdata" ,tzdata-for-tests)))
e55c1b67 82 (native-inputs
20626f62 83 `(("glib" ,glib "bin") ; glib-compile-schemas, etc.
e55c1b67 84 ("intltool" ,intltool)
53e66fbc
RW
85 ("googlemock" ,(package-source googletest))
86 ("googletest" ,googletest)
f3eeca56 87 ("gnucash-docs" ,gnucash-docs)
e55c1b67 88 ("pkg-config" ,pkg-config)))
2a67ea73 89 (outputs '("out" "doc" "debug"))
8b94dffd 90 (arguments
53e66fbc
RW
91 `(#:test-target "check"
92 #:configure-flags
20626f62
MC
93 (list "-DWITH_OFX=OFF" ; libofx is not available yet
94 "-DWITH_SQL=OFF") ; without dbi.h
73ca145a
KK
95 #:make-flags '("GUILE_AUTO_COMPILE=0")
96 #:modules ((guix build cmake-build-system)
97 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
98 (guix build utils))
99 #:imported-modules (,@%gnu-build-system-modules
100 (guix build cmake-build-system)
101 (guix build glib-or-gtk-build-system))
8b94dffd
EB
102 #:phases
103 (modify-phases %standard-phases
53e66fbc
RW
104 (add-after 'unpack 'unpack-gmock
105 (lambda* (#:key inputs #:allow-other-keys)
106 (mkdir "gmock")
107 (invoke "tar" "xf" (assoc-ref inputs "googlemock")
108 "-C" "gmock" "--strip-components=1")
109 (setenv "GMOCK_ROOT" (string-append (getcwd) "/gmock/googlemock"))
110 #t))
73ca145a
KK
111 (add-after 'unpack 'set-env-vars
112 (lambda* (#:key inputs #:allow-other-keys)
113 (let ((tzdata (assoc-ref inputs "tzdata")))
114 ;; At least one test is time-related and requires this
115 ;; environment variable.
116 (setenv "TZDIR"
117 (string-append tzdata
118 "/share/zoneinfo"))
119 (substitute* "CMakeLists.txt"
120 (("set\\(SHELL /bin/bash\\)")
121 (string-append "set(SHELL " (which "bash") ")")))
122 #t)))
7c8ea31a
MC
123 ;; After wrapping gnc-fq-check and gnc-fq-helper we can no longer
124 ;; execute them with perl, so execute them directly instead.
125 (add-after 'unpack 'fix-finance-quote-check
126 (lambda _
127 (substitute* "libgnucash/scm/price-quotes.scm"
128 (("\"perl\" \"-w\" ") ""))
129 #t))
a2e7e956
MC
130 ;; The test-stress-options unit test is known to fail, so we disable
131 ;; it (see: https://bugs.gnucash.org/show_bug.cgi?id=796877).
132 (add-after 'unpack 'disable-stress-options-test
133 (lambda _
134 (substitute* "gnucash/report/standard-reports/test/CMakeLists.txt"
135 (("test-stress-options.scm") ""))
136 #t))
137 ;; The qof test requires the en_US, en_GB, and fr_FR locales.
138 (add-before 'check 'install-locales
139 (lambda _
140 (setenv "LOCPATH" (getcwd))
141 (invoke "localedef" "-i" "en_US" "-f" "UTF-8" "./en_US.UTF-8")
142 (invoke "localedef" "-i" "en_GB" "-f" "UTF-8" "./en_GB.UTF-8")
143 (invoke "localedef" "-i" "fr_FR" "-f" "UTF-8" "./fr_FR.UTF-8")
144 #t))
f3eeca56 145 ;; There are about 100 megabytes of documentation.
20626f62
MC
146 (add-after 'install 'install-docs
147 (lambda* (#:key inputs outputs #:allow-other-keys)
148 (let ((docs (assoc-ref inputs "gnucash-docs"))
149 (doc-output (assoc-ref outputs "doc")))
150 (mkdir-p (string-append doc-output "/share"))
151 (symlink (string-append docs "/share/gnome")
152 (string-append doc-output "/share/gnome"))
153 #t)))
154 (add-after 'install-docs 'wrap-programs
155 (lambda* (#:key inputs outputs #:allow-other-keys)
156 (for-each (lambda (prog)
157 (wrap-program (string-append (assoc-ref outputs "out")
158 "/bin/" prog)
159 `("PERL5LIB" ":" prefix
160 ,(map (lambda (o)
161 (string-append o "/lib/perl5/site_perl/"
162 ,(package-version perl)))
163 (if (string=? prog "gnc-fq-helper")
164 (list
165 ,@(transitive-input-references
166 'inputs
167 (map (lambda (l)
168 (assoc l (inputs)))
169 '("perl-finance-quote"
170 "perl-date-manip"))))
171 (list
172 ,@(transitive-input-references
173 'inputs
174 (map (lambda (l)
175 (assoc l (inputs)))
176 '("perl-finance-quote")))))))))
177 '("gnucash"
178 "gnc-fq-check"
179 "gnc-fq-helper"
180 "gnc-fq-dump"))))
73ca145a
KK
181 (add-after 'install 'glib-or-gtk-compile-schemas
182 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
183 (add-after 'install 'glib-or-gtk-wrap
184 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
7c1adf00 185 (home-page "https://www.gnucash.org/")
e55c1b67
RW
186 (synopsis "Personal and small business financial accounting software")
187 (description
188 "GnuCash is personal and professional financial-accounting software.
189It can be used to track bank accounts, stocks, income and expenses, based on
190the double-entry accounting practice. It includes support for QIF/OFX/HBCI
191import and transaction matching. It also automates several tasks, such as
60bfefb6
MC
192financial calculations or scheduled transactions.
193
194To make the GnuCash documentation available, its doc output must be
195installed as well as Yelp, the Gnome help browser.")
c71c8b97 196 (license license:gpl3+)))
5c881f32 197
f3eeca56
CM
198;; This package is not public, since we use it to build the "doc" output of
199;; the gnucash package (see above). It would be confusing if it were public.
200(define gnucash-docs
ae283c18 201 (let ((revision "a")) ;set to the empty string when no revision
2a67ea73
MC
202 (package
203 (name "gnucash-docs")
204 (version (package-version gnucash))
205 (source
206 (origin
207 (method url-fetch)
208 (uri (string-append "mirror://sourceforge/gnucash/gnucash%20%28stable%29/"
ae283c18 209 version "/gnucash-docs-" version revision ".tar.gz"))
2a67ea73
MC
210 (sha256
211 (base32
212 "0bgjxpxgk7hy8ihn1kvd8p6vv191q5md2hz6jb9mqc4aykpvdlq7"))))
213 (build-system gnu-build-system)
214 ;; These are native-inputs because they are only required for building the
215 ;; documentation.
216 (native-inputs
217 `(("libxml2" ,libxml2)
218 ;; The "check" target needs the docbook xml package for validating the
219 ;; DocBook XML during the tests.
220 ("docbook-xml" ,docbook-xml)
221 ("libxslt" ,libxslt)
222 ("docbook-xsl" ,docbook-xsl)
223 ("scrollkeeper" ,scrollkeeper)))
224 (home-page "https://www.gnucash.org/")
225 (synopsis "Documentation for GnuCash")
226 (description
227 "User guide and other documentation for GnuCash in various languages.
f3eeca56
CM
228This package exists because the GnuCash project maintains its documentation in
229an entirely separate package from the actual GnuCash program. It is intended
230to be read using the GNOME Yelp program.")
2a67ea73 231 (license (list license:fdl1.1+ license:gpl3+)))))
f3eeca56 232
5c881f32
RW
233(define-public gwenhywfar
234 (package
235 (name "gwenhywfar")
aef8a9fb 236 (version "4.20.0")
5c881f32
RW
237 (source
238 (origin
239 (method url-fetch)
aef8a9fb
RW
240 (uri (string-append "https://www.aquamaniac.de/sites/download/"
241 "download.php?package=01&release=208&file=02&"
242 "dummy=gwenhywfar-" version ".tar.gz"))
5c881f32
RW
243 (file-name (string-append name "-" version ".tar.gz"))
244 (sha256
245 (base32
aef8a9fb 246 "1c0g3f8jk6j693774ifslx2ds4ksabgbbalhhm9gk20kpamxm22s"))))
5c881f32
RW
247 (build-system gnu-build-system)
248 (arguments
249 `(#:configure-flags
250 (list "--disable-network-checks"
aef8a9fb
RW
251 ;; GTK+3, GTK+2 and QT4 are supported.
252 "--with-guis=gtk3"
5c881f32
RW
253 (string-append "--with-openssl-includes="
254 (assoc-ref %build-inputs "openssl") "/include")
255 (string-append "--with-openssl-libs="
256 (assoc-ref %build-inputs "openssl") "/lib"))))
257 (inputs
258 `(("libgcrypt" ,libgcrypt)
259 ("gnutls" ,gnutls)
260 ("openssl" ,openssl)
aef8a9fb 261 ("gtk+" ,gtk+)))
5c881f32
RW
262 (native-inputs
263 `(("pkg-config" ,pkg-config)))
264 (home-page "http://www.aquamaniac.de/sites/aqbanking/index.php")
265 (synopsis "Utility library for networking and security applications")
266 (description
267 "This package provides a helper library for networking and security
268applications and libraries. It is used by AqBanking.")
269 ;; The license includes an explicit additional permission to compile and
270 ;; distribute this library with the OpenSSL Toolkit.
271 (license license:lgpl2.1+)))
272
445aa137
RW
273(define-public aqbanking
274 (package
275 (name "aqbanking")
2f5ccf27 276 (version "5.7.8")
445aa137
RW
277 (source
278 (origin
279 (method url-fetch)
2f5ccf27
RW
280 (uri (string-append "https://www.aquamaniac.de/sites/download/"
281 "download.php?package=03&release=217&file=02&"
282 "dummy=aqbanking-" version ".tar.gz"))
445aa137
RW
283 (file-name (string-append name "-" version ".tar.gz"))
284 (sha256
285 (base32
2f5ccf27 286 "0s67mysskbiw1h1p0np4ph4351r7wq3nc873vylam7lsqi66xy0n"))))
445aa137
RW
287 (build-system gnu-build-system)
288 (arguments
289 `(;; Parallel building fails because aqhbci is required before it's
290 ;; built.
291 #:parallel-build? #f
292 #:configure-flags
293 (list (string-append "--with-gwen-dir="
294 (assoc-ref %build-inputs "gwenhywfar")))))
295 (propagated-inputs
296 `(("gwenhywfar" ,gwenhywfar)))
297 (inputs
298 `(("gmp" ,gmp)
299 ("xmlsec" ,xmlsec)
300 ("gnutls" ,gnutls)))
301 (native-inputs
302 `(("pkg-config" ,pkg-config)
303 ("libltdl" ,libltdl)))
304 (home-page "http://www.aquamaniac.de/sites/aqbanking/index.php")
305 (synopsis "Interface for online banking tasks")
306 (description
307 "AqBanking is a modular and generic interface to online banking tasks,
308financial file formats (import/export) and bank/country/currency information.
309AqBanking uses backend plugins to actually perform the online tasks. HBCI,
310OFX DirectConnect, YellowNet, GeldKarte, and DTAUS discs are currently
311supported. AqBanking is used by GnuCash, KMyMoney, and QBankManager.")
312 ;; AqBanking is licensed under the GPLv2 or GPLv3
313 (license (list license:gpl2 license:gpl3))))