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