From 063aa389dfaa29b697acf2db72610324b1b6aa39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kemetm=C3=BCller?= Date: Sun, 9 Sep 2018 20:56:34 +0200 Subject: [PATCH 1/2] pythonPackages.libusb1: Fix darwin build --- pkgs/development/python-modules/libusb1/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/libusb1/default.nix b/pkgs/development/python-modules/libusb1/default.nix index 245ea90038ea..a460fb8a1185 100644 --- a/pkgs/development/python-modules/libusb1/default.nix +++ b/pkgs/development/python-modules/libusb1/default.nix @@ -9,7 +9,7 @@ buildPythonPackage rec { sha256 = "a49917a2262cf7134396f6720c8be011f14aabfc5cdc53f880cc672c0f39d271"; }; - postPatch = lib.optionalString stdenv.isLinux '' + postPatch = '' substituteInPlace usb1/libusb1.py --replace \ "ctypes.util.find_library(base_name)" \ "'${libusb1}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}'" From b633fc4fb4b3bbd44b4bbb1d29d3f3fa642991f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kemetm=C3=BCller?= Date: Sun, 9 Sep 2018 22:09:34 +0200 Subject: [PATCH 2/2] pythonPackages.libusb1: Disable flaky test --- pkgs/development/python-modules/libusb1/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/libusb1/default.nix b/pkgs/development/python-modules/libusb1/default.nix index a460fb8a1185..8a9b5da68ef9 100644 --- a/pkgs/development/python-modules/libusb1/default.nix +++ b/pkgs/development/python-modules/libusb1/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildPythonPackage, fetchPypi, python, libusb1 }: +{ stdenv, lib, buildPythonPackage, fetchPypi, python, libusb1, pytest }: buildPythonPackage rec { pname = "libusb1"; @@ -17,8 +17,12 @@ buildPythonPackage rec { buildInputs = [ libusb1 ]; + checkInputs = [ pytest ]; + checkPhase = '' - ${python.interpreter} -m usb1.testUSB1 + # USBPollerThread is unreliable. Let's not test it. + # See: https://github.com/vpelletier/python-libusb1/issues/16 + py.test -k 'not testUSBPollerThreadExit' usb1/testUSB1.py ''; meta = with stdenv.lib; {