2021-06-23 03:34:39 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, hidapi
|
|
|
|
, nose
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hid";
|
2022-04-08 23:51:25 +00:00
|
|
|
version = "1.0.5";
|
2021-06-23 03:34:39 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-04-08 23:51:25 +00:00
|
|
|
sha256 = "sha256-HpVOf3q5t8nfx421lQRpLBfbO3EklJK5drFSW5fbsOg=";
|
2021-06-23 03:34:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ hidapi ];
|
|
|
|
|
|
|
|
checkInputs = [ nose ];
|
|
|
|
|
2021-06-24 19:24:01 +00:00
|
|
|
postPatch = ''
|
2021-06-23 03:34:39 +00:00
|
|
|
hidapi=${hidapi}/lib/
|
|
|
|
test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; }
|
|
|
|
sed -i -e "s|libhidapi|$hidapi/libhidapi|" hid/__init__.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "hidapi bindings in ctypes";
|
|
|
|
homepage = "https://github.com/apmorton/pyhidapi";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
|
|
|
};
|
|
|
|
}
|