2023-03-03 19:37:04 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
hidapi,
|
|
|
|
pyscard,
|
|
|
|
ecdsa,
|
|
|
|
}:
|
2018-10-02 00:13:03 +02:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "btchip-python";
|
2021-02-11 02:55:39 +00:00
|
|
|
version = "0.1.32";
|
2023-03-03 19:37:04 +01:00
|
|
|
format = "setuptools";
|
2018-10-02 00:13:03 +02:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-03 19:37:04 +01:00
|
|
|
hash = "sha256-NPXgwWHAj2XcDQcLov9MMV7SHEt+D6oypGhi0Nwbj1U=";
|
2018-10-02 00:13:03 +02:00
|
|
|
};
|
|
|
|
|
2023-03-03 19:37:04 +01:00
|
|
|
postPatch = ''
|
|
|
|
# fix extra_requires validation
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "python-pyscard>=1.6.12-4build1" "python-pyscard>=1.6.12"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
hidapi
|
|
|
|
ecdsa
|
|
|
|
];
|
|
|
|
|
2024-09-28 22:35:45 -07:00
|
|
|
optional-dependencies.smartcard = [ pyscard ];
|
2018-10-02 00:13:03 +02:00
|
|
|
|
|
|
|
# tests requires hardware
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-03-03 19:37:04 +01:00
|
|
|
pythonImportsCheck = [ "btchip.btchip" ];
|
2021-02-11 04:04:37 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-10-02 00:13:03 +02:00
|
|
|
description = "Python communication library for Ledger Hardware Wallet products";
|
|
|
|
homepage = "https://github.com/LedgerHQ/btchip-python";
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|