about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/hwi/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/hwi/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/hwi/default.nix41
1 files changed, 21 insertions, 20 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/hwi/default.nix b/nixpkgs/pkgs/development/python-modules/hwi/default.nix
index 6431791d65e6..7c34235a190b 100644
--- a/nixpkgs/pkgs/development/python-modules/hwi/default.nix
+++ b/nixpkgs/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";