From bd069ad03f798bb35cb28b6c1b576e91a7e95dcf Mon Sep 17 00:00:00 2001 From: Vinicius Monego Date: Sun, 3 Aug 2025 21:27:19 -0300 Subject: [PATCH] gnu: Add python-electrum-ecc. * gnu/packages/finance.scm (python-electrum-ecc): New variable. Change-Id: Iaa0923fde89d5b4bc0660a91c249af0b21b0d517 --- gnu/packages/finance.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm index 20c5356765366f6610c4e294ee869ecd0eefce5f..9a0e8684ebe8eb2fda164ec560722dd5e618f6cc 100644 --- a/gnu/packages/finance.scm +++ b/gnu/packages/finance.scm @@ -562,6 +562,44 @@ It's not clear at the moment whether one day it will be possible to do so.") (license license:agpl3+))) +(define-public python-electrum-ecc + (package + (name "python-electrum-ecc") + (version "0.0.5") + (source + (origin + (method url-fetch) + (uri (pypi-uri "electrum_ecc" version)) + (sha256 + (base32 "1lmp5zmhabaxp6jha3xlsmqviivrxxhsy20x6z42ayqgd9cvhczp")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Delete the vendored dependency. + (delete-file-recursively "libsecp256k1"))))) + (build-system pyproject-build-system) + (arguments + (list + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'prepare-env + (lambda* (#:key inputs #:allow-other-keys) + ;; Do not attempt to compile vendored libsecp256k1. + (setenv "ELECTRUM_ECC_DONT_COMPILE" "1") + ;; Make the package find our libsecp256k1. + (substitute* "src/electrum_ecc/ecc_fast.py" + (("library_paths = \\[\\]") + (string-append + "library_paths = ['" + (search-input-file inputs "/lib/libsecp256k1.so") + "']")))))))) + (native-inputs (list python-pytest python-setuptools python-wheel)) + (inputs (list libsecp256k1)) + (home-page "https://github.com/spesmilo/electrum-ecc") + (synopsis "Pure python ctypes wrapper for libsecp256k1") + (description "This package provides a pure Python ctypes wrapper for +@code{libsecp256k1}.") + (license license:expat))) + (define-public electrum (package (name "electrum")