···89stdenv.mkDerivation rec {
10 pname = "gettext";
11+ version = "0.22.4";
1213 src = fetchurl {
14 url = "mirror://gnu/gettext/${pname}-${version}.tar.gz";
15+ hash = "sha256-weC7KkQnqQJDkMZizVMtZkxLNrj/RE7V5UsRX9t6Guo=";
16 };
17 patches = [
18 ./absolute-paths.diff
···47 ];
4849 postPatch = ''
50+ # Older versions of gettext come with a copy of `extern-inline.m4` that is not compatible with clang 18.
51+ # When a project uses gettext + autoreconfPhase, autoreconfPhase will invoke `autopoint -f`, which will
52+ # replace whatever (probably compatible) version of `extern-inline.m4` with one that probalby won’t work
53+ # because `autopoint` will copy the autoconf macros from the project’s required version of gettext.
54+ # Fixing this requires replacing all the older copies of the problematic file with a new one.
55+ #
56+ # This is ugly, but it avoids requiring workarounds in every package using gettext and autoreconfPhase.
57+ declare -a oldFiles=($(tar tf gettext-tools/misc/archive.dir.tar | grep '^gettext-0\.[19].*/extern-inline.m4'))
58+ oldFilesDir=$(mktemp -d)
59+ for oldFile in "''${oldFiles[@]}"; do
60+ mkdir -p "$oldFilesDir/$(dirname "$oldFile")"
61+ cp gettext-tools/gnulib-m4/extern-inline.m4 "$oldFilesDir/$oldFile"
62+ done
63+ tar uf gettext-tools/misc/archive.dir.tar -C "$oldFilesDir" "''${oldFiles[@]}"
64+65+ substituteAllInPlace gettext-runtime/src/gettext.sh.in
66+ substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
67+ substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
68+ substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
69 '' + lib.optionalString stdenv.hostPlatform.isCygwin ''
70 sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
71 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
···385 configureFlags = (a.configureFlags or []) ++ [
386 "--with-native-system-header-dir=/include"
387 "--with-build-sysroot=${lib.getDev self.stdenv.cc.libc}"
000388 ];
389390 # This is a separate phase because gcc assembles its phase scripts
···507 overrides = self: super: rec {
508 inherit (prevStage)
509 ccWrapperStdenv
510- binutils coreutils gnugrep gettext
511 perl patchelf linuxHeaders gnum4 bison libidn2 libunistring libxcrypt;
512 # We build a special copy of libgmp which doesn't use libstdc++, because
513 # xgcc++'s libstdc++ references the bootstrap-files (which is what
···385 configureFlags = (a.configureFlags or []) ++ [
386 "--with-native-system-header-dir=/include"
387 "--with-build-sysroot=${lib.getDev self.stdenv.cc.libc}"
388+ # Don't assume that `gettext` was built with iconv support, since we don't have
389+ # our own `glibc` yet.
390+ "--disable-nls"
391 ];
392393 # This is a separate phase because gcc assembles its phase scripts
···510 overrides = self: super: rec {
511 inherit (prevStage)
512 ccWrapperStdenv
513+ binutils coreutils gnugrep
514 perl patchelf linuxHeaders gnum4 bison libidn2 libunistring libxcrypt;
515 # We build a special copy of libgmp which doesn't use libstdc++, because
516 # xgcc++'s libstdc++ references the bootstrap-files (which is what