Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / finance.scm
index 3f5f7b1..3784912 100644 (file)
 ;;; Copyright © 2018 Adriano Peluso <catonano@gmail.com>
 ;;; Copyright © 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
-;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
+;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2019 Sebastian Schott <sschott@mailbox.org>
+;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix build-system python)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system go)
+  #:use-module (guix build-system qt)
   #:use-module (guix utils)
   #:use-module (gnu packages)
+  #:use-module (gnu packages aidc)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages docbook)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages dns)
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages dbm)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages man)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages networking)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages popt)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-crypto)
@@ -76,6 +86,7 @@
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages textutils)
+  #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages upnp)
   #:use-module (gnu packages version-control)
@@ -86,7 +97,7 @@
 (define-public bitcoin-core
   (package
     (name "bitcoin-core")
-    (version "0.18.0")
+    (version "0.18.1")
     (source (origin
              (method url-fetch)
              (uri
                              version "/bitcoin-" version ".tar.gz"))
              (sha256
               (base32
-               "0ps0vw9iknz1b1sx74rabd1yhlxvwbd0aimjzn9hlqkvw286hkjy"))))
+               "15mz0gmm058gmq2gdpffbw25jpv7mksyhyfws6i7mqvrapqr6zaw"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)
-       ("python" ,python) ; for the tests
-       ("util-linux" ,util-linux)   ; provides the hexdump command for tests
+       ("python" ,python)               ; for the tests
+       ("util-linux" ,util-linux)       ; provides the hexdump command for tests
        ("qttools" ,qttools)))
     (inputs
-     `(("bdb" ,bdb-4.8) ; Bitcoin Core requires bdb 4.8 for compatibility
+     `(("bdb" ,bdb-4.8)                 ; 4.8 required for compatibility
        ("boost" ,boost)
        ("libevent" ,libevent)
        ("miniupnpc" ,miniupnpc)
             #t))
           (add-before 'check 'set-home
            (lambda _
-            (setenv "HOME" (getenv "TMPDIR"))  ; Tests write to $HOME.
+            (setenv "HOME" (getenv "TMPDIR")) ; tests write to $HOME
             #t))
           (add-after 'check 'check-functional
            (lambda _
@@ -151,6 +162,34 @@ of the bitcoin protocol.  This package provides the Bitcoin Core command
 line client and a client based on Qt.")
     (license license:expat)))
 
+(define-public homebank
+  (package
+    (name "homebank")
+    (version "5.2.8")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://homebank.free.fr/public/homebank-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "13ampiv68y30kc0p2560g3yz8whqpwnidfcnb9lndv93b9ca767y"))))
+    (build-system glib-or-gtk-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("intltool" ,intltool)))
+    (inputs
+     `(("gtk+" ,gtk+)
+       ("libsoup" ,libsoup)))
+    (arguments
+     `(#:configure-flags (list "-without-ofx"))) ; libofx is not available yet
+    (home-page "http://homebank.free.fr/")
+    (synopsis "Graphical personal accounting application")
+    (description "HomeBank allows you to manage your personal accounts at
+home.  The seeks to be lightweight, simple and easy to use.  It brings
+features that allow you to analyze your finances in a detailed way instantly
+and dynamically with report tools based on filtering and graphical charts.")
+    (license license:gpl2+)))
+
 (define-public ledger
   (package
     (name "ledger")
@@ -256,6 +295,12 @@ in ability, and easy to use.")
          #:tests? #f ; there are none
          #:phases
          (modify-phases %standard-phases
+           (add-after 'unpack 'patch-site-dir
+             (lambda _
+               (substitute* "CMakeLists.txt"
+                 (("DESTINATION share/emacs/site-lisp/ledger-mode")
+                  "DESTINATION share/emacs/site-lisp"))
+               #t))
            (add-before 'build 'patch-path
              (lambda* (#:key inputs #:allow-other-keys)
                (let ((ledger (assoc-ref inputs "ledger")))
@@ -271,17 +316,12 @@ in ability, and easy to use.")
                  (invoke "makeinfo" "-o" target
                          "../source/doc/ledger-mode.texi"))
                #t))
-           (add-after 'install 'relocate-elisp
+           (add-after 'install 'generate-autoload
              (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))))))
+                                               "/share/emacs/site-lisp")))
+                 (emacs-generate-autoloads ,name site-dir))
+               #t)))))
       (inputs
        `(("ledger" ,ledger)))
       (native-inputs
@@ -413,24 +453,31 @@ other machines/servers.  Electrum does not download the Bitcoin blockchain.")
   (package
     (inherit electrum)
     (name "electron-cash")
-    (version "4.0.7")
+    (version "4.0.12")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://electroncash.org/downloads/"
-                           version
-                           "/win-linux/Electron-Cash-"
-                           version
-                           ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Electron-Cash/Electron-Cash.git")
+             (commit version)))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "0xswmr68cm1c77lzisi3z812jzqczm9dfrshfhdq42zz5kaz4gnn"))
-       (modules '((guix build utils)))
-       (snippet
-        '(begin
-           ;; Delete the bundled dependencies.
-           (delete-file-recursively "packages")
-           #t))))
+         "0gidrx8499v7rig7ljhd70wssshs1qm0gp1553g70i323hcbf62x"))))
+    (inputs
+     `(,@(package-inputs electrum)
+       ("libsecp256k1", libsecp256k1)
+       ("python-dateutil", python-dateutil)
+       ("python-dnspython", python-dnspython)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments electrum)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'use-libsecp256k1-input
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* "lib/secp256k1.py"
+                 (("library_paths = .* 'libsecp256k1.so.0'.")
+                  (string-append "library_paths = ('" (assoc-ref inputs "libsecp256k1") "/lib/libsecp256k1.so.0'")))))))))
     (home-page "https://electroncash.org/")
     (synopsis "Bitcoin Cash wallet")
     (description
@@ -448,7 +495,7 @@ other machines/servers.  Electroncash does not download the Bitcoin Cash blockch
   ;; the system's dynamically linked library.
   (package
     (name "monero")
-    (version "0.14.1.2")
+    (version "0.15.0.1")
     (source
      (origin
        (method git-fetch)
@@ -469,7 +516,7 @@ other machines/servers.  Electroncash does not download the Bitcoin Cash blockch
            #t))
        (sha256
         (base32
-         "00zl883c7lcd9z7g4y3vv7rxmr7ppzrxdblnhk32r9l3qzyw55r6"))))
+         "0sypa235lf2bbib4b71xpaw39h9304slgsvnsz8wmy9fq1zx009m"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("doxygen" ,doxygen)
@@ -542,13 +589,18 @@ other machines/servers.  Electroncash does not download the Bitcoin Cash blockch
                (invoke "tests/unit_tests/unit_tests"
                        (string-append "--gtest_filter=-"
                                       excluded-unit-tests)))))
