python311Packages.pyads: refactor

This commit is contained in:
Fabian Affolter 2024-04-05 13:12:43 +02:00
parent 36cc5f55f2
commit ec4fc3d3ae

View File

@ -4,29 +4,34 @@
, fetchFromGitHub , fetchFromGitHub
, pytestCheckHook , pytestCheckHook
, pythonOlder , pythonOlder
, setuptools
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pyads"; pname = "pyads";
version = "3.4.0"; version = "3.4.0";
format = "setuptools"; pyproject = true;
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.7";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "stlehmann"; owner = "stlehmann";
repo = pname; repo = "pyads";
rev = "refs/tags/${version}"; rev = "refs/tags/${version}";
hash = "sha256-HJ/dlRuwFSY5j/mAp6rLMlTV59GFwrTV27n73TWlCUo="; hash = "sha256-HJ/dlRuwFSY5j/mAp6rLMlTV59GFwrTV27n73TWlCUo=";
}; };
build-system = [
setuptools
];
buildInputs = [ buildInputs = [
adslib adslib
]; ];
patchPhase = '' patchPhase = ''
substituteInPlace pyads/pyads_ex.py \ substituteInPlace pyads/pyads_ex.py \
--replace "ctypes.CDLL(adslib)" "ctypes.CDLL(\"${adslib}/lib/adslib.so\")" --replace-fail "ctypes.CDLL(adslib)" "ctypes.CDLL(\"${adslib}/lib/adslib.so\")"
''; '';
nativeCheckInputs = [ nativeCheckInputs = [
@ -40,6 +45,7 @@ buildPythonPackage rec {
meta = with lib; { meta = with lib; {
description = "Python wrapper for TwinCAT ADS library"; description = "Python wrapper for TwinCAT ADS library";
homepage = "https://github.com/MrLeeh/pyads"; homepage = "https://github.com/MrLeeh/pyads";
changelog = "https://github.com/stlehmann/pyads/releases/tag/${version}";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ jamiemagee ]; maintainers = with maintainers; [ jamiemagee ];
}; };