summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2025-04-14 20:22:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-04-23 19:48:04 +0100
commit58776612f034bebead799f0063f98129f5318c45 (patch)
tree7c862b76a6d4916cb0dbbd3c48da7b24ee8a5fd5
parent62689ff1fb95057be7b76a670feca4b4a4f3c39d (diff)
downloadpoky-58776612f034bebead799f0063f98129f5318c45.tar.gz
mesa-demos: fix detection of GLX headers
Backport a patch from upstream to fix the build when glx.pc isn't found, but the glx headers are available. As libglvnd is the only provider of glx.pc and by default we build without libglvnd, this is common. This solves the problem where mesa-demo is missing the GLX demos, such as glxgears. [ YOCTO #15825 ] (From OE-Core rev: 466c01cb1ec9ad2a13dc12b5fa7276b9b450266e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0001-meson-fix-glx-detection-without-glvnd.patch46
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb1
2 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0001-meson-fix-glx-detection-without-glvnd.patch b/meta/recipes-graphics/mesa/mesa-demos/0001-meson-fix-glx-detection-without-glvnd.patch
new file mode 100644
index 0000000000..f16ba4a24c
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0001-meson-fix-glx-detection-without-glvnd.patch
@@ -0,0 +1,46 @@
1From e16117fc92688d76a042ad2c590c77d5a987a4ac Mon Sep 17 00:00:00 2001
2From: Erik Faye-Lund <erik.faye-lund@collabora.com>
3Date: Fri, 24 Mar 2023 13:31:58 +0100
4Subject: [PATCH] meson: fix glx-detection without glvnd
5
6When build without GLVND, Mesa provides GLX as a part of libGL, just
7like XQuartz does on MacOS. There's nothing really macOS specific about
8this fallback, so let's drop the condition.
9
10And just for good measure, let's add in dep_gl as a dependency for
11the header-check here, in case some one decides to install libGL outside
12of the default include directory.
13
14Fixes: 34300551 ("meson: explicitly check for glx dependency")
15Closes: https://gitlab.freedesktop.org/mesa/demos/-/issues/36
16Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
17
18Upstream-Status: Backport
19Signed-off-by: Ross Burton <ross.burton@arm.com>
20---
21 meson.build | 9 +++++----
22 1 file changed, 5 insertions(+), 4 deletions(-)
23
24diff --git a/meson.build b/meson.build
25index c1853f94..bc3278e1 100644
26--- a/meson.build
27+++ b/meson.build
28@@ -99,10 +99,11 @@ if not dep_glu.found() and host_machine.system() != 'darwin'
29 endif
30
31 dep_glx = dependency('glx', required: false, disabler : true)
32-if not dep_glx.found() and host_machine.system() == 'darwin'
33- # xquartz doesn't have a glx.pc, but it does have the header. And all the
34- # symbols reside in libGL, so let's just use that.
35- if cc.check_header('GL/glx.h', dependencies: dep_x11)
36+if not dep_glx.found()
37+ # Both Mesa build without GLVND and XQuartz lacks a glx.pc, but does
38+ # provide the header. And all the symbols reside in libGL, so let's
39+ # just use that.
40+ if cc.check_header('GL/glx.h', dependencies: [dep_x11, dep_gl])
41 dep_glx = dep_gl
42 endif
43 endif
44--
452.43.0
46
diff --git a/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb b/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb
index 0301b55361..d92f1ddc5b 100644
--- a/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb
+++ b/meta/recipes-graphics/mesa/mesa-demos_9.0.0.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=9142
10 file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06" 10 file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06"
11 11
12SRC_URI = "https://archive.mesa3d.org/demos/${BPN}-${PV}.tar.xz \ 12SRC_URI = "https://archive.mesa3d.org/demos/${BPN}-${PV}.tar.xz \
13 file://0001-meson-fix-glx-detection-without-glvnd.patch \
13 " 14 "
14SRC_URI[sha256sum] = "3046a3d26a7b051af7ebdd257a5f23bfeb160cad6ed952329cdff1e9f1ed496b" 15SRC_URI[sha256sum] = "3046a3d26a7b051af7ebdd257a5f23bfeb160cad6ed952329cdff1e9f1ed496b"
15 16