commit:     ce90900a0ff16326fd1f2608d32ad2c4e294b89f
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 25 13:06:39 2021 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Dec 25 13:07:20 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce90900a

dev-lang/perl-5.34.0-r6: fix build on Darwin 9

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 dev-lang/perl/perl-5.34.0-r6.ebuild | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/dev-lang/perl/perl-5.34.0-r6.ebuild 
b/dev-lang/perl/perl-5.34.0-r6.ebuild
index c5e33db0b272..10a8bdee8bdb 100644
--- a/dev-lang/perl/perl-5.34.0-r6.ebuild
+++ b/dev-lang/perl/perl-5.34.0-r6.ebuild
@@ -430,6 +430,12 @@ src_prepare() {
        if [[ ${CHOST} == *-darwin* ]] ; then
                # fix install_name (soname) not to reference $D
                sed -i -e '/install_name `pwd/s/`pwd`/\\$(shrpdir)/' 
Makefile.SH || die
+
+               # fix environ linkage absence (only a real issue on Darwin9)
+               if [[ ${CHOST##*-darwin} -le 9 ]] ; then
+                       sed -i -e '/^PLDLFLAGS =/s/=/= -include crt_externs.h 
-Denviron="(*_NSGetEnviron())"/' \
+                               Makefile.SH || die
+               fi
        fi
 
        default
@@ -614,9 +620,11 @@ src_configure() {
                myconf "-Dld=env 
MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)"
 
        # Older macOS with non-Apple GCC chokes on inline in system headers
-       # using c89 mode as injected by cflags.SH
+       # using c89 mode as injected by cflags.SH, in addition, we override
+       # cflags, so we loose PERL_DARWIN which enables compat code that
+       # apparently on more recent macOS releases is no longer necessary
        [[ ${CHOST} == *-darwin* && ${CHOST##*darwin} -le 9 ]] && tc-is-gcc && \
-               append-cflags -Dinline=__inline__
+               append-cflags -Dinline=__inline__ -DPERL_DARWIN
 
        # flock on 32-bit sparc Solaris is broken, fall back to fcntl
        [[ ${CHOST} == sparc-*-solaris* ]] && \

Reply via email to