nixpkgs/pkgs/development/python-modules/hid/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
760 B
Nix
Raw Normal View History

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 ];
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 ];
};
}