From f5e47c943a96713fcbe8d83b10f89a4d875f8dc3029abc2ee35ca24fb3e6d2f0 Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Wed, 13 Jun 2018 07:14:36 +0000 Subject: [PATCH] Accepting request 616365 from home:adra:branches:KDE:Extra Added a patch (fix_build_with_qt5.11.patch), taken from upstream, to fix build failure with Qt 5.11 OBS-URL: https://build.opensuse.org/request/show/616365 OBS-URL: https://build.opensuse.org/package/show/KDE:Extra/subtitlecomposer?expand=0&rev=17 --- fix_build_with_qt5.11.patch | 155 ++++++++++++++++++++++++++++++++++++ subtitlecomposer.changes | 6 ++ subtitlecomposer.spec | 11 ++- 3 files changed, 168 insertions(+), 4 deletions(-) create mode 100644 fix_build_with_qt5.11.patch diff --git a/fix_build_with_qt5.11.patch b/fix_build_with_qt5.11.patch new file mode 100644 index 0000000..25ee6ec --- /dev/null +++ b/fix_build_with_qt5.11.patch @@ -0,0 +1,155 @@ +From cca0ff13c5bab516c073f9457277bdbf5fe1fd9a Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 10 Jun 2018 21:34:29 +0200 +Subject: [PATCH] Use target_link_libraries instead of qt5_use_modules + +The qt5_use_modules macro is deprecated and even no longer +available in Qt 5.11.0. +--- + src/CMakeLists.txt | 4 ++-- + src/core/tests/CMakeLists.txt | 12 ++++-------- + src/speechplugins/pocketsphinx/CMakeLists.txt | 3 +-- + src/videoplayerplugins/gstreamer/CMakeLists.txt | 3 +-- + src/videoplayerplugins/mplayer/CMakeLists.txt | 4 +--- + src/videoplayerplugins/mpv/CMakeLists.txt | 3 +-- + src/videoplayerplugins/phonon/CMakeLists.txt | 3 +-- + src/videoplayerplugins/xine/CMakeLists.txt | 3 +-- + 8 files changed, 12 insertions(+), 23 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index aac9147..4f8223a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -100,8 +100,6 @@ ki18n_wrap_ui(subtitlecomposer_SRCS + + add_executable(subtitlecomposer ${subtitlecomposer_SRCS}) + +-qt5_use_modules(subtitlecomposer Core Widgets) +- + # Xine videoplayer plugin needs XInitThreads() call in main + # optional since Xine will not be built without X11 + find_package(X11 QUIET) +@@ -117,6 +115,8 @@ target_link_libraries(subtitlecomposer + ${widgets_LIBS} + ${X11_LIBRARIES} + ${FFMPEG_LIBRARIES} ++ Qt5::Core ++ Qt5::Widgets + ) + + add_definitions( +diff --git a/src/core/tests/CMakeLists.txt b/src/core/tests/CMakeLists.txt +index 1ef64c0..71c3c99 100644 +--- a/src/core/tests/CMakeLists.txt ++++ b/src/core/tests/CMakeLists.txt +@@ -10,26 +10,22 @@ set(rangelisttest_SRCS rangelisttest.cpp) + add_executable(core-rangelisttest ${rangelisttest_SRCS}) + add_test(subtitlecomposer core-rangelisttest) + ecm_mark_as_test(core-rangelisttest) +-target_link_libraries(core-rangelisttest ${subtitlecomposer_LIBS}) +-qt5_use_modules(core-rangelisttest Core Test) ++target_link_libraries(core-rangelisttest ${subtitlecomposer_LIBS} Qt5::Core Qt5::Test) + + set(rangetest_SRCS rangetest.cpp) + add_executable(core-rangetest ${rangetest_SRCS}) + add_test(subtitlecomposer core-rangetest) + ecm_mark_as_test(core-rangetest) +-target_link_libraries(core-rangetest ${subtitlecomposer_LIBS}) +-qt5_use_modules(core-rangetest Core Test) ++target_link_libraries(core-rangetest ${subtitlecomposer_LIBS} Qt5::Core Qt5::Test) + + set(timetest_SRCS ../time.cpp timetest.cpp) + add_executable(core-timetest ${timetest_SRCS}) + add_test(subtitlecomposer core-timetest) + ecm_mark_as_test(core-timetest) +-target_link_libraries(core-timetest ${subtitlecomposer_LIBS}) +-qt5_use_modules(core-timetest Core Test) ++target_link_libraries(core-timetest ${subtitlecomposer_LIBS} Qt5::Core Qt5::Test) + + set(sstringtest_SRCS ../sstring.cpp sstringtest.cpp) + add_executable(core-sstringtest ${sstringtest_SRCS}) + add_test(subtitlecomposer core-sstringtest) + ecm_mark_as_test(core-sstringtest) +-target_link_libraries(core-sstringtest ${subtitlecomposer_LIBS}) +-qt5_use_modules(core-sstringtest Core Test) ++target_link_libraries(core-sstringtest ${subtitlecomposer_LIBS} Qt5::Core Qt5::Test) +diff --git a/src/speechplugins/pocketsphinx/CMakeLists.txt b/src/speechplugins/pocketsphinx/CMakeLists.txt +index 2420c5c..bad266f 100644 +--- a/src/speechplugins/pocketsphinx/CMakeLists.txt ++++ b/src/speechplugins/pocketsphinx/CMakeLists.txt +@@ -29,8 +29,7 @@ install(TARGETS pocketsphinxasr DESTINATION ${SC_PLUGIN_INSTALL_DIR}) + + target_include_directories(pocketsphinxasr SYSTEM PRIVATE ${speech_pocketsphinx_INCLUDE_DIRS}) + set_target_properties(pocketsphinxasr PROPERTIES COMPILE_FLAGS "${speech_pocketsphinx_DEFS}") +-target_link_libraries(pocketsphinxasr ${subtitlecomposer_LIBS} ${speech_pocketsphinx_LIBS}) +-qt5_use_modules(pocketsphinxasr Core) ++target_link_libraries(pocketsphinxasr ${subtitlecomposer_LIBS} ${speech_pocketsphinx_LIBS} Qt5::Core) + + add_dependencies(pocketsphinxasr subtitlecomposer) + +diff --git a/src/videoplayerplugins/gstreamer/CMakeLists.txt b/src/videoplayerplugins/gstreamer/CMakeLists.txt +index 90de462..3f61dde 100644 +--- a/src/videoplayerplugins/gstreamer/CMakeLists.txt ++++ b/src/videoplayerplugins/gstreamer/CMakeLists.txt +@@ -45,7 +45,6 @@ install(TARGETS gstplayer DESTINATION ${SC_PLUGIN_INSTALL_DIR}) + + target_include_directories(gstplayer SYSTEM PRIVATE ${videoplayer_gstreamer_INCLUDE_DIR}) + set_target_properties(gstplayer PROPERTIES COMPILE_FLAGS "${videoplayer_gstreamer_DEFS}") +-target_link_libraries(gstplayer ${subtitlecomposer_LIBS} ${videoplayer_gstreamer_LIBS}) +-qt5_use_modules(gstplayer Core) ++target_link_libraries(gstplayer ${subtitlecomposer_LIBS} ${videoplayer_gstreamer_LIBS} Qt5::Core) + + add_dependencies(gstplayer subtitlecomposer) +diff --git a/src/videoplayerplugins/mplayer/CMakeLists.txt b/src/videoplayerplugins/mplayer/CMakeLists.txt +index 0f51011..44945f8 100644 +--- a/src/videoplayerplugins/mplayer/CMakeLists.txt ++++ b/src/videoplayerplugins/mplayer/CMakeLists.txt +@@ -17,8 +17,6 @@ install(TARGETS mplayer DESTINATION ${SC_PLUGIN_INSTALL_DIR}) + + target_include_directories(mplayer SYSTEM PRIVATE ${videoplayer_mplayer_INCLUDE_DIR}) + set_target_properties(mplayer PROPERTIES COMPILE_FLAGS "${videoplayer_mplayer_DEFS}") +-target_link_libraries(mplayer ${subtitlecomposer_LIBS} ${videoplayer_mplayer_LIBS}) +- +-qt5_use_modules(mplayer Core) ++target_link_libraries(mplayer ${subtitlecomposer_LIBS} ${videoplayer_mplayer_LIBS} Qt5::Core) + + add_dependencies(mplayer subtitlecomposer) +diff --git a/src/videoplayerplugins/mpv/CMakeLists.txt b/src/videoplayerplugins/mpv/CMakeLists.txt +index 1eccba3..9b3ba80 100644 +--- a/src/videoplayerplugins/mpv/CMakeLists.txt ++++ b/src/videoplayerplugins/mpv/CMakeLists.txt +@@ -35,7 +35,6 @@ install(TARGETS mpvplayer DESTINATION ${SC_PLUGIN_INSTALL_DIR}) + + target_include_directories(mpvplayer SYSTEM PRIVATE ${videoplayer_mpv_INCLUDE_DIR}) + set_target_properties(mpvplayer PROPERTIES COMPILE_FLAGS "${videoplayer_mpv_DEFS}") +-target_link_libraries(mpvplayer ${subtitlecomposer_LIBS} ${videoplayer_mpv_LIBS}) +-qt5_use_modules(mpvplayer Core) ++target_link_libraries(mpvplayer ${subtitlecomposer_LIBS} ${videoplayer_mpv_LIBS} Qt5::Core) + + add_dependencies(mpvplayer subtitlecomposer) +diff --git a/src/videoplayerplugins/phonon/CMakeLists.txt b/src/videoplayerplugins/phonon/CMakeLists.txt +index 8dc4ecf..4aaceda 100644 +--- a/src/videoplayerplugins/phonon/CMakeLists.txt ++++ b/src/videoplayerplugins/phonon/CMakeLists.txt +@@ -24,7 +24,6 @@ install(TARGETS phononplayer DESTINATION ${SC_PLUGIN_INSTALL_DIR}) + + target_include_directories(phononplayer SYSTEM PRIVATE ${videoplayer_phonon_INCLUDE_DIR}) + set_target_properties(phononplayer PROPERTIES COMPILE_FLAGS "${videoplayer_phonon_DEFS}") +-target_link_libraries(phononplayer ${subtitlecomposer_LIBS} ${videoplayer_phonon_LIBS}) +-qt5_use_modules(phononplayer Core) ++target_link_libraries(phononplayer ${subtitlecomposer_LIBS} ${videoplayer_phonon_LIBS} Qt5::Core) + + add_dependencies(phononplayer subtitlecomposer) +diff --git a/src/videoplayerplugins/xine/CMakeLists.txt b/src/videoplayerplugins/xine/CMakeLists.txt +index 7d0f61a..09003f5 100644 +--- a/src/videoplayerplugins/xine/CMakeLists.txt ++++ b/src/videoplayerplugins/xine/CMakeLists.txt +@@ -59,7 +59,6 @@ install(TARGETS xineplayer DESTINATION ${SC_PLUGIN_INSTALL_DIR}) + + target_include_directories(xineplayer SYSTEM PRIVATE ${videoplayer_xine_INCLUDE_DIR}) + set_target_properties(xineplayer PROPERTIES COMPILE_FLAGS "${videoplayer_xine_DEFS}") +-target_link_libraries(xineplayer ${subtitlecomposer_LIBS} ${videoplayer_xine_LIBS}) +-qt5_use_modules(xineplayer Core) ++target_link_libraries(xineplayer ${subtitlecomposer_LIBS} ${videoplayer_xine_LIBS} Qt5::Core) + + add_dependencies(xineplayer subtitlecomposer) diff --git a/subtitlecomposer.changes b/subtitlecomposer.changes index 7bc6ed5..7d542f8 100644 --- a/subtitlecomposer.changes +++ b/subtitlecomposer.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 12 17:58:02 UTC 2018 - asterios.dramis@gmail.com + +- Added a patch (fix_build_with_qt5.11.patch), taken from upstream, + to fix build failure with Qt 5.11. + ------------------------------------------------------------------- Sun Feb 11 09:30:06 UTC 2018 - aloisio@gmx.com diff --git a/subtitlecomposer.spec b/subtitlecomposer.spec index fd687c0..7934178 100644 --- a/subtitlecomposer.spec +++ b/subtitlecomposer.spec @@ -20,10 +20,12 @@ Name: subtitlecomposer Version: 0.6.6 Release: 0 Summary: A text-based subtitle editor -License: GPL-2.0+ +License: GPL-2.0-or-later Group: Productivity/Multimedia/Video/Editors and Convertors URL: https://github.com/maxrd2/subtitlecomposer/ Source0: https://github.com/maxrd2/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix_build_with_qt5.11.patch asterios.dramis@gmail.com -- Fix build failure with Qt 5.11 +Patch0: fix_build_with_qt5.11.patch BuildRequires: cmake >= 3.10 BuildRequires: extra-cmake-modules BuildRequires: kauth-devel @@ -70,14 +72,15 @@ has speech Recognition using PocketSphinx. %prep %setup -q +%patch0 -p1 # Fix permissions chmod 644 ChangeLog # Fix shebang -sed -i '1s|/usr/bin/env python|%{__python}|' \ +sed -i '1s|%{_bindir}/env python|%{_bindir}/python|' \ src/scripting/examples/*.py -sed -i '1s|/usr/bin/env ruby|%{_bindir}/ruby|' \ +sed -i '1s|%{_bindir}/env ruby|%{_bindir}/ruby|' \ src/scripting/examples/*.rb %build @@ -95,7 +98,7 @@ mkdir files_for_doc cp -a %{buildroot}%{_kf5_appsdir}/%{name}/scripts/api/ files_for_doc/ rm -rf %{buildroot}%{_kf5_appsdir}/%{name}/scripts/api/ # Point to the correct path of the header files directory (doc) -perl -pi -e "s|'api'|'/usr/share/doc/packages/subtitlecomposer/api'|" %{buildroot}%{_kf5_appsdir}/%{name}/scripts/README +perl -pi -e "s|'api'|'%{_docdir}/subtitlecomposer/api'|" %{buildroot}%{_kf5_appsdir}/%{name}/scripts/README %suse_update_desktop_file -r %{name} Qt KDE AudioVideo AudioVideoEditing