* [PATCH 2/5] mesa: drop the libopencl-mesa-dev package
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 ` Dmitry Baryshkov
2025-05-20 17:45 ` [PATCH 3/5] mesa: don't add extra tags to the libopencl-mesa package Dmitry Baryshkov
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2025-05-20 17:45 UTC (permalink / raw)
To: openembedded-core
Thre is no "development" package for libopencl-mesa. The main package
contains Installable Client Drivers, for which there are no headers and
the extra .so file isn't supposed to be linked with anything.
Drop the useless and confusing libopencl-mesa-dev package.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
meta/recipes-graphics/mesa/mesa.inc | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 89ae71595991..02e502e58737 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -261,7 +261,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \
libgles1-mesa libgles1-mesa-dev \
libgles2-mesa libgles2-mesa-dev \
libgles3-mesa libgles3-mesa-dev \
- libopencl-mesa libopencl-mesa-dev \
+ libopencl-mesa \
libxatracker libxatracker-dev \
mesa-megadriver mesa-vulkan-drivers \
mesa-vdpau-drivers mesa-tools \
@@ -349,7 +349,7 @@ FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
FILES:libgl-mesa = "${libdir}/libGL.so.*"
FILES:libglx-mesa = "${libdir}/libGLX*.so.*"
-FILES:libopencl-mesa = "${libdir}/lib*OpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/*.icd"
+FILES:libopencl-mesa = "${libdir}/lib*OpenCL.so* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/*.icd"
FILES:libglapi = "${libdir}/libglapi.so.*"
FILES:libosmesa = "${libdir}/libOSMesa.so.*"
FILES:libxatracker = "${libdir}/libxatracker.so.*"
@@ -363,7 +363,6 @@ FILES:libglapi-dev = "${libdir}/libglapi.*"
FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
FILES:libgles3-mesa-dev = "${includedir}/GLES3"
-FILES:libopencl-mesa-dev = "${libdir}/lib*OpenCL.so"
FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
@@ -375,6 +374,9 @@ ALLOW_EMPTY:${PN}-tools = "1"
# All DRI drivers are symlinks to libdril_dri.so
INSANE_SKIP:${PN}-megadriver += "dev-so"
+# OpenCL ICDs package also ship correspondig .so files, there is no -dev package
+INSANE_SKIP:libopencl-mesa += "dev-so"
+
# Fix upgrade path from mesa to mesa-megadriver
RREPLACES:mesa-megadriver = "mesa"
RCONFLICTS:mesa-megadriver = "mesa"
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 3/5] mesa: don't add extra tags to the libopencl-mesa package
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 ` Dmitry Baryshkov
2025-05-20 17:45 ` [PATCH 4/5] mesa: don't set RCONFLICTS / PROVIDES if glvnd is enabled Dmitry Baryshkov
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2025-05-20 17:45 UTC (permalink / raw)
To: openembedded-core
The libopencl-mesa package provides OpenCL ICDs (Installable Client
Drivers). As such, there is no conflict between several packages
providing ICDs for different vendors. Split the loop that modifies
package metadata and stop adding extra RPROVIDES / RCONFLICTS /
RREPLACES tags to the libopencl-mesa package.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
meta/recipes-graphics/mesa/mesa.inc | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 02e502e58737..fdebae7977e4 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -278,29 +278,32 @@ do_install:append () {
# RPROVIDEs/RCONFLICTs on the generic libgl name.
python __anonymous() {
pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
+ mlprefix = d.getVar("MLPREFIX")
suffix = ""
if "-native" in d.getVar("PN"):
suffix = "-native"
+
+ for p in ("libegl", "libgl", "libglx", "libgles1", "libgles2", "libgles3", "libopencl"):
+ fullp = mlprefix + p[1] + "-mesa" + suffix
+ d.appendVar("RRECOMMENDS:" + fullp, " ${MLPREFIX}mesa-megadriver" + suffix)
+
+ d.setVar("DEBIAN_NOAUTONAME:%slibopencl-mesa%s" % (mlprefix, suffix), "1")
+
for p in (("egl", "libegl", "libegl1"),
("opengl", "libgl", "libgl1"),
("glvnd", "libglx",),
("gles", "libgles1", "libglesv1-cm1"),
("gles", "libgles2", "libglesv2-2"),
- ("gles", "libgles3",),
- ("opencl", "libopencl",)):
+ ("gles", "libgles3",)):
if not p[0] in pkgconfig:
continue
- mlprefix = d.getVar("MLPREFIX")
fullp = mlprefix + p[1] + "-mesa" + suffix
- mlprefix = d.getVar("MLPREFIX")
pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:])
d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
d.appendVar("RREPLACES:" + fullp, pkgs)
d.appendVar("RPROVIDES:" + fullp, pkgs)
d.appendVar("RCONFLICTS:" + fullp, pkgs)
- d.appendVar("RRECOMMENDS:" + fullp, " ${MLPREFIX}mesa-megadriver" + suffix)
-
# For -dev, the first element is both the Debian and original name
fullp = mlprefix + p[1] + "-mesa-dev" + suffix
pkgs = " " + mlprefix + p[1] + "-dev" + suffix
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 4/5] mesa: don't set RCONFLICTS / PROVIDES if glvnd is enabled
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 ` Dmitry Baryshkov
2025-05-20 17:45 ` [PATCH 5/5] mesa: sort out PROVIDES for the glvnd case Dmitry Baryshkov
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
4 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2025-05-20 17:45 UTC (permalink / raw)
To: openembedded-core
If glvnd is enabled, mesa packages do not provide full library
implementations (instead it provides two ICDs, one for EGL, one for
GLX). This means that there is no more conflict between mesa packages
and other vendor packages. Stop setting those extra tags for mesa
packages.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
meta/recipes-graphics/mesa/mesa.inc | 44 ++++++++++++++---------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index fdebae7977e4..53f77b98c898 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -289,28 +289,28 @@ python __anonymous() {
d.setVar("DEBIAN_NOAUTONAME:%slibopencl-mesa%s" % (mlprefix, suffix), "1")
- for p in (("egl", "libegl", "libegl1"),
- ("opengl", "libgl", "libgl1"),
- ("glvnd", "libglx",),
- ("gles", "libgles1", "libglesv1-cm1"),
- ("gles", "libgles2", "libglesv2-2"),
- ("gles", "libgles3",)):
- if not p[0] in pkgconfig:
- continue
- fullp = mlprefix + p[1] + "-mesa" + suffix
- pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:])
- d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
- d.appendVar("RREPLACES:" + fullp, pkgs)
- d.appendVar("RPROVIDES:" + fullp, pkgs)
- d.appendVar("RCONFLICTS:" + fullp, pkgs)
-
- # For -dev, the first element is both the Debian and original name
- fullp = mlprefix + p[1] + "-mesa-dev" + suffix
- pkgs = " " + mlprefix + p[1] + "-dev" + suffix
- d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
- d.appendVar("RREPLACES:" + fullp, pkgs)
- d.appendVar("RPROVIDES:" + fullp, pkgs)
- d.appendVar("RCONFLICTS:" + fullp, pkgs)
+ if 'glvnd' not in pkgconfig:
+ for p in (("egl", "libegl", "libegl1"),
+ ("opengl", "libgl", "libgl1"),
+ ("gles", "libgles1", "libglesv1-cm1"),
+ ("gles", "libgles2", "libglesv2-2"),
+ ("gles", "libgles3",)):
+ if not p[0] in pkgconfig:
+ continue
+ fullp = mlprefix + p[1] + "-mesa" + suffix
+ pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:])
+ d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
+ d.appendVar("RREPLACES:" + fullp, pkgs)
+ d.appendVar("RPROVIDES:" + fullp, pkgs)
+ d.appendVar("RCONFLICTS:" + fullp, pkgs)
+
+ # For -dev, the first element is both the Debian and original name
+ fullp = mlprefix + p[1] + "-mesa-dev" + suffix
+ pkgs = " " + mlprefix + p[1] + "-dev" + suffix
+ d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
+ d.appendVar("RREPLACES:" + fullp, pkgs)
+ d.appendVar("RPROVIDES:" + fullp, pkgs)
+ d.appendVar("RCONFLICTS:" + fullp, pkgs)
}
python mesa_populate_packages() {
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 5/5] mesa: sort out PROVIDES for the glvnd case
2025-05-20 17:45 [PATCH 1/5] mesa: don't build empty libgles3-mesa in GLVND case Dmitry Baryshkov
` (2 preceding siblings ...)
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
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
4 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2025-05-20 17:45 UTC (permalink / raw)
To: openembedded-core
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
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [OE-core] [PATCH 1/5] mesa: don't build empty libgles3-mesa in GLVND case
2025-05-20 17:45 [PATCH 1/5] mesa: don't build empty libgles3-mesa in GLVND case Dmitry Baryshkov
` (3 preceding siblings ...)
2025-05-20 17:45 ` [PATCH 5/5] mesa: sort out PROVIDES for the glvnd case Dmitry Baryshkov
@ 2025-05-21 9:03 ` Böszörményi Zoltán
2025-05-21 13:51 ` Dmitry Baryshkov
4 siblings, 1 reply; 7+ messages in thread
From: Böszörményi Zoltán @ 2025-05-21 9:03 UTC (permalink / raw)
To: dmitry.baryshkov, openembedded-core
2025. 05. 20. 19:45 keltezéssel, Dmitry Baryshkov via lists.openembedded.org írta:
> If GLVND is enabled, there is no libgles2-mesa package to depend on
> libgles3-mesa. Stop building unused empty package in this case.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> meta/recipes-graphics/mesa/mesa.inc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
> index 288027bbb996..89ae71595991 100644
> --- a/meta/recipes-graphics/mesa/mesa.inc
> +++ b/meta/recipes-graphics/mesa/mesa.inc
> @@ -247,7 +247,7 @@ RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
> # GLES2 and GLES3 implementations are packaged in a single library in libgles2-mesa.
> # Add a dependency so the GLES3 dev package is associated with its implementation.
> RDEPENDS:libgles2-mesa += "libgles3-mesa"
> -ALLOW_EMPTY:libgles3-mesa = "1"
> +ALLOW_EMPTY:libgles3-mesa = "${@bb.utils.contains('PACKAGECONFIG', 'glvnd', '', '1', d)}"
Why not merge the two packages instead?
The GLES implementation in Mesa includes both 2.x and 3.x,
regardless of being standalone lib or ICD.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [OE-core] [PATCH 1/5] mesa: don't build empty libgles3-mesa in GLVND case
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
0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2025-05-21 13:51 UTC (permalink / raw)
To: Böszörményi Zoltán; +Cc: openembedded-core
On Wed, May 21, 2025 at 11:03:15AM +0200, Böszörményi Zoltán wrote:
> 2025. 05. 20. 19:45 keltezéssel, Dmitry Baryshkov via lists.openembedded.org írta:
> > If GLVND is enabled, there is no libgles2-mesa package to depend on
> > libgles3-mesa. Stop building unused empty package in this case.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > ---
> > meta/recipes-graphics/mesa/mesa.inc | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
> > index 288027bbb996..89ae71595991 100644
> > --- a/meta/recipes-graphics/mesa/mesa.inc
> > +++ b/meta/recipes-graphics/mesa/mesa.inc
> > @@ -247,7 +247,7 @@ RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
> > # GLES2 and GLES3 implementations are packaged in a single library in libgles2-mesa.
> > # Add a dependency so the GLES3 dev package is associated with its implementation.
> > RDEPENDS:libgles2-mesa += "libgles3-mesa"
> > -ALLOW_EMPTY:libgles3-mesa = "1"
> > +ALLOW_EMPTY:libgles3-mesa = "${@bb.utils.contains('PACKAGECONFIG', 'glvnd', '', '1', d)}"
>
> Why not merge the two packages instead?
> The GLES implementation in Mesa includes both 2.x and 3.x,
> regardless of being standalone lib or ICD.
Might be a good idea, indeed.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread