freebsd-ports/multimedia/bino/files/glew-fix-7098cd6a.patch
Niclas Zeising 7614763208 Update to 1.6.5
Switch to use QT5
Add patch to fix build with recent update to graphics/glew

PR:		223426
Submitted by:	zeising
Approved by:	maintainer timeout
2017-11-18 19:38:30 +00:00

208 lines
6.5 KiB
Diff

From 7098cd6afb7ed805de085ed72a5a3ff56e529277 Mon Sep 17 00:00:00 2001
From: Martin Lambers <marlam@marlam.de>
Date: Sun, 18 Dec 2016 14:37:52 +0100
Subject: Revert "Always use GLEWmx, do not fall back to GLEW."
This reverts commit eaf9278782b32a13cea19d1be331cb74a6cddce9.
---
configure.ac | 15 +++++++++++++--
src/Makefile.am | 8 ++++++--
src/video_output.h | 4 +++-
src/video_output_qt.cpp | 13 ++++++++-----
src/video_output_qt.h | 20 +++++++++++++-------
5 files changed, 43 insertions(+), 17 deletions(-)
diff --git a/configure.ac b/configure.ac
index 52181ed..03c6b58 100644
--- configure.ac
+++ configure.ac
@@ -296,7 +296,9 @@ fi
AC_DEFINE_UNQUOTED([HAVE_LIBEQUALIZER], [$HAVE_LIBEQUALIZER], [Have Equalizer?])
AM_CONDITIONAL([HAVE_LIBEQUALIZER], [test "$HAVE_LIBEQUALIZER" = "1"])
-dnl glewmx
+dnl glew
+dnl With Equalizer, we need glewmx, since that is what Equalizer uses.
+dnl Without Equalizer, glew (without mx) is ok to use, too.
PKG_CHECK_MODULES([libglewmx], [glewmx >= 1.6.0], [HAVE_LIBGLEWMX=1], [HAVE_LIBGLEWMX=0])
if test "$HAVE_LIBGLEWMX" != "1"; then
AC_MSG_WARN([required library libglewmx >= 1.6.0 not found:])
@@ -304,6 +306,15 @@ if test "$HAVE_LIBGLEWMX" != "1"; then
AC_MSG_WARN([libglewmx is provided by glew; Debian package: libglewmx-dev])
fi
AM_CONDITIONAL([HAVE_LIBGLEWMX], [test "$HAVE_LIBGLEWMX" = "1"])
+if test "$HAVE_LIBGLEWMX" != "1" -a "$HAVE_LIBEQUALIZER" != "1"; then
+ AC_MSG_NOTICE([trying to use libglew instead of libglewmx])
+ PKG_CHECK_MODULES([libglew], [glew >= 1.6.0], [HAVE_LIBGLEW=1], [HAVE_LIBGLEW=0])
+ if test "$HAVE_LIBGLEW" != "1"; then
+ AC_MSG_WARN([required library libglew >= 1.6.0 not found:])
+ AC_MSG_WARN([$libglew_PKG_ERRORS])
+ AC_MSG_WARN([libglew is provided by glew; Debian package: libglew-dev])
+ fi
+fi
dnl libXNVCtrl
AC_ARG_WITH([xnvctrl],
@@ -390,7 +401,7 @@ if test "$am_cv_func_iconv" != "yes" \
-o "$HAVE_LIBASS" != "1" \
-o "$HAVE_LIBOPENAL" != "1" \
-o "$HAVE_LIBQTOPENGL" != "1" \
- -o "$HAVE_LIBGLEWMX" != "1" \
+ -o \( "$HAVE_LIBGLEWMX" != "1" -a "$HAVE_LIBGLEW" != "1" \) \
-o \( "$equalizer" = "yes" -a "$HAVE_LIBEQUALIZER" != "1" \) \
-o \( "$xnvctrl" = "yes" -a "$HAVE_LIBXNVCTRL" != "1" \) \
-o \( "$lirc" = "yes" -a "$HAVE_LIRC" != "1" \) ; then
diff --git a/src/Makefile.am b/src/Makefile.am
index 6fc12bb..65cbae6 100644
--- src/Makefile.am
+++ src/Makefile.am
@@ -149,11 +149,15 @@ DEFS += -DHTMLDIR=\"$(htmldir)\" -DLOCALEDIR=\"$(localedir)\"
AM_CPPFLAGS = \
$(libavformat_CFLAGS) $(libavdevice_CFLAGS) $(libswscale_CFLAGS) $(libass_CFLAGS) \
- $(libopenal_CFLAGS) $(libgl_CFLAGS) $(libglewmx_CFLAGS) $(libqtopengl_CFLAGS)
+ $(libopenal_CFLAGS) $(libgl_CFLAGS) $(libglewmx_CFLAGS) $(libglew_CFLAGS) $(libqtopengl_CFLAGS)
bino_LDADD = $(top_builddir)/src/base/libbase.a $(LIBINTL) $(LIBICONV) \
$(libavformat_LIBS) $(libavdevice_LIBS) $(libswscale_LIBS) $(libass_LIBS) \
- $(libopenal_LIBS) $(libgl_LIBS) $(libglewmx_LIBS) $(libqtopengl_LIBS)
+ $(libopenal_LIBS) $(libgl_LIBS) $(libglewmx_LIBS) $(libglew_LIBS) $(libqtopengl_LIBS)
+
+if HAVE_LIBGLEWMX
+AM_CPPFLAGS += -DGLEW_MX
+endif
if HAVE_LIBEQUALIZER
bino_SOURCES += player_equalizer.h player_equalizer.cpp
diff --git a/src/video_output.h b/src/video_output.h
index 8430ddc..2fd72ce 100644
--- src/video_output.h
+++ src/video_output.h
@@ -1,7 +1,7 @@
/*
* This file is part of bino, a 3D video player.
*
- * Copyright (C) 2010, 2011, 2012, 2015
+ * Copyright (C) 2010, 2011, 2012, 2015, 2016
* Martin Lambers <marlam@marlam.de>
* Frédéric Devernay <Frederic.Devernay@inrialpes.fr>
* Joe <cuchac@email.cz>
@@ -128,7 +128,9 @@ private:
protected:
subtitle_renderer _subtitle_renderer;
+#ifdef GLEW_MX
virtual GLEWContext* glewGetContext() const = 0;
+#endif
// Get the total viewport size.
int full_display_width() const;
diff --git a/src/video_output_qt.cpp b/src/video_output_qt.cpp
index 0758892..ab82388 100644
--- src/video_output_qt.cpp
+++ src/video_output_qt.cpp
@@ -1,7 +1,7 @@
/*
* This file is part of bino, a 3D video player.
*
- * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Martin Lambers <marlam@marlam.de>
* Frédéric Devernay <frederic.devernay@inrialpes.fr>
* Joe <cuchac@email.cz>
@@ -80,11 +80,13 @@ gl_thread::gl_thread(video_output_qt* vo_qt, video_output_qt_widget* vo_qt_widge
{
}
-#if HAVE_X11
+#ifdef GLEW_MX
+# if HAVE_X11
GLXEWContext* gl_thread::glxewGetContext() const
{
return _vo_qt->glxewGetContext();
}
+# endif
#endif
void gl_thread::set_render(bool r)
@@ -781,17 +783,18 @@ void video_output_qt::create_widget()
process_events();
}
-#if HAVE_X11
+#ifdef GLEW_MX
+# if HAVE_X11
GLXEWContext* video_output_qt::glxewGetContext() const
{
return const_cast<GLXEWContext*>(&_glxew_context);
}
-#endif
-
+# endif
GLEWContext* video_output_qt::glewGetContext() const
{
return const_cast<GLEWContext*>(&_glew_context);
}
+#endif
bool video_output_qt::context_is_stereo() const
{
diff --git a/src/video_output_qt.h b/src/video_output_qt.h
index 1cc3174..089bac9 100644
--- src/video_output_qt.h
+++ src/video_output_qt.h
@@ -1,7 +1,7 @@
/*
* This file is part of bino, a 3D video player.
*
- * Copyright (C) 2010, 2011, 2012, 2013, 2015
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016
* Martin Lambers <marlam@marlam.de>
*
* This program is free software; you can redistribute it and/or modify
@@ -69,8 +69,10 @@ private:
public:
gl_thread(video_output_qt* vo_qt, video_output_qt_widget* vo_qt_widget);
-#if HAVE_X11
+#ifdef GLEW_MX
+# if HAVE_X11
GLXEWContext* glxewGetContext() const;
+# endif
#endif
void set_render(bool r);
@@ -166,10 +168,12 @@ protected:
class video_output_qt : public video_output
{
private:
-#if HAVE_X11
+#ifdef GLEW_MX
+# if HAVE_X11
GLXEWContext _glxew_context;
-#endif
+# endif
GLEWContext _glew_context;
+#endif
int _screen_width, _screen_height;
float _screen_pixel_aspect_ratio;
video_container_widget *_container_widget;
@@ -192,10 +196,12 @@ private:
void resume_screensaver();
protected:
-#if HAVE_X11
- GLXEWContext* glxewGetContext() const;
-#endif
+#ifdef GLEW_MX
+# if HAVE_X11
+ virtual GLXEWContext* glxewGetContext() const;
+# endif
virtual GLEWContext* glewGetContext() const;
+#endif
virtual bool context_is_stereo() const;
virtual void recreate_context(bool stereo);
virtual void trigger_resize(int w, int h);
--
cgit v1.0-41-gc330