1{ lib
2, buildPythonPackage
3, fetchPypi
4, libftdi1
5, libusb1
6}:
7
8buildPythonPackage rec {
9 pname = "pylibftdi";
10 version = "0.19.0";
11
12 src = fetchPypi {
13 inherit pname version;
14 sha256 = "bb0ec74df292ef884aa37bf1e98fb9df4d338718e1559eebda363317a792123e";
15 };
16
17 propagatedBuildInputs = [
18 libftdi1
19 libusb1
20 ];
21
22 postPatch = ''
23 substituteInPlace pylibftdi/driver.py \
24 --replace "self._load_library('libusb')" "cdll.LoadLibrary('${libusb1.out}/lib/libusb-1.0.so')" \
25 --replace "self._load_library('libftdi')" "cdll.LoadLibrary('${libftdi1.out}/lib/libftdi1.so')"
26 '';
27
28 pythonImportsCheck = [ "pylibftdi" ];
29
30 meta = with lib; {
31 homepage = "https://bitbucket.org/codedstructure/pylibftdi/src/default/";
32 description = "Minimal pythonic wrapper to Intra2net's libftdi driver for FTDI's USB devices";
33 license = licenses.mit;
34 maintainers = with maintainers; [ matthuszagh ];
35 };
36}