at 24.11-pre 1.0 kB view raw
1{ 2 lib, 3 adslib, 4 buildPythonPackage, 5 fetchFromGitHub, 6 pytestCheckHook, 7 pythonOlder, 8 setuptools, 9}: 10 11buildPythonPackage rec { 12 pname = "pyads"; 13 version = "3.4.0"; 14 pyproject = true; 15 16 disabled = pythonOlder "3.7"; 17 18 src = fetchFromGitHub { 19 owner = "stlehmann"; 20 repo = "pyads"; 21 rev = "refs/tags/${version}"; 22 hash = "sha256-HJ/dlRuwFSY5j/mAp6rLMlTV59GFwrTV27n73TWlCUo="; 23 }; 24 25 build-system = [ setuptools ]; 26 27 buildInputs = [ adslib ]; 28 29 patchPhase = '' 30 substituteInPlace pyads/pyads_ex.py \ 31 --replace-fail "ctypes.CDLL(adslib)" "ctypes.CDLL(\"${adslib}/lib/adslib.so\")" 32 ''; 33 34 nativeCheckInputs = [ pytestCheckHook ]; 35 36 pythonImportsCheck = [ "pyads" ]; 37 38 meta = with lib; { 39 description = "Python wrapper for TwinCAT ADS library"; 40 homepage = "https://github.com/MrLeeh/pyads"; 41 changelog = "https://github.com/stlehmann/pyads/releases/tag/${version}"; 42 license = licenses.mit; 43 maintainers = with maintainers; [ jamiemagee ]; 44 }; 45}