gnu: Add bats.
[jackhill/guix/guix.git] / gnu / packages / finance.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
5 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
6 ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
7 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
8 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
9 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
11 ;;; Copyright © 2018 Adriano Peluso <catonano@gmail.com>
12 ;;; Copyright © 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
13 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
14 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
15 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
16 ;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
17 ;;; Copyright © 2019 Sebastian Schott <sschott@mailbox.org>
18 ;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
19 ;;; Copyright © 2020 Christopher Lemmer Webber <cwebber@dustycloud.org>
20 ;;; Copyright © 2020 Tom Zander <tomz@freedommail.ch>
21 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
22 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
23 ;;;
24 ;;; This file is part of GNU Guix.
25 ;;;
26 ;;; GNU Guix is free software; you can redistribute it and/or modify it
27 ;;; under the terms of the GNU General Public License as published by
28 ;;; the Free Software Foundation; either version 3 of the License, or (at
29 ;;; your option) any later version.
30 ;;;
31 ;;; GNU Guix is distributed in the hope that it will be useful, but
32 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 ;;; GNU General Public License for more details.
35 ;;;
36 ;;; You should have received a copy of the GNU General Public License
37 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38
39 (define-module (gnu packages finance)
40 #:use-module ((guix licenses) #:prefix license:)
41 #:use-module (guix packages)
42 #:use-module (guix download)
43 #:use-module (guix git-download)
44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system cmake)
46 #:use-module (guix build-system copy)
47 #:use-module (guix build-system emacs)
48 #:use-module (guix build-system python)
49 #:use-module (guix build-system glib-or-gtk)
50 #:use-module (guix build-system go)
51 #:use-module (guix build-system qt)
52 #:use-module (guix utils)
53 #:use-module (gnu packages)
54 #:use-module (gnu packages aidc)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages boost)
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages compression)
60 #:use-module (gnu packages crypto)
61 #:use-module (gnu packages curl)
62 #:use-module (gnu packages databases)
63 #:use-module (gnu packages docbook)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages dns)
66 #:use-module (gnu packages emacs)
67 #:use-module (gnu packages dbm)
68 #:use-module (gnu packages gettext)
69 #:use-module (gnu packages gnome)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnupg)
72 #:use-module (gnu packages graphviz)
73 #:use-module (gnu packages groff)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages libedit)
76 #:use-module (gnu packages libevent)
77 #:use-module (gnu packages libunwind)
78 #:use-module (gnu packages libusb)
79 #:use-module (gnu packages linux)
80 #:use-module (gnu packages man)
81 #:use-module (gnu packages multiprecision)
82 #:use-module (gnu packages networking)
83 #:use-module (gnu packages pkg-config)
84 #:use-module (gnu packages popt)
85 #:use-module (gnu packages protobuf)
86 #:use-module (gnu packages python)
87 #:use-module (gnu packages python-crypto)
88 #:use-module (gnu packages python-web)
89 #:use-module (gnu packages python-xyz)
90 #:use-module (gnu packages qt)
91 #:use-module (gnu packages readline)
92 #:use-module (gnu packages sphinx)
93 #:use-module (gnu packages texinfo)
94 #:use-module (gnu packages textutils)
95 #:use-module (gnu packages time)
96 #:use-module (gnu packages tls)
97 #:use-module (gnu packages upnp)
98 #:use-module (gnu packages version-control)
99 #:use-module (gnu packages web)
100 #:use-module (gnu packages xml)
101 #:use-module (gnu packages gnuzilla))
102
103 (define-public bitcoin-core
104 (package
105 (name "bitcoin-core")
106 (version "0.19.1")
107 (source (origin
108 (method url-fetch)
109 (uri
110 (string-append "https://bitcoincore.org/bin/bitcoin-core-"
111 version "/bitcoin-" version ".tar.gz"))
112 (sha256
113 (base32
114 "1h3w7brc18145np920vy7j5ms5hym59hvr40swdjx34fbdaisngj"))
115 (patches (search-patches "bitcoin-core-python-compat.patch"))))
116 (build-system gnu-build-system)
117 (native-inputs
118 `(("pkg-config" ,pkg-config)
119 ("python" ,python) ; for the tests
120 ("util-linux" ,util-linux) ; provides the hexdump command for tests
121 ("qttools" ,qttools)))
122 (inputs
123 `(("bdb" ,bdb-4.8) ; 4.8 required for compatibility
124 ("boost" ,boost)
125 ("libevent" ,libevent)
126 ("miniupnpc" ,miniupnpc)
127 ("openssl" ,openssl)
128 ("protobuf" ,protobuf)
129 ("qtbase" ,qtbase)))
130 (arguments
131 `(#:configure-flags
132 (list
133 ;; Boost is not found unless specified manually.
134 (string-append "--with-boost="
135 (assoc-ref %build-inputs "boost"))
136 ;; XXX: The configure script looks up Qt paths by
137 ;; `pkg-config --variable=host_bins Qt5Core`, which fails to pick
138 ;; up executables residing in 'qttools', so we specify them here.
139 (string-append "ac_cv_path_LRELEASE="
140 (assoc-ref %build-inputs "qttools")
141 "/bin/lrelease")
142 (string-append "ac_cv_path_LUPDATE="
143 (assoc-ref %build-inputs "qttools")
144 "/bin/lupdate"))
145 #:phases
146 (modify-phases %standard-phases
147 (add-before 'configure 'make-qt-deterministic
148 (lambda _
149 ;; Make Qt deterministic.
150 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
151 #t))
152 (add-before 'check 'set-home
153 (lambda _
154 (setenv "HOME" (getenv "TMPDIR")) ; tests write to $HOME
155 #t))
156 (add-after 'check 'check-functional
157 (lambda _
158 (invoke
159 "python3" "./test/functional/test_runner.py"
160 (string-append "--jobs=" (number->string (parallel-job-count))))
161 #t)))))
162 (home-page "https://bitcoin.org/en/")
163 (synopsis "Bitcoin peer-to-peer client")
164 (description
165 "Bitcoin is a digital currency that enables instant payments to anyone
166 anywhere in the world. It uses peer-to-peer technology to operate without
167 central authority: managing transactions and issuing money are carried out
168 collectively by the network. Bitcoin Core is the reference implementation
169 of the bitcoin protocol. This package provides the Bitcoin Core command
170 line client and a client based on Qt.")
171 (license license:expat)))
172
173 (define-public homebank
174 (package
175 (name "homebank")
176 (version "5.4.2")
177 (source (origin
178 (method url-fetch)
179 (uri (string-append "http://homebank.free.fr/public/homebank-"
180 version ".tar.gz"))
181 (sha256
182 (base32
183 "0bkjvd819kw9cwmr3macggbg8yil3yc8v2za8pjrl6g746s89kn6"))))
184 (build-system glib-or-gtk-build-system)
185 (native-inputs
186 `(("pkg-config" ,pkg-config)
187 ("intltool" ,intltool)))
188 (inputs
189 `(("gtk+" ,gtk+)
190 ("libofx" ,libofx)
191 ("libsoup" ,libsoup)))
192 (home-page "http://homebank.free.fr/")
193 (synopsis "Graphical personal accounting application")
194 (description "HomeBank allows you to manage your personal accounts at
195 home. The seeks to be lightweight, simple and easy to use. It brings
196 features that allow you to analyze your finances in a detailed way instantly
197 and dynamically with report tools based on filtering and graphical charts.")
198 (license license:gpl2+)))
199
200 (define-public ledger
201 (package
202 (name "ledger")
203 (version "3.2.0")
204 (source
205 (origin
206 (method git-fetch)
207 (uri (git-reference
208 (url "https://github.com/ledger/ledger.git")
209 (commit (string-append "v" version))))
210 (file-name (git-file-name name version))
211 (sha256
212 (base32 "1l5c9jf2wnly6ncm9civ8i7v47xld15g1y7wpl0hqwgbfyffwjci"))))
213 (build-system cmake-build-system)
214 (arguments
215 `(#:modules (,@%cmake-build-system-modules
216 ((guix build python-build-system) #:select (python-version)))
217 #:imported-modules (,@%cmake-build-system-modules
218 (guix build python-build-system))
219 #:configure-flags
220 `("-DBUILD_DOCS:BOOL=ON"
221 "-DBUILD_WEB_DOCS:BOOL=ON"
222 "-DUSE_PYTHON:BOOL=ON"
223 "-DCMAKE_INSTALL_LIBDIR:PATH=lib")
224 #:phases
225 (modify-phases (@ (guix build cmake-build-system) %standard-phases)
226 (add-after 'unpack 'fix-python-installation-directory
227 (lambda* (#:key inputs outputs #:allow-other-keys)
228 ;; By default the package attempts to install its Python bindings
229 ;; to the Python store directory, which obviously does not work.
230 ;; Passing -DPython_SITEARCH in #:configure-flags has no effect.
231 (let ((python-version (python-version (assoc-ref inputs "python")))
232 (out (assoc-ref outputs "out")))
233 (substitute* "src/CMakeLists.txt"
234 (("DESTINATION \\$\\{Python_SITEARCH\\}")
235 (string-append "DESTINATION " out "/lib/python"
236 python-version "/site-packages")))
237 #t)))
238 (add-before 'configure 'install-examples
239 (lambda* (#:key outputs #:allow-other-keys)
240 (let ((examples (string-append (assoc-ref outputs "out")
241 "/share/doc/ledger/examples")))
242 (install-file "test/input/sample.dat" examples)
243 (install-file "test/input/demo.ledger" examples))
244 #t))
245 (add-after 'build 'build-doc
246 (lambda _ (invoke "make" "doc")))
247 (add-before 'check 'check-setup
248 ;; One test fails if it can't set the timezone.
249 (lambda* (#:key inputs #:allow-other-keys)
250 (setenv "TZDIR"
251 (string-append (assoc-ref inputs "tzdata")
252 "/share/zoneinfo"))
253 ;; Skip failing test BaselineTest_cmd-org.
254 ;; This is a known upstream issue. See
255 ;; https://github.com/ledger/ledger/issues/550
256 (setenv "ARGS" "-E BaselineTest_cmd-org")
257 #t)))))
258 (inputs
259 `(("boost" ,boost)
260 ("gmp" ,gmp)
261 ("libedit" ,libedit)
262 ("mpfr" ,mpfr)
263 ("python" ,python)
264 ("utfcpp" ,utfcpp)))
265 (native-inputs
266 `(("groff" ,groff)
267 ("texinfo" ,texinfo)
268 ("tzdata" ,tzdata-for-tests)))
269 (home-page "https://ledger-cli.org/")
270 (synopsis "Command-line double-entry accounting program")
271 (description
272 "Ledger is a powerful, double-entry accounting system that is
273 accessed from the UNIX command-line. This may put off some users, since
274 there is no flashy UI, but for those who want unparalleled reporting
275 access to their data there are few alternatives.
276
277 Ledger uses text files for input. It reads the files and generates
278 reports; there is no other database or stored state. To use Ledger,
279 you create a file of your account names and transactions, run from the
280 command line with some options to specify input and requested reports, and
281 get output. The output is generally plain text, though you could generate
282 a graph or html instead. Ledger is simple in concept, surprisingly rich
283 in ability, and easy to use.")
284 ;; There are some extra licenses in files which do not presently get
285 ;; installed when you build this package. Different versions of the GPL
286 ;; are used in the contrib and python subdirectories. The bundled version
287 ;; of utfcpp is under the Boost 1.0 license. Also the file
288 ;; `tools/update_copyright_year` has an Expat license.
289 (license (list license:bsd-3
290 license:asl2.0 ; src/strptime.cc
291 (license:non-copyleft
292 "file://src/wcwidth.cc"
293 "See src/wcwidth.cc in the distribution.")))))
294
295 (define-public emacs-ledger-mode
296 ;; There have been no new releases since 2016.
297 (let ((commit "253a20dc62e137ed0ed8e1dd8614ecba116610ea")
298 (revision "1"))
299 (package
300 (name "emacs-ledger-mode")
301 (version (git-version "3.1.1" revision commit))
302 (source
303 (origin
304 (method git-fetch)
305 (uri (git-reference
306 (url "https://github.com/ledger/ledger-mode.git")
307 (commit commit)))
308 (file-name (git-file-name name version))
309 (sha256
310 (base32 "06wrgkqpgvk17vibrk2qikdlqn8y63jg86marp1wgmram92mb3jk"))))
311 (build-system cmake-build-system)
312 (arguments
313 `(#:modules ((guix build cmake-build-system)
314 (guix build utils)
315 (guix build emacs-utils))
316 #:imported-modules (,@%cmake-build-system-modules
317 (guix build emacs-utils))
318 #:tests? #f ; there are none
319 #:phases
320 (modify-phases %standard-phases
321 (add-after 'unpack 'patch-site-dir
322 (lambda _
323 (substitute* "CMakeLists.txt"
324 (("DESTINATION share/emacs/site-lisp/ledger-mode")
325 "DESTINATION share/emacs/site-lisp"))
326 #t))
327 (add-before 'build 'patch-path
328 (lambda* (#:key inputs #:allow-other-keys)
329 (let ((ledger (assoc-ref inputs "ledger")))
330 (make-file-writable "ledger-exec.el")
331 (emacs-substitute-variables "ledger-exec.el"
332 ("ledger-binary-path" (string-append ledger "/bin/ledger"))))
333 #t))
334 (add-after 'build 'build-doc
335 (lambda* (#:key outputs #:allow-other-keys)
336 (let ((target (string-append (assoc-ref outputs "out")
337 "/share/info")))
338 (mkdir-p target)
339 (invoke "makeinfo" "-o" target
340 "../source/doc/ledger-mode.texi"))
341 #t))
342 (add-after 'install 'generate-autoload
343 (lambda* (#:key outputs #:allow-other-keys)
344 (let* ((site-dir (string-append (assoc-ref outputs "out")
345 "/share/emacs/site-lisp")))
346 (emacs-generate-autoloads ,name site-dir))
347 #t)))))
348 (inputs
349 `(("ledger" ,ledger)))
350 (native-inputs
351 `(("emacs-minimal" ,emacs-minimal)
352 ("texinfo" ,texinfo)))
353 (home-page "https://ledger-cli.org/")
354 (synopsis "Command-line double-entry accounting program")
355 (description
356 "Ledger is a powerful, double-entry accounting system that is
357 accessed from the UNIX command-line. This may put off some users, since
358 there is no flashy UI, but for those who want unparalleled reporting
359 access to their data there are few alternatives.
360
361 Ledger uses text files for input. It reads the files and generates
362 reports; there is no other database or stored state. To use Ledger,
363 you create a file of your account names and transactions, run from the
364 command line with some options to specify input and requested reports, and
365 get output. The output is generally plain text, though you could generate
366 a graph or html instead. Ledger is simple in concept, surprisingly rich
367 in ability, and easy to use.
368
369 This package provides the Emacs mode.")
370 (license license:gpl2+))))
371
372 (define-public geierlein
373 (package
374 (name "geierlein")
375 (version "0.9.13")
376 (source
377 (origin
378 (method git-fetch)
379 (uri (git-reference
380 (url "https://github.com/stesie/geierlein.git")
381 (commit (string-append "V" version))))
382 (file-name (git-file-name name version))
383 (sha256
384 (base32 "00zpwr3lk2vdmd60fgdwdk0xxs52wvnm19ln2m75yfphydvkglic"))))
385 (build-system gnu-build-system)
386 (arguments
387 `(#:tests? #f ; would require npm, python and a lot more
388 #:phases
389 (modify-phases %standard-phases
390 (delete 'configure) ; no configure script
391 (add-after 'unpack 'override-target-directory-and-tool-paths
392 (lambda* (#:key inputs outputs #:allow-other-keys)
393 (substitute* "Makefile"
394 (("prefix := .*")
395 (string-append "prefix := " (assoc-ref outputs "out") "\n"))
396 ;; Required for tests, unused for now:
397 ;;(("PYTHON := .*")
398 ;; (string-append (which "python") "\n")))
399 (("INSTALL := .*")
400 (string-append "INSTALL := " (which "install") "\n")))
401 (substitute* "bin/xgeierlein.in"
402 ;; Use icecat as XULRUNNER
403 (("^for search ")
404 (string-append "XULRUNNER=" (which "icecat") "\n"
405 "for search ")))
406 #t)))))
407 (inputs
408 `(("icecat" ,icecat)))
409 (home-page "https://stesie.github.io/geierlein/")
410 (synopsis "Free Elster client, for sending Germany VAT declarations")
411 (description
412 "Geierlein is a free Elster client, i.e. an application that
413 sends VAT declarations to Germany's fiscal authorities.
414
415 Currently it is *not* possible to send returns that are due annually
416 (especially the income tax return) since the fiscal authority doesn't
417 allow doing that off the ERiC library (which is proprietary however).
418 It's not clear at the moment whether one day it will be possible to
419 do so.")
420 (license license:agpl3+)))
421
422 (define-public electrum
423 (package
424 (name "electrum")
425 (version "3.3.8")
426 (source
427 (origin
428 (method url-fetch)
429 (uri (string-append "https://download.electrum.org/"
430 version "/Electrum-"
431 version ".tar.gz"))
432 (sha256
433 (base32 "1g00cj1pmckd4xis8r032wmraiv3vd3zc803hnyxa2bnhj8z3bg2"))
434 (modules '((guix build utils)))
435 (snippet
436 '(begin
437 ;; Delete the bundled dependencies.
438 (delete-file-recursively "packages")
439 #t))))
440 (build-system python-build-system)
441 (inputs
442 `(("python-pyaes" ,python-pyaes)
443 ("python-pysocks" ,python-pysocks)
444 ("python-sip" ,python-sip)
445 ("python-pyqt" ,python-pyqt)
446 ("python-ecdsa" ,python-ecdsa)
447 ("python-pbkdf2" ,python-pbkdf2)
448 ("python-requests" ,python-requests)
449 ("python-qrcode" ,python-qrcode)
450 ("python-protobuf" ,python-protobuf)
451 ("python-aiohttp" ,python-aiohttp)
452 ("python-aiohttp-socks" ,python-aiohttp-socks)
453 ("python-aiorpcx" ,python-aiorpcx)
454 ("python-certifi" ,python-certifi)
455 ("python-dnspython" ,python-dnspython)
456 ("python-jsonrpclib-pelix" ,python-jsonrpclib-pelix)))
457 (arguments
458 `(#:tests? #f ;; package doesn't have any tests
459 #:phases
460 (modify-phases %standard-phases
461 (add-before 'build 'patch-home
462 (lambda* (#:key outputs #:allow-other-keys)
463 (substitute* "setup.py"
464 (("~/.local/share")
465 (string-append (assoc-ref outputs "out") "/local/share"))))))))
466 (home-page "https://electrum.org/")
467 (synopsis "Bitcoin wallet")
468 (description
469 "Electrum is a lightweight Bitcoin client, based on a client-server
470 protocol. It supports Simple Payment Verification (SPV) and deterministic key
471 generation from a seed. Your secret keys are encrypted and are never sent to
472 other machines/servers. Electrum does not download the Bitcoin blockchain.")
473 (license license:expat)))
474
475 (define-public electron-cash
476 (package
477 (name "electron-cash")
478 (version "4.0.15")
479 (source
480 (origin
481 (method git-fetch)
482 (uri (git-reference
483 (url "https://github.com/Electron-Cash/Electron-Cash.git")
484 (commit version)))
485 (file-name (git-file-name name version))
486 (sha256
487 (base32 "0bvj64fdxpi0dbivhgv509kqq503zjp7r7xckl8q5c48j5h1zik2"))))
488 (build-system python-build-system)
489 (inputs
490 `(("libevent" ,libevent)
491 ("libsecp256k1", libsecp256k1)
492 ("openssl" ,openssl)
493 ("python-cython" ,python-cython)
494 ("python-dateutil", python-dateutil)
495 ("python-dnspython" ,python-dnspython)
496 ("python-ecdsa" ,python-ecdsa)
497 ("python-hidapi" ,python-hidapi)
498 ("python-jsonrpclib-pelix" ,python-jsonrpclib-pelix)
499 ("python-keepkey" ,python-keepkey)
500 ("python-protobuf" ,python-protobuf)
501 ("python-pyaes" ,python-pyaes)
502 ("python-pyqt" ,python-pyqt)
503 ("python-pysocks" ,python-pysocks)
504 ("python-qrcode" ,python-qrcode)
505 ("python-requests" ,python-requests)
506 ("python-stem" ,python-stem)
507 ("python-trezor" ,python-trezor)
508 ("qtsvg" ,qtsvg)
509 ("zlib" ,zlib)))
510 (arguments
511 `(#:tests? #f ; No tests
512 #:modules ((guix build python-build-system)
513 (guix build qt-utils)
514 (guix build utils))
515 #:imported-modules (,@%python-build-system-modules
516 (guix build qt-utils))
517 #:phases
518 (modify-phases %standard-phases
519 (add-after 'unpack 'patch-home
520 (lambda* (#:key outputs #:allow-other-keys)
521 (substitute* "setup.py"
522 (("~/.local/share")
523 (string-append (assoc-ref outputs "out") "/local/share")))))
524 (add-after 'unpack 'use-libsecp256k1-input
525 (lambda* (#:key inputs #:allow-other-keys)
526 (substitute* "lib/secp256k1.py"
527 (("library_paths = .* 'libsecp256k1.so.0'.")
528 (string-append "library_paths = ('" (assoc-ref inputs "libsecp256k1") "/lib/libsecp256k1.so.0'")))))
529 (add-after 'install 'wrap-qt
530 (lambda* (#:key outputs #:allow-other-keys)
531 (wrap-qt-program (assoc-ref outputs "out") "electron-cash")
532 #t)))))
533 (home-page "https://electroncash.org/")
534 (synopsis "Bitcoin Cash wallet")
535 (description
536 "Electroncash is a lightweight Bitcoin Cash client, based on a client-server
537 protocol. It supports Simple Payment Verification (SPV) and deterministic key
538 generation from a seed. Your secret keys are encrypted and are never sent to
539 other machines/servers. Electroncash does not download the Bitcoin Cash blockchain.")
540 (license license:expat)))
541
542 (define-public monero
543 ;; This package bundles easylogging++ and lmdb.
544 ;; The bundled easylogging++ is modified, and the changes will not be
545 ;; upstreamed.
546 ;; The devs deem the lmdb driver too critical a consenus component, to use
547 ;; the system's dynamically linked library.
548 (package
549 (name "monero")
550 (version "0.16.0.0")
551 (source
552 (origin
553 (method git-fetch)
554 (uri (git-reference
555 (url "https://github.com/monero-project/monero.git")
556 (commit (string-append "v" version))
557 (recursive? #t)))
558 (file-name (git-file-name name version))
559 (patches (search-patches "monero-use-system-miniupnpc.patch"))
560 (modules '((guix build utils)))
561 (snippet
562 '(begin
563 ;; Delete bundled dependencies.
564 (for-each
565 delete-file-recursively
566 '("external/miniupnp" "external/rapidjson"
567 "external/unbound"))
568 #t))
569 (sha256
570 (base32
571 "0x74h5z0nxxxip97ibc854pqmrgd8r4d6w62m424f66i8gbzfskh"))))
572 (build-system cmake-build-system)
573 (native-inputs
574 `(("doxygen" ,doxygen)
575 ("git" ,git)
576 ("graphviz" ,graphviz)
577 ("pkg-config" ,pkg-config)
578 ("protobuf" ,protobuf)
579 ("python" ,python)
580 ("qttools" ,qttools)))
581 (inputs
582 `(("boost" ,boost)
583 ("cppzmq" ,cppzmq)
584 ("expat" ,expat)
585 ("hidapi" ,hidapi)
586 ("libsodium" ,libsodium)
587 ("libunwind" ,libunwind)
588 ("libusb" ,libusb)
589 ("miniupnpc" ,miniupnpc)
590 ("openssl" ,openssl)
591 ("protobuf" ,protobuf)
592 ("rapidjson" ,rapidjson)
593 ("readline" ,readline)
594 ("unbound" ,unbound)
595 ("xz" ,xz)
596 ("zeromq" ,zeromq)))
597 (arguments
598 `(#:out-of-source? #t
599 #:configure-flags
600 (list "-DARCH=default"
601 "-DBUILD_TESTS=ON"
602 "-DBUILD_GUI_DEPS=ON"
603 (string-append "-DReadline_ROOT_DIR="
604 (assoc-ref %build-inputs "readline")))
605 #:phases
606 (modify-phases %standard-phases
607 ;; tests/core_tests need a valid HOME
608 (add-before 'configure 'set-home
609 (lambda _
610 (setenv "HOME" (getcwd))
611 #t))
612 (add-after 'set-home 'change-log-path
613 (lambda _
614 (substitute* "contrib/epee/src/mlog.cpp"
615 (("epee::string_tools::get_current_module_folder\\(\\)")
616 "\".bitmonero\"")
617 (("return \\(")
618 "return ((std::string(getenv(\"HOME\"))) / "))
619 #t))
620 (add-after 'change-log-path 'fix-file-permissions-for-tests
621 (lambda _
622 (for-each make-file-writable
623 (find-files "tests/data/" "wallet_9svHk1.*"))
624 #t))
625 ;; Only try tests that don't need access to network or system
626 (replace 'check
627 (lambda _
628 ;; Core tests sometimes fail, at least on i686-linux.
629 ;; Let's disable them for now and just try hash tests
630 ;; and unit tests.
631 ;; (invoke "make" "ARGS=-R 'hash|core_tests' --verbose" "test")))
632 (invoke "make" "ARGS=-R 'hash' --verbose" "test")))
633 (add-after 'check 'unit-tests
634 (lambda _
635 (let ((excluded-unit-tests
636 (string-join
637 '("AddressFromURL.Success"
638 "AddressFromURL.Failure"
639 "DNSResolver.IPv4Success"
640 "DNSResolver.DNSSECSuccess"
641 "DNSResolver.DNSSECFailure"
642 "DNSResolver.GetTXTRecord"
643 "is_hdd.linux_os_root")
644 ":")))
645 (invoke "tests/unit_tests/unit_tests"
646 (string-append "--gtest_filter=-"
647 excluded-unit-tests)))))
648 (add-after 'install 'install-librandomx
649 (lambda* (#:key outputs #:allow-other-keys)
650 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
651 (install-file "external/randomx/librandomx.a" lib)
652 #t)))
653 (add-after 'install 'delete-dead-links
654 (lambda* (#:key outputs #:allow-other-keys)
655 (let ((out (assoc-ref outputs "out")))
656 (delete-file (string-append out "/lib/libprotobuf.so"))
657 (delete-file (string-append out "/lib/libusb-1.0.so"))
658 #t))))))
659 (home-page "https://web.getmonero.org/")
660 (synopsis "Command-line interface to the Monero currency")
661 (description
662 "Monero is a secure, private, untraceable currency. This package provides
663 the Monero command line client and daemon.")
664 (license license:bsd-3)))
665
666 (define-public monero-gui
667 (package
668 (name "monero-gui")
669 (version "0.16.0.0")
670 (source
671 (origin
672 (method git-fetch)
673 (uri (git-reference
674 (url "https://github.com/monero-project/monero-gui.git")
675 (commit (string-append "v" version))))
676 (file-name (git-file-name name version))
677 (sha256
678 (base32
679 "06vdrsj5y9k0zn32hspyxc7sw1kkyrvi3chzkdbnxk9jvyj8k4ld"))))
680 (build-system qt-build-system)
681 (native-inputs
682 `(("monero-source" ,(package-source monero))
683 ("pkg-config" ,pkg-config)
684 ("qttools" ,qttools)))
685 (inputs
686 `(("boost" ,boost)
687 ("hidapi" ,hidapi)
688 ("libgcrypt" ,libgcrypt)
689 ("libsodium" ,libsodium)
690 ("libunwind" ,libunwind)
691 ("libusb" ,libusb)
692 ("openssl" ,openssl)
693 ("protobuf" ,protobuf)
694 ("qtbase" ,qtbase)
695 ("qtdeclarative" ,qtdeclarative)
696 ("qtgraphicaleffects" ,qtgraphicaleffects)
697 ("qtlocation" ,qtlocation)
698 ("qtmultimedia" ,qtmultimedia)
699 ("qtquickcontrols" ,qtquickcontrols)
700 ("qtquickcontrols2",qtquickcontrols2)
701 ("qtsvg" ,qtsvg)
702 ("qtxmlpatterns" ,qtxmlpatterns)
703 ("unbound" ,unbound)))
704 (propagated-inputs
705 `(("monero" ,monero)))
706 (arguments
707 `(#:tests? #f ; No tests
708 #:phases
709 (modify-phases %standard-phases
710 (add-after 'unpack 'get-monero-extra-files
711 ;; Some headers and GnuPG public keys of the monero package source
712 ;; code are required to build the GUI.
713 (lambda* (#:key inputs #:allow-other-keys)
714 (invoke "tar" "-xv" "--wildcards" "--strip-components=1"
715 "-C" "monero"
716 "-f" (assoc-ref inputs "monero-source")
717 "*.asc" "*.h")
718 #t))
719 (add-after 'get-monero-extra-files 'fix-makefile-vars
720 (lambda _
721 (substitute* "src/zxcvbn-c/makefile"
722 (("\\?=") "="))
723 #t))
724 (add-after 'fix-makefile-vars 'fix-paths
725 (lambda* (#:key inputs outputs #:allow-other-keys)
726 (let ((boost (assoc-ref inputs "boost"))
727 (monero (assoc-ref inputs "monero"))
728 (openssl (assoc-ref inputs "openssl"))
729 (qttools (assoc-ref inputs "qttools"))
730 (out (assoc-ref outputs "out")))
731 (substitute* "monero-wallet-gui.pro"
732 (("-L/usr/local/lib")
733 "")
734 (("-L/usr/local/opt/openssl/lib")
735 (string-append "-L" openssl "/lib"))
736 (("-L/usr/local/opt/boost/lib")
737 (string-append "-L" boost "/lib"))
738 (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
739 (string-append qttools "/bin/lrelease"))
740 (("\\$\\$\\[QT_INSTALL_BINS\\]/lupdate")
741 (string-append qttools "/bin/lupdate")))
742 (substitute* "deployment.pri"
743 (("/opt/\\$\\$\\{TARGET\\}/bin")
744 (string-append out "/bin")))
745 (substitute* "src/daemon/DaemonManager.cpp"
746 (("QApplication::applicationDirPath\\(\\) \\+ \"/monerod")
747 (string-append "\"" monero "/bin/monerod")))
748 #t)))
749 (add-after 'fix-paths 'make-qt-deterministic
750 (lambda _
751 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
752 #t))
753 (add-after 'make-qt-deterministic 'fix-version
754 (lambda _
755 (substitute* "build.sh"
756 (("echo .*> version.js")
757 ""))
758 (with-output-to-file "version.js"
759 (lambda _
760 (format #t
761 "var GUI_VERSION = \"~a\"~@
762 var GUI_MONERO_VERSION = \"~a\"~%"
763 ,version
764 ,(package-version monero))))
765 #t))
766 (replace 'configure
767 (lambda _
768 (mkdir-p "build")
769 (chdir "build")
770 (invoke "qmake" "../monero-wallet-gui.pro" "CONFIG+=release")))
771 (add-before 'build 'build-zxcvbn-c
772 (lambda _
773 (invoke "make" "-C" "../src/zxcvbn-c"))))))
774 (home-page "https://web.getmonero.org/")
775 (synopsis "Graphical user interface for the Monero currency")
776 (description
777 "Monero is a secure, private, untraceable currency. This package provides
778 the Monero GUI client.")
779 (license license:bsd-3)))
780
781 (define-public python-trezor-agent
782 (package
783 (name "python-trezor-agent")
784 (version "0.13.1")
785 (source
786 (origin
787 (method git-fetch)
788 (uri (git-reference
789 (url "https://github.com/romanz/trezor-agent.git")
790 (commit (string-append "v" version))))
791 (file-name (git-file-name name version))
792 (sha256
793 (base32 "0q99vbfd3h85s8rnjipnmldixabqmmlk5w9karv6f0rhyi54f4zv"))))
794 (build-system python-build-system)
795 (arguments
796 `(#:phases
797 (modify-phases %standard-phases
798 (add-after 'unpack 'remove-requires-backports-shutil-which
799 ;; Remove requires on backport of shutil_which, as python 3.4+ has
800 ;; a built-in implementation supported in python-trezor-agent.
801 (lambda _
802 (substitute* "setup.py"
803 (("'backports.shutil_which>=3.5.1',") ""))
804 #t))
805 (delete 'check)
806 (add-after 'install 'check
807 (lambda* (#:key outputs inputs #:allow-other-keys)
808 ;; Make installed package available for running the tests.
809 (add-installed-pythonpath inputs outputs)
810 (invoke "py.test"))))))
811 (propagated-inputs
812 `(("python-configargparse" ,python-configargparse)
813 ("python-daemon" ,python-daemon)
814 ("python-docutils" ,python-docutils)
815 ("python-ecdsa" ,python-ecdsa)
816 ("python-ed25519" ,python-ed25519)
817 ("python-mnemonic" ,python-mnemonic)
818 ("python-pymsgbox" ,python-pymsgbox)
819 ("python-semver" ,python-semver)
820 ("python-unidecode" ,python-unidecode)
821 ("python-wheel" ,python-wheel)))
822 (native-inputs
823 `(("gnupg" ,gnupg)
824 ("python-mock" ,python-mock)
825 ("python-pytest" ,python-pytest)))
826 (home-page "https://github.com/romanz/trezor-agent")
827 (synopsis "Use hardware wallets as SSH and GPG agent")
828 (description
829 "@code{libagent} is a library that allows using TREZOR, Keepkey and
830 Ledger Nano as a hardware SSH/GPG agent.")
831 (license license:lgpl3)))
832
833 (define-public python-mnemonic
834 (package
835 (name "python-mnemonic")
836 (version "0.19")
837 (source
838 (origin
839 (method url-fetch)
840 (uri (pypi-uri "mnemonic" version))
841 (sha256
842 (base32 "0cd9prmdj8wzdmc7lxbf9lz0xrlkvak5ignag406mmfbn81fndsf"))))
843 (build-system python-build-system)
844 (propagated-inputs
845 `(("python-pbkdf2" ,python-pbkdf2)))
846 (home-page "https://github.com/trezor/python-mnemonic")
847 (synopsis "Implementation of Bitcoin BIP-0039")
848 (description "@code{mnemonic} is a library that provides an implementation
849 of Bitcoin BIP-0039.")
850 (license license:expat)))
851
852 (define-public python2-mnemonic
853 (package-with-python2 python-mnemonic))
854
855 (define-public python-ledgerblue
856 (package
857 (name "python-ledgerblue")
858 (version "0.1.16")
859 (source
860 (origin
861 (method url-fetch)
862 (uri (pypi-uri "ledgerblue" version))
863 (sha256
864 (base32
865 "010mghaqh1cmz3a0ifc3f40mmyplilwlw7kpha2mzyrrff46p9gb"))))
866 (build-system python-build-system)
867 (propagated-inputs
868 `(("python-ecpy" ,python-ecpy)
869 ("python-future" ,python-future)
870 ("python-hidapi" ,python-hidapi)
871 ("python-pillow" ,python-pillow)
872 ("python-protobuf" ,python-protobuf)
873 ("python-pycrypto" ,python-pycrypto)))
874 (home-page "https://github.com/LedgerHQ/blue-loader-python")
875 (synopsis "Python library to communicate with Ledger Blue/Nano S")
876 (description "@code{ledgerblue} is a Python library to communicate with
877 Ledger Blue/Nano S.")
878 (license license:asl2.0)))
879
880 (define-public python2-ledgerblue
881 (package-with-python2 python-ledgerblue))
882
883 (define-public python-trezor
884 (package
885 (name "python-trezor")
886 (version "0.12.0")
887 (source
888 (origin
889 (method url-fetch)
890 (uri (pypi-uri "trezor" version))
891 (sha256
892 (base32
893 "0ycmpwjv5xp25993divjhaq5j766zgcy22xx39xfc1pcvldq5g7n"))))
894 (build-system python-build-system)
895 (propagated-inputs
896 `(("python-click" ,python-click)
897 ("python-construct" ,python-construct)
898 ("python-ecdsa" ,python-ecdsa)
899 ("python-libusb1" ,python-libusb1)
900 ("python-mnemonic" ,python-mnemonic)
901 ("python-requests" ,python-requests)
902 ("python-typing-extensions" ,python-typing-extensions)))
903 (native-inputs
904 ;; For tests.
905 `(("protobuf" ,protobuf)
906 ("python-black" ,python-black)
907 ("python-protobuf" ,python-protobuf)
908 ("python-isort" ,python-isort)
909 ("python-pyqt" ,python-pyqt)
910 ("python-pytest" ,python-pytest)))
911 (home-page "https://github.com/trezor/python-trezor")
912 (synopsis "Python library for communicating with TREZOR Hardware Wallet")
913 (description "@code{trezor} is a Python library for communicating with
914 TREZOR Hardware Wallet.")
915 (license license:lgpl3)))
916
917 (define-public python-keepkey
918 (package
919 (name "python-keepkey")
920 (version "6.0.3")
921 (source
922 (origin
923 (method url-fetch)
924 (uri (pypi-uri "keepkey" version))
925 (sha256
926 (base32
927 "0z3d0m6364v9dv0njs4cd5m5ai6j6v35xaaxfxl90m9vmyxy81vd"))))
928 (build-system python-build-system)
929 (arguments
930 `(#:phases
931 (modify-phases %standard-phases
932 (delete 'check)
933 (add-after 'install 'check
934 (lambda* (#:key inputs outputs #:allow-other-keys)
935 (add-installed-pythonpath inputs outputs)
936 (apply invoke "python" (find-files "tests/unit" "\\.py$")))))))
937 (propagated-inputs
938 `(("python-ecdsa" ,python-ecdsa)
939 ("python-hidapi" ,python-hidapi)
940 ("python-libusb1" ,python-libusb1)
941 ("python-mnemonic" ,python-mnemonic)
942 ("python-protobuf" ,python-protobuf)))
943 (home-page "https://github.com/keepkey/python-keepkey")
944 (synopsis "Python library for communicating with KeepKey Hardware Wallet")
945 (description "@code{keepkey} is a Python library for communicating with
946 the KeepKey Hardware Wallet.")
947 (license license:lgpl3)))
948
949 (define-public python2-keepkey
950 (package-with-python2 python-keepkey))
951
952 (define-public ledger-agent
953 (package
954 (name "ledger-agent")
955 (version "0.9.0")
956 (source
957 (origin
958 (method url-fetch)
959 (uri (pypi-uri "ledger_agent" version))
960 (sha256
961 (base32
962 "03zj602m2rln9yvr08dswy56vzkbldp8b074ixwzz525dafblr92"))))
963 (build-system python-build-system)
964 (inputs
965 `(("python-ledgerblue" ,python-ledgerblue)
966 ("python-trezor-agent" ,python-trezor-agent)))
967 (home-page "http://github.com/romanz/trezor-agent")
968 (synopsis "Ledger as hardware SSH/GPG agent")
969 (description "This package allows using Ledger as hardware SSH/GPG agent.
970
971 Usage for SSH: trezor-agent foo@@example.com --connect
972 Usage for GPG: Initialize using trezor-gpg init \"Foo <foo@@example.com>\"
973 Then set the environment variable GNUPGHOME to
974 \"${HOME}/.gnupg/trezor\".")
975 (license license:lgpl3)))
976
977 (define-public trezor-agent
978 (package
979 (name "trezor-agent")
980 (version "0.10.0")
981 (source
982 (origin
983 (method url-fetch)
984 (uri (pypi-uri "trezor_agent" version))
985 (sha256
986 (base32
987 "144657c7bn0a667dq5fv5r6j7iilxf3h9agj29v1m2qpq40g0az8"))))
988 (arguments
989 ;; Tests fail with "AttributeError: module 'attr' has no attribute 's'".
990 `(#:phases
991 (modify-phases %standard-phases
992 (add-after 'wrap 'fixup-agent-py
993 (lambda* (#:key inputs outputs #:allow-other-keys)
994 (let* ((out (assoc-ref outputs "out")))
995 ;; overwrite the wrapper with the real thing.
996 (install-file "./trezor_agent.py"
997 (string-append out "/bin"))
998 #t))))))
999 (build-system python-build-system)
1000 (inputs
1001 `(("python-trezor" ,python-trezor)
1002 ("python-trezor-agent" ,python-trezor-agent)))
1003 (native-inputs
1004 `(("python-hidapi" ,python-hidapi)))
1005 (home-page "https://github.com/romanz/trezor-agent")
1006 (synopsis "Using Trezor as hardware SSH/GPG agent")
1007 (description "This package allows using Trezor as a hardware SSH/GPG
1008 agent.")
1009 (license license:lgpl3)))
1010
1011 (define-public keepkey-agent
1012 (package
1013 (name "keepkey-agent")
1014 (version "0.9.0")
1015 (source
1016 (origin
1017 (method url-fetch)
1018 (uri (pypi-uri "keepkey_agent" version))
1019 (sha256
1020 (base32
1021 "03779gvlx70i0nnry98i4pl1d92604ix5x6jgdfkrdgzqbh5vj27"))))
1022 (build-system python-build-system)
1023 (inputs
1024 `(("python-keepkey" ,python-keepkey)
1025 ("python-trezor-agent" ,python-trezor-agent)))
1026 (home-page "http://github.com/romanz/trezor-agent")
1027 (synopsis "KeepKey as hardware SSH/GPG agent")
1028 (description "This package allows using KeepKey as a hardware SSH/GPG
1029 agent.")
1030 (license license:lgpl3)))
1031
1032 (define-public python-stdnum
1033 (package
1034 (name "python-stdnum")
1035 (version "1.13")
1036 (source
1037 (origin
1038 (method url-fetch)
1039 (uri (pypi-uri "python-stdnum" version))
1040 (sha256
1041 (base32
1042 "0q4128rjdgavywhzlm2gz2n5ybc9b9sxs81g50dvxf5q7z9q63qj"))))
1043 (build-system python-build-system)
1044 (arguments
1045 '(#:phases (modify-phases %standard-phases
1046 (replace 'check
1047 (lambda _
1048 (invoke "nosetests"))))))
1049 (native-inputs
1050 `(("python-nose" ,python-nose)))
1051 (home-page
1052 "https://arthurdejong.org/python-stdnum/")
1053 (synopsis
1054 "Python module to handle standardized number and code formats")
1055 (description
1056 "This is a Python library that aims to provide functions to handle,
1057 parse and validate standard numbers.
1058 The module supports more than 100 different number formats
1059 amongst which a great number of VAT and other tax numbers,
1060 personal identity and company identification codes,
1061 international standard numbers (ISBN, IBAN, EAN, etc.)
1062 and various other formats.
1063 The module also inclused implementations of the Verhoeff,
1064 Luhn and family of ISO/IEC 7064 check digit algorithms. ")
1065 (license license:lgpl2.1+)))
1066
1067 (define-public python2-stdnum
1068 (package-with-python2 python-stdnum))
1069
1070 (define-public python-duniterpy
1071 (package
1072 (name "python-duniterpy")
1073 (version "0.57.0")
1074 (source
1075 (origin
1076 (method url-fetch)
1077 (uri (pypi-uri "duniterpy" version))
1078 (sha256
1079 (base32 "0rw2c7r9gcqhymp82gbk1ky45zqbypsi2q5x4vdwjc6g00kh7h6l"))))
1080 (build-system python-build-system)
1081 (arguments
1082 ;; FIXME: Tests fail with: "ModuleNotFoundError: No module named
1083 ;; 'tests'". Not sure how to handle this.
1084 `(#:tests? #f
1085 #:phases
1086 (modify-phases %standard-phases
1087 ;; "setup.py" tries to open missing "requirements.txt".
1088 (add-after 'unpack 'ignore-missing-file
1089 (lambda _
1090 (substitute* "setup.py"
1091 (("open\\('requirements\\.txt'\\)") "[]"))
1092 #t)))))
1093 (propagated-inputs
1094 `(("aiohttp" ,python-aiohttp)
1095 ("attrs" ,python-attrs)
1096 ("base58" ,python-base58)
1097 ("jsonschema" ,python-jsonschema)
1098 ("libnacl" ,python-libnacl)
1099 ("pyaes" ,python-pyaes)
1100 ("pylibscrypt" ,python-pylibscrypt)
1101 ("pypeg2" ,python-pypeg2)))
1102 (home-page "https://git.duniter.org/clients/python/duniterpy")
1103 (synopsis "Python implementation of Duniter API")
1104 (description "@code{duniterpy} is an implementation of
1105 @uref{https://github.com/duniter/duniter/, duniter} API. Its
1106 main features are:
1107 @itemize
1108 @item Support Duniter's Basic Merkle API and protocol
1109 @item Asynchronous/synchronous without threads
1110 @item Support HTTP, HTTPS and Web Socket transport for Basic Merkle API
1111 @item Support Elasticsearch Duniter4j API
1112 @item Duniter signing key
1113 @item Sign/verify and encrypt/decrypt messages with the Duniter credentials
1114 @end itemize")
1115 (license license:gpl3+)))
1116
1117 (define-public silkaj
1118 (package
1119 (name "silkaj")
1120 (version "0.7.6")
1121 (source
1122 (origin
1123 (method url-fetch)
1124 (uri (pypi-uri "silkaj" version))
1125 (sha256
1126 (base32 "0hrn0jwg415z7wjkp0myvw85wszlfi18f56j03075xxakr4dmi2j"))))
1127 (build-system python-build-system)
1128 (arguments
1129 `(#:tests? #f)) ;no test
1130 (inputs
1131 `(("click" ,python-click)
1132 ("duniterpy" ,python-duniterpy)
1133 ("ipaddress" ,python-ipaddress)
1134 ("pynacl" ,python-pynacl)
1135 ("tabulate" ,python-tabulate)
1136 ("texttable" ,python-texttable)))
1137 (home-page "https://git.duniter.org/clients/python/silkaj")
1138 (synopsis "Command line client for Duniter network")
1139 (description "@code{Silkaj} is a command line client for the
1140 @uref{https://github.com/duniter/duniter/, Duniter} network.
1141
1142 Its features are:
1143 @itemize
1144 @item information about currency,
1145 @item issuers difficulty to generate next block,
1146 @item network view of nodes,
1147 @item list of last issuers,
1148 @item send transactions,
1149 @item get account amount.
1150 @end itemize")
1151 (license license:agpl3+)))
1152
1153 (define-public grisbi
1154 (package
1155 (name "grisbi")
1156 (version "1.2.2")
1157 (source
1158 (origin
1159 (method url-fetch)
1160 (uri (string-append
1161 "mirror://sourceforge/grisbi/grisbi%20stable/"
1162 (version-major+minor version) ".x/" version
1163 "/grisbi-" version ".tar.bz2"))
1164 (sha256
1165 (base32
1166 "1piiyyxjsjbw9gcqydvknzxmmfgh8kdqal12ywrxyxih2afwnvbw"))))
1167 (build-system glib-or-gtk-build-system)
1168 (arguments
1169 `(#:configure-flags (list "--without-ofx")))
1170 (propagated-inputs
1171 `(("dconf" ,dconf)))
1172 (native-inputs
1173 `(("glib" ,glib "bin") ; glib-compile-schemas
1174 ("pkg-config" ,pkg-config)
1175 ("intltool" ,intltool)))
1176 (inputs
1177 `(("gtk+" ,gtk+)
1178 ("libgsf" ,libgsf)))
1179 (synopsis "Personal accounting application")
1180 (description "Grisbi is a personal accounting application written by
1181 French developers that is designed to follow French accounting rules.
1182 Grisbi can manage multiple accounts, currencies and users. It manages
1183 third party, expenditure and receipt categories, budgetary lines,
1184 financial years, budget estimates, bankcard management and other
1185 information.")
1186 (home-page "https://grisbi.org")
1187 (license license:gpl2+)))
1188
1189 (define-public trezord-udev-rules
1190 (let ((commit "bff7fdfe436c727982cc553bdfb29a9021b423b0")
1191 (revision "0"))
1192 (package
1193 (name "trezord-udev-rules")
1194 (version (git-version "0.0.0" revision commit))
1195 (source
1196 (origin
1197 (method git-fetch)
1198 (uri (git-reference
1199 (url "https://github.com/trezor/trezor-common.git")
1200 (commit commit)))
1201 (sha256
1202 (base32
1203 "14mrirrn68if7ja6qdk9qlxs1hv0f21vrxy5ncnms0gx9iwakp2l"))
1204 (file-name (git-file-name name version))))
1205 (build-system copy-build-system)
1206 (arguments
1207 '(#:install-plan
1208 '(("./udev/51-trezor.rules" "lib/udev/rules.d/"))))
1209 (home-page "https://github.com/trezor/trezor-common")
1210 (synopsis "Udev rules for trezord")
1211 (description
1212 "This contains the udev rules for trezord. This will let a user run
1213 trezord as a regular user instead of needing to it run as root.")
1214 (license license:lgpl3+))))
1215
1216 (define-public trezord
1217 (package
1218 (name "trezord")
1219 (version "2.0.29")
1220 (source
1221 (origin
1222 (method git-fetch)
1223 (uri (git-reference
1224 (url "https://github.com/trezor/trezord-go.git")
1225 (commit (string-append "v" version))))
1226 (sha256
1227 (base32
1228 "1ks1fa0027s3xp0z6qp0dxmayvrb4dwwscfhbx7da0khp153f2cp"))
1229 (file-name (git-file-name name version))))
1230 (build-system go-build-system)
1231 (arguments
1232 '(#:import-path "github.com/trezor/trezord-go"))
1233 (home-page "https://trezor.io")
1234 (synopsis "Trezor Communication Daemon aka Trezor Bridge (written in Go)")
1235 (description "This allows a Trezor hardware wallet to communicate to the
1236 Trezor wallet.")
1237 (license license:lgpl3+)))
1238
1239 (define-public bitcoin-abc
1240 (package
1241 (name "bitcoin-abc")
1242 (version "0.21.6")
1243 (source (origin
1244 (method url-fetch)
1245 (uri (string-append "https://download.bitcoinabc.org/"
1246 version "/src/bitcoin-abc-"
1247 version ".tar.gz"))
1248 (sha256
1249 (base32
1250 "1w3c397h2mxsi9471fwyc3yjxw7s4jgvr4q3w2qfh49bhr4wygqj"))))
1251 (build-system cmake-build-system)
1252 (native-inputs
1253 `(("pkg-config" ,pkg-config)
1254 ("python" ,python) ; for the tests
1255 ("util-linux" ,util-linux) ; provides the hexdump command for tests
1256 ("qttools" ,qttools)))
1257 (inputs
1258 `(("bdb" ,bdb-5.3)
1259 ("boost" ,boost)
1260 ("libevent" ,libevent)
1261 ("miniupnpc" ,miniupnpc)
1262 ("openssl" ,openssl)
1263 ("protobuf" ,protobuf)
1264 ("qrencode" ,qrencode)
1265 ("qtbase" ,qtbase)
1266 ("zeromq" ,zeromq)
1267 ("zlib" ,zlib)))
1268 (arguments
1269 `(#:phases
1270 (modify-phases %standard-phases
1271 (add-before 'configure 'make-qt-deterministic
1272 (lambda _
1273 ;; Make Qt deterministic.
1274 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
1275 #t))
1276 (add-before 'check 'set-home
1277 (lambda _
1278 (setenv "HOME" (getenv "TMPDIR")) ; tests write to $HOME
1279 #t))
1280 (add-after 'check 'check-functional
1281 (lambda _
1282 (invoke
1283 "python3" "./test/functional/test_runner.py"
1284 (string-append "--jobs=" (number->string (parallel-job-count)))
1285 ;; TODO: find why the abc-miner-fund test fails.
1286 "--exclude=abc-miner-fund")
1287 #t)))))
1288 (home-page "https://www.bitcoinabc.org/")
1289 (synopsis "Bitcoin ABC peer-to-peer full node for the Bitcoin Cash protocol")
1290 (description
1291 "Bitcoin Cash brings sound money to the world, fulfilling the original
1292 promise of Bitcoin as Peer-to-Peer Electronic Cash. Merchants and users are
1293 empowered with low fees and reliable confirmations is a digital currency that
1294 enables instant payments to anyone anywhere in the world. It uses
1295 peer-to-peer technology to operate without central authority: managing
1296 transactions and issuing money are carried out collectively by the network.
1297 As a fork it implemented changes lowering the time between blocks and now
1298 offers confimations after less than 5 seconds and have significantly lower
1299 fees that BTC. Bitcoin ABC is the reference implementation of the Bitcoin
1300 Cash protocol. This package provides the Bitcoin Cash command line client and
1301 a client based on Qt. This is a fork of Bitcoin Core.")
1302 (license license:expat)))
1303
1304 (define-public libofx
1305 (package
1306 (name "libofx")
1307 (version "0.9.15")
1308 (source (origin
1309 (method git-fetch)
1310 (uri (git-reference
1311 (url "https://github.com/libofx/libofx")
1312 (commit version)))
1313 (file-name (git-file-name name version))
1314 (sha256
1315 (base32
1316 "1jx56ma351p8af8dvavygjwf6ipa7qbgq7bpdsymwj27apdnixfy"))))
1317 (build-system gnu-build-system)
1318 (arguments
1319 '(#:parallel-build? #f ;fails with -j64
1320 #:configure-flags
1321 (list (string-append "--with-opensp-includes="
1322 (assoc-ref %build-inputs "opensp")
1323 "/include/OpenSP"))))
1324 (native-inputs
1325 `(("autoconf" ,autoconf)
1326 ("automake" ,automake)
1327 ("gengetopt" ,gengetopt)
1328 ("help2man" ,help2man)
1329 ("libtool" ,libtool)
1330 ("pkg-config" ,pkg-config)))
1331 (inputs
1332 `(("curl" ,curl)
1333 ("libxml++-2" ,libxml++-2)
1334 ("opensp" ,opensp)))
1335 (home-page "http://libofx.sourceforge.net/")
1336 (synopsis "Library supporting the Open Financial Exchange format")
1337 (description
1338 "The LibOFX library is an API designed to allow applications to very easily
1339 support OFX command responses, usually provided by financial institutions. The
1340 following three utilities are included with the library:
1341 @enumerate
1342 @item @code{ofxdump}
1343 @item @code{ofx2qif}
1344 @item @code{ofxconnect}
1345 @end enumerate")
1346 (license license:gpl2+)))
1347
1348 (define-public opensp
1349 (package
1350 (name "opensp")
1351 (version "1.5.2")
1352 (source (origin
1353 (method url-fetch)
1354 (uri (string-append "mirror://sourceforge/openjade/opensp/"
1355 version "/OpenSP-" version ".tar.gz"))
1356 (sha256
1357 (base32
1358 "1khpasr6l0a8nfz6kcf3s81vgdab8fm2dj291n5r2s53k228kx2p"))))
1359 (build-system gnu-build-system)
1360 (native-inputs
1361 `(("gettext" ,gettext-minimal)))
1362 (inputs
1363 `(("docbook-xml" ,docbook-xml-4.1.2)
1364 ("docbook-xsl" ,docbook-xsl)
1365 ("xmlto" ,xmlto)))
1366 (arguments
1367 `(;; TODO: Fix and enable tests.
1368 #:tests? #f
1369 #:phases
1370 (modify-phases %standard-phases
1371 (add-after 'unpack 'patch-docbook-paths
1372 (lambda* (#:key inputs #:allow-other-keys)
1373 (let ((xmldoc (string-append (assoc-ref inputs "docbook-xml")
1374 "/xml/dtd/docbook"))
1375 (xsldoc (string-append (assoc-ref inputs "docbook-xsl")
1376 "/xml/xsl/docbook-xsl-"
1377 ,(package-version docbook-xsl))))
1378 (substitute* (find-files "docsrc" "\\.xml$")
1379 (("/usr/share/sgml/docbook/xml-dtd-4.1.2") xmldoc)
1380 (("http://.*/docbookx\\.dtd")
1381 (string-append xmldoc "/docbookx.dtd")))
1382 ;; Directly pass the path to the stylesheet to xmlto.
1383 (substitute* "docsrc/Makefile.in"
1384 (("\\$\\(XMLTO\\)")
1385 (string-append "$(XMLTO) -x " xsldoc
1386 "/manpages/docbook.xsl")))
1387 #t))))))
1388 (home-page "http://openjade.sourceforge.net/")
1389 (synopsis "Suite of SGML/XML processing tools")
1390 (description "OpenSP is an object-oriented toolkit for SGML parsing and
1391 entity management.")
1392 (license
1393 ;; expat license with added clause regarding advertising
1394 (license:non-copyleft
1395 "file://COPYING"
1396 "See COPYING in the distribution."))))
1397
1398 (define-public bitcoin-unlimited
1399 (package
1400 (name "bitcoin-unlimited")
1401 (version "1.8.0.0")
1402 (source
1403 (origin
1404 (method git-fetch)
1405 (uri (git-reference
1406 (url "https://github.com/BitcoinUnlimited/BitcoinUnlimited.git")
1407 (commit (string-append "BCHunlimited" version))))
1408 (file-name (git-file-name name version))
1409 (sha256
1410 (base32 "1ivkig6q7i4n389dg1zv06cmfki20bjq0slmshx0p5a1aavkqj7k"))))
1411 (build-system gnu-build-system)
1412 (native-inputs
1413 `(("autoconf" ,autoconf)
1414 ("automake" ,automake)
1415 ("libtool" ,libtool)
1416 ("pkg-config" ,pkg-config)
1417 ("python" ,python) ; for the tests
1418 ("util-linux" ,util-linux) ; provides the hexdump command for tests
1419 ("qttools" ,qttools)))
1420 (inputs
1421 `(("bdb" ,bdb-4.8)
1422 ("boost" ,boost)
1423 ("libevent" ,libevent)
1424 ("miniupnpc" ,miniupnpc)
1425 ("openssl" ,openssl)
1426 ("protobuf" ,protobuf)
1427 ("qrencode" ,qrencode)
1428 ("qtbase" ,qtbase)
1429 ("zeromq" ,zeromq)
1430 ("zlib" ,zlib)))
1431 (arguments
1432 `(#:configure-flags
1433 (list
1434 ;; Boost is not found unless specified manually.
1435 (string-append "--with-boost="
1436 (assoc-ref %build-inputs "boost"))
1437 ;; XXX: The configure script looks up Qt paths by
1438 ;; `pkg-config --variable=host_bins Qt5Core`, which fails to pick
1439 ;; up executables residing in 'qttools', so we specify them here.
1440 (string-append "ac_cv_path_LRELEASE="
1441 (assoc-ref %build-inputs "qttools")
1442 "/bin/lrelease")
1443 (string-append "ac_cv_path_LUPDATE="
1444 (assoc-ref %build-inputs "qttools")
1445 "/bin/lupdate"))
1446 #:phases
1447 (modify-phases %standard-phases
1448 (add-after 'unpack 'fix-build
1449 (lambda _
1450 ;; The 'stack' header was not included in unlimited.cpp, which
1451 ;; caused the build to fail.
1452 (substitute* "src/unlimited.cpp"
1453 (("#include <queue>" all)
1454 (string-append all "\n#include <stack>")))
1455 #t))
1456 (add-after 'unpack 'fix-tests
1457 (lambda _
1458 ;; TODO: Find why txvalidationcache_tests fails and
1459 ;; utilprocess_tests never ends. Disable for now.
1460 (substitute* "src/Makefile.test.include"
1461 (("test/txvalidationcache_tests.cpp")
1462 "")
1463 (("test/utilprocess_tests.cpp")
1464 ""))
1465 #t))
1466 (add-before 'configure 'make-qt-deterministic
1467 (lambda _
1468 ;; Make Qt deterministic.
1469 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
1470 #t))
1471 (add-before 'check 'set-home
1472 (lambda _
1473 (setenv "HOME" (getenv "TMPDIR")) ; tests write to $HOME
1474 #t)))))
1475 (home-page "https://www.bitcoinunlimited.info/")
1476 (synopsis "Client for the Bitcoin Cash protocol")
1477 (description
1478 "Bitcoin Unlimited is a client for the Bitcoin Cash peer-to-peer
1479 electronic cash system. This package provides a command line client and
1480 a Qt GUI.")
1481 (license license:expat)))
1482
1483 (define-public fulcrum
1484 (package
1485 (name "fulcrum")
1486 (version "1.1.1")
1487 (source
1488 (origin
1489 (method url-fetch)
1490 (uri (string-append "https://gitlab.com/FloweeTheHub/fulcrum/-/archive/v"
1491 version "/fulcrum-v" version ".tar.gz"))
1492 (sha256
1493 (base32 "04w5gw02d39caa8a0l6wkn87kc43zzad2prqsyrcq97vlbkdx6x6"))))
1494 (build-system gnu-build-system)
1495 (arguments
1496 `(#:phases
1497 (modify-phases %standard-phases
1498 ;; Call qmake instead of configure to create a Makefile.
1499 (replace 'configure
1500 (lambda _
1501 (invoke
1502 "qmake"
1503 (string-append "PREFIX=" %output)
1504 "features="))))))
1505 (native-inputs
1506 `(("qttools" ,qttools)))
1507 (inputs
1508 `(("python" ,python)
1509 ("qtbase" ,qtbase)
1510 ("rocksdb" ,rocksdb)
1511 ("zlib" ,zlib)))
1512 (home-page "https://gitlab.com/FloweeTheHub/fulcrum/")
1513 (synopsis "Fast and nimble SPV server for Bitcoin Cash")
1514 (description
1515 "Flowee Fulcrum is a server that is the back-end for @acronym{SPV,
1516 Simplified Payment Verification} wallets, it provides the full API for those
1517 walets in a fast and small server. The full data is stored in a full node,
1518 like Flowee the Hub, which Fulcrum connects to over RPC.")
1519 (license license:gpl3+)))
1520
1521 (define-public flowee
1522 (package
1523 (name "flowee")
1524 (version "2020.04.1")
1525 (source
1526 (origin
1527 (method url-fetch)
1528 (uri (string-append "https://gitlab.com/FloweeTheHub/thehub/-/archive/"
1529 version "/thehub-" version ".tar.gz"))
1530 (sha256
1531 (base32 "1vwvaxm3b71pfx8l4rrv06wqks6xdf2333w856b36s1bzvj53rhc"))))
1532 (build-system cmake-build-system)
1533 (arguments
1534 `(#:configure-flags '("-Dbuild_tests=ON" "-Denable_gui=OFF")
1535 #:phases
1536 (modify-phases %standard-phases
1537 (add-before 'configure 'make-qt-deterministic
1538 (lambda _
1539 ;; Make Qt deterministic.
1540 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
1541 #t))
1542 (add-before 'configure 'disable-black-box
1543 ;; the black-box testing runs full hubs and lets them interact.
1544 ;; this is more fragile and a slow machine, or low memory machine, may
1545 ;; make the tests timeout and fail. We just disable them here.
1546 (lambda _
1547 (substitute* "testing/CMakeLists.txt"
1548 (("test_api") ""))
1549 (substitute* "testing/CMakeLists.txt"
1550 (("add_subdirectory\\(api\\)") ""))
1551 #t))
1552 (add-after 'configure 'set-build-info
1553 ;; Their genbuild.sh to generate a build.h fails in guix (no .git dir) .
1554 ;; Its purpose is to write the tag name in the build.h file. We do that
1555 ;; here instead.
1556 (lambda _
1557 (with-output-to-file "include/build.h"
1558 (lambda _
1559 (display
1560 (string-append "#define BUILD_DESC " "\"", version "\""))))))
1561 (add-before 'check 'set-home
1562 (lambda _
1563 (setenv "HOME" (getenv "TMPDIR")) ; tests write to $HOME
1564 #t))
1565 (replace 'check
1566 (lambda _
1567 (invoke "make" "check" "-C" "testing"))))))
1568 (inputs
1569 `(("boost" ,boost)
1570 ("gmp" ,gmp)
1571 ("libevent" ,libevent)
1572 ("miniupnpc" ,miniupnpc)
1573 ("openssl" ,openssl)
1574 ("qtbase" ,qtbase)))
1575 (native-inputs
1576 `(("pkg-config" ,pkg-config)
1577 ("qttools" ,qttools)
1578 ("util-linux" ,util-linux))) ; provides the hexdump command for tests
1579 (home-page "https://flowee.org")
1580 (synopsis "Flowee infrastructure tools and services")
1581 (description
1582 "Flowee packages all tier-1 applications and services from the Flowee group.
1583 This includes components like The Hub and Indexer which and various others
1584 that allows you to run services and through them access the Bitcoin Cash networks.")
1585 (license license:gpl3+)))
1586
1587
1588 (define-public beancount
1589 (package
1590 (name "beancount")
1591 (version "2.2.3")
1592 (source
1593 (origin
1594 (method url-fetch)
1595 (uri (pypi-uri "beancount" version))
1596 (sha256
1597 (base32
1598 "0pcfl2rx2ng06i4f9izdpnlnb1k0rdzsckbzzn4cn4ixfzyssm0m"))
1599 (patches (search-patches "beancount-disable-googleapis-fonts.patch"))))
1600 (build-system python-build-system)
1601 (arguments
1602 `(#:tests? #f ; Says test is missing, not sure why
1603 #:phases
1604 (modify-phases %standard-phases
1605 ;; Not importing the googleapis package for now
1606 (add-after 'unpack 'ignore-googleapis
1607 (lambda _
1608 (substitute* "setup.py"
1609 (("'google-api-python-client',") ""))
1610 #t)))))
1611 (inputs
1612 `(("python-beautifulsoup4" ,python-beautifulsoup4)
1613 ("python-bottle" ,python-bottle)
1614 ("python-chardet" ,python-chardet)
1615 ("python-dateutil" ,python-dateutil)
1616 ("python-lxml" ,python-lxml)
1617 ("python-magic" ,python-magic)
1618 ("python-ply" ,python-ply)
1619 ("python-requests" ,python-requests)))
1620 (native-inputs
1621 `(("python-pytest" ,python-pytest)))
1622 (home-page "http://furius.ca/beancount")
1623 (synopsis "Command-line double-entry accounting tool")
1624 (description
1625 "Beancount is a double-entry bookkeeping computer language that lets you
1626 define financial transaction records in a text file, read them in memory,
1627 generate a variety of reports from them, and provides a web interface.")
1628 (license license:gpl2)))
1629
1630 ;; The beancount source ships with elisp in a subdirectory
1631 (define-public emacs-beancount
1632 (package
1633 (inherit beancount)
1634 (name "emacs-beancount")
1635 (build-system emacs-build-system)
1636 (arguments
1637 `(#:tests? #f ;no tests
1638 #:phases
1639 (modify-phases %standard-phases
1640 (add-before 'install 'chdir-emacs
1641 (lambda _
1642 (chdir "editors/emacs")
1643 #t)))))
1644 (inputs '())
1645 (native-inputs '())
1646 (synopsis "Emacs mode for beancount")
1647 (description
1648 "Emacs-beancount is an Emacs mode for the Beancount accounting tool.")))