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