2020-04-28 21:49:19 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, libftdi1
|
|
|
|
, libusb1
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pylibftdi";
|
2020-08-16 18:31:11 +01:00
|
|
|
version = "0.19.0";
|
2020-04-28 21:49:19 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-08-16 18:31:11 +01:00
|
|
|
sha256 = "bb0ec74df292ef884aa37bf1e98fb9df4d338718e1559eebda363317a792123e";
|
2020-04-28 21:49:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
libftdi1
|
|
|
|
libusb1
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pylibftdi/driver.py \
|
2020-05-02 18:08:57 +01:00
|
|
|
--replace "self._load_library('libusb')" "cdll.LoadLibrary('${libusb1.out}/lib/libusb-1.0.so')" \
|
2020-04-28 21:49:19 +01:00
|
|
|
--replace "self._load_library('libftdi')" "cdll.LoadLibrary('${libftdi1.out}/lib/libftdi1.so')"
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pylibftdi" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://bitbucket.org/codedstructure/pylibftdi/src/default/";
|
|
|
|
description = "Minimal pythonic wrapper to Intra2net's libftdi driver for FTDI's USB devices";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ matthuszagh ];
|
|
|
|
};
|
|
|
|
}
|