autotools.bbclass: Copy gettext/po/Makefile.in.in to all po/Makefile.in.in
cover autotools.bbclass: Copy gettext/po/Makefile.in.in to all po/Makefile.in.in
From: Robert Yang <[email protected]>
The following changes since commit c7faf141592d1e2a5cab32a83f7e1498ee498d65:
kernel-module-split: Allow for external conf files (2025-05-20 14:47:47 +0100)
are available in the Git repository at:
https://github.com/robertlinux/yocto rbt/autotools
https://github.com/robertlinux/yocto/tree/rbt/autotools
Robert Yang (1):
autotools.bbclass: Copy gettext/po/Makefile.in.in to all
po/Makefile.in.in
meta/classes-recipe/autotools.bbclass | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
Signature · 1 line
2.49.0
PATCH 1/1 autotools.bbclass: Copy gettext/po/Makefile.in.in to all po/Makefile.in.in
From: Robert Yang <[email protected]>
The previous code only copied to ${S}/po/Makefile.in.in, but there might be other po/Makefile.in.in in ${S}, for example:
* bison:
runtime-po/Makefile.in.in
gnulib-po/Makefile.in.in
* gawk:
extension/po/Makefile.in.in
* fontconfig
po-conf/Makefile.in.in
* There might be more recipes in oe-core, and more recipes from other layers.
The build would be failed after upgrade gettext to 0.24.1 since gettext changed the way to include Makevars, so we have to fix the recipes one by one, such as:
do_configure:prepend() {
cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/runtime-po/
cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/gnulib-po/
}Even if we don't upgrade gettext to 0.24.1, have different po/Makefile.in.in in the same ${S} is a kind of bug, this patch can fix the issues.
The fix way is:
Find all possible po/Makefile.in.in, if it is the same as ${S}/po/Makefile.in.in, then override it with ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in.
--- meta/classes-recipe/autotools.bbclass | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
meta/classes-recipe/autotools.bbclass +21 -1
@@ -188,8 +188,28 @@ autotools_do_configure() { elif [ "${BPN}" != "gettext" ] && grep -q "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC; then # We'd call gettextize here if it wasn't so broken... cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/ + # Find all possible po/Makefile.in.in, if it is the same as + # po/Makefile.in.in, then override it with + # ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in. if [ -d ${S}/po/ ]; then - cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/ + makefile_in_in_top=${S}/po/Makefile.in.in + need_copy=$makefile_in_in_top + if [ -f $makefile_in_in_top ]; then + makefile_in_ins="$(find ${S} -name Makefile.in.in)" + for makefile_in_in in $makefile_in_ins; do + if [ $makefile_in_in != $makefile_in_in_top ]; then + diff="$(diff ${S}/po/Makefile.in.in $makefile_in_in)" + if [ -z $difff ]; then + need_copy="$need_copy $makefile_in_in" + fi + fi + done + fi + for makefile in $need_copy; do + cmd="cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in $makefile" + bbnote "Running $cmd" + $cmd + done if [ ! -e ${S}/po/remove-potcdate.sed ]; then cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sed ${S}/po/ fi
Signature · 1 line
2.49.0
Quoted 46 lines · Robert Yang via lists.openembedded.org
From: Robert Yang <[email protected]>
The previous code only copied to ${S}/po/Makefile.in.in, but there might be other po/Makefile.in.in in ${S}, for example:
* bison:
runtime-po/Makefile.in.in
gnulib-po/Makefile.in.in* gawk:
extension/po/Makefile.in.in* fontconfig
po-conf/Makefile.in.in* There might be more recipes in oe-core, and more recipes from other layers.
The build would be failed after upgrade gettext to 0.24.1 since gettext changed the way to include Makevars, so we have to fix the recipes one by one, such as:
do_configure:prepend() { cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/runtime-po/ cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/gnulib-po/ }Even if we don't upgrade gettext to 0.24.1, have different po/Makefile.in.in in the same ${S} is a kind of bug, this patch can fix the issues.
The fix way is:
Find all possible po/Makefile.in.in, if it is the same as ${S}/po/Makefile.in.in, then override it with ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in.Signed-off-by Robert Yang <[email protected]>--- meta/classes-recipe/autotools.bbclass | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)meta/classes-recipe/autotools.bbclass +3
-0@@ -188,8 +188,28 @@ autotools_do_configure() { elif [ "${BPN}" != "gettext" ] && grep -q "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC; then # We'd call gettextize here if it wasn't so broken... cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/ + # Find all possible po/Makefile.in.in, if it is the same as + # po/Makefile.in.in, then override it with + # ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in.
meta/classes-recipe/autotools.bbclass autotools_do_configure() { · line 202
Quoted 10 lines
meta/classes-recipe/autotools.bbclass +8
-1if [ -d ${S}/po/ ]; then - cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/ + makefile_in_in_top=${S}/po/Makefile.in.in + need_copy=$makefile_in_in_top + if [ -f $makefile_in_in_top ]; then + makefile_in_ins="$(find ${S} -name Makefile.in.in)" + for makefile_in_in in $makefile_in_ins; do + if [ $makefile_in_in != $makefile_in_in_top ]; then + diff="$(diff ${S}/po/Makefile.in.in $makefile_in_in)" + if [ -z $difff ]; then
There seems to be an extra f (difff vs diff)
Quoted 22 lines
meta/classes-recipe/autotools.bbclass +10
-1+ need_copy="$need_copy $makefile_in_in" + fi + fi + done + fi + for makefile in $need_copy; do + cmd="cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in $makefile" + bbnote "Running $cmd" + $cmd + done if [ ! -e ${S}/po/remove-potcdate.sed ]; then cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sed ${S}/po/ fi -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#217006): https://lists.openembedded.org/g/openembedded-core/message/217006
Mute This Topic: https://lists.openembedded.org/mt/113225997/6084445
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 52 lines · Gyorgy Sarvari
Quoted 49 lines · Robert Yang via lists.openembedded.org
From: Robert Yang <[email protected]>
The previous code only copied to ${S}/po/Makefile.in.in, but there might be other po/Makefile.in.in in ${S}, for example:
* bison:
runtime-po/Makefile.in.in
gnulib-po/Makefile.in.in* gawk:
extension/po/Makefile.in.in* fontconfig
po-conf/Makefile.in.in* There might be more recipes in oe-core, and more recipes from other layers.
The build would be failed after upgrade gettext to 0.24.1 since gettext changed the way to include Makevars, so we have to fix the recipes one by one, such as:
do_configure:prepend() { cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/runtime-po/ cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/gnulib-po/ }Even if we don't upgrade gettext to 0.24.1, have different po/Makefile.in.in in the same ${S} is a kind of bug, this patch can fix the issues.
The fix way is:
Find all possible po/Makefile.in.in, if it is the same as ${S}/po/Makefile.in.in, then override it with ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in.Signed-off-by Robert Yang <[email protected]>--- meta/classes-recipe/autotools.bbclass | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)meta/classes-recipe/autotools.bbclass +4
-1@@ -188,8 +188,28 @@ autotools_do_configure() { elif [ "${BPN}" != "gettext" ] && grep -q "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC; then # We'd call gettextize here if it wasn't so broken... cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/ + # Find all possible po/Makefile.in.in, if it is the same as + # po/Makefile.in.in, then override it with + # ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in. if [ -d ${S}/po/ ]; then - cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/ + makefile_in_in_top=${S}/po/Makefile.in.in
Quoted 8 lines
meta/classes-recipe/autotools.bbclass autotools_do_configure() { · line 202
Quoted 7 lines
meta/classes-recipe/autotools.bbclass +7
-0+ need_copy=$makefile_in_in_top + if [ -f $makefile_in_in_top ]; then + makefile_in_ins="$(find ${S} -name Makefile.in.in)" + for makefile_in_in in $makefile_in_ins; do + if [ $makefile_in_in != $makefile_in_in_top ]; then + diff="$(diff ${S}/po/Makefile.in.in $makefile_in_in)" + if [ -z $difff ]; thenThere seems to be an extra f (difff vs diff)
Yes, you're right! It's strange that my world built well with this typo. I've fixed it locally and re-do the world build. Will update the patch if the build works well.
// Robert
Quoted 23 lines
Quoted 22 lines
meta/classes-recipe/autotools.bbclass +10
-1+ need_copy="$need_copy $makefile_in_in" + fi + fi + done + fi + for makefile in $need_copy; do + cmd="cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in $makefile" + bbnote "Running $cmd" + $cmd + done if [ ! -e ${S}/po/remove-potcdate.sed ]; then cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sed ${S}/po/ fi -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#217006): https://lists.openembedded.org/g/openembedded-core/message/217006
Mute This Topic: https://lists.openembedded.org/mt/113225997/6084445
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 2 lines · Robert Yang via lists.openembedded.org
The previous code only copied to ${S}/po/Makefile.in.in, but there might be other po/Makefile.in.in in ${S}, for example:
I’ve made it my life’s work over the last few years to slowly remove all the crazy from autotools.bbclass so I have a counter-proposal: what if gettextize works now?
If there’s a new gettext release we need to integrate, then it’s absolutely worth investigating to see if the tooling now works out of the box. Unfortunately what the breakage actually is has been lost beyond a comment saying that it’s “broken”.
Ross
Quoted 5 lines · Ross Burton
Quoted 2 lines · Robert Yang via lists.openembedded.org
The previous code only copied to ${S}/po/Makefile.in.in, but there might be other po/Makefile.in.in in ${S}, for example:
I’ve made it my life’s work over the last few years to slowly remove all the crazy from autotools.bbclass so I have a counter-proposal: what if gettextize works now?
I will try gettextize.
Quoted 2 lines
If there’s a new gettext release we need to integrate, then it’s absolutely worth investigating to see if the tooling now works out of the box. Unfortunately what the breakage actually is has been lost beyond a comment saying that it’s “broken”.
Before 0.24.1, they way to include Makevars is the following line in po/Makefile.in.in:
# Makevars gets inserted here. (Don't remove this line!)
After 0.24.1, the above line doesn't work, and the new way is:
# Include the customization of this po/ directory. include $(srcdir)/Makevars
So po/Makefile.in.in from older gettext doesn't work any more, and will get the errors like:
make[2]: *** No rule to make target '/config.status', needed by 'Makefile'. Stop.
This is because it doesn't include Makevars which makes it misses var definitions such as top_builddir.
// Robert
Quoted 2 lines
Ross
Hi Ross,
Quoted 7 lines · Ross Burton
Quoted 2 lines · Robert Yang via lists.openembedded.org
The previous code only copied to ${S}/po/Makefile.in.in, but there might be other po/Makefile.in.in in ${S}, for example:
I’ve made it my life’s work over the last few years to slowly remove all the crazy from autotools.bbclass so I have a counter-proposal: what if gettextize works now?
If there’s a new gettext release we need to integrate, then it’s absolutely worth investigating to see if the tooling now works out of the box. Unfortunately what the breakage actually is has been lost beyond a comment saying that it’s “broken”.
Sorry for the late reply, I did try gettextize, but things will be worse:
1) gettextize doesn't work for sub-po directories such as runtime-po, we sitll need find and sub-po/Makefile.in.in and run getextize there
2) The recipe gettext-minimal-native doesn't provide gettextize, so we need
check whether gettextize is present before run it, we need copy the
Makefile.in.in manually if it is not present, that will increase the
code complexity.
So it seems that my current patch is the best choice we have.
// Robert
Quoted 2 lines
Ross