Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electrum: Support Ledger #1

Open
franzos opened this issue Dec 19, 2023 · 0 comments
Open

Electrum: Support Ledger #1

franzos opened this issue Dec 19, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@franzos
Copy link
Member

franzos commented Dec 19, 2023

ledger: (error getting device infos)
    Missing libraries for ledger.
        ModuleNotFoundError("No module named 'ledger_bitcoin'")

I already tried packaging this, but I have trouble with python-coincurve. It seems to be trying to do network requests, during the build:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ffff55258d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/requests/

Here's what I've got so far:

(define-public python-ledgercomm
  (package
    (name "python-ledgercomm")
    (version "1.2.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "ledgercomm" version))
       (sha256
        (base32 "019f13h59yxxhyhvi5xz8b20pfhazbvn9sgx5x98mp2shj6cks8y"))))
    (build-system pyproject-build-system)
    (home-page "https://github.com/LedgerHQ/ledgercomm")
    (synopsis "Library to communicate with Ledger Nano S/X and Speculos")
    (description "Library to communicate with Ledger Nano S/X and Speculos")
    (license #f)))

(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 python-build-system)
    (inputs (list python-hidapi python-ecdsa python-pyaes python-click))
    (arguments
     `(#:tests? #f))
    (home-page "https://github.com/Coldcard/ckcc-protocol")
    (synopsis "Cross-platform Python CFFI bindings for libsecp256k1")
    (description "Cross-platform Python CFFI bindings for libsecp256k1")
    (license license:expat)))

(define-public python-bip32
  (package
    (name "python-bip32")
    (version "3.4")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "bip32" version))
       (sha256
        (base32 "040sysllmshpi9h1byp3xd4wr3lxahhabxd475n97plyv4jk4889"))))
    (build-system pyproject-build-system)
    (propagated-inputs (list python-base58 python-coincurve))
    (home-page "http://github.com/darosior/python-bip32")
    (synopsis "Minimalistic implementation of the BIP32 key derivation scheme")
    (description
     "Minimalistic implementation of the BIP32 key derivation scheme")
    (license license:expat)))

(define-public python-ledger-bitcoin
  (package
    (name "python-ledger-bitcoin")
    (version "0.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "ledger_bitcoin" version))
       (sha256
        (base32 "1wjanpaw0rlwzzxyfy21cpwcwf8k5k8ysl8pj40yq831ig06wiih"))))
    (build-system pyproject-build-system)
    (propagated-inputs (list python-bip32 python-coincurve python-ledgercomm
                             python-packaging python-typing-extensions))
    (arguments
     `(#:tests? #f))
    (home-page "https://github.com/LedgerHQ/app-bitcoin-new")
    (synopsis "Client for Ledger Nano Bitcoin application")
    (description "Python library and command line tool for 
communicating with your Ledger over USB")
    (license license:expat)))

Probably because of https://github.com/ofek/coincurve/blob/master/setup.py#L50


EDIT: With a couple of changes:

(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
                             libsecp256k1
                             autoconf
                             automake
                             libtool))
    (home-page "")
    (synopsis "Cross-platform Python CFFI bindings for libsecp256k1")
    (description "Cross-platform Python CFFI bindings for libsecp256k1")
    (license #f)))

which fails with

error: [Errno 2] No such file or directory: '/tmp/guix-build-python-coincurve-18.0.0.drv-0/coincurve-18.0.0/libsecp256k1/configure'
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "python" arguments: ("-c" "import sys, importlib, json\nconfig_settings = json.loads (sys.argv[3])\nbuilder = importlib.import_module(sys.argv[1])\nbuilder.build_wheel(sys.argv[2], config_settings=config_settings)" "setuptools.build_meta" "dist" "[]") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `build' failed after 5.6 seconds
command "python" "-c" "import sys, importlib, json\nconfig_settings = json.loads (sys.argv[3])\nbuilder = importlib.import_module(sys.argv[1])\nbuilder.build_wheel(sys.argv[2], config_settings=config_settings)" "setuptools.build_meta" "dist" "[]" failed with status 1
@franzos franzos added the enhancement New feature or request label Dec 19, 2023
@franzos franzos self-assigned this Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant