commit: 71d7882ebef08a2da96a996d36afd127bebc5cfa
parent 45c4bae35045d8a394382128d8d3f5a7ded65396
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 6 Nov 2020 19:19:30 +0100
patches: GL without X11 patches for glu and libepoxy
Diffstat:
2 files changed, 140 insertions(+), 0 deletions(-)
diff --git a/patches/media-libs/glu/glu-libOpenGL.patch b/patches/media-libs/glu/glu-libOpenGL.patch
@@ -0,0 +1,106 @@
+diff --git a/configure b/configure
+index 72f2d70..eff93ee 100755
+--- a/configure
++++ b/configure
+@@ -17141,13 +17141,13 @@ else
+ fi
+
+
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5
+-$as_echo_n "checking for glBegin in -lGL... " >&6; }
+-if ${ac_cv_lib_GL_glBegin+:} false; then :
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lOpenGL" >&5
++$as_echo_n "checking for glBegin in -lOpenGL... " >&6; }
++if ${ac_cv_lib_OpenGL_glBegin+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lGL $LIBS"
++LIBS="-lOpenGL $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+@@ -17167,18 +17167,18 @@ return glBegin ();
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- ac_cv_lib_GL_glBegin=yes
++ ac_cv_lib_OpenGL_glBegin=yes
+ else
+- ac_cv_lib_GL_glBegin=no
++ ac_cv_lib_OpenGL_glBegin=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5
+-$as_echo "$ac_cv_lib_GL_glBegin" >&6; }
+-if test "x$ac_cv_lib_GL_glBegin" = xyes; then :
+- GL_LIBS=-lGL
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OpenGL_glBegin" >&5
++$as_echo "$ac_cv_lib_OpenGL_glBegin" >&6; }
++if test "x$ac_cv_lib_OpenGL_glBegin" = xyes; then :
++ GL_LIBS=-lOpenGL
+ else
+ as_fn_error $? "GL required" "$LINENO" 5
+ fi
+@@ -17196,13 +17196,13 @@ else
+ fi
+
+
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lGL" >&5
+-$as_echo_n "checking for glBegin in -lGL... " >&6; }
+-if ${ac_cv_lib_GL_glBegin+:} false; then :
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glBegin in -lOpenGL" >&5
++$as_echo_n "checking for glBegin in -lOpenGL... " >&6; }
++if ${ac_cv_lib_OpenGL_glBegin+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lGL $LIBS"
++LIBS="-lOpenGL $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+@@ -17222,18 +17222,18 @@ return glBegin ();
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- ac_cv_lib_GL_glBegin=yes
++ ac_cv_lib_OpenGL_glBegin=yes
+ else
+- ac_cv_lib_GL_glBegin=no
++ ac_cv_lib_OpenGL_glBegin=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBegin" >&5
+-$as_echo "$ac_cv_lib_GL_glBegin" >&6; }
+-if test "x$ac_cv_lib_GL_glBegin" = xyes; then :
+- GL_LIBS=-lGL
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OpenGL_glBegin" >&5
++$as_echo "$ac_cv_lib_OpenGL_glBegin" >&6; }
++if test "x$ac_cv_lib_OpenGL_glBegin" = xyes; then :
++ GL_LIBS=-lOpenGL
+ else
+ as_fn_error $? "GL required" "$LINENO" 5
+ fi
+diff --git a/configure.ac b/configure.ac
+index 6d9b04b..70148fd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -77,9 +77,9 @@ else
+ AC_CHECK_HEADER([GL/gl.h],
+ [],
+ AC_MSG_ERROR([GL not found]))
+- AC_CHECK_LIB([GL],
++ AC_CHECK_LIB([OpenGL],
+ [glBegin],
+- [GL_LIBS=-lGL],
++ [GL_LIBS=-lOpenGL],
+ AC_MSG_ERROR([GL required]))
+ ])
+ fi
diff --git a/patches/media-libs/libepoxy/pr-232_GLX.patch b/patches/media-libs/libepoxy/pr-232_GLX.patch
@@ -0,0 +1,34 @@
+From 7e6843e2c5ca7c7e27c1a327a296e5d719744b49 Mon Sep 17 00:00:00 2001
+From: Patrick Steinhardt <ps@pks.im>
+Date: Sat, 24 Oct 2020 11:25:00 +0200
+Subject: [PATCH] dispatch: fix loading of GL without GLX library
+
+When loading the GL library in `epoxy_load_gl`, we in turn try to load
+OPENGL_LIB and GLX_LIB. But notably, we'll also try to load GLX_LIB even
+if loading OPENGL_LIB succeeded. As this load will abort in case the
+library wasn't found, the end result is that systems without GLX_LIB
+will always fail `epoxy_load_gl`.
+
+Fix the issue by only trying to load GLX_LIB in case OPENGL_LIB wasn't
+found.
+---
+ src/dispatch_common.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/dispatch_common.c b/src/dispatch_common.c
+index 9977a02..71ff2a0 100644
+--- a/src/dispatch_common.c
++++ b/src/dispatch_common.c
+@@ -675,8 +675,10 @@ epoxy_load_gl(void)
+ 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.glx_handle, GLX_LIB, true, true);
++ api.gl_handle = api.glx_handle;
++ }
+ #endif
+ }
+