From 43b7e27aaacec251b66247e8caf4a55a75cb0219 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 8 Nov 2024 16:58:14 +0100 Subject: [PATCH] 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 --- pkgs/development/python-modules/hidapi/default.nix | 13 +------------ pkgs/top-level/python-packages.nix | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/hidapi/default.nix b/pkgs/development/python-modules/hidapi/default.nix index 976961d2164b..5c1fdda9484f 100644 --- a/pkgs/development/python-modules/hidapi/default.nix +++ b/pkgs/development/python-modules/hidapi/default.nix @@ -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; { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6582ff759efb..f4d6dea86887 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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 { };