From e9d69043cf065aacaca44dd584b41c8b3be8067f Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Fri, 20 Jun 2025 22:14:55 +0300 Subject: [PATCH] libglvnd: migrate from meta-oe 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). (From OE-Core rev: 621e9be9663e448dde3f6b6a02b413fd65983e6c) Signed-off-by: Dmitry Baryshkov Signed-off-by: Richard Purdie --- meta/conf/distro/include/maintainers.inc | 1 + meta/lib/oeqa/selftest/cases/distrodata.py | 2 +- .../libglvnd/libglvnd_1.7.0.bb | 39 +++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 870c81e85f..d94fb693e3 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 " RECIPE_MAINTAINER:pn-libgfortran = "Khem Raj " RECIPE_MAINTAINER:pn-libgit2 = "Unassigned " RECIPE_MAINTAINER:pn-libgloss = "Alejandro Hernandez " +RECIPE_MAINTAINER:pn-libglvnd = "Dmitry Baryshkov " RECIPE_MAINTAINER:pn-libglu = "Ross Burton " RECIPE_MAINTAINER:pn-libgpg-error = "Hongxu Jia " RECIPE_MAINTAINER:pn-libgudev = "Ross Burton " diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py b/meta/lib/oeqa/selftest/cases/distrodata.py index 1e88ea82e6..f2c6124d70 100644 --- a/meta/lib/oeqa/selftest/cases/distrodata.py +++ b/meta/lib/oeqa/selftest/cases/distrodata.py @@ -56,7 +56,7 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re def is_maintainer_exception(entry): exceptions = ["musl", "newlib", "picolibc", "linux-yocto", "linux-dummy", "mesa-gl", "libgfortran", "libx11-compose-data", - "cve-update-nvd2-native", "barebox"] + "cve-update-nvd2-native", "barebox", "libglvnd"] for i in exceptions: if i in entry: return True 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 0000000000..d2a4b2dc51 --- /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 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)}"