gnu: r-dose: Update to 3.10.2.
[jackhill/guix/guix.git] / gnu / packages / finance.scm
index 2253a29..cd5d3b7 100644 (file)
@@ -1,12 +1,16 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
+;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2018 Adriano Peluso <catonano@gmail.com>
+;;; Copyright © 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +31,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system python)
   #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages dns)
   #:use-module (gnu packages emacs)
+  #:use-module (gnu packages dbm)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages groff)
   #:use-module (gnu packages libedit)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages sphinx)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
 (define-public bitcoin-core
   (package
     (name "bitcoin-core")
-    (version "0.15.1")
+    (version "0.17.1")
     (source (origin
              (method url-fetch)
              (uri
-              (string-append "https://bitcoin.org/bin/bitcoin-core-"
+              (string-append "https://bitcoincore.org/bin/bitcoin-core-"
                              version "/bitcoin-" version ".tar.gz"))
              (sha256
               (base32
-               "1d22fgwdcn343kd95lh389hj417zwbmnhi29cij8n7wc0nz2vpil"))))
+               "0am4pnaf2cisv172jqx6jdpzx770agm8777163lkjbw3ryslymiy"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)
                          "/bin/lupdate"))
        #:phases
         (modify-phases %standard-phases
+          (add-before 'configure 'make-qt-deterministic
+           (lambda _
+            ;; Make Qt deterministic.
+            (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
+            #t))
           (add-before 'check 'set-home
            (lambda _
-            (setenv "HOME" (getenv "TMPDIR"))))))) ; Tests write to $HOME.
+            (setenv "HOME" (getenv "TMPDIR"))  ; Tests write to $HOME.
+            #t)))))
     (home-page "https://bitcoin.org/en/")
     (synopsis "Bitcoin peer-to-peer client")
     (description
@@ -123,34 +140,23 @@ line client and a client based on Qt.")
 (define-public ledger
   (package
     (name "ledger")
-    (version "3.1.1")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/ledger/ledger/archive/v"
-                    version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
-              (sha256
-               (base32
-                "12jlv3gsjhrja25q9hrwh73cdacd2l3c2yyn8qnijav9mdhnbw4h"))
-              (patches (search-patches "ledger-revert-boost-python-fix.patch"
-                                       "ledger-fix-uninitialized.patch"))))
+    (version "3.1.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ledger/ledger.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0bfnrqrd6wqgsngfpqi30xh6yy86pwl25iwzrqy44q31r0zl4mm3"))))
     (build-system cmake-build-system)
     (arguments
-     `(#:modules ((guix build cmake-build-system)
-                  (guix build utils)
-                  (guix build emacs-utils))
-       #:imported-modules (,@%cmake-build-system-modules
-                           (guix build emacs-utils))
-       #:configure-flags
+     `(#:configure-flags
        `("-DBUILD_DOCS:BOOL=ON"
          "-DBUILD_WEB_DOCS:BOOL=ON"
-         "-DBUILD_EMACSLISP:BOOL=ON"
          "-DUSE_PYTHON:BOOL=ON"
-         "-DCMAKE_INSTALL_LIBDIR:PATH=lib"
-         ,(string-append "-DUTFCPP_INCLUDE_DIR:PATH="
-                         (assoc-ref %build-inputs "utfcpp")
-                         "/include"))
+         "-DCMAKE_INSTALL_LIBDIR:PATH=lib")
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'install-examples
@@ -161,24 +167,17 @@ line client and a client based on Qt.")
                (install-file "test/input/demo.ledger" examples))
              #t))
          (add-after 'build 'build-doc
-           (lambda _ (zero? (system* "make" "doc"))))
+           (lambda _ (invoke "make" "doc")))
          (add-before 'check 'check-setup
            ;; One test fails if it can't set the timezone.
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "TZDIR"
                      (string-append (assoc-ref inputs "tzdata")
                                     "/share/zoneinfo"))
-             #t))
-         (add-after 'install 'relocate-elisp
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((site-dir (string-append (assoc-ref outputs "out")
-                                             "/share/emacs/site-lisp"))
-                    (guix-dir (string-append site-dir "/guix.d"))
-                    (orig-dir (string-append site-dir "/ledger-mode"))
-                    (dest-dir (string-append guix-dir "/ledger-mode")))
-               (mkdir-p guix-dir)
-               (rename-file orig-dir dest-dir)
-               (emacs-generate-autoloads ,name dest-dir))
+             ;; Skip failing test BaselineTest_cmd-org.
+             ;; This is a known upstream issue. See
+             ;; https://github.com/ledger/ledger/issues/550
+             (setenv "ARGS" "-E BaselineTest_cmd-org")
              #t)))))
     (inputs
      `(("boost" ,boost)
@@ -189,10 +188,9 @@ line client and a client based on Qt.")
        ("tzdata" ,tzdata)
        ("utfcpp" ,utfcpp)))
     (native-inputs
-     `(("emacs" ,emacs-minimal)
-       ("groff" ,groff)
+     `(("groff" ,groff)
        ("texinfo" ,texinfo)))
-    (home-page "http://ledger-cli.org/")
+    (home-page "https://ledger-cli.org/")
     (synopsis "Command-line double-entry accounting program")
     (description
      "Ledger is a powerful, double-entry accounting system that is
@@ -216,28 +214,103 @@ in ability, and easy to use.")
                    license:asl2.0     ; src/strptime.cc
                    (license:non-copyleft
                     "file://src/wcwidth.cc"
-                    "See src/wcwidth.cc in the distribution.")
-                   license:gpl2+))))  ; lisp/*
+                    "See src/wcwidth.cc in the distribution.")))))
+
+(define-public emacs-ledger-mode
+  ;; There have been no new releases since 2016.
+  (let ((commit "253a20dc62e137ed0ed8e1dd8614ecba116610ea")
+        (revision "1"))
+    (package
+      (name "emacs-ledger-mode")
+      (version (git-version "3.1.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ledger/ledger-mode.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "06wrgkqpgvk17vibrk2qikdlqn8y63jg86marp1wgmram92mb3jk"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:modules ((guix build cmake-build-system)
+                    (guix build utils)
+                    (guix build emacs-utils))
+         #:imported-modules (,@%cmake-build-system-modules
+                             (guix build emacs-utils))
+         #:tests? #f ; there are none
+         #:phases
+         (modify-phases %standard-phases
+           (add-before 'build 'patch-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((ledger (assoc-ref inputs "ledger")))
+                 (make-file-writable "ledger-exec.el")
+                 (emacs-substitute-variables "ledger-exec.el"
+                   ("ledger-binary-path" (string-append ledger "/bin/ledger"))))
+               #t))
+           (add-after 'build 'build-doc
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((target (string-append (assoc-ref outputs "out")
+                                            "/share/info")))
+                 (mkdir-p target)
+                 (invoke "makeinfo" "-o" target
+                         "../source/doc/ledger-mode.texi"))
+               #t))
+           (add-after 'install 'relocate-elisp
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((site-dir (string-append (assoc-ref outputs "out")
+                                               "/share/emacs/site-lisp"))
+                      (guix-dir (string-append site-dir "/guix.d"))
+                      (orig-dir (string-append site-dir "/ledger-mode"))
+                      (dest-dir (string-append guix-dir "/ledger-mode")))
+                 (mkdir-p guix-dir)
+                 (rename-file orig-dir dest-dir)
+                 (emacs-generate-autoloads ,name dest-dir)
+                 #t))))))
+      (inputs
+       `(("ledger" ,ledger)))
+      (native-inputs
+       `(("emacs-minimal" ,emacs-minimal)
+         ("texinfo" ,texinfo)))
+      (home-page "https://ledger-cli.org/")
+      (synopsis "Command-line double-entry accounting program")
+      (description
+       "Ledger is a powerful, double-entry accounting system that is
+accessed from the UNIX command-line.  This may put off some users, since
+there is no flashy UI, but for those who want unparalleled reporting
+access to their data there are few alternatives.
+
+Ledger uses text files for input.  It reads the files and generates
+reports; there is no other database or stored state.  To use Ledger,
+you create a file of your account names and transactions, run from the
+command line with some options to specify input and requested reports, and
+get output.  The output is generally plain text, though you could generate
+a graph or html instead.  Ledger is simple in concept, surprisingly rich
+in ability, and easy to use.
+
+This package provides the Emacs mode.")
+      (license license:gpl2+))))
 
 (define-public geierlein
   (package
     (name "geierlein")
-    (version "0.9.5")
+    (version "0.9.13")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/stesie/geierlein"
-                           "/archive/V" version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/stesie/geierlein.git")
+             (commit (string-append "V" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32
-         "0b11fq8v5w8nxjb20jl4dsfhv76xky6n3sq3k3fbb0m2sq9ikikw"))))
+        (base32 "00zpwr3lk2vdmd60fgdwdk0xxs52wvnm19ln2m75yfphydvkglic"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f ; would require npm, python and a lot more
+     `(#:tests? #f                  ; would require npm, python and a lot more
        #:phases
         (modify-phases %standard-phases
-          (delete 'configure)
+          (delete 'configure)           ; no configure script
           (add-after 'unpack 'override-target-directory-and-tool-paths
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (substitute* "Makefile"
@@ -256,7 +329,7 @@ in ability, and easy to use.")
               #t)))))
     (inputs
      `(("icecat" ,icecat)))
-    (home-page "http://stesie.github.io/geierlein/")
+    (home-page "https://stesie.github.io/geierlein/")
     (synopsis "Free Elster client, for sending Germany VAT declarations")
     (description
      "Geierlein is a free Elster client, i.e. an application that
@@ -272,7 +345,7 @@ do so.")
 (define-public electrum
   (package
     (name "electrum")
-    (version "3.0.5")
+    (version "3.3.6")
     (source
      (origin
        (method url-fetch)
@@ -280,8 +353,7 @@ do so.")
                            version "/Electrum-"
                            version ".tar.gz"))
        (sha256
-        (base32
-         "06z0a5p1jg93jialphslip8d72q9yg3651qqaf494gs3h9kw1sv1"))
+        (base32 "0am5ki3z0yvhrz16vp2jjy5fkxxqph0mj9qqpbw3kpql65shykwz"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -299,6 +371,10 @@ do so.")
        ("python-requests" ,python-requests)
        ("python-qrcode" ,python-qrcode)
        ("python-protobuf" ,python-protobuf)
+       ("python-aiohttp" ,python-aiohttp)
+       ("python-aiohttp-socks" ,python-aiohttp-socks)
+       ("python-aiorpcx" ,python-aiorpcx)
+       ("python-certifi" ,python-certifi)
        ("python-dnspython" ,python-dnspython)
        ("python-jsonrpclib-pelix" ,python-jsonrpclib-pelix)))
     (arguments
@@ -319,6 +395,37 @@ generation from a seed.  Your secret keys are encrypted and are never sent to
 other machines/servers.  Electrum does not download the Bitcoin blockchain.")
     (license license:expat)))
 
+(define-public electron-cash
+  (package
+    (inherit electrum)
+    (name "electron-cash")
+    (version "4.0.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://electroncash.org/downloads/"
+                           version
+                           "/win-linux/Electron-Cash-"
+                           version
+                           ".tar.gz"))
+       (sha256
+        (base32
+         "0xswmr68cm1c77lzisi3z812jzqczm9dfrshfhdq42zz5kaz4gnn"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; Delete the bundled dependencies.
+           (delete-file-recursively "packages")
+           #t))))
+    (home-page "https://electroncash.org/")
+    (synopsis "Bitcoin Cash wallet")
+    (description
+     "Electroncash is a lightweight Bitcoin Cash client, based on a client-server
+protocol.  It supports Simple Payment Verification (SPV) and deterministic key
+generation from a seed.  Your secret keys are encrypted and are never sent to
+other machines/servers.  Electroncash does not download the Bitcoin Cash blockchain.")
+    (license license:expat)))
+
 (define-public monero
   ;; This package bundles easylogging++ and lmdb.
   ;; The bundled easylogging++ is modified, and the changes will not be upstreamed.
@@ -326,25 +433,18 @@ other machines/servers.  Electrum does not download the Bitcoin blockchain.")
   ;; the system's dynamically linked library.
   (package
     (name "monero")
-    (version "0.11.1.0")
+    (version "0.12.3.0")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/monero-project/monero/archive/v"
-                           version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
-       (modules '((guix build utils)))
-       (snippet
-        '(begin
-           ;; Delete bundled dependencies.
-           (for-each
-            delete-file-recursively
-            '("external/miniupnpc" "external/rapidjson"
-              "external/unbound"))
-           #t))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/monero-project/monero")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (patches (search-patches "monero-use-system-miniupnpc.patch"))
        (sha256
         (base32
-         "16shd834025jyzy68h3gag1sz8vbk875hy4j97hrki8pacz8vd5m"))))
+         "14db9kgjm2ha93c2x5fjdw01xaqshn756qr3x2cnzyyjh7caz5qd"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("doxygen" ,doxygen)
@@ -354,15 +454,19 @@ other machines/servers.  Electrum does not download the Bitcoin blockchain.")
     (inputs
      `(("bind" ,isc-bind)
        ("boost" ,boost)
+       ("zeromq" ,zeromq)
+       ("cppzmq" ,cppzmq)
        ("expat" ,expat)
+       ("libsodium" ,libsodium)
        ("libunwind" ,libunwind)
        ("lmdb" ,lmdb)
-       ("miniupnpc" ,miniupnpc)
+       ("miniupnpc" ,monero-miniupnpc)
        ("openssl" ,openssl)
        ("rapidjson" ,rapidjson)
        ("unbound" ,unbound)))
     (arguments
      `(#:out-of-source? #t
+       #:build-type "release"
        #:configure-flags '("-DBUILD_TESTS=ON"
                            ,@(if (string=? "aarch64-linux" (%current-system))
                                  '("-DARCH=armv8-a")
@@ -390,9 +494,8 @@ other machines/servers.  Electrum does not download the Bitcoin blockchain.")
              #t))
          (replace 'check
            (lambda _
-             (zero?
-              (system* "make" "ARGS=-E 'unit_tests|libwallet_api_tests'"
-                       "test"))))
+             (invoke "make" "ARGS=-E 'unit_tests|libwallet_api_tests'"
+                     "test")))
          ;; The excluded unit tests need network access
          (add-after 'check 'unit-tests
            (lambda _
@@ -405,10 +508,9 @@ other machines/servers.  Electrum does not download the Bitcoin blockchain.")
                        "DNSResolver.DNSSECFailure"
                        "DNSResolver.GetTXTRecord")
                      ":")))
-               (zero?
-                (system* "tests/unit_tests/unit_tests"
-                         (string-append "--gtest_filter=-"
-                                        excluded-unit-tests))))))
+               (invoke "tests/unit_tests/unit_tests"
+                       (string-append "--gtest_filter=-"
+                                      excluded-unit-tests)))))
          (add-after 'install 'install-blockchain-import-export
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -422,29 +524,34 @@ other machines/servers.  Electrum does not download the Bitcoin blockchain.")
 Monero command line client and daemon.")
     (license license:bsd-3)))
 
-(define-public monero-core
+(define-public monero-gui
   (package
-    (name "monero-core")
-    (version "0.11.1.0")
+    (name "monero-gui")
+    (version "0.12.2.0")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/monero-project/monero-core/archive/v"
-                           version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/monero-project/monero-gui")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "1q7a9kpcjgp74fbplzs2iszdld6gwbfrydyd9in9izhwp100p1rr"))))
+         "1cnrkwh7kp64lnzz1xfmkf1mhsgm5gls292gpqai3jr8jydpkahl"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("doxygen" ,doxygen)
        ("graphviz" ,graphviz)
-       ("pkg-config" ,pkg-config)))
+       ("pkg-config" ,pkg-config)
+       ("qttools" ,qttools)))
     (inputs
      `(("boost" ,boost)
        ("libunwind" ,libunwind)
        ("openssl" ,openssl)
-       ("qt" ,qt)
+       ("qtbase" ,qtbase)
+       ("qtdeclarative" ,qtdeclarative)
+       ("qtgraphicaleffects" ,qtgraphicaleffects)
+       ("qtquickcontrols" ,qtquickcontrols)
        ("readline" ,readline)
        ("unbound" ,unbound)))
     (propagated-inputs
@@ -479,9 +586,18 @@ Monero command line client and daemon.")
                 (string-append "\""(assoc-ref inputs "monero")
                                "/bin/monerod")))
              #t))
+         (add-after 'fix-monerod-path 'fix-qt-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((qttools  (assoc-ref inputs "qttools"))
+                    (lrelease (string-append qttools "/bin/lrelease"))
+                    (lupdate (string-append qttools "/bin/lupdate")))
+               (substitute* "monero-wallet-gui.pro"
+                 (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease") lrelease)
+                 (("\\$\\$\\[QT_INSTALL_BINS\\]/lupdate") lupdate))
+               #t)))
          (replace 'build
            (lambda _
-             (zero? (system* "./build.sh"))))
+             (invoke "./build.sh")))
          (add-after 'build 'fix-install-path
            (lambda* (#:key outputs #:allow-other-keys)
              (substitute* "build/Makefile"
@@ -490,7 +606,23 @@ Monero command line client and daemon.")
              #t))
          (add-before 'install 'change-dir
            (lambda _
-             (chdir "build"))))))
+             (chdir "build")))
+         (add-after 'install 'wrap-executable
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (wrap-program (string-append out "/bin/monero-wallet-gui")
+                 `("QT_PLUGIN_PATH" ":" prefix
+                   ,(map (lambda (label)
+                           (string-append (assoc-ref inputs label)
+                                          "/lib/qt5/plugins"))
+                         '("qtbase" "qtdeclarative")))
+                 `("QML2_IMPORT_PATH" ":" prefix
+                   ,(map (lambda (label)
+                           (string-append (assoc-ref inputs label)
+                                          "/lib/qt5/qml"))
+                         '("qtdeclarative" "qtgraphicaleffects"
+                           "qtquickcontrols"))))
+               #t))))))
     (home-page "https://getmonero.org/")
     (synopsis "Graphical user interface for the Monero currency")
     (description
@@ -498,39 +630,56 @@ Monero command line client and daemon.")
 Monero GUI client.")
     (license license:bsd-3)))
 
+(define-public monero-core
+  (deprecated-package "monero-core" monero-gui))
+
 (define-public python-trezor-agent
   (package
     (name "python-trezor-agent")
-    (version "0.9.4")
+    (version "0.13.1")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/romanz/trezor-agent/archive/v"
-                           version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/romanz/trezor-agent.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32
-         "0h8jb147vpjk7mqbl4za0xdh7lblhx07n9dfk80kn2plwnvrry1x"))))
+        (base32 "0q99vbfd3h85s8rnjipnmldixabqmmlk5w9karv6f0rhyi54f4zv"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'remove-requires-backports-shutil-which
+           ;; Remove requires on backport of shutil_which, as python 3.4+ has
+           ;; a built-in implementation supported in python-trezor-agent.
+           (lambda _
+             (substitute* "setup.py"
+               (("'backports.shutil_which>=3.5.1',") ""))
+             #t))
          (delete 'check)
          (add-after 'install 'check
            (lambda* (#:key outputs inputs #:allow-other-keys)
-             ;; Make installed package available for running the tests
+             ;; Make installed package available for running the tests.
              (add-installed-pythonpath inputs outputs)
              (invoke "py.test"))))))
     (propagated-inputs
-     `(("python-ecdsa" ,python-ecdsa)
+     `(("python-configargparse" ,python-configargparse)
+       ("python-daemon" ,python-daemon)
+       ("python-docutils" ,python-docutils)
+       ("python-ecdsa" ,python-ecdsa)
        ("python-ed25519" ,python-ed25519)
+       ("python-mnemonic" ,python-mnemonic)
+       ("python-pymsgbox" ,python-pymsgbox)
        ("python-semver" ,python-semver)
-       ("python-unidecode" ,python-unidecode)))
+       ("python-unidecode" ,python-unidecode)
+       ("python-wheel" ,python-wheel)))
     (native-inputs
-     `(("python-mock" ,python-mock)
+     `(("gnupg" ,gnupg)
+       ("python-mock" ,python-mock)
        ("python-pytest" ,python-pytest)))
     (home-page "https://github.com/romanz/trezor-agent")
-    (synopsis "TREZOR SSH and GPG host support")
+    (synopsis "Use hardware wallets as SSH and GPG agent")
     (description
      "@code{libagent} is a library that allows using TREZOR, Keepkey and
 Ledger Nano as a hardware SSH/GPG agent.")
@@ -593,23 +742,41 @@ Ledger Blue/Nano S.")
 (define-public python-trezor
   (package
     (name "python-trezor")
-    (version "0.7.16")
+    (version "0.11.3")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "trezor" version))
         (sha256
           (base32
-            "055kii56wgwadl5z911s59ya2fnsqzk3n5i19s2hb9sv2by6knvb"))))
+            "0211m027vlvyqy83kwbjjjxalb04xgf1klv0h0y0f0yhj07516n7"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+        (modify-phases %standard-phases
+          ;; Default tests run device-specific tests which fail, only run specific tests.
+          (replace 'check
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              ;; Delete tests that require network access.
+              (delete-file "trezorlib/tests/unit_tests/test_tx_api.py")
+              (invoke "python" "-m" "pytest" "--pyarg" "trezorlib.tests.unit_tests"))))))
     (propagated-inputs
-     `(("python-ecdsa" ,python-ecdsa)
-       ("python-hidapi" ,python-hidapi)
+     `(("python-click" ,python-click)
+       ("python-construct" ,python-construct)
+       ("python-ecdsa" ,python-ecdsa)
+       ("python-libusb1" ,python-libusb1)
        ("python-mnemonic" ,python-mnemonic)
-       ("python-protobuf" ,python-protobuf)
-       ("python-requests" ,python-requests)))
+       ("python-pyblake2" ,python-pyblake2)
+       ("python-requests" ,python-requests)
+       ("python-typing-extensions" ,python-typing-extensions)))
     (native-inputs
-     `(("python-pyqt" ,python-pyqt))) ; Tests
+     ;; For tests.
+     `(("protobuf" ,protobuf)
+       ("python-black" ,python-black)
+       ("python-protobuf" ,python-protobuf)
+       ("python-isort" ,python-isort)
+       ("python-pyqt" ,python-pyqt)
+       ("python-pytest" ,python-pytest)))
     (home-page "https://github.com/trezor/python-trezor")
     (synopsis "Python library for communicating with TREZOR Hardware Wallet")
     (description "@code{trezor} is a Python library for communicating with
@@ -622,14 +789,14 @@ TREZOR Hardware Wallet.")
 (define-public python-keepkey
   (package
     (name "python-keepkey")
-    (version "4.0.2")
+    (version "6.0.3")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "keepkey" version))
         (sha256
           (base32
-            "0f4iqqjlqmamw4mhyhik4qlb5bnfd10wbjw9yzgir105wh5fdpnd"))))
+            "0z3d0m6364v9dv0njs4cd5m5ai6j6v35xaaxfxl90m9vmyxy81vd"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -642,6 +809,7 @@ TREZOR Hardware Wallet.")
     (propagated-inputs
      `(("python-ecdsa" ,python-ecdsa)
        ("python-hidapi" ,python-hidapi)
+       ("python-libusb1" ,python-libusb1)
        ("python-mnemonic" ,python-mnemonic)
        ("python-protobuf" ,python-protobuf)))
     (home-page "https://github.com/keepkey/python-keepkey")
@@ -681,19 +849,32 @@ Then set the environment variable GNUPGHOME to
 (define-public trezor-agent
   (package
     (name "trezor-agent")
-    (version "0.9.0")
+    (version "0.10.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "trezor_agent" version))
        (sha256
         (base32
-         "1i5cdamlf3c0ym600pjklij74p8ifj9cv7xrpnrfl1b8nkadswbz"))))
+         "144657c7bn0a667dq5fv5r6j7iilxf3h9agj29v1m2qpq40g0az8"))))
+    (arguments
+     ;; Tests fail with "AttributeError: module 'attr' has no attribute 's'".
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'wrap 'fixup-agent-py
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               ;; overwrite the wrapper with the real thing.
+               (install-file "./trezor_agent.py"
+                             (string-append out "/bin"))
+             #t))))))
     (build-system python-build-system)
     (inputs
      `(("python-trezor" ,python-trezor)
        ("python-trezor-agent" ,python-trezor-agent)))
-    (home-page "http://github.com/romanz/trezor-agent")
+    (native-inputs
+     `(("python-hidapi" ,python-hidapi)))
+    (home-page "https://github.com/romanz/trezor-agent")
     (synopsis "Using Trezor as hardware SSH/GPG agent")
     (description "This package allows using Trezor as a hardware SSH/GPG
 agent.")
@@ -719,3 +900,132 @@ agent.")
     (description "This package allows using KeepKey as a hardware SSH/GPG
 agent.")
     (license license:lgpl3)))
+
+(define-public python-stdnum
+  (package
+    (name "python-stdnum")
+    (version "1.8.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-stdnum" version))
+       (sha256
+        (base32
+         "0hvr47q32xbyiznpmbg4r8rcvxhnf0lwf33hcpnynyik57djy5np"))))
+    (build-system python-build-system)
+    (home-page
+     "https://arthurdejong.org/python-stdnum/")
+    (synopsis
+     "Python module to handle standardized number and code formats")
+    (description
+     "This is a Python library that aims to provide functions to handle,
+parse and validate standard numbers.
+The module supports more than 100 different number formats
+amongst which a great number of VAT and other tax numbers,
+personal identity and company identification codes,
+international standard numbers (ISBN, IBAN, EAN, etc.)
+and various other formats.
+The module also inclused implementations of the Verhoeff,
+Luhn and family of ISO/IEC 7064 check digit algorithms. ")
+    (license license:lgpl2.1+)))
+
+(define-public python2-stdnum
+  (package-with-python2 python-stdnum))
+
+(define-public python-duniterpy
+  (package
+    (name "python-duniterpy")
+    (version "0.54.1")
+    (source
+     (origin
+       (method git-fetch)
+       ;; Pypi's default URI is missing "requirements.txt" file.
+       (uri (git-reference
+             (url "https://git.duniter.org/clients/python/duniterpy.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "15z5wc3ahvv8axyiqmf7hd4y91ahh1x4bfmgsqxwygyhswl1yjq8"))))
+    (build-system python-build-system)
+    (arguments
+     ;; Tests fail with "AttributeError: module 'attr' has no attribute 's'".
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'build 'build-documentation
+           (lambda _
+             (invoke "make" "docs")))
+         (add-after 'build-documentation 'install-documentation
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (doc (string-append out "/share/doc/" ,name)))
+               (mkdir-p doc)
+               (copy-recursively "docs/_build/html" doc))
+             #t)))))
+    (native-inputs
+     `(("sphinx" ,python-sphinx)
+       ("sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
+    (propagated-inputs
+     `(("aiohttp" ,python-aiohttp)
+       ("attr" ,python-attr)
+       ("base58" ,python-base58)
+       ("jsonschema" ,python-jsonschema)
+       ("libnacl" ,python-libnacl)
+       ("pyaes" ,python-pyaes)
+       ("pylibscrypt" ,python-pylibscrypt)
+       ("pypeg2" ,python-pypeg2)))
+    (home-page "https://git.duniter.org/clients/python/duniterpy")
+    (synopsis "Python implementation of Duniter API")
+    (description "@code{duniterpy} is an implementation of
+@uref{https://github.com/duniter/duniter/, duniter} API.  Its
+main features are:
+@itemize
+@item Support Duniter's Basic Merkle API and protocol
+@item Asynchronous/synchronous without threads
+@item Support HTTP, HTTPS and Web Socket transport for Basic Merkle API
+@item Support Elasticsearch Duniter4j API
+@item Duniter signing key
+@item Sign/verify and encrypt/decrypt messages with the Duniter credentials
+@end itemize")
+    (license license:gpl3+)))
+
+(define-public silkaj
+  (package
+    (name "silkaj")
+    (version "0.7.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.duniter.org/clients/python/silkaj.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0pnd5v15sgxxm114sbs0z24a4dars5hy1nabc9v9ask7kxzrxs9y"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f))                    ;no test
+    (inputs
+     `(("click" ,python-click)
+       ("duniterpy" ,python-duniterpy)
+       ("ipaddress" ,python-ipaddress)
+       ("pynacl" ,python-pynacl)
+       ("tabulate" ,python-tabulate)
+       ("texttable" ,python-texttable)))
+    (home-page "https://silkaj.duniter.org/")
+    (synopsis "Command line client for Duniter network")
+    (description "@code{Silkaj} is a command line client for the
+@uref{https://github.com/duniter/duniter/, Duniter} network.
+
+Its features are:
+@itemize
+@item information about currency,
+@item issuers difficulty to generate next block,
+@item network view of nodes,
+@item list of last issuers,
+@item send transactions,
+@item get account amount.
+@end itemize")
+    (license license:agpl3+)))