depot/third_party/nixpkgs/pkgs/development/python-modules/hwi/default.nix
Default email 83405b6dd2 Project import generated by Copybara.
GitOrigin-RevId: ac718d02867a84b42522a0ece52d841188208f2c
2023-03-15 17:39:30 +01:00

62 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, bitbox02
, cbor
, ecdsa
, hidapi
, libusb1
, mnemonic
, pyaes
, pyserial
, typing-extensions
, pythonOlder
}:
buildPythonPackage rec {
pname = "hwi";
version = "2.2.1";
format = "setuptools";
src = fetchFromGitHub {
owner = "bitcoin-core";
repo = "HWI";
rev = "refs/tags/${version}";
hash = "sha256-vQJN2YXWGvYSVV9lemZyu61inc9iBFxf5nIlpIiRe+s=";
};
propagatedBuildInputs = [
bitbox02
cbor
ecdsa
hidapi
libusb1
mnemonic
pyaes
pyserial
typing-extensions
];
# 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 \
--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
doCheck = false;
pythonImportsCheck = [
"hwilib"
];
meta = with lib; {
description = "Bitcoin Hardware Wallet Interface";
homepage = "https://github.com/bitcoin-core/hwi";
license = with licenses; [ mit ];
maintainers = with maintainers; [ prusnak ];
};
}