Files
nixpkgs/pkgs/by-name/li/libsemanage/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

84 lines
1.8 KiB
Nix
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
lib,
stdenv,
fetchurl,
pkg-config,
bison,
flex,
libsepol,
libselinux,
bzip2,
audit,
enablePython ? true,
swig ? null,
python3 ? null,
}:
stdenv.mkDerivation rec {
pname = "libsemanage";
version = "3.8.1";
inherit (libsepol) se_url;
src = fetchurl {
url = "${se_url}/${version}/libsemanage-${version}.tar.gz";
sha256 = "sha256-ezkSeyGcxwv9k1pK9rDyuoPUs1yRbyU8fpQsI6tJDwc=";
};
outputs = [
"out"
"dev"
"man"
]
++ lib.optional enablePython "py";
strictDeps = true;
nativeBuildInputs = [
bison
flex
pkg-config
]
++ lib.optionals enablePython [
python3
swig
];
buildInputs = [
libsepol
libselinux
bzip2
audit
]
++ lib.optional enablePython python3;
makeFlags = [
"PREFIX=$(out)"
"INCLUDEDIR=$(dev)/include"
"MAN3DIR=$(man)/share/man/man3"
"MAN5DIR=$(man)/share/man/man5"
"PYTHON=python"
"PYPREFIX=python"
"PYTHONLIBDIR=$(py)/${python3.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
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=clobbered" ];
installTargets = [ "install" ] ++ lib.optionals enablePython [ "install-pywrap" ];
enableParallelBuilding = true;
meta = removeAttrs libsepol.meta [ "outputsToInstall" ] // {
description = "Policy management tools for SELinux";
license = lib.licenses.lgpl21;
};
}