commit:     f6d82cf28da6af16d16f25f06490b574e825d9a8
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat May 17 22:32:40 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat May 17 22:32:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6d82cf2

kde-frameworks/extra-cmake-modules: Fix ECMGenerateQDoc.cmake module

Making lack of qdoc and qhelpgenerator binaries nonfatal.

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../extra-cmake-modules-6.14.0-r1.ebuild           |  81 ++++++++++++
 ...-cmake-modules-6.14.0-fix-ECMGenerateQDoc.patch | 137 +++++++++++++++++++++
 2 files changed, 218 insertions(+)

diff --git 
a/kde-frameworks/extra-cmake-modules/extra-cmake-modules-6.14.0-r1.ebuild 
b/kde-frameworks/extra-cmake-modules/extra-cmake-modules-6.14.0-r1.ebuild
new file mode 100644
index 000000000000..cf299b6f3c1a
--- /dev/null
+++ b/kde-frameworks/extra-cmake-modules/extra-cmake-modules-6.14.0-r1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+QTMIN=6.7.2
+inherit cmake frameworks.kde.org python-any-r1
+
+DESCRIPTION="Extra modules and scripts for CMake"
+HOMEPAGE="https://invent.kde.org/frameworks/extra-cmake-modules";
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="doc test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="app-arch/libarchive[bzip2]"
+DEPEND="
+       test? (
+               >=dev-qt/qtbase-${QTMIN}:6[dbus,gui]
+               >=dev-qt/qtdeclarative-${QTMIN}:6
+       )
+"
+BDEPEND="
+       doc? (
+               ${PYTHON_DEPS}
+               $(python_gen_any_dep 'dev-python/sphinx[${PYTHON_USEDEP}]')
+               >=dev-qt/qttools-${QTMIN}:6[assistant]
+       )
+       test? (
+               >=dev-qt/qtbase-${QTMIN}:6
+               >=dev-qt/qttools-${QTMIN}:6[linguist]
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-5.49.0-no-fatal-warnings.patch"
+       "${FILESDIR}/${PN}-5.93.0-skip-ecm_add_test-early.patch"
+       "${FILESDIR}/${PN}-5.245.0-disable-qmlplugindump.patch"
+       "${FILESDIR}/${PN}-6.5.0-disable-appstreamtest.patch"
+       "${FILESDIR}/${PN}-6.5.0-disable-git-commit-hooks.patch"
+       "${FILESDIR}/${P}-fix-ECMGenerateQDoc.patch" # in 6.15.0
+)
+
+python_check_deps() {
+       python_has_version "dev-python/sphinx[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+       use doc && python-any-r1_pkg_setup
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DDOC_INSTALL_DIR=/usr/share/doc/"${PF}"
+               -DBUILD_QTHELP_DOCS=$(usex doc)
+               -DBUILD_HTML_DOCS=$(usex doc)
+               -DBUILD_MAN_DOCS=$(usex doc)
+               -DBUILD_TESTING=$(usex test)
+       )
+       if use test; then
+               mycmakeargs+=( -DQT_MAJOR_VERSION=6 ) # bug 938316
+       fi
+
+       cmake_src_configure
+}
+
+src_test() {
+       local CMAKE_SKIP_TESTS=(
+               # passes, but then breaks src_install
+               ECMToolchainAndroidTest
+               # broken, bug #627806
+               ECMPoQmToolsTest
+               # can not possibly succeed in releases, bug #764953
+               KDEFetchTranslations
+       )
+       # possible race condition with multiple jobs, bug #701854
+       cmake_src_test -j1
+}

diff --git 
a/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-6.14.0-fix-ECMGenerateQDoc.patch
 
