···8899stdenv.mkDerivation rec {
1010 pname = "gettext";
1111- version = "0.21.1";
1111+ version = "0.22.4";
12121313 src = fetchurl {
1414 url = "mirror://gnu/gettext/${pname}-${version}.tar.gz";
1515- sha256 = "sha256-6MNlDh2M7odcTzVWQjgsHfgwWL1aEe6FVcDPJ21kbUU=";
1515+ hash = "sha256-weC7KkQnqQJDkMZizVMtZkxLNrj/RE7V5UsRX9t6Guo=";
1616 };
1717 patches = [
1818 ./absolute-paths.diff
···4747 ];
48484949 postPatch = ''
5050- substituteAllInPlace gettext-runtime/src/gettext.sh.in
5151- substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
5252- substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
5353- substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
5050+ # Older versions of gettext come with a copy of `extern-inline.m4` that is not compatible with clang 18.
5151+ # When a project uses gettext + autoreconfPhase, autoreconfPhase will invoke `autopoint -f`, which will
5252+ # replace whatever (probably compatible) version of `extern-inline.m4` with one that probalby won’t work
5353+ # because `autopoint` will copy the autoconf macros from the project’s required version of gettext.
5454+ # Fixing this requires replacing all the older copies of the problematic file with a new one.
5555+ #
5656+ # This is ugly, but it avoids requiring workarounds in every package using gettext and autoreconfPhase.
5757+ declare -a oldFiles=($(tar tf gettext-tools/misc/archive.dir.tar | grep '^gettext-0\.[19].*/extern-inline.m4'))
5858+ oldFilesDir=$(mktemp -d)
5959+ for oldFile in "''${oldFiles[@]}"; do
6060+ mkdir -p "$oldFilesDir/$(dirname "$oldFile")"
6161+ cp gettext-tools/gnulib-m4/extern-inline.m4 "$oldFilesDir/$oldFile"
6262+ done
6363+ tar uf gettext-tools/misc/archive.dir.tar -C "$oldFilesDir" "''${oldFiles[@]}"
6464+6565+ substituteAllInPlace gettext-runtime/src/gettext.sh.in
6666+ substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
6767+ substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
6868+ substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
5469 '' + lib.optionalString stdenv.hostPlatform.isCygwin ''
5570 sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
5671 sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
+4-1
pkgs/stdenv/linux/default.nix
···385385 configureFlags = (a.configureFlags or []) ++ [
386386 "--with-native-system-header-dir=/include"
387387 "--with-build-sysroot=${lib.getDev self.stdenv.cc.libc}"
388388+ # Don't assume that `gettext` was built with iconv support, since we don't have
389389+ # our own `glibc` yet.
390390+ "--disable-nls"
388391 ];
389392390393 # This is a separate phase because gcc assembles its phase scripts
···507510 overrides = self: super: rec {
508511 inherit (prevStage)
509512 ccWrapperStdenv
510510- binutils coreutils gnugrep gettext
513513+ binutils coreutils gnugrep
511514 perl patchelf linuxHeaders gnum4 bison libidn2 libunistring libxcrypt;
512515 # We build a special copy of libgmp which doesn't use libstdc++, because
513516 # xgcc++'s libstdc++ references the bootstrap-files (which is what