diff mbox series

[PATCH/next,v2,1/1] package/{gettext-gnu, libtextstyle}: bump to version 0.22

Message ID 20230818144231.976762-1-bernd@kuhls.net
State Changes Requested
Headers show
Series [PATCH/next,v2,1/1] package/{gettext-gnu, libtextstyle}: bump to version 0.22 | expand

Commit Message

Bernd Kuhls Aug. 18, 2023, 2:42 p.m. UTC
Release notes:
https://lists.gnu.org/archive/html/info-gnu/2020-07/msg00009.html
https://lists.gnu.org/archive/html/info-gnu/2023-06/msg00003.html

Removed patch 0001, the patched file is not present in this release.
Removed patch 0002 which was applied upstream.

Link libtextstyle.hash to gettext-gnu.hash.

Added comments about other files to be updated during version bumps.

Since upstream commit
https://github.com/autotools-mirror/gettext/commit/785a89e5df994c2b242f082d60de89e2d520aa4a
gettext-runtime is a build-dependency for gettext-tools so we add the
needed HOST_GETTEXT_GNU_PRE_{CONFIGURE, BUILD}_HOOKS.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
v2: fixed host build, added more comments (Thomas)
    link libtextstyle.hash to gettext-gnu.hash

 .checkpackageignore                           |   2 -
 .../0001-error_print_progname.patch           |  20 ---
 ...-buld-gettext-tools-seperately-part1.patch | 142 ------------------
 package/gettext-gnu/gettext-gnu.hash          |   7 +-
 package/gettext-gnu/gettext-gnu.mk            |  21 ++-
 package/gettext-tiny/gettext-tiny.hash        |   4 +-
 package/gettext-tiny/gettext-tiny.mk          |   5 +-
 package/libtextstyle/libtextstyle.hash        |   7 +-
 package/libtextstyle/libtextstyle.mk          |   5 +-
 9 files changed, 30 insertions(+), 183 deletions(-)
 delete mode 100644 package/gettext-gnu/0001-error_print_progname.patch
 delete mode 100644 package/gettext-gnu/0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch
 mode change 100644 => 120000 package/libtextstyle/libtextstyle.hash

Comments

Yann E. MORIN Aug. 19, 2023, 12:57 p.m. UTC | #1
Bernd, All,

On 2023-08-18 16:42 +0200, Bernd Kuhls spake thusly:
> Release notes:
> https://lists.gnu.org/archive/html/info-gnu/2020-07/msg00009.html
> https://lists.gnu.org/archive/html/info-gnu/2023-06/msg00003.html
> 
> Removed patch 0001, the patched file is not present in this release.
> Removed patch 0002 which was applied upstream.
> 
> Link libtextstyle.hash to gettext-gnu.hash.
> 
> Added comments about other files to be updated during version bumps.
> 
> Since upstream commit
> https://github.com/autotools-mirror/gettext/commit/785a89e5df994c2b242f082d60de89e2d520aa4a
> gettext-runtime is a build-dependency for gettext-tools so we add the
> needed HOST_GETTEXT_GNU_PRE_{CONFIGURE, BUILD}_HOOKS.

[--SNIP--]
> diff --git a/package/gettext-gnu/gettext-gnu.mk b/package/gettext-gnu/gettext-gnu.mk
> index 9a1eabd0df..67074e42bc 100644
> --- a/package/gettext-gnu/gettext-gnu.mk
> +++ b/package/gettext-gnu/gettext-gnu.mk
> @@ -4,8 +4,9 @@
>  #
>  ################################################################################
>  
> -# Please keep in sync with package/libtextstyle/libtextstyle.mk
> -GETTEXT_GNU_VERSION = 0.20.1
> +# Please keep in sync with package/libtextstyle/libtextstyle.mk and
> +# GETTEXT_TINY_ARCHIVE_VERSION in gettext-tiny/gettext-tiny.mk
> +GETTEXT_GNU_VERSION = 0.22

So we now have three files that must be kept in sync, and experience has
shown that, even though we do have such comments about keeping things in
sync, people actualy do not read those comments and we have seen one
package being bumped but not the other (not just about gettext, but
mesa3d, bluez5, protobuf...)