b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-6.14.0-fix-ECMGenerateQDoc.patch
new file mode 100644
index 000000000000..1901c8676d0d
--- /dev/null
+++ 
b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-6.14.0-fix-ECMGenerateQDoc.patch
@@ -0,0 +1,137 @@
+From e54526054fe5f3f4b7a960bd34ba617e02bf08fb Mon Sep 17 00:00:00 2001
+From: Nicolas Fella <[email protected]>
+Date: Sat, 3 May 2025 20:10:30 +0200
+Subject: [PATCH 1/2] [ECMGenerateQDoc] Handle qdoc tool not being found
+
+---
+ modules/ECMGenerateQDoc.cmake | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/modules/ECMGenerateQDoc.cmake b/modules/ECMGenerateQDoc.cmake
+index 4ffbe836..16078b22 100644
+--- a/modules/ECMGenerateQDoc.cmake
++++ b/modules/ECMGenerateQDoc.cmake
+@@ -71,6 +71,10 @@ function(ecm_generate_qdoc target qdocconf_file)
+     set(qdoc_extra_args "")
+ 
+     if (NOT QDOC_BIN)
++        if (NOT TARGET Qt6::qdoc)
++            message("qdoc executable not found, not generating API 
documentation")
++            return()
++        endif()
+         get_target_property(QDOC_BIN Qt6::qdoc LOCATION)
+     endif()
+ 
+-- 
+2.49.0
+
+
+From 7d0fb2783b1e9564caa4198302b5512c9fc93365 Mon Sep 17 00:00:00 2001
+From: Nicolas Fella <[email protected]>
+Date: Sat, 3 May 2025 20:28:57 +0200
+Subject: [PATCH 2/2] [ECMGenerateQDoc] Handle qhelpgenerator tool not being
+ found
+
+---
+ modules/ECMGenerateQDoc.cmake | 84 ++++++++++++++++++-----------------
+ 1 file changed, 44 insertions(+), 40 deletions(-)
+
+diff --git a/modules/ECMGenerateQDoc.cmake b/modules/ECMGenerateQDoc.cmake
+index 16078b22..7062d7cf 100644
+--- a/modules/ECMGenerateQDoc.cmake
++++ b/modules/ECMGenerateQDoc.cmake
+@@ -160,47 +160,51 @@ function(ecm_generate_qdoc target qdocconf_file)
+         ${generate_qdoc_args}
+     )
+ 
+-    # generate .qch
+-    set(qch_file_name ${doc_target}.qch)
+-    set(qch_file_path ${dest_dir}/${doc_target}/${qch_file_name})
+-
+-    get_target_property(QHelpGenerator_EXECUTABLE Qt6::qhelpgenerator 
LOCATION)
+-
+-    add_custom_target(generate_qch_${target}
+-        COMMAND ${QHelpGenerator_EXECUTABLE}
+-        "${dest_dir}/html/${doc_target}.qhp"
+-        -o "${qch_file_path}"
+-    )
+-
+     add_dependencies(prepare_docs prepare_docs_${target})
+     add_dependencies(generate_docs generate_docs_${target})
+-    add_dependencies(generate_qch generate_qch_${target})
+-    add_dependencies(install_html_docs install_html_docs_${target})
+-    add_dependencies(install_qch_docs install_qch_docs_${target})
+-
+-    install(DIRECTORY "${dest_dir}/html/"
+-            DESTINATION "${KDE_INSTALL_QTQCHDIR}/${doc_target}"
+-            COMPONENT _install_html_docs_${target}
+-            EXCLUDE_FROM_ALL
+-    )
+ 
+-    add_custom_target(install_html_docs_${target}
+-        COMMAND ${CMAKE_COMMAND}
+-        --install "${CMAKE_BINARY_DIR}"
+-        --component _install_html_docs_${target}
+-        COMMENT "Installing html docs for target ${target}"
+-    )
+-
+-    install(FILES "${qch_file_path}"
+-            DESTINATION "${KDE_INSTALL_QTQCHDIR}"
+-            COMPONENT _install_qch_docs_${target}
+-            EXCLUDE_FROM_ALL
+-    )
+-
+-    add_custom_target(install_qch_docs_${target}
+-        COMMAND ${CMAKE_COMMAND}
+-        --install "${CMAKE_BINARY_DIR}"
+-        --component _install_qch_docs_${target}
+-        COMMENT "Installing qch docs for target ${target}"
+-    )
++    # generate .qch
++    if (TARGET Qt6::qhelpgenerator)
++        set(qch_file_name ${doc_target}.qch)
++        set(qch_file_path ${dest_dir}/${doc_target}/${qch_file_name})
++        get_target_property(QHelpGenerator_EXECUTABLE Qt6::qhelpgenerator 
LOCATION)
++
++        add_custom_target(generate_qch_${target}
++            COMMAND ${QHelpGenerator_EXECUTABLE}
++            "${dest_dir}/html/${doc_target}.qhp"
++            -o "${qch_file_path}"
++        )
++
++        add_dependencies(generate_qch generate_qch_${target})
++        add_dependencies(install_html_docs install_html_docs_${target})
++        add_dependencies(install_qch_docs install_qch_docs_${target})
++
++        install(DIRECTORY "${dest_dir}/html/"
++                DESTINATION "${KDE_INSTALL_QTQCHDIR}/${doc_target}"
++                COMPONENT _install_html_docs_${target}
++                EXCLUDE_FROM_ALL
++        )
++
++        add_custom_target(install_html_docs_${target}
++            COMMAND ${CMAKE_COMMAND}
++            --install "${CMAKE_BINARY_DIR}"
++            --component _install_html_docs_${target}
++            COMMENT "Installing html docs for target ${target}"
++        )
++
++        install(FILES "${qch_file_path}"
++                DESTINATION "${KDE_INSTALL_QTQCHDIR}"
++                COMPONENT _install_qch_docs_${target}
++                EXCLUDE_FROM_ALL
++        )
++
++        add_custom_target(install_qch_docs_${target}
++            COMMAND ${CMAKE_COMMAND}
++            --install "${CMAKE_BINARY_DIR}"
++            --component _install_qch_docs_${target}
++            COMMENT "Installing qch docs for target ${target}"
++        )
++    else()
++        message("qhelpgenerator executable not found, not generating API 
documentation in QCH format")
++    endif()
+ endfunction()
+-- 
+2.49.0
+

Reply via email to