17 stdenv.mkDerivation rec {
18 pname = "libsemanage";
20 inherit (libsepol) se_url;
23 url = "${se_url}/${version}/libsemanage-${version}.tar.gz";
24 sha256 = "sha256-4WbK4ppBfasAjbnKCHQCPzU6MBewdpOgNu2XSH7aNbE=";
31 ] ++ lib.optional enablePython "py";
39 ] ++ lib.optional enablePython swig;
45 ] ++ lib.optional enablePython python;
49 "INCLUDEDIR=$(dev)/include"
50 "MAN3DIR=$(man)/share/man/man3"
51 "MAN5DIR=$(man)/share/man/man5"
54 "PYTHONLIBDIR=$(py)/${python.sitePackages}"
55 "DEFAULT_SEMANAGE_CONF_LOCATION=$(out)/etc/selinux/semanage.conf"
58 # The following turns the 'clobbered' error into a warning
59 # which should fix the following error:
61 # semanage_store.c: In function 'semanage_exec_prog':
62 # semanage_store.c:1278:6: error: variable 'i' might be clobbered by 'longjmp' or 'vfork' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wclobbered
\a-Werror=clobbered8;;
\a]
65 # cc1: all warnings being treated as errors
66 env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=clobbered" ];
68 installTargets = [ "install" ] ++ lib.optionals enablePython [ "install-pywrap" ];
70 enableParallelBuilding = true;
72 meta = removeAttrs libsepol.meta [ "outputsToInstall" ] // {
73 description = "Policy management tools for SELinux";
74 license = lib.licenses.lgpl21;