Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / libusb1 / default.nix
blobb61b78a86321ac15e16ff5367229ebd9bc723a7b
1 { lib, stdenv, buildPythonPackage, fetchPypi, libusb1, pytestCheckHook }:
3 buildPythonPackage rec {
4   pname = "libusb1";
5   version = "3.1.0";
6   format = "setuptools";
8   src = fetchPypi {
9     inherit pname version;
10     sha256 = "4ee9b0a55f8bd0b3ea7017ae919a6c1f439af742c4a4b04543c5fd7af89b828c";
11   };
13   postPatch = ''
14     substituteInPlace usb1/_libusb1.py --replace \
15       "ctypes.util.find_library(base_name)" \
16       "'${libusb1}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}'"
17   '';
19   buildInputs = [ libusb1 ];
21   nativeCheckInputs = [ pytestCheckHook ];
23   pytestFlagsArray = [
24     "usb1/testUSB1.py"
25   ];
27   meta = with lib; {
28     homepage    = "https://github.com/vpelletier/python-libusb1";
29     description = "Python ctype-based wrapper around libusb1";
30     license     = licenses.lgpl2Plus;
31     maintainers = with maintainers; [ prusnak rnhmjoj ];
32   };