gnu: Enable tests for ruby-multi-json.
[jackhill/guix/guix.git] / gnu / packages / finance.scm
CommitLineData
20c6b9da 1;;; GNU Guix --- Functional package management for GNU
fe7fa353 2;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
136ff9a2 3;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
d3699b31 4;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
cb0866c3 5;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
9475fd92 6;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
8514662b 7;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
14e09e90 8;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
1c21e734 9;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
5424f9bc 10;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
3da86c52 11;;; Copyright © 2018 Adriano Peluso <catonano@gmail.com>
730553d7 12;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
948e888d 13;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
20c6b9da
AE
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages finance)
fa4f95a7
CB
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
33 #:use-module (guix download)
730553d7 34 #:use-module (guix git-download)
fa4f95a7
CB
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system python)
5424f9bc 38 #:use-module (gnu packages)
fa4f95a7
CB
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages check)
0a551443 42 #:use-module (gnu packages crypto)
fa4f95a7
CB
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages documentation)
45 #:use-module (gnu packages dns)
46 #:use-module (gnu packages emacs)
47 #:use-module (gnu packages graphviz)
48 #:use-module (gnu packages groff)
49 #:use-module (gnu packages libedit)
50 #:use-module (gnu packages libevent)
51 #:use-module (gnu packages libunwind)
96f5e2e9 52 #:use-module (gnu packages libusb)
fa4f95a7
CB
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages multiprecision)
0a551443 55 #:use-module (gnu packages networking)
fa4f95a7
CB
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages protobuf)
58 #:use-module (gnu packages python)
cc6f4912 59 #:use-module (gnu packages python-crypto)
589e3f4e 60 #:use-module (gnu packages python-web)
fa4f95a7 61 #:use-module (gnu packages qt)
1d0865c1 62 #:use-module (gnu packages readline)
fa4f95a7
CB
63 #:use-module (gnu packages texinfo)
64 #:use-module (gnu packages textutils)
65 #:use-module (gnu packages tls)
66 #:use-module (gnu packages upnp)
67 #:use-module (gnu packages web)
68 #:use-module (gnu packages xml)
69 #:use-module (gnu packages gnuzilla))
20c6b9da
AE
70
71(define-public bitcoin-core
72 (package
73 (name "bitcoin-core")
6f88285a 74 (version "0.16.1")
20c6b9da
AE
75 (source (origin
76 (method url-fetch)
77 (uri
78 (string-append "https://bitcoin.org/bin/bitcoin-core-"
14ea30e4 79 version "/bitcoin-" version ".tar.gz"))
20c6b9da
AE
80 (sha256
81 (base32
6f88285a 82 "1zkqp93yircd3pbxczxfnibkpq0sgcv5r7wg6d196b9pwgr9zd39"))))
20c6b9da
AE
83 (build-system gnu-build-system)
84 (native-inputs
85 `(("pkg-config" ,pkg-config)
e49e74f5 86 ("python" ,python) ; for the tests
0193812a
MB
87 ("util-linux" ,util-linux) ; provides the hexdump command for tests
88 ("qttools" ,qttools)))
20c6b9da 89 (inputs
fe7fa353 90 `(("bdb" ,bdb-5.3) ; with 6.2.23, there is an error: ambiguous overload
20c6b9da 91 ("boost" ,boost)
14ea30e4 92 ("libevent" ,libevent)
20c6b9da
AE
93 ("miniupnpc" ,miniupnpc)
94 ("openssl" ,openssl)
95 ("protobuf" ,protobuf)
0193812a 96 ("qtbase" ,qtbase)))
20c6b9da
AE
97 (arguments
98 `(#:configure-flags
99 (list
100 ;; We use a bdb version newer than 4.8.
101 "--with-incompatible-bdb"
102 ;; Boost is not found unless specified manually.
103 (string-append "--with-boost="
0193812a
MB
104 (assoc-ref %build-inputs "boost"))
105 ;; XXX: The configure script looks up Qt paths by
106 ;; `pkg-config --variable=host_bins Qt5Core`, which fails to pick
107 ;; up executables residing in 'qttools', so we specify them here.
108 (string-append "ac_cv_path_LRELEASE="
109 (assoc-ref %build-inputs "qttools")
110 "/bin/lrelease")
111 (string-append "ac_cv_path_LUPDATE="
112 (assoc-ref %build-inputs "qttools")
113 "/bin/lupdate"))
20c6b9da
AE
114 #:phases
115 (modify-phases %standard-phases
116 (add-before 'check 'set-home
117 (lambda _
118 (setenv "HOME" (getenv "TMPDIR"))))))) ; Tests write to $HOME.
119 (home-page "https://bitcoin.org/en/")
120 (synopsis "Bitcoin peer-to-peer client")
121 (description
122 "Bitcoin is a digital currency that enables instant payments to anyone
123anywhere in the world. It uses peer-to-peer technology to operate without
124central authority: managing transactions and issuing money are carried out
125collectively by the network. Bitcoin Core is the reference implementation
126of the bitcoin protocol. This package provides the Bitcoin Core command
127line client and a client based on Qt.")
128 (license license:expat)))
d3699b31
AG
129
130(define-public ledger
131 (package
132 (name "ledger")
133 (version "3.1.1")
134 (source (origin
135 (method url-fetch)
136 (uri (string-append
137 "https://github.com/ledger/ledger/archive/v"
138 version ".tar.gz"))
139 (file-name (string-append name "-" version ".tar.gz"))
140 (sha256
141 (base32
5424f9bc
EB
142 "12jlv3gsjhrja25q9hrwh73cdacd2l3c2yyn8qnijav9mdhnbw4h"))
143 (patches (search-patches "ledger-revert-boost-python-fix.patch"
144 "ledger-fix-uninitialized.patch"))))
d3699b31
AG
145 (build-system cmake-build-system)
146 (arguments
147 `(#:modules ((guix build cmake-build-system)
948e888d 148 ((guix build gnu-build-system) #:prefix gnu:)
d3699b31
AG
149 (guix build utils)
150 (guix build emacs-utils))
151 #:imported-modules (,@%cmake-build-system-modules
152 (guix build emacs-utils))
153 #:configure-flags
154 `("-DBUILD_DOCS:BOOL=ON"
155 "-DBUILD_WEB_DOCS:BOOL=ON"
156 "-DBUILD_EMACSLISP:BOOL=ON"
157 "-DUSE_PYTHON:BOOL=ON"
158 "-DCMAKE_INSTALL_LIBDIR:PATH=lib"
159 ,(string-append "-DUTFCPP_INCLUDE_DIR:PATH="
160 (assoc-ref %build-inputs "utfcpp")
161 "/include"))
948e888d
AI
162 ;; Skip failing test BaselineTest_cmd-org during the check phase.
163 ;; This is a known upstream issue. See
164 ;; https://github.com/ledger/ledger/issues/550
165 #:make-flags (list "ARGS=-E BaselineTest_cmd-org")
d3699b31
AG
166 #:phases
167 (modify-phases %standard-phases
168 (add-before 'configure 'install-examples
169 (lambda* (#:key outputs #:allow-other-keys)
170 (let ((examples (string-append (assoc-ref outputs "out")
171 "/share/doc/ledger/examples")))
172 (install-file "test/input/sample.dat" examples)
173 (install-file "test/input/demo.ledger" examples))
174 #t))
175 (add-after 'build 'build-doc
1f3c4ba8 176 (lambda _ (invoke "make" "doc")))
d3699b31
AG
177 (add-before 'check 'check-setup
178 ;; One test fails if it can't set the timezone.
179 (lambda* (#:key inputs #:allow-other-keys)
180 (setenv "TZDIR"
181 (string-append (assoc-ref inputs "tzdata")
182 "/share/zoneinfo"))
183 #t))
948e888d 184 (replace 'check (assoc-ref gnu:%standard-phases 'check))
d3699b31
AG
185 (add-after 'install 'relocate-elisp
186 (lambda* (#:key outputs #:allow-other-keys)
187 (let* ((site-dir (string-append (assoc-ref outputs "out")
188 "/share/emacs/site-lisp"))
189 (guix-dir (string-append site-dir "/guix.d"))
190 (orig-dir (string-append site-dir "/ledger-mode"))
191 (dest-dir (string-append guix-dir "/ledger-mode")))
192 (mkdir-p guix-dir)
193 (rename-file orig-dir dest-dir)
1f3c4ba8 194 (emacs-generate-autoloads ,name dest-dir)))))))
d3699b31
AG
195 (inputs
196 `(("boost" ,boost)
197 ("gmp" ,gmp)
198 ("libedit" ,libedit)
199 ("mpfr" ,mpfr)
200 ("python" ,python-2)
201 ("tzdata" ,tzdata)
202 ("utfcpp" ,utfcpp)))
203 (native-inputs
b8fc3622 204 `(("emacs" ,emacs-minimal)
d3699b31
AG
205 ("groff" ,groff)
206 ("texinfo" ,texinfo)))
b53a0c88 207 (home-page "https://ledger-cli.org/")
d3699b31
AG
208 (synopsis "Command-line double-entry accounting program")
209 (description
210 "Ledger is a powerful, double-entry accounting system that is
211accessed from the UNIX command-line. This may put off some users, since
212there is no flashy UI, but for those who want unparalleled reporting
213access to their data there are few alternatives.
214
215Ledger uses text files for input. It reads the files and generates
216reports; there is no other database or stored state. To use Ledger,
217you create a file of your account names and transactions, run from the
218command line with some options to specify input and requested reports, and
219get output. The output is generally plain text, though you could generate
220a graph or html instead. Ledger is simple in concept, surprisingly rich
221in ability, and easy to use.")
222 ;; There are some extra licenses in files which do not presently get
223 ;; installed when you build this package. Different versions of the GPL
224 ;; are used in the contrib and python subdirectories. The bundled version
225 ;; of utfcpp is under the Boost 1.0 license. Also the file
226 ;; `tools/update_copyright_year` has an Expat license.
227 (license (list license:bsd-3
228 license:asl2.0 ; src/strptime.cc
229 (license:non-copyleft
230 "file://src/wcwidth.cc"
231 "See src/wcwidth.cc in the distribution.")
232 license:gpl2+)))) ; lisp/*
cb0866c3
HG
233
234(define-public geierlein
235 (package
236 (name "geierlein")
1c21e734 237 (version "0.9.13")
cb0866c3
HG
238 (source
239 (origin
240 (method url-fetch)
241 (uri (string-append "https://github.com/stesie/geierlein"
242 "/archive/V" version ".tar.gz"))
243 (file-name (string-append name "-" version ".tar.gz"))
244 (sha256
245 (base32
1c21e734 246 "11jfa7mxvvf0ldhx0hsvjbx3xwvzvn2wrfjpms8c7qmrnqhwh4wp"))))
cb0866c3
HG
247 (build-system gnu-build-system)
248 (arguments
249 `(#:tests? #f ; would require npm, python and a lot more
250 #:phases
251 (modify-phases %standard-phases
1c21e734 252 (delete 'configure) ; no configure script
cb0866c3
HG
253 (add-after 'unpack 'override-target-directory-and-tool-paths
254 (lambda* (#:key inputs outputs #:allow-other-keys)
255 (substitute* "Makefile"
256 (("prefix := .*")
257 (string-append "prefix := " (assoc-ref outputs "out") "\n"))
258 ;; Required for tests, unused for now:
259 ;;(("PYTHON := .*")
260 ;; (string-append (which "python") "\n")))
261 (("INSTALL := .*")
262 (string-append "INSTALL := " (which "install") "\n")))
263 (substitute* "bin/xgeierlein.in"
264 ;; Use icecat as XULRUNNER
265 (("^for search ")
266 (string-append "XULRUNNER=" (which "icecat") "\n"
267 "for search ")))
268 #t)))))
269 (inputs
270 `(("icecat" ,icecat)))
1e41bb1b 271 (home-page "https://stesie.github.io/geierlein/")
cb0866c3
HG
272 (synopsis "Free Elster client, for sending Germany VAT declarations")
273 (description
274 "Geierlein is a free Elster client, i.e. an application that
275allows to send VAT declarations to Germany's fiscal authorities.
276
277Currently it is *not* possible to send returns that are due annually
278(especially the income tax return) since the fiscal authority doesn't
279allow to do that off the ERiC library (which is proprietary however).
280It's not clear at the moment whether one day it will be possible to
281do so.")
282 (license license:agpl3+)))
9475fd92
CZ
283
284(define-public electrum
285 (package
286 (name "electrum")
840818cb 287 (version "3.2.2")
9475fd92
CZ
288 (source
289 (origin
290 (method url-fetch)
291 (uri (string-append "https://download.electrum.org/"
292 version "/Electrum-"
293 version ".tar.gz"))
294 (sha256
295 (base32
840818cb 296 "1fxaxlf5vm2zydj678ls3pazyriym188iwzk60kyk26cz2p3xk39"))
9475fd92
CZ
297 (modules '((guix build utils)))
298 (snippet
299 '(begin
300 ;; Delete the bundled dependencies.
301 (delete-file-recursively "packages")
302 #t))))
303 (build-system python-build-system)
304 (inputs
47bd32d9
CZ
305 `(("python-pyaes" ,python-pyaes)
306 ("python-pysocks" ,python-pysocks)
307 ("python-sip" ,python-sip)
308 ("python-pyqt" ,python-pyqt)
309 ("python-ecdsa" ,python-ecdsa)
310 ("python-pbkdf2" ,python-pbkdf2)
311 ("python-requests" ,python-requests)
312 ("python-qrcode" ,python-qrcode)
313 ("python-protobuf" ,python-protobuf)
314 ("python-dnspython" ,python-dnspython)
315 ("python-jsonrpclib-pelix" ,python-jsonrpclib-pelix)))
9475fd92 316 (arguments
47bd32d9 317 `(#:tests? #f ;; package doesn't have any tests
9475fd92
CZ
318 #:phases
319 (modify-phases %standard-phases
320 (add-before 'build 'patch-home
321 (lambda* (#:key outputs #:allow-other-keys)
322 (substitute* "setup.py"
323 (("~/.local/share")
324 (string-append (assoc-ref outputs "out") "/local/share"))))))))
325 (home-page "https://electrum.org/")
326 (synopsis "Bitcoin wallet")
327 (description
328 "Electrum is a lightweight Bitcoin client, based on a client-server
329protocol. It supports Simple Payment Verification (SPV) and deterministic key
330generation from a seed. Your secret keys are encrypted and are never sent to
331other machines/servers. Electrum does not download the Bitcoin blockchain.")
332 (license license:expat)))
8514662b 333
a0bb0217
VC
334(define-public electron-cash
335 (package
336 (inherit electrum)
337 (name "electron-cash")
84fbb4b2 338 (version "3.3.1")
a0bb0217
VC
339 (source
340 (origin
341 (method url-fetch)
342 (uri (string-append "https://electroncash.org/downloads/"
343 version
344 "/win-linux/ElectronCash-"
345 version
346 ".tar.gz"))
347 (sha256
348 (base32
84fbb4b2 349 "1jdy89rfdwc2jadx3rqj5yvynpcn90cx6482ax9f1cj9gfxp9j2b"))
a0bb0217
VC
350 (modules '((guix build utils)))
351 (snippet
352 '(begin
353 ;; Delete the bundled dependencies.
354 (delete-file-recursively "packages")
355 #t))))
356 (home-page "https://electroncash.org/")
357 (synopsis "Bitcoin Cash wallet")
358 (description
359 "Electroncash is a lightweight Bitcoin Cash client, based on a client-server
360protocol. It supports Simple Payment Verification (SPV) and deterministic key
361generation from a seed. Your secret keys are encrypted and are never sent to
362other machines/servers. Electroncash does not download the Bitcoin Cash blockchain.")
363 (license license:expat)))
364
8514662b
TF
365(define-public monero
366 ;; This package bundles easylogging++ and lmdb.
367 ;; The bundled easylogging++ is modified, and the changes will not be upstreamed.
368 ;; The devs deem the lmdb driver too critical a consenus component, to use
369 ;; the system's dynamically linked library.
370 (package
371 (name "monero")
0a551443 372 (version "0.12.3.0")
8514662b
TF
373 (source
374 (origin
0a551443
TF
375 (method git-fetch)
376 (uri (git-reference
377 (url "https://github.com/monero-project/monero")
378 (commit (string-append "v" version))))
136ff9a2 379 (file-name (git-file-name name version))
0a551443 380 (patches (search-patches "monero-use-system-miniupnpc.patch"))
8514662b
TF
381 (sha256
382 (base32
0a551443 383 "14db9kgjm2ha93c2x5fjdw01xaqshn756qr3x2cnzyyjh7caz5qd"))))
8514662b
TF
384 (build-system cmake-build-system)
385 (native-inputs
386 `(("doxygen" ,doxygen)
387 ("googletest" ,googletest)
388 ("graphviz" ,graphviz)
389 ("pkg-config" ,pkg-config)))
390 (inputs
391 `(("bind" ,isc-bind)
392 ("boost" ,boost)
0a551443
TF
393 ("zeromq" ,zeromq)
394 ("cppzmq" ,cppzmq)
8514662b 395 ("expat" ,expat)
0a551443 396 ("libsodium" ,libsodium)
8514662b
TF
397 ("libunwind" ,libunwind)
398 ("lmdb" ,lmdb)
0a551443 399 ("miniupnpc" ,monero-miniupnpc)
8514662b
TF
400 ("openssl" ,openssl)
401 ("rapidjson" ,rapidjson)
402 ("unbound" ,unbound)))
403 (arguments
404 `(#:out-of-source? #t
0a551443 405 #:build-type "release"
8514662b 406 #:configure-flags '("-DBUILD_TESTS=ON"
fa7647c6
EF
407 ,@(if (string=? "aarch64-linux" (%current-system))
408 '("-DARCH=armv8-a")
409 '())
8514662b
TF
410 "-DBUILD_GUI_DEPS=ON")
411 #:phases
412 (modify-phases %standard-phases
413 ;; tests/core_tests need a valid HOME
414 (add-before 'configure 'set-home
415 (lambda _
416 (setenv "HOME" (getcwd))
417 #t))
418 (add-after 'set-home 'fix-wallet-path-for-unit-tests
419 (lambda _
420 (substitute* "tests/unit_tests/serialization.cpp"
421 (("\\.\\./\\.\\./\\.\\./\\.\\./") "../../"))
422 #t))
423 (add-after 'fix-wallet-path-for-unit-tests 'change-log-path
424 (lambda _
425 (substitute* "contrib/epee/src/mlog.cpp"
426 (("epee::string_tools::get_current_module_folder\\(\\)")
427 "\".bitmonero\""))
428 (substitute* "contrib/epee/src/mlog.cpp"
429 (("return \\(") "return ((std::string(getenv(\"HOME\"))) / "))
430 #t))
431 (replace 'check
432 (lambda _
797445be
TF
433 (invoke "make" "ARGS=-E 'unit_tests|libwallet_api_tests'"
434 "test")))
8514662b
TF
435 ;; The excluded unit tests need network access
436 (add-after 'check 'unit-tests
437 (lambda _
438 (let ((excluded-unit-tests
439 (string-join
440 '("AddressFromURL.Success"
441 "AddressFromURL.Failure"
442 "DNSResolver.IPv4Success"
443 "DNSResolver.DNSSECSuccess"
444 "DNSResolver.DNSSECFailure"
445 "DNSResolver.GetTXTRecord")
446 ":")))
797445be
TF
447 (invoke "tests/unit_tests/unit_tests"
448 (string-append "--gtest_filter=-"
449 excluded-unit-tests)))))
8514662b
TF
450 (add-after 'install 'install-blockchain-import-export
451 (lambda* (#:key outputs #:allow-other-keys)
452 (let* ((out (assoc-ref outputs "out"))
453 (bin (string-append out "/bin")))
454 (install-file "bin/monero-blockchain-import" bin)
455 (install-file "bin/monero-blockchain-export" bin)))))))
456 (home-page "https://getmonero.org/")
457 (synopsis "Command-line interface to the Monero currency")
458 (description
459 "Monero is a secure, private, untraceable currency. This package provides the
460Monero command line client and daemon.")
461 (license license:bsd-3)))
79228a52 462
f7e24839 463(define-public monero-gui
79228a52 464 (package
f7e24839 465 (name "monero-gui")
3902bc5c 466 (version "0.12.2.0")
79228a52
TF
467 (source
468 (origin
3902bc5c
TF
469 (method git-fetch)
470 (uri (git-reference
f7e24839 471 (url "https://github.com/monero-project/monero-gui")
3902bc5c 472 (commit (string-append "v" version))))
398a96a2 473 (file-name (git-file-name name version))
79228a52
TF
474 (sha256
475 (base32
3902bc5c 476 "1cnrkwh7kp64lnzz1xfmkf1mhsgm5gls292gpqai3jr8jydpkahl"))))
79228a52
TF
477 (build-system gnu-build-system)
478 (native-inputs
479 `(("doxygen" ,doxygen)
480 ("graphviz" ,graphviz)
6915d20f
EF
481 ("pkg-config" ,pkg-config)
482 ("qttools" ,qttools)))
79228a52
TF
483 (inputs
484 `(("boost" ,boost)
485 ("libunwind" ,libunwind)
486 ("openssl" ,openssl)
6915d20f
EF
487 ("qtbase" ,qtbase)
488 ("qtdeclarative" ,qtdeclarative)
489 ("qtgraphicaleffects" ,qtgraphicaleffects)
490 ("qtquickcontrols" ,qtquickcontrols)
1d0865c1 491 ("readline" ,readline)
79228a52
TF
492 ("unbound" ,unbound)))
493 (propagated-inputs
494 `(("monero" ,monero)))
495 (arguments
496 `(#:phases
497 (modify-phases %standard-phases
498 (delete 'configure)
499 (delete 'check)
500 (add-before 'build 'fix-makefile-vars
501 (lambda _
502 (substitute* "src/zxcvbn-c/makefile"
503 (("\\?=") "="))
504 #t))
505 (add-after 'fix-makefile-vars 'fix-library-paths
506 (lambda* (#:key inputs #:allow-other-keys)
507 (substitute* "monero-wallet-gui.pro"
508 (("-L/usr/local/lib") "")
509 (("-L/usr/local/opt/openssl/lib")
510 (string-append "-L"
511 (assoc-ref inputs "openssl")
512 "/lib"))
513 (("-L/usr/local/opt/boost/lib")
514 (string-append "-L"
515 (assoc-ref inputs "boost")
516 "/lib")))
517 #t))
518 (add-after 'fix-library-paths 'fix-monerod-path
519 (lambda* (#:key inputs #:allow-other-keys)
520 (substitute* "src/daemon/DaemonManager.cpp"
521 (("QApplication::applicationDirPath\\(\\) \\+ \"/monerod")
522 (string-append "\""(assoc-ref inputs "monero")
523 "/bin/monerod")))
524 #t))
6915d20f
EF
525 (add-after 'fix-monerod-path 'fix-qt-paths
526 (lambda* (#:key inputs #:allow-other-keys)
527 (let* ((qttools (assoc-ref inputs "qttools"))
528 (lrelease (string-append qttools "/bin/lrelease"))
529 (lupdate (string-append qttools "/bin/lupdate")))
530 (substitute* "monero-wallet-gui.pro"
531 (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease") lrelease)
532 (("\\$\\$\\[QT_INSTALL_BINS\\]/lupdate") lupdate))
533 #t)))
79228a52
TF
534 (replace 'build
535 (lambda _
88d5ee44 536 (invoke "./build.sh")))
79228a52
TF
537 (add-after 'build 'fix-install-path
538 (lambda* (#:key outputs #:allow-other-keys)
539 (substitute* "build/Makefile"
540 (("/opt/monero-wallet-gui")
541 (assoc-ref outputs "out")))
542 #t))
543 (add-before 'install 'change-dir
544 (lambda _
6915d20f
EF
545 (chdir "build")))
546 (add-after 'install 'wrap-executable
547 (lambda* (#:key inputs outputs #:allow-other-keys)
548 (let ((out (assoc-ref outputs "out")))
549 (wrap-program (string-append out "/bin/monero-wallet-gui")
550 `("QT_PLUGIN_PATH" ":" prefix
551 ,(map (lambda (label)
552 (string-append (assoc-ref inputs label)
553 "/lib/qt5/plugins"))
554 '("qtbase" "qtdeclarative")))
555 `("QML2_IMPORT_PATH" ":" prefix
556 ,(map (lambda (label)
557 (string-append (assoc-ref inputs label)
558 "/lib/qt5/qml"))
559 '("qtdeclarative" "qtgraphicaleffects"
560 "qtquickcontrols"))))
561 #t))))))
79228a52
TF
562 (home-page "https://getmonero.org/")
563 (synopsis "Graphical user interface for the Monero currency")
564 (description
565 "Monero is a secure, private, untraceable currency. This package provides the
566Monero GUI client.")
567 (license license:bsd-3)))
00d3f022 568
f7e24839
TF
569(define-public monero-core
570 (deprecated-package "monero-core" monero-gui))
571
00d3f022
DM
572(define-public python-trezor-agent
573 (package
574 (name "python-trezor-agent")
575 (version "0.9.4")
576 (source
577 (origin
578 (method url-fetch)
579 (uri (string-append "https://github.com/romanz/trezor-agent/archive/v"
580 version ".tar.gz"))
581 (file-name (string-append name "-" version ".tar.gz"))
582 (sha256
583 (base32
584 "0h8jb147vpjk7mqbl4za0xdh7lblhx07n9dfk80kn2plwnvrry1x"))))
585 (build-system python-build-system)
586 (arguments
587 `(#:phases
588 (modify-phases %standard-phases
589 (delete 'check)
590 (add-after 'install 'check
591 (lambda* (#:key outputs inputs #:allow-other-keys)
592 ;; Make installed package available for running the tests
593 (add-installed-pythonpath inputs outputs)
594 (invoke "py.test"))))))
595 (propagated-inputs
596 `(("python-ecdsa" ,python-ecdsa)
597 ("python-ed25519" ,python-ed25519)
598 ("python-semver" ,python-semver)
599 ("python-unidecode" ,python-unidecode)))
600 (native-inputs
601 `(("python-mock" ,python-mock)
602 ("python-pytest" ,python-pytest)))
603 (home-page "https://github.com/romanz/trezor-agent")
604 (synopsis "TREZOR SSH and GPG host support")
605 (description
606 "@code{libagent} is a library that allows using TREZOR, Keepkey and
607Ledger Nano as a hardware SSH/GPG agent.")
608 (license license:lgpl3)))
609
610(define-public python2-trezor-agent
611 (package-with-python2 python-trezor-agent))
6e9749ef
DM
612
613(define-public python-mnemonic
614 (package
615 (name "python-mnemonic")
616 (version "0.18")
617 (source
618 (origin
619 (method url-fetch)
620 (uri (pypi-uri "mnemonic" version))
621 (sha256
622 (base32
623 "07bzfa5di6nv5xwwcwbypnflpj50wlfczhh6q6hg8w13g5m319q2"))))
624 (build-system python-build-system)
625 (propagated-inputs
626 `(("python-pbkdf2" ,python-pbkdf2)))
627 (home-page "https://github.com/trezor/python-mnemonic")
628 (synopsis "Implementation of Bitcoin BIP-0039")
629 (description "@code{mnemonic} is a library that provides an implementation
630of Bitcoin BIP-0039.")
631 (license license:expat)))
632
633(define-public python2-mnemonic
634 (package-with-python2 python-mnemonic))
96f5e2e9
DM
635
636(define-public python-ledgerblue
637 (package
638 (name "python-ledgerblue")
639 (version "0.1.16")
640 (source
641 (origin
642 (method url-fetch)
643 (uri (pypi-uri "ledgerblue" version))
644 (sha256
645 (base32
646 "010mghaqh1cmz3a0ifc3f40mmyplilwlw7kpha2mzyrrff46p9gb"))))
647 (build-system python-build-system)
648 (propagated-inputs
649 `(("python-ecpy" ,python-ecpy)
650 ("python-future" ,python-future)
651 ("python-hidapi" ,python-hidapi)
652 ("python-pillow" ,python-pillow)
653 ("python-protobuf" ,python-protobuf)
654 ("python-pycrypto" ,python-pycrypto)))
655 (home-page "https://github.com/LedgerHQ/blue-loader-python")
656 (synopsis "Python library to communicate with Ledger Blue/Nano S")
657 (description "@code{ledgerblue} is a Python library to communicate with
658Ledger Blue/Nano S.")
659 (license license:asl2.0)))
660
661(define-public python2-ledgerblue
662 (package-with-python2 python-ledgerblue))
663
1dca32e3
DM
664(define-public python-trezor
665 (package
666 (name "python-trezor")
b4c698c8 667 (version "0.10.2")
1dca32e3
DM
668 (source
669 (origin
670 (method url-fetch)
671 (uri (pypi-uri "trezor" version))
672 (sha256
673 (base32
b4c698c8 674 "138k6zsqqpb46k3rcpyslm9q7yq5i6k4myvr9n425jnkadf4vfjd"))))
1dca32e3 675 (build-system python-build-system)
b4c698c8
VC
676 (arguments
677 `(#:phases
678 (modify-phases %standard-phases
679 ;; Default tests run device-specific tests which fail, only run specific tests.
680 (replace 'check
681 (lambda* (#:key inputs outputs #:allow-other-keys)
682 (invoke "python" "-m" "pytest" "--pyarg" "trezorlib.tests.unit_tests")
683 (invoke "python" "-m" "pytest" "-m" "slow_cosi" "--pyarg" "trezorlib.tests.unit_tests")
684 )))))
1dca32e3 685 (propagated-inputs
b4c698c8
VC
686 `(("python-click" ,python-click)
687 ("python-ecdsa" ,python-ecdsa)
1dca32e3 688 ("python-hidapi" ,python-hidapi)
b4c698c8 689 ("python-libusb1" ,python-libusb1)
1dca32e3
DM
690 ("python-mnemonic" ,python-mnemonic)
691 ("python-protobuf" ,python-protobuf)
b4c698c8
VC
692 ("python-pyblake2" ,python-pyblake2)
693 ("python-requests" ,python-requests)
694 ("python-typing" ,python-typing)))
1dca32e3 695 (native-inputs
b4c698c8
VC
696 `(("python-mock" ,python-mock) ; Tests
697 ("python-pyqt" ,python-pyqt) ; Tests
698 ("python-pytest" ,python-pytest))) ; Tests
1dca32e3
DM
699 (home-page "https://github.com/trezor/python-trezor")
700 (synopsis "Python library for communicating with TREZOR Hardware Wallet")
701 (description "@code{trezor} is a Python library for communicating with
702TREZOR Hardware Wallet.")
703 (license license:lgpl3)))
704
705(define-public python2-trezor
706 (package-with-python2 python-trezor))
d596fea5 707
d6ddeffc
DM
708(define-public python-keepkey
709 (package
710 (name "python-keepkey")
711 (version "4.0.2")
712 (source
713 (origin
714 (method url-fetch)
715 (uri (pypi-uri "keepkey" version))
716 (sha256
717 (base32
718 "0f4iqqjlqmamw4mhyhik4qlb5bnfd10wbjw9yzgir105wh5fdpnd"))))
719 (build-system python-build-system)
720 (arguments
721 `(#:phases
722 (modify-phases %standard-phases
723 (delete 'check)
724 (add-after 'install 'check
725 (lambda* (#:key inputs outputs #:allow-other-keys)
726 (add-installed-pythonpath inputs outputs)
727 (apply invoke "python" (find-files "tests/unit" "\\.py$")))))))
728 (propagated-inputs
729 `(("python-ecdsa" ,python-ecdsa)
730 ("python-hidapi" ,python-hidapi)
731 ("python-mnemonic" ,python-mnemonic)
732 ("python-protobuf" ,python-protobuf)))
733 (home-page "https://github.com/keepkey/python-keepkey")
734 (synopsis "Python library for communicating with KeepKey Hardware Wallet")
735 (description "@code{keepkey} is a Python library for communicating with
736the KeepKey Hardware Wallet.")
737 (license license:lgpl3)))
738
739(define-public python2-keepkey
740 (package-with-python2 python-keepkey))
741
d596fea5
DM
742(define-public ledger-agent
743 (package
744 (name "ledger-agent")
745 (version "0.9.0")
746 (source
747 (origin
748 (method url-fetch)
749 (uri (pypi-uri "ledger_agent" version))
750 (sha256
751 (base32
752 "03zj602m2rln9yvr08dswy56vzkbldp8b074ixwzz525dafblr92"))))
753 (build-system python-build-system)
754 (inputs
755 `(("python-ledgerblue" ,python-ledgerblue)
756 ("python-trezor-agent" ,python-trezor-agent)))
757 (home-page "http://github.com/romanz/trezor-agent")
758 (synopsis "Ledger as hardware SSH/GPG agent")
759 (description "This package allows using Ledger as hardware SSH/GPG agent.
760
5859fd6c
MB
761Usage for SSH: trezor-agent foo@@example.com --connect
762Usage for GPG: Initialize using trezor-gpg init \"Foo <foo@@example.com>\"
d596fea5
DM
763Then set the environment variable GNUPGHOME to
764\"${HOME}/.gnupg/trezor\".")
765 (license license:lgpl3)))
47c8ea99
DM
766
767(define-public trezor-agent
768 (package
769 (name "trezor-agent")
770 (version "0.9.0")
771 (source
772 (origin
773 (method url-fetch)
774 (uri (pypi-uri "trezor_agent" version))
775 (sha256
776 (base32
777 "1i5cdamlf3c0ym600pjklij74p8ifj9cv7xrpnrfl1b8nkadswbz"))))
778 (build-system python-build-system)
779 (inputs
780 `(("python-trezor" ,python-trezor)
781 ("python-trezor-agent" ,python-trezor-agent)))
782 (home-page "http://github.com/romanz/trezor-agent")
783 (synopsis "Using Trezor as hardware SSH/GPG agent")
784 (description "This package allows using Trezor as a hardware SSH/GPG
785agent.")
786 (license license:lgpl3)))
50c4d676
DM
787
788(define-public keepkey-agent
789 (package
790 (name "keepkey-agent")
791 (version "0.9.0")
792 (source
793 (origin
794 (method url-fetch)
795 (uri (pypi-uri "keepkey_agent" version))
796 (sha256
797 (base32
798 "03779gvlx70i0nnry98i4pl1d92604ix5x6jgdfkrdgzqbh5vj27"))))
799 (build-system python-build-system)
800 (inputs
801 `(("python-keepkey" ,python-keepkey)
802 ("python-trezor-agent" ,python-trezor-agent)))
803 (home-page "http://github.com/romanz/trezor-agent")
804 (synopsis "KeepKey as hardware SSH/GPG agent")
805 (description "This package allows using KeepKey as a hardware SSH/GPG
806agent.")
807 (license license:lgpl3)))
3da86c52
AP
808
809(define-public python-stdnum
810 (package
811 (name "python-stdnum")
812 (version "1.8.1")
813 (source
814 (origin
815 (method url-fetch)
816 (uri (pypi-uri "python-stdnum" version))
817 (sha256
818 (base32
819 "0hvr47q32xbyiznpmbg4r8rcvxhnf0lwf33hcpnynyik57djy5np"))))
820 (build-system python-build-system)
821 (home-page
822 "https://arthurdejong.org/python-stdnum/")
823 (synopsis
824 "Python module to handle standardized number and code formats")
825 (description
826 "This is a Python library that aims to provide functions to handle,
827parse and validate standard numbers.
828The module supports more than 100 different number formats
829amongst which a great number of VAT and other tax numbers,
830personal identity and company identification codes,
831international standard numbers (ISBN, IBAN, EAN, etc.)
832and various other formats.
833The module also inclused implementations of the Verhoeff,
834Luhn and family of ISO/IEC 7064 check digit algorithms. ")
835 (license license:lgpl2.1+)))
836
837(define-public python2-stdnum
838 (package-with-python2 python-stdnum))
730553d7 839
c7299015
NG
840(define-public python-duniterpy
841 (package
842 (name "python-duniterpy")
7dab3e61 843 (version "0.43.7")
c7299015
NG
844 (source
845 (origin
846 (method git-fetch)
847 ;; Pypi's default URI is missing "requirements.txt" file.
848 (uri (git-reference
7dab3e61 849 (url "https://git.duniter.org/clients/python/duniterpy.git")
c7299015
NG
850 (commit version)))
851 (file-name (git-file-name name version))
852 (sha256
853 (base32
7dab3e61 854 "19m36z98361bqxjdb65597j2kxbly491927c6p9z47s1vxc3raaq"))))
c7299015 855 (build-system python-build-system)
c7299015
NG
856 (propagated-inputs
857 `(("python-aiohttp" ,python-aiohttp)
858 ("python-base58" ,python-base58)
859 ("python-jsonschema" ,python-jsonschema)
860 ("python-libnacl" ,python-libnacl)
861 ("python-pylibscrypt" ,python-pylibscrypt)
862 ("python-pypeg2" ,python-pypeg2)))
9f1a2be2 863 (home-page "https://git.duniter.org/clients/python/duniterpy")
c7299015
NG
864 (synopsis "Python implementation of Duniter API")
865 (description "@code{duniterpy} is an implementation of
866@uref{https://github.com/duniter/duniter/, duniter} API. Its
867main features are:
868@itemize
869@item Supports Duniter's Basic Merkle API and protocol
870@item Asynchronous
871@item Duniter signing key
872@end itemize")
873 (license license:gpl3+)))
874
730553d7
NG
875(define-public silkaj
876 (package
877 (name "silkaj")
878 (version "0.5.0")
879 (source
880 (origin
881 (method git-fetch)
882 (uri (git-reference
883 (url "https://git.duniter.org/clients/python/silkaj.git")
884 (commit (string-append "v" version))))
885 (file-name (git-file-name name version))
886 (sha256
887 (base32
888 "0xy25lpgz04nxikjvxlnlckrc9xmsxyiz2qm0bsiid8cnbdqcn12"))))
889 (build-system python-build-system)
890 (arguments
891 `(#:tests? #f ;no test
892 #:phases
893 (modify-phases %standard-phases
894 ;; The program is just a bunch of Python files in "src/" directory.
895 ;; Many phases are useless. However, `python-build-system' correctly
896 ;; sets PYTHONPATH and patches Python scripts.
897 (delete 'configure)
898 (delete 'build)
899 (replace 'install
900 (lambda* (#:key outputs #:allow-other-keys)
901 (let* ((out (assoc-ref outputs "out"))
902 (share (string-append out "/share/silkaj"))
903 (executable (string-append share "/silkaj.py"))
904 (bin (string-append out "/bin")))
905 ;; Install data.
906 (copy-recursively "src" share)
907 ;; Install executable.
908 (mkdir-p bin)
909 (with-directory-excursion bin
910 (symlink executable "silkaj")))
911 #t)))))
912 (inputs
913 `(("python-commandlines" ,python-commandlines)
914 ("python-ipaddress" ,python-ipaddress)
915 ("python-pyaes" ,python-pyaes)
916 ("python-pynacl" ,python-pynacl)
917 ("python-scrypt" ,python-scrypt)
918 ("python-tabulate" ,python-tabulate)))
919 (home-page "https://silkaj.duniter.org/")
920 (synopsis "Command line client for Duniter network")
921 (description "@code{Silkaj} is a command line client for the
922@uref{https://github.com/duniter/duniter/, Duniter} network.
923
924Its features are:
925@itemize
926@item information about currency,
927@item issuers difficulty to generate next block,
928@item network view of nodes,
929@item list of last issuers,
930@item send transactions,
931@item get account amount.
932@end itemize")
933 (license license:agpl3+)))