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