nixpkgs/pkgs/development/python-modules/hwi/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.2 KiB
Nix
Raw Normal View History

2020-07-15 15:37:51 +01:00
{ lib
, buildPythonPackage
, fetchFromGitHub
, bitbox02
2020-07-15 15:37:51 +01:00
, ecdsa
, hidapi
, libusb1
, mnemonic
2020-07-15 15:37:51 +01:00
, pyaes
2021-03-05 22:23:06 +00:00
, typing-extensions
, pythonOlder
2020-07-15 15:37:51 +01:00
}:
buildPythonPackage rec {
pname = "hwi";
2021-06-02 16:31:31 +01:00
version = "2.0.2";
format = "setuptools";
disabled = pythonOlder "3.7";
2020-07-15 15:37:51 +01:00
src = fetchFromGitHub {
owner = "bitcoin-core";
repo = "HWI";
rev = version;
2021-06-02 16:31:31 +01:00
sha256 = "sha256-s0pKYqesZjHE6YndqsMwCuqLK7eE82oRiSXxBdUtEX4=";
2020-07-15 15:37:51 +01:00
};
propagatedBuildInputs = [
bitbox02
2020-07-15 15:37:51 +01:00
ecdsa
hidapi
libusb1
mnemonic
2020-07-15 15:37:51 +01:00
pyaes
2021-03-05 22:23:06 +00:00
typing-extensions
2020-07-15 15:37:51 +01:00
];
# make compatible with libusb1 2.x
postPatch = ''
substituteInPlace setup.py \
--replace 'libusb1>=1.7,<2.0' 'libusb1>=1.7' \
--replace "'python_requires': '>=3.6,<3.10'," "'python_requires': '>=3.6,<4'," \
--replace 'typing-extensions>=3.7,<4.0' 'typing-extensions>=3.7'
'';
# tests require to clone quite a few firmwares
2020-07-15 15:37:51 +01:00
doCheck = false;
pythonImportsCheck = [
"hwilib"
];
2020-07-15 15:37:51 +01:00
meta = with lib; {
2020-07-15 15:37:51 +01:00
description = "Bitcoin Hardware Wallet Interface";
homepage = "https://github.com/bitcoin-core/hwi";
license = with licenses; [ mit ];
maintainers = with maintainers; [ prusnak ];
2020-07-15 15:37:51 +01:00
};
}