Skip to content

Commit

Permalink
Update gettext from upstream (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 12, 2024
1 parent 281ab51 commit 1899606
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 206 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ jobs:
run: rm -Rf */pkg */src
shell: msys2 {0}

- name: update msys2
timeout-minutes: 5
run: |
%RUNNER_TEMP%\msys64\usr\bin\pacman.exe -Syu --noconfirm
%RUNNER_TEMP%\msys64\usr\bin\pacman.exe -Sy --needed --noconfirm git patch make unzip pactoys
shell: cmd

- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
5 changes: 3 additions & 2 deletions 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 --needed ${MINGW_PACKAGE_PREFIX}-{cc,libtre,pkgconf,xz}

# Some upstream DLL files
pacman --noconfirm --needed -Sdd ${MINGW_PACKAGE_PREFIX}-{gcc-libs,libwinpthread}
Expand Down Expand Up @@ -66,7 +67,7 @@ for package in "${packages[@]}"; do
#execute "Installing build dependencies for $package" makepkg-mingw -seoc --noconfirm
#rm -fv /${MINGW_ARCH}/lib/*.dll.a

execute 'Building binary' makepkg-mingw --noconfirm --noprogressbar --nocheck --skippgpcheck --syncdeps --rmdeps --cleanbuild
execute 'Building binary' makepkg-mingw --noconfirm --noprogressbar --nocheck --skippgpcheck --syncdeps --cleanbuild
#MINGW_ARCH=mingw64 execute 'Building source' makepkg-mingw --noconfirm --noprogressbar --skippgpcheck --allsource
execute 'List output contents' ls -ltr
execute 'Installing' yes:pacman --noprogressbar --upgrade --noconfirm *.pkg.tar.xz
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 1899606

Please sign in to comment.