Skip to contentSkip to conversation

mesa: fix RPROVIDEd package names

PATCH Superseded Dmitry Baryshkov 2 participants 10 messages Jun 18, 2025

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/8 mesa: fix RPROVIDEd package names

The BCP for virtual runtime package names is virtual-foo. Make mesa follow the established convention and change the names of the provied packages to virtual-foo-icd.

Fixes 9d3b4c9bc403 ("mesa: sort out PROVIDES for the glvnd case")
---
 meta/recipes-graphics/mesa/mesa.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/mesa/mesa.inc +1 -1
index 56ac18ea534b..a583edc57f6f 100644
@@ -287,7 +287,7 @@ python __anonymous() {
     if 'glvnd' in pkgconfig:
         for p in ("libegl", "libglx"):
             fullp = mlprefix + p + "-mesa" + suffix
-            d.appendVar("RPROVIDES:" + fullp, '%s-icd' % p)
+            d.appendVar("RPROVIDES:" + fullp, ' virtual-%s-icd' % p)
     else:
         for p in (("egl", "libegl", "libegl1"),
                   ("opengl", "libgl", "libgl1"),
Signature · 1 line
2.39.5
#1 lore raw

PATCH v4 2/8 default-providers: fix GLVND providers to be selected at runtime

The virtual-{libegl,libglx}-icd names are RPROVIDES, not PROVIDES, because they are a runtime dependency of libglvnd. Make default-providers follow that and specify PREFERRED_RPROVIDER instead of PREFERRED_PROVIDER for those names.

Fixes 9d3b4c9bc403 ("mesa: sort out PROVIDES for the glvnd case")
---
 meta/conf/distro/include/default-providers.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/conf/distro/include/default-providers.inc +2 -2
index 4f094163546c..274ad0c4f630 100644
@@ -7,9 +7,7 @@ PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg"
 PREFERRED_PROVIDER_virtual/libsdl2 ?= "libsdl2"
 PREFERRED_PROVIDER_virtual/libsdl2-native ?= "libsdl2-native"
 PREFERRED_PROVIDER_virtual/egl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libegl-icd ?= "mesa"
 PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libglx-icd ?= "mesa"
 PREFERRED_PROVIDER_virtual/libgl-native ?= "mesa-native"
 PREFERRED_PROVIDER_virtual/nativesdk-libgl ?= "nativesdk-mesa"
 PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
@@ -68,4 +66,6 @@ PREFERRED_RPROVIDER_initd-functions ?= "initscripts"
 PREFERRED_PROVIDER_nativesdk-mesa ?= "nativesdk-mesa"
 PREFERRED_PROVIDER_virtual/nativesdk-libsdl2 ?= "nativesdk-libsdl2"
 
+PREFERRED_RPROVIDER_virtual-libegl-icd ?= "mesa"
+PREFERRED_RPROVIDER_virtual-libglx-icd ?= "mesa"
 PREFERRED_RPROVIDER_virtual-x-terminal-emulator ?= "rxvt-unicode"
Signature · 1 line
2.39.5
#2 lore raw

PATCH v4 3/8 qemux86: drop duplicates with qemu.inc

In reply to Dmitry Baryshkov

qemu.inc already includes PREFERRED_PROVIDER values for xserver and GL libraries. Drop the same values being set in the machine config.

---
 meta/conf/machine/qemux86.conf | 6 ------
 1 file changed, 6 deletions(-)
meta/conf/machine/qemux86.conf +0 -6
index 1e072e1ae285..51f080bd2a51 100644
@@ -2,12 +2,6 @@
 #@NAME: QEMU x86 machine
 #@DESCRIPTION: Machine configuration for running an x86 system on QEMU
 
-PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
-PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa"
-
 require conf/machine/include/qemu.inc
 DEFAULTTUNE ?= "core2-32"
 require conf/machine/include/x86/tune-corei7.inc
Signature · 1 line
2.39.5
#3 lore raw

RE: [OE-core] [PATCH v4 3/8] qemux86: drop duplicates with qemu.inc

Quoted 10 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Dmitry Baryshkov via lists.openembedded.org
Sent: den 18 juni 2025 11:46
To: [email protected]
Subject: [OE-core] [PATCH v4 3/8] qemux86: drop duplicates with qemu.inc

qemu.inc already includes PREFERRED_PROVIDER values for xserver and GL libraries. Drop the same values being set in the machine config.

The subject and commit message for this and the next commit should be updated to reflect that the duplicates are in default-providers.inc rather than qemu.inc.

//Peter

Quoted 23 lines
---
 meta/conf/machine/qemux86.conf | 6 ------
 1 file changed, 6 deletions(-)
meta/conf/machine/qemux86.conf +0 -7
index 1e072e1ae285..51f080bd2a51 100644
@@ -2,12 +2,6 @@
 #@NAME: QEMU x86 machine
 #@DESCRIPTION: Machine configuration for running an x86 system on QEMU
 
-PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
-PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa"
-
 require conf/machine/include/qemu.inc
 DEFAULTTUNE ?= "core2-32"
 require conf/machine/include/x86/tune-corei7.inc
--

2.39.5

#4 lore raw

Re: [OE-core] [PATCH v4 3/8] qemux86: drop duplicates with qemu.inc

Quoted 7 lines · Peter Kjellerstedt
Quoted 7 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Dmitry Baryshkov via lists.openembedded.org
Sent: den 18 juni 2025 11:46
To: [email protected]
Subject: [OE-core] [PATCH v4 3/8] qemux86: drop duplicates with qemu.inc

Quoted 8 lines
Quoted 4 lines

qemu.inc already includes PREFERRED_PROVIDER values for xserver and GL libraries. Drop the same values being set in the machine config.

The subject and commit message for this and the next commit should be updated to reflect that the duplicates are in default-providers.inc rather than qemu.inc.

When this patch is being applied, the duplicates are present in both places. But I see your logic, let me send an update.

Quoted 27 lines

//Peter

Quoted 23 lines
---
 meta/conf/machine/qemux86.conf | 6 ------
 1 file changed, 6 deletions(-)
meta/conf/machine/qemux86.conf +0 -7
index 1e072e1ae285..51f080bd2a51 100644
@@ -2,12 +2,6 @@
 #@NAME: QEMU x86 machine
 #@DESCRIPTION: Machine configuration for running an x86 system on QEMU
 
-PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
-PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa"
-
 require conf/machine/include/qemu.inc
 DEFAULTTUNE ?= "core2-32"
 require conf/machine/include/x86/tune-corei7.inc
--

2.39.5

Signature · 2 lines
With best wishes
Dmitry
#5 lore raw

PATCH v4 4/8 qemux86-64: drop duplicates with qemu.inc

In reply to Dmitry Baryshkov

qemu.inc already includes PREFERRED_PROVIDER values for xserver and GL libraries. Drop the same values being set in the machine config.

---
 meta/conf/machine/qemux86-64.conf | 6 ------
 1 file changed, 6 deletions(-)
meta/conf/machine/qemux86-64.conf +0 -6
index 4a9c6d364bea..62108b703b69 100644
@@ -2,12 +2,6 @@
 #@NAME: QEMU x86-64 machine
 #@DESCRIPTION: Machine configuration for running an x86-64 system on QEMU
 
-PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
-PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa"
-
 require conf/machine/include/qemu.inc
 DEFAULTTUNE ?= "core2-64"
 require conf/machine/include/x86/tune-x86-64-v3.inc
Signature · 1 line
2.39.5
#6 lore raw

PATCH v4 5/8 qemu.inc: drop duplicates with default-providers.inc

In reply to Dmitry Baryshkov

default-providers.inc already includes PREFERRED_PROVIDER values for xserver and GL libraries. Drop the same values being set in the machine config.

---
 meta/conf/machine/include/qemu.inc | 7 -------
 1 file changed, 7 deletions(-)
meta/conf/machine/include/qemu.inc +0 -7
index d7392d476238..c143e37f710e 100644
@@ -1,10 +1,3 @@
-PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
-PREFERRED_PROVIDER_virtual/egl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa"
-
 XSERVER ?= "xserver-xorg \
             ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \
             xf86-video-fbdev \
Signature · 1 line
2.39.5
#7 lore raw

PATCH v4 6/8 libglvnd: migrate from meta-oe

In reply to Dmitry Baryshkov

libglvnd is a vendor-neutral approach to handling OpenGL / OpenGL ES / EGL / GLX libraries. It has been proposed and initially implemented by NVIDIA in order to simplify coinstallation of GL drivers provided by different vendors. Major Linux distributions (Debian, Ubuntu, Fedora, etc.) have already switched to libglvnd.

Having libglvnd in OE-Core simplifies integration of this ABI into distro and BSP layers (e.g. it will help meta-tegra, which currently provides its own version of the recipe).

Import recipe for libglvnd from the meta-oe layer (changes: fix virtual package names, add add the SUMMARY data, drop git@ from SRC_URI, require glvnd DISTRO_FEATURE).

---
 meta/conf/distro/include/maintainers.inc      |  1 +
 .../libglvnd/libglvnd_1.7.0.bb                | 39 +++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb
meta/conf/distro/include/maintainers.inc +1 -0
index b6cf4b7cfae9..ba2e9a527597 100644
@@ -353,6 +353,7 @@ RECIPE_MAINTAINER:pn-libgcrypt = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER:pn-libgfortran = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-libgit2 = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-libgloss = "Alejandro Hernandez <[email protected]>"
+RECIPE_MAINTAINER:pn-libglvnd = "Dmitry Baryshkov <[email protected]>"
 RECIPE_MAINTAINER:pn-libglu = "Ross Burton <[email protected]>"
 RECIPE_MAINTAINER:pn-libgpg-error = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER:pn-libgudev = "Ross Burton <[email protected]>"
meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb new file +39 -0
new file mode 100644
index 000000000000..d2a4b2dc51d9
@@ -0,0 +1,39 @@
+SUMMARY = "the GL Vendor-Neutral Dispatch library"
+DESCRIPTION = "libglvnd is a vendor-neutral dispatch layer for arbitrating \
+OpenGL API calls between multiple vendors."
+HOMEPAGE = "https://gitlab.freedesktop.org/glvnd/libglvnd"
+LICENSE = "MIT & BSD-1-Clause & BSD-3-Clause & GPL-3.0-with-autoconf-exception"
+LIC_FILES_CHKSUM = "file://README.md;beginline=323;md5=7ac5f0111f648b92fe5427efeb08e8c4"
+
+SRC_URI = "git://gitlab.freedesktop.org/glvnd/libglvnd.git;protocol=https;branch=master"
+
+SRCREV = "faa23f21fc677af5792825dc30cb1ccef4bf33a6"
+
+REQUIRED_DISTRO_FEATURES = "opengl glvnd"
+
+inherit meson pkgconfig features_check
+
+S = "${WORKDIR}/git"
+
+PACKAGECONFIG ?= "\
+  ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+  ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'egl gles1 gles2', '', d)} \
+  ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)} \
+  "
+
+PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,libx11 libxext xorgproto"
+PACKAGECONFIG[glx] = "-Dglx=enabled,-Dglx=disabled,libx11 libxext xorgproto,,virtual-libglx-icd"
+PACKAGECONFIG[egl] = "-Degl=true,-Degl=false,,virtual-libegl-icd"
+PACKAGECONFIG[gles1] = "-Dgles1=true,-Dgles1=false,"
+PACKAGECONFIG[gles2] = "-Dgles2=true,-Dgles2=false,"
+
+BBCLASSEXTEND = "native nativesdk"
+
+PROVIDES = " \
+    ${@bb.utils.contains('PACKAGECONFIG', 'glx', 'virtual/libgl', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'gles1', 'virtual/libgles1', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'gles2', 'virtual/libgles2 virtual/libgles3', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \
+"
+
+RPROVIDES:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'egl', 'libegl', '', d)}"
Signature · 1 line
2.39.5
#8 lore raw

PATCH v4 7/8 mesa: enable glvnd if it is enabled in DISTRO_FEATURES

In reply to Dmitry Baryshkov

Let the distro to be a central authority regarding GLVND feature. Make mesa.inc enable glvnd PACKAGECONFIG if it is enabled in DISTRO_FEATURES.

---
 meta/recipes-graphics/mesa/mesa.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/mesa/mesa.inc +1 -1
index a583edc57f6f..99047c798607 100644
@@ -85,7 +85,7 @@ def strip_comma(s):
 PACKAGECONFIG = " \
 	gallium \
 	video-codecs \
-	${@bb.utils.filter('DISTRO_FEATURES', 'x11 vulkan wayland', d)} \
+	${@bb.utils.filter('DISTRO_FEATURES', 'x11 vulkan wayland glvnd', d)} \
 	${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm virgl', '', d)} \
 	${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'zink', '', d)} \
 "
Signature · 1 line
2.39.5
#9 lore raw

PATCH v4 8/8 default-providers: handle GLVND-related providers

In reply to Dmitry Baryshkov

If GLVND is enabled, then libglvnd is providing all OpenGL / ES libraries. Tune default-providers.inc to select a correct package in this case.

---
 meta/conf/distro/include/default-providers.inc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
meta/conf/distro/include/default-providers.inc +7 -7
index 274ad0c4f630..3f113543cd9c 100644
@@ -6,13 +6,13 @@ PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
 PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg"
 PREFERRED_PROVIDER_virtual/libsdl2 ?= "libsdl2"
 PREFERRED_PROVIDER_virtual/libsdl2-native ?= "libsdl2-native"
-PREFERRED_PROVIDER_virtual/egl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgl-native ?= "mesa-native"
-PREFERRED_PROVIDER_virtual/nativesdk-libgl ?= "nativesdk-mesa"
-PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
-PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa"
+PREFERRED_PROVIDER_virtual/egl ?= "${@bb.utils.contains('DISTRO_FEATURES','glvnd','libglvnd','mesa',d)}"
+PREFERRED_PROVIDER_virtual/libgl ?= "${@bb.utils.contains('DISTRO_FEATURES', 'glvnd', 'libglvnd', 'mesa',d)}"
+PREFERRED_PROVIDER_virtual/libgl-native ?= "${@bb.utils.contains('DISTRO_FEATURES', 'glvnd', 'libglvnd-native', 'mesa-native',d)}"
+PREFERRED_PROVIDER_virtual/nativesdk-libgl ?= "${@bb.utils.contains('DISTRO_FEATURES', 'glvnd', 'nativesdk-libglvnd', 'nativesdk-mesa',d)}"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "${@bb.utils.contains('DISTRO_FEATURES', 'glvnd', 'libglvnd', 'mesa',d)}"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "${@bb.utils.contains('DISTRO_FEATURES', 'glvnd', 'libglvnd', 'mesa',d)}"
+PREFERRED_PROVIDER_virtual/libgles3 ?= "${@bb.utils.contains('DISTRO_FEATURES', 'glvnd', 'libglvnd', 'mesa',d)}"
 PREFERRED_PROVIDER_virtual/mesa ?= "mesa"
 PREFERRED_PROVIDER_virtual/update-alternatives ?= "opkg-utils"
 PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-utils-native"
Signature · 1 line
2.39.5