2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
adslib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyads";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.4.0";
|
|
|
|
pyproject = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stlehmann";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "pyads";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-HJ/dlRuwFSY5j/mAp6rLMlTV59GFwrTV27n73TWlCUo=";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
buildInputs = [ adslib ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace pyads/pyads_ex.py \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "ctypes.CDLL(adslib)" "ctypes.CDLL(\"${adslib}/lib/adslib.so\")"
|
2020-10-07 09:15:18 +00:00
|
|
|
'';
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "pyads" ];
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python wrapper for TwinCAT ADS library";
|
|
|
|
homepage = "https://github.com/MrLeeh/pyads";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/stlehmann/pyads/releases/tag/${version}";
|
2020-10-07 09:15:18 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jamiemagee ];
|
|
|
|
};
|
|
|
|
}
|