Skip to content

Commit 43b7e27

Browse files
committed
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: #329704
1 parent 63f5683 commit 43b7e27

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

pkgs/development/python-modules/hidapi/default.nix

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
fetchPypi,
66
xcbuild,
77
cython_0,
8-
libusb1,
98
udev,
109
darwin,
1110
}:
@@ -23,10 +22,7 @@ buildPythonPackage rec {
2322
nativeBuildInputs = [ cython_0 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
2423

2524
propagatedBuildInputs =
26-
lib.optionals stdenv.hostPlatform.isLinux [
27-
libusb1
28-
udev
29-
]
25+
lib.optionals stdenv.hostPlatform.isLinux [ udev ]
3026
++ lib.optionals stdenv.hostPlatform.isDarwin (
3127
with darwin.apple_sdk.frameworks;
3228
[
@@ -36,13 +32,6 @@ buildPythonPackage rec {
3632
]
3733
);
3834

39-
# Fix the USB backend library lookup
40-
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
41-
libusb=${libusb1.dev}/include/libusb-1.0
42-
test -d $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; }
43-
sed -i -e "s|/usr/include/libusb-1.0|$libusb|" setup.py
44-
'';
45-
4635
pythonImportsCheck = [ "hid" ];
4736

4837
meta = with lib; {

pkgs/top-level/python-packages.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5756,7 +5756,7 @@ self: super: with self; {
57565756
};
57575757

57585758
hidapi = callPackage ../development/python-modules/hidapi {
5759-
inherit (pkgs) udev libusb1;
5759+
inherit (pkgs) udev;
57605760
};
57615761

57625762
hid-parser = callPackage ../development/python-modules/hid-parser { };

0 commit comments

Comments
 (0)