2019-09-14 01:34:35 +01:00
|
|
|
{ stdenv, fetchFromGitHub, python3
|
2018-03-20 12:11:07 +00:00
|
|
|
, libsepol, libselinux, checkpolicy
|
|
|
|
, withGraphics ? false
|
|
|
|
}:
|
2013-11-28 08:58:06 +00:00
|
|
|
|
2018-03-20 12:11:07 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
with python3.pkgs;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "setools";
|
2019-09-14 01:34:35 +01:00
|
|
|
version = "4.2.2";
|
2013-11-28 08:58:06 +00:00
|
|
|
|
2015-07-31 23:14:58 +01:00
|
|
|
src = fetchFromGitHub {
|
2019-01-11 03:35:51 +00:00
|
|
|
owner = "SELinuxProject";
|
2018-03-20 12:11:07 +00:00
|
|
|
repo = pname;
|
2019-01-11 03:35:51 +00:00
|
|
|
rev = version;
|
2019-09-14 01:34:35 +01:00
|
|
|
sha256 = "18kklv26dwm2fdjjzfflvxsq83b2svnwf4g18xq7wsfsri121a90";
|
2013-11-28 08:58:06 +00:00
|
|
|
};
|
|
|
|
|
2019-09-14 01:34:35 +01:00
|
|
|
nativeBuildInputs = [ cython ];
|
2019-03-24 18:52:40 +00:00
|
|
|
buildInputs = [ libsepol ];
|
2018-03-20 12:11:07 +00:00
|
|
|
propagatedBuildInputs = [ enum34 libselinux networkx ]
|
|
|
|
++ optionals withGraphics [ pyqt5 ];
|
2014-08-14 16:55:12 +01:00
|
|
|
|
2018-03-20 12:11:07 +00:00
|
|
|
checkInputs = [ tox checkpolicy ];
|
|
|
|
preCheck = ''
|
|
|
|
export CHECKPOLICY=${checkpolicy}/bin/checkpolicy
|
|
|
|
'';
|
2016-02-12 18:02:25 +00:00
|
|
|
|
2018-03-20 12:11:07 +00:00
|
|
|
setupPyBuildFlags = [ "-i" ];
|
2013-11-28 08:58:06 +00:00
|
|
|
|
2018-03-20 12:11:07 +00:00
|
|
|
preBuild = ''
|
2018-06-21 10:40:31 +01:00
|
|
|
export SEPOL="${stdenv.lib.getLib libsepol}/lib/libsepol.a"
|
2018-03-20 12:11:07 +00:00
|
|
|
'';
|
2013-11-28 08:58:06 +00:00
|
|
|
|
|
|
|
meta = {
|
2019-01-11 03:35:51 +00:00
|
|
|
description = "SELinux Policy Analysis Tools";
|
|
|
|
homepage = https://github.com/SELinuxProject/setools;
|
2018-03-20 12:11:07 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2013-11-28 08:58:06 +00:00
|
|
|
};
|
|
|
|
}
|