pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-electrum: added optional support for hardware wallets and QR code scanning.



Module Name:	pkgsrc-wip
Committed By:	Stepan Ipatov <st.ipatov%gmail.com@localhost>
Pushed By:	st.ipatov
Date:		Thu Nov 6 03:44:05 2025 +0000
Changeset:	99960aab2c5ddd6ff9bd53babeee01d9b94bbb8e

Modified Files:
	py-electrum/Makefile
	py-electrum/distinfo
	py-electrum/options.mk
Added Files:
	py-electrum/patches/patch-electrum_plugins_coldcard_coldcard.py
Removed Files:
	py-electrum/TODO

Log Message:
py-electrum: added optional support for hardware wallets and QR code scanning.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=99960aab2c5ddd6ff9bd53babeee01d9b94bbb8e

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-electrum/Makefile                               |  4 ++--
 py-electrum/TODO                                   |  1 -
 py-electrum/distinfo                               |  1 +
 py-electrum/options.mk                             | 19 +++++++++++++++--
 .../patch-electrum_plugins_coldcard_coldcard.py    | 24 ++++++++++++++++++++++
 5 files changed, 44 insertions(+), 5 deletions(-)

diffs:
diff --git a/py-electrum/Makefile b/py-electrum/Makefile
index 796f44a4c3..327cbcfc3f 100644
--- a/py-electrum/Makefile
+++ b/py-electrum/Makefile
@@ -2,8 +2,8 @@
 
 DISTNAME=	Electrum-4.6.2
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME:tl}
-PKGREVISION=	1
-CATEGORIES=	finance
+PKGREVISION=	2
+CATEGORIES=	finance python
 MASTER_SITES=	https://download.electrum.org/4.6.2/
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
diff --git a/py-electrum/TODO b/py-electrum/TODO
deleted file mode 100644
index 20f68db128..0000000000
--- a/py-electrum/TODO
+++ /dev/null
@@ -1 +0,0 @@
-* Hardware wallets (Ledger, Trezor, KeepKey) are not yet supported due to the absence of several required dependencies.
diff --git a/py-electrum/distinfo b/py-electrum/distinfo
index fb9c14c41d..bbb51ce30a 100644
--- a/py-electrum/distinfo
+++ b/py-electrum/distinfo
@@ -3,4 +3,5 @@ $NetBSD$
 BLAKE2s (Electrum-4.6.2.tar.gz) = 789e9da18af40ccd9e6b1257c42c675fd04b05ca06d731d6e8e0f51745f20569
 SHA512 (Electrum-4.6.2.tar.gz) = 890c1fae4cd2da5f1fea3f07c1c6b537f9557177b86e23c40333ec83743ed46182ec74e43a27416a3eaa9704d87d0a1702d0a789b23467bcc68a17d638b43655
 Size (Electrum-4.6.2.tar.gz) = 15020844 bytes
+SHA1 (patch-electrum_plugins_coldcard_coldcard.py) = c6aa1a4960cd6b88cd74252b425b4ef88c9e04ff
 SHA1 (patch-setup.py) = f047112c899ae240fbbf50df14f16e90d79dbec6
diff --git a/py-electrum/options.mk b/py-electrum/options.mk
index b9f6f26c7e..4fe9c60e9c 100644
--- a/py-electrum/options.mk
+++ b/py-electrum/options.mk
@@ -1,8 +1,8 @@
 # $NetBSD$
 
 PKG_OPTIONS_VAR=		PKG_OPTIONS.py-electrum
-PKG_SUPPORTED_OPTIONS=		x11
-PKG_SUGGESTED_OPTIONS=		x11
+PKG_SUPPORTED_OPTIONS=		x11 hardware zbar
+PKG_SUGGESTED_OPTIONS=		x11 zbar
 
 .include "../../mk/bsd.prefs.mk"
 .include "../../mk/bsd.options.mk"
@@ -11,3 +11,18 @@ PKG_SUGGESTED_OPTIONS=		x11
 DEPENDS+=	${PYPKGPREFIX}-qt6>=6.9.0:../../x11/py-qt6
 DEPENDS+=	${PYPKGPREFIX}-qdarkstyle>=3.2:../../wip/py-qdarkstyle
 .endif
+
+.if !empty(PKG_OPTIONS:Mhardware)
+DEPENDS+=	${PYPKGPREFIX}-trezor>=0.13.0:../../security/py-trezor
+DEPENDS+=	${PYPKGPREFIX}-mnemonic>=0.8:../../devel/py-mnemonic
+DEPENDS+=	${PYPKGPREFIX}-cbor2>=5.4.6:../../devel/py-cbor2
+DEPENDS+=	${PYPKGPREFIX}-serial>=3.5.0:../../comms/py-serial
+DEPENDS+=	${PYPKGPREFIX}-hidapi>=0.14.0:../../wip/py-hidapi
+DEPENDS+=	${PYPKGPREFIX}-bitbox02>=7.0.0:../../wip/py-bitbox02
+DEPENDS+=	${PYPKGPREFIX}-ckcc-protocol>=0.7.7:../../wip/py-ckcc-protocol
+DEPENDS+=	${PYPKGPREFIX}-ledger-bitcoin>=0.2.0:../../wip/py-ledger-bitcoin
+.endif
+
+.if !empty(PKG_OPTIONS:Mzbar)
+.include "../../graphics/zbar/buildlink3.mk"
+.endif
diff --git a/py-electrum/patches/patch-electrum_plugins_coldcard_coldcard.py b/py-electrum/patches/patch-electrum_plugins_coldcard_coldcard.py
new file mode 100644
index 0000000000..29d1b0f4c6
--- /dev/null
+++ b/py-electrum/patches/patch-electrum_plugins_coldcard_coldcard.py
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Fix Coldcard plugin to support ckcc-protocol versions > 1.0
+
+--- electrum/plugins/coldcard/coldcard.py.orig	2000-11-11 11:11:11.000000000 +0000
++++ electrum/plugins/coldcard/coldcard.py
+@@ -34,7 +34,7 @@ try:
+     from ckcc.constants import (MAX_MSG_LEN, MAX_BLK_LEN, MSG_SIGNING_MAX_LENGTH, MAX_TXN_LEN,
+         AF_CLASSIC, AF_P2SH, AF_P2WPKH, AF_P2WSH, AF_P2WPKH_P2SH, AF_P2WSH_P2SH)
+ 
+-    from ckcc.client import ColdcardDevice, COINKITE_VID, CKCC_PID, CKCC_SIMULATOR_PATH
++    from ckcc.client import ColdcardDevice, COINKITE_VID, CKCC_PID, DEFAULT_SIM_SOCKET
+ 
+     requirements_ok = True
+ 
+@@ -511,7 +511,7 @@ class ColdcardPlugin(HW_PluginBase):
+     def detect_simulator(self):
+         # if there is a simulator running on this machine,
+         # return details about it so it's offered as a pairing choice
+-        fn = CKCC_SIMULATOR_PATH
++        fn = DEFAULT_SIM_SOCKET
+ 
+         if os.path.exists(fn):
+             return [Device(path=fn,


Home | Main Index | Thread Index | Old Index