2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitHub, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, libsepol, libselinux, checkpolicy
|
|
|
|
, withGraphics ? false
|
|
|
|
}:
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
with python3.pkgs;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "setools";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "4.4.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SELinuxProject";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "1qvd5j6zwq4fmlahg45swjplhif2z89x7s6pnp07gvcp2fbqdsh5";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
buildInputs = [ libsepol ];
|
|
|
|
propagatedBuildInputs = [ enum34 libselinux networkx ]
|
|
|
|
++ optionals withGraphics [ pyqt5 ];
|
|
|
|
|
|
|
|
checkInputs = [ tox checkpolicy ];
|
|
|
|
preCheck = ''
|
|
|
|
export CHECKPOLICY=${checkpolicy}/bin/checkpolicy
|
|
|
|
'';
|
|
|
|
|
|
|
|
setupPyBuildFlags = [ "-i" ];
|
|
|
|
|
|
|
|
preBuild = ''
|
2021-02-05 17:12:51 +00:00
|
|
|
export SEPOL="${lib.getLib libsepol}/lib/libsepol.a"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "SELinux Policy Analysis Tools";
|
|
|
|
homepage = "https://github.com/SELinuxProject/setools";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|