2021-10-10 01:22:29 +01:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchPypi, libusb1, pytestCheckHook }:
|
2017-12-30 10:47:57 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "libusb1";
|
2021-10-17 17:53:27 +01:00
|
|
|
version = "2.0.1";
|
2017-12-30 10:47:57 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-10-17 17:53:27 +01:00
|
|
|
sha256 = "d3ba82ecf7ab6a48d21dac6697e26504670cc3522b8e5941bd28fb56cf3f6c46";
|
2017-12-30 10:47:57 +00:00
|
|
|
};
|
|
|
|
|
2018-09-09 19:56:34 +01:00
|
|
|
postPatch = ''
|
2021-10-10 01:22:29 +01:00
|
|
|
substituteInPlace usb1/_libusb1.py --replace \
|
2017-12-30 10:47:57 +00:00
|
|
|
"ctypes.util.find_library(base_name)" \
|
2017-12-31 10:17:34 +00:00
|
|
|
"'${libusb1}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
2017-12-30 10:47:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ libusb1 ];
|
|
|
|
|
2021-10-10 01:22:29 +01:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
2018-09-09 21:09:34 +01:00
|
|
|
|
2021-10-10 01:22:29 +01:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"usb1/testUSB1.py"
|
|
|
|
];
|
2018-07-30 17:28:58 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/vpelletier/python-libusb1";
|
2017-12-30 10:47:57 +00:00
|
|
|
description = "Python ctype-based wrapper around libusb1";
|
|
|
|
license = licenses.lgpl2Plus;
|
2020-12-14 12:03:36 +00:00
|
|
|
maintainers = with maintainers; [ prusnak rnhmjoj ];
|
2017-12-30 10:47:57 +00:00
|
|
|
};
|
|
|
|
}
|