gettext: implement clang 18 on Darwin workaround
This commit is contained in:
@@ -47,10 +47,25 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteAllInPlace gettext-runtime/src/gettext.sh.in
|
||||
substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
|
||||
substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
|
||||
substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
|
||||
# Older versions of gettext come with a copy of `extern-inline.m4` that is not compatible with clang 18.
|
||||
# When a project uses gettext + autoreconfPhase, autoreconfPhase will invoke `autopoint -f`, which will
|
||||
# replace whatever (probably compatible) version of `extern-inline.m4` with one that probalby won’t work
|
||||
# because `autopoint` will copy the autoconf macros from the project’s required version of gettext.
|
||||
# Fixing this requires replacing all the older copies of the problematic file with a new one.
|
||||
#
|
||||
# This is ugly, but it avoids requiring workarounds in every package using gettext and autoreconfPhase.
|
||||
declare -a oldFiles=($(tar tf gettext-tools/misc/archive.dir.tar | grep '^gettext-0\.[19].*/extern-inline.m4'))
|
||||
oldFilesDir=$(mktemp -d)
|
||||
for oldFile in "''${oldFiles[@]}"; do
|
||||
mkdir -p "$oldFilesDir/$(dirname "$oldFile")"
|
||||
cp gettext-tools/gnulib-m4/extern-inline.m4 "$oldFilesDir/$oldFile"
|
||||
done
|
||||
tar uf gettext-tools/misc/archive.dir.tar -C "$oldFilesDir" "''${oldFiles[@]}"
|
||||
|
||||
substituteAllInPlace gettext-runtime/src/gettext.sh.in
|
||||
substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
|
||||
substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
|
||||
substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
|
||||
'' + lib.optionalString stdenv.hostPlatform.isCygwin ''
|
||||
sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
|
||||
sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
|
||||
|
||||
Reference in New Issue
Block a user