about summary refs log tree commit diff
path: root/pkgs/development/python-modules/hidapi/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/hidapi/default.nix')
-rw-r--r--pkgs/development/python-modules/hidapi/default.nix17
1 files changed, 3 insertions, 14 deletions
diff --git a/pkgs/development/python-modules/hidapi/default.nix b/pkgs/development/python-modules/hidapi/default.nix
index ee69705614c9..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,
 }:
@@ -20,14 +19,11 @@ buildPythonPackage rec {
     sha256 = "sha256-bA6XumsFmjCdUbSVqPDV77zqh1a2QNmLb2u5/e8kWKw=";
   };
 
-  nativeBuildInputs = [ cython_0 ] ++ lib.optionals stdenv.isDarwin [ xcbuild ];
+  nativeBuildInputs = [ cython_0 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
 
   propagatedBuildInputs =
-    lib.optionals stdenv.isLinux [
-      libusb1
-      udev
-    ]
-    ++ lib.optionals stdenv.isDarwin (
+    lib.optionals stdenv.hostPlatform.isLinux [ udev ]
+    ++ lib.optionals stdenv.hostPlatform.isDarwin (
       with darwin.apple_sdk.frameworks;
       [
         AppKit
@@ -36,13 +32,6 @@ buildPythonPackage rec {
       ]
     );
 
-  # Fix the USB backend library lookup
-  postPatch = lib.optionalString stdenv.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; {