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, 2018 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 (git-file-name name version))
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 (git-file-name name version))
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 ("qttools" ,qttools)))
483 (inputs
484 `(("boost" ,boost)
485 ("libunwind" ,libunwind)
486 ("openssl" ,openssl)
487 ("qtbase" ,qtbase)
488 ("qtdeclarative" ,qtdeclarative)
489 ("qtgraphicaleffects" ,qtgraphicaleffects)
490 ("qtquickcontrols" ,qtquickcontrols)
491 ("readline" ,readline)
492 ("unbound" ,unbound)))
493 (propagated-inputs
494 `(("monero" ,monero)))
495 (arguments
496 `(#:phases
497 (modify-phases %standard-phases
498 (delete 'configure)
499 (delete 'check)
500 (add-before 'build 'fix-makefile-vars
501 (lambda _
502 (substitute* "src/zxcvbn-c/makefile"
503 (("\\?=") "="))
504 #t))
505 (add-after 'fix-makefile-vars 'fix-library-paths
506 (lambda* (#:key inputs #:allow-other-keys)
507 (substitute* "monero-wallet-gui.pro"
508 (("-L/usr/local/lib") "")
509 (("-L/usr/local/opt/openssl/lib")
510 (string-append "-L"
511 (assoc-ref inputs "openssl")
512 "/lib"))
513 (("-L/usr/local/opt/boost/lib")
514 (string-append "-L"
515 (assoc-ref inputs "boost")
516 "/lib")))
517 #t))
518 (add-after 'fix-library-paths 'fix-monerod-path
519 (lambda* (#:key inputs #:allow-other-keys)
520 (substitute* "src/daemon/DaemonManager.cpp"
521 (("QApplication::applicationDirPath\\(\\) \\+ \"/monerod")
522 (string-append "\""(assoc-ref inputs "monero")
523 "/bin/monerod")))
524 #t))
525 (add-after 'fix-monerod-path 'fix-qt-paths
526 (lambda* (#:key inputs #:allow-other-keys)
527 (let* ((qttools (assoc-ref inputs "qttools"))
528 (lrelease (string-append qttools "/bin/lrelease"))
529 (lupdate (string-append qttools "/bin/lupdate")))
530 (substitute* "monero-wallet-gui.pro"
531 (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease") lrelease)
532 (("\\$\\$\\[QT_INSTALL_BINS\\]/lupdate") lupdate))
533 #t)))
534 (replace 'build
535 (lambda _
536 (invoke "./build.sh")))
537 (add-after 'build 'fix-install-path
538 (lambda* (#:key outputs #:allow-other-keys)
539 (substitute* "build/Makefile"
540 (("/opt/monero-wallet-gui")
541 (assoc-ref outputs "out")))
542 #t))
543 (add-before 'install 'change-dir
544 (lambda _
545 (chdir "build")))
546 (add-after 'install 'wrap-executable
547 (lambda* (#:key inputs outputs #:allow-other-keys)
548 (let ((out (assoc-ref outputs "out")))
549 (wrap-program (string-append out "/bin/monero-wallet-gui")
550 `("QT_PLUGIN_PATH" ":" prefix
551 ,(map (lambda (label)
552 (string-append (assoc-ref inputs label)
553 "/lib/qt5/plugins"))
554 '("qtbase" "qtdeclarative")))
555 `("QML2_IMPORT_PATH" ":" prefix
556 ,(map (lambda (label)
557 (string-append (assoc-ref inputs label)
558 "/lib/qt5/qml"))
559 '("qtdeclarative" "qtgraphicaleffects"
560 "qtquickcontrols"))))
561 #t))))))
562 (home-page "https://getmonero.org/")
563 (synopsis "Graphical user interface for the Monero currency")
564 (description
565 "Monero is a secure, private, untraceable currency. This package provides the
566 Monero GUI client.")
567 (license license:bsd-3)))
568
569 (define-public monero-core
570 (deprecated-package "monero-core" monero-gui))
571
572 (define-public python-trezor-agent
573 (package
574 (name "python-trezor-agent")
575 (version "0.9.4")
576 (source
577 (origin
578 (method url-fetch)
579 (uri (string-append "https://github.com/romanz/trezor-agent/archive/v"
580 version ".tar.gz"))
581 (file-name (string-append name "-" version ".tar.gz"))
582 (sha256
583 (base32
584 "0h8jb147vpjk7mqbl4za0xdh7lblhx07n9dfk80kn2plwnvrry1x"))))
585 (build-system python-build-system)
586 (arguments
587 `(#:phases
588 (modify-phases %standard-phases
589 (delete 'check)
590 (add-after 'install 'check
591 (lambda* (#:key outputs inputs #:allow-other-keys)
592 ;; Make installed package available for running the tests
593 (add-installed-pythonpath inputs outputs)
594 (invoke "py.test"))))))
595 (propagated-inputs
596 `(("python-ecdsa" ,python-ecdsa)
597 ("python-ed25519" ,python-ed25519)
598 ("python-semver" ,python-semver)
599 ("python-unidecode" ,python-unidecode)))
600 (native-inputs
601 `(("python-mock" ,python-mock)
602 ("python-pytest" ,python-pytest)))
603 (home-page "https://github.com/romanz/trezor-agent")
604 (synopsis "TREZOR SSH and GPG host support")
605 (description
606 "@code{libagent} is a library that allows using TREZOR, Keepkey and
607 Ledger Nano as a hardware SSH/GPG agent.")
608 (license license:lgpl3)))
609
610 (define-public python2-trezor-agent
611 (package-with-python2 python-trezor-agent))
612
613 (define-public python-mnemonic
614 (package
615 (name "python-mnemonic")
616 (version "0.18")
617 (source
618 (origin
619 (method url-fetch)
620 (uri (pypi-uri "mnemonic" version))
621 (sha256
622 (base32
623 "07bzfa5di6nv5xwwcwbypnflpj50wlfczhh6q6hg8w13g5m319q2"))))
624 (build-system python-build-system)
625 (propagated-inputs
626 `(("python-pbkdf2" ,python-pbkdf2)))
627 (home-page "https://github.com/trezor/python-mnemonic")
628 (synopsis "Implementation of Bitcoin BIP-0039")
629 (description "@code{mnemonic} is a library that provides an implementation
630 of Bitcoin BIP-0039.")
631 (license license:expat)))
632
633 (define-public python2-mnemonic
634 (package-with-python2 python-mnemonic))
635
636 (define-public python-ledgerblue
637 (package
638 (name "python-ledgerblue")
639 (version "0.1.16")
640 (source
641 (origin
642 (method url-fetch)
643 (uri (pypi-uri "ledgerblue" version))
644 (sha256
645 (base32
646 "010mghaqh1cmz3a0ifc3f40mmyplilwlw7kpha2mzyrrff46p9gb"))))
647 (build-system python-build-system)
648 (propagated-inputs
649 `(("python-ecpy" ,python-ecpy)
650 ("python-future" ,python-future)
651 ("python-hidapi" ,python-hidapi)
652 ("python-pillow" ,python-pillow)
653 ("python-protobuf" ,python-protobuf)
654 ("python-pycrypto" ,python-pycrypto)))
655 (home-page "https://github.com/LedgerHQ/blue-loader-python")
656 (synopsis "Python library to communicate with Ledger Blue/Nano S")
657 (description "@code{ledgerblue} is a Python library to communicate with
658 Ledger Blue/Nano S.")
659 (license license:asl2.0)))
660
661 (define-public python2-ledgerblue
662 (package-with-python2 python-ledgerblue))
663
664 (define-public python-trezor
665 (package
666 (name "python-trezor")
667 (version "0.7.16")
668 (source
669 (origin
670 (method url-fetch)
671 (uri (pypi-uri "trezor" version))
672 (sha256
673 (base32
674 "055kii56wgwadl5z911s59ya2fnsqzk3n5i19s2hb9sv2by6knvb"))))
675 (build-system python-build-system)
676 (propagated-inputs
677 `(("python-ecdsa" ,python-ecdsa)
678 ("python-hidapi" ,python-hidapi)
679 ("python-mnemonic" ,python-mnemonic)
680 ("python-protobuf" ,python-protobuf)
681 ("python-requests" ,python-requests)))
682 (native-inputs
683 `(("python-pyqt" ,python-pyqt))) ; Tests
684 (home-page "https://github.com/trezor/python-trezor")
685 (synopsis "Python library for communicating with TREZOR Hardware Wallet")
686 (description "@code{trezor} is a Python library for communicating with
687 TREZOR Hardware Wallet.")
688 (license license:lgpl3)))
689
690 (define-public python2-trezor
691 (package-with-python2 python-trezor))
692
693 (define-public python-keepkey
694 (package
695 (name "python-keepkey")
696 (version "4.0.2")
697 (source
698 (origin
699 (method url-fetch)
700 (uri (pypi-uri "keepkey" version))
701 (sha256
702 (base32
703 "0f4iqqjlqmamw4mhyhik4qlb5bnfd10wbjw9yzgir105wh5fdpnd"))))
704 (build-system python-build-system)
705 (arguments
706 `(#:phases
707 (modify-phases %standard-phases
708 (delete 'check)
709 (add-after 'install 'check
710 (lambda* (#:key inputs outputs #:allow-other-keys)
711 (add-installed-pythonpath inputs outputs)
712 (apply invoke "python" (find-files "tests/unit" "\\.py$")))))))
713 (propagated-inputs
714 `(("python-ecdsa" ,python-ecdsa)
715 ("python-hidapi" ,python-hidapi)
716 ("python-mnemonic" ,python-mnemonic)
717 ("python-protobuf" ,python-protobuf)))
718 (home-page "https://github.com/keepkey/python-keepkey")
719 (synopsis "Python library for communicating with KeepKey Hardware Wallet")
720 (description "@code{keepkey} is a Python library for communicating with
721 the KeepKey Hardware Wallet.")
722 (license license:lgpl3)))
723
724 (define-public python2-keepkey
725 (package-with-python2 python-keepkey))
726
727 (define-public ledger-agent
728 (package
729 (name "ledger-agent")
730 (version "0.9.0")
731 (source
732 (origin
733 (method url-fetch)
734 (uri (pypi-uri "ledger_agent" version))
735 (sha256
736 (base32
737 "03zj602m2rln9yvr08dswy56vzkbldp8b074ixwzz525dafblr92"))))
738 (build-system python-build-system)
739 (inputs
740 `(("python-ledgerblue" ,python-ledgerblue)
741 ("python-trezor-agent" ,python-trezor-agent)))
742 (home-page "http://github.com/romanz/trezor-agent")
743 (synopsis "Ledger as hardware SSH/GPG agent")
744 (description "This package allows using Ledger as hardware SSH/GPG agent.
745
746 Usage for SSH: trezor-agent foo@@example.com --connect
747 Usage for GPG: Initialize using trezor-gpg init \"Foo <foo@@example.com>\"
748 Then set the environment variable GNUPGHOME to
749 \"${HOME}/.gnupg/trezor\".")
750 (license license:lgpl3)))
751
752 (define-public trezor-agent
753 (package
754 (name "trezor-agent")
755 (version "0.9.0")
756 (source
757 (origin
758 (method url-fetch)
759 (uri (pypi-uri "trezor_agent" version))
760 (sha256
761 (base32
762 "1i5cdamlf3c0ym600pjklij74p8ifj9cv7xrpnrfl1b8nkadswbz"))))
763 (build-system python-build-system)
764 (inputs
765 `(("python-trezor" ,python-trezor)
766 ("python-trezor-agent" ,python-trezor-agent)))
767 (home-page "http://github.com/romanz/trezor-agent")
768 (synopsis "Using Trezor as hardware SSH/GPG agent")
769 (description "This package allows using Trezor as a hardware SSH/GPG
770 agent.")
771 (license license:lgpl3)))
772
773 (define-public keepkey-agent
774 (package
775 (name "keepkey-agent")
776 (version "0.9.0")
777 (source
778 (origin
779 (method url-fetch)
780 (uri (pypi-uri "keepkey_agent" version))
781 (sha256
782 (base32
783 "03779gvlx70i0nnry98i4pl1d92604ix5x6jgdfkrdgzqbh5vj27"))))
784 (build-system python-build-system)
785 (inputs
786 `(("python-keepkey" ,python-keepkey)
787 ("python-trezor-agent" ,python-trezor-agent)))
788 (home-page "http://github.com/romanz/trezor-agent")
789 (synopsis "KeepKey as hardware SSH/GPG agent")
790 (description "This package allows using KeepKey as a hardware SSH/GPG
791 agent.")
792 (license license:lgpl3)))
793
794 (define-public python-stdnum
795 (package
796 (name "python-stdnum")
797 (version "1.8.1")
798 (source
799 (origin
800 (method url-fetch)
801 (uri (pypi-uri "python-stdnum" version))
802 (sha256
803 (base32
804 "0hvr47q32xbyiznpmbg4r8rcvxhnf0lwf33hcpnynyik57djy5np"))))
805 (build-system python-build-system)
806 (home-page
807 "https://arthurdejong.org/python-stdnum/")
808 (synopsis
809 "Python module to handle standardized number and code formats")
810 (description
811 "This is a Python library that aims to provide functions to handle,
812 parse and validate standard numbers.
813 The module supports more than 100 different number formats
814 amongst which a great number of VAT and other tax numbers,
815 personal identity and company identification codes,
816 international standard numbers (ISBN, IBAN, EAN, etc.)
817 and various other formats.
818 The module also inclused implementations of the Verhoeff,
819 Luhn and family of ISO/IEC 7064 check digit algorithms. ")
820 (license license:lgpl2.1+)))
821
822 (define-public python2-stdnum
823 (package-with-python2 python-stdnum))
824
825 (define-public python-duniterpy
826 (package
827 (name "python-duniterpy")
828 (version "0.43.7")
829 (source
830 (origin
831 (method git-fetch)
832 ;; Pypi's default URI is missing "requirements.txt" file.
833 (uri (git-reference
834 (url "https://git.duniter.org/clients/python/duniterpy.git")
835 (commit version)))
836 (file-name (git-file-name name version))
837 (sha256
838 (base32
839 "19m36z98361bqxjdb65597j2kxbly491927c6p9z47s1vxc3raaq"))))
840 (build-system python-build-system)
841 (propagated-inputs
842 `(("python-aiohttp" ,python-aiohttp)
843 ("python-base58" ,python-base58)
844 ("python-jsonschema" ,python-jsonschema)
845 ("python-libnacl" ,python-libnacl)
846 ("python-pylibscrypt" ,python-pylibscrypt)
847 ("python-pypeg2" ,python-pypeg2)))
848 (home-page "https://git.duniter.org/clients/python/duniterpy")
849 (synopsis "Python implementation of Duniter API")
850 (description "@code{duniterpy} is an implementation of
851 @uref{https://github.com/duniter/duniter/, duniter} API. Its
852 main features are:
853 @itemize
854 @item Supports Duniter's Basic Merkle API and protocol
855 @item Asynchronous
856 @item Duniter signing key
857 @end itemize")
858 (license license:gpl3+)))
859
860 (define-public silkaj
861 (package
862 (name "silkaj")
863 (version "0.5.0")
864 (source
865 (origin
866 (method git-fetch)
867 (uri (git-reference
868 (url "https://git.duniter.org/clients/python/silkaj.git")
869 (commit (string-append "v" version))))
870 (file-name (git-file-name name version))
871 (sha256
872 (base32
873 "0xy25lpgz04nxikjvxlnlckrc9xmsxyiz2qm0bsiid8cnbdqcn12"))))
874 (build-system python-build-system)
875 (arguments
876 `(#:tests? #f ;no test
877 #:phases
878 (modify-phases %standard-phases
879 ;; The program is just a bunch of Python files in "src/" directory.
880 ;; Many phases are useless. However, `python-build-system' correctly
881 ;; sets PYTHONPATH and patches Python scripts.
882 (delete 'configure)
883 (delete 'build)
884 (replace 'install
885 (lambda* (#:key outputs #:allow-other-keys)
886 (let* ((out (assoc-ref outputs "out"))
887 (share (string-append out "/share/silkaj"))
888 (executable (string-append share "/silkaj.py"))
889 (bin (string-append out "/bin")))
890 ;; Install data.
891 (copy-recursively "src" share)
892 ;; Install executable.
893 (mkdir-p bin)
894 (with-directory-excursion bin
895 (symlink executable "silkaj")))
896 #t)))))
897 (inputs
898 `(("python-commandlines" ,python-commandlines)
899 ("python-ipaddress" ,python-ipaddress)
900 ("python-pyaes" ,python-pyaes)
901 ("python-pynacl" ,python-pynacl)
902 ("python-scrypt" ,python-scrypt)
903 ("python-tabulate" ,python-tabulate)))
904 (home-page "https://silkaj.duniter.org/")
905 (synopsis "Command line client for Duniter network")
906 (description "@code{Silkaj} is a command line client for the
907 @uref{https://github.com/duniter/duniter/, Duniter} network.
908
909 Its features are:
910 @itemize
911 @item information about currency,
912 @item issuers difficulty to generate next block,
913 @item network view of nodes,
914 @item list of last issuers,
915 @item send transactions,
916 @item get account amount.
917 @end itemize")
918 (license license:agpl3+)))