commit:     92cb4183bc2f0885ab438666242524e3e2ff59bc
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 21 15:25:25 2026 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Feb 28 20:57:59 2026 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=92cb4183

ecm.eclass: Cleanup KF5 support

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

 eclass/ecm.eclass | 144 ++++++++++++++++--------------------------------------
 1 file changed, 41 insertions(+), 103 deletions(-)

diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass
index 0b64e1c24a..8d675ad953 100644
--- a/eclass/ecm.eclass
+++ b/eclass/ecm.eclass
@@ -49,10 +49,9 @@ fi
 
 # @ECLASS_VARIABLE: ECM_NONGUI
 # @DESCRIPTION:
-# By default, for all CATEGORIES except kde-frameworks, assume we are building
-# a GUI application. Add dependency on kde-frameworks/breeze-icons or
-# kde-frameworks/oxygen-icons. With KFMIN lower than 6.9.0, inherit xdg.eclass,
-# run pkg_preinst, pkg_postinst and pkg_postrm. If set to "true", do nothing.
+# By default, for all CATEGORIES except kde-frameworks, set to "false", which
+# assumes we are building a GUI application, and depend on breeze-icons or
+# oxygen-icons.  If set to "true", do nothing.
 : "${ECM_NONGUI:=false}"
 if [[ ${CATEGORY} == kde-frameworks ]]; then
        ECM_NONGUI=true
@@ -81,28 +80,27 @@ fi
 # Will accept "true", "false", "optional", "forceoptional", "forceoff".
 # If set to "false" (default), do nothing.
 # Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and let
-# KF${_KFSLOT}DocTools generate and install the handbook from docbook file(s)
-# found in ECM_HANDBOOK_DIR. However if !handbook, disable build of
-# ECM_HANDBOOK_DIR in CMakeLists.txt.
-# If set to "optional", build with
-# -DCMAKE_DISABLE_FIND_PACKAGE_KF${_KFSLOT}DocTools=ON when !handbook. In case
-# package requires KF5KDELibs4Support, see next:
-# If set to "forceoptional", remove a KF${_KFSLOT}DocTools dependency from the
-# root CMakeLists.txt in addition to the above.
+# KF6DocTools generate and install the handbook from docbook file(s) found in
+# ECM_HANDBOOK_DIR. However if !handbook, disable build of ECM_HANDBOOK_DIR in
+# CMakeLists.txt.
+# If set to "optional", build with -DCMAKE_DISABLE_FIND_PACKAGE_KF6DocTools=ON
+# when !handbook.
+# If set to "forceoptional", remove a KF6DocTools dependency from the root
+# CMakeLists.txt in addition to the above.
 : "${ECM_HANDBOOK:=false}"
 
 # @ECLASS_VARIABLE: ECM_HANDBOOK_DIR
 # @DESCRIPTION:
 # Specifies the directory containing the docbook file(s) relative to ${S} to
-# be processed by KF${_KFSLOT}DocTools (kdoctools_install).
+# be processed by KF6DocTools (kdoctools_install).
 : "${ECM_HANDBOOK_DIR:=doc}"
 
 # @ECLASS_VARIABLE: ECM_PO_DIRS
 # @PRE_INHERIT
 # @DESCRIPTION:
 # Specifies directories of l10n files relative to ${S} to be processed by
-# KF${_KFSLOT}I18n (ki18n_install). If IUSE nls exists and is disabled then
-# disable build of these directories in CMakeLists.txt.
+# KF6I18n (ki18n_install). If IUSE nls exists and is disabled then disable
+# build of these directories in CMakeLists.txt.
 if [[ ${ECM_PO_DIRS} ]]; then
        [[ ${ECM_PO_DIRS@a} == *a* ]] ||
                die "ECM_PO_DIRS must be an array"
@@ -124,10 +122,10 @@ fi
 # If set to "true", add "doc" to IUSE, add the appropriate dependency, let
 # -DBUILD_QCH=ON generate and install Qt compressed help files when USE=doc.
 # If set to "false", do nothing.
