gnu: Add ruby-commander.
[jackhill/guix/guix.git] / gnu / packages / finance.scm
index 45aa89e..112a6eb 100644 (file)
@@ -6,10 +6,10 @@
 ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
-;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018 Adriano Peluso <catonano@gmail.com>
-;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -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)
@@ -138,48 +139,26 @@ 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.2")
+    (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 "0hwnipj2m9p95hhyv6kyq54m27g14r58gnsy2my883kxhpcyb2vc"))
+       (patches (search-patches "ledger-fix-uninitialized.patch"))))
     (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,74 @@ 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-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))))))
+      (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
@@ -252,16 +289,16 @@ in ability, and easy to use.")
     (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
-         "11jfa7mxvvf0ldhx0hsvjbx3xwvzvn2wrfjpms8c7qmrnqhwh4wp"))))
+        (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)           ; no configure script
@@ -299,7 +336,7 @@ do so.")
 (define-public electrum
   (package
     (name "electrum")
-    (version "3.2.2")
+    (version "3.3.3")
     (source
      (origin
        (method url-fetch)
@@ -308,7 +345,7 @@ do so.")
                            version ".tar.gz"))
        (sha256
         (base32
-         "1fxaxlf5vm2zydj678ls3pazyriym188iwzk60kyk26cz2p3xk39"))
+         "0z2zfhyawrbzs0w1426a2w0d4wsajl34ymj77qmpm41138g2ysf2"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -326,6 +363,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 +391,18 @@ other machines/servers.  Electrum does not download the Bitcoin blockchain.")
   (package
     (inherit electrum)
     (name "electron-cash")
-    (version "3.3.4")
+    (version "3.3.5")
     (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"))
+         "185z3c5j9nvl31ga80hvahx7ghvkgmqgfjrrzw1fbs6p9jxy007w"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -587,36 +628,50 @@ Monero GUI client.")
 (define-public python-trezor-agent
   (package
     (name "python-trezor-agent")
-    (version "0.9.4")
+    (version "0.13.0")
     (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 "0i4igkxi8fwdlbhg6nx27lhnc9v9nmrw4j5fvpnc202n6yjlc7x7"))))
     (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.")
@@ -679,14 +734,14 @@ Ledger Blue/Nano S.")
 (define-public python-trezor
   (package
     (name "python-trezor")
-    (version "0.10.2")
+    (version "0.11.1")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "trezor" version))
         (sha256
           (base32
-            "138k6zsqqpb46k3rcpyslm9q7yq5i6k4myvr9n425jnkadf4vfjd"))))
+            "064yds8f4px0c6grkkanpdjx022g4q87ihzhkmdv9qanv0hz6hv0"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -694,21 +749,23 @@ 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
+     `(("protobuf" ,protobuf) ; Tests
+       ("python-black" ,python-black) ; Tests
+       ("python-protobuf" ,python-protobuf) ; Tests
+       ("python-isort" ,python-isort) ; Tests
        ("python-pyqt" ,python-pyqt) ; Tests
        ("python-pytest" ,python-pytest))) ; Tests
     (home-page "https://github.com/trezor/python-trezor")
@@ -723,14 +780,14 @@ TREZOR Hardware Wallet.")
 (define-public python-keepkey
   (package
     (name "python-keepkey")
-    (version "4.0.2")
+    (version "6.0.2")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "keepkey" version))
         (sha256
           (base32
-            "0f4iqqjlqmamw4mhyhik4qlb5bnfd10wbjw9yzgir105wh5fdpnd"))))
+            "16j8hnxj9r4b2w6kfncmny09pb1al8ppmn59qxzl3qmh1xhpy45g"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -743,6 +800,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 +840,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.")
@@ -913,7 +984,7 @@ main features are:
 (define-public silkaj
   (package
     (name "silkaj")
-    (version "0.6.1")
+    (version "0.6.5")
     (source
      (origin
        (method git-fetch)
@@ -923,17 +994,16 @@ main features are:
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0a99gbgdd7m9wisqhqpfyaim0rlv9gkp8gmrppkagqf6j0683igh"))))
+         "1fy509vsmz7rs9m3vah0ky0jvq9mxmfga6b18rkrkl2lbjk872q2"))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f))                    ;no test
     (inputs
-     `(("python-commandlines" ,python-commandlines)
-       ("python-ipaddress" ,python-ipaddress)
-       ("python-pyaes" ,python-pyaes)
-       ("python-pynacl" ,python-pynacl)
-       ("python-scrypt" ,python-scrypt)
-       ("python-tabulate" ,python-tabulate)))
+     `(("click" ,python-click)
+       ("duniterpy" ,python-duniterpy)
+       ("ipaddress" ,python-ipaddress)
+       ("pynacl" ,python-pynacl)
+       ("tabulate" ,python-tabulate)))
     (home-page "https://silkaj.duniter.org/")
     (synopsis "Command line client for Duniter network")
     (description "@code{Silkaj} is a command line client for the