1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 hidapi,
7}:
8
9buildPythonPackage rec {
10 pname = "hid";
11 version = "1.0.8";
12 pyproject = true;
13
14 src = fetchPypi {
15 inherit pname version;
16 hash = "sha256-XKEpp7lDSs5ePkKcEJKhZ5L+/68Geka2ZunFhocs3P4=";
17 };
18
19 postPatch = ''
20 hidapi=${hidapi}/lib/
21 test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; }
22 sed -i -e "s|libhidapi|$hidapi/libhidapi|" hid/__init__.py
23 '';
24
25 build-system = [ setuptools ];
26
27 dependencies = [ hidapi ];
28
29 doCheck = false; # no tests
30
31 pythonImportsCheck = [ "hid" ];
32
33 meta = with lib; {
34 description = "Hidapi bindings in ctypes";
35 homepage = "https://github.com/apmorton/pyhidapi";
36 license = with licenses; [ mit ];
37 maintainers = with maintainers; [ ];
38 };
39}