at 23.11-beta 42 lines 966 B view raw
1{ lib, fetchFromGitHub, python3 2, libsepol, libselinux, checkpolicy 3, withGraphics ? false 4}: 5 6with lib; 7with python3.pkgs; 8 9buildPythonApplication rec { 10 pname = "setools"; 11 version = "4.4.1"; 12 13 src = fetchFromGitHub { 14 owner = "SELinuxProject"; 15 repo = pname; 16 rev = "refs/tags/${version}"; 17 sha256 = "sha256-4T5FIdnKi35JSm+IoYA2gIBBRV0nN0YLEw9xvDqNcgo="; 18 }; 19 20 nativeBuildInputs = [ cython ]; 21 buildInputs = [ libsepol ]; 22 propagatedBuildInputs = [ enum34 libselinux networkx ] 23 ++ optionals withGraphics [ pyqt5 ]; 24 25 nativeCheckInputs = [ tox checkpolicy ]; 26 preCheck = '' 27 export CHECKPOLICY=${checkpolicy}/bin/checkpolicy 28 ''; 29 30 setupPyBuildFlags = [ "-i" ]; 31 32 preBuild = '' 33 export SEPOL="${lib.getLib libsepol}/lib/libsepol.a" 34 ''; 35 36 meta = { 37 description = "SELinux Policy Analysis Tools"; 38 homepage = "https://github.com/SELinuxProject/setools"; 39 license = licenses.gpl2; 40 platforms = platforms.linux; 41 }; 42}