nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at r-updates 43 lines 902 B view raw
1{ 2 lib, 3 buildPythonPackage, 4 snap7, 5 fetchFromGitHub, 6 setuptools, 7}: 8 9buildPythonPackage rec { 10 pname = "python-snap7"; 11 version = "2.1.0"; 12 pyproject = true; 13 14 src = fetchFromGitHub { 15 owner = "gijzelaerr"; 16 repo = "python-snap7"; 17 tag = version; 18 hash = "sha256-l7nLW7qrIloa6JlQTubXnISljsC7jkdAjye9AAUTDrw="; 19 }; 20 21 prePatch = '' 22 substituteInPlace snap7/common.py \ 23 --replace "lib_location = None" "lib_location = '${snap7}/lib/libsnap7.so'" 24 ''; 25 26 build-system = [ setuptools ]; 27 28 # Tests require root privileges to open privileged ports 29 doCheck = false; 30 31 pythonImportsCheck = [ 32 "snap7" 33 "snap7.util" 34 ]; 35 36 meta = { 37 description = "Python wrapper for the snap7 PLC communication library"; 38 mainProgram = "snap7-server"; 39 homepage = "https://github.com/gijzelaerr/python-snap7"; 40 license = lib.licenses.mit; 41 maintainers = [ ]; 42 }; 43}