about summary refs log tree commit diff
path: root/pkgs/development/python-modules/hwi
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2021-01-03 22:33:12 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2021-01-07 10:42:02 +0100
commit863d89b767c4de7d6a87b77a2b13d74177b2f201 (patch)
tree56f2f4edb940e09f9d589d99803f1fabbc93cd11 /pkgs/development/python-modules/hwi
parent8cc981adc2f3ccf9b339231b4d58f7725ce1a693 (diff)
pythonPackages.hwi: Fix dependencies, cleanup
Diffstat (limited to 'pkgs/development/python-modules/hwi')
-rw-r--r--pkgs/development/python-modules/hwi/default.nix41
-rw-r--r--pkgs/development/python-modules/hwi/relax-deps.patch16
2 files changed, 21 insertions, 36 deletions
diff --git a/pkgs/development/python-modules/hwi/default.nix b/pkgs/development/python-modules/hwi/default.nix
index 6431791d65e68..7c34235a190b9 100644
--- a/pkgs/development/python-modules/hwi/default.nix
+++ b/pkgs/development/python-modules/hwi/default.nix
@@ -1,46 +1,47 @@
 { lib
 , buildPythonPackage
-, fetchPypi
-, mnemonic
+, fetchFromGitHub
+, bitbox02
 , ecdsa
-, typing-extensions
 , hidapi
 , libusb1
+, mnemonic
 , pyaes
-, trezor
-, btchip
-, ckcc-protocol
+, pythonAtLeast
 }:
 
 buildPythonPackage rec {
   pname = "hwi";
   version = "1.2.1";
+  disabled = pythonAtLeast "3.9";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "d0d220a4967d7f106b828b12a98b78c220d609d7cc6c811898e24fcf1a6f04f3";
+  src = fetchFromGitHub {
+    owner = "bitcoin-core";
+    repo = "HWI";
+    rev = version;
+    sha256 = "0fs3152lw7y5l9ssr5as8gd739m9lb7wxpv1vc5m77k5nw7l8ax5";
   };
 
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "'ecdsa>=0.13.0,<0.14.0'" "'ecdsa'" \
+      --replace "'hidapi>=0.7.99,<0.8.0'" "'hidapi'" \
+      --replace "'mnemonic>=0.18.0,<0.19.0'" "'mnemonic'"
+  '';
+
   propagatedBuildInputs = [
-    mnemonic
+    bitbox02
     ecdsa
-    typing-extensions
     hidapi
     libusb1
+    mnemonic
     pyaes
-    trezor
-    btchip
-    ckcc-protocol
   ];
 
-  patches = [ ./relax-deps.patch ];
-
-  # tests are not packaged in the released tarball
+  # tests require to clone quite a few firmwares
   doCheck = false;
 
-  pythonImportsCheck = [
-    "hwilib"
-  ];
+  pythonImportsCheck = [ "hwilib" ];
 
   meta = {
     description = "Bitcoin Hardware Wallet Interface";
diff --git a/pkgs/development/python-modules/hwi/relax-deps.patch b/pkgs/development/python-modules/hwi/relax-deps.patch
deleted file mode 100644
index ff6c6b9768f62..0000000000000
--- a/pkgs/development/python-modules/hwi/relax-deps.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/setup.py
-+++ b/setup.py
-@@ -98,10 +98,10 @@ package_data = \
- modules = \
- ['hwi', 'hwi-qt']
- install_requires = \
--['ecdsa>=0.13.0,<0.14.0',
-- 'hidapi>=0.7.99,<0.8.0',
-+['ecdsa',
-+ 'hidapi',
-  'libusb1>=1.7,<2.0',
-+ 'mnemonic',
-- 'mnemonic>=0.18.0,<0.19.0',
-  'pyaes>=1.6,<2.0',
-  'typing-extensions>=3.7,<4.0']
-