mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-21 05:04:00 +00:00
5082c85ea2
the hack in checkPhase is no longer needed since the issue has been resolved: https://github.com/vpelletier/python-libusb1/issues/16
33 lines
836 B
Nix
33 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 ];
|
|
};
|
|
}
|