nixpkgs/pkgs/development/python-modules/pyads/default.nix
2024-04-05 09:37:40 +00:00

47 lines
883 B
Nix

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