aboutsummaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2024-08-26 00:29:07 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2024-08-26 00:36:06 +0200
commit15ae9d83694e073d09e68967a4940fe0ef16f063 (patch)
tree367252fc8e519508eb4b457e58f0e6d24d09ee98 /eclass
parentkde-apps/kate-addons: qtkeychain is needed for USE=sql (diff)
downloadkde-15ae9d83694e073d09e68967a4940fe0ef16f063.tar.gz
kde-15ae9d83694e073d09e68967a4940fe0ef16f063.tar.bz2
kde-15ae9d83694e073d09e68967a4940fe0ef16f063.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>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ecm-common.eclass43
1 files changed, 34 insertions, 9 deletions
diff --git a/eclass/ecm-common.eclass b/eclass/ecm-common.eclass
index 63a23878c6..c0c2b4f7e6 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