@@ -30,6 +30,14 @@ let
3030 sha256 = "03nislxccnbxld89giak2s8xa4mdbwscfxbdwhmw5qpvgz08dgwh";
3131 };
3232
33+ # See <https://gitlab.com/apparmor/apparmor/-/issues/74> This and the
34+ # accompanying application in prePatchCommon should be removed in 2.13.5
35+ gnumake43Patch = fetchpatch {
36+ url = "https://gitlab.com/apparmor/apparmor/-/merge_requests/465.patch";
37+ name = "2-23-fix-build-with-make-4.3.patch";
38+ sha256 = "0xw028iqp69j9mxv0kbwraplgkj5i5djdlgf0anpkc5cdbsf96r9";
39+ };
40+
3341 prePatchCommon = ''
3442 substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${buildPackages.perl}/bin/pod2man"
3543 substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${buildPackages.perl}/bin/pod2html"
@@ -176,7 +184,11 @@ let
176184
177185 buildInputs = [ libapparmor ];
178186
179− prePatch = prePatchCommon + ''
187+ prePatch = ''
188+ patch -p1 < ${gnumake43Patch}
189+ chmod a+x ./common/list_capabilities.sh ./common/list_af_names.sh
190+ patchShebangs ./common/list_capabilities.sh ./common/list_af_names.sh
191+ '' + prePatchCommon + ''
180192 substituteInPlace ./parser/Makefile --replace "/usr/bin/bison" "${bison}/bin/bison"
181193 substituteInPlace ./parser/Makefile --replace "/usr/bin/flex" "${flex}/bin/flex"
182194 substituteInPlace ./parser/Makefile --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h"