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.

63 lines
1.2 KiB
Nix
Raw Normal View History

2020-07-15 14:37:51 +00:00
{ lib
, buildPythonPackage
, fetchFromGitHub
, bitbox02
2022-02-19 15:40:34 +00:00
, cbor
2020-07-15 14:37:51 +00:00
, ecdsa
, hidapi
, libusb1
, mnemonic
2020-07-15 14:37:51 +00:00
, pyaes
2022-02-19 15:40:34 +00:00
, pyserial
2021-03-05 22:23:06 +00:00
, typing-extensions
, pythonOlder
2020-07-15 14:37:51 +00:00
}:
buildPythonPackage rec {
pname = "hwi";
2022-05-25 12:28:48 +00:00
version = "2.1.1";
format = "setuptools";
src = fetchFromGitHub {
owner = "bitcoin-core";
repo = "HWI";
rev = version;
2022-05-25 12:28:48 +00:00
sha256 = "sha256-jsJjGezf2JrPYr3YNZGx23Jo14DbmM1S6bu7+xgZh58=";
2020-07-15 14:37:51 +00:00
};
propagatedBuildInputs = [
bitbox02
2022-02-19 15:40:34 +00:00
cbor
2020-07-15 14:37:51 +00:00
ecdsa
hidapi
libusb1
mnemonic
2020-07-15 14:37:51 +00:00
pyaes
2022-02-19 15:40:34 +00:00
pyserial
2021-03-05 22:23:06 +00:00
typing-extensions
2020-07-15 14:37:51 +00:00
];
2022-02-19 15:40:34 +00:00
# relax required dependencies:
# libusb1 - https://github.com/bitcoin-core/HWI/issues/579
# typing-extensions - https://github.com/bitcoin-core/HWI/issues/572
postPatch = ''
substituteInPlace setup.py \
2022-02-19 15:40:34 +00:00
--replace 'libusb1>=1.7,<3' 'libusb1>=1.7,<4' \
--replace 'typing-extensions>=3.7,<4.0' 'typing-extensions>=3.7,<5.0'
'';
# tests require to clone quite a few firmwares
2020-07-15 14:37:51 +00:00
doCheck = false;
pythonImportsCheck = [
"hwilib"
];
2020-07-15 14:37:51 +00:00
meta = with lib; {
2020-07-15 14:37:51 +00:00
description = "Bitcoin Hardware Wallet Interface";
homepage = "https://github.com/bitcoin-core/hwi";
license = with licenses; [ mit ];
maintainers = with maintainers; [ prusnak ];
2020-07-15 14:37:51 +00:00
};
}