aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia
diff options
context:
space:
mode:
authorriggs <riggs@FreeBSD.org>2017-02-18 16:20:45 +0800
committerriggs <riggs@FreeBSD.org>2017-02-18 16:20:45 +0800
commit9d6e23ffa9258dc276522acdda1bbfbe2a1b7611 (patch)
treee1071937b7d6ff2a2f063fd00469a5b87d47282b /multimedia
parent6dcd0498ddd03cc8943ed8a97a2f7197f2b8d5f8 (diff)
downloadfreebsd-ports-gnome-9d6e23ffa9258dc276522acdda1bbfbe2a1b7611.tar.gz
freebsd-ports-gnome-9d6e23ffa9258dc276522acdda1bbfbe2a1b7611.tar.zst
freebsd-ports-gnome-9d6e23ffa9258dc276522acdda1bbfbe2a1b7611.zip
Use c++11 by default, in preparation for Qt 5.7.1 update
PR: 217051 Submitted by: rakuco
Diffstat (limited to 'multimedia')
-rw-r--r--multimedia/vlc/Makefile10
-rw-r--r--multimedia/vlc/files/patch-git_92ec47e43
-rw-r--r--multimedia/vlc/files/patch-git_d2571e651
-rw-r--r--multimedia/vlc/files/patch-include_vlc__atomic.h106
-rw-r--r--multimedia/vlc/files/patch-modules_gui_qt4_dialogs_messages.hpp11
5 files changed, 198 insertions, 23 deletions
diff --git a/multimedia/vlc/Makefile b/multimedia/vlc/Makefile
index b1e324f4bdc4..d3c54d972aca 100644
--- a/multimedia/vlc/Makefile
+++ b/multimedia/vlc/Makefile
@@ -3,7 +3,7 @@
PORTNAME= vlc
DISTVERSION= 2.2.4
-PORTREVISION= 7
+PORTREVISION= 8
PORTEPOCH= 4
CATEGORIES= multimedia audio ipv6 net www
MASTER_SITES= http://download.videolan.org/pub/videolan/${PORTNAME}/${DISTVERSION:S/a$//}/ \
@@ -24,7 +24,13 @@ BUILD_DEPENDS= ffmpeg>=2.0:multimedia/ffmpeg \
yasm:devel/yasm
RUN_DEPENDS= ffmpeg>=2.0:multimedia/ffmpeg
-USES= compiler:c11 desktop-file-utils gmake iconv libtool pathfix \
+# VLC git (post 2.2.4) requires C++11 support and passes the appropriate flag
+# to the compiler. Until the port is updated, we explicitly pass -std=c++11 to
+# the compiler because Qt 5.7+ requires C++11 support, and FreeBSD 10.3's clang
+# does not default to C++11 mode.
+USE_CXXSTD= c++11
+
+USES= compiler:c++11-lib desktop-file-utils gmake iconv libtool pathfix \
pkgconfig tar:xz
USE_GNOME= libxml2
USE_LDCONFIG= yes
diff --git a/multimedia/vlc/files/patch-git_92ec47e b/multimedia/vlc/files/patch-git_92ec47e
new file mode 100644
index 000000000000..a9af552cca89
--- /dev/null
+++ b/multimedia/vlc/files/patch-git_92ec47e
@@ -0,0 +1,43 @@
+Partial import of upstream git-commit to fix build in c++11 mode
+
+From 92ec47e15b62ef12e15e6ce5550abe2620bc3167 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
+Date: Wed, 2 Jul 2014 14:17:19 +0000
+Subject: [PATCH] Fix build when using C++11
+
+--- modules/access/live555.cpp.orig 2015-10-21 17:48:45 UTC
++++ modules/access/live555.cpp
+@@ -307,7 +307,7 @@ static int Open ( vlc_object_t *p_this
+ p_demux->p_sys = p_sys = (demux_sys_t*)calloc( 1, sizeof( demux_sys_t ) );
+ if( !p_sys ) return VLC_ENOMEM;
+
+- msg_Dbg( p_demux, "version "LIVEMEDIA_LIBRARY_VERSION_STRING );
++ msg_Dbg( p_demux, "version " LIVEMEDIA_LIBRARY_VERSION_STRING );
+
+ TAB_INIT( p_sys->i_track, p_sys->track );
+ p_sys->f_npt = 0.;
+@@ -593,7 +593,7 @@ createnew:
+
+ p_sys->rtsp = new RTSPClientVlc( *p_sys->env, psz_url,
+ var_InheritInteger( p_demux, "verbose" ) > 1 ? 1 : 0,
+- "LibVLC/"VERSION, i_http_port, p_sys );
++ "LibVLC/" VERSION, i_http_port, p_sys );
+ if( !p_sys->rtsp )
+ {
+ msg_Err( p_demux, "RTSPClient::createNew failed (%s)",
+ modules/access/live555.cpp | 4 ++--
+ modules/demux/mp4/libmp4.h | 2 +-
+ modules/demux/vobsub.h | 8 +++----
+ 10 files changed, 40 insertions(+), 40 deletions(-)
+
+--- modules/demux/mp4/libmp4.h.orig 2015-02-02 19:42:29 UTC
++++ modules/demux/mp4/libmp4.h
+@@ -1360,7 +1360,7 @@ static inline size_t mp4_box_headersize(
+ if( i_actually_read < 0 || (int64_t)i_actually_read < i_read )\
+ { \
+ msg_Warn( p_stream, "MP4_READBOX_ENTER: I got %i bytes, "\
+- "but I requested %"PRId64"", i_actually_read, i_read );\
++ "but I requested %" PRId64, i_actually_read, i_read );\
+ free( p_buff ); \
+ return( 0 ); \
+ } \
diff --git a/multimedia/vlc/files/patch-git_d2571e6 b/multimedia/vlc/files/patch-git_d2571e6
new file mode 100644
index 000000000000..70c4f7614550
--- /dev/null
+++ b/multimedia/vlc/files/patch-git_d2571e6
@@ -0,0 +1,51 @@
+commit d2571e643edb0f1cb217805ef8d5ac172d59a864
+Author: RĂ©mi Denis-Courmont <remi@remlab.net>
+Date: Fri Jun 26 00:06:44 2015 +0300
+
+ qt: use QAtomicInt
+
+diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
+index 21c11107c7..d23007f036 100644
+--- modules/gui/qt4/dialogs/messages.cpp
++++ modules/gui/qt4/dialogs/messages.cpp
+@@ -146,7 +146,7 @@ MessagesDialog::~MessagesDialog()
+
+ void MessagesDialog::changeVerbosity( int i_verbosity )
+ {
+- atomic_store( &this->verbosity, i_verbosity );
++ verbosity = i_verbosity;
+ }
+
+ void MessagesDialog::updateConfig()
+@@ -340,7 +340,7 @@ void MessagesDialog::MsgCallback( void *self, int type, const vlc_log_t *item,
+ {
+ MessagesDialog *dialog = (MessagesDialog *)self;
+ char *str;
+- int verbosity = atomic_load( &dialog->verbosity );
++ int verbosity = dialog->verbosity;
+
+ if( verbosity < 0 || verbosity < (type - VLC_MSG_ERR)
+ || unlikely(vasprintf( &str, format, ap ) == -1) )
+diff --git a/modules/gui/qt4/dialogs/messages.hpp b/modules/gui/qt4/dialogs/messages.hpp
+index a8d5804be2..0491a8f158 100644
+--- modules/gui/qt4/dialogs/messages.hpp
++++ modules/gui/qt4/dialogs/messages.hpp
+@@ -28,8 +28,8 @@
+ #include "util/singleton.hpp"
+ #include "ui/messages_panel.h"
+ #include <stdarg.h>
+-#include <vlc_atomic.h>
+ #include <QMutex>
++#include <QAtomicInt>
+
+ class QPushButton;
+ class QTreeWidget;
+@@ -49,7 +49,7 @@ private:
+ void sinkMessage( const MsgEvent * );
+ bool matchFilter( const QString& );
+
+- atomic_uint verbosity;
++ QAtomicInt verbosity;
+ static void MsgCallback( void *, int, const vlc_log_t *, const char *,
+ va_list );
+
diff --git a/multimedia/vlc/files/patch-include_vlc__atomic.h b/multimedia/vlc/files/patch-include_vlc__atomic.h
index 064bf0f4c58f..24059536aed4 100644
--- a/multimedia/vlc/files/patch-include_vlc__atomic.h
+++ b/multimedia/vlc/files/patch-include_vlc__atomic.h
@@ -1,17 +1,103 @@
+Move vlc_atomic.h closer to the git version (post-2.2.4), especially revision
+ab550d60dd8d8 ("include: stick to a single version (2011) C/C++ atomics") by
+assuming C++ builds are being done in C++11 mode or later and include <atomic>.
+For C usages, use <stdatomic.h> in C11 mode and define some shims otherwise.
+
+The original 2.2.4 version does not have C++11 support and breaks with Qt5, as
+Qt 5.7+ requires C++11 support.
--- include/vlc_atomic.h.orig 2014-08-14 07:20:03 UTC
+++ include/vlc_atomic.h
-@@ -32,6 +32,14 @@
+@@ -26,13 +26,13 @@
+ * Atomic operations do not require locking, but they are not very powerful.
+ */
+
+-# if !defined (__cplusplus) && (__STDC_VERSION__ >= 201112L) \
+- && !defined (__STDC_NO_ATOMICS__)
++# ifndef __cplusplus
++# if (__STDC_VERSION__ >= 201112L) && !defined (__STDC_NO_ATOMICS__)
+
/*** Native C11 atomics ***/
# include <stdatomic.h>
-+# elif defined (__cplusplus) && defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 3800
-+
-+# include <atomic>
-+
-+using std::atomic_uint_least32_t;
-+using std::atomic_uintptr_t;
-+using std::atomic_int;
-+
- # else
+-# else
++# else
# define ATOMIC_FLAG_INIT false
+
+@@ -57,7 +57,7 @@
+ * unsigned equivalents, i.e. 4-bytes and 8-bytes types, although GCC also
+ * supports 1 and 2-bytes types. Some non-x86 architectures do not support
+ * 8-byte atomic types (or not efficiently). */
+-# if defined (_MSC_VER)
++# if defined (_MSC_VER)
+ /* Some atomic operations of the Interlocked API are only
+ available for desktop apps. Thus we define the atomic types to
+ be at least 32 bits wide. */
+@@ -68,7 +68,7 @@
+ typedef uint_least32_t atomic_uchar;
+ typedef int_least32_t atomic_short;
+ typedef uint_least32_t atomic_ushort;
+-# else
++# else
+ typedef bool atomic_flag;
+ typedef bool atomic_bool;
+ typedef char atomic_char;
+@@ -76,7 +76,7 @@
+ typedef unsigned char atomic_uchar;
+ typedef short atomic_short;
+ typedef unsigned short atomic_ushort;
+-# endif
++# endif
+ typedef int atomic_int;
+ typedef unsigned int atomic_uint;
+ typedef long atomic_long;
+@@ -109,7 +109,7 @@
+ typedef intmax_t atomic_intmax_t;
+ typedef uintmax_t atomic_uintmax_t;
+
+-# if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) || (defined (__clang__) && (defined (__x86_64__) || defined (__i386__)))
++# if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) || (defined (__clang__) && (defined (__x86_64__) || defined (__i386__)))
+
+ /*** Intel/GCC atomics ***/
+
+@@ -203,7 +203,7 @@
+ # define atomic_flag_clear_explicit(object,order) \
+ atomic_flag_clear(object)
+
+-# elif defined (__GNUC__)
++# elif defined (__GNUC__)
+
+ /*** No atomics ***/
+
+@@ -315,7 +315,7 @@
+ # define atomic_flag_clear_explicit(object,order) \
+ atomic_flag_clear(object)
+
+-# elif defined (_MSC_VER)
++# elif defined (_MSC_VER)
+
+ # include <windows.h>
+
+@@ -397,10 +397,8 @@
+ # define atomic_flag_clear_explicit(object,order) \
+ atomic_flag_clear(object)
+
+-# else
+-# error FIXME: implement atomic operations for this compiler.
+-# endif
+-# endif
++# endif
++# endif
+
+ typedef atomic_uint_least32_t vlc_atomic_float;
+
+@@ -427,4 +425,9 @@
+ atomic_store(atom, u.i);
+ }
+
++# else /* C++ */
++/*** Native C++11 atomics ***/
++# include <atomic>
++# endif
++
+ #endif
diff --git a/multimedia/vlc/files/patch-modules_gui_qt4_dialogs_messages.hpp b/multimedia/vlc/files/patch-modules_gui_qt4_dialogs_messages.hpp
deleted file mode 100644
index bb70dc1bf936..000000000000
--- a/multimedia/vlc/files/patch-modules_gui_qt4_dialogs_messages.hpp
+++ /dev/null
@@ -1,11 +0,0 @@
---- modules/gui/qt4/dialogs/messages.hpp.orig 2014-08-14 07:20:04 UTC
-+++ modules/gui/qt4/dialogs/messages.hpp
-@@ -55,7 +55,7 @@ private:
- void sinkMessage( const MsgEvent * );
- bool matchFilter( const QString& );
-
-- atomic_uint verbosity;
-+ atomic_int verbosity;
- static void MsgCallback( void *, int, const vlc_log_t *, const char *,
- va_list );
-