diff mbox series

[v2,1/3] gobject-introspection: check for GI_DATA_ENABLED

Message ID 20230324093326.3973899-2-kubiznak@2n.com
State New
Headers show
Series [v2,1/3] gobject-introspection: check for GI_DATA_ENABLED | expand

Commit Message

Petr Kubizňák - 2N March 24, 2023, 9:33 a.m. UTC
When GI_DATA_ENABLED is 'False' (e.g. because
'gobject-introspection-data' is not in DISTRO_FEATURES),
gobject-introspection and gobject-introspection-native
should not be added to DEPENDS. This is to reduce dependency chain
when g-i is disabled.

Signed-off-by: Petr Kubizňák <kubiznak@2n.com>
---
 meta/classes-recipe/gobject-introspection.bbclass | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Alexander Kanavin March 24, 2023, 10:22 a.m. UTC | #1
On Fri, 24 Mar 2023 at 10:36, Petr Kubizňák <kubiznak@2n.com> wrote:
>  # Generating introspection data depends on a combination of native and target
>  # introspection tools, and qemu to run the target tools.
> -DEPENDS:append:class-target = " gobject-introspection gobject-introspection-native qemu-native"
> +DEPENDS:append:class-target = " ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'gobject-introspection gobject-introspection-native', '', d)}"
> +DEPENDS:append:class-target = " qemu-native"

This does not seem right; if g-i is entirely disabled, then qemu
shouldn't be called at any point, and so should be in the same
conditional list.

Alex
diff mbox series

Patch

diff --git a/meta/classes-recipe/gobject-introspection.bbclass b/meta/classes-recipe/gobject-introspection.bbclass
index 0c7b7d200a..eb55e7c5e8 100644
--- a/meta/classes-recipe/gobject-introspection.bbclass
+++ b/meta/classes-recipe/gobject-introspection.bbclass
@@ -35,7 +35,8 @@  EXTRA_OEMESON:prepend:class-nativesdk = "${@['', '${GIRMESONBUILD}'][d.getVar('G
 
 # Generating introspection data depends on a combination of native and target
 # introspection tools, and qemu to run the target tools.
-DEPENDS:append:class-target = " gobject-introspection gobject-introspection-native qemu-native"
+DEPENDS:append:class-target = " ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'gobject-introspection gobject-introspection-native', '', d)}"
+DEPENDS:append:class-target = " qemu-native"
 
 # Even though introspection is disabled on -native, gobject-introspection package is still
 # needed for m4 macros.
@@ -46,10 +47,12 @@  DEPENDS:append:class-nativesdk = " gobject-introspection-native"
 export XDG_DATA_DIRS = "${STAGING_DATADIR}:${STAGING_LIBDIR}"
 
 do_configure:prepend:class-target () {
-    # introspection.m4 pre-packaged with upstream tarballs does not yet
-    # have our fixes
-    mkdir -p ${S}/m4
-    cp ${STAGING_DIR_TARGET}/${datadir}/aclocal/introspection.m4 ${S}/m4
+    if [ "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '1', '0', d)}" = "1" ] ; then
+        # introspection.m4 pre-packaged with upstream tarballs does not yet
+        # have our fixes
+        mkdir -p ${S}/m4
+        cp ${STAGING_DIR_TARGET}/${datadir}/aclocal/introspection.m4 ${S}/m4
+    fi
 }
 
 # .typelib files are needed at runtime and so they go to the main package (so