2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
hidapi,
|
|
|
|
pyscard,
|
|
|
|
ecdsa,
|
|
|
|
}:
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "btchip-python";
|
|
|
|
version = "0.1.32";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
hash = "sha256-NPXgwWHAj2XcDQcLov9MMV7SHEt+D6oypGhi0Nwbj1U=";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# fix extra_requires validation
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "python-pyscard>=1.6.12-4build1" "python-pyscard>=1.6.12"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
hidapi
|
|
|
|
ecdsa
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
passthru.optional-dependencies.smartcard = [ pyscard ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
# tests requires hardware
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "btchip.btchip" ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python communication library for Ledger Hardware Wallet products";
|
|
|
|
homepage = "https://github.com/LedgerHQ/btchip-python";
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|