nixpkgs-suyu/pkgs/development/python-modules/libusb1/default.nix
Pavol Rusnak 5082c85ea2
python3Packages.libusb1: 1.9.2 -> 1.9.3
the hack in checkPhase is no longer needed since the issue has been
resolved: https://github.com/vpelletier/python-libusb1/issues/16
2021-07-04 21:42:03 +02:00

32 lines
836 B
Nix

{ lib, stdenv, buildPythonPackage, fetchPypi, libusb1, pytest }:
buildPythonPackage rec {
pname = "libusb1";
version = "1.9.3";
src = fetchPypi {
inherit pname version;
sha256 = "60e6ce37be064f6e51d02b25da44230ecc9c0b1fdb6f14568c71457d963c1749";
};
postPatch = ''
substituteInPlace usb1/libusb1.py --replace \
"ctypes.util.find_library(base_name)" \
"'${libusb1}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}'"
'';
buildInputs = [ libusb1 ];
checkInputs = [ pytest ];
checkPhase = ''
py.test 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 ];
};
}