summary refs log tree commit diff
path: root/pkgs/development/python-modules/libusb1/default.nix
blob: 8d74a4d3c46e74c8d92eac33c63d4180282d48d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ stdenv, lib, buildPythonPackage, fetchPypi, libusb1 }:

buildPythonPackage rec {
  pname = "libusb1";
  version = "1.6.5";

  src = fetchPypi {
    inherit pname version;
    sha256 = "4707f81e933a97fed1c5bf7d4957f07bae1139cb8084bdee1f50201a40e3fd7c";
  };

  postPatch = lib.optionalString stdenv.isLinux ''
    substituteInPlace usb1/libusb1.py --replace \
      "ctypes.util.find_library(base_name)" \
      "'${libusb1}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}'"
  '';

  buildInputs = [ libusb1 ];

  meta = with stdenv.lib; {
    homepage    = https://github.com/vpelletier/python-libusb1;
    description = "Python ctype-based wrapper around libusb1";
    license     = licenses.lgpl2Plus;
    maintainers = with maintainers; [ rnhmjoj ];
  };
}