From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sat, 26 Oct 2019 14:19:57 +0000 (+0200)
Subject: kde-plasma/kwin: Don't use MESA_EGL_NO_X11_HEADERS
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b7779965fdd4940b1c25224eab98bd89135d98de;p=gentoo.git

kde-plasma/kwin: Don't use MESA_EGL_NO_X11_HEADERS

Closes: https://bugs.gentoo.org/698546
Package-Manager: Portage-2.3.78, Repoman-2.3.17
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---

diff --git a/kde-plasma/kwin/files/kwin-5.17.1-dont-use-MESA_EGL_NO_X11_HEADERS.patch b/kde-plasma/kwin/files/kwin-5.17.1-dont-use-MESA_EGL_NO_X11_HEADERS.patch
new file mode 100644
index 000000000000..a15c8aee1533
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.17.1-dont-use-MESA_EGL_NO_X11_HEADERS.patch
@@ -0,0 +1,57 @@
+From 8e176c8b0d97e78e8b33fac3b5acded277bbcf4f Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vladzzag@gmail.com>
+Date: Mon, 21 Oct 2019 21:20:11 +0300
+Subject: Don't use MESA_EGL_NO_X11_HEADERS
+
+Summary:
+With recent Mesa updates (19.2.1), MESA_EGL_NO_X11_HEADERS doesn't have
+any effect. So, let's include fixx11h.h instead.
+
+Test Plan: I am able to build kwin once again.
+
+Reviewers: #kwin, davidedmundson
+
+Reviewed By: #kwin, davidedmundson
+
+Subscribers: kwin
+
+Tags: #kwin
+
+Differential Revision: https://phabricator.kde.org/D24840
+---
+ plugins/qpa/eglhelpers.h       | 2 +-
+ plugins/qpa/offscreensurface.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/qpa/eglhelpers.h b/plugins/qpa/eglhelpers.h
+index 1eb7624..30eb56d 100644
+--- a/plugins/qpa/eglhelpers.h
++++ b/plugins/qpa/eglhelpers.h
+@@ -20,9 +20,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ #pragma once
+ 
+-#define MESA_EGL_NO_X11_HEADERS
+ #include <epoxy/egl.h>
+ #include "fixqopengl.h"
++#include <fixx11h.h>
+ 
+ #include <QSurfaceFormat>
+ 
+diff --git a/plugins/qpa/offscreensurface.h b/plugins/qpa/offscreensurface.h
+index 1254981..5b8ce29 100644
+--- a/plugins/qpa/offscreensurface.h
++++ b/plugins/qpa/offscreensurface.h
+@@ -20,9 +20,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ #pragma once
+ 
+-#define MESA_EGL_NO_X11_HEADERS
+ #include <epoxy/egl.h>
+ #include "fixqopengl.h"
++#include <fixx11h.h>
+ 
+ #include <qpa/qplatformoffscreensurface.h>
+ 
+-- 
+cgit v1.1
diff --git a/kde-plasma/kwin/kwin-5.17.1.ebuild b/kde-plasma/kwin/kwin-5.17.1.ebuild
index d3e20b0940d7..61b6f0494ca9 100644
--- a/kde-plasma/kwin/kwin-5.17.1.ebuild
+++ b/kde-plasma/kwin/kwin-5.17.1.ebuild
@@ -87,6 +87,8 @@ PDEPEND="
 
 RESTRICT+=" test"
 
+PATCHES=( "${FILESDIR}/${P}-dont-use-MESA_EGL_NO_X11_HEADERS.patch" )
+
 src_prepare() {
 	kde5_src_prepare
 	use multimedia || eapply "${FILESDIR}/${PN}-5.16.80-gstreamer-optional.patch"