gnu: r-dose: Update to 3.10.2.
[jackhill/guix/guix.git] / gnu / packages / finance.scm
index ce67694..cd5d3b7 100644 (file)
@@ -6,7 +6,7 @@
 ;;; 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 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; 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>
@@ -45,6 +45,7 @@
   #: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)
@@ -62,6 +63,7 @@
   #: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)
@@ -138,7 +140,7 @@ line client and a client based on Qt.")
 (define-public ledger
   (package
     (name "ledger")
-    (version "3.1.1")
+    (version "3.1.3")
     (source
      (origin
        (method git-fetch)
@@ -147,39 +149,16 @@ line client and a client based on Qt.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1j4p7djkmdmd858hylrsc3inamh9z0vkfl98s9wiqfmrzw51pmxp"))
-       (patches (search-patches "ledger-revert-boost-python-fix.patch"
-                                "ledger-fix-uninitialized.patch"))))
+        (base32 "0bfnrqrd6wqgsngfpqi30xh6yy86pwl25iwzrqy44q31r0zl4mm3"))))
     (build-system cmake-build-system)
     (arguments
-     `(#:modules ((guix build cmake-build-system)
-                  ((guix build gnu-build-system) #:prefix gnu:)
-                  (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"))
-       ;; Skip failing test BaselineTest_cmd-org during the check phase.
-       ;; This is a known upstream issue. See
-       ;; https://github.com/ledger/ledger/issues/550
-       #:make-flags (list "ARGS=-E BaselineTest_cmd-org")
+         "-DCMAKE_INSTALL_LIBDIR:PATH=lib")
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'boost-compat
-           (lambda _
-             (substitute* "src/utils.h"
-               ;; This library moved in Boost 1.66.  Remove for Ledger
-               ;; versions > 3.1.1.
-               (("boost/uuid/sha1.hpp") "boost/uuid/detail/sha1.hpp"))
-             #t))
          (add-before 'configure 'install-examples
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((examples (string-append (assoc-ref outputs "out")
@@ -195,18 +174,11 @@ line client and a client based on Qt.")
              (setenv "TZDIR"
                      (string-append (assoc-ref inputs "tzdata")
                                     "/share/zoneinfo"))
-             #t))
-         (replace 'check (assoc-ref gnu:%standard-phases 'check))
-         (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)
        ("gmp" ,gmp)
@@ -216,8 +188,7 @@ 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 "https://ledger-cli.org/")
     (synopsis "Command-line double-entry accounting program")
@@ -243,8 +214,83 @@ 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
@@ -299,7 +345,7 @@ do so.")
 (define-public electrum
   (package
     (name "electrum")
-    (version "3.2.2")
+    (version "3.3.6")
     (source
      (origin
        (method url-fetch)
@@ -307,8 +353,7 @@ do so.")
                            version "/Electrum-"
                            version ".tar.gz"))
        (sha256
-        (base32
-         "1fxaxlf5vm2zydj678ls3pazyriym188iwzk60kyk26cz2p3xk39"))
+        (base32 "0am5ki3z0yvhrz16vp2jjy5fkxxqph0mj9qqpbw3kpql65shykwz"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -326,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
@@ -350,18 +399,18 @@ other machines/servers.  Electrum does not download the Bitcoin blockchain.")
   (package
     (inherit electrum)
     (name "electron-cash")
-    (version "3.3.4")
+    (version "4.0.7")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://electroncash.org/downloads/"
                            version
-                           "/win-linux/ElectronCash-"
+                           "/win-linux/Electron-Cash-"
                            version
                            ".tar.gz"))
        (sha256
         (base32
-         "0ipl6vf2n9a5n556sx2z57s7wdvg05xwjvz67kff9nmbx4s8vjyf"))
+         "0xswmr68cm1c77lzisi3z812jzqczm9dfrshfhdq42zz5kaz4gnn"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -587,7 +636,7 @@ Monero GUI client.")
 (define-public python-trezor-agent
   (package
     (name "python-trezor-agent")
-    (version "0.9.4")
+    (version "0.13.1")
     (source
      (origin
        (method git-fetch)
@@ -596,11 +645,18 @@ Monero GUI client.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "15aaqk79d9y9nbsfznf2iscz12z5ispcj8kr8v5bc0sqqj2brs12"))))
+        (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)
@@ -608,15 +664,22 @@ Monero GUI client.")
              (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.")
@@ -679,14 +742,14 @@ Ledger Blue/Nano S.")
 (define-public python-trezor
   (package
     (name "python-trezor")
-    (version "0.10.2")
+    (version "0.11.3")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "trezor" version))
         (sha256
           (base32
-            "138k6zsqqpb46k3rcpyslm9q7yq5i6k4myvr9n425jnkadf4vfjd"))))
+            "0211m027vlvyqy83kwbjjjxalb04xgf1klv0h0y0f0yhj07516n7"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -694,23 +757,26 @@ Ledger Blue/Nano S.")
           ;; Default tests run device-specific tests which fail, only run specific tests.
           (replace 'check
             (lambda* (#:key inputs outputs #:allow-other-keys)
-              (invoke "python" "-m" "pytest" "--pyarg" "trezorlib.tests.unit_tests")
-              (invoke "python" "-m" "pytest" "-m" "slow_cosi" "--pyarg" "trezorlib.tests.unit_tests")
-              )))))
+              ;; 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-click" ,python-click)
+       ("python-construct" ,python-construct)
        ("python-ecdsa" ,python-ecdsa)
-       ("python-hidapi" ,python-hidapi)
        ("python-libusb1" ,python-libusb1)
        ("python-mnemonic" ,python-mnemonic)
-       ("python-protobuf" ,python-protobuf)
        ("python-pyblake2" ,python-pyblake2)
        ("python-requests" ,python-requests)
-       ("python-typing" ,python-typing)))
+       ("python-typing-extensions" ,python-typing-extensions)))
     (native-inputs
-     `(("python-mock" ,python-mock) ; Tests
-       ("python-pyqt" ,python-pyqt) ; Tests
-       ("python-pytest" ,python-pytest))) ; 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
@@ -723,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
@@ -743,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")
@@ -782,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.")
@@ -855,7 +935,7 @@ Luhn and family of ISO/IEC 7064 check digit algorithms. ")
 (define-public python-duniterpy
   (package
     (name "python-duniterpy")
-    (version "0.52.0")
+    (version "0.54.1")
     (source
      (origin
        (method git-fetch)
@@ -866,7 +946,7 @@ Luhn and family of ISO/IEC 7064 check digit algorithms. ")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "07liba2d21hb8m3n6yccfamq9yq0ryywh18vs9g2sgywfsnv82lh"))))
+         "15z5wc3ahvv8axyiqmf7hd4y91ahh1x4bfmgsqxwygyhswl1yjq8"))))
     (build-system python-build-system)
     (arguments
      ;; Tests fail with "AttributeError: module 'attr' has no attribute 's'".
@@ -913,7 +993,7 @@ main features are:
 (define-public silkaj
   (package
     (name "silkaj")
-    (version "0.6.5")
+    (version "0.7.0")
     (source
      (origin
        (method git-fetch)
@@ -923,7 +1003,7 @@ main features are:
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "1fy509vsmz7rs9m3vah0ky0jvq9mxmfga6b18rkrkl2lbjk872q2"))))
+         "0pnd5v15sgxxm114sbs0z24a4dars5hy1nabc9v9ask7kxzrxs9y"))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f))                    ;no test
@@ -932,7 +1012,8 @@ main features are:
        ("duniterpy" ,python-duniterpy)
        ("ipaddress" ,python-ipaddress)
        ("pynacl" ,python-pynacl)
-       ("tabulate" ,python-tabulate)))
+       ("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