limo: 1.0.11 > 1.1 (#376325)
[NixPkgs.git] / pkgs / development / python-modules / pylibftdi / default.nix
blob359af2a577d897b6e3dcae7b2cad3c9d53bc058f
2   lib,
3   buildPythonPackage,
4   fetchPypi,
5   libftdi1,
6   libusb1,
7   pythonOlder,
8   poetry-core,
9 }:
11 buildPythonPackage rec {
12   pname = "pylibftdi";
13   version = "0.23.0";
14   pyproject = true;
16   disabled = pythonOlder "3.7";
18   src = fetchPypi {
19     inherit pname version;
20     hash = "sha256-v1tMa6c9eab234ScNFsAunY9AjIBvtm6Udh2pDl7Ftg=";
21   };
23   build-system = [ poetry-core ];
25   dependencies = [
26     libftdi1
27     libusb1
28   ];
30   postPatch = ''
31     substituteInPlace src/pylibftdi/driver.py \
32       --replace-fail 'self._load_library("libusb")' 'cdll.LoadLibrary("${libusb1.out}/lib/libusb-1.0.so")' \
33       --replace-fail 'self._load_library("libftdi")' 'cdll.LoadLibrary("${libftdi1.out}/lib/libftdi1.so")'
34   '';
36   pythonImportsCheck = [ "pylibftdi" ];
38   meta = with lib; {
39     description = "Wrapper to Intra2net's libftdi driver for FTDI's USB devices";
40     homepage = "https://pylibftdi.readthedocs.io/";
41     changelog = "https://github.com/codedstructure/pylibftdi/blob/${version}/CHANGES.txt";
42     license = licenses.mit;
43     maintainers = with maintainers; [ matthuszagh ];
44   };