diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-04-22 17:50:29 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-04-23 10:13:18 +0000 |
commit | 9240c60bf923394212bf34f6a70b7d66f4af2d09 (patch) | |
tree | d3381e0cfce31746ea87bcb5f6dcc0354133f5f9 /nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch | |
parent | b0de6eb3337b81eb07af08a0114462d7bf314cb6 (diff) | |
download | nixlib-9240c60bf923394212bf34f6a70b7d66f4af2d09.tar nixlib-9240c60bf923394212bf34f6a70b7d66f4af2d09.tar.gz nixlib-9240c60bf923394212bf34f6a70b7d66f4af2d09.tar.bz2 nixlib-9240c60bf923394212bf34f6a70b7d66f4af2d09.tar.lz nixlib-9240c60bf923394212bf34f6a70b7d66f4af2d09.tar.xz nixlib-9240c60bf923394212bf34f6a70b7d66f4af2d09.tar.zst nixlib-9240c60bf923394212bf34f6a70b7d66f4af2d09.zip |
cairo: make xlib support optional
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.patch | 40 |
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 + |