nixpkgs/pkgs/os-specific/linux/libsemanage/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, pkg-config, bison, flex, libsepol, libselinux, bzip2, audit
2018-03-14 12:43:48 +00:00
, enablePython ? true, swig ? null, python ? null
}:
2021-01-15 14:45:37 +00:00
with lib;
2015-07-31 20:40:31 +01:00
stdenv.mkDerivation rec {
pname = "libsemanage";
version = "3.3";
inherit (libsepol) se_url;
src = fetchurl {
url = "${se_url}/${version}/libsemanage-${version}.tar.gz";
sha256 = "1s3wb66l47blc15s6lkqs11j9l8pycdqqbb03x3vpfrlz9dfrl44";
2019-08-17 18:08:49 +01:00
};
outputs = [ "out" "dev" "man" ] ++ optional enablePython "py";
strictDeps = true;
nativeBuildInputs = [ bison flex pkg-config ] ++ optional enablePython swig;
buildInputs = [ libsepol libselinux bzip2 audit ]
++ optional enablePython python;
2015-07-31 21:02:41 +01:00
2019-08-17 18:08:49 +01:00
makeFlags = [
"PREFIX=$(out)"
"INCLUDEDIR=$(dev)/include"
"MAN3DIR=$(man)/share/man/man3"
"MAN5DIR=$(man)/share/man/man5"
"PYTHON=python"
"PYPREFIX=python"
2019-08-17 18:08:49 +01:00
"PYTHONLIBDIR=$(py)/${python.sitePackages}"
"DEFAULT_SEMANAGE_CONF_LOCATION=$(out)/etc/selinux/semanage.conf"
];
# The following turns the 'clobbered' error into a warning
# which should fix the following error:
#
# semanage_store.c: In function 'semanage_exec_prog':
# 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-Werror=clobbered8;;]
# 1278 | int i;
# | ^
# cc1: all warnings being treated as errors
NIX_CFLAGS_COMPILE = [ "-Wno-error=clobbered" ];
2018-03-14 12:43:48 +00:00
installTargets = [ "install" ] ++ optionals enablePython [ "install-pywrap" ];
enableParallelBuilding = true;
meta = removeAttrs libsepol.meta ["outputsToInstall"] // {
description = "Policy management tools for SELinux";
2021-01-15 14:45:37 +00:00
license = lib.licenses.lgpl21;
};
}