-if [[ ${CATEGORY} = kde-frameworks && ${_KFSLOT} == 5 ]]; then
+if [[ ${CATEGORY} = kde-frameworks ]]; then
 # TODO: Implement KF 6.15 changes how API documentation is built. See also:
 #   https://mail.kde.org/pipermail/distributions/2025-June/001595.html
-       : "${ECM_QTHELP:=true}"
+       : "${ECM_QTHELP:=false}"
 fi
 : "${ECM_QTHELP:=false}"
 
@@ -144,20 +142,14 @@ fi
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Will accept "true", "false", "forceoptional", and "forceoptional-recursive".
-# For KF5-based ebuilds, additionally accepts "optional".
 # Default value is "false", except for CATEGORY=kde-frameworks where it is
 # set to "true". If set to "false", do nothing.
 # For any other value, add "test" to IUSE. If set to "forceoptional", ignore
-# "autotests", "test", "tests" subdirs from top-level CMakeLists.txt when
-# USE=!test. If set to "forceoptional-recursive", make autotest(s), unittest(s)
+# "appiumtests", "autotests", "test", "tests" subdirs from root CMakeLists.txt
+# when USE=!test. If set to "forceoptional-recursive", make autotest(s), 
unittest(s)
 # and test(s) subdirs from *any* CMakeLists.txt in ${S} and below conditional
 # on BUILD_TESTING when USE=!test. This is always meant as a short-term fix and
 # creates ${T}/${P}-tests-optional.patch to refine and submit upstream.
-# For KF5-based ebuilds:
-# Additionally DEPEND on dev-qt/qttest:5 if USE=test, but punt Qt5Test
-# dependency if set to "forceoptional*" with USE=!test.
-# If set to "optional", build with -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON
-# when USE=!test.
 if [[ ${CATEGORY} = kde-frameworks ]]; then
        : "${ECM_TEST:=true}"
 fi
@@ -168,33 +160,17 @@ fi
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Minimum version of Frameworks to require. Default value for kde-frameworks
-# is ${PV} and 5.116.0 baseline for everything else.
-# If set to >=5.240, KF6/Qt6 is assumed thus SLOT=6 dependencies added and
-# -DQT_MAJOR_VERSION=6 added to cmake args.
+# is ${PV} and 6.22.0 baseline for everything else.  KF5 is unsupported.
 if [[ ${CATEGORY} = kde-frameworks ]]; then
        : "${KFMIN:=$(ver_cut 1-2)}"
 fi
-: "${KFMIN:=5.116.0}"
+: "${KFMIN:=6.22.0}"
 
 if ver_test ${KFMIN} -lt 6.9 && [[ ${ECM_NONGUI} == false ]]; then
        inherit xdg
 fi
 
-# @ECLASS_VARIABLE: _KFSLOT
-# @INTERNAL
-# @DESCRIPTION:
-# KDE Frameworks and Qt main slot dependency, implied by KFMIN version, *not*
-# necessarily the package's SLOT. This is being used throughout the eclass to
-# depend on either :5 or :6 Qt/KF packages as well as setting correctly
-# prefixed cmake args.
-: "${_KFSLOT:=5}"
-if [[ ${CATEGORY} == kde-frameworks ]]; then
-       ver_test ${KFMIN} -ge 5.240 && _KFSLOT=6
-else
-       if [[ ${KFMIN/.*} == 6 ]] || $(ver_test ${KFMIN} -ge 5.240); then
-               _KFSLOT=6
-       fi
-fi
+ver_test ${KFMIN} -lt 5.240 && die "KF5 is unsupported!"
 
 # @ECLASS_VARIABLE: KDE_GCC_MINIMAL
 # @DEFAULT_UNSET
@@ -233,11 +209,7 @@ esac
 case ${ECM_DESIGNERPLUGIN} in
        true)
                IUSE+=" designer"
-               if [[ ${_KFSLOT} == 6 ]]; then
-                       BDEPEND+=" designer? ( 
dev-qt/qttools:${_KFSLOT}[designer] )"
-               else
-                       BDEPEND+=" designer? ( dev-qt/designer:${_KFSLOT} )"
-               fi
+               BDEPEND+=" designer? ( dev-qt/qttools:6[designer] )"
                ;;
        false) ;;
        *)
