From 47d74bd400df662d582c5c3e73ddd98740866467 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Wed, 2 Jun 2021 22:39:57 +0300 Subject: [PATCH] graphics/libepoxy: backport reverted patch for Wayland-only builds 1.5.8 reverted two commits that caused regressions under certain conditions for Xorg, but regressed Wayland-only environments where libGL does not exist and OpenGL is provided by libOpenGL instead. --- graphics/libepoxy/Makefile | 1 + graphics/libepoxy/files/extra-patch-libopengl | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 graphics/libepoxy/files/extra-patch-libopengl diff --git a/graphics/libepoxy/Makefile b/graphics/libepoxy/Makefile index 835e7111c023..4865908c7295 100644 --- a/graphics/libepoxy/Makefile +++ b/graphics/libepoxy/Makefile @@ -20,6 +20,7 @@ OPTIONS_SUB= yes TEST_MESON_TRUE= tests +X11_EXTRA_PATCHES_OFF= ${PATCHDIR}/extra-patch-libopengl X11_USES= xorg X11_USE= GL=gl XORG=x11 X11_MESON_YES= glx diff --git a/graphics/libepoxy/files/extra-patch-libopengl b/graphics/libepoxy/files/extra-patch-libopengl new file mode 100644 index 000000000000..784735d2c37e --- /dev/null +++ b/graphics/libepoxy/files/extra-patch-libopengl @@ -0,0 +1,36 @@ +From dbfa4b209c0712b67dfeb8366c2ebe8503063b52 Mon Sep 17 00:00:00 2001 +From: Yaroslav Isakov +Date: Wed, 29 Jul 2020 16:40:01 +0200 +Subject: [PATCH] If glvnd library found, do not use libGL.so in epoxy_load_gl + +Without additional check, even if libOpenGL was loaded, libGL.so will +be loaded as well, and used both in gl_handle and glx_handle, so +libglvnd libraries will not be used. + +Reviewed-by: Adam Jackson + +Signed-off-by: Emmanuele Bassi +--- + src/dispatch_common.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/dispatch_common.c b/src/dispatch_common.c +index 9977a02..cfc9dcc 100644 +--- src/dispatch_common.c ++++ src/dispatch_common.c +@@ -674,9 +674,12 @@ epoxy_load_gl(void) + if (!api.gl_handle) + get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true); + #endif +- +- get_dlopen_handle(&api.glx_handle, GLX_LIB, true, true); +- api.gl_handle = api.glx_handle; ++ if (!api.gl_handle) { ++ get_dlopen_handle(&api.gl_handle, GLX_LIB, true, true); ++#if PLATFORM_HAS_GLX ++ api.glx_handle = api.gl_handle; ++#endif ++ } + #endif + } + -- 2.31.1