Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libmlt for openSUSE:Factory checked in at 2022-08-06 22:08:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libmlt (Old) and /work/SRC/openSUSE:Factory/.libmlt.new.1521 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libmlt" Sat Aug 6 22:08:15 2022 rev:62 rq:993436 version:7.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libmlt/libmlt.changes 2022-06-25 10:24:14.890672551 +0200 +++ /work/SRC/openSUSE:Factory/.libmlt.new.1521/libmlt.changes 2022-08-06 22:08:30.002716192 +0200 @@ -1,0 +2,10 @@ +Fri Aug 5 16:16:04 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr> + +- Add upstream changes to build a Qt 6 based mod: + * 0001-Split-to-allow-installing-Qt5-and-Qt6-in-parallel-80.patch + * 0002-Remove-deprecated-C-register-keyword-815.patch + * 0003-Move-CMake-code-for-testing-to-the-right-position-fo.patch + * 0004-Add-MLT_REPOSITORY_DENY-envvar-to-skip-plugin-loadin.patch + * 0005-Avoid-to-load-both-qt-modules-816.patch + +------------------------------------------------------------------- New: ---- 0001-Split-to-allow-installing-Qt5-and-Qt6-in-parallel-80.patch 0002-Remove-deprecated-C-register-keyword-815.patch 0003-Move-CMake-code-for-testing-to-the-right-position-fo.patch 0004-Add-MLT_REPOSITORY_DENY-envvar-to-skip-plugin-loadin.patch 0005-Avoid-to-load-both-qt-modules-816.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libmlt.spec ++++++ --- /var/tmp/diff_new_pack.GGfyjE/_old 2022-08-06 22:08:30.618717982 +0200 +++ /var/tmp/diff_new_pack.GGfyjE/_new 2022-08-06 22:08:30.622717994 +0200 @@ -26,6 +26,10 @@ %define sover_pp 7 %define lversion_pp 7.8.0 %define libpp_pkgname %{libname_pp}-%{sover_pp}-%{sover_pp} +# Qt 6 is not available in Leap 15.3 +%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400 +%bcond_without Qt6 +%endif Name: %{libname} Version: 7.8.0 Release: 0 @@ -35,9 +39,19 @@ URL: https://www.mltframework.org Source0: https://github.com/mltframework/mlt/archive/v%{version}.tar.gz#/%{_name}-%{version}.tar.gz Patch0: 0001-Another-take-on-fixing-the-wcrtomb-issue.patch +# Improvements to allow building both the Qt 5 and Qt 6 mods and prevent loading both at the same time +Patch1: 0001-Split-to-allow-installing-Qt5-and-Qt6-in-parallel-80.patch +Patch2: 0002-Remove-deprecated-C-register-keyword-815.patch +Patch3: 0003-Move-CMake-code-for-testing-to-the-right-position-fo.patch +Patch4: 0004-Add-MLT_REPOSITORY_DENY-envvar-to-skip-plugin-loadin.patch +Patch5: 0005-Avoid-to-load-both-qt-modules-816.patch BuildRequires: cmake BuildRequires: fdupes BuildRequires: gcc-c++ +%if %{with Qt6} && 0%{?sle_version} +# Qt 6 requires a compiler that fully supports c++-17 +BuildRequires: gcc10-c++ +%endif BuildRequires: ladspa-devel BuildRequires: pkgconfig BuildRequires: python-rpm-macros @@ -46,6 +60,13 @@ BuildRequires: cmake(Qt5Svg) BuildRequires: cmake(Qt5Widgets) BuildRequires: cmake(Qt5Xml) +%if %{with Qt6} +BuildRequires: cmake(Qt6Core) +BuildRequires: cmake(Qt6Core5Compat) +BuildRequires: cmake(Qt6Gui) +BuildRequires: cmake(Qt6SvgWidgets) +BuildRequires: cmake(Qt6Xml) +%endif BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(fftw3) BuildRequires: pkgconfig(frei0r) @@ -148,6 +169,25 @@ The functionality of the system is provided via an assortment of tools, XML authoring components, and an plug-in based API. +%if %{with Qt6} +# Creating a distinct Qt 6 module avoids pulling Qt 6 when installing the +# libmlt modules package +%package -n %{libname}%{sover}-module-qt6 +Summary: Qt 6 module for the MLT multimedia framework +Group: Productivity/Multimedia/Video/Editors and Convertors +Requires: %{libname}%{sover}-modules + +%description -n %{libname}%{sover}-module-qt6 +MLT is a multimedia framework for television broadcasting. It +provides a toolkit for broadcasters, video editors, media players, +transcoders and web streamers. + +The functionality of the system is provided via an assortment of +tools, XML authoring components, and an plug-in based API. + +This package provides a Qt 6 module for MLT. +%endif + %package -n %{libname}%{sover}-data Summary: Architecture-independent data files for the MLT multimedia framework Group: Productivity/Multimedia/Video/Editors and Convertors @@ -176,6 +216,10 @@ %autosetup -p1 -n %{_name}-%{version} %build +%if %{with Qt6} && 0%{?sle_version} +export CC=gcc-10 CXX=g++-10 +%endif + # WARNING: building opencv module causes multicore issues - boo#1068792 %cmake \ %if 0%{?suse_version} > 1501 @@ -186,7 +230,11 @@ -DGPL=ON \ -DGPL3=ON \ -DSWIG_PYTHON=ON \ - -DCMAKE_SKIP_RPATH=1 + -DCMAKE_SKIP_RPATH=1 \ +%if %{with Qt6} + -DMOD_QT6=ON +%endif + %cmake_build %install @@ -196,11 +244,15 @@ for MODULE in %{buildroot}%{_libdir}/mlt-%{sover}/libmlt*.so; do echo $MODULE MODULEDIR=%{_datadir}/mlt-%{sover}/$(echo $MODULE | sed 's|%{buildroot}%{_libdir}/mlt-%{sover}/libmlt\(.*\).so|\1|') + if [[ "$MODULEDIR" =~ "qt6" ]]; then + echo "Ignoring $MODULEDIR" + continue + fi echo $MODULEDIR if [ -e %{buildroot}$MODULEDIR ]; then echo Done $MODULEDIR echo $MODULEDIR >> module_data.dirs - fi; + fi done #Link man melt to man melt-7 @@ -243,6 +295,15 @@ %license GPLv3 COPYING GPL %{_libdir}/%{_name}-%{sover} %dir %{_datadir}/%{_name}-%{sover}/ +%exclude %{_libdir}/%{_name}-%{sover}/libmltqt6.so + +%if %{with Qt6} +%files -n %{libname}%{sover}-module-qt6 +%dir %{_libdir}/%{_name}-%{sover} +%{_libdir}/%{_name}-%{sover}/libmltqt6.so +%dir %{_datadir}/%{_name}-%{sover}/ +%{_datadir}/%{_name}-%{sover}/qt6/ +%endif %files -n %{libname}%{sover}-data %dir %{_datadir}/%{_name}-%{sover}/ ++++++ 0001-Split-to-allow-installing-Qt5-and-Qt6-in-parallel-80.patch ++++++ >From 89dd75355c5506ae27fa12e8ee9ed10f246e069d Mon Sep 17 00:00:00 2001 From: jlskuz <78424983+jls...@users.noreply.github.com> Date: Sat, 30 Jul 2022 22:15:55 +0200 Subject: [PATCH 1/5] Split to allow installing Qt5 and Qt6 in parallel (#807) --- CMakeLists.txt | 64 +++++---- src/modules/CMakeLists.txt | 4 +- src/modules/glaxnimate/CMakeLists.txt | 105 +++++++++------ src/modules/qt/CMakeLists.txt | 180 +++++++++++++++----------- 4 files changed, 210 insertions(+), 143 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f838b0..ea2c782 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,13 +11,14 @@ option(GPL "Enable GPLv2 components" ON) option(GPL3 "Enable GPLv3 components" ON) option(BUILD_TESTING "Enable tests" OFF) option(BUILD_DOCS "Enable Doxygen documentation" OFF) -option(BUILD_WITH_QT6 "Build against Qt 6" OFF) +option(BUILD_TESTS_WITH_QT6 "Build test against Qt 6" OFF) option(MOD_AVFORMAT "Enable avformat module" ON) option(MOD_DECKLINK "Enable DeckLink module" ON) option(MOD_FREI0R "Enable Frei0r module" ON) option(MOD_GDK "Enable GDK module" ON) -option(MOD_GLAXNIMATE "Enable Glaxnimate module" OFF) +option(MOD_GLAXNIMATE "Enable Glaxnimate module (Qt5)" OFF) +#option(MOD_GLAXNIMATE_QT6 "Enable Glaxnimate module (Qt6)" OFF) option(MOD_JACKRACK "Enable JACK Rack module" ON) option(MOD_KDENLIVE "Enable Kdenlive module" ON) option(MOD_NDI "Enable NDI module" OFF) @@ -27,7 +28,8 @@ option(MOD_OPENCV "Enable OpenCV module" OFF) option(MOD_MOVIT "Enable OpenGL module" ON) option(MOD_PLUS "Enable Plus module" ON) option(MOD_PLUSGPL "Enable PlusGPL module (GPL)" ON) -option(MOD_QT "Enable Qt module (GPL)" ON) +option(MOD_QT "Enable Qt5 module (GPL)" ON) +option(MOD_QT6 "Enable Qt6 module (GPL)" OFF) option(MOD_RESAMPLE "Enable Resample module (GPL)" ON) option(MOD_RTAUDIO "Enable RtAudio module" ON) option(MOD_RUBBERBAND "Enable Rubberband module (GPL)" ON) @@ -151,6 +153,7 @@ if(NOT GPL) set(MOD_NORMALIZE OFF) set(MOD_PLUSGPL OFF) set(MOD_QT OFF) + set(MOD_QT6 OFF) set(MOD_RESAMPLE OFF) set(MOD_RUBBERBAND OFF) set(MOD_VIDSTAB OFF) @@ -170,7 +173,7 @@ endif() pkg_check_modules(sdl2 IMPORTED_TARGET sdl2) -if (BUILD_WITH_QT6) +if (BUILD_TESTS_WITH_QT6) set(QT_MAJOR_VERSION 6) else() set(QT_MAJOR_VERSION 5) @@ -182,14 +185,14 @@ if(BUILD_TESTING) enable_testing() endif() -if(MOD_QT OR MOD_PLUS) +if(MOD_QT OR MOD_QT6 OR MOD_PLUS) pkg_check_modules(FFTW IMPORTED_TARGET fftw3) if(NOT FFTW_FOUND) pkg_check_modules(FFTW IMPORTED_TARGET fftw) endif() endif() -if(MOD_QT OR MOD_GDK) +if(MOD_QT OR MOD_QT6 OR MOD_GDK) pkg_check_modules(libexif IMPORTED_TARGET libexif) endif() @@ -240,15 +243,6 @@ if(MOD_GDK) endif() endif() -if(MOD_GLAXNIMATE) - find_package(Qt${QT_MAJOR_VERSION} COMPONENTS Core Gui Widgets Xml) - if(Qt${QT_MAJOR_VERSION}_FOUND) - list(APPEND MLT_SUPPORTED_COMPONENTS qt) - else() - set(MOD_GLAXNIMATE OFF) - endif() -endif() - if(MOD_JACKRACK) find_package(JACK) pkg_check_modules(glib IMPORTED_TARGET glib-2.0) @@ -304,20 +298,42 @@ if(MOD_PLUSGPL) list(APPEND MLT_SUPPORTED_COMPONENTS plusgpl) endif() -if(MOD_QT) - find_package(Qt${QT_MAJOR_VERSION} COMPONENTS Core Xml) - if(QT_MAJOR_VERSION EQUAL 6) - find_package(Qt${QT_MAJOR_VERSION} COMPONENTS SvgWidgets Core5Compat) +if(MOD_QT6) + find_package(Qt6 COMPONENTS Core Gui Xml SvgWidgets Core5Compat) + if(Qt6_FOUND) + list(APPEND MLT_SUPPORTED_COMPONENTS qt6) else() - find_package(Qt${QT_MAJOR_VERSION} COMPONENTS Gui Svg Widgets) + set(MOD_QT6 OFF) endif() - if(Qt${QT_MAJOR_VERSION}_FOUND) +endif() + +#if(MOD_GLAXNIMATE_QT6) +# find_package(Qt6 COMPONENTS Core Gui Widgets Xml) +# if(Qt6_FOUND) +# list(APPEND MLT_SUPPORTED_COMPONENTS glaxnimate-qt6) +# else() +# set(MOD_GLAXNIMATE_QT6 OFF) +# endif() +#endif() + +if(MOD_QT) + find_package(Qt5 COMPONENTS Core Xml Gui Svg Widgets) + if(Qt5_FOUND) list(APPEND MLT_SUPPORTED_COMPONENTS qt) else() set(MOD_QT OFF) endif() endif() +if(MOD_GLAXNIMATE) + find_package(Qt5 COMPONENTS Core Gui Widgets Xml) + if(Qt5_FOUND) + list(APPEND MLT_SUPPORTED_COMPONENTS glaxnimate) + else() + set(MOD_GLAXNIMATE OFF) + endif() +endif() + if(MOD_RESAMPLE) pkg_check_modules(samplerate IMPORTED_TARGET samplerate) if(TARGET PkgConfig::samplerate) @@ -511,7 +527,8 @@ add_feature_info("Module: avformat" MOD_AVFORMAT "") add_feature_info("Module: DeckLink" MOD_DECKLINK "") add_feature_info("Module: Frei0r" MOD_FREI0R "") add_feature_info("Module: GDK" MOD_GDK "") -add_feature_info("Module: Glaxnimate" MOD_GLAXNIMATE "") +add_feature_info("Module: Glaxnimate (Qt5)" MOD_GLAXNIMATE "") +#add_feature_info("Module: Glaxnimate (Qt6)" MOD_GLAXNIMATE_QT6 "") add_feature_info("Module: JACKRack" MOD_JACKRACK "") add_feature_info("Module: Kdenlive" MOD_KDENLIVE "") add_feature_info("Module: NDI" MOD_NDI "") @@ -521,7 +538,8 @@ add_feature_info("Module: OpenCV" MOD_OPENCV "") add_feature_info("Module: Movit" MOD_MOVIT "") add_feature_info("Module: Plus" MOD_PLUS "") add_feature_info("Module: PlusGPL" MOD_PLUSGPL "") -add_feature_info("Module: Qt" MOD_QT "") +add_feature_info("Module: Qt (Qt5)" MOD_QT "") +add_feature_info("Module: Qt6" MOD_QT6 "") add_feature_info("Module: Resample" MOD_RESAMPLE "") add_feature_info("Module: RtAudio" MOD_RTAUDIO "") add_feature_info("Module: Rubberband" MOD_RUBBERBAND "") diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index 1effa74..0c8dcdb 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -16,7 +16,7 @@ if(MOD_GDK) add_subdirectory(gdk) endif() -if(MOD_GLAXNIMATE) +if(MOD_GLAXNIMATE OR MOD_GLAXNIMATE_QT6) add_subdirectory(glaxnimate) endif() @@ -56,7 +56,7 @@ if(MOD_PLUSGPL) add_subdirectory(plusgpl) endif() -if(MOD_QT) +if(MOD_QT OR MOD_QT6) add_subdirectory(qt) endif() diff --git a/src/modules/glaxnimate/CMakeLists.txt b/src/modules/glaxnimate/CMakeLists.txt index f00b4d0..eecf2fa 100644 --- a/src/modules/glaxnimate/CMakeLists.txt +++ b/src/modules/glaxnimate/CMakeLists.txt @@ -118,50 +118,75 @@ set(GLAX_SOURCES ${CORE_DIR}utils/tar.cpp ) -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/${CORE_DIR}application_info_generated.in.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/${CORE_DIR}application_info_generated.hpp" -) +function(mlt_add_glaxnimate_module ARG_TARGET) + cmake_parse_arguments(PARSE_ARGV 1 ARG "" "QT_VERSION;DATADIR" "") -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/${APP_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/${CORE_DIR}) -include_directories(${LibArchive_INCLUDE_DIRS}) -add_library(mltglaxnimate MODULE - producer_glaxnimate.cpp - ${GLAX_SOURCES} -) + if ("${ARG_TARGET}" STREQUAL "") + message(FATAL_ERROR "mlt_add_glaxnimate_module called without a valid target name.") + endif() -target_compile_options(mltglaxnimate PRIVATE ${MLT_COMPILE_OPTIONS}) -add_definitions(-DWITHOUT_POTRACE -DWITHOUT_QT_COLOR_WIDGETS) - -find_package(LibArchive REQUIRED) -find_package(ZLIB REQUIRED) - -set_property(TARGET mltglaxnimate APPEND PROPERTY AUTOMOC_MACRO_NAMES "GLAXNIMATE_OBJECT") - -target_link_libraries(mltglaxnimate PRIVATE - mlt++ - mlt - m - Threads::Threads - Qt${QT_MAJOR_VERSION}::Core - Qt${QT_MAJOR_VERSION}::Gui - Qt${QT_MAJOR_VERSION}::Widgets - Qt${QT_MAJOR_VERSION}::Xml - ${LibArchive_LIBRARIES} - ZLIB::ZLIB -) + if (NOT (("${ARG_QT_VERSION}" STREQUAL "5") OR ("${ARG_QT_VERSION}" STREQUAL "6"))) + message(FATAL_ERROR "mlt_add_glaxnimate_module called without a valid Qt Version (allowed are 5 or 6).") + endif() -if(NOT WINDOWS_DEPLOY) - target_compile_definitions(mltglaxnimate PRIVATE NODEPLOY) -endif() + if ("${ARG_DATADIR}" STREQUAL "") + message(FATAL_ERROR "mlt_add_glaxnimate_module called without a valid data dir name.") + endif() -set_target_properties(mltglaxnimate PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}") + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/${CORE_DIR}application_info_generated.in.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/${CORE_DIR}application_info_generated.hpp" + ) -install(TARGETS mltglaxnimate LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/${APP_DIR}) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/${CORE_DIR}) + include_directories(${LibArchive_INCLUDE_DIRS}) -install(FILES - producer_glaxnimate.yml - DESTINATION ${MLT_INSTALL_DATA_DIR}/glaxnimate -) + add_library(${ARG_TARGET} MODULE + producer_glaxnimate.cpp + ${GLAX_SOURCES} + ) + + target_compile_options(${ARG_TARGET} PRIVATE ${MLT_COMPILE_OPTIONS}) + add_definitions(-DWITHOUT_POTRACE -DWITHOUT_QT_COLOR_WIDGETS) + + find_package(LibArchive REQUIRED) + find_package(ZLIB REQUIRED) + + set_property(TARGET ${ARG_TARGET} APPEND PROPERTY AUTOMOC_MACRO_NAMES "GLAXNIMATE_OBJECT") + + target_link_libraries(${ARG_TARGET} PRIVATE + mlt++ + mlt + m + Threads::Threads + Qt${ARG_QT_VERSION}::Core + Qt${ARG_QT_VERSION}::Gui + Qt${ARG_QT_VERSION}::Widgets + Qt${ARG_QT_VERSION}::Xml + ${LibArchive_LIBRARIES} + ZLIB::ZLIB + ) + + if(NOT WINDOWS_DEPLOY) + target_compile_definitions(${ARG_TARGET} PRIVATE NODEPLOY) + endif() + + set_target_properties(${ARG_TARGET} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}") + + install(TARGETS ${ARG_TARGET} LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) + + install(FILES + producer_glaxnimate.yml + DESTINATION ${MLT_INSTALL_DATA_DIR}/${ARG_DATADIR} + ) +endfunction() + +if(MOD_GLAXNIMATE) + mlt_add_glaxnimate_module(mltglaxnimate QT_VERSION 5 DATADIR glaxnimate) +endif() + +#if(MOD_GLAXNIMATE_QT6) + #mlt_add_glaxnimate_module(mltglaxnimate-qt6 QT_VERSION 6 DATADIR glaxnimate-qt6) +#endif() diff --git a/src/modules/qt/CMakeLists.txt b/src/modules/qt/CMakeLists.txt index 35802b1..604efc5 100644 --- a/src/modules/qt/CMakeLists.txt +++ b/src/modules/qt/CMakeLists.txt @@ -1,87 +1,111 @@ set(CMAKE_AUTOMOC ON) -add_library(mltqt MODULE - factory.c - producer_qimage.c - producer_kdenlivetitle.c - common.cpp graph.cpp - qimage_wrapper.cpp - kdenlivetitle_wrapper.cpp - filter_audiolevelgraph.cpp - filter_audiowaveform.cpp - filter_qtext.cpp - filter_qtblend.cpp - filter_qtcrop.cpp - producer_qtext.cpp - transition_qtblend.cpp - consumer_qglsl.cpp - filter_typewriter.cpp - typewriter.cpp -) - -target_compile_options(mltqt PRIVATE ${MLT_COMPILE_OPTIONS}) - -target_link_libraries(mltqt PRIVATE - mlt++ - mlt - m - Threads::Threads - Qt${QT_MAJOR_VERSION}::Core - Qt${QT_MAJOR_VERSION}::Xml -) - -if(QT_MAJOR_VERSION EQUAL 6) - target_link_libraries(mltqt PRIVATE - Qt${QT_MAJOR_VERSION}::SvgWidgets - Qt${QT_MAJOR_VERSION}::Core5Compat - ) -else() - target_link_libraries(mltqt PRIVATE - Qt${QT_MAJOR_VERSION}::Svg - Qt${QT_MAJOR_VERSION}::Widgets - Qt${QT_MAJOR_VERSION}::Gui - ) -endif() +function(mlt_add_qt_module ARG_TARGET) + cmake_parse_arguments(PARSE_ARGV 1 ARG "" "QT_VERSION;DATADIR" "") -target_compile_definitions(mltqt PRIVATE USE_QT_OPENGL) + if ("${ARG_TARGET}" STREQUAL "") + message(FATAL_ERROR "mlt_add_qt_module called without a valid target name.") + endif() -if(NOT WINDOWS_DEPLOY) - target_compile_definitions(mltqt PRIVATE NODEPLOY) -endif() + if (NOT (("${ARG_QT_VERSION}" STREQUAL "5") OR ("${ARG_QT_VERSION}" STREQUAL "6"))) + message(FATAL_ERROR "mlt_add_qt_module called without a valid Qt Version (allowed are 5 or 6).") + endif() -if(GPL3) - target_sources(mltqt PRIVATE transition_vqm.cpp) - target_compile_definitions(mltqt PRIVATE GPL3) - install(FILES transition_vqm.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/qt) -endif() + if ("${ARG_DATADIR}" STREQUAL "") + message(FATAL_ERROR "mlt_add_qt_module called without a valid data dir name.") + endif() -if(TARGET PkgConfig::FFTW) - target_sources(mltqt PRIVATE filter_audiospectrum.cpp filter_lightshow.cpp) - target_link_libraries(mltqt PRIVATE PkgConfig::FFTW) - target_compile_definitions(mltqt PRIVATE USE_FFTW) - install(FILES filter_audiospectrum.yml filter_lightshow.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/qt) -endif() + add_library(${ARG_TARGET} MODULE + factory.c + producer_qimage.c + producer_kdenlivetitle.c + common.cpp graph.cpp + qimage_wrapper.cpp + kdenlivetitle_wrapper.cpp + filter_audiolevelgraph.cpp + filter_audiowaveform.cpp + filter_qtext.cpp + filter_qtblend.cpp + filter_qtcrop.cpp + producer_qtext.cpp + transition_qtblend.cpp + consumer_qglsl.cpp + filter_typewriter.cpp + typewriter.cpp + ) + + target_compile_options(${ARG_TARGET} PRIVATE ${MLT_COMPILE_OPTIONS}) + + target_link_libraries(${ARG_TARGET} PRIVATE + mlt++ + mlt + m + Threads::Threads + Qt${ARG_QT_VERSION}::Core + Qt${ARG_QT_VERSION}::Gui + Qt${ARG_QT_VERSION}::Xml + ) + + if(ARG_QT_VERSION EQUAL 6) + target_link_libraries(${ARG_TARGET} PRIVATE + Qt6::SvgWidgets + Qt6::Core5Compat + ) + else() + target_link_libraries(${ARG_TARGET} PRIVATE + Qt${ARG_QT_VERSION}::Svg + Qt${ARG_QT_VERSION}::Widgets + ) + endif() + + target_compile_definitions(${ARG_TARGET} PRIVATE USE_QT_OPENGL) -if(TARGET PkgConfig::libexif) - target_link_libraries(mltqt PRIVATE PkgConfig::libexif) - target_compile_definitions(mltqt PRIVATE USE_EXIF) + if(NOT WINDOWS_DEPLOY) + target_compile_definitions(${ARG_TARGET} PRIVATE NODEPLOY) + endif() + + if(GPL3) + target_sources(${ARG_TARGET} PRIVATE transition_vqm.cpp) + target_compile_definitions(${ARG_TARGET} PRIVATE GPL3) + install(FILES transition_vqm.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/${ARG_DATADIR}) + endif() + + if(TARGET PkgConfig::FFTW) + target_sources(${ARG_TARGET} PRIVATE filter_audiospectrum.cpp filter_lightshow.cpp) + target_link_libraries(${ARG_TARGET} PRIVATE PkgConfig::FFTW) + target_compile_definitions(${ARG_TARGET} PRIVATE USE_FFTW) + install(FILES filter_audiospectrum.yml filter_lightshow.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/${ARG_DATADIR}) + endif() + + if(TARGET PkgConfig::libexif) + target_link_libraries(${ARG_TARGET} PRIVATE PkgConfig::libexif) + target_compile_definitions(${ARG_TARGET} PRIVATE USE_EXIF) + endif() + + set_target_properties(${ARG_TARGET} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}") + + install(TARGETS ${ARG_TARGET} LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) + + install(FILES + filter_audiolevelgraph.yml + filter_audiospectrum.yml + filter_audiowaveform.yml + filter_qtblend.yml + filter_qtcrop.yml + filter_qtext.yml + filter_typewriter.yml + producer_kdenlivetitle.yml + producer_qimage.yml + producer_qtext.yml + transition_qtblend.yml + DESTINATION ${MLT_INSTALL_DATA_DIR}/${ARG_DATADIR} + ) +endfunction() + +if (MOD_QT) + mlt_add_qt_module(mltqt QT_VERSION 5 DATADIR qt) endif() -set_target_properties(mltqt PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}") - -install(TARGETS mltqt LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) - -install(FILES - filter_audiolevelgraph.yml - filter_audiospectrum.yml - filter_audiowaveform.yml - filter_qtblend.yml - filter_qtcrop.yml - filter_qtext.yml - filter_typewriter.yml - producer_kdenlivetitle.yml - producer_qimage.yml - producer_qtext.yml - transition_qtblend.yml - DESTINATION ${MLT_INSTALL_DATA_DIR}/qt -) +if (MOD_QT6) + mlt_add_qt_module(mltqt6 QT_VERSION 6 DATADIR qt6) +endif() -- 2.37.1 ++++++ 0002-Remove-deprecated-C-register-keyword-815.patch ++++++ >From ee1716464a37e7db85dbadbedb2ba21758ccdb78 Mon Sep 17 00:00:00 2001 From: jlskuz <78424983+jls...@users.noreply.github.com> Date: Sat, 30 Jul 2022 19:51:05 +0200 Subject: [PATCH 2/5] Remove deprecated C++ register keyword (#815) See https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/ n4193.html#809 Co-authored-by: Christophe Giboudeaux --- src/modules/qt/producer_qtext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/qt/producer_qtext.cpp b/src/modules/qt/producer_qtext.cpp index 84239cb..d9cc32a 100644 --- a/src/modules/qt/producer_qtext.cpp +++ b/src/modules/qt/producer_qtext.cpp @@ -71,11 +71,11 @@ static void copy_qimage_to_mlt_image( QImage* qImg, uint8_t* mImg ) static void copy_image_to_alpha( uint8_t* image, uint8_t* alpha, int width, int height ) { - register int len = width * height; + int len = width * height; // Extract the alpha mask from the RGBA image using Duff's Device - register uint8_t *s = image + 3; // start on the alpha component - register uint8_t *d = alpha; - register int n = ( len + 7 ) / 8; + uint8_t *s = image + 3; // start on the alpha component + uint8_t *d = alpha; + int n = ( len + 7 ) / 8; switch ( len % 8 ) { -- 2.37.1 ++++++ 0003-Move-CMake-code-for-testing-to-the-right-position-fo.patch ++++++ >From 26a6071c91eefc68fa557972bbca558385f1711d Mon Sep 17 00:00:00 2001 From: jlskuz <78424983+jls...@users.noreply.github.com> Date: Wed, 3 Aug 2022 01:35:17 +0200 Subject: [PATCH 3/5] Move CMake code for testing to the right position (for Qt) (#817) --- CMakeLists.txt | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea2c782..9ddaf0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,18 +173,6 @@ endif() pkg_check_modules(sdl2 IMPORTED_TARGET sdl2) -if (BUILD_TESTS_WITH_QT6) - set(QT_MAJOR_VERSION 6) -else() - set(QT_MAJOR_VERSION 5) -endif() - -if(BUILD_TESTING) - find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Core Test) - find_package(Kwalify REQUIRED) - enable_testing() -endif() - if(MOD_QT OR MOD_QT6 OR MOD_PLUS) pkg_check_modules(FFTW IMPORTED_TARGET fftw3) if(NOT FFTW_FOUND) @@ -298,6 +286,8 @@ if(MOD_PLUSGPL) list(APPEND MLT_SUPPORTED_COMPONENTS plusgpl) endif() +# It is necessary to look for Qt6 before Qt5, otherwise there will +# be a conflict with the targets in case both are enabled if(MOD_QT6) find_package(Qt6 COMPONENTS Core Gui Xml SvgWidgets Core5Compat) if(Qt6_FOUND) @@ -307,6 +297,7 @@ if(MOD_QT6) endif() endif() + #if(MOD_GLAXNIMATE_QT6) # find_package(Qt6 COMPONENTS Core Gui Widgets Xml) # if(Qt6_FOUND) @@ -316,6 +307,18 @@ endif() # endif() #endif() +if (BUILD_TESTS_WITH_QT6) + set(QT_MAJOR_VERSION 6) +else() + set(QT_MAJOR_VERSION 5) +endif() + +if(BUILD_TESTING) + find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Core Test) + find_package(Kwalify REQUIRED) + enable_testing() +endif() + if(MOD_QT) find_package(Qt5 COMPONENTS Core Xml Gui Svg Widgets) if(Qt5_FOUND) -- 2.37.1 ++++++ 0004-Add-MLT_REPOSITORY_DENY-envvar-to-skip-plugin-loadin.patch ++++++ >From 96f53a2dbcf3efde06fec2439439bb8298248ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= <jk.kde...@smartlab.uber.space> Date: Fri, 24 Jun 2022 16:16:05 +0200 Subject: [PATCH 4/5] Add MLT_REPOSITORY_DENY envvar to skip plugin loading Use colon to separate entries Example: MLT_REPOSITORY_DENY=libmltplus:libmltavformat:libmltfrei0r Related to #801 --- src/framework/mlt_factory.h | 1 + src/framework/mlt_repository.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/framework/mlt_factory.h b/src/framework/mlt_factory.h index 5ae7f53..f590228 100644 --- a/src/framework/mlt_factory.h +++ b/src/framework/mlt_factory.h @@ -35,6 +35,7 @@ * \envvar \em MLT_REPOSITORY overrides the default location of the plugin modules, defaults to \p PREFIX_LIB. * MLT_REPOSITORY is ignored on Windows and OS X relocatable builds. * \envvar \em MLT_PRESETS_PATH overrides the default full path to the properties preset files, defaults to \p MLT_DATA/presets + * \envvar \em MLT_REPOSITORY_DENY colon seperated list of modules to skip. Example: libmltplus:libmltavformat:libmltfrei0r * \event \em producer-create-request fired when mlt_factory_producer is called; * the event data is a pointer to mlt_factory_event_data * \event \em producer-create-done fired when a producer registers itself; diff --git a/src/framework/mlt_repository.c b/src/framework/mlt_repository.c index ce73086..73d91fc 100644 --- a/src/framework/mlt_repository.c +++ b/src/framework/mlt_repository.c @@ -98,12 +98,33 @@ mlt_repository mlt_repository_init( const char *directory ) free(newpath); #endif + mlt_tokeniser tokeniser = mlt_tokeniser_init(); + int dl_length = mlt_tokeniser_parse_new( tokeniser, getenv( "MLT_REPOSITORY_DENY" ), ":" ); + // Iterate over files for ( i = 0; i < count; i++ ) { int flags = RTLD_NOW; const char *object_name = mlt_properties_get_value( dir, i); + // check if the plugin was asked to be skipped through MLT_REPOSITORY_DENY + int ignore = 0; + for (int j = 0; j < dl_length; j++ ) + { + char *denyfile = calloc( 1, strlen( directory ) + strlen( mlt_tokeniser_get_string( tokeniser, j ) ) + 2 ); + sprintf (denyfile, "%s/%s.", directory, mlt_tokeniser_get_string( tokeniser, j )); + ignore += !strncmp(object_name, denyfile, strlen( denyfile ) ); + free (denyfile); + } + + if (ignore) + { + mlt_log_info(NULL, "%s: skip plugin %s\n", __FUNCTION__, object_name); + continue; + } + + mlt_log_debug(NULL, "%s: processing plugin at %s\n", __FUNCTION__, object_name); + // Open the shared object void *object = dlopen( object_name, flags ); if ( object != NULL ) @@ -136,6 +157,8 @@ mlt_repository mlt_repository_init( const char *directory ) mlt_properties_close( dir ); + mlt_tokeniser_close( tokeniser ); + return self; } -- 2.37.1 ++++++ 0005-Avoid-to-load-both-qt-modules-816.patch ++++++ >From c180e7d22e3daa01a5e4c6b50b21bac795d8ecbe Mon Sep 17 00:00:00 2001 From: jlskuz <78424983+jls...@users.noreply.github.com> Date: Wed, 3 Aug 2022 01:23:24 +0200 Subject: [PATCH 5/5] Avoid to load both qt modules (#816) In case there is the intention to load both qt modules, qt6 will be blocked. Use MLT_REPOSITORY_DENY to block qt5 (mltqt) instead --- src/framework/mlt_factory.h | 1 + src/framework/mlt_repository.c | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/framework/mlt_factory.h b/src/framework/mlt_factory.h index f590228..c4d2cf4 100644 --- a/src/framework/mlt_factory.h +++ b/src/framework/mlt_factory.h @@ -36,6 +36,7 @@ * MLT_REPOSITORY is ignored on Windows and OS X relocatable builds. * \envvar \em MLT_PRESETS_PATH overrides the default full path to the properties preset files, defaults to \p MLT_DATA/presets * \envvar \em MLT_REPOSITORY_DENY colon seperated list of modules to skip. Example: libmltplus:libmltavformat:libmltfrei0r + * In case both qt5 and qt6 modules are found and none of both is blocked by MLT_REPOSITORY_DENY, qt6 will be blocked * \event \em producer-create-request fired when mlt_factory_producer is called; * the event data is a pointer to mlt_factory_event_data * \event \em producer-create-done fired when a producer registers itself; diff --git a/src/framework/mlt_repository.c b/src/framework/mlt_repository.c index 73d91fc..4ad732b 100644 --- a/src/framework/mlt_repository.c +++ b/src/framework/mlt_repository.c @@ -101,6 +101,24 @@ mlt_repository mlt_repository_init( const char *directory ) mlt_tokeniser tokeniser = mlt_tokeniser_init(); int dl_length = mlt_tokeniser_parse_new( tokeniser, getenv( "MLT_REPOSITORY_DENY" ), ":" ); + // check if both qt5 and qt6 modules are available??? + int qtmodules = 0; + for ( i = 0; i < count; i++ ) + { + const char *object_name = mlt_properties_get_value( dir, i); + qtmodules += strncmp(object_name, "mltqt", strlen( "mltqt" ) ); + qtmodules += strncmp(object_name, "mltqt6", strlen( "mltqt6" ) ); + } + // ???and not blocked + for (int j = 0; j < dl_length; j++ ) + { + char *denyfile = calloc( 1, strlen( directory ) + strlen( mlt_tokeniser_get_string( tokeniser, j ) ) + 3 ); + sprintf (denyfile, "%s/%s.", directory, mlt_tokeniser_get_string( tokeniser, j )); + qtmodules -= !strncmp("mltqt", denyfile, strlen( denyfile ) ); + qtmodules -= !strncmp("mltqt6", denyfile, strlen( denyfile ) ); + free (denyfile); + } + // Iterate over files for ( i = 0; i < count; i++ ) { @@ -111,12 +129,18 @@ mlt_repository mlt_repository_init( const char *directory ) int ignore = 0; for (int j = 0; j < dl_length; j++ ) { - char *denyfile = calloc( 1, strlen( directory ) + strlen( mlt_tokeniser_get_string( tokeniser, j ) ) + 2 ); + char *denyfile = calloc( 1, strlen( directory ) + strlen( mlt_tokeniser_get_string( tokeniser, j ) ) + 3 ); sprintf (denyfile, "%s/%s.", directory, mlt_tokeniser_get_string( tokeniser, j )); ignore += !strncmp(object_name, denyfile, strlen( denyfile ) ); free (denyfile); } + // in case we have both qt modules, we block qt6 to avoid conflicts + if (qtmodules == 2 && strncmp(object_name, "mltqt6", strlen( "mltqt6" ) ) ) + { + ignore = 1; + } + if (ignore) { mlt_log_info(NULL, "%s: skip plugin %s\n", __FUNCTION__, object_name); -- 2.37.1