diff --git a/pkgs/development/python-modules/hwi/default.nix b/pkgs/development/python-modules/hwi/default.nix new file mode 100644 index 00000000000..de9c7995bde --- /dev/null +++ b/pkgs/development/python-modules/hwi/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonPackage +, fetchPypi +, mnemonic +, ecdsa +, typing-extensions +, hidapi +, libusb1 +, pyaes +, trezor +, btchip +, ckcc-protocol +}: + +buildPythonPackage rec { + pname = "hwi"; + version = "1.1.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "eec460a51eb556500c1eca92015be246d5714cd53171407a76da71e4346048ae"; + }; + + propagatedBuildInputs = [ + mnemonic + ecdsa + typing-extensions + hidapi + libusb1 + pyaes + trezor + btchip + ckcc-protocol + ]; + + patches = [ ./relax-deps.patch ]; + + # tests are not packaged in the released tarball + doCheck = false; + + pythonImportsCheck = [ + "hwilib" + ]; + + meta = { + description = "Bitcoin Hardware Wallet Interface"; + homepage = "https://github.com/bitcoin-core/hwi"; + license = with lib.licenses; [ mit ]; + maintainers = with lib.maintainers; [ prusnak ]; + }; +} diff --git a/pkgs/development/python-modules/hwi/relax-deps.patch b/pkgs/development/python-modules/hwi/relax-deps.patch new file mode 100644 index 00000000000..ff6c6b9768f --- /dev/null +++ b/pkgs/development/python-modules/hwi/relax-deps.patch @@ -0,0 +1,16 @@ +--- 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'] + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 191b6b32ece..31d9ae88190 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1055,6 +1055,8 @@ in httperf = callPackage ../tools/networking/httperf { }; + hwi = with python3Packages; toPythonApplication hwi; + ili2c = callPackage ../tools/misc/ili2c { }; imageworsener = callPackage ../tools/graphics/imageworsener { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b580e3f834c..acc093a3957 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -872,6 +872,8 @@ in { httptools = callPackage ../development/python-modules/httptools { }; + hwi = callPackage ../development/python-modules/hwi { }; + i3ipc = callPackage ../development/python-modules/i3ipc { }; ignite = callPackage ../development/python-modules/ignite { };