Maybe it woud make sense to introduce a shared version string, à-la qt5;

    package/gettext/gettext.mk
        GETTEXT_VERSION = 0.22
        include $(wildcard package/gettext/*/*.mk)

    package/gettext/gettext-gnu/gettect-gnu.mk
        GETTEXT_GNU_VERSION = $(GETTEXT_VERSION)

    package/gettext/gettext-tiny/gettext-tiny/mk
        $(SED) 's,@ARCHIVE_VERSION@,$(GETTEXT_VERSION),' $(@D)/gettextize

    package/gettext/libtextstyle/libtextstyle.mk
        LIBTEXTSTYLE_VERSION = $(GETTEXT_VERSION)

But see below....

[--SNIP--]
> +# gettext-tools depends on gettext-runtime
> +define HOST_GETTEXT_GNU_CONFIGURE_RUNTIME
> +	cd $(@D)/$(GETTEXT_GNU_SUBDIR); \

You're mixing the target _SUBDIR with host build; that's not clean.

If we can't have proper separation of tiools and runtime for the host
variant, then let's just stop this dance and build host-gettext at the
root of the package (e.g. let's just drop HOST_GETTEEXT_GNU_SUBDIR).

And see below...

> +		$(HOST_CONFIGURE_OPTS) \
> +		./configure --prefix=$(HOST_DIR) \
> +		$(HOST_GETTEXT_GNU_CONF_OPTS)
> +endef
> +HOST_GETTEXT_GNU_PRE_CONFIGURE_HOOKS += HOST_GETTEXT_GNU_CONFIGURE_RUNTIME
> +
> +define HOST_GETTEXT_GNU_BUILD_RUNTIME
> +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/$(GETTEXT_GNU_SUBDIR) install
> +endef
> +HOST_GETTEXT_GNU_PRE_BUILD_HOOKS += HOST_GETTEXT_GNU_BUILD_RUNTIME

As far as I understand, this installs stuff into $(HOST_DIR) at
build time. That is definitely not correct.

What happens when gettext is built as a whole? Certainly, the runtime
library is not installed by the time the tools are built, so the gettext
buildsystem has provising for using as-yet-uninstalled libraries when
linking the tools.

The reason to only build gettext-tools for the host package, was to not
suffer from the whole build time. But if we now need to build the
runtime, then that gain in buildtime is now very limited.

So, back to my porposal above: if we need the runtime for the tools,
then let's build the whole package.

And thus we can drop host-libtextstyle too.

Thoughts?

Regards,
Yann E. MORIN.
Bernd Kuhls Aug. 19, 2023, 2:03 p.m. UTC | #2
Hi Yann,

> You're mixing the target _SUBDIR with host build; that's not clean.

after seeing the discussion[1] about the build-time improvements, which 
led to the current situation, I decided not to enter the discussion about 
its rationale ;) This lead to my un-clean code.

> If we can't have proper separation of tiools and runtime for the host
> variant, then let's just stop this dance and build host-gettext at the
> root of the package (e.g. let's just drop HOST_GETTEEXT_GNU_SUBDIR).

+1, and thanks for starting the discussion ;)

> As far as I understand, this installs stuff into $(HOST_DIR) at build
> time. That is definitely not correct.

You are right, it's hackish.

> So, back to my porposal above: if we need the runtime for the tools,
> then let's build the whole package.

+1

Regards, Bernd

[1] https://lists.buildroot.org/pipermail/buildroot/2014-June/401411.html
Yann E. MORIN Aug. 19, 2023, 2:33 p.m. UTC | #3
Bernd, All,

On 2023-08-19 16:03 +0200, Bernd Kuhls spake thusly:
> > You're mixing the target _SUBDIR with host build; that's not clean.
> after seeing the discussion[1] about the build-time improvements,

He, things can change in 9 years! ;-)

> > If we can't have proper separation of tiools and runtime for the host
> > variant, then let's just stop this dance and build host-gettext at the
> > root of the package (e.g. let's just drop HOST_GETTEEXT_GNU_SUBDIR).
> +1, and thanks for starting the discussion ;)

Note that we can't just drop the HOST_GETTEXT_GNU_SUBDIR assignment,
because the host variant inherits the target setting, so if we drop
HOST_GETTEXT_GNU_SUBDIR, it's gonna be set to "gettext-runtime".

Instead, we'll have to override it with:

    # Don't inherit the target setting; build the whole package:
    HOST_GETTEXT_GNU_SUBDIR = .

> > As far as I understand, this installs stuff into $(HOST_DIR) at build
> > time. That is definitely not correct.
> You are right, it's hackish.

But it had merit to trigger reviewing the current situation.

Thanks!

Regards,
Yann E. MORIN.
diff mbox series

Patch

diff --git a/.checkpackageignore b/.checkpackageignore
index ae5d7cc782..6b1089cb28 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -520,8 +520,6 @@  package/genpart/0001-fix-return-code.patch Upstream
 package/genromfs/0001-build-system.patch Sob Upstream
 package/gensio/0001-Fix-missing-EVP_PKEY_ED25519-build-error-on-libressl.patch Upstream
 package/gerbera/S99gerbera Indent
-package/gettext-gnu/0001-error_print_progname.patch Upstream
-package/gettext-gnu/0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch Upstream
 package/giblib/0001-fix-imlib2-detection.patch Upstream
 package/giflib/0001-Makefile-add-targets-to-manage-static-building.patch Upstream
 package/git-crypt/0001-fix-build-with-libressl-3.5.0.patch Upstream
diff --git a/package/gettext-gnu/0001-error_print_progname.patch b/package/gettext-gnu/0001-error_print_progname.patch
deleted file mode 100644
index 7e1d3c55cf..0000000000
--- a/package/gettext-gnu/0001-error_print_progname.patch
+++ /dev/null
@@ -1,20 +0,0 @@ 
-[Updated to apply cleanly with 0.20.1]
-Signed-off-by: Adam Duskett <Aduskett@gmail.com>
----
-diff --git a/gettext-tools/gnulib-lib/error.h b/gettext-tools/gnulib-lib/error.h
-index 61771cc..4221684 100644
---- a/gettext-tools/gnulib-lib/error.h
-+++ b/gettext-tools/gnulib-lib/error.h
-@@ -68,7 +68,10 @@ extern void error_at_line (int __status, int __errnum, const char *__fname,
- /* If NULL, error will flush stdout, then print on stderr the program
-    name, a colon and a space.  Otherwise, error will call this
-    function without parameters instead.  */
--extern DLL_VARIABLE void (*error_print_progname) (void);
-+#ifndef __UCLIBC__
-+extern DLL_VARIABLE
-+#endif
-+void (*error_print_progname) (void);
- 
- /* This variable is incremented each time 'error' is called.  */
- extern DLL_VARIABLE unsigned int error_message_count;
---
diff --git a/package/gettext-gnu/0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch b/package/gettext-gnu/0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch
deleted file mode 100644
index 5334a36bb7..0000000000
--- a/package/gettext-gnu/0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch
+++ /dev/null
@@ -1,142 +0,0 @@ 
-From e4b3a3f56fa6fc2a51769e286545f0631bb4837c Mon Sep 17 00:00:00 2001
-From: Bruno Haible <bruno@clisp.org>
-Date: Sat, 18 May 2019 23:33:06 +0200
-Subject: [PATCH] build: Restore the ability to build gettext-tools separately, part 1.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Reported by Hanspeter Niederstrasser <nieder@users.sourceforge.net>
-in <https://savannah.gnu.org/bugs/?56333>.
-
-Code based on patch by Miguel Ángel Arruga Vivas <rosen644835@gmail.com>.
-
-* autogen.sh: Copy libtextstyle.m4 for use by gettext-tools.
-* gettext-tools/configure.ac: New option --with-installed-libtextstyle.
-(USE_INSTALLED_LIBTEXTSTYLE): New conditional.
-* gettext-tools/src/Makefile.am (textstyle.h): Disable rule if
-USE_INSTALLED_LIBTEXTSTYLE is true.
-(LT_LIBTEXTSTYLE): New variable.
-(libgettextsrc_la_LDFLAGS): Use it instead of hardcoding a relative filename of
-libtextstyle.la.
-* configure.ac: Filter out --with-installed-libtextstyle from inherited --help
-output.
-* Makefile.am (distcheck-hook): Compare different copies of libtextstyle.m4.
-* PACKAGING: Document that gettext-tools's configure needs to be invoked with
---with-installed-libtextstyle.
-
-Upstream-status: committed.
-https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=e4b3a3f56fa6fc2a51769e286545f0631bb4837c
-
-Signed-off-by: Bruno Haible <bruno@clisp.org>
-[Backported to 0.20.1]
-Signed-off-by: Adam Duskett <Aduskett@gmail.com>
----
- PACKAGING                     |  2 +-
- autogen.sh                    |  1 +
- configure.ac                  |  2 +-
- gettext-tools/configure.ac    | 16 ++++++++++++++++
- gettext-tools/src/Makefile.am |  8 +++++++-
- 5 files changed, 26 insertions(+), 3 deletions(-)
-
-diff --git a/PACKAGING b/PACKAGING
-index a8ce979..52b80ac 100644
---- a/PACKAGING
-+++ b/PACKAGING
-@@ -42,7 +42,7 @@ The 'libtextstyle' binary package can be installed by doing
- The 'gettext-tools' binary package can be installed by doing
- 
-       cd gettext-tools
--      ./configure
-+      ./configure --with-installed-libtextstyle
-       make
-       make install
- 
-diff --git a/autogen.sh b/autogen.sh
-index 5c28b6f..2ccf373 100755
---- a/autogen.sh
-+++ b/autogen.sh
-@@ -268,6 +268,7 @@ if ! $skip_gnulib; then
-   $GNULIB_TOOL --dir=gettext-tools --lib=libgettextlib --source-base=gnulib-lib --m4-base=gnulib-m4 --tests-base=gnulib-tests --makefile-name=Makefile.gnulib --libtool --with-tests --local-dir=gnulib-local --local-symlink \
-     --import --avoid=array-list-tests --avoid=linkedhash-list-tests --avoid=hash-tests --avoid=fdutimensat-tests --avoid=futimens-tests --avoid=utime-tests --avoid=utimens-tests --avoid=utimensat-tests \
-     `for m in $GNULIB_MODULES_TOOLS_LIBUNISTRING_TESTS; do echo --avoid=$m; done` $GNULIB_MODULES_TOOLS_FOR_SRC $GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES $GNULIB_MODULES_TOOLS_OTHER || exit $?
-+  $GNULIB_TOOL --copy-file m4/libtextstyle.m4 gettext-tools/gnulib-m4/libtextstyle.m4 || exit $?
-   # In gettext-tools/libgrep:
-   GNULIB_MODULES_TOOLS_FOR_LIBGREP='
-     mbrlen
-diff --git a/configure.ac b/configure.ac
-index 38db6fd..0c84bdd 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -49,7 +49,7 @@ AC_CANONICAL_HOST
- dnl Optional Features: AC_ARG_ENABLE calls
- dnl Optional Packages: AC_ARG_WITH calls
- dnl Some influential environment variables: AC_ARG_VAR calls
--esyscmd([{ cd gettext-runtime && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; cd libtextstyle && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; cd gettext-tools && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; } | sed -f build-aux/ac-help.sed ])
-+esyscmd([{ cd gettext-runtime && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; cd libtextstyle && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; { cd gettext-tools && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; } | grep -v installed.libtextstyle; } | sed -f build-aux/ac-help.sed ])
- 
- AC_CONFIG_FILES([Makefile])
- 
-diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac
-index cf1dd73..a6816b8 100644
---- a/gettext-tools/configure.ac
-+++ b/gettext-tools/configure.ac
-@@ -121,6 +121,22 @@ AM_CONDITIONAL([PACKAGE_IS_GETTEXT_TOOLS], [true])
- AM_CONDITIONAL([PRELOADABLE_LIBINTL],
-   [test $USE_INCLUDED_LIBINTL = no && test $GLIBC2 = yes])
- 
-+dnl This option allows to build gettext-tools without (re)building libtextstyle.
-+AC_ARG_WITH([installed-libtextstyle],
-+  [AS_HELP_STRING([--with-installed-libtextstyle],
-+     [Use an already installed libtextstyle.])],
-+  [gt_use_installed_libtextstyle=$withval],
-+  [gt_use_installed_libtextstyle=no])
-+if test "$gt_use_installed_libtextstyle" != no; then
-+  gl_LIBTEXTSTYLE
-+else
-+  test -f ../libtextstyle/Makefile || {
-+    AC_MSG_ERROR([When building the gettext-tools package without building the entire gettext package, you need to pass the --with-installed-libtextstyle option to configure.])
-+  }
-+fi
-+AM_CONDITIONAL([USE_INSTALLED_LIBTEXTSTYLE],
-+  [test "$gt_use_installed_libtextstyle" != no])
-+
- dnl This line internationalizes the bison generated parsers.
- BISON_I18N
- 
-diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am
-index b98b7ab..af3dcee 100644
---- a/gettext-tools/src/Makefile.am
-+++ b/gettext-tools/src/Makefile.am
-@@ -250,6 +250,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`; \
-@@ -257,6 +260,9 @@ textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h:
- 	  $(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
- 
- # How to build libgettextsrc.la.
- # Need ../gnulib-lib/libgettextlib.la.
-@@ -268,7 +274,7 @@ MOSTLYCLEANFILES += textstyle.h textstyle/stdbool.h textstyle/version.h textstyl
- # use iconv().
- libgettextsrc_la_LDFLAGS = \
-   -release @VERSION@ \
--  ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) ../../libtextstyle/lib/libtextstyle.la @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
-+  ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) $(LT_LIBTEXTSTYLE) @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
- 
- # OS/2 does not support a DLL name longer than 8 characters.
- if OS2
--- 
-2.24.1
-
diff --git a/package/gettext-gnu/gettext-gnu.hash b/package/gettext-gnu/gettext-gnu.hash
index 4c17fb3e04..b4ec27642c 100644
--- a/package/gettext-gnu/gettext-gnu.hash
+++ b/package/gettext-gnu/gettext-gnu.hash
@@ -1,7 +1,8 @@ 
-# From https://lists.gnu.org/archive/html/info-gnu/2019-05/msg00011.html
-sha1  62f4a6a2fd5f80bfd0e66c497a04094fa3e07b90  gettext-0.20.1.tar.xz
+# Please keep in sync with package/gettext-tiny/gettext-tiny.hash
+# From https://lists.gnu.org/archive/html/info-gnu/2023-06/msg00003.html
+sha1  d9666d3b9c47a84c814d32e76fa75f60ec23756f  gettext-0.22.tar.xz
 
 # Locally calculated
-sha256  53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800  gettext-0.20.1.tar.xz
+sha256  0e60393a47061567b46875b249b7d2788b092d6457d656145bb0e7e6a3e26d93  gettext-0.22.tar.xz
 sha256  e79e9c8a0c85d735ff98185918ec94ed7d175efc377012787aebcf3b80f0d90b  COPYING
 sha256  3fe5361f24b7c49ba12911c08f5a33f9cb18871d95d9fb881f5b8a4793e04288  gettext-runtime/intl/COPYING.LIB
diff --git a/package/gettext-gnu/gettext-gnu.mk b/package/gettext-gnu/gettext-gnu.mk
index 9a1eabd0df..67074e42bc 100644
--- a/package/gettext-gnu/gettext-gnu.mk
+++ b/package/gettext-gnu/gettext-gnu.mk
@@ -4,8 +4,9 @@ 
 #
 ################################################################################
 
-# Please keep in sync with package/libtextstyle/libtextstyle.mk
-GETTEXT_GNU_VERSION = 0.20.1
+# Please keep in sync with package/libtextstyle/libtextstyle.mk and
+# GETTEXT_TINY_ARCHIVE_VERSION in gettext-tiny/gettext-tiny.mk
+GETTEXT_GNU_VERSION = 0.22
 GETTEXT_GNU_SITE = $(BR2_GNU_MIRROR)/gettext
 GETTEXT_GNU_SOURCE = gettext-$(GETTEXT_GNU_VERSION).tar.xz
 GETTEXT_GNU_INSTALL_STAGING = YES
@@ -13,8 +14,6 @@  GETTEXT_GNU_LICENSE = LGPL-2.1+ (libintl), GPL-3.0+ (the rest)
 GETTEXT_GNU_LICENSE_FILES = COPYING gettext-runtime/intl/COPYING.LIB
 GETTEXT_GNU_CPE_ID_VENDOR = gnu
 GETTEXT_GNU_CPE_ID_PRODUCT = gettext
-# 0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch
-GETTEXT_GNU_AUTORECONF = YES
 GETTEXT_GNU_PROVIDES = gettext
 GETTEXT_GNU_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
 
@@ -67,6 +66,20 @@  endef
 GETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED
 HOST_GETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED
 
+# gettext-tools depends on gettext-runtime
+define HOST_GETTEXT_GNU_CONFIGURE_RUNTIME
+	cd $(@D)/$(GETTEXT_GNU_SUBDIR); \
+		$(HOST_CONFIGURE_OPTS) \
+		./configure --prefix=$(HOST_DIR) \
+		$(HOST_GETTEXT_GNU_CONF_OPTS)
+endef
+HOST_GETTEXT_GNU_PRE_CONFIGURE_HOOKS += HOST_GETTEXT_GNU_CONFIGURE_RUNTIME
+
+define HOST_GETTEXT_GNU_BUILD_RUNTIME
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/$(GETTEXT_GNU_SUBDIR) install
+endef
+HOST_GETTEXT_GNU_PRE_BUILD_HOOKS += HOST_GETTEXT_GNU_BUILD_RUNTIME
+
 define GETTEXT_GNU_REMOVE_UNNEEDED
 	$(RM) -rf $(TARGET_DIR)/usr/share/gettext/ABOUT-NLS
 	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/gettext
diff --git a/package/gettext-tiny/gettext-tiny.hash b/package/gettext-tiny/gettext-tiny.hash
index 5155b41910..57e7951cec 100644
--- a/package/gettext-tiny/gettext-tiny.hash
+++ b/package/gettext-tiny/gettext-tiny.hash
@@ -2,5 +2,5 @@ 
 sha256  29cc165e27e83d2bb3760118c2368eadab550830d962d758e51bd36eb860f383  gettext-tiny-0.3.2.tar.gz
 sha256  4c938aa3d8fa3c184bba5e87a8a2febc89560627c9d0567536879e3eca1a7b4f  LICENSE
 sha256  e79e9c8a0c85d735ff98185918ec94ed7d175efc377012787aebcf3b80f0d90b  extra/COPYING
-# From https://lists.gnu.org/archive/html/info-gnu/2019-05/msg00011.html
-sha1  62f4a6a2fd5f80bfd0e66c497a04094fa3e07b90  gettext-0.20.1.tar.xz
+# From https://lists.gnu.org/archive/html/info-gnu/2023-06/msg00003.html
+sha1  d9666d3b9c47a84c814d32e76fa75f60ec23756f  gettext-0.22.tar.xz
diff --git a/package/gettext-tiny/gettext-tiny.mk b/package/gettext-tiny/gettext-tiny.mk
index e2dc563667..90b0531d08 100644
--- a/package/gettext-tiny/gettext-tiny.mk
+++ b/package/gettext-tiny/gettext-tiny.mk
@@ -13,8 +13,9 @@  HOST_GETTEXT_TINY_LICENSE_FILES = LICENSE extra/COPYING
 
 GETTEXT_TINY_PROVIDES = gettext
 
-# needed for gettextize
-GETTEXT_TINY_ARCHIVE_VERSION = 0.20.1
+# Please keep in sync with package/libtextstyle/libtextstyle.mk and
+# package/gettext-gnu/gettext-gnu.mk
+GETTEXT_TINY_ARCHIVE_VERSION = 0.22
 
 GETTEXT_TINY_EXTRA_GETTEXT_FILES = \
 	gettext-tools/misc/gettextize.in \
diff --git a/package/libtextstyle/libtextstyle.hash b/package/libtextstyle/libtextstyle.hash
deleted file mode 100644
index 5c5aee85bf..0000000000
--- a/package/libtextstyle/libtextstyle.hash
+++ /dev/null
@@ -1,6 +0,0 @@ 
-# From https://lists.gnu.org/archive/html/info-gnu/2019-05/msg00011.html
-sha1  62f4a6a2fd5f80bfd0e66c497a04094fa3e07b90  gettext-0.20.1.tar.xz
-
-# Locally calculated
-sha256  53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800  gettext-0.20.1.tar.xz
-sha256  e79e9c8a0c85d735ff98185918ec94ed7d175efc377012787aebcf3b80f0d90b  COPYING
diff --git a/package/libtextstyle/libtextstyle.hash b/package/libtextstyle/libtextstyle.hash
new file mode 120000
index 0000000000..8f87f766aa
--- /dev/null
+++ b/package/libtextstyle/libtextstyle.hash
@@ -0,0 +1 @@ 
+../gettext-gnu/gettext-gnu.hash
\ No newline at end of file
diff --git a/package/libtextstyle/libtextstyle.mk b/package/libtextstyle/libtextstyle.mk
index a5afad04b3..7acf4158d4 100644
--- a/package/libtextstyle/libtextstyle.mk
+++ b/package/libtextstyle/libtextstyle.mk
@@ -4,8 +4,9 @@ 
 #
 ################################################################################
 
-# Please keep in sync with package/gettext-gnu/gettext-gnu.mk
-LIBTEXTSTYLE_VERSION = 0.20.1
+# Please keep in sync with package/gettext-gnu/gettext-gnu.mk and
+# GETTEXT_TINY_ARCHIVE_VERSION in gettext-tiny/gettext-tiny.mk
+LIBTEXTSTYLE_VERSION = 0.22
 LIBTEXTSTYLE_SITE = $(BR2_GNU_MIRROR)/gettext
 LIBTEXTSTYLE_SOURCE = gettext-$(LIBTEXTSTYLE_VERSION).tar.xz
 LIBTEXTSTYLE_INSTALL_STAGING = YES