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