Skip to contentSkip to conversation

mesa: build fix for gallium-egl

dora Valentin Popa 1 participant 1 message Feb 27, 2014

lore
Share & tools
lore
#0 lore raw

(*) add MESA_EGL_NO_X11_HEADERS to defines
(*) avoid altering eglplatform.h from {top_srcdir}/include using an alternative to 0003-EGL-Mutate-NativeDisplayType-depending-on-config patch.

[YOCTO #5882]
---
 ...01-Add-MESA_EGL_NO_X11_HEADERS-to-defines.patch |  39 +++
 ...ate-NativeDisplayType-depending-on-config.patch | 359 ---------------------
 meta/recipes-graphics/mesa/mesa_9.1.6.bb           |  10 +-
 meta/recipes-graphics/mesa/mesa_git.bb             |  10 +-
 4 files changed, 57 insertions(+), 361 deletions(-)
 create mode 100644 meta/recipes-graphics/mesa/mesa/0001-Add-MESA_EGL_NO_X11_HEADERS-to-defines.patch
 delete mode 100644 meta/recipes-graphics/mesa/mesa/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch
meta/recipes-graphics/mesa/mesa/0001-Add-MESA_EGL_NO_X11_HEADERS-to-defines.patch new file +39 -0
new file mode 100644
index 0000000..ca38075
@@ -0,0 +1,39 @@
+From 63d5b4ec7a5853bbbae2e1963d406bb09e77dd60 Mon Sep 17 00:00:00 2001
+From: Valentin Popa <[email protected]>
+Date: Thu, 27 Feb 2014 10:32:17 +0200
+Subject: [PATCH] Add MESA_EGL_NO_X11_HEADERS to defines
+
+MESA_EGL_NO_X11_HEADERS is used in eglplatform.h
+but the preprocessor doesn't know about it.
+Define MESA_EGL_NO_X11_HEADERS for builds without
+x11 in DISTRO_FEATURES.
+
+Backport from 9.2.5.
+
+Signed-off-by: Valentin Popa <[email protected]>
+---
+ configure.ac | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 2acf579..a1a8487 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1568,6 +1568,14 @@ AC_SUBST([EGL_NATIVE_PLATFORM])
+ AC_SUBST([EGL_PLATFORMS])
+ AC_SUBST([EGL_CFLAGS])
+ 
++# If we don't have the X11 platform, set this define so we don't try
++# to include
++# the X11 headers.
++if ! echo "$egl_platforms" | grep -q 'x11'; then
++    DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
++    GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
++fi
++
+ AC_ARG_WITH([egl-driver-dir],
+     [AS_HELP_STRING([--with-egl-driver-dir=DIR],
+                     [directory for EGL drivers [[default=${libdir}/egl]]])],
+-- 
+1.8.3.2
+
meta/recipes-graphics/mesa/mesa/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch deleted +0 -359

359 lines not on this page · raw message

meta/recipes-graphics/mesa/mesa_9.1.6.bb +9 -1
index b55fa02..6e9cd82 100644
@@ -2,8 +2,8 @@ require ${BPN}.inc
 
 SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
            file://0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch \
+           file://0001-Add-MESA_EGL_NO_X11_HEADERS-to-defines.patch \
            file://0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch \
-           file://0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch \
            file://0004-glsl-fix-builtin_compiler-cross-compilation.patch \
            file://0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch \
            file://0005-fix-out-of-tree-builds-gallium.patch \
@@ -14,3 +14,11 @@ SRC_URI[md5sum] = "443a2a352667294b53d56cb1a74114e9"
 SRC_URI[sha256sum] = "e632dff0acafad0a59dc208d16dedb37f7bd58f94c5d58c4b51912e41d005e3d"
 
 S = "${WORKDIR}/Mesa-${PV}"
+
+#because we cannot rely on the fact that all apps will use pkgconfig,
+#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
+do_install_append() {
+    if ${@base_contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
+        sed -i -e 's/^#ifdef MESA_EGL_NO_X11_HEADERS/#if ${@base_contains('DISTRO_FEATURES', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+    fi
+}
\ No newline at end of file
meta/recipes-graphics/mesa/mesa_git.bb +9 -1
index 6397ece..1babcc0 100644
@@ -10,11 +10,19 @@ PV = "9.1.3+git${SRCPV}"
 
 SRC_URI = "git://anongit.freedesktop.org/git/mesa/mesa \
            file://0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch \
+           file://0001-Add-MESA_EGL_NO_X11_HEADERS-to-defines.patch \
            file://0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch \
-           file://0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch \
            file://0004-glsl-fix-builtin_compiler-cross-compilation.patch \
            file://0005-fix-out-of-tree-builds-gallium.patch \
            file://0006-fix-out-of-tree-egl.patch \
            "
 
 S = "${WORKDIR}/git"
+
+#because we cannot rely on the fact that all apps will use pkgconfig,
+#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
+do_install_append() {
+    if ${@base_contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
+        sed -i -e 's/^#ifdef MESA_EGL_NO_X11_HEADERS/#if ${@base_contains('DISTRO_FEATURES', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+    fi
+}
Signature · 1 line
1.8.3.2