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