libgpiod: selectively enable GObject introspection

The oe-core bbclass for GObject introspection sets GI_DATA_ENABLED if
the relevant distro feature is enabled. That means that it's up to the
inheriting recipe to disable it if needed.

For libgpiod: we only want to enable it if any of the GLib based
packages is being generated (GLib bindings, D-Bus daemon or ptest).

This also effectively reverts commit 78a332939f (libgpiod_2.2: depend
on glib-2.0) which indiscriminately pulls in GLib for all packages
generated by this recipe which feels like shooting a fly with a cannon.

Fixes: 9626e8a2c8 ("libgpiod: update to v2.2")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Bartosz Golaszewski 2024-10-30 21:53:31 +01:00 committed by Khem Raj
parent 0f692c3ab7
commit ec67268d5e
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -9,8 +9,6 @@ LIC_FILES_CHKSUM = " \
file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
"
DEPENDS += "glib-2.0"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
SRC_URI += "file://gpio-manager.init"
@ -59,6 +57,10 @@ python __anonymous() {
d.setVar("SYSTEMD_SERVICE:{}-manager".format(pn), "gpio-manager.service")
else:
d.appendVar("EXTRA_OECONF", " --disable-systemd")
# Disable gobject introspection set by the bbclass if we don't want it.
if not any(cfg in ["glib", "dbus", "ptest"] for cfg in packageconfig):
d.setVar("GI_DATA_ENABLED", "False")
}
UPDATERCPN = "${PN}-manager"