commit:     86e8bf343485dc910db31d883e55aa8c02ebaac9
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  9 22:02:28 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Apr  9 22:02:50 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86e8bf34

kde-frameworks/extra-cmake-modules: Add missing patches

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...make-modules-5.93.0-disable-qmlplugindump.patch | 76 ++++++++++++++++++++++
 ...ke-modules-5.93.0-skip-ecm_add_test-early.patch | 57 ++++++++++++++++
 2 files changed, 133 insertions(+)

diff --git 
a/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-disable-qmlplugindump.patch
 
b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-disable-qmlplugindump.patch
new file mode 100644
index 000000000000..0683bd3effd9
--- /dev/null
+++ 
b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-disable-qmlplugindump.patch
@@ -0,0 +1,76 @@
+From 1c79ef2189dc156bbe0f182411bcc136f140a21d Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <ast...@gentoo.org>
+Date: Sun, 8 Dec 2019 15:01:33 +0100
+Subject: [PATCH] ECMFindQMLModule.cmake.in: Add ECM_DISABLE_QMLPLUGINDUMP to
+ avoid sandbox violations
+
+See also: https://phabricator.kde.org/D25812
+
+Backstory: https://bugzilla.gnome.org/show_bug.cgi?id=744135
+BUG: 387753
+---
+ modules/ECMFindQmlModule.cmake.in | 45 ++++++++++++++++++-------------
+ 1 file changed, 27 insertions(+), 18 deletions(-)
+
+diff --git a/modules/ECMFindQmlModule.cmake.in 
b/modules/ECMFindQmlModule.cmake.in
+index 0ee5665e..d6e1f14c 100644
+--- a/modules/ECMFindQmlModule.cmake.in
++++ b/modules/ECMFindQmlModule.cmake.in
+@@ -7,27 +7,36 @@
+ include(FindPackageHandleStandardArgs)
+ include("${ECM_MODULE_DIR}/QtVersionOption.cmake")
+ 
+-if (QT_MAJOR_VERSION EQUAL "5")
+-    include("${ECM_MODULE_DIR}/ECMQueryQt.cmake")
+-    ecm_query_qt(qt_binaries_dir QT_HOST_BINS)
+-    find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS 
${qt_binaries_dir})
+-elseif (QT_MAJOR_VERSION EQUAL "6")
+-    find_package(Qt6 COMPONENTS QmlTools REQUIRED)
+-    get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
+-endif()
+-
+-if(NOT QMLPLUGINDUMP_PROGRAM)
+-    message(WARNING "Could not find qmlplugindump. It is necessary to look up 
qml module dependencies.")
+-endif()
++option (ECM_DISABLE_QMLPLUGINDUMP "Do not use qmlplugindump which may 
segfault in some sandboxed environments" OFF)
+ 
+-execute_process(COMMAND "${QMLPLUGINDUMP_PROGRAM}" "@MODULE_NAME@" 
"@VERSION@" ERROR_VARIABLE ERRORS_OUTPUT OUTPUT_VARIABLE DISREGARD_VARIABLE 
RESULT_VARIABLE ExitCode TIMEOUT 30)
+-
+-if(ExitCode EQUAL 0)
++if(ECM_DISABLE_QMLPLUGINDUMP)
++    message(NOTICE "@GENMODULE@: qmlplugindump disabled - assuming dependency 
is available as >= @VERSION@.")
+     set(@GENMODULE@_FOUND TRUE)
+-    set(@GENMODULE@_VERSION "${PACKAGE_FIND_VERSION}")
++    set(@GENMODULE@_VERSION @VERSION@)
+ else()
+-    message(STATUS "qmlplugindump failed for @MODULE_NAME@.")
+-    set(@GENMODULE@_FOUND FALSE)
++
++    if (QT_MAJOR_VERSION EQUAL "5")
++        include("${ECM_MODULE_DIR}/ECMQueryQt.cmake")
++        ecm_query_qt(qt_binaries_dir QT_HOST_BINS)
++        find_program(QMLPLUGINDUMP_PROGRAM NAMES qmlplugindump HINTS 
${qt_binaries_dir})
++    elseif (QT_MAJOR_VERSION EQUAL "6")
++        find_package(Qt6 COMPONENTS QmlTools REQUIRED)
++        get_target_property(QMLPLUGINDUMP_PROGRAM Qt6::qmlplugindump LOCATION)
++    endif()
++
++    if(NOT QMLPLUGINDUMP_PROGRAM)
++        message(WARNING "Could not find qmlplugindump. It is necessary to 
look up qml module dependencies.")
++    endif()
++
++    execute_process(COMMAND "${QMLPLUGINDUMP_PROGRAM}" "@MODULE_NAME@" 
"@VERSION@" ERROR_VARIABLE ERRORS_OUTPUT OUTPUT_VARIABLE DISREGARD_VARIABLE 
RESULT_VARIABLE ExitCode TIMEOUT 30)
++
++    if(ExitCode EQUAL 0)
++        set(@GENMODULE@_FOUND TRUE)
++        set(@GENMODULE@_VERSION "${PACKAGE_FIND_VERSION}")
++    else()
++        message(STATUS "qmlplugindump failed for @MODULE_NAME@.")
++        set(@GENMODULE@_FOUND FALSE)
++    endif()
+ endif()
+ 
+ find_package_handle_standard_args(@GENMODULE@
+-- 
+2.35.1
+

diff --git 
a/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-skip-ecm_add_test-early.patch
 
b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-skip-ecm_add_test-early.patch
new file mode 100644
index 000000000000..f9eef600724c
--- /dev/null
+++ 
b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-skip-ecm_add_test-early.patch
@@ -0,0 +1,57 @@
+From 9b53dd107af153b88658ffa246de728a8a6fbd9d Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <ast...@gentoo.org>
+Date: Sat, 11 Jul 2020 23:04:16 +0200
+Subject: [PATCH] ECMAddTests.cmake: Skip ecm_add_test early if Qt::Test is not
+ available
+
+Signed-off-by: Andreas Sturmlechner <ast...@gentoo.org>
+---
+ modules/ECMAddTests.cmake        | 9 +++++++++
+ tests/ECMAddTests/CMakeLists.txt | 4 ++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/modules/ECMAddTests.cmake b/modules/ECMAddTests.cmake
+index 58c78d05..994ed1e4 100644
+--- a/modules/ECMAddTests.cmake
++++ b/modules/ECMAddTests.cmake
+@@ -84,6 +84,10 @@ function(ecm_add_test)
+     message(FATAL_ERROR "ecm_add_test() called with multiple source files but 
without setting \"TEST_NAME\"")
+   endif()
+ 
++  if(NOT TARGET Qt::Test)
++    return()
++  endif()
++
+   set(_testname ${ARG_NAME_PREFIX}${_targetname})
+   set(gui_args)
+   if(ARG_GUI)
+@@ -127,6 +131,11 @@ function(ecm_add_tests)
+   endif()
+   set(test_names)
+   set(target_names)
++
++  if(NOT TARGET Qt::Test)
++    return()
++  endif()
++
+   foreach(_test_source ${ARG_UNPARSED_ARGUMENTS})
+     ecm_add_test(${_test_source}
+       NAME_PREFIX ${ARG_NAME_PREFIX}
+diff --git a/tests/ECMAddTests/CMakeLists.txt 
b/tests/ECMAddTests/CMakeLists.txt
+index aa7e73a1..5fbc1cc7 100644
+--- a/tests/ECMAddTests/CMakeLists.txt
++++ b/tests/ECMAddTests/CMakeLists.txt
+@@ -2,6 +2,10 @@ if (QT_MAJOR_VERSION EQUAL "6")
+     set(QT_VERSION_OPT "-DBUILD_WITH_QT6=ON")
+ else()
+     set(QT_VERSION_OPT "-DBUILD_WITH_QT6=OFF")
++
++if(NOT TARGET Qt::Test)
++    message(STATUS "WARNING: skipping tests that require Qt::Test")
++    return()
+ endif()
+ 
+ macro(add_check NAME)
+-- 
+2.35.1
+

Reply via email to