summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-python/trezor/files/51-trezor.rules10
-rw-r--r--dev-python/trezor/trezor-0.12.2.ebuild7
2 files changed, 15 insertions, 2 deletions
diff --git a/dev-python/trezor/files/51-trezor.rules b/dev-python/trezor/files/51-trezor.rules
new file mode 100644
index 00000000..f0e0329f
--- /dev/null
+++ b/dev-python/trezor/files/51-trezor.rules
@@ -0,0 +1,10 @@
+# Source: https://data.trezor.io/udev/51-trezor.rules
+
+# Trezor
+SUBSYSTEM=="usb", ATTR{idVendor}=="534c", ATTR{idProduct}=="0001", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="trezor%n"
+KERNEL=="hidraw*", ATTRS{idVendor}=="534c", ATTRS{idProduct}=="0001", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
+
+# Trezor v2
+SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="53c0", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="trezor%n"
+SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="53c1", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="trezor%n"
+KERNEL=="hidraw*", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="53c1", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
diff --git a/dev-python/trezor/trezor-0.12.2.ebuild b/dev-python/trezor/trezor-0.12.2.ebuild
index d318c1de..9e22eab1 100644
--- a/dev-python/trezor/trezor-0.12.2.ebuild
+++ b/dev-python/trezor/trezor-0.12.2.ebuild
@@ -1,10 +1,10 @@
-# Copyright 2019-2021 Gentoo Authors
+# Copyright 2019-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python{3_8,3_9} )
-inherit distutils-r1 bash-completion-r1
+inherit distutils-r1 bash-completion-r1 udev
DESCRIPTION="Python client for communicating with TREZOR Hardware Wallet"
HOMEPAGE="https://trezor.io"
@@ -29,7 +29,10 @@ BDEPEND=""
S="${WORKDIR}/trezor-firmware-python-v${PV}/python"
+distutils_enable_tests pytest
+
python_install_all() {
+ udev_dorules "${FILESDIR}/51-trezor.rules"
newbashcomp bash_completion.d/trezorctl.sh trezorctl
distutils-r1_python_install_all
}