depot/third_party/nixpkgs/pkgs/development/python-modules/pylibftdi/default.nix
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

45 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
libftdi1,
libusb1,
pythonOlder,
poetry-core,
}:
buildPythonPackage rec {
pname = "pylibftdi";
version = "0.22.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-haaqtDj3ZTQoQ6otWbso+7DTCEemIfuYAJhRhZkPAa8=";
};
build-system = [ poetry-core ];
dependencies = [
libftdi1
libusb1
];
postPatch = ''
substituteInPlace src/pylibftdi/driver.py \
--replace-fail 'self._load_library("libusb")' 'cdll.LoadLibrary("${libusb1.out}/lib/libusb-1.0.so")' \
--replace-fail 'self._load_library("libftdi")' 'cdll.LoadLibrary("${libftdi1.out}/lib/libftdi1.so")'
'';
pythonImportsCheck = [ "pylibftdi" ];
meta = with lib; {
description = "Wrapper to Intra2net's libftdi driver for FTDI's USB devices";
homepage = "https://pylibftdi.readthedocs.io/";
changelog = "https://github.com/codedstructure/pylibftdi/blob/${version}/CHANGES.txt";
license = licenses.mit;
maintainers = with maintainers; [ matthuszagh ];
};
}