+         (add-after 'install 'install-librandomx
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
+               (install-file "external/randomx/librandomx.a" lib)
+               #t)))
          (add-after 'install 'delete-dead-links
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
                (delete-file (string-append out "/lib/libprotobuf.so"))
                (delete-file (string-append out "/lib/libusb-1.0.so"))
                #t))))))
-    (home-page "https://getmonero.org/")
+    (home-page "https://web.getmonero.org/")
     (synopsis "Command-line interface to the Monero currency")
     (description
      "Monero is a secure, private, untraceable currency.  This package provides
@@ -558,7 +610,7 @@ the Monero command line client and daemon.")
 (define-public monero-gui
   (package
     (name "monero-gui")
-    (version "0.14.1.2")
+    (version "0.15.0.3")
     (source
      (origin
        (method git-fetch)
@@ -568,8 +620,8 @@ the Monero command line client and daemon.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "1rm043r6y2mzy8pclnzbjjfxgps8pkfa2b92p66k8y8rdmgq6m1k"))))
-    (build-system gnu-build-system)
+         "1v2mk6qp7dfdj4j4cilxp0s0phfwwnmjvpvjrz6jzzlpvbnavkr0"))))
+    (build-system qt-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("qttools" ,qttools)))
@@ -589,53 +641,45 @@ the Monero command line client and daemon.")
        ("qtquickcontrols" ,qtquickcontrols)
        ("qtquickcontrols2",qtquickcontrols2)
        ("qtsvg" ,qtsvg)
