networkmanager: enable vala bindings if gobject introspection is enabled

when opting out from the DISTRO_FEATURE gobject-introspection-date, the
build fails with error:
../NetworkManager-1.50.0/meson.build:849:4: ERROR: Assert failed: vala api require GObject introspection. Use -Dvapi=false to disable it

The gobject-introspection-data feature, while ultimately added to
DISTRO_FEATURES via DISTRO_FEATURE_BACKFILL, isn't available during the
vala.bbclass inheritance check. This also excludes derived variables
e.g. GI_DATA_ENABLED.

To properly disable a DISTRO_FEATURE_BACKFILL feature, it must be
included in DISTRO_FEATURE_BACKFILL_CONSIDERED, a variable that is
available during the parsing phase.

Similar situations have been resolved in:

[openembedded-core:31daea70b18b2b2266bf94063b655aaf142a6166]
librsvg: Only enable the Vala bindings if GObject Introspection is enabled
 PACKAGECONFIG:append:class-target = " ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'vala', '', d)}"

  -- and --

[meta-openembedded:d89fc6ffbdf8f947643def51b804052bb5e7ac97
libpeas: add recipe for 2.0.5
 PACKAGECONFIG ?= "python3 gjs lua51 ${@bb.utils.contains('DISTRO_FEATURES', 'gobject-introspection', 'vala', '', d)}"

Signed-off: Andreas Fenkart <afenkart@gmail.com>
This commit is contained in:
Andreas Fenkart 2025-04-04 17:07:48 +02:00 committed by Khem Raj
parent ed6a77501a
commit e81fefb0ef
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -77,11 +77,12 @@ CFLAGS:append:libc-musl = " \
-DRTLD_DEEPBIND=0 \
"
PACKAGECONFIG ??= "readline nss ifupdown dnsmasq nmcli vala \
PACKAGECONFIG ??= "readline nss ifupdown dnsmasq nmcli \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'wifi polkit ppp', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES_BACKFILL_CONSIDERED', 'gobject-introspection-data', '', 'vala', d)} \
"
inherit ${@bb.utils.contains('PACKAGECONFIG', 'vala', 'vala', '', d)}