Merge branch 'master' into staging
[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 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 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 Nicolas Goaziou <mail@nicolasgoaziou.fr>
13 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
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)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix git-download)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system python)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages check)
42 #:use-module (gnu packages crypto)
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)
52 #:use-module (gnu packages libusb)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages multiprecision)
55 #:use-module (gnu packages networking)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages protobuf)
58 #:use-module (gnu packages python)
59 #:use-module (gnu packages python-crypto)
60 #:use-module (gnu packages python-web)
61 #:use-module (gnu packages qt)
62 #:use-module (gnu packages readline)
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))
70
71 (define-public bitcoin-core
72 (package
73 (name "bitcoin-core")
74 (version "0.16.1")
75 (source (origin
76 (method url-fetch)
77 (uri
78 (string-append "https://bitcoin.org/bin/bitcoin-core-"
79 version "/bitcoin-" version ".tar.gz"))
80 (sha256
81 (base32
82 "1zkqp93yircd3pbxczxfnibkpq0sgcv5r7wg6d196b9pwgr9zd39"))))
83 (build-system gnu-build-system)
84 (native-inputs
85 `(("pkg-config" ,pkg-config)
86 ("python" ,python) ; for the tests
87 ("util-linux" ,util-linux) ; provides the hexdump command for tests
88 ("qttools" ,qttools)))
89 (inputs
90 `(("bdb" ,bdb-5.3) ; with 6.2.23, there is an error: ambiguous overload
91 ("boost" ,boost)
92 ("libevent" ,libevent)
93 ("miniupnpc" ,miniupnpc)
94 ("openssl" ,openssl)
95 ("protobuf" ,protobuf)
96 ("qtbase" ,qtbase)))
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="
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"))
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
123 anywhere in the world. It uses peer-to-peer technology to operate without
124 central authority: managing transactions and issuing money are carried out
125 collectively by the network. Bitcoin Core is the reference implementation
126 of the bitcoin protocol. This package provides the Bitcoin Core command
127 line client and a client based on Qt.")
128 (license license:expat)))
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
142 "12jlv3gsjhrja25q9hrwh73cdacd2l3c2yyn8qnijav9mdhnbw4h"))
143 (patches (search-patches "ledger-revert-boost-python-fix.patch"
144 "ledger-fix-uninitialized.patch"))))
145 (build-system cmake-build-system)
146 (arguments
147 `(#:modules ((guix build cmake-build-system)
148 ((guix build gnu-build-system) #:prefix gnu:)
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"))
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")
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
176 (lambda _ (invoke "make" "doc")))
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))
184 (replace 'check (assoc-ref gnu:%standard-phases 'check))
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)
194 (emacs-generate-autoloads ,name dest-dir)))))))
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
204 `(("emacs" ,emacs-minimal)
205 ("groff" ,groff)
206 ("texinfo" ,texinfo)))
207 (home-page "https://ledger-cli.org/")
208 (synopsis "Command-line double-entry accounting program")
209 (description
210 "Ledger is a powerful, double-entry accounting system that is
211 accessed from the UNIX command-line. This may put off some users, since
212 there is no flashy UI, but for those who want unparalleled reporting
213 access to their data there are few alternatives.
214
215 Ledger uses text files for input. It reads the files and generates
216 reports; there is no other database or stored state. To use Ledger,
217 you create a file of your account names and transactions, run from the
218 command line with some options to specify input and requested reports, and
219 get output. The output is generally plain text, though you could generate
220 a graph or html instead. Ledger is simple in concept, surprisingly rich
221 in 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/*
233
234 (define-public geierlein
235 (package
236 (name "geierlein")
237 (version "0.9.13")
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
246 "11jfa7mxvvf0ldhx0hsvjbx3xwvzvn2wrfjpms8c7qmrnqhwh4wp"))))
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
252 (delete 'configure) ; no configure script
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)))
271 (home-page "https://stesie.github.io/geierlein/")
272 (synopsis "Free Elster client, for sending Germany VAT declarations")
273 (description
274 "Geierlein is a free Elster client, i.e. an application that
275 allows to send VAT declarations to Germany's fiscal authorities.
276
277 Currently it is *not* possible to send returns that are due annually
278 (especially the income tax return) since the fiscal authority doesn't
279 allow to do that off the ERiC library (which is proprietary however).
280 It's not clear at the moment whether one day it will be possible to
281 do so.")
282 (license license:agpl3+)))
283
284 (define-public electrum
285 (package
286 (name "electrum")
287 (version "3.2.2")
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
296 "1fxaxlf5vm2zydj678ls3pazyriym188iwzk60kyk26cz2p3xk39"))
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
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)))
316 (arguments
317 `(#:tests? #f ;; package doesn't have any tests
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
329 protocol. It supports Simple Payment Verification (SPV) and deterministic key
330 generation from a seed. Your secret keys are encrypted and are never sent to
331 other machines/servers. Electrum does not download the Bitcoin blockchain.")
332 (license license:expat)))
333
334 (define-public electron-cash
335 (package
336 (inherit electrum)
337 (name "electron-cash")
338 (version "3.3")
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
349 "1x487hyacdm1qhik1mhfimr4jwcwz7sgsbkh11awrb6j19sxdxym"))
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
360 protocol. It supports Simple Payment Verification (SPV) and deterministic key
361 generation from a seed. Your secret keys are encrypted and are never sent to
362 other machines/servers. Electroncash does not download the Bitcoin Cash blockchain.")
363 (license license:expat)))
364
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")
372 (version "0.12.3.0")
373 (source
374 (origin
375 (method git-fetch)
376 (uri (git-reference
377 (url "https://github.com/monero-project/monero")
378 (commit (string-append "v" version))))
379 (file-name (string-append name "-" version ".tar.gz"))
380 (patches (search-patches "monero-use-system-miniupnpc.patch"))
381 (sha256
382 (base32
383 "14db9kgjm2ha93c2x5fjdw01xaqshn756qr3x2cnzyyjh7caz5qd"))))
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)
393 ("zeromq" ,zeromq)
394 ("cppzmq" ,cppzmq)
395 ("expat" ,expat)
396 ("libsodium" ,libsodium)
397 ("libunwind" ,libunwind)
398 ("lmdb" ,lmdb)
399 ("miniupnpc" ,monero-miniupnpc)
400 ("openssl" ,openssl)
401 ("rapidjson" ,rapidjson)
402 ("unbound" ,unbound)))
403 (arguments
404 `(#:out-of-source? #t
405 #:build-type "release"
406 #:configure-flags '("-DBUILD_TESTS=ON"
407 ,@(if (string=? "aarch64-linux" (%current-system))
408 '("-DARCH=armv8-a")
409 '())
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 _
433 (invoke "make" "ARGS=-E 'unit_tests|libwallet_api_tests'"
434 "test")))
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 ":")))
447 (invoke "tests/unit_tests/unit_tests"
448 (string-append "--gtest_filter=-"
449 excluded-unit-tests)))))
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
460 Monero command line client and daemon.")
461 (license license:bsd-3)))
462
463 (define-public monero-gui
464 (package
465 (name "monero-gui")
466 (version "0.12.2.0")
467 (source
468 (origin
469 (method git-fetch)
470 (uri (git-reference
471 (url "https://github.com/monero-project/monero-gui")
472 (commit (string-append "v" version))))
473 (file-name (string-append name "-" version ".tar.gz"))
474 (sha256
475 (base32
476 "1cnrkwh7kp64lnzz1xfmkf1mhsgm5gls292gpqai3jr8jydpkahl"))))
477 (build-system gnu-build-system)
478 (native-inputs
479 `(("doxygen" ,doxygen)
480 ("graphviz" ,graphviz)
481 ("pkg-config" ,pkg-config)))
482 (inputs
483 `(("boost" ,boost)
484 ("libunwind" ,libunwind)
485 ("openssl" ,openssl)
486 ("qt" ,qt)
487 ("readline" ,readline)
488 ("unbound" ,unbound)))
489 (propagated-inputs
490 `(("monero" ,monero)))
491 (arguments
492 `(#:phases
493 (modify-phases %standard-phases
494 (delete 'configure)
495 (delete 'check)
496 (add-before 'build 'fix-makefile-vars
497 (lambda _
498 (substitute* "src/zxcvbn-c/makefile"
499 (("\\?=") "="))
500 #t))
501 (add-after 'fix-makefile-vars 'fix-library-paths
502 (lambda* (#:key inputs #:allow-other-keys)
503 (substitute* "monero-wallet-gui.pro"
504 (("-L/usr/local/lib") "")
505 (("-L/usr/local/opt/openssl/lib")
506 (string-append "-L"
507 (assoc-ref inputs "openssl")
508 "/lib"))
509 (("-L/usr/local/opt/boost/lib")
510 (string-append "-L"
511 (assoc-ref inputs "boost")
512 "/lib")))
513 #t))
514 (add-after 'fix-library-paths 'fix-monerod-path
515 (lambda* (#:key inputs #:allow-other-keys)
516 (substitute* "src/daemon/DaemonManager.cpp"
517 (("QApplication::applicationDirPath\\(\\) \\+ \"/monerod")
518 (string-append "\""(assoc-ref inputs "monero")
519 "/bin/monerod")))
520 #t))
521 (replace 'build
522 (lambda _
523 (invoke "./build.sh")))
524 (add-after 'build 'fix-install-path
525 (lambda* (#:key outputs #:allow-other-keys)
526 (substitute* "build/Makefile"
527 (("/opt/monero-wallet-gui")
528 (assoc-ref outputs "out")))
529 #t))
530 (add-before 'install 'change-dir
531 (lambda _
532 (chdir "build"))))))
533 (home-page "https://getmonero.org/")
534 (synopsis "Graphical user interface for the Monero currency")
535 (description
536 "Monero is a secure, private, untraceable currency. This package provides the
537 Monero GUI client.")
538 (license license:bsd-3)))
539
540 (define-public monero-core
541 (deprecated-package "monero-core" monero-gui))
542
543 (define-public python-trezor-agent
544 (package
545 (name "python-trezor-agent")
546 (version "0.9.4")
547 (source
548 (origin
549 (method url-fetch)
550 (uri (string-append "https://github.com/romanz/trezor-agent/archive/v"
551 version ".tar.gz"))
552 (file-name (string-append name "-" version ".tar.gz"))
553 (sha256
554 (base32
555 "0h8jb147vpjk7mqbl4za0xdh7lblhx07n9dfk80kn2plwnvrry1x"))))
556 (build-system python-build-system)
557 (arguments
558 `(#:phases
559 (modify-phases %standard-phases
560 (delete 'check)
561 (add-after 'install 'check
562 (lambda* (#:key outputs inputs #:allow-other-keys)
563 ;; Make installed package available for running the tests
564 (add-installed-pythonpath inputs outputs)
565 (invoke "py.test"))))))
566 (propagated-inputs
567 `(("python-ecdsa" ,python-ecdsa)
568 ("python-ed25519" ,python-ed25519)
569 ("python-semver" ,python-semver)
570 ("python-unidecode" ,python-unidecode)))
571 (native-inputs
572 `(("python-mock" ,python-mock)
573 ("python-pytest" ,python-pytest)))
574 (home-page "https://github.com/romanz/trezor-agent")
575 (synopsis "TREZOR SSH and GPG host support")
576 (description
577 "@code{libagent} is a library that allows using TREZOR, Keepkey and
578 Ledger Nano as a hardware SSH/GPG agent.")
579 (license license:lgpl3)))
580
581 (define-public python2-trezor-agent
582 (package-with-python2 python-trezor-agent))
583
584 (define-public python-mnemonic
585 (package
586 (name "python-mnemonic")
587 (version "0.18")
588 (source
589 (origin
590 (method url-fetch)
591 (uri (pypi-uri "mnemonic" version))
592 (sha256
593 (base32
594 "07bzfa5di6nv5xwwcwbypnflpj50wlfczhh6q6hg8w13g5m319q2"))))
595 (build-system python-build-system)
596 (propagated-inputs
597 `(("python-pbkdf2" ,python-pbkdf2)))
598 (home-page "https://github.com/trezor/python-mnemonic")
599 (synopsis "Implementation of Bitcoin BIP-0039")
600 (description "@code{mnemonic} is a library that provides an implementation
601 of Bitcoin BIP-0039.")
602 (license license:expat)))
603
604 (define-public python2-mnemonic
605 (package-with-python2 python-mnemonic))
606
607 (define-public python-ledgerblue
608 (package
609 (name "python-ledgerblue")
610 (version "0.1.16")
611 (source
612 (origin
613 (method url-fetch)
614 (uri (pypi-uri "ledgerblue" version))
615 (sha256
616 (base32
617 "010mghaqh1cmz3a0ifc3f40mmyplilwlw7kpha2mzyrrff46p9gb"))))
618 (build-system python-build-system)
619 (propagated-inputs
620 `(("python-ecpy" ,python-ecpy)
621 ("python-future" ,python-future)
622 ("python-hidapi" ,python-hidapi)
623 ("python-pillow" ,python-pillow)
624 ("python-protobuf" ,python-protobuf)
625 ("python-pycrypto" ,python-pycrypto)))
626 (home-page "https://github.com/LedgerHQ/blue-loader-python")
627 (synopsis "Python library to communicate with Ledger Blue/Nano S")
628 (description "@code{ledgerblue} is a Python library to communicate with
629 Ledger Blue/Nano S.")
630 (license license:asl2.0)))
631
632 (define-public python2-ledgerblue
633 (package-with-python2 python-ledgerblue))
634
635 (define-public python-trezor
636 (package
637 (name "python-trezor")
638 (version "0.7.16")
639 (source
640 (origin
641 (method url-fetch)
642 (uri (pypi-uri "trezor" version))
643 (sha256
644 (base32
645 "055kii56wgwadl5z911s59ya2fnsqzk3n5i19s2hb9sv2by6knvb"))))
646 (build-system python-build-system)
647 (propagated-inputs
648 `(("python-ecdsa" ,python-ecdsa)
649 ("python-hidapi" ,python-hidapi)
650 ("python-mnemonic" ,python-mnemonic)
651 ("python-protobuf" ,python-protobuf)
652 ("python-requests" ,python-requests)))
653 (native-inputs
654 `(("python-pyqt" ,python-pyqt))) ; Tests
655 (home-page "https://github.com/trezor/python-trezor")
656 (synopsis "Python library for communicating with TREZOR Hardware Wallet")
657 (description "@code{trezor} is a Python library for communicating with
658 TREZOR Hardware Wallet.")
659 (license license:lgpl3)))
660
661 (define-public python2-trezor
662 (package-with-python2 python-trezor))
663
664 (define-public python-keepkey
665 (package
666 (name "python-keepkey")
667 (version "4.0.2")
668 (source
669 (origin
670 (method url-fetch)
671 (uri (pypi-uri "keepkey" version))
672 (sha256
673 (base32
674 "0f4iqqjlqmamw4mhyhik4qlb5bnfd10wbjw9yzgir105wh5fdpnd"))))
675 (build-system python-build-system)
676 (arguments
677 `(#:phases
678 (modify-phases %standard-phases
679 (delete 'check)
680 (add-after 'install 'check
681 (lambda* (#:key inputs outputs #:allow-other-keys)
682 (add-installed-pythonpath inputs outputs)
683 (apply invoke "python" (find-files "tests/unit" "\\.py$")))))))
684 (propagated-inputs
685 `(("python-ecdsa" ,python-ecdsa)
686 ("python-hidapi" ,python-hidapi)
687 ("python-mnemonic" ,python-mnemonic)
688 ("python-protobuf" ,python-protobuf)))
689 (home-page "https://github.com/keepkey/python-keepkey")
690 (synopsis "Python library for communicating with KeepKey Hardware Wallet")
691 (description "@code{keepkey} is a Python library for communicating with
692 the KeepKey Hardware Wallet.")
693 (license license:lgpl3)))
694
695 (define-public python2-keepkey
696 (package-with-python2 python-keepkey))
697
698 (define-public ledger-agent
699 (package
700 (name "ledger-agent")
701 (version "0.9.0")
702 (source
703 (origin
704 (method url-fetch)
705 (uri (pypi-uri "ledger_agent" version))
706 (sha256
707 (base32
708 "03zj602m2rln9yvr08dswy56vzkbldp8b074ixwzz525dafblr92"))))
709 (build-system python-build-system)
710 (inputs
711 `(("python-ledgerblue" ,python-ledgerblue)
712 ("python-trezor-agent" ,python-trezor-agent)))
713 (home-page "http://github.com/romanz/trezor-agent")
714 (synopsis "Ledger as hardware SSH/GPG agent")
715 (description "This package allows using Ledger as hardware SSH/GPG agent.
716
717 Usage for SSH: trezor-agent foo@@example.com --connect
718 Usage for GPG: Initialize using trezor-gpg init \"Foo <foo@@example.com>\"
719 Then set the environment variable GNUPGHOME to
720 \"${HOME}/.gnupg/trezor\".")
721 (license license:lgpl3)))
722
723 (define-public trezor-agent
724 (package
725 (name "trezor-agent")
726 (version "0.9.0")
727 (source
728 (origin
729 (method url-fetch)
730 (uri (pypi-uri "trezor_agent" version))
731 (sha256
732 (base32
733 "1i5cdamlf3c0ym600pjklij74p8ifj9cv7xrpnrfl1b8nkadswbz"))))
734 (build-system python-build-system)
735 (inputs
736 `(("python-trezor" ,python-trezor)
737 ("python-trezor-agent" ,python-trezor-agent)))
738 (home-page "http://github.com/romanz/trezor-agent")
739 (synopsis "Using Trezor as hardware SSH/GPG agent")
740 (description "This package allows using Trezor as a hardware SSH/GPG
741 agent.")
742 (license license:lgpl3)))
743
744 (define-public keepkey-agent
745 (package
746 (name "keepkey-agent")
747 (version "0.9.0")
748 (source
749 (origin
750 (method url-fetch)
751 (uri (pypi-uri "keepkey_agent" version))
752 (sha256
753 (base32
754 "03779gvlx70i0nnry98i4pl1d92604ix5x6jgdfkrdgzqbh5vj27"))))
755 (build-system python-build-system)
756 (inputs
757 `(("python-keepkey" ,python-keepkey)
758 ("python-trezor-agent" ,python-trezor-agent)))
759 (home-page "http://github.com/romanz/trezor-agent")
760 (synopsis "KeepKey as hardware SSH/GPG agent")
761 (description "This package allows using KeepKey as a hardware SSH/GPG
762 agent.")
763 (license license:lgpl3)))
764
765 (define-public python-stdnum
766 (package
767 (name "python-stdnum")
768 (version "1.8.1")
769 (source
770 (origin
771 (method url-fetch)
772 (uri (pypi-uri "python-stdnum" version))
773 (sha256
774 (base32
775 "0hvr47q32xbyiznpmbg4r8rcvxhnf0lwf33hcpnynyik57djy5np"))))
776 (build-system python-build-system)
777 (home-page
778 "https://arthurdejong.org/python-stdnum/")
779 (synopsis
780 "Python module to handle standardized number and code formats")
781 (description
782 "This is a Python library that aims to provide functions to handle,
783 parse and validate standard numbers.
784 The module supports more than 100 different number formats
785 amongst which a great number of VAT and other tax numbers,
786 personal identity and company identification codes,
787 international standard numbers (ISBN, IBAN, EAN, etc.)
788 and various other formats.
789 The module also inclused implementations of the Verhoeff,
790 Luhn and family of ISO/IEC 7064 check digit algorithms. ")
791 (license license:lgpl2.1+)))
792
793 (define-public python2-stdnum
794 (package-with-python2 python-stdnum))
795
796 (define-public python-duniterpy
797 (package
798 (name "python-duniterpy")
799 (version "0.43.2")
800 (source
801 (origin
802 (method git-fetch)
803 ;; Pypi's default URI is missing "requirements.txt" file.
804 (uri (git-reference
805 (url "https://github.com/duniter/duniter-python-api.git")
806 (commit version)))
807 (file-name (git-file-name name version))
808 (sha256
809 (base32
810 "1ch4f150k1p1l876pp08p5rxqhpv5xfbxdw6njcmr06hspv8v8x4"))))
811 (build-system python-build-system)
812 (arguments
813 `(#:phases
814 (modify-phases %standard-phases
815 ;; Among 108 tests, a single one is failing: FAIL:
816 ;; test_from_pubkey. Remove it.
817 (add-after 'unpack 'remove-failing-test
818 (lambda _
819 (delete-file "tests/documents/test_crc_pubkey.py")
820 #t)))))
821 (propagated-inputs
822 `(("python-aiohttp" ,python-aiohttp)
823 ("python-base58" ,python-base58)
824 ("python-jsonschema" ,python-jsonschema)
825 ("python-libnacl" ,python-libnacl)
826 ("python-pylibscrypt" ,python-pylibscrypt)
827 ("python-pypeg2" ,python-pypeg2)))
828 (home-page "https://github.com/duniter/duniter-python-api")
829 (synopsis "Python implementation of Duniter API")
830 (description "@code{duniterpy} is an implementation of
831 @uref{https://github.com/duniter/duniter/, duniter} API. Its
832 main features are:
833 @itemize
834 @item Supports Duniter's Basic Merkle API and protocol
835 @item Asynchronous
836 @item Duniter signing key
837 @end itemize")
838 (license license:gpl3+)))
839
840 (define-public silkaj
841 (package
842 (name "silkaj")
843 (version "0.5.0")
844 (source
845 (origin
846 (method git-fetch)
847 (uri (git-reference
848 (url "https://git.duniter.org/clients/python/silkaj.git")
849 (commit (string-append "v" version))))
850 (file-name (git-file-name name version))
851 (sha256
852 (base32
853 "0xy25lpgz04nxikjvxlnlckrc9xmsxyiz2qm0bsiid8cnbdqcn12"))))
854 (build-system python-build-system)
855 (arguments
856 `(#:tests? #f ;no test
857 #:phases
858 (modify-phases %standard-phases
859 ;; The program is just a bunch of Python files in "src/" directory.
860 ;; Many phases are useless. However, `python-build-system' correctly
861 ;; sets PYTHONPATH and patches Python scripts.
862 (delete 'configure)
863 (delete 'build)
864 (replace 'install
865 (lambda* (#:key outputs #:allow-other-keys)
866 (let* ((out (assoc-ref outputs "out"))
867 (share (string-append out "/share/silkaj"))
868 (executable (string-append share "/silkaj.py"))
869 (bin (string-append out "/bin")))
870 ;; Install data.
871 (copy-recursively "src" share)
872 ;; Install executable.
873 (mkdir-p bin)
874 (with-directory-excursion bin
875 (symlink executable "silkaj")))
876 #t)))))
877 (inputs
878 `(("python-commandlines" ,python-commandlines)
879 ("python-ipaddress" ,python-ipaddress)
880 ("python-pyaes" ,python-pyaes)
881 ("python-pynacl" ,python-pynacl)
882 ("python-scrypt" ,python-scrypt)
883 ("python-tabulate" ,python-tabulate)))
884 (home-page "https://silkaj.duniter.org/")
885 (synopsis "Command line client for Duniter network")
886 (description "@code{Silkaj} is a command line client for the
887 @uref{https://github.com/duniter/duniter/, Duniter} network.
888
889 Its features are:
890 @itemize
891 @item information about currency,
892 @item issuers difficulty to generate next block,
893 @item network view of nodes,
894 @item list of last issuers,
895 @item send transactions,
896 @item get account amount.
897 @end itemize")
898 (license license:agpl3+)))