2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchPypi, libusb1, pytestCheckHook }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "libusb1";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "3.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "5792a9defee40f15d330a40d9b1800545c32e47ba7fc66b6f28f133c9fcc8538";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-10-17 09:34:42 +00:00
|
|
|
substituteInPlace usb1/_libusb1.py --replace \
|
2020-04-24 23:36:52 +00:00
|
|
|
"ctypes.util.find_library(base_name)" \
|
|
|
|
"'${libusb1}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ libusb1 ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"usb1/testUSB1.py"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/vpelletier/python-libusb1";
|
|
|
|
description = "Python ctype-based wrapper around libusb1";
|
|
|
|
license = licenses.lgpl2Plus;
|
2020-12-25 13:55:36 +00:00
|
|
|
maintainers = with maintainers; [ prusnak rnhmjoj ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|