python3Packages.hidapi: Remove libusb dependency

Since version v0.14.0.post2, hidapi defaults to the hidraw backend so
libusb is no longer required.

See also: https://github.com/NixOS/nixpkgs/pull/329704
This commit is contained in:
Robin Krahl 2024-11-08 16:58:14 +01:00
parent 63f568345a
commit 43b7e27aaa
No known key found for this signature in database
GPG Key ID: B7556972702AFD45
2 changed files with 2 additions and 13 deletions

View File

@ -5,7 +5,6 @@
fetchPypi,
xcbuild,
cython_0,
libusb1,
udev,
darwin,
}:
@ -23,10 +22,7 @@ buildPythonPackage rec {
nativeBuildInputs = [ cython_0 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
propagatedBuildInputs =
lib.optionals stdenv.hostPlatform.isLinux [
libusb1
udev
]
lib.optionals stdenv.hostPlatform.isLinux [ udev ]
++ lib.optionals stdenv.hostPlatform.isDarwin (
with darwin.apple_sdk.frameworks;
[
@ -36,13 +32,6 @@ buildPythonPackage rec {
]
);
# Fix the USB backend library lookup
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
libusb=${libusb1.dev}/include/libusb-1.0
test -d $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; }
sed -i -e "s|/usr/include/libusb-1.0|$libusb|" setup.py
'';
pythonImportsCheck = [ "hid" ];
meta = with lib; {

View File

@ -5756,7 +5756,7 @@ self: super: with self; {
};
hidapi = callPackage ../development/python-modules/hidapi {
inherit (pkgs) udev libusb1;
inherit (pkgs) udev;
};
hid-parser = callPackage ../development/python-modules/hid-parser { };