Electrum is installed with various hardware wallet plugins but they lack the

necessary python backends. Now that we have ports for the TREZOR and LEDGER
hardware wallets in the ports tree add those as an option and enable by default.
Provide devd sample rules and display a message on how to enable.

Takeover maintainership.

PR:		222946
Approved by:	amutu@amutu.com
This commit is contained in:
Emanuel Haupt 2017-10-13 15:09:30 +00:00
parent 50773eef9e
commit d70de080a6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=452010
4 changed files with 66 additions and 1 deletions

View file

@ -3,12 +3,13 @@
PORTNAME= electrum
PORTVERSION= 2.9.3
PORTREVISION= 1
CATEGORIES= finance python
MASTER_SITES= https://download.electrum.org/${PORTVERSION}/ \
http://download.electrum.org/${PORTVERSION}/
DISTNAME= Electrum-${PORTVERSION}
MAINTAINER= amutu@amutu.com
MAINTAINER= ehaupt@FreeBSD.org
COMMENT= Easy to use Bitcoin client
LICENSE= MIT
@ -29,8 +30,32 @@ USE_PYQT= gui_run
USE_PYTHON= autoplist distutils
PYDISTUTILS_PKGNAME= Electrum
NO_ARCH= yes
OPTIONS_SUB= yes
OPTIONS_DEFINE= LEDGER TREZOR
OPTIONS_DEFAULT=LEDGER TREZOR
LEDGER_DESC= Enable LEDGER Bitcoin hardware wallet support
TREZOR_DESC= Enable TREZOR Bitcoin hardware wallet support
LEDGER_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}btchip>0:security/py-btchip
TREZOR_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}trezor>0:security/py-trezor
LEDGER_PLIST_FILES= "@sample etc/devd/ledger_wallet.conf.sample"
TREZOR_PLIST_FILES= "@sample etc/devd/trezor_wallet.conf.sample"
LEDGER_SUB_FILES= pkg-message-hwwallet
TREZOR_SUB_FILES= pkg-message-hwwallet
post-patch:
@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/setup.py
post-install-LEDGER-on:
${INSTALL_DATA} ${FILESDIR}/ledger_wallet.conf.sample \
${STAGEDIR}${PREFIX}/etc/devd
post-install-TREZOR-on:
${INSTALL_DATA} ${FILESDIR}/trezor_wallet.conf.sample \
${STAGEDIR}${PREFIX}/etc/devd
.include <bsd.port.mk>

View file

@ -0,0 +1,13 @@
# $FreeBSD$
#
# Allow members of group operator to access hardware wallet devices
## Ledger Nano S
#notify 301 {
# match "system" "USB";
# match "subsystem" "DEVICE";
# match "vendor" "0x2c97";
# match "product" "0x0001";
# match "type" "ATTACH";
# action "/bin/chmod g=rw /dev/$cdev";
#};

View file

@ -0,0 +1,14 @@
For hardware wallet devices to work you need to be in the operator group
and need r/w permissions to the appropriate /dev/usb/* device.
Add a user to operator group:
% pw groupmod operator -m satoshi
Edit your configuration:
%%PREFIX%%/etc/devd/*_wallet.conf
Then restart devd to load the new rules:
% /etc/rc.d/devd restart

View file

@ -0,0 +1,13 @@
# $FreeBSD$
#
# Allow members of group operator to access hardware wallet devices
## SatoshiLabs TREZOR
#notify 301 {
# match "system" "USB";
# match "subsystem" "DEVICE";
# match "vendor" "0x534c";
# match "product" "0x0001";
# match "type" "ATTACH";
# action "/bin/chmod g=rw /dev/$cdev";
#};