1{ adslib, buildPythonPackage, fetchFromGitHub, lib, pytestCheckHook, pytest
2, pytestcov, pythonOlder }:
3
4buildPythonPackage rec {
5 pname = "pyads";
6 version = "3.2.2";
7
8 disabled = pythonOlder "3.6";
9
10 src = fetchFromGitHub {
11 owner = "stlehmann";
12 repo = pname;
13 rev = version;
14 sha256 = "1jd727pw0z73y4xhrykqkfcz1acrpy3rks58lr1y4yilfv11p6jb";
15 };
16
17 buildInputs = [ adslib ];
18 patchPhase = ''
19 substituteInPlace pyads/pyads_ex.py \
20 --replace "ctypes.CDLL(adslib)" "ctypes.CDLL(\"${adslib}/lib/adslib.so\")"
21 '';
22 checkInputs = [ pytestCheckHook pytest pytestcov ];
23
24 meta = with lib; {
25 description = "Python wrapper for TwinCAT ADS library";
26 homepage = "https://github.com/MrLeeh/pyads";
27 license = licenses.mit;
28 maintainers = with maintainers; [ jamiemagee ];
29 };
30}