3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/libusb1/default.nix

33 lines
853 B
Nix
Raw Normal View History

{ 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
};
postPatch = ''
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 ];
checkInputs = [ pytestCheckHook ];
pytestFlagsArray = [
"usb1/testUSB1.py"
];
2018-07-30 17:28:58 +01:00
meta = with lib; {
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
};
}