We shouldn't package the bare libportal and the GTK3 and GTK4 libraries
into one package. Instead package the UI libraries into separate
packages, so that dependencies are contained.

Add PACKAGECONFIGs for the gtk3 and gtk3 libraries so that they can be
controlled individually. Keep the existing behaviour of enabling both
GTK 3 and 4 as various recipes use both, but this allows building
libportal without any GTK dependencies if required.

The PACKAGECONFIG logic is "fun": if either of wayland or x11 are
enabled then we can enable GTK+3 by default, and if either of those
_and_ opengl are enabled then we can also do GTK 4.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/recipes-gnome/libportal/libportal_0.9.1.bb | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-gnome/libportal/libportal_0.9.1.bb 
b/meta/recipes-gnome/libportal/libportal_0.9.1.bb
index f4924355f93..59252e2a67b 100644
--- a/meta/recipes-gnome/libportal/libportal_0.9.1.bb
+++ b/meta/recipes-gnome/libportal/libportal_0.9.1.bb
@@ -9,14 +9,22 @@ LIC_FILES_CHKSUM = 
"file://COPYING;md5=3000208d539ec061b899bce1d9ce9404"
 SRC_URI = "git://github.com/flatpak/${BPN}.git;protocol=https;branch=main"
 SRCREV = "8f5dc8d192f6e31dafe69e35219e3b707bde71ce"
 
-inherit meson gi-docgen gobject-introspection vala features_check pkgconfig
+inherit meson gi-docgen gobject-introspection vala pkgconfig
 GIDOCGEN_MESON_OPTION = 'docs'
 
-ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+DEPENDS += "glib-2.0 glib-2.0-native"
 
-DEPENDS += "glib-2.0 glib-2.0-native gtk+3"
+CAN_GTK = "${@bb.utils.contains_any('DISTRO_FEATURES', 
'${GTK3DISTROFEATURES}', '1', '0', d)}"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gtk4', 
'', d)}"
+PACKAGECONFIG ??= "${@oe.utils.vartrue('CAN_GTK', 'gtk3', '', d)} \
+                   ${@oe.utils.vartrue('CAN_GTK', 
'${@bb.utils.contains("DISTRO_FEATURES", "opengl", "gtk4", "", d)}', '', d)}"
+
+PACKAGECONFIG[gtk3] = "-Dbackend-gtk3=enabled,-Dbackend-gtk3=disabled,gtk+3"
 PACKAGECONFIG[gtk4] = "-Dbackend-gtk4=enabled,-Dbackend-gtk4=disabled,gtk4"
 
 EXTRA_OEMESON = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 
'-Dvapi=true', '-Dvapi=false', d)} -Dbackend-qt5=disabled"
+
+PACKAGES =+ "${PN}-gtk3 ${PN}-gtk4"
+
+FILES:${PN}-gtk3 = "${libdir}/libportal-gtk3${SOLIBS} 
${libdir}/girepository-1.0/*Gtk3-1.0.typelib"
+FILES:${PN}-gtk4 = "${libdir}/libportal-gtk4${SOLIBS} 
${libdir}/girepository-1.0/*Gtk4-1.0.typelib"
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#236981): 
https://lists.openembedded.org/g/openembedded-core/message/236981
Mute This Topic: https://lists.openembedded.org/mt/119297082/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to