Files
nixpkgs/pkgs/development/python-modules/hid/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

40 lines
817 B
Nix

{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
hidapi,
}:
buildPythonPackage rec {
pname = "hid";
version = "1.0.8";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-XKEpp7lDSs5ePkKcEJKhZ5L+/68Geka2ZunFhocs3P4=";
};
postPatch = ''
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
'';
build-system = [ setuptools ];
dependencies = [ hidapi ];
doCheck = false; # no tests
pythonImportsCheck = [ "hid" ];
meta = {
description = "Hidapi bindings in ctypes";
homepage = "https://github.com/apmorton/pyhidapi";
license = with lib.licenses; [ mit ];
maintainers = [ ];
};
}