1{ 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 hidapi, 6 pyscard, 7 ecdsa, 8}: 9 10buildPythonPackage rec { 11 pname = "btchip-python"; 12 version = "0.1.32"; 13 format = "setuptools"; 14 15 src = fetchPypi { 16 inherit pname version; 17 hash = "sha256-NPXgwWHAj2XcDQcLov9MMV7SHEt+D6oypGhi0Nwbj1U="; 18 }; 19 20 postPatch = '' 21 # fix extra_requires validation 22 substituteInPlace setup.py \ 23 --replace "python-pyscard>=1.6.12-4build1" "python-pyscard>=1.6.12" 24 ''; 25 26 propagatedBuildInputs = [ 27 hidapi 28 ecdsa 29 ]; 30 31 optional-dependencies.smartcard = [ pyscard ]; 32 33 # tests requires hardware 34 doCheck = false; 35 36 pythonImportsCheck = [ "btchip.btchip" ]; 37 38 meta = with lib; { 39 description = "Python communication library for Ledger Hardware Wallet products"; 40 homepage = "https://github.com/LedgerHQ/btchip-python"; 41 license = licenses.asl20; 42 }; 43}