diff mbox series

[meta-arago,scarthgap/master,PATCHv2] mesa-demos: add a git version

Message ID 20250508211009.1576476-1-rs@ti.com
State New
Headers show
Series [meta-arago,scarthgap/master,PATCHv2] mesa-demos: add a git version | expand

Commit Message

Randolph Sapp May 8, 2025, 9:10 p.m. UTC
From: Randolph Sapp <rs@ti.com>

Add a newer git version of this package to fetch modifications that
allow us to build the EGL and GLES specific demos without the hard
Desktop GL and X11 dependencies.

These modification have not made it into a tag yet, but this recipe can
be removed once oe-core's version of the package passes
02eae079cb0b8186064d5b194ca4cc2995f099ee.

Set this git recipe as the preferred version when using the arago
distro.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 .../conf/distro/include/arago-prefs.inc       |  3 ++
 .../recipes-graphics/mesa/mesa-demos_git.bb   | 43 +++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 meta-arago-distro/recipes-graphics/mesa/mesa-demos_git.bb
diff mbox series

Patch

diff --git a/meta-arago-distro/conf/distro/include/arago-prefs.inc b/meta-arago-distro/conf/distro/include/arago-prefs.inc
index 69bae7d7..98aa2552 100644
--- a/meta-arago-distro/conf/distro/include/arago-prefs.inc
+++ b/meta-arago-distro/conf/distro/include/arago-prefs.inc
@@ -17,3 +17,6 @@  PREFERRED_PROVIDER_nativesdk-llvm = "nativesdk-clang"
 PROVIDES:pn-clang = "llvm"
 PROVIDES:pn-clang-native = "llvm-native"
 PROVIDES:pn-nativesdk-clang = "nativesdk-llvm"
+
+# Bump mesa-demos to include some patches not in a tagged release
+PREFERRED_VERSION_mesa-demos = "9.0.0+git"
diff --git a/meta-arago-distro/recipes-graphics/mesa/mesa-demos_git.bb b/meta-arago-distro/recipes-graphics/mesa/mesa-demos_git.bb
new file mode 100644
index 00000000..a18d212e
--- /dev/null
+++ b/meta-arago-distro/recipes-graphics/mesa/mesa-demos_git.bb
@@ -0,0 +1,43 @@ 
+SUMMARY = "Mesa demo applications"
+DESCRIPTION = "This package includes the demonstration application, such as glxgears. \
+These applications can be used for Mesa validation and benchmarking."
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+
+LICENSE = "MIT & PD"
+LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=a481fbdb2ac800ecb12405c33bcfacae \
+                    file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06"
+
+SRC_URI = "git://gitlab.freedesktop.org/mesa/demos.git;protocol=https;branch=main"
+SRCREV = "02eae079cb0b8186064d5b194ca4cc2995f099ee"
+S = "${WORKDIR}/git"
+
+DEFAULT_PREFERENCE = "-1"
+PV = "9.0.0+git"
+
+inherit meson pkgconfig features_check
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+EXTRA_OEMESON = "-Dwith-system-data-files=true"
+
+PACKAGECONFIG ?= "drm egl gles1 gles2 \
+                  ${@bb.utils.filter('DISTRO_FEATURES', 'vulkan x11 wayland', d)}"
+
+PACKAGECONFIG[drm] = "-Dlibdrm=enabled,-Dlibdrm=disabled,libdrm"
+PACKAGECONFIG[egl] = "-Degl=enabled,-Degl=disabled,virtual/egl"
+PACKAGECONFIG[gles1] = "-Dgles1=enabled,-Dgles1=disabled,virtual/libgles1"
+PACKAGECONFIG[gles2] = "-Dgles2=enabled,-Dgles2=disabled,virtual/libgles2"
+PACKAGECONFIG[glut] = "-Dwith-glut=${STAGING_EXECPREFIXDIR},-Dglut=disabled,freeglut"
+PACKAGECONFIG[osmesa] = "-Dosmesa=enabled,-Dosmesa=disabled,"
+PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,vulkan-loader glslang-native"
+PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,virtual/libgl wayland wayland-native wayland-protocols libxkbcommon libdecor"
+PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 libglu libxkbcommon libxcb"
+
+do_install:append() {
+	# it can be completely empty when all PACKAGECONFIG options are disabled
+	rmdir --ignore-fail-on-non-empty ${D}${bindir}
+
+	if [ -f ${D}${bindir}/clear ]; then
+		mv ${D}${bindir}/clear ${D}${bindir}/clear.mesa-demos
+	fi
+}