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