From 8da4505aa62d1613acd4b87db5f5996a4807151e Mon Sep 17 00:00:00 2001 From: Sarah Brofeldt Date: Thu, 16 Jul 2020 23:46:00 +0200 Subject: [PATCH 1/2] libapparmor: Fix build with gnumake 4.3 --- pkgs/os-specific/linux/apparmor/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index afb6799fbafc..807ab4fa44be 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -30,7 +30,18 @@ let sha256 = "03nislxccnbxld89giak2s8xa4mdbwscfxbdwhmw5qpvgz08dgwh"; }; + # See This and the + # accompanying application in prePatchCommon should be removed in 2.13.5 + gnumake43Patch = fetchpatch { + url = "https://gitlab.com/apparmor/apparmor/-/merge_requests/465.patch"; + name = "2-23-fix-build-with-make-4.3.patch"; + sha256 = "0xw028iqp69j9mxv0kbwraplgkj5i5djdlgf0anpkc5cdbsf96r9"; + }; + prePatchCommon = '' + patch -p1 < ${gnumake43Patch} + chmod a+x ./common/list_capabilities.sh ./common/list_af_names.sh + patchShebangs ./common/list_capabilities.sh ./common/list_af_names.sh substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${buildPackages.perl}/bin/pod2man" substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${buildPackages.perl}/bin/pod2html" substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h" From 4b028aecae881fbfbe51d1072489af41578c6f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 18 Jul 2020 17:46:37 +0200 Subject: [PATCH 2/2] apparmor: only apply the gnumake fix to the parser This is to avoid the huge rebuild for now, as it seems to be enough to fix the problem, but I'll revert this on staging anyway. --- pkgs/os-specific/linux/apparmor/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 807ab4fa44be..66c2582603c1 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -39,9 +39,6 @@ let }; prePatchCommon = '' - patch -p1 < ${gnumake43Patch} - chmod a+x ./common/list_capabilities.sh ./common/list_af_names.sh - patchShebangs ./common/list_capabilities.sh ./common/list_af_names.sh substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${buildPackages.perl}/bin/pod2man" substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${buildPackages.perl}/bin/pod2html" substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h" @@ -187,7 +184,11 @@ let buildInputs = [ libapparmor ]; - prePatch = prePatchCommon + '' + prePatch = '' + patch -p1 < ${gnumake43Patch} + chmod a+x ./common/list_capabilities.sh ./common/list_af_names.sh + patchShebangs ./common/list_capabilities.sh ./common/list_af_names.sh + '' + prePatchCommon + '' substituteInPlace ./parser/Makefile --replace "/usr/bin/bison" "${bison}/bin/bison" substituteInPlace ./parser/Makefile --replace "/usr/bin/flex" "${flex}/bin/flex" substituteInPlace ./parser/Makefile --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h"