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