From 0911f32d1c34b239cbb59e1b2d89d1b5cadee7e0 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias Date: Wed, 9 Mar 2016 06:58:39 -0300 Subject: libepoxy: move outside x11r7 scope Move it outside x11r7 scope since it can be built without it with a few patches (sent upstream via github pull request). Motivation is simple, it's a dependency for newer gtk3 versions which can work with a wayland or broadway backend, and having a full x11 stack is pointless for that scenario. Signed-off-by: Gustavo Zacarias [Thomas: split the first patch into four separate patches, since that's how they were submitted upstream.] Signed-off-by: Thomas Petazzoni --- ...arwin-use-glx-instead-of-opengl-framework.patch | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch (limited to 'package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch') diff --git a/package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch b/package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch new file mode 100644 index 0000000000..be9b009f5c --- /dev/null +++ b/package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch @@ -0,0 +1,95 @@ +From d010922282580a32dfebcda12ee1c307b3ef6005 Mon Sep 17 00:00:00 2001 +From: Jeremy Huddleston Sequoia +Date: Mon, 18 Jan 2016 09:49:55 -0800 +Subject: [PATCH 4/4] darwin: Use GLX instead of OpenGL.framework if it is the + current context + +Also makes a stab at similar support for Win32 + +anholt/libepoxy#63 + +Signed-off-by: Jeremy Huddleston Sequoia +Fetched from pull #81 on github for libepoxy: +https://github.com/anholt/libepoxy/pull/81/commits +Signed-off-by: Gustavo Zacarias +--- + src/dispatch_common.c | 29 ++++++++++++++++------------- + 1 file changed, 16 insertions(+), 13 deletions(-) + +diff --git a/src/dispatch_common.c b/src/dispatch_common.c +index 163d348..cb9f76a 100644 +--- a/src/dispatch_common.c ++++ b/src/dispatch_common.c +@@ -482,16 +482,20 @@ epoxy_glx_dlsym(const char *name) + void * + epoxy_gl_dlsym(const char *name) + { +-#ifdef _WIN32 ++#if defined(_WIN32) || defined(__APPLE__) ++if (!epoxy_current_context_is_glx()) { ++# if defined(_WIN32) + return do_dlsym(&api.gl_handle, "OPENGL32", name, true); +-#elif defined(__APPLE__) ++# elif defined(__APPLE__) + return do_dlsym(&api.gl_handle, + "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", + name, true); +-#else ++# endif ++} ++#endif ++ + /* There's no library for desktop GL support independent of GLX. */ + return epoxy_glx_dlsym(name); +-#endif + } + + void * +@@ -615,7 +619,7 @@ epoxy_get_bootstrap_proc_address(const char *name) + */ + #if PLATFORM_HAS_GLX + if (api.glx_handle && glXGetCurrentContext()) +- return epoxy_gl_dlsym(name); ++ return epoxy_glx_dlsym(name); + #endif + + /* If epoxy hasn't loaded any API-specific library yet, try to +@@ -644,22 +648,17 @@ epoxy_get_bootstrap_proc_address(const char *name) + } + #endif /* PLATFORM_HAS_EGL */ + +- /* Fall back to GLX */ ++ /* Fall back to the platform default */ + return epoxy_gl_dlsym(name); + } + + void * + epoxy_get_proc_address(const char *name) + { +-#ifdef _WIN32 +- return wglGetProcAddress(name); +-#elif defined(__APPLE__) +- return epoxy_gl_dlsym(name); +-#else + #if PLATFORM_HAS_GLX + if (epoxy_current_context_is_glx()) { + return glXGetProcAddressARB((const GLubyte *)name); +- } else ++ } + #endif /* PLATFORM_HAS_GLX */ + #if PLATFORM_HAS_EGL + { +@@ -674,8 +673,12 @@ epoxy_get_proc_address(const char *name) + } + } + #endif /* PLATFORM_HAS_EGL */ ++#if defined(_WIN32) ++ return wglGetProcAddress(name); ++#elif defined(__APPLE__) ++ return epoxy_gl_dlsym(name); ++#endif + errx(1, "Couldn't find current GLX or EGL context.\n"); +-#endif /* _WIN32 | __APPLE__*/ + } + + WRAPPER_VISIBILITY (void) -- cgit v1.2.3