diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2024-08-26 00:29:07 +0200 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2024-08-26 08:33:46 +0200 |
commit | 37f7986b816b46aaca8f96b49582c9c73bebaf5c (patch) | |
tree | 55012d646c3a5d1db40b02259e6175877e47eba1 | |
parent | app-text/aspell: Stabilize 0.60.8.1-r1 x86, #938509 (diff) | |
download | gentoo-37f7986b816b46aaca8f96b49582c9c73bebaf5c.tar.gz gentoo-37f7986b816b46aaca8f96b49582c9c73bebaf5c.tar.bz2 gentoo-37f7986b816b46aaca8f96b49582c9c73bebaf5c.zip |
ecm-common.eclass: Add _ecm-common-check_deps to simplify pkg_setup()
Bug: https://bugs.gentoo.org/938507
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
-rw-r--r-- | eclass/ecm-common.eclass | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/eclass/ecm-common.eclass b/eclass/ecm-common.eclass index 63a23878c6f5..c0c2b4f7e644 100644 --- a/eclass/ecm-common.eclass +++ b/eclass/ecm-common.eclass @@ -309,6 +309,38 @@ _ecm-common_summary() { _EOF_ } +# @FUNCTION: _ecm-common-check_deps +# @INTERNAL +# @DESCRIPTION: +# Check existence of requested KF6 dependencies. +_ecm-common-check_deps() { + local chk=0 + case ${1} in + i18n) + if [[ ${ECM_I18N} ]]; then + chk=$(has_version -b "kde-frameworks/ki18n:6") + fi + ;; + doctools) + if [[ ${ECM_HANDBOOK} ]] && in_iuse handbook; then + if use handbook; then + chk=$(has_version -b "kde-frameworks/kdoctools:6") + fi + fi + ;; + kcmutils) + if [[ ${ECM_KCM_TARGETS} ]]; then + chk=$(has_version -b "kde-frameworks/kcmutils:6") + fi + ;; + *) + eerror "Unknown value for _ecm-common-check_deps()" + die "Value ${1} is not supported" + ;; + esac + return ${chk} +} + # @FUNCTION: ecm-common-check_deps # @DESCRIPTION: # Override this to add more KF6 has_version checks to pkg_setup(), @@ -327,15 +359,8 @@ ecm-common-check_deps() { ecm-common_pkg_setup() { $(ver_test ${KFMIN} -ge 5.240) && return - if has_version -b "kde-frameworks/ki18n:6" && { - ! in_iuse handbook || { - in_iuse handbook && use handbook && - has_version -b "kde-frameworks/kdoctools:6" - } - } && { - ! [[ ${ECM_KCM_TARGETS} ]] || - has_version -b "kde-frameworks/kcmutils:6" - } && ecm-common-check_deps + if _ecm-common-check_deps i18n && _ecm-common-check_deps doctools && + _ecm-common-check_deps kcmutils && ecm-common-check_deps then _KFSLOT=6 else |