Skip to contentSkip to conversation

mesa: double check for eglplatform.h

PATCH In review Valentin Popa 1 participant 2 messages Apr 14, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mesa: double check for eglplatform.h

Even if 'egl' is in PACKAGECONFIG, mesa egl support can be disabled explicitly (using a .bbappend, for example). This patch adds another check for the existence
of eglplatform.h before 'sed' can alter it.

---
 meta/recipes-graphics/mesa/mesa_9.1.6.bb | 4 +++-
 meta/recipes-graphics/mesa/mesa_git.bb   | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
meta/recipes-graphics/mesa/mesa_9.1.6.bb +3 -1
index 6e9cd82..388cfd7 100644
@@ -19,6 +19,8 @@ S = "${WORKDIR}/Mesa-${PV}"
 #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
+        if [ -e "${D}${includedir}/EGL/eglplatform.h" ]; 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
     fi
 }
\ No newline at end of file
meta/recipes-graphics/mesa/mesa_git.bb +3 -1
index 1babcc0..714911f 100644
@@ -23,6 +23,8 @@ S = "${WORKDIR}/git"
 #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
+        if [ -e "${D}${includedir}/EGL/eglplatform.h" ]; 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
     fi
 }
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 31 lines · Valentin Popa

Even if 'egl' is in PACKAGECONFIG, mesa egl support can be disabled explicitly (using a .bbappend, for example). This patch adds another check for the existence
of eglplatform.h before 'sed' can alter it.

---
  meta/recipes-graphics/mesa/mesa_9.1.6.bb | 4 +++-
  meta/recipes-graphics/mesa/mesa_git.bb   | 4 +++-
  2 files changed, 6 insertions(+), 2 deletions(-)
meta/recipes-graphics/mesa/mesa_9.1.6.bb +3 -1
index 6e9cd82..388cfd7 100644
@@ -19,6 +19,8 @@ S = "${WORKDIR}/Mesa-${PV}"
  #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
+        if [ -e "${D}${includedir}/EGL/eglplatform.h" ]; 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
      fi
  }
\ No newline at end of file
meta/recipes-graphics/mesa/mesa_git.bb +0 -0
index 1babcc0..714911f 100644

meta/recipes-graphics/mesa/mesa_git.bb S = "${WORKDIR}/git" · line 30

Quoted 9 lines
meta/recipes-graphics/mesa/mesa_git.bb +3 -1
@@ -23,6 +23,8 @@ S = "${WORKDIR}/git"
  #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
+        if [ -e "${D}${includedir}/EGL/eglplatform.h" ]; 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
      fi
  }

Not sure why subject-prefix didn't work. I'll resend this. Please ignore!