summaryrefslogtreecommitdiff
path: root/eclass/kde5-functions.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/kde5-functions.eclass')
-rw-r--r--eclass/kde5-functions.eclass63
1 files changed, 35 insertions, 28 deletions
diff --git a/eclass/kde5-functions.eclass b/eclass/kde5-functions.eclass
index 345408aae2b5..44e45e4734fd 100644
--- a/eclass/kde5-functions.eclass
+++ b/eclass/kde5-functions.eclass
@@ -4,10 +4,12 @@
# @ECLASS: kde5-functions.eclass
# @MAINTAINER:
# kde@gentoo.org
-# @BLURB: Common ebuild functions for KDE 5 packages
+# @BLURB: Common ebuild functions for packages based on KDE Frameworks 5.
# @DESCRIPTION:
-# This eclass contains all functions shared by the different eclasses,
-# for KDE 5 ebuilds.
+# This eclass contains functions shared by the other KDE eclasses and forms
+# part of their public API.
+#
+# This eclass should (almost) never be inherited directly by an ebuild.
if [[ -z ${_KDE5_FUNCTIONS_ECLASS} ]]; then
_KDE5_FUNCTIONS_ECLASS=1
@@ -22,7 +24,10 @@ case ${EAPI} in
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
-# determine the build type
+# @ECLASS-VARIABLE: KDE_BUILD_TYPE
+# @DESCRIPTION:
+# If PV matches "*9999*", this is automatically set to "live".
+# Otherwise, this is automatically set to "release".
if [[ ${PV} = *9999* ]]; then
KDE_BUILD_TYPE="live"
else
@@ -44,28 +49,29 @@ esac
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
-# Minimal Qt version to require for the package.
+# Minimum version of Qt to require. This affects add_qt_dep.
: ${QT_MINIMAL:=5.7.1}
# @ECLASS-VARIABLE: FRAMEWORKS_MINIMAL
# @DESCRIPTION:
-# Minimal Frameworks version to require for the package.
+# Minimum version of Frameworks to require. This affects add_frameworks_dep.
: ${FRAMEWORKS_MINIMAL:=5.37.0}
# @ECLASS-VARIABLE: PLASMA_MINIMAL
# @DESCRIPTION:
-# Minimal Plasma version to require for the package.
+# Minimum version of Plasma to require. This affects add_plasma_dep.
: ${PLASMA_MINIMAL:=5.10.5}
# @ECLASS-VARIABLE: KDE_APPS_MINIMAL
# @DESCRIPTION:
-# Minimal KDE Applications version to require for the package.
+# Minimum version of KDE Applications to require. This affects add_kdeapps_dep.
: ${KDE_APPS_MINIMAL:=14.12.0}
# @ECLASS-VARIABLE: KDE_GCC_MINIMAL
# @DEFAULT_UNSET
# @DESCRIPTION:
-# Minimal GCC version to require for the package.
+# Minimum version of active GCC to require. This is checked in kde5.eclass in
+# kde5_pkg_pretend and kde5_pkg_setup.
# @ECLASS-VARIABLE: KDEBASE
# @DESCRIPTION:
@@ -79,7 +85,8 @@ debug-print "${ECLASS}: ${KDEBASE} ebuild recognized"
# @ECLASS-VARIABLE: KDE_SCM
# @DESCRIPTION:
-# SCM to use if this is a live ebuild.
+# SCM to use if KDE_BUILD_TYPE is determined to be "live".
+# Currently, only git is supported.
: ${KDE_SCM:=git}
case ${KDE_SCM} in
@@ -135,7 +142,7 @@ _add_category_dep() {
if [[ -n ${version} ]] ; then
local operator=">="
- local version="-$(get_version_component_range 1-3 ${version})"
+ local version="-${version}"
fi
if [[ -n ${slot} ]] ; then
@@ -148,7 +155,7 @@ _add_category_dep() {
}
# @FUNCTION: add_frameworks_dep
-# @USAGE: <package> [USE flags] [minimum version]
+# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for kde-frameworks/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
@@ -172,7 +179,7 @@ add_frameworks_dep() {
version=${3}
elif [[ ${CATEGORY} = kde-frameworks ]]; then
version=$(get_version_component_range 1-2)
- elif [[ -z "${version}" ]] ; then
+ elif [[ -z ${3} ]] ; then
version=${FRAMEWORKS_MINIMAL}
fi
@@ -180,7 +187,7 @@ add_frameworks_dep() {
}
# @FUNCTION: add_plasma_dep
-# @USAGE: <package> [USE flags] [minimum version]
+# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for kde-plasma/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
@@ -203,8 +210,8 @@ add_plasma_dep() {
if [[ -n ${3} ]]; then
version=${3}
elif [[ ${CATEGORY} = kde-plasma ]]; then
- version=${PV}
- elif [[ -z "${version}" ]] ; then
+ version=$(get_version_component_range 1-3)
+ elif [[ -z ${3} ]] ; then
version=${PLASMA_MINIMAL}
fi
@@ -212,7 +219,7 @@ add_plasma_dep() {
}
# @FUNCTION: add_kdeapps_dep
-# @USAGE: <package> [USE flags] [minimum version]
+# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for kde-apps/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
@@ -235,8 +242,8 @@ add_kdeapps_dep() {
if [[ -n ${3} ]]; then
version=${3}
elif [[ ${CATEGORY} = kde-apps ]]; then
- version=${PV}
- elif [[ -z "${version}" ]] ; then
+ version=$(get_version_component_range 1-3)
+ elif [[ -z ${3} ]] ; then
version=${KDE_APPS_MINIMAL}
fi
@@ -244,7 +251,7 @@ add_kdeapps_dep() {
}
# @FUNCTION: add_qt_dep
-# @USAGE: <package> [USE flags] [minimum version]
+# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for dev-qt/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
@@ -262,15 +269,12 @@ add_qt_dep() {
die "${FUNCNAME} was called with too many arguments"
fi
- local version
+ local version=${3}
local slot=${4}
- if [[ -n ${3} ]]; then
- version=${3}
- elif [[ -z "${version}" ]]; then
+ if [[ -z ${version} ]]; then
version=${QT_MINIMAL}
fi
-
if [[ -z ${slot} ]]; then
slot="5"
fi
@@ -278,10 +282,13 @@ add_qt_dep() {
_add_category_dep dev-qt "${1}" "${2}" "${version}" "${slot}"
}
-# @FUNCTION: get_kde_version
+# @FUNCTION: get_kde_version [version]
# @DESCRIPTION:
-# Translates an ebuild version into a major.minor KDE SC
-# release version. If no version is specified, ${PV} is used.
+# Translates an ebuild version into a major.minor KDE release version, taking
+# into account KDE's prerelease versioning scheme.
+# For example, get_kde_version 17.07.80 will return "17.08".
+# If the version equals 9999, "live" is returned.
+# If no version is specified, ${PV} is used.
get_kde_version() {
local ver=${1:-${PV}}
local major=$(get_major_version ${ver})