Files
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

88 lines
1.8 KiB
Nix

{
lib,
makeWrapper,
gawk,
perl,
bash,
stdenv,
which,
linuxHeaders ? stdenv.cc.libc.linuxHeaders,
python3Packages,
bashNonInteractive,
buildPackages,
# apparmor deps
apparmor-parser,
apparmor-teardown,
}:
let
inherit (python3Packages) libapparmor;
in
python3Packages.buildPythonApplication {
pname = "apparmor-utils";
inherit (libapparmor) version src;
postPatch = ''
patchShebangs .
cd utils
substituteInPlace aa-remove-unknown \
--replace-fail "/lib/apparmor/rc.apparmor.functions" "${apparmor-parser}/lib/apparmor/rc.apparmor.functions"
substituteInPlace Makefile \
--replace-fail "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h"
sed -i -E 's/^(DESTDIR|BINDIR|PYPREFIX)=.*//g' Makefile
sed -i aa-unconfined -e "/my_env\['PATH'\]/d"
''
+ (lib.optionalString stdenv.hostPlatform.isMusl ''
sed -i Makefile -e "/\<vim\>/d"
'');
format = "other";
strictDeps = true;
doCheck = true;
nativeBuildInputs = [
makeWrapper
which
bashNonInteractive
python3Packages.setuptools
];
buildInputs = [
bash
perl
];
pythonPath = [
python3Packages.notify2
python3Packages.psutil
libapparmor
];
makeFlags = [
"LANGS="
"POD2MAN=${lib.getExe' buildPackages.perl "pod2man"}"
"POD2HTML=${lib.getExe' buildPackages.perl "pod2html"}"
"MANDIR=share/man"
];
installFlags = [
"DESTDIR=$(out)"
"BINDIR=$(out)/bin"
"VIM_INSTALL_PATH=$(out)/share"
"PYPREFIX="
];
postInstall = ''
wrapProgram $out/bin/aa-remove-unknown \
--prefix PATH : ${lib.makeBinPath [ gawk ]}
ln -s ${lib.getExe apparmor-teardown} $out/bin/aa-teardown
'';
meta = libapparmor.meta // {
description = "Mandatory access control system - script user-land utilities";
};
}