@@ -260,7 +232,7 @@ esac
 case ${ECM_HANDBOOK} in
        true|optional|forceoptional)
                IUSE+=" +handbook"
-               BDEPEND+=" handbook? ( 
>=kde-frameworks/kdoctools-${KFMIN}:${_KFSLOT} )"
+               BDEPEND+=" handbook? ( >=kde-frameworks/kdoctools-${KFMIN}:6 )"
                ;;
        false|forceoff) ;;
        *)
@@ -281,13 +253,11 @@ esac
 case ${ECM_QTHELP} in
        true)
                IUSE+=" doc"
-               COMMONDEPEND+=" doc? ( dev-qt/qt-docs:${_KFSLOT} )"
-               BDEPEND+=" doc? ( >=app-text/doxygen-1.8.13-r1 )"
-               if [[ ${_KFSLOT} == 6 ]]; then
-                       BDEPEND+=" doc? ( dev-qt/qttools:${_KFSLOT}[assistant] 
)"
-               else
-                       BDEPEND+=" doc? ( dev-qt/qthelp:${_KFSLOT} )"
-               fi
+               COMMONDEPEND+=" doc? ( dev-qt/qt-docs:6 )"
+               BDEPEND+=" doc? (
+                       >=app-text/doxygen-1.8.13-r1
+                       dev-qt/qttools:6[assistant]
+               )"
                ;;
        false) ;;
        *)
@@ -298,10 +268,8 @@ esac
 
 case ${ECM_TEST} in
        optional)
-               if [[ ${_KFSLOT} != 5 ]]; then
-                       eerror "Banned value for \${ECM_TEST}"
-                       die "Value ${ECM_TEST} is only supported in KF5"
-               fi
+               eerror "Banned value for \${ECM_TEST}"
+               die "Value ${ECM_TEST} was only supported in KF5"
                ;;
        true|forceoptional|forceoptional-recursive) ;;
        false) ;;
@@ -319,16 +287,8 @@ if [[ ${ECM_TEST} != false ]]; then
        IUSE+=" test"
        RESTRICT+=" !test? ( test )"
 fi
-if [[ ${_KFSLOT} == 6 ]]; then
-       RDEPEND+=" >=kde-frameworks/kf-env-6"
-       COMMONDEPEND+=" dev-qt/qtbase:${_KFSLOT}"
-else
-       RDEPEND+=" >=kde-frameworks/kf-env-4"
-       COMMONDEPEND+=" dev-qt/qtcore:${_KFSLOT}"
-       if [[ ${ECM_TEST} != false ]]; then
-               DEPEND+=" test? ( dev-qt/qttest:5 )"
-       fi
-fi
+RDEPEND+=" >=kde-frameworks/kf-env-6"
+COMMONDEPEND+=" dev-qt/qtbase:6"
 
 DEPEND+=" ${COMMONDEPEND}"
 RDEPEND+=" ${COMMONDEPEND}"
@@ -337,12 +297,12 @@ unset COMMONDEPEND
 # @FUNCTION: _ecm_handbook_optional
 # @DESCRIPTION:
 # Use with ECM_HANDBOOK=optional; ticks either -DBUILD_DOC if available,
-# or -DCMAKE_DISABLE_FIND_PACKAGE_KF${_KFSLOT}DocTools
+# or -DCMAKE_DISABLE_FIND_PACKAGE_KF6DocTools
 _ecm_handbook_optional() {
        if grep -Eq "option.*BUILD_DOC" CMakeLists.txt; then
                echo "-DBUILD_DOC=$(usex handbook)"
        else
-               echo "-DCMAKE_DISABLE_FIND_PACKAGE_KF${_KFSLOT}DocTools=$(usex 
!handbook)"
+               echo "-DCMAKE_DISABLE_FIND_PACKAGE_KF6DocTools=$(usex 
!handbook)"
        fi
 }
 
