Files
nixpkgs/pkgs/development/python-modules/libusb1/default.nix
Martin Weinelt 9e52af5181 python3Packages.libusb1: update libusb path substiution
The code was moved into _libusb1.py. Also migrate to pytestCheckHook.
2021-10-11 01:22:10 +02:00

33 lines
854 B
Nix

{ lib, stdenv, buildPythonPackage, fetchPypi, libusb1, pytestCheckHook }:
buildPythonPackage rec {
pname = "libusb1";
version = "1.10.1";
src = fetchPypi {
inherit pname version;
sha256 = "8d70e5ef11a9facf304e696cc1d571c526bd9e02a8710a045b3b2567db7a54e0";
};
postPatch = ''
substituteInPlace usb1/_libusb1.py --replace \
"ctypes.util.find_library(base_name)" \
"'${libusb1}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}'"
'';
buildInputs = [ libusb1 ];
checkInputs = [ pytestCheckHook ];
pytestFlagsArray = [
"usb1/testUSB1.py"
];
meta = with lib; {
homepage = "https://github.com/vpelletier/python-libusb1";
description = "Python ctype-based wrapper around libusb1";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ prusnak rnhmjoj ];
};
}