diff mbox series

[v2,3/3] libglvnd: migrate from meta-oe

Message ID 20250613120358.2011626-3-dmitry.baryshkov@oss.qualcomm.com
State Accepted, archived
Commit 621e9be9663e448dde3f6b6a02b413fd65983e6c
Headers show
Series [v2,1/3] mesa: fix RPROVIDEd package names | expand

Commit Message

Dmitry Baryshkov June 13, 2025, 12:03 p.m. UTC
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).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 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

Comments

Mathieu Dubois-Briand June 14, 2025, 1:11 p.m. UTC | #1
On Fri Jun 13, 2025 at 2:03 PM CEST, Dmitry Baryshkov via lists.openembedded.org wrote:
> 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).
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---

Hi Dmitry,

Thanks for your patch.

> +PACKAGECONFIG[glx] = "-Dglx=enabled,-Dglx=disabled,libx11 libxext xorgproto,,virtual-libglx-icd"

It looks like this dependency is not present in oe-core:

WARNING: Nothing RPROVIDES 'nativesdk-virtual-libglx-icd' (but virtual:nativesdk:/srv/pokybuild/yocto-worker/a-full/build/meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb RDEPENDS on or otherwise requires it)

https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/1799/steps/13/logs/stdio
Dmitry Baryshkov June 15, 2025, 2:43 p.m. UTC | #2
On Sat, Jun 14, 2025 at 03:11:03PM +0200, Mathieu Dubois-Briand wrote:
> On Fri Jun 13, 2025 at 2:03 PM CEST, Dmitry Baryshkov via lists.openembedded.org wrote:
> > 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).
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > ---
> 
> Hi Dmitry,
> 
> Thanks for your patch.
> 
> > +PACKAGECONFIG[glx] = "-Dglx=enabled,-Dglx=disabled,libx11 libxext xorgproto,,virtual-libglx-icd"
> 
> It looks like this dependency is not present in oe-core:
> 
> WARNING: Nothing RPROVIDES 'nativesdk-virtual-libglx-icd' (but virtual:nativesdk:/srv/pokybuild/yocto-worker/a-full/build/meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb RDEPENDS on or otherwise requires it)

I see. I had a plan to convert glvnd to DISTRO_FEATURE later, but let's
include it in, so that we can block glvnd globally.

> 
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/1799/steps/13/logs/stdio
> 
> -- 
> Mathieu Dubois-Briand, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> 
>
diff mbox series

Patch

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 5c315d58cf56..dbe9623de1dd 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -353,6 +353,7 @@  RECIPE_MAINTAINER:pn-libgcrypt = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER:pn-libgfortran = "Khem Raj <raj.khem@gmail.com>"
 RECIPE_MAINTAINER:pn-libgit2 = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-libgloss = "Alejandro Hernandez <alejandro@enedino.org>"
+RECIPE_MAINTAINER:pn-libglvnd = "Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>"
 RECIPE_MAINTAINER:pn-libglu = "Ross Burton <ross.burton@arm.com>"
 RECIPE_MAINTAINER:pn-libgpg-error = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER:pn-libgudev = "Ross Burton <ross.burton@arm.com>"
diff --git a/meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb b/meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb
new file mode 100644
index 000000000000..aefe62001148
--- /dev/null
+++ b/meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb
@@ -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"
+
+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)}"