Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pyads / default.nix
blobbdedb2392af7d0d2ddac954f74a158a8e8f9dd0c
1 { lib
2 , adslib
3 , buildPythonPackage
4 , fetchFromGitHub
5 , pytestCheckHook
6 , pythonOlder
7 }:
9 buildPythonPackage rec {
10   pname = "pyads";
11   version = "3.3.9";
12   format = "setuptools";
14   disabled = pythonOlder "3.7";
16   src = fetchFromGitHub {
17     owner = "stlehmann";
18     repo = pname;
19     rev = version;
20     hash = "sha256-eNouFJQDgp56fgkA7wZKfosKWOKU6OvXRjFwjCMvZqI=";
21   };
23   buildInputs = [
24     adslib
25   ];
27   patchPhase = ''
28     substituteInPlace pyads/pyads_ex.py \
29       --replace "ctypes.CDLL(adslib)" "ctypes.CDLL(\"${adslib}/lib/adslib.so\")"
30   '';
32   nativeCheckInputs = [
33     pytestCheckHook
34   ];
36   pythonImportsCheck = [
37     "pyads"
38   ];
40   meta = with lib; {
41     description = "Python wrapper for TwinCAT ADS library";
42     homepage = "https://github.com/MrLeeh/pyads";
43     license = licenses.mit;
44     maintainers = with maintainers; [ jamiemagee ];
45   };