@@ -587,21 +547,11 @@ ecm_src_prepare() {
 
        # limit playing field of locale stripping to kde-*/ categories
        if [[ ${CATEGORY} = kde-* ]] ; then
-               # TODO: cleanup after KF5 removal:
-               # always install unconditionally for <kconfigwidgets-6.16 - if 
you use
-               # language X as system language, and there is a combobox with 
language
-               # names, the translated language name for language Y is taken 
from
-               # /usr/share/locale/Y/kf${_KFSLOT}_entry.desktop
-               if ! [[ ${PN} == kconfigwidgets && ${_KFSLOT} == 5 ]]; then
-                       _ecm_strip_handbook_translations
-               fi
+               _ecm_strip_handbook_translations
        fi
 
        # only build unit tests when required
        if ! { in_iuse test && use test; } ; then
-               if [[ ${ECM_TEST} == forceoptional* && ${_KFSLOT} == 5 ]]; then
-                       ecm_punt_qt_module Test
-               fi
                if [[ -n ${_KDE_ORG_ECLASS} && ${ECM_TEST} != forceoptional ]]; 
then
                        cmake_comment_add_subdirectory appiumtests autotests 
test tests
                fi
@@ -631,18 +581,10 @@ ecm_src_configure() {
                append-cppflags -DQT_NO_DEBUG
        fi
 
-       local cmakeargs
+       local cmakeargs=( -DQT_MAJOR_VERSION=6 )
 
-       if [[ ${_KFSLOT} == 6 ]]; then
-               cmakeargs+=( -DQT_MAJOR_VERSION=6 )
-       fi
-
-       if in_iuse test && ! use test ; then
-               cmakeargs+=( -DBUILD_TESTING=OFF )
-
-               if [[ ${_KFSLOT} = 5 && ${ECM_TEST} = optional ]] ; then
-                       cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON )
-               fi
+       if in_iuse test; then
+               cmakeargs+=( $(usev !test -DBUILD_TESTING=OFF) )
        fi
 
        if [[ ${ECM_HANDBOOK} = optional ]] ; then
@@ -669,21 +611,17 @@ ecm_src_configure() {
                set(ECM_DISABLE_APPSTREAMTEST ON CACHE BOOL "") # 
*-disable-appstreamtest.patch
                set(ECM_DISABLE_GIT ON CACHE BOOL "") # 
*-disable-git-commit-hooks.patch
 
-               # KDEInstallDirs[56] section
+               # KDEInstallDirs6 section
                set(KDE_INSTALL_USE_QT_SYS_PATHS ON CACHE BOOL "") # install 
mkspecs in same dir as Qt stuff
                # move handbook outside of doc dir, bug #667138
                set(KDE_INSTALL_DOCBUNDLEDIR "${EPREFIX}/usr/share/help" CACHE 
PATH "")
                set(KDE_INSTALL_INFODIR "${EPREFIX}/usr/share/info" CACHE PATH 
"")
                set(KDE_INSTALL_LIBDIR $(get_libdir) CACHE PATH "Output 
directory for libraries")
                set(KDE_INSTALL_MANDIR "${EPREFIX}/usr/share/man" CACHE PATH "")
-       _EOF_
 
-       if [[ ${_KFSLOT} == 6 ]]; then
-               cat >> ${ecm_config} <<- _EOF_ || die
-                       # TODO: Ask upstream why LIBEXECDIR is set to 
EXECROOTDIR/LIBDIR/libexec, bug #928345
-                       set(KDE_INSTALL_LIBEXECDIR "${EPREFIX}/usr/libexec" 
CACHE PATH "")
-               _EOF_
-       fi
+               # TODO: Ask upstream why LIBEXECDIR is set to 
EXECROOTDIR/LIBDIR/libexec, bug #928345
+               set(KDE_INSTALL_LIBEXECDIR "${EPREFIX}/usr/libexec" CACHE PATH 
"")
+       _EOF_
 
        # allow the ebuild to override what we set here
        mycmakeargs=(

Reply via email to