summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin35990 -> 35980 bytes
-rw-r--r--eclass/kde.org.eclass47
-rw-r--r--eclass/readme.gentoo-r1.eclass17
-rw-r--r--eclass/xdg.eclass34
4 files changed, 59 insertions, 39 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index 75165709e83b..c1b18d88ee20 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass
index 7f0b32aad848..aab7abcd6c65 100644
--- a/eclass/kde.org.eclass
+++ b/eclass/kde.org.eclass
@@ -4,7 +4,7 @@
# @ECLASS: kde.org.eclass
# @MAINTAINER:
# kde@gentoo.org
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: Support eclass for packages that are hosted on kde.org infrastructure.
# @DESCRIPTION:
# This eclass is mainly providing facilities for the three upstream release
@@ -16,7 +16,7 @@
# particular build system.
case ${EAPI} in
- 7) ;;
+ 7|8) ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
@@ -30,12 +30,12 @@ _KDE_ORG_ECLASS=1
# If PV matches "*9999*", this is automatically set to "live".
# Otherwise, this is automatically set to "release".
KDE_BUILD_TYPE="release"
-if [[ ${PV} = *9999* ]]; then
+if [[ ${PV} == *9999* ]]; then
KDE_BUILD_TYPE="live"
fi
export KDE_BUILD_TYPE
-if [[ ${KDE_BUILD_TYPE} = live ]]; then
+if [[ ${KDE_BUILD_TYPE} == live ]]; then
inherit git-r3
fi
@@ -82,12 +82,14 @@ declare -A KDE_ORG_CATEGORIES=(
readonly KDE_ORG_CATEGORIES
# @ECLASS-VARIABLE: KDE_ORG_CATEGORY
+# @PRE_INHERIT
# @DESCRIPTION:
# If unset, default value is mapped from ${CATEGORY} to corresponding upstream
# category on invent.kde.org, with "kde" as fallback value.
: ${KDE_ORG_CATEGORY:=${KDE_ORG_CATEGORIES[${CATEGORY}]:-kde}}
# @ECLASS-VARIABLE: KDE_ORG_COMMIT
+# @PRE_INHERIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, instead of a regular release tarball, pull tar.gz snapshot from an
@@ -95,17 +97,23 @@ readonly KDE_ORG_CATEGORIES
# at the desired COMMIT ID.
# @ECLASS-VARIABLE: KDE_ORG_NAME
+# @PRE_INHERIT
# @DESCRIPTION:
# If unset, default value is set to ${PN}.
# Name of the package as hosted on kde.org mirrors.
: ${KDE_ORG_NAME:=$PN}
# @ECLASS-VARIABLE: KDE_GEAR
+# @PRE_INHERIT
# @DESCRIPTION:
-# If set to "false", do nothing.
+# Mark package is being part of KDE Gear release schedule.
+# By default, this is set to "false" and does nothing.
+# If CATEGORY equals kde-apps, this is automatically set to "true".
# If set to "true", set SRC_URI accordingly and apply KDE_UNRELEASED.
-# Backward compatibility: Picks up KDE_RELEASE_SERVICE value if set.
-: ${KDE_GEAR:=${KDE_RELEASE_SERVICE:-false}}
+: ${KDE_GEAR:=false}
+if [[ ${CATEGORY} == kde-apps ]]; then
+ KDE_GEAR=true
+fi
# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
# @PRE_INHERIT
@@ -139,16 +147,13 @@ case ${CATEGORY} in
HOMEPAGE="https://community.kde.org/Qt5PatchCollection
https://invent.kde.org/qt/qt/ https://www.qt.io/"
;;
- kde-apps)
- KDE_GEAR=true
- ;;
kde-plasma)
HOMEPAGE="https://kde.org/plasma-desktop"
;;
kde-frameworks)
HOMEPAGE="https://kde.org/products/frameworks/"
SLOT=5/${PV}
- [[ ${KDE_BUILD_TYPE} = release ]] && SLOT=$(ver_cut 1)/$(ver_cut 1-2)
+ [[ ${KDE_BUILD_TYPE} == release ]] && SLOT=$(ver_cut 1)/$(ver_cut 1-2)
;;
*) ;;
esac
@@ -160,10 +165,10 @@ esac
_kde.org_is_unreleased() {
local pair
for pair in "${KDE_UNRELEASED[@]}" ; do
- if [[ "${pair}" = "${CATEGORY}-${PV}" ]]; then
+ if [[ "${pair}" == "${CATEGORY}-${PV}" ]]; then
return 0
- elif [[ ${KDE_GEAR} = true ]]; then
- if [[ "${pair/kde-apps/${CATEGORY}}" = "${CATEGORY}-${PV}" ]]; then
+ elif [[ ${KDE_GEAR} == true ]]; then
+ if [[ "${pair/kde-apps/${CATEGORY}}" == "${CATEGORY}-${PV}" ]]; then
return 0
fi
fi
@@ -181,7 +186,7 @@ _kde.org_calculate_src_uri() {
local _src_uri="mirror://kde/"
- if [[ ${KDE_GEAR} = true ]]; then
+ if [[ ${KDE_GEAR} == true ]]; then
case ${PV} in
??.??.[6-9]? )
_src_uri+="unstable/release-service/${PV}/src/"
@@ -219,7 +224,7 @@ _kde.org_calculate_src_uri() {
;;
esac
- if [[ ${PN} = kdevelop* ]]; then
+ if [[ ${PN} == kdevelop* ]]; then
case ${PV} in
*.*.[6-9]? )
_src_uri+="unstable/kdevelop/${PV}/src/"
@@ -257,19 +262,19 @@ _kde.org_calculate_live_repo() {
# (anongit) with anything else you might want to use.
EGIT_MIRROR=${EGIT_MIRROR:=https://invent.kde.org/${KDE_ORG_CATEGORY}}
- if [[ ${PV} == ?.??.9999 && ${CATEGORY} = dev-qt ]]; then
+ if [[ ${PV} == ?.??.9999 && ${CATEGORY} == dev-qt ]]; then
EGIT_BRANCH="kde/$(ver_cut 1-2)"
fi
- if [[ ${PV} == ??.??.49.9999 && ${KDE_GEAR} = true ]]; then
+ if [[ ${PV} == ??.??.49.9999 && ${KDE_GEAR} == true ]]; then
EGIT_BRANCH="release/$(ver_cut 1-2)"
fi
- if [[ ${PV} != 9999 && ${CATEGORY} = kde-plasma ]]; then
+ if [[ ${PV} != 9999 && ${CATEGORY} == kde-plasma ]]; then
EGIT_BRANCH="Plasma/$(ver_cut 1-2)"
fi
- if [[ ${PV} != 9999 && ${PN} = kdevelop* ]]; then
+ if [[ ${PV} != 9999 && ${PN} == kdevelop* ]]; then
EGIT_BRANCH="$(ver_cut 1-2)"
fi
@@ -309,7 +314,7 @@ kde.org_pkg_nofetch() {
kde-frameworks) sched_uri+="/Frameworks" ;;
kde-plasma) sched_uri+="/Plasma_5" ;;
*)
- [[ ${KDE_GEAR} = true ]] &&
+ [[ ${KDE_GEAR} == true ]] &&
sched_uri+="/KDE_Gear_$(ver_cut 1-2)_Schedule"
;;
esac
diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass
index 69d0e1c5c6b4..3ad36fac2588 100644
--- a/eclass/readme.gentoo-r1.eclass
+++ b/eclass/readme.gentoo-r1.eclass
@@ -20,15 +20,9 @@
if [[ -z ${_README_GENTOO_ECLASS} ]]; then
_README_GENTOO_ECLASS=1
-case "${EAPI:-0}" in
- 0|1|2|3|4|5)
- die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
- ;;
- 6|7|8)
- ;;
- *)
- die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
- ;;
+case ${EAPI} in
+ 6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @ECLASS-VARIABLE: DISABLE_AUTOFORMATTING
@@ -76,7 +70,10 @@ readme.gentoo_create_doc() {
die "You are not specifying README.gentoo contents!"
fi
- dodoc "${T}"/README.gentoo
+ ( # subshell to avoid pollution of calling environment
+ docinto .
+ dodoc "${T}"/README.gentoo
+ ) || die
README_GENTOO_DOC_VALUE=$(< "${T}/README.gentoo")
}
diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index 219be712e84d..08dc8432a5e0 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: xdg.eclass
@@ -6,7 +6,7 @@
# freedesktop-bugs@gentoo.org
# @AUTHOR:
# Original author: Gilles Dartiguelongue <eva@gentoo.org>
-# @SUPPORTED_EAPIS: 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: Provides phases for XDG compliant packages.
# @DESCRIPTION:
# Utility eclass to update the desktop, icon and shared mime info as laid
@@ -14,29 +14,47 @@
inherit xdg-utils
-case "${EAPI:-0}" in
- 4|5|6|7)
- EXPORT_FUNCTIONS src_prepare pkg_preinst pkg_postinst pkg_postrm
+_DEFINE_XDG_SRC_PREPARE=false
+case "${EAPI}" in
+ 5|6|7)
+ # src_prepare is only exported in EAPI < 8.
+ EXPORT_FUNCTIONS src_prepare
+ _DEFINE_XDG_SRC_PREPARE=true
;;
- *) die "EAPI=${EAPI} is not supported" ;;
+ 8)
+ ;;
+ *) die "${ECLASS}: EAPI=${EAPI} is not supported" ;;
esac
+EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm
# Avoid dependency loop as both depend on glib-2
if [[ ${CATEGORY}/${P} != dev-libs/glib-2.* ]] ; then
-DEPEND="
+_XDG_DEPEND="
dev-util/desktop-file-utils
x11-misc/shared-mime-info
"
+
+case "${EAPI}" in
+ 5|6|7)
+ DEPEND="${_XDG_DEPEND}"
+ ;;
+ *)
+ IDEPEND="${_XDG_DEPEND}"
+ ;;
+esac
fi
+if ${_DEFINE_XDG_SRC_PREPARE}; then
# @FUNCTION: xdg_src_prepare
# @DESCRIPTION:
# Prepare sources to work with XDG standards.
+# Note that this function is only defined and exported in EAPIs < 8.
xdg_src_prepare() {
xdg_environment_reset
- [[ ${EAPI:-0} != [45] ]] && default
+ [[ ${EAPI} != 5 ]] && default
}
+fi
# @FUNCTION: xdg_pkg_preinst
# @DESCRIPTION: