Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 5/5] mesa: sort out PROVIDES for the glvnd case
Date: Tue, 20 May 2025 20:45:29 +0300	[thread overview]
Message-ID: <20250520174529.1173460-5-dmitry.baryshkov@oss.qualcomm.com> (raw)
In-Reply-To: <20250520174529.1173460-1-dmitry.baryshkov@oss.qualcomm.com>

If mesa is built with GLVND enabled, it doesn't provide GL / GL ES / EGL
libraries directly. Instead it provides two ICD libraries: libEGL_mesa.0
and libGLX_mesa.so.0. Remove virtual provides from the glvnd case
(dropping incorrect virtual/libglx provider while we are at it) and
replace those with runtime providers (to be used by libglvnd in order to
pull corresponding ICDs).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 meta/conf/distro/include/default-providers.inc |  3 ++-
 meta/recipes-graphics/mesa/mesa.inc            | 12 +++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index ee91af87968f..4f094163546c 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -7,8 +7,9 @@ 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 ?= "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"
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 53f77b98c898..dca706efec68 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -39,11 +39,13 @@ do_install:append() {
 
 DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native python3-pyyaml-native"
 EXTRANATIVEPATH += "chrpath-native"
-PROVIDES = " \
+GLPROVIDES = " \
     ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'glvnd', 'virtual/libglx', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \
+"
+PROVIDES = " \
+    ${@bb.utils.contains('PACKAGECONFIG', 'glvnd', '', d.getVar('GLPROVIDES'), d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \
     virtual/mesa \
     "
@@ -289,7 +291,11 @@ python __anonymous() {
 
     d.setVar("DEBIAN_NOAUTONAME:%slibopencl-mesa%s" % (mlprefix, suffix), "1")
 
-    if 'glvnd' not in pkgconfig:
+    if 'glvnd' in pkgconfig:
+        for p in ("libegl", "libglx"):
+            fullp = mlprefix + p + "-mesa" + suffix
+            d.appendVar("RPROVIDES:" + fullp, '%s-icd' % p)
+    else:
         for p in (("egl", "libegl", "libegl1"),
                   ("opengl", "libgl", "libgl1"),
                   ("gles", "libgles1", "libglesv1-cm1"),
-- 
2.39.5



  parent reply	other threads:[~2025-05-20 17:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-20 17:45 [PATCH 1/5] mesa: don't build empty libgles3-mesa in GLVND case Dmitry Baryshkov
2025-05-20 17:45 ` [PATCH 2/5] mesa: drop the libopencl-mesa-dev package Dmitry Baryshkov
2025-05-20 17:45 ` [PATCH 3/5] mesa: don't add extra tags to the libopencl-mesa package Dmitry Baryshkov
2025-05-20 17:45 ` [PATCH 4/5] mesa: don't set RCONFLICTS / PROVIDES if glvnd is enabled Dmitry Baryshkov
2025-05-20 17:45 ` Dmitry Baryshkov [this message]
2025-05-21  9:03 ` [OE-core] [PATCH 1/5] mesa: don't build empty libgles3-mesa in GLVND case Böszörményi Zoltán
2025-05-21 13:51   ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250520174529.1173460-5-dmitry.baryshkov@oss.qualcomm.com \
    --to=dmitry.baryshkov@oss.qualcomm.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox