apparmor-parser: fix for apparmor 5.0
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
bison,
|
||||
linuxHeaders ? stdenv.cc.libc.linuxHeaders,
|
||||
buildPackages,
|
||||
zstd,
|
||||
|
||||
# apparmor deps
|
||||
libapparmor,
|
||||
@@ -23,15 +24,23 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs .
|
||||
|
||||
substituteInPlace init/rc.apparmor.functions \
|
||||
--replace-fail "/sbin/apparmor_parser" "$out/bin/apparmor_parser" \
|
||||
--replace-fail "/usr/sbin/aa-status" "${lib.getExe' apparmor-bin-utils "aa-status"}"
|
||||
sed -i init/rc.apparmor.functions -e '2i . ${./fix-rc.apparmor.functions.sh}'
|
||||
|
||||
cd parser
|
||||
|
||||
substituteInPlace Makefile \
|
||||
--replace-fail "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h"
|
||||
substituteInPlace rc.apparmor.functions \
|
||||
--replace-fail "/sbin/apparmor_parser" "$out/bin/apparmor_parser" # FIXME
|
||||
substituteInPlace rc.apparmor.functions \
|
||||
--replace-fail "/usr/sbin/aa-status" "${lib.getExe' apparmor-bin-utils "aa-status"}"
|
||||
sed -i rc.apparmor.functions -e '2i . ${./fix-rc.apparmor.functions.sh}'
|
||||
|
||||
# strict format check causes yacc auto-generated code to fail.
|
||||
# This is known, see https://gitlab.com/apparmor/apparmor/-/merge_requests/2039
|
||||
# removing the compile-time check here downgrades the issue and allows compilation to succeed
|
||||
substituteInPlace parser.h \
|
||||
--replace-fail 'extern void yyerror(const char *msg, ...) __attribute__((noreturn, format(printf, 1, 2)));' \
|
||||
'extern void yyerror(const char *msg, ...);'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -42,6 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
buildInputs = [
|
||||
libapparmor
|
||||
zstd
|
||||
runtimeShellPackage
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user