From 6e8b6770dfd57c49ce196f8cdb4b9ee2511bb739 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Tue, 17 Jan 2017 12:08:21 +0100 Subject: [PATCH] lirc + wayland fixes --- ...-Fix-lirc-activation-after-detection.patch | 32 +++ ...rt-qt-add-Wayland-run-time-detection.patch | 191 ++++++++++++++++++ vlc.spec | 11 +- 3 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-lirc-activation-after-detection.patch create mode 100644 0001-Revert-qt-add-Wayland-run-time-detection.patch diff --git a/0001-Fix-lirc-activation-after-detection.patch b/0001-Fix-lirc-activation-after-detection.patch new file mode 100644 index 0000000..c4fd0b9 --- /dev/null +++ b/0001-Fix-lirc-activation-after-detection.patch @@ -0,0 +1,32 @@ +From 72846370b9f0e93a51838b567064c6a6b62c37be Mon Sep 17 00:00:00 2001 +From: Nicolas Chauvet +Date: Mon, 16 Jan 2017 12:09:10 +0100 +Subject: [PATCH] Fix lirc activation after detection + +This fix build time activation of lirc. +"true" isn't "yes", so the HAVE_LIRC condition isn't met + +This bug was initialy reported as +https://bugzilla.rpmfusion.org/4420 + +Signed-off-by: Nicolas Chauvet +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 29eaed9..864ff98 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3931,7 +3931,7 @@ have_lirc="no" + AS_IF([test "${enable_lirc}" = "yes"], [ + AC_CHECK_HEADER(lirc/lirc_client.h, [ + AC_CHECK_LIB(lirc_client, lirc_init, [ +- have_lirc="true" ++ have_lirc="yes" + ]) + ]) + ]) +-- +2.7.4 + diff --git a/0001-Revert-qt-add-Wayland-run-time-detection.patch b/0001-Revert-qt-add-Wayland-run-time-detection.patch new file mode 100644 index 0000000..20ce795 --- /dev/null +++ b/0001-Revert-qt-add-Wayland-run-time-detection.patch @@ -0,0 +1,191 @@ +From 82e73a6fa15cb7cf62decdd8ba44df4d1685301d Mon Sep 17 00:00:00 2001 +From: Nicolas Chauvet +Date: Mon, 16 Jan 2017 12:03:14 +0100 +Subject: [PATCH] Revert "qt: add Wayland run-time detection" + +This reverts commit 785b0f18d70815288c8a673bcd0f3849af7ef6f7. +--- + modules/gui/qt/Makefile.am | 4 -- + modules/gui/qt/qt.cpp | 104 +++++++++++++-------------------------------- + 2 files changed, 29 insertions(+), 79 deletions(-) + +diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am +index 7e5f5ae..16e3596 100644 +--- a/modules/gui/qt/Makefile.am ++++ b/modules/gui/qt/Makefile.am +@@ -24,10 +24,6 @@ if HAVE_QT5_X11 + libqt_plugin_la_CXXFLAGS += $(QT5_X11_CFLAGS) -DQT5_HAS_X11 + libqt_plugin_la_LIBADD += $(QT5_X11_LIBS) $(X_LIBS) $(X_PRE_LIB) -lX11 + endif +-if HAVE_WAYLAND +-libqt_plugin_la_CXXFLAGS += $(WAYLAND_CLIENT_CFLAGS) -DQT5_HAS_WAYLAND +-libqt_plugin_la_LIBADD += $(WAYLAND_CLIENT_LIBS) +-endif + if HAVE_WIN32 + libqt_plugin_la_LIBADD += $(LIBCOM) -lcomctl32 -luuid + endif +diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp +index 6015b2a..0229f6e 100644 +--- a/modules/gui/qt/qt.cpp ++++ b/modules/gui/qt/qt.cpp +@@ -48,6 +48,10 @@ + #include "util/qvlcapp.hpp" /* QVLCApplication definition */ + #include "components/playlist/playlist_model.hpp" /* for ~PLModel() */ + ++#if defined (QT5_HAS_X11) || defined (Q_WS_X11) ++ #include ++#endif ++ + #include + #include + +@@ -75,6 +79,7 @@ static int Open ( vlc_object_t *, bool ); + static void Close ( vlc_object_t * ); + static int WindowOpen ( vout_window_t *, const vout_window_cfg_t * ); + static void WindowClose ( vout_window_t * ); ++static void *Thread ( void * ); + static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); + + /***************************************************************************** +@@ -332,13 +337,6 @@ static bool active = false; + * Module callbacks + *****************************************************************************/ + +-static void *ThreadPlatform( void *, char * ); +- +-static void *Thread( void *data ) +-{ +- return ThreadPlatform( data, NULL ); +-} +- + #ifdef Q_OS_MAC + /* Used to abort the app.exec() on OSX after libvlc_Quit is called */ + #include "../../../lib/libvlc_internal.h" /* libvlc_SetExitHandler */ +@@ -348,67 +346,22 @@ static void Abort( void *obj ) + } + #endif + +-#if defined (QT5_HAS_X11) +-# include +- +-static void *ThreadXCB( void *data ) +-{ +- char platform_name[] = "xcb"; +- return ThreadPlatform( data, platform_name ); +-} +- +-static bool HasX11( vlc_object_t *obj ) +-{ +- if( !vlc_xlib_init( obj ) ) +- return false; +- +- Display *dpy = XOpenDisplay( NULL ); +- if( dpy == NULL ) +- return false; +- +- XCloseDisplay( dpy ); +- return true; +-} +-#endif +- +-#ifdef QT5_HAS_WAYLAND +-# include +- +-static void *ThreadWayland( void *data ) +-{ +- char platform_name[] = "wayland"; +- return ThreadPlatform( data, platform_name ); +-} +- +-static bool HasWayland( void ) +-{ +- struct wl_display *dpy = wl_display_connect( NULL ); +- if( dpy == NULL ) +- return false; +- +- wl_display_disconnect( dpy ); +- return true; +-} +-#endif +- + /* Open Interface */ + static int Open( vlc_object_t *p_this, bool isDialogProvider ) + { + intf_thread_t *p_intf = (intf_thread_t *)p_this; +- void *(*thread)(void *) = Thread; + +-#ifdef QT5_HAS_WAYLAND +- if( HasWayland() ) +- thread = ThreadWayland; +- else +-#endif +-#ifdef QT5_HAS_X11 +- if( HasX11( p_this ) ) +- thread = ThreadXCB; +- else +-#endif +-#if defined (QT5_HAS_X11) || defined (QT5_HAS_WAYLAND) ++#if defined (QT5_HAS_X11) || defined (Q_WS_X11) ++ if( !vlc_xlib_init( p_this ) ) ++ return VLC_EGENERIC; ++ ++ Display *p_display = XOpenDisplay( NULL ); ++ if( !p_display ) ++ { ++ msg_Err( p_intf, "Could not connect to X server" ); + return VLC_EGENERIC; ++ } ++ XCloseDisplay( p_display ); + #endif + + QMutexLocker locker (&lock); +@@ -435,9 +388,9 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider ) + #ifdef Q_OS_MAC + /* Run mainloop on the main thread as Cocoa requires */ + libvlc_SetExitHandler( p_intf->obj.libvlc, Abort, p_intf ); +- thread( (void *)p_intf ); ++ Thread( (void *)p_intf ); + #else +- if( vlc_clone( &p_sys->thread, thread, p_intf, VLC_THREAD_PRIORITY_LOW ) ) ++ if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) ) + { + delete p_sys; + return VLC_ENOMEM; +@@ -493,22 +446,23 @@ static void Close( vlc_object_t *p_this ) + busy = false; + } + +-static void *ThreadPlatform( void *obj, char *platform_name ) ++static void *Thread( void *obj ) + { + intf_thread_t *p_intf = (intf_thread_t *)obj; + intf_sys_t *p_sys = p_intf->p_sys; + char vlc_name[] = "vlc"; /* for WM_CLASS */ ++#ifdef QT5_HAS_X11 + char platform_parm[] = "-platform"; +- char *argv[4]; +- int argc = 0; +- +- argv[argc++] = vlc_name; +- if( platform_name != NULL ) +- { +- argv[argc++] = platform_parm; +- argv[argc++] = platform_name; +- } +- argv[argc] = NULL; ++ char platform_value[] = "xcb"; ++#endif ++ char *argv[] = { ++ vlc_name, ++#ifdef QT5_HAS_X11 ++ platform_parm, platform_value, ++#endif ++ NULL, ++ }; ++ int argc = sizeof(argv) / sizeof(argv[0]) - 1; + + Q_INIT_RESOURCE( vlc ); + +-- +2.7.4 + diff --git a/vlc.spec b/vlc.spec index c785871..06ec402 100644 --- a/vlc.spec +++ b/vlc.spec @@ -23,6 +23,7 @@ %global _with_freerdp 1 %global _with_projectm 1 %global _with_schroedinger 1 +%global _with_wayland 1 %endif %ifarch x86_64 i686 %global _with_crystalhd 1 @@ -32,7 +33,7 @@ Summary: The cross-platform open-source multimedia framework, player and server Name: vlc Version: 3.0.0 -Release: 0.14%{?dist} +Release: 0.15%{?dist} License: GPLv2+ Group: Applications/Multimedia URL: http://www.videolan.org @@ -40,6 +41,8 @@ URL: http://www.videolan.org # nightly for 3.0 Source0: http://nightlies.videolan.org/build/source/vlc-%{version}%{?vlc_rc}.tar.xz Patch0: disable_hidpi_scaling.patch +Patch1: 0001-Fix-lirc-activation-after-detection.patch +Patch2: 0001-Revert-qt-add-Wayland-run-time-detection.patch BuildRequires: desktop-file-utils BuildRequires: libappstream-glib @@ -236,6 +239,8 @@ VLC media player extras modules. %prep %setup -q -n %{name}-%{version}%{?vlc_rc:-git} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %{?_with_bootstrap: rm aclocal.m4 m4/lib*.m4 m4/lt*.m4 || : ./bootstrap @@ -513,6 +518,10 @@ fi || : %changelog +* Tue Jan 17 2017 Nicolas Chauvet - 3.0.0-0.15 +- Fix lirc activation - rhbz#4420 +- Revert upstream commit 785b0f18d7 for wayland detection - rfbz#4380 + * Mon Jan 09 2017 Nicolas Chauvet - 3.0.0-0.14 - Update to 20170109 - Disable wayland for now - rhbz#4380