Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Gyorgy Sarvari <skandigraun@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [RFC] gettext, gettext-native-minimal: upgrade 0.23.1 -> 0.26
Date: Sat, 30 Aug 2025 22:58:11 +0200	[thread overview]
Message-ID: <2f5a2e0f-0b16-4990-a574-a3fad36fdc96@gmail.com> (raw)
In-Reply-To: <1860A6DF185EFE18.24627@lists.openembedded.org>

On 8/30/25 22:55, Gyorgy Sarvari via lists.openembedded.org wrote:
> diff --git a/meta/classes-recipe/autotools.bbclass b/meta/classes-recipe/autotools.bbclass
> index 948f8c183a..0d83e68679 100644
> --- a/meta/classes-recipe/autotools.bbclass
> +++ b/meta/classes-recipe/autotools.bbclass
> @@ -186,13 +186,35 @@ autotools_do_configure() {
>  				echo "no" | glib-gettextize --force --copy
>  			fi
>  		elif [ "${BPN}" != "gettext" ] && grep -q "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC; then
> -			# We'd call gettextize here if it wasn't so broken...
> +			# Gettextize could be called here, however it doesn't make the job much easier:
> +			# It doesn't discover relevant po folders on its own, so they still need to be
> +			# found by some heurestics. Also, it would require always the full gettext
> +			# package always, instead of gettext-minimal-native.
>  			cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
> -			if [ -d ${S}/po/ ]; then
> -				cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
> -				if [ ! -e ${S}/po/remove-potcdate.sed ]; then
> -					cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sed ${S}/po/
> +			if [ -d ${S}/po ]; then
> +				if [ -f ${S}/po/Makefile.in.in ]; then
> +					# search for all Makefile.in.in files that are identical to ./po/Makefile.in.in, by md5sum
> +					base_makefile_hash=`md5sum ${S}/po/Makefile.in.in | tr -s ' ' | cut -f1 -d' '`
> +					makefiles_to_update=`find ${S} -name Makefile.in.in -exec md5sum {} \+ | grep $base_makefile_hash | tr -s ' ' | cut -d' ' -f2`
> +				else
> +					# if there is no po/Makefile.in.in, then just copy the latest there, without
> +					# searching for others
> +					makefiles_to_update="./po/Makefile.in.in"
>  				fi
> +				bbnote List of Makefile.in.ins to update: $makefiles_to_update
> +				for makefile in ${makefiles_to_update}; do
> +					makefile_dir=$(dirname $makefile)
> +					bbnote Executing: cp ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${makefile_dir}/
> +					cp ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${makefile_dir}/
> +					if [ ! -e ${makefile_dir}/remove-potcdate.sed ]; then
> +						cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sed ${makefile_dir}/
> +					fi
> +				done
> +				for makevars in `find ${S} -name Makevars`; do
> +					bbnote Concatenating Makevars: $makevars
> +					cat ${STAGING_DATADIR_NATIVE}/gettext/po/Makevars.template.minimal ${makevars} >> ${makevars}.yocto_temp
> +					mv ${makevars}.yocto_temp ${makevars}
> +				done
>  			fi
>

In principle I think that it's about as I can make it on my own (sans AB
failures[1]), but there would be a few question marks on my end:

1. If you have a better idea for relevant Makefile.in.in heurestics in
autotools.bbclass, I'm listening
2. I *think* that the Makevars concatenation makes actual sense, and the
build success is not only an accident - but I'm not 100% sure if that's
the best way to handle this. If you know gettext, I'd like to hear your
opinion. (This was inspired by gettextize's behavior. Upon running it,
it copies the Makevars.template with default values in the po folder,
and asks you to set up all the variables from it in your Makevars file)

[1]: I did build recipes and multiple images successfully, but not
"bitbake world" on multiple configs


       reply	other threads:[~2025-08-30 20:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1860A6DF185EFE18.24627@lists.openembedded.org>
2025-08-30 20:58 ` Gyorgy Sarvari [this message]
2025-09-01  8:21   ` [OE-core] [RFC] gettext, gettext-native-minimal: upgrade 0.23.1 -> 0.26 Mathieu Dubois-Briand
2025-09-02  9:40     ` Gyorgy Sarvari
2025-09-01 10:09   ` Alexander Kanavin
2025-09-03  9:10     ` Gyorgy Sarvari
     [not found] <186229F4B4DD4221.5335@lists.openembedded.org>
2025-09-04 19:10 ` Gyorgy Sarvari
2025-09-05 10:45   ` Alexander Kanavin
2025-09-05 10:49     ` Gyorgy Sarvari
2025-09-05 10:52       ` Alexander Kanavin
2025-09-05 11:02         ` Gyorgy Sarvari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f5a2e0f-0b16-4990-a574-a3fad36fdc96@gmail.com \
    --to=skandigraun@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox