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