Skip to content

Commit

Permalink
Update gettext from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 12, 2024
1 parent 281ab51 commit 0128a44
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 205 deletions.
3 changes: 2 additions & 1 deletion ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ if [ "$MINGW_ARCH" == "clangarm64" ]; then
fi

# Enable custom -next repos (this will break msys2 toolchains that use dll's)
pacman --noconfirm -S ${MINGW_PACKAGE_PREFIX}-{cc,libtre,pkgconf,xz}
cp -f pacman.conf /etc/pacman.conf
pacman --noconfirm -Scc
pacman --noconfirm -Sy

# Downgrades to be compatible with rtools
pacman --noconfirm --needed -S git patch make unzip pactoys
pacman --noconfirm -S ${MINGW_PACKAGE_PREFIX}-{cc,libtre,pkgconf,xz}
pacman --noconfirm -S ${MINGW_PACKAGE_PREFIX}-{cc,xz}

# Some upstream DLL files
pacman --noconfirm --needed -Sdd ${MINGW_PACKAGE_PREFIX}-{gcc-libs,libwinpthread}
Expand Down
28 changes: 28 additions & 0 deletions mingw-w64-gettext/0022-libasprintf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Do not replace names of asprintf and vasprintf while including a header
that pulls in stdio.h which also declares functions with that names.
These function declarations would conflict with the declarations from
this library.

diff -urN gettext-0.22.3/gettext-runtime/libasprintf/vasprintf.c.orig gettext-0.22.3/gettext-runtime/libasprintf/vasprintf.c
--- gettext-0.22.3/gettext-runtime/libasprintf/vasprintf.c.orig 2019-05-11 13:29:32.000000000 +0200
+++ gettext-0.22.3/gettext-runtime/libasprintf/vasprintf.c 2023-10-27 18:58:18.838760500 +0200
@@ -27,8 +27,19 @@
#include <limits.h>
#include <stdlib.h>

+#undef asprintf
+#undef vasprintf
+
#include "vasnprintf.h"

+#if !(HAVE_VASPRINTF && HAVE_POSIX_PRINTF)
+
+/* Define to the same symbols as in lib-asprintf.h. */
+#define asprintf libasprintf_asprintf
+#define vasprintf libasprintf_vasprintf
+
+#endif
+
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
#ifndef EOVERFLOW
# define EOVERFLOW E2BIG
33 changes: 33 additions & 0 deletions mingw-w64-gettext/0023-gnulib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Do not include two directories with generated gnulib headers in -I flags,
or #include_next directive for error.h fails.

diff -urN gettext-0.22.3/gettext-tools/src/Makefile.am.orig gettext-0.22.3/gettext-tools/src/Makefile.am
--- gettext-0.22.3/gettext-tools/src/Makefile.am.orig 2023-10-27 20:04:58.982538600 +0200
+++ gettext-0.22.3/gettext-tools/src/Makefile.am 2023-10-27 20:40:13.497536600 +0200
@@ -307,7 +307,7 @@

# Use the dummy libtextstyle from gnulib, as libgettextpo does.
LT_LIBTEXTSTYLE =
-AM_CPPFLAGS += -I../libgettextpo -I$(top_srcdir)/libgettextpo
+AM_CPPFLAGS += -I$(top_srcdir)/libgettextpo

# How to build libgettextsrc.la.
# Need ../gnulib-lib/libgettextlib.la.
diff -urN gettext-0.22.3/gettext-tools/libgettextpo/Makefile.gnulib.orig gettext-0.22.3/gettext-tools/libgettextpo/Makefile.gnulib
--- gettext-0.22.3/gettext-tools/libgettextpo/Makefile.gnulib.orig 2023-10-02 23:07:33.000000000 +0200
+++ gettext-0.22.3/gettext-tools/libgettextpo/Makefile.gnulib 2023-10-27 21:08:15.039903500 +0200
@@ -751,11 +751,12 @@
# We need the following in order to create a dummy placeholder for
# <textstyle.h>.
textstyle.h: textstyle.in.h $(top_builddir)/config.status
- $(AM_V_GEN)rm -f $@-t $@ && \
+ $(AM_V_GEN)rm -f $@-t $@ ../gnulib-lib/$@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/textstyle.in.h; \
} > $@-t && \
- mv $@-t $@
+ mv $@-t $@ && \
+ cp $@ ../gnulib-lib/$@
MOSTLYCLEANFILES += textstyle.h textstyle.h-t

EXTRA_DIST += textstyle.in.h
121 changes: 0 additions & 121 deletions mingw-w64-gettext/0030-fix-wbindtextdomain-backport.patch

This file was deleted.

Loading

0 comments on commit 0128a44

Please sign in to comment.