nixpkgs/pkgs/development/python-modules/pyads/default.nix

43 lines
832 B
Nix
Raw Normal View History

2021-06-06 12:24:09 +02:00
{ lib
, adslib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
}:
2020-10-03 16:11:13 +02:00
buildPythonPackage rec {
pname = "pyads";
2021-06-06 12:24:09 +02:00
version = "3.3.7";
2020-10-03 16:11:13 +02:00
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "stlehmann";
repo = pname;
rev = version;
2021-06-06 12:24:09 +02:00
sha256 = "sha256-h3c6z+dmrOc1Q7E8YVJZJD2FsxoxqQX5J92SEweIpto=";
2020-10-03 16:11:13 +02:00
};
2021-06-06 12:24:09 +02:00
buildInputs = [
adslib
];
2020-10-03 16:11:13 +02:00
patchPhase = ''
substituteInPlace pyads/pyads_ex.py \
--replace "ctypes.CDLL(adslib)" "ctypes.CDLL(\"${adslib}/lib/adslib.so\")"
'';
2021-06-06 12:24:09 +02:00
checkInputs = [
pytestCheckHook
];
pythonImportsCheck = [ "pyads" ];
2020-10-03 16:11:13 +02:00
meta = with lib; {
description = "Python wrapper for TwinCAT ADS library";
homepage = "https://github.com/MrLeeh/pyads";
license = licenses.mit;
maintainers = with maintainers; [ jamiemagee ];
};
}