diff mbox series

[bug#74039,v2,2/5] gnu: Add python-coincurve

Message ID d2d3df469c7e8465ead1d88b31e3e3a4f7b148a1.1730063595.git.jesse@eisses.email
State New
Headers show
Series [bug#74039,v2,1/5] gnu: Add python-ledgercomm | expand

Commit Message

guix-patches--- via Oct. 27, 2024, 9:13 p.m. UTC
From: Jesse Eisses <jesse@eisses.email>

Change-Id: I2acb09def9193247b1e4169321cf22bdb77c9960
---
 gnu/packages/finance.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 262380d13e..d96055601d 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -110,6 +110,7 @@  (define-module (gnu packages finance)
   #:use-module (gnu packages jemalloc)
   #:use-module (gnu packages libedit)
   #:use-module (gnu packages libevent)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
@@ -1119,6 +1120,35 @@  (define-public python-ledgercomm
     (description "Library to communicate with Ledger Nano S/X and Speculos")
     (license license:expat)))
 
+(define-public python-coincurve
+  (package
+    (name "python-coincurve")
+    (version "18.0.0")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "coincurve" version))
+              (sha256
+               (base32
+                "1hagr7hicfc1hkg5lfxj0di53bp3rbpq0rz5h279v80pwjpjcrn8"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-asn1crypto python-cffi))
+    (home-page "https://pypi.org/project/coincurve")
+    (inputs (list libsecp256k1))
+    (native-inputs (list autoconf automake libtool pkg-config))
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (delete 'check)
+               (add-after 'unpack 'use-libsecp256k1-input
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (let ((lib-dir (string-append
+                                   (assoc-ref inputs "libsecp256k1") "/lib")))
+                     (setenv "LIB_DIR" lib-dir)))))))
+    (synopsis "Cross-platform Python CFFI bindings for libsecp256k1")
+    (description "Cross-platform Python CFFI bindings for libsecp256k1")
+    (license (list license:asl2.0
+                   license:expat))))
+
 (define-public python-trezor
   (package
     (name "python-trezor")