-       ("qtwebchannel" ,qtwebchannel)
-       ("qtx11extras" ,qtx11extras)
        ("qtxmlpatterns" ,qtxmlpatterns)
        ("unbound" ,unbound)))
     (propagated-inputs
      `(("monero" ,monero)))
     (arguments
-     `(#:modules ((guix build gnu-build-system)
-                  (guix build qt-utils)
-                  (guix build utils))
-       #:imported-modules (,@%gnu-build-system-modules
-                           (guix build qt-utils))
+     `(#:tests? #f ; No tests
        #:phases
        (modify-phases %standard-phases
-         (delete 'configure)
-         (delete 'check)
-         (add-before 'build 'fix-makefile-vars
+         (add-after 'unpack 'fix-makefile-vars
            (lambda _
              (substitute* "src/zxcvbn-c/makefile"
                (("\\?=") "="))
              #t))
-         (add-after 'fix-makefile-vars 'fix-library-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "monero-wallet-gui.pro"
-               (("-L/usr/local/lib")
-                "")
-               (("-L/usr/local/opt/openssl/lib")
-                (string-append "-L" (assoc-ref inputs "openssl") "/lib"))
-               (("-L/usr/local/opt/boost/lib")
-                (string-append "-L" (assoc-ref inputs "boost") "/lib")))
-             #t))
-         (add-after 'fix-library-paths 'fix-monerod-path
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "src/daemon/DaemonManager.cpp"
-               (("QApplication::applicationDirPath\\(\\) \\+ \"/monerod")
-                (string-append "\"" (assoc-ref inputs "monero")
-                               "/bin/monerod")))
-             #t))
-         (add-after 'fix-monerod-path 'fix-qt-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "monero-wallet-gui.pro"
-               (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
-                (string-append (assoc-ref inputs "qttools") "/bin/lrelease"))
-               (("\\$\\$\\[QT_INSTALL_BINS\\]/lupdate")
-                (string-append (assoc-ref inputs "qttools") "/bin/lupdate")))
-             #t))
-         (add-after 'fix-qt-paths 'make-qt-deterministic
+         (add-after 'fix-makefile-vars 'fix-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((boost (assoc-ref inputs "boost"))
+                   (monero (assoc-ref inputs "monero"))
+                   (openssl (assoc-ref inputs "openssl"))
+                   (qttools (assoc-ref inputs "qttools"))
+                   (out (assoc-ref outputs "out")))
+               (substitute* "monero-wallet-gui.pro"
+                 (("-L/usr/local/lib")
+                  "")
+                 (("-L/usr/local/opt/openssl/lib")
+                  (string-append "-L" openssl "/lib"))
+                 (("-L/usr/local/opt/boost/lib")
+                  (string-append "-L" boost "/lib"))
+                 (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                  (string-append qttools "/bin/lrelease"))
+                 (("\\$\\$\\[QT_INSTALL_BINS\\]/lupdate")
+                  (string-append qttools "/bin/lupdate")))
+               (substitute* "deployment.pri"
+                 (("/opt/\\$\\$\\{TARGET\\}/bin")
+                  (string-append out "/bin")))
+               (substitute* "src/daemon/DaemonManager.cpp"
+                 (("QApplication::applicationDirPath\\(\\) \\+ \"/monerod")
+                  (string-append "\"" monero "/bin/monerod")))
+               #t)))
+         (add-after 'fix-paths 'make-qt-deterministic
            (lambda _
              (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
              #t))
@@ -652,25 +696,15 @@ the Monero command line client and daemon.")
                          ,version
                          ,(package-version monero))))
              #t))
-         (replace 'build
-           (lambda _
-             (invoke "./build.sh")))
-         (add-after 'build 'fix-install-path
-           (lambda* (#:key outputs #:allow-other-keys)
-             (substitute* "build/Makefile"
-               (("/opt/monero-wallet-gui")
-                (assoc-ref outputs "out")))
-             #t))
-         (add-before 'install 'change-dir
+         (replace 'configure
            (lambda _
+             (mkdir-p "build")
              (chdir "build")
-             #t))
-         (add-after 'install 'wrap-program
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               (wrap-qt-program out "monero-wallet-gui"))
-             #t)))))
-    (home-page "https://getmonero.org/")
+             (invoke "qmake" "../monero-wallet-gui.pro" "CONFIG+=release")))
+         (add-before 'build 'build-zxcvbn-c
+           (lambda _
+             (invoke "make" "-C" "../src/zxcvbn-c"))))))
+    (home-page "https://web.getmonero.org/")
     (synopsis "Graphical user interface for the Monero currency")
     (description
      "Monero is a secure, private, untraceable currency.  This package provides
@@ -735,14 +769,13 @@ Ledger Nano as a hardware SSH/GPG agent.")
 (define-public python-mnemonic
   (package
     (name "python-mnemonic")
-    (version "0.18")
+    (version "0.19")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "mnemonic" version))
         (sha256
-          (base32
-            "07bzfa5di6nv5xwwcwbypnflpj50wlfczhh6q6hg8w13g5m319q2"))))
+          (base32 "0cd9prmdj8wzdmc7lxbf9lz0xrlkvak5ignag406mmfbn81fndsf"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-pbkdf2" ,python-pbkdf2)))
@@ -1134,15 +1167,33 @@ Trezor wallet.")
   (package
     (inherit bitcoin-core)
     (name "bitcoin-abc")
-    (version "0.19.8")
+    (version "0.20.7")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://download.bitcoinabc.org/"
-                                  version "/linux/src/bitcoin-abc-"
+                                  version "/src/bitcoin-abc-"
                                   version ".tar.gz"))
               (sha256
                (base32
-                "0ndvkxv5m8346bdhfqzgdiz1k9wyjycj05jp7daf9pml3cw79sz5"))))
+                "0py5ilfi4r8qh5r9637vwch27sqrrn0dg9rz8bccnj3lp2xpzw27"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python)               ; for the tests
+       ("util-linux" ,util-linux)       ; provides the hexdump command for tests
+       ("qttools" ,qttools)))
+    (inputs
+     `(("bdb" ,bdb-5.3)
+       ("boost" ,boost)
+       ("libevent" ,libevent)
+       ("miniupnpc" ,miniupnpc)
+       ("openssl" ,openssl)
+       ("protobuf" ,protobuf)
+       ("qrencode" ,qrencode)
+       ("qtbase" ,qtbase)
+       ("zlib" ,zlib)))
     (home-page "https://www.bitcoinabc.org/")
     (synopsis "Bitcoin ABC peer-to-peer full node for the Bitcoin Cash protocol")
     (description
@@ -1157,3 +1208,96 @@ offers confimations after less than 5 seconds and have significantly lower
 fees that BTC.  Bitcoin ABC is the reference implementation of the Bitcoin
 Cash protocol.  This package provides the Bitcoin Cash command line client and
 a client based on Qt.  This is a fork of Bitcoin Core.")))
+
+(define-public libofx
+  (package
+    (name "libofx")
+    (version "0.9.15")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/libofx/libofx")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1jx56ma351p8af8dvavygjwf6ipa7qbgq7bpdsymwj27apdnixfy"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       (list (string-append "--with-opensp-includes="
+                            (assoc-ref %build-inputs "opensp")
+                            "/include/OpenSP"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("gengetopt" ,gengetopt)
+       ("help2man" ,help2man)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("curl" ,curl)
+       ("libxml++-2" ,libxml++-2)
+       ("opensp" ,opensp)))
+    (home-page "http://libofx.sourceforge.net/")
+    (synopsis "Library supporting the Open Financial Exchange format")
+    (description
+     "The LibOFX library is an API designed to allow applications to very easily
+support OFX command responses, usually provided by financial institutions.  The
+following three utilities are included with the library:
+@enumerate
+@item @code{ofxdump}
+@item @code{ofx2qif}
+@item @code{ofxconnect}
+@end enumerate")
+    (license license:gpl2+)))
+
+(define-public opensp
+  (package
+    (name "opensp")
+    (version "1.5.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/openjade/opensp/"
+                                  version "/OpenSP-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1khpasr6l0a8nfz6kcf3s81vgdab8fm2dj291n5r2s53k228kx2p"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("gettext" ,gettext-minimal)))
+    (inputs
+     `(("docbook-xml" ,docbook-xml-4.1.2)
+       ("docbook-xsl" ,docbook-xsl)
+       ("xmlto" ,xmlto)))
+    (arguments
+     `(;; TODO: Fix and enable tests.
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-docbook-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((xmldoc (string-append (assoc-ref inputs "docbook-xml")
+                                          "/xml/dtd/docbook"))
+                   (xsldoc (string-append (assoc-ref inputs "docbook-xsl")
+                                          "/xml/xsl/docbook-xsl-"
+                                          ,(package-version docbook-xsl))))
+               (substitute* (find-files "docsrc" "\\.xml$")
+                 (("/usr/share/sgml/docbook/xml-dtd-4.1.2") xmldoc)
+                 (("http://.*/docbookx\\.dtd")
+                  (string-append xmldoc "/docbookx.dtd")))
+               ;; Directly pass the path to the stylesheet to xmlto.
+               (substitute* "docsrc/Makefile.in"
+                 (("\\$\\(XMLTO\\)")
+                  (string-append "$(XMLTO) -x " xsldoc
+                                 "/manpages/docbook.xsl")))
+               #t))))))
+    (home-page "http://openjade.sourceforge.net/")
+    (synopsis "Suite of SGML/XML processing tools")
+    (description "OpenSP is an object-oriented toolkit for SGML parsing and
+entity management.")
+    (license
+     ;; expat license with added clause regarding advertising
+     (license:non-copyleft
+      "file://COPYING"
+      "See COPYING in the distribution."))))