diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04fbc37..5d27c30 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/ci-build.sh b/ci-build.sh index 5f3471a..13b7dc6 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -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} @@ -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 diff --git a/mingw-w64-gettext/0022-libasprintf.patch b/mingw-w64-gettext/0022-libasprintf.patch new file mode 100644 index 0000000..e7e2645 --- /dev/null +++ b/mingw-w64-gettext/0022-libasprintf.patch @@ -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 + #include + ++#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 diff --git a/mingw-w64-gettext/0023-gnulib.patch b/mingw-w64-gettext/0023-gnulib.patch new file mode 100644 index 0000000..52afc06 --- /dev/null +++ b/mingw-w64-gettext/0023-gnulib.patch @@ -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.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 diff --git a/mingw-w64-gettext/0030-fix-wbindtextdomain-backport.patch b/mingw-w64-gettext/0030-fix-wbindtextdomain-backport.patch deleted file mode 100644 index c346f31..0000000 --- a/mingw-w64-gettext/0030-fix-wbindtextdomain-backport.patch +++ /dev/null @@ -1,121 +0,0 @@ -diff --git a/gettext-runtime/intl/finddomain.c b/gettext-runtime/intl/finddomain.c -index e54b7346f..59352b5d2 100644 ---- a/gettext-runtime/intl/finddomain.c -+++ b/gettext-runtime/intl/finddomain.c -@@ -47,7 +47,11 @@ - #endif - - /* @@ end of prolog @@ */ --/* List of already loaded domains. */ -+/* List of already loaded domains. -+ On most platforms, it is sorted in decreasing order of ->filename. -+ On native Windows platforms, the elements with ->filename != NULL -+ are sorted in decreasing order of ->filename, and the elements with -+ ->wfilename != NULL are sorted in decreasing order of ->wfilename. */ - static struct loaded_l10nfile *_nl_loaded_domains; - - /* Lock that protects the access to _NL_LOADED_DOMAINS. */ -diff --git a/gettext-runtime/intl/l10nflist.c b/gettext-runtime/intl/l10nflist.c -index d97060628..8d9eae811 100644 ---- a/gettext-runtime/intl/l10nflist.c -+++ b/gettext-runtime/intl/l10nflist.c -@@ -1,4 +1,4 @@ --/* Copyright (C) 1995-2020 Free Software Foundation, Inc. -+/* Copyright (C) 1995-2023 Free Software Foundation, Inc. - Contributed by Ulrich Drepper , 1995. - - This program is free software: you can redistribute it and/or modify -@@ -218,31 +218,48 @@ _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, - /* Look in list of already loaded domains whether it is already - available. */ - lastp = l10nfile_list; -- for (retval = *l10nfile_list; retval != NULL; retval = retval->next) -- if (retval->filename != NULL - #if defined _WIN32 && !defined __CYGWIN__ -- || retval->wfilename != NULL -+ if (abs_wfilename != NULL) -+ { -+ for (retval = *l10nfile_list; retval != NULL; retval = retval->next) -+ { -+ if (retval->wfilename != NULL) -+ { -+ int compare = wcscmp (retval->wfilename, abs_wfilename); -+ if (compare == 0) -+ /* We found it! */ -+ break; -+ if (compare < 0) -+ { -+ /* It's not in the list, and we have found the place where it -+ needs to be inserted: at *LASTP. */ -+ retval = NULL; -+ break; -+ } -+ } -+ lastp = &retval->next; -+ } -+ } -+ else - #endif -- ) -+ for (retval = *l10nfile_list; retval != NULL; retval = retval->next) - { -- int compare = - #if defined _WIN32 && !defined __CYGWIN__ -- abs_wfilename != NULL -- ? retval->wfilename != NULL && wcscmp (retval->wfilename, abs_wfilename) -- : retval->filename != NULL && strcmp (retval->filename, abs_filename); --#else -- strcmp (retval->filename, abs_filename); -+ if (retval->filename != NULL) - #endif -- if (compare == 0) -- /* We found it! */ -- break; -- if (compare < 0) - { -- /* It's not in the list. */ -- retval = NULL; -- break; -+ int compare = strcmp (retval->filename, abs_filename); -+ if (compare == 0) -+ /* We found it! */ -+ break; -+ if (compare < 0) -+ { -+ /* It's not in the list, and we have found the place where it -+ needs to be inserted: at *LASTP. */ -+ retval = NULL; -+ break; -+ } - } -- - lastp = &retval->next; - } - -diff --git a/gettext-runtime/intl/loadinfo.h b/gettext-runtime/intl/loadinfo.h -index c0a31d23b..97d8dd4a1 100644 ---- a/gettext-runtime/intl/loadinfo.h -+++ b/gettext-runtime/intl/loadinfo.h -@@ -62,6 +62,9 @@ - - struct loaded_l10nfile - { -+ /* The file name of the localization file. -+ It is set at construction time and then never changed. -+ Exactly one of filename, wfilename is non-NULL. */ - const char *filename; - #if defined _WIN32 && !defined __CYGWIN__ - const wchar_t *wfilename; -@@ -84,7 +87,11 @@ extern const char *_nl_normalize_codeset (const char *codeset, - - /* Lookup a locale dependent file. - *L10NFILE_LIST denotes a pool of lookup results of locale dependent -- files of the same kind, sorted in decreasing order of ->filename. -+ files of the same kind. -+ On most platforms, it is sorted in decreasing order of ->filename. -+ On native Windows platforms, the elements with ->filename != NULL -+ are sorted in decreasing order of ->filename, and the elements with -+ ->wfilename != NULL are sorted in decreasing order of ->wfilename. - - DIRLIST and DIRLIST_LEN are an argz list of directories in which to - look. diff --git a/mingw-w64-gettext/PKGBUILD b/mingw-w64-gettext/PKGBUILD index 2cb12ab..7c19a4c 100644 --- a/mingw-w64-gettext/PKGBUILD +++ b/mingw-w64-gettext/PKGBUILD @@ -3,37 +3,36 @@ _realname=gettext pkgbase=mingw-w64-${_realname} -pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=0.21.1 -pkgrel=2 +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-runtime" "${MINGW_PACKAGE_PREFIX}-${_realname}-tools") +pkgver=0.22.4 +pkgrel=6 arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') url="https://www.gnu.org/software/gettext/" pkgdesc="GNU internationalization library (mingw-w64)" # GPL3 for the package as a whole and LGPL for some parts, see the license files -license=('spdx:GPL-3.0-or-later OR partial:LGPL-2.1-or-later') -depends=("${MINGW_PACKAGE_PREFIX}-expat" - "${MINGW_PACKAGE_PREFIX}-gcc-libs" - "${MINGW_PACKAGE_PREFIX}-libiconv" - ) -makedepends=("${MINGW_PACKAGE_PREFIX}-ncurses" +license=('spdx:GPL-3.0-or-later AND LGPL-2.1-or-later') +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-libiconv") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-autotools" - "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-ncurses" "groff") -options=('strip' 'staticlibs') source=(https://ftp.gnu.org/pub/gnu/${_realname}/${_realname}-${pkgver}.tar.gz{,.sig} 0005-Fix-compilation-of-pthread_sigmask.c.patch 122-Use-LF-as-newline-in-envsubst.patch - 0020-0.21-disable-libtextstyle.patch + gettext-0.22-disable-libtextstyle.patch 0021-replace-fsync.patch - 0030-fix-wbindtextdomain-backport.patch) -sha256sums=('e8c3650e1d8cee875c4f355642382c1df83058bd5a11ee8555c0cf276d646d45' + 0022-libasprintf.patch + 0023-gnulib.patch) +sha256sums=('c1e0bb2a4427a9024390c662cd532d664c4b36b8ff444ed5e54b115fdb7a1aea' 'SKIP' 'cbc2f533012d646521afa20f8b256917fce040741ff42cf53fb6dd7123a6670a' 'ef9f11a1cd10539d4323c6fcba3013cc503d47366004fe8a99c642dc3ddf2fd0' - '621f53e193ae8a57b940ca746d37c6f6becfa0f628b4ff02398cc22e1554ee0e' + 'a28a27192f336f0b0908bdbf840d3b19d7b587c4ac52cad635cb43e95eb3c78d' '380dbddee2f9e2feee4c1435e8a942b5d11d0125e60c3350ebb10c19b19011aa' - '91673258039ff6400a7cdf9f827ab96df8e7b953d3c6087df6cf5978e7192bde') + 'c354f6a7021069c99b90f1c6d6f6a4ccf40a01e9f6742b866df2b5a7286cb868' + '4f34906eeb535c74fa3f2936729b59c36d05d503a274e2b850fc770263c60b46') validpgpkeys=('462225C3B46F34879FC8496CD605848ED7E69871' # Daiki Ueno '9001B85AF9E1B83DF1BDA942F5BE8B267C6A406D') # Bruno Haible @@ -53,39 +52,31 @@ prepare() { 0005-Fix-compilation-of-pthread_sigmask.c.patch \ 122-Use-LF-as-newline-in-envsubst.patch - # https://src.fedoraproject.org/rpms/gettext/blob/7aca11f7d43d10c47fbeb4efd16af2884b34f9c7/f/gettext-0.21.1-disable-libtextstyle.patch + # https://gitlab.archlinux.org/archlinux/packaging/packages/gettext/-/blob/c85956ab0dc426c674551fd2bf977a96089752e9/gettext-0.22-disable-libtextstyle.patch apply_patch_with_msg \ - 0020-0.21-disable-libtextstyle.patch + gettext-0.22-disable-libtextstyle.patch apply_patch_with_msg \ - 0021-replace-fsync.patch - - # https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=40df836f7474dec73a1cd89e80977692d7f42dcb - apply_patch_with_msg \ - 0030-fix-wbindtextdomain-backport.patch + 0021-replace-fsync.patch \ + 0022-libasprintf.patch \ + 0023-gnulib.patch libtoolize --automake --copy --force WANT_AUTOMAKE=latest ./autogen.sh --skip-gnulib } -build() { - [[ -d ${srcdir}/build-${MSYSTEM} ]] && rm -rf ${srcdir}/build-${MSYSTEM} - mkdir -p ${srcdir}/build-${MSYSTEM} && cd ${srcdir}/build-${MSYSTEM} - - export lt_cv_deplibs_check_method='pass_all' - export MSYS2_ARG_CONV_EXCL="-DLOCALEDIR=;-DLIBDIR=;-DLOCALE_ALIAS_PATH=" +_build() { + _config_opt=$1 # gl_cv_func_mkdir_trailing_dot_works=yes was added to avoid having two # incompatible declarations of mkdir in the same compilation unit. ../${_realname}-${pkgver}/configure \ --prefix=${MINGW_PREFIX} \ - --host=${MINGW_CHOST} \ - --target=${MINGW_CHOST} \ --build=${MINGW_CHOST} \ --disable-java \ --disable-native-java \ --disable-csharp \ - --enable-static \ + ${_config_opt} \ --enable-threads=win32 \ --enable-relocatable \ --without-emacs \ @@ -98,6 +89,7 @@ build() { --with-included-glib \ --with-libncurses-prefix=${MINGW_PREFIX} \ --disable-silent-rules \ + lt_cv_deplibs_check_method='pass_all' \ gl_cv_func_mkdir_trailing_dot_works=yes # to make relocate() in gnulib-lib work @@ -106,17 +98,104 @@ build() { make } -package() { - cd ${srcdir}/build-${MSYSTEM} +build() { + + export MSYS2_ARG_CONV_EXCL="-DLOCALEDIR=;-DLIBDIR=;-DLOCALE_ALIAS_PATH=" + + msg2 "Build static libraries" + mkdir -p ${srcdir}/build-${MSYSTEM}-static && cd ${srcdir}/build-${MSYSTEM}-static + _build "--enable-static --disable-shared" + + msg2 "Build shared libraries" + mkdir -p ${srcdir}/build-${MSYSTEM}-shared && cd ${srcdir}/build-${MSYSTEM}-shared + _build "--enable-shared --disable-static" +} + +check () { + cd ${srcdir}/build-${MSYSTEM}-static + + # ensure that the Windows-specific `%I64*` format family is recognized correctly + cat >test-I64d.c < +#include +#include + +int main(int argc, char **argv) +{ + char buf[1024] = "(failure)"; + int len = libintl_snprintf(buf, 1024, "hello %llu %I64u 0:%d\n", (uint64_t)123, (uint64_t)123, 0); + + printf("%d, '%s'\n", len, buf); + + return len < 0 ? 1 : 0; +} +EOF + gcc -Wall -g -o test-I64d.exe test-I64d.c ./gettext-runtime/intl/.libs/libintl.a || return 1 + ./test-I64d.exe || return 1 +} + +package_gettext-runtime() { + pkgdesc="GNU internationalization runtime library (mingw-w64)" + depends=( + "${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-libiconv" + ) +# conflicts=("${MINGW_PACKAGE_PREFIX}-gettext<=0.22.4-3") + + cd ${srcdir}/build-${MSYSTEM}-static/gettext-runtime + make DESTDIR="${pkgdir}" install + + cd ${srcdir}/build-${MSYSTEM}-shared/gettext-runtime + make DESTDIR="${pkgdir}" install + + # Licenses + install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-runtime/COPYING" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/gettext-runtime/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-runtime/intl/COPYING.LIB" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/gettext-runtime/intl/COPYING.LIB" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-runtime/libasprintf/COPYING" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/gettext-runtime/libasprintf/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-runtime/libasprintf/COPYING.LIB" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/gettext-runtime/libasprintf/COPYING.LIB" +} + +package_gettext-tools() { + pkgdesc="GNU internationalization tools (mingw-w64)" + depends=( + "${MINGW_PACKAGE_PREFIX}-gettext-runtime" + "${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-libiconv" + ) + provides=("${MINGW_PACKAGE_PREFIX}-gettext=${pkgver}-${pkgrel}") +# conflicts=("${MINGW_PACKAGE_PREFIX}-gettext<=0.22.4-3") + replaces=("${MINGW_PACKAGE_PREFIX}-gettext") + + cd ${srcdir}/build-${MSYSTEM}-static/gettext-tools + make DESTDIR="${pkgdir}" install + + cd ${srcdir}/build-${MSYSTEM}-shared/gettext-tools make DESTDIR="${pkgdir}" install # Licenses - install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-runtime/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/gettext-runtime/COPYING" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-runtime/intl/COPYING.LIB" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/gettext-runtime/intl/COPYING.LIB" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-runtime/libasprintf/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/gettext-runtime/libasprintf/COPYING" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-runtime/libasprintf/COPYING.LIB" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/gettext-runtime/libasprintf/COPYING.LIB" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-tools/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/gettext-tools/COPYING" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-tools/gnulib-lib/libxml/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/gettext-tools/gnulib-lib/libxml/COPYING" - install -Dm644 "${srcdir}/${_realname}-${pkgver}/gnulib-local/lib/libxml/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/gnulib-local/lib/libxml/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-tools/COPYING" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/gettext-tools/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/gettext-tools/gnulib-lib/libxml/COPYING" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/gettext-tools/gnulib-lib/libxml/COPYING" + + # Not sure where to put them, so put them in the gettext-tools package + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/gnulib-local/lib/libxml/COPYING" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/gnulib-local/lib/libxml/COPYING" } + +# template start; name=mingw-w64-splitpkg-wrappers; version=1.0; +# vim: set ft=bash : + +# generate wrappers +for _name in "${pkgname[@]}"; do + _short="package_${_name#${MINGW_PACKAGE_PREFIX}-}" + _func="$(declare -f "${_short}")" + eval "${_func/#${_short}/package_${_name}}" +done +# template end; diff --git a/mingw-w64-gettext/0020-0.21-disable-libtextstyle.patch b/mingw-w64-gettext/gettext-0.22-disable-libtextstyle.patch similarity index 83% rename from mingw-w64-gettext/0020-0.21-disable-libtextstyle.patch rename to mingw-w64-gettext/gettext-0.22-disable-libtextstyle.patch index 76a9079..143f9fc 100644 --- a/mingw-w64-gettext/0020-0.21-disable-libtextstyle.patch +++ b/mingw-w64-gettext/gettext-0.22-disable-libtextstyle.patch @@ -1,5 +1,5 @@ diff --git a/Makefile.am b/Makefile.am -index 5a7184c..28267a5 100644 +index 815e3c7..e897de7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,7 @@ @@ -11,7 +11,7 @@ index 5a7184c..28267a5 100644 changelog_etc = \ gettext-runtime/ChangeLog.0 \ -@@ -124,7 +124,6 @@ distcheck-hook: +@@ -123,7 +123,6 @@ distcheck-hook: test "`sed 1,16d $(srcdir)/gettext-runtime/intl/xsize.h | md5sum`" = "`sed 1,16d $(srcdir)/gettext-tools/gnulib-lib/xsize.h | md5sum`" cmp -s $(srcdir)/gettext-runtime/man/help2man $(srcdir)/gettext-tools/man/help2man cmp -s $(srcdir)/gettext-runtime/man/x-to-1.in $(srcdir)/gettext-tools/man/x-to-1.in @@ -20,7 +20,7 @@ index 5a7184c..28267a5 100644 cmp -s $(srcdir)/gettext-tools/examples/hello-java-awt/m4/TestAWT.class $(srcdir)/gettext-tools/examples/hello-java-swing/m4/TestAWT.class test "`sed 1,15d $(srcdir)/gnulib-local/lib/alloca.in.h | md5sum`" = "`sed 1,15d $(srcdir)/gettext-runtime/libasprintf/alloca.in.h | md5sum`" diff --git a/configure.ac b/configure.ac -index f4e54ea..ff850ae 100644 +index 49689fb..2d23b44 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ dnl Checks for typedefs, structures, and compiler characteristics. @@ -42,23 +42,48 @@ index f4e54ea..ff850ae 100644 AC_CONFIG_FILES([Makefile]) diff --git a/gettext-tools/Makefile.am b/gettext-tools/Makefile.am -index 449a797..bce4ad8 100644 +index 449a797..c5719c2 100644 --- a/gettext-tools/Makefile.am +++ b/gettext-tools/Makefile.am @@ -19,7 +19,7 @@ AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 --SUBDIRS = intl gnulib-lib libgrep src libgettextpo po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc -+SUBDIRS = intl gnulib-lib libgrep libgettextpo src po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc +-SUBDIRS = gnulib-lib libgrep src libgettextpo po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc ++SUBDIRS = gnulib-lib libgrep libgettextpo src po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc EXTRA_DIST = misc/DISCLAIM MOSTLYCLEANFILES = core *.stackdump -diff --git a/gettext-tools/libgettextpo/textstyle.in.h b/gettext-tools/libgettextpo/textstyle.in.h -index 05ce0cf..936331c 100644 ---- a/gettext-tools/libgettextpo/textstyle.in.h -+++ b/gettext-tools/libgettextpo/textstyle.in.h -@@ -239,7 +239,8 @@ typedef ostream_t file_ostream_t; +diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am +index 764ffad..eccfbbd 100644 +--- a/gettext-tools/src/Makefile.am ++++ b/gettext-tools/src/Makefile.am +@@ -292,19 +292,9 @@ cldr_plurals_SOURCES = cldr-plural.y cldr-plural-exp.c cldr-plurals.c + cldr_plurals_CFLAGS = $(AM_CFLAGS) $(INCXML) + cldr_plurals_LDADD = libgettextsrc.la $(LDADD) + +-if USE_INSTALLED_LIBTEXTSTYLE +-LT_LIBTEXTSTYLE = @LTLIBTEXTSTYLE@ +-else +-# How to get the include files of libtextstyle. +-textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h: +- here=`pwd`; \ +- cd ../../libtextstyle/lib && \ +- $(MAKE) install-nobase_includeHEADERS install-nobase_nodist_includeHEADERS includedir="$$here" +-BUILT_SOURCES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h +-MOSTLYCLEANFILES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h +-# Where to find the built libtextstyle library. +-LT_LIBTEXTSTYLE = ../../libtextstyle/lib/libtextstyle.la +-endif ++# Use the dummy libtextstyle from gnulib, as libgettextpo does. ++LT_LIBTEXTSTYLE = ++AM_CPPFLAGS += -I../libgettextpo -I$(top_srcdir)/libgettextpo + + # How to build libgettextsrc.la. + # Need ../gnulib-lib/libgettextlib.la. +--- a/gettext-tools/libgettextpo/textstyle.in.h.orig 2023-09-18 22:36:31.000000000 +0200 ++++ b/gettext-tools/libgettextpo/textstyle.in.h 2023-09-21 10:11:20.611665975 +0200 +@@ -255,7 +255,8 @@ static inline file_ostream_t file_ostream_create (FILE *fp) { @@ -67,9 +92,24 @@ index 05ce0cf..936331c 100644 + return fdopen (dup (fileno (fp)), "w"); } - /* --------------------------- From fd-ostream.h --------------------------- */ -@@ -439,6 +440,30 @@ html_styled_ostream_create (_GL_ATTRIBUTE_MAYBE_UNUSED ostream_t destination, - return NULL; + static inline bool +@@ -673,14 +674,6 @@ + return true; + } + +-static inline noop_styled_ostream_t +-noop_styled_ostream_create (ostream_t destination, bool pass_ownership) +-{ +- if (!pass_ownership) +- /* Not supported without the real libtextstyle. */ +- abort (); +- return destination; +-} + + static inline bool + is_instance_of_noop_styled_ostream (_GL_ATTRIBUTE_MAYBE_UNUSED ostream_t stream) +@@ -688,6 +689,30 @@ + return false; } +/* ----------------------- From noop-styled-ostream.h ----------------------- */ @@ -99,30 +139,3 @@ index 05ce0cf..936331c 100644 /* ------------------------------ From color.h ------------------------------ */ #define color_test_mode false -diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am -index 510ab2a..72791ba 100644 ---- a/gettext-tools/src/Makefile.am -+++ b/gettext-tools/src/Makefile.am -@@ -291,19 +291,9 @@ cldr_plurals_SOURCES = cldr-plural.y cldr-plural-exp.c cldr-plurals.c - cldr_plurals_CFLAGS = $(AM_CFLAGS) $(INCXML) - cldr_plurals_LDADD = libgettextsrc.la $(LDADD) - --if USE_INSTALLED_LIBTEXTSTYLE --LT_LIBTEXTSTYLE = @LTLIBTEXTSTYLE@ --else --# How to get the include files of libtextstyle. --textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h: -- here=`pwd`; \ -- cd ../../libtextstyle/lib && \ -- $(MAKE) install-nobase_includeHEADERS install-nobase_nodist_includeHEADERS includedir="$$here" --BUILT_SOURCES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h --MOSTLYCLEANFILES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h --# Where to find the built libtextstyle library. --LT_LIBTEXTSTYLE = ../../libtextstyle/lib/libtextstyle.la --endif -+# Use the dummy libtextstyle from gnulib, as libgettextpo does. -+LT_LIBTEXTSTYLE = -+AM_CPPFLAGS += -I../libgettextpo -I$(top_srcdir)/libgettextpo - - # How to build libgettextsrc.la. - # Need ../gnulib-lib/libgettextlib.la.