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