From c2877951a7d73803acc9988dcef4fb77fe9641dc Mon Sep 17 00:00:00 2001 From: "Dan R. K. Ports" Date: Mon, 25 May 2026 12:52:06 -0700 Subject: [PATCH] luametatex: fix build with gcc (e.g. on PPC/10.5/10.6): * Replace GNU ld flag -Wl,-z,stack-size with Apple ld equivalent -Wl,-stack_size,0x280000 * Replace GNU strip flags (-g -S -d -x) in upstream's post-build strip command with Apple strip compatible flags (-x -S) Fixes: https://trac.macports.org/ticket/74037 Fixes: https://trac.macports.org/ticket/72204 --- tex/luametatex/Portfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tex/luametatex/Portfile b/tex/luametatex/Portfile index b9479c7c9a9..65f6d5d00cc 100644 --- a/tex/luametatex/Portfile +++ b/tex/luametatex/Portfile @@ -24,3 +24,16 @@ checksums rmd160 aa5220eb803e6a8cd67279d52c905ae832925b86 \ size 3464142 compiler.c_standard 2011 + +# Fix GCC build (primarily for 10.5/10.6). +# 1. Apple's ld doesn't support -z; use -stack_size instead +# https://trac.macports.org/ticket/74037 +# 2. Upstream's post-build strip uses GNU flags (-g -S -d -x) that Apple's +# strip doesn't support; use -x -S instead +# https://trac.macports.org/ticket/72204 +post-patch { + reinplace "s|-Wl,-z,stack-size=2621440|-Wl,-stack_size,0x280000|g" \ + ${worksrcpath}/CMakeLists.txt + reinplace {s|${CMAKE_STRIP} -g -S -d -x|${CMAKE_STRIP} -x -S|g} \ + ${worksrcpath}/cmake/luametatex.cmake +}