public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] kde.org.eclass: EAPI-8; allow KDE_BUILD_TYPE to hold "snapshot" value
@ 2021-08-15 11:33 Andreas Sturmlechner
  0 siblings, 0 replies; only message in thread
From: Andreas Sturmlechner @ 2021-08-15 11:33 UTC (permalink / raw
  To: gentoo-dev; +Cc: kde

[-- Attachment #1: Type: text/plain, Size: 2937 bytes --]

This value is set in conjunction with KDE_ORG_COMMIT to distinguish
between proper release tarballs and snapshots.

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
 eclass/kde.org.eclass | 50 +++++++++++++++++++++++++++----------------
 1 file changed, 31 insertions(+), 19 deletions(-)

diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass
index 0503bcf6a2..18f198e522 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
@@ -15,8 +15,8 @@
 # It also contains default meta variables for settings not specific to any
 # particular build system.
 
 case ${EAPI} in
-	7) ;;
+	7|8) ;;
 	*) die "EAPI=${EAPI:-0} is not supported" ;;
 esac
 
@@ -25,20 +25,6 @@ EXPORT_FUNCTIONS pkg_nofetch src_unpack
 if [[ -z ${_KDE_ORG_ECLASS} ]]; then
 _KDE_ORG_ECLASS=1
 
-# @ECLASS-VARIABLE: KDE_BUILD_TYPE
-# @DESCRIPTION:
-# 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
-	KDE_BUILD_TYPE="live"
-fi
-export KDE_BUILD_TYPE
-
-if [[ ${KDE_BUILD_TYPE} == live ]]; then
-	inherit git-r3
-fi
-
 # @ECLASS-VARIABLE: KDE_ORG_CATEGORIES
 # @INTERNAL
 # @DESCRIPTION:
@@ -105,6 +91,25 @@ readonly KDE_ORG_CATEGORIES
 # If set to "false", do nothing.
 # If set to "true", set SRC_URI accordingly and apply KDE_UNRELEASED.
 : ${KDE_GEAR:=false}
+
+# @ECLASS-VARIABLE: KDE_BUILD_TYPE
+# @DESCRIPTION:
+# By default, this is set to "release".
+# If PV matches "*9999*", this is automatically set to "live" and will cause
+# git-r3.eclass to be inherited.
+# In EAPI-8, if KDE_ORG_COMMIT is set, this is automatically set to "snapshot".
+KDE_BUILD_TYPE="release"
+if [[ ${PV} == *9999* ]]; then
+	KDE_BUILD_TYPE="live"
+fi
+if [[ ${EAPI} == 8 ]] && [[ -n ${KDE_ORG_COMMIT} ]]; then
+	KDE_BUILD_TYPE="snapshot"
+fi
+export KDE_BUILD_TYPE
+
+if [[ ${KDE_BUILD_TYPE} == live ]]; then
+	inherit git-r3
+fi
 
 # @ECLASS-VARIABLE: KDE_SELINUX_MODULE
 # @PRE_INHERIT
@@ -147,7 +152,7 @@ case ${CATEGORY} in
 	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} != live ]] && SLOT=$(ver_cut 1)/$(ver_cut 1-2)
 		;;
 	*) ;;
 esac
@@ -284,6 +289,7 @@ case ${KDE_BUILD_TYPE} in
 	*)
 		_kde.org_calculate_src_uri
 		debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
+		# TODO: simplify after dropping support for EAPI-7
 		if [[ -n ${KDE_ORG_COMMIT} ]]; then
 			S=${WORKDIR}/${KDE_ORG_NAME}-${KDE_ORG_COMMIT}
 			[[ ${CATEGORY} == dev-qt ]] && QT5_BUILD_DIR="${S}_build"

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-16 20:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-15 11:33 [gentoo-dev] [PATCH] kde.org.eclass: EAPI-8; allow KDE_BUILD_TYPE to hold "snapshot" value Andreas Sturmlechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox