2020-07-15 15:37:51 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2021-01-03 21:33:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, bitbox02
|
2020-07-15 15:37:51 +01:00
|
|
|
, ecdsa
|
|
|
|
, hidapi
|
|
|
|
, libusb1
|
2021-01-03 21:33:12 +00:00
|
|
|
, mnemonic
|
2020-07-15 15:37:51 +01:00
|
|
|
, pyaes
|
2021-01-03 21:33:12 +00:00
|
|
|
, pythonAtLeast
|
2020-07-15 15:37:51 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hwi";
|
2020-11-29 14:04:31 +00:00
|
|
|
version = "1.2.1";
|
2021-01-03 21:33:12 +00:00
|
|
|
disabled = pythonAtLeast "3.9";
|
2020-07-15 15:37:51 +01:00
|
|
|
|
2021-01-03 21:33:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bitcoin-core";
|
|
|
|
repo = "HWI";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0fs3152lw7y5l9ssr5as8gd739m9lb7wxpv1vc5m77k5nw7l8ax5";
|
2020-07-15 15:37:51 +01:00
|
|
|
};
|
|
|
|
|
2021-01-03 21:33:12 +00:00
|
|
|
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'"
|
|
|
|
'';
|
|
|
|
|
2020-07-15 15:37:51 +01:00
|
|
|
propagatedBuildInputs = [
|
2021-01-03 21:33:12 +00:00
|
|
|
bitbox02
|
2020-07-15 15:37:51 +01:00
|
|
|
ecdsa
|
|
|
|
hidapi
|
|
|
|
libusb1
|
2021-01-03 21:33:12 +00:00
|
|
|
mnemonic
|
2020-07-15 15:37:51 +01:00
|
|
|
pyaes
|
|
|
|
];
|
|
|
|
|
2021-01-03 21:33:12 +00:00
|
|
|
# tests require to clone quite a few firmwares
|
2020-07-15 15:37:51 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-03 21:33:12 +00:00
|
|
|
pythonImportsCheck = [ "hwilib" ];
|
2020-07-15 15:37:51 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Bitcoin Hardware Wallet Interface";
|
|
|
|
homepage = "https://github.com/bitcoin-core/hwi";
|
|
|
|
license = with lib.licenses; [ mit ];
|
|
|
|
maintainers = with lib.maintainers; [ prusnak ];
|
|
|
|
};
|
|
|
|
}
|