commit:     5e1ee182afd8c4933d0daf37565f0f81b6548350
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 31 08:28:48 2025 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Sun Feb  2 05:13:50 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e1ee182

app-i18n/ibus: always forcibly regenerate vala files

Upstream says to do it. We chased around trying to only rebuild a
handful of them depending on arcane decisions such as USE flags or even
whether a system dependency (???) was installed, but the correct answer
was always to unconditionally do so.

It is needed for correctness, to ensure that econf options are actually
respected, since vala `#define`s work at the time the *.c files
themselves are generated. In particular, checking whether gtk as
currently installed is compiled with wayland support is an obvious red
flag that the resulting behavior isn't compatible with USE flags. The
build system compiles C code using an *unconditional* wayland API/ABI on
gtk, if the wayland USE flag is set on ibus itself, as enforced by
touching and regenerating these vala -> C files. The upstream distfile
generated these C files in a build where `$(use_enable wayland)` was in
an enabled state.

(There are also handwritten C files with automagic dependencies, but
that is the next commit.)

Bug: https://github.com/ibus/ibus/issues/2609
Bug: https://gitlab.gnome.org/GNOME/vala/-/issues/1580
Closes: https://bugs.gentoo.org/878813
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 app-i18n/ibus/ibus-1.5.29.ebuild | 25 ++++++++++++-------------
 app-i18n/ibus/ibus-1.5.30.ebuild | 25 ++++++++++++-------------
 app-i18n/ibus/ibus-1.5.31.ebuild | 25 ++++++++++++-------------
 3 files changed, 36 insertions(+), 39 deletions(-)

diff --git a/app-i18n/ibus/ibus-1.5.29.ebuild b/app-i18n/ibus/ibus-1.5.29.ebuild
index b8e1fcc24e03..dcc89a5ba88d 100644
--- a/app-i18n/ibus/ibus-1.5.29.ebuild
+++ b/app-i18n/ibus/ibus-1.5.29.ebuild
@@ -87,19 +87,18 @@ S=${WORKDIR}/${PN}-${MY_PV_DERP}
 
 src_prepare() {
        vala_setup --ignore-use
-       if ! has_version 'x11-libs/gtk+:3[wayland]'; then
-               touch ui/gtk3/panelbinding.vala \
-                       ui/gtk3/panel.vala \
-                       ui/gtk3/emojierapp.vala || die
-       fi
-       if ! use emoji; then
-               touch \
-                       tools/main.vala \
-                       ui/gtk3/panel.vala || die
-       fi
-       if ! use appindicator; then
-               touch ui/gtk3/panel.vala || die
-       fi
+       # Under various circumstances, vala transpiles will need to be redone 
due to
+       # encoding false assumptions about enabled features at the time the 
distfile
+       # was produced. Vala's conditional compilation encodes the configure 
options
+       # from the maintainer's machine when creating distfiles.
+       #
+       # See:
+       # - https://github.com/ibus/ibus/issues/2609
+       # - https://gitlab.gnome.org/GNOME/vala/-/issues/1580
+       #
+       # Force all vala files to be regenerated no matter what.
+       find . -name '*.vala' -exec touch {} + || die
+
        if [[ -n ${GENTOO_VER} ]]; then
                einfo "Try to apply Gentoo specific patch set"
                eapply "${WORKDIR}"/patches-gentoo/*.patch

diff --git a/app-i18n/ibus/ibus-1.5.30.ebuild b/app-i18n/ibus/ibus-1.5.30.ebuild
index 1c54952f1872..ff30e4b764a9 100644
--- a/app-i18n/ibus/ibus-1.5.30.ebuild
+++ b/app-i18n/ibus/ibus-1.5.30.ebuild
@@ -84,19 +84,18 @@ BDEPEND="
 
 src_prepare() {
        vala_setup --ignore-use
-       if ! has_version 'x11-libs/gtk+:3[wayland]'; then
-               touch ui/gtk3/panelbinding.vala \
-                       ui/gtk3/panel.vala \
-                       ui/gtk3/emojierapp.vala || die
-       fi
-       if ! use emoji; then
-               touch \
-                       tools/main.vala \
-                       ui/gtk3/panel.vala || die
-       fi
-       if ! use appindicator; then
-               touch ui/gtk3/panel.vala || die
-       fi
+       # Under various circumstances, vala transpiles will need to be redone 
due to
+       # encoding false assumptions about enabled features at the time the 
distfile
+       # was produced. Vala's conditional compilation encodes the configure 
options
+       # from the maintainer's machine when creating distfiles.
+       #
+       # See:
+       # - https://github.com/ibus/ibus/issues/2609
+       # - https://gitlab.gnome.org/GNOME/vala/-/issues/1580
+       #
+       # Force all vala files to be regenerated no matter what.
+       find . -name '*.vala' -exec touch {} + || die
+
        if [[ -n ${GENTOO_VER} ]]; then
                einfo "Try to apply Gentoo specific patch set"
                eapply "${WORKDIR}"/patches-gentoo/*.patch

diff --git a/app-i18n/ibus/ibus-1.5.31.ebuild b/app-i18n/ibus/ibus-1.5.31.ebuild
index 4d286675ba7d..45f554b527e7 100644
--- a/app-i18n/ibus/ibus-1.5.31.ebuild
+++ b/app-i18n/ibus/ibus-1.5.31.ebuild
@@ -84,19 +84,18 @@ BDEPEND="
 
 src_prepare() {
        vala_setup --ignore-use
-       if ! has_version 'x11-libs/gtk+:3[wayland]'; then
-               touch ui/gtk3/panelbinding.vala \
-                       ui/gtk3/panel.vala \
-                       ui/gtk3/emojierapp.vala || die
-       fi
-       if ! use emoji; then
-               touch \
-                       tools/main.vala \
-                       ui/gtk3/panel.vala || die
-       fi
-       if ! use appindicator; then
-               touch ui/gtk3/panel.vala || die
-       fi
+       # Under various circumstances, vala transpiles will need to be redone 
due to
+       # encoding false assumptions about enabled features at the time the 
distfile
+       # was produced. Vala's conditional compilation encodes the configure 
options
+       # from the maintainer's machine when creating distfiles.
+       #
+       # See:
+       # - https://github.com/ibus/ibus/issues/2609
+       # - https://gitlab.gnome.org/GNOME/vala/-/issues/1580
+       #
+       # Force all vala files to be regenerated no matter what.
+       find . -name '*.vala' -exec touch {} + || die
+
        if [[ -n ${GENTOO_VER} ]]; then
                einfo "Try to apply Gentoo specific patch set"
                eapply "${WORKDIR}"/patches-gentoo/*.patch

Reply via email to