about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch')
-rw-r--r--nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch b/nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch
new file mode 100644
index 000000000000..c34e93ae676a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch
@@ -0,0 +1,40 @@
+From ec6ee0e09e2d59455241081af66fb3ba02def7e4 Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Mon, 22 Apr 2019 10:41:27 +0000
+Subject: [PATCH 2/5] gl: don't implicitly include X11 headers
+
+EGL/egl.h on my system includes X11 headers by default, which breaks
+compilation when they aren't available, even though Cairo doesn't need
+them.
+
+Fortunately, this only happens if MESA_EGL_NO_X11_HEADERS is not
+defined, so defining that allows Cairo to be built with GL enabled even
+when X11 isn't available.
+
+Only when the Xlib surface is enabled are the headers guaranteed to be
+available. In that case, MESA_EGL_NO_X11_HEADERS should not be defined,
+to preserve compatibility with users expecting Cairo to include these
+headers. (There are tests that make this assumption.)
+---
+ src/cairo-gl.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/cairo-gl.h b/src/cairo-gl.h
+index 7cd869c76..a95b07bc3 100644
+--- a/src/cairo-gl.h
++++ b/src/cairo-gl.h
+@@ -127,6 +127,11 @@ cairo_gl_surface_create_for_dc (cairo_device_t		*device,
+ #endif
+ 
+ #if CAIRO_HAS_EGL_FUNCTIONS
++
++#if !CAIRO_HAS_XLIB_SURFACE && !defined(MESA_EGL_NO_X11_HEADERS)
++#define MESA_EGL_NO_X11_HEADERS
++#endif
++
+ #include <EGL/egl.h>
+ 
+ cairo_public cairo_device_t *
+-- 
+2.19.2
+