python311Packages.pylibftdi: refactor

This commit is contained in:
Fabian Affolter 2024-04-05 13:00:31 +02:00
parent e5a63c6e29
commit 08cc441cf7
1 changed files with 10 additions and 5 deletions

View File

@ -4,12 +4,13 @@
, libftdi1
, libusb1
, pythonOlder
, poetry-core
}:
buildPythonPackage rec {
pname = "pylibftdi";
version = "0.22.0";
format = "setuptools";
pyproject = true;
disabled = pythonOlder "3.7";
@ -18,15 +19,19 @@ buildPythonPackage rec {
hash = "sha256-haaqtDj3ZTQoQ6otWbso+7DTCEemIfuYAJhRhZkPAa8=";
};
propagatedBuildInputs = [
build-system = [
poetry-core
];
dependencies = [
libftdi1
libusb1
];
postPatch = ''
substituteInPlace src/pylibftdi/driver.py \
--replace "self._load_library('libusb')" "cdll.LoadLibrary('${libusb1.out}/lib/libusb-1.0.so')" \
--replace "self._load_library('libftdi')" "cdll.LoadLibrary('${libftdi1.out}/lib/libftdi1.so')"
--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 = [
@ -36,7 +41,7 @@ buildPythonPackage rec {
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}0/CHANGES.txt";
changelog = "https://github.com/codedstructure/pylibftdi/blob/${version}/CHANGES.txt";
license = licenses.mit;
maintainers = with maintainers; [ matthuszagh ];
};