Skip to content

Commit

Permalink
gettext: 0.21.1 -> 0.22.4 (#279197)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilazy committed Nov 18, 2024
2 parents 459e87d + a1bd0f0 commit 83dc5d6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
27 changes: 21 additions & 6 deletions pkgs/development/libraries/gettext/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

stdenv.mkDerivation rec {
pname = "gettext";
version = "0.21.1";
version = "0.22.4";

src = fetchurl {
url = "mirror://gnu/gettext/${pname}-${version}.tar.gz";
sha256 = "sha256-6MNlDh2M7odcTzVWQjgsHfgwWL1aEe6FVcDPJ21kbUU=";
hash = "sha256-weC7KkQnqQJDkMZizVMtZkxLNrj/RE7V5UsRX9t6Guo=";
};
patches = [
./absolute-paths.diff
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion pkgs/stdenv/linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ in
configureFlags = (a.configureFlags or []) ++ [
"--with-native-system-header-dir=/include"
"--with-build-sysroot=${lib.getDev self.stdenv.cc.libc}"
# Don't assume that `gettext` was built with iconv support, since we don't have
# our own `glibc` yet.
"--disable-nls"
];

# This is a separate phase because gcc assembles its phase scripts
Expand Down Expand Up @@ -507,7 +510,7 @@ in
overrides = self: super: rec {
inherit (prevStage)
ccWrapperStdenv
binutils coreutils gnugrep gettext
binutils coreutils gnugrep
perl patchelf linuxHeaders gnum4 bison libidn2 libunistring libxcrypt;
# We build a special copy of libgmp which doesn't use libstdc++, because
# xgcc++'s libstdc++ references the bootstrap-files (which is what
Expand Down
5 changes: 5 additions & 0 deletions pkgs/tools/misc/fontforge/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ stdenv.mkDerivation rec {
url = "https://github.com/fontforge/fontforge/commit/216eb14b558df344b206bf82e2bdaf03a1f2f429.patch";
hash = "sha256-aRnir09FSQMT50keoB7z6AyhWAVBxjSQsTRvBzeBuHU=";
})
# Fixes translation compatibility with gettext 0.22
(fetchpatch {
url = "https://github.com/fontforge/fontforge/commit/55d58f87ab1440f628f2071a6f6cc7ef9626c641.patch";
hash = "sha256-rkYnKPXA8Ztvh9g0zjG2yTUCPd3lE1uqwvBuEd8+Oyw=";
})

# https://github.com/fontforge/fontforge/pull/5423
./replace-distutils.patch
Expand Down

0 comments on commit 83dc5d6

Please sign in to comment.