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 +}