Merge pull request #99478 from risicle/ris-hidapi-darwin-fix

pythonPackages.hidapi: fix build on darwin
This commit is contained in:
Martin Weinelt 2020-10-04 05:29:58 +02:00 committed by GitHub
commit 9751fa8a40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,8 +19,12 @@ buildPythonPackage rec {
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
'' + stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace setup.py --replace 'macos_sdk_path =' 'macos_sdk_path = "" #'
'';
pythonImportsCheck = [ "hid" ];
meta = with stdenv.lib; {
description = "A Cython interface to the hidapi from https://github.com/signal11/hidapi";
homepage = "https://github.com/trezor/cython-hidapi";