Subject: [PATCH 7/7] gnu: electrum: Update to 4.0.5.

From: [email-masked]
Date: Tue, 1 Dec 2020 12:25:30 +0100

From: John Doe <[email-masked]>

* gnu/packages/finance.scm (electrum): Update to 4.0.5.
[inputs]: Remove.
[propagated-inputs]: Add python-pyqt, python-ecdsa, python-qrcode,
python-protobuf, python-aiohttp, python-aiohttp-socks, python-aiorpcx,
python-certifi, python-bitstring, python-attrs, python-cryptography,
python-qdarkstyle, python-dnspython and libsecp256k1.
[arguments]: Copy 'use-libsecp256k1-input phase from
(electron-cash) to #:phases to fix runtime lookup of libsecp256k1
library.
---
 gnu/packages/finance.scm | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index a79c70d1e0..e7b83eec20 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -493,7 +493,7 @@ do so.")
 (define-public electrum
   (package
     (name "electrum")
-    (version "3.3.8")
+    (version "4.0.5")
     (source
      (origin
        (method url-fetch)
@@ -501,7 +501,7 @@ do so.")
                            version "/Electrum-"
                            version ".tar.gz"))
        (sha256
-        (base32 "1g00cj1pmckd4xis8r032wmraiv3vd3zc803hnyxa2bnhj8z3bg2"))
+        (base32 "06ml9lwa5k2dp56sm5s7dsl6qirqmgim7rn853cqcq9n45z41437"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -509,22 +509,21 @@ do so.")
            (delete-file-recursively "packages")
            #t))))
     (build-system python-build-system)
-    (inputs
-     `(("python-pyaes" ,python-pyaes)
-       ("python-pysocks" ,python-pysocks)
-       ("python-sip" ,python-sip)
-       ("python-pyqt" ,python-pyqt)
+    (propagated-inputs
+     `(("python-pyqt" ,python-pyqt)
        ("python-ecdsa" ,python-ecdsa)
-       ("python-pbkdf2" ,python-pbkdf2)
-       ("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-bitstring" ,python-bitstring)
+       ("python-attrs" ,python-attrs)
+       ("python-cryptography" ,python-cryptography)
+       ("python-qdarkstyle" ,python-qdarkstyle)
        ("python-dnspython" ,python-dnspython)
-       ("python-jsonrpclib-pelix" ,python-jsonrpclib-pelix)))
+       ("libsecp256k1" ,libsecp256k1)))
     (arguments
      `(#:tests? #f                      ; no tests
        #:phases
@@ -538,7 +537,14 @@ do so.")
                (substitute* "setup.py"
                  (("sys\\.prefix")
                   (format #f "\"~a\"" out)))
-               #t))))))
+               #t)))
+         (add-after 'unpack 'use-libsecp256k1-input
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "electrum/ecc_fast.py"
+               (("library_paths = .* 'libsecp256k1.so.0'.")
+                (string-append "library_paths = ('"
+                               (assoc-ref inputs "libsecp256k1")
+                               "/lib/libsecp256k1.so.0'"))))))))
     (home-page "https://electrum.org/")
     (synopsis "Bitcoin wallet")
     (description
-- 
2.28.0