diff mbox series

[1/1] package/kodi: fix build error with newer mesa3d

Message ID 20230201225104.3433262-1-bernd.kuhls@t-online.de
State Superseded
Headers show
Series [1/1] package/kodi: fix build error with newer mesa3d | expand

Commit Message

Bernd Kuhls Feb. 1, 2023, 10:51 p.m. UTC
Fixes build error:

output/build/kodi-19.5-Matrix/xbmc/windowing/X11/GLContextEGL.h:16:10:
 fatal error: EGL/eglextchromium.h: No such file or directory
   16 | #include <EGL/eglextchromium.h>

introduced by mesa3d 22.3 with this commit
https://gitlab.freedesktop.org/mesa/mesa/-/commit/f5bb9dd738ace274c97507adea073b6c609469b2

using this defconfig

BR2_PACKAGE_KODI=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON3_PY_ONLY=y

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/kodi/0005-Fix-EGL-build.patch | 58 +++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 package/kodi/0005-Fix-EGL-build.patch
diff mbox series

Patch

diff --git a/package/kodi/0005-Fix-EGL-build.patch b/package/kodi/0005-Fix-EGL-build.patch
new file mode 100644
index 0000000000..cefa8cbdb4
--- /dev/null
+++ b/package/kodi/0005-Fix-EGL-build.patch
@@ -0,0 +1,58 @@ 
+From 3fed131284b53b0e42c87c672f02dc3e91e40b22 Mon Sep 17 00:00:00 2001
+From: Alan Swanson <reiver@improbability.net>
+Date: Mon, 19 Dec 2022 21:28:13 +0200
+Subject: [PATCH] Work around Mesa eglchromium.h removal
+
+I have polished Alan's snippet to buildable state and tested
+on Kodi from Debian sid.
+
+Backported EGL fix from upstream commit:
+https://github.com/xbmc/xbmc/commit/2968130023ea6ee4327119dc969758840c4a5941
+
+Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ cmake/modules/FindEGL.cmake       | 6 ++++++
+ xbmc/windowing/X11/GLContextEGL.h | 4 ++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/cmake/modules/FindEGL.cmake b/cmake/modules/FindEGL.cmake
+index b00fe08a25f95..a68a8db901222 100644
+--- a/cmake/modules/FindEGL.cmake
++++ b/cmake/modules/FindEGL.cmake
+@@ -9,6 +9,7 @@
+ # EGL_INCLUDE_DIRS - the EGL include directory
+ # EGL_LIBRARIES - the EGL libraries
+ # EGL_DEFINITIONS - the EGL definitions
++# HAVE_EGLEXTANGLE - if eglext_angle.h exists else use eglextchromium.h
+ #
+ # and the following imported targets::
+ #
+@@ -35,6 +36,11 @@ if(EGL_FOUND)
+   set(EGL_LIBRARIES ${EGL_LIBRARY})
+   set(EGL_INCLUDE_DIRS ${EGL_INCLUDE_DIR})
+   set(EGL_DEFINITIONS -DHAS_EGL=1)
++  include(CheckIncludeFiles)
++  check_include_files("EGL/egl.h;EGL/eglext.h;EGL/eglext_angle.h" HAVE_EGLEXTANGLE)
++  if(HAVE_EGLEXTANGLE)
++    list(APPEND EGL_DEFINITIONS "-DHAVE_EGLEXTANGLE=1")
++  endif()
+ 
+   if(NOT TARGET EGL::EGL)
+     add_library(EGL::EGL UNKNOWN IMPORTED)
+diff --git a/xbmc/windowing/X11/GLContextEGL.h b/xbmc/windowing/X11/GLContextEGL.h
+index 99a6a9024e8c6..afea0b7c43eac 100644
+--- a/xbmc/windowing/X11/GLContextEGL.h
++++ b/xbmc/windowing/X11/GLContextEGL.h
+@@ -13,7 +13,11 @@
+ #include "threads/CriticalSection.h"
+ 
+ #include <EGL/eglext.h>
++#ifdef HAVE_EGLEXTANGLE
++#include <EGL/eglext_angle.h>
++#else
+ #include <EGL/eglextchromium.h>
++#endif
+ #include <X11/Xutil.h>
+ 
+ class CGLContextEGL : public CGLContext