package/pkg-autotools: add FOO_AUTOPOINT flag

Add a new variable to run autopoint during autoreconf.

This variable depends on FOO_AUTORECONF = YES. It is mutually exclusive
to FOO_GETTEXTIZE. If both are set, FOO_AUTOPOINT is ignored to preserve
previous behavior.

This support is being added per a previous discussion [1].

The usage of gettextize needs to be removed cuz mama says so [2].
  ... is not part of the GNU build system, in the sense that it should
  not be invoked automatically, and not be invoked by someone who doesn’t
  assume the responsibilities of a package maintainer. For the latter
  purpose, a separate tool is provided, see Invoking the autopoint Program [3]

Using gettextize has the unintended consequence of updating the package
based on the version of host-gettext vs what was chosen by the upstream
maintainer. As mama said above, we should use autopoint. Do as she says
to avoid further scolding (gettextize shoehorning and package patching).

[1] https://patchwork.ozlabs.org/project/buildroot/patch/20170827110920.15579-1-aleksander@aleksander.es/
[2] https://www.gnu.org/software/gettext/manual/html_node/gettextize-Invocation.html
[3] https://www.gnu.org/software/gettext/manual/html_node/autopoint-Invocation.html

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
This commit is contained in:
Vincent Fazio 2023-02-21 11:21:54 -06:00 committed by Arnout Vandecappelle
parent 658e7626e5
commit bb7822abad

View File

@ -152,6 +152,15 @@ ifndef $(2)_GETTEXTIZE
endif
endif
ifndef $(2)_AUTOPOINT
ifdef $(3)_AUTOPOINT
$(2)_AUTOPOINT = $$($(3)_AUTOPOINT)
else
$(2)_AUTOPOINT ?= NO
endif
endif
ifeq ($(4),host)
$(2)_AUTORECONF_OPTS ?= $$($(3)_AUTORECONF_OPTS)
endif
@ -240,8 +249,14 @@ ifeq ($$($(2)_AUTORECONF),YES)
ifeq ($$($(2)_GETTEXTIZE),YES)
$(2)_PRE_CONFIGURE_HOOKS += GETTEXTIZE_HOOK
$(2)_DEPENDENCIES += host-gettext
endif
$(2)_AUTORECONF_ENV += AUTOPOINT=/bin/true
# autopoint is provided by gettext
else ifeq ($$($(2)_AUTOPOINT),YES)
$(2)_DEPENDENCIES += host-gettext
$(2)_AUTORECONF_ENV += AUTOPOINT=$$(HOST_DIR)/bin/autopoint
else
$(2)_AUTORECONF_ENV += AUTOPOINT=/bin/true
endif
$(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK
# default values are not evaluated yet, so don't rely on this defaulting to YES
ifneq ($$($(2)_LIBTOOL_PATCH),NO)