Gentoo Archives: gentoo-dev

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-dev@l.g.o
Cc: kde <kde@g.o>
Subject: [gentoo-dev] [PATCH] kde.org.eclass: EAPI-8; allow KDE_BUILD_TYPE to hold "snapshot" value
Date: Mon, 16 Aug 2021 20:48:26
Message-Id: 4465983.vXUDI8C0e8@tuxbrain
1 This value is set in conjunction with KDE_ORG_COMMIT to distinguish
2 between proper release tarballs and snapshots.
3
4 Signed-off-by: Andreas Sturmlechner <asturm@g.o>
5 ---
6 eclass/kde.org.eclass | 50 +++++++++++++++++++++++++++----------------
7 1 file changed, 31 insertions(+), 19 deletions(-)
8
9 diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass
10 index 0503bcf6a2..18f198e522 100644
11 --- a/eclass/kde.org.eclass
12 +++ b/eclass/kde.org.eclass
13 @@ -4,7 +4,7 @@
14 # @ECLASS: kde.org.eclass
15 # @MAINTAINER:
16 # kde@g.o
17 -# @SUPPORTED_EAPIS: 7
18 +# @SUPPORTED_EAPIS: 7 8
19 # @BLURB: Support eclass for packages that are hosted on kde.org infrastructure.
20 # @DESCRIPTION:
21 # This eclass is mainly providing facilities for the three upstream release
22 @@ -15,8 +15,8 @@
23 # It also contains default meta variables for settings not specific to any
24 # particular build system.
25
26 case ${EAPI} in
27 - 7) ;;
28 + 7|8) ;;
29 *) die "EAPI=${EAPI:-0} is not supported" ;;
30 esac
31
32 @@ -25,20 +25,6 @@ EXPORT_FUNCTIONS pkg_nofetch src_unpack
33 if [[ -z ${_KDE_ORG_ECLASS} ]]; then
34 _KDE_ORG_ECLASS=1
35
36 -# @ECLASS-VARIABLE: KDE_BUILD_TYPE
37 -# @DESCRIPTION:
38 -# If PV matches "*9999*", this is automatically set to "live".
39 -# Otherwise, this is automatically set to "release".
40 -KDE_BUILD_TYPE="release"
41 -if [[ ${PV} == *9999* ]]; then
42 - KDE_BUILD_TYPE="live"
43 -fi
44 -export KDE_BUILD_TYPE
45 -
46 -if [[ ${KDE_BUILD_TYPE} == live ]]; then
47 - inherit git-r3
48 -fi
49 -
50 # @ECLASS-VARIABLE: KDE_ORG_CATEGORIES
51 # @INTERNAL
52 # @DESCRIPTION:
53 @@ -105,6 +91,25 @@ readonly KDE_ORG_CATEGORIES
54 # If set to "false", do nothing.
55 # If set to "true", set SRC_URI accordingly and apply KDE_UNRELEASED.
56 : ${KDE_GEAR:=false}
57 +
58 +# @ECLASS-VARIABLE: KDE_BUILD_TYPE
59 +# @DESCRIPTION:
60 +# By default, this is set to "release".
61 +# If PV matches "*9999*", this is automatically set to "live" and will cause
62 +# git-r3.eclass to be inherited.
63 +# In EAPI-8, if KDE_ORG_COMMIT is set, this is automatically set to "snapshot".
64 +KDE_BUILD_TYPE="release"
65 +if [[ ${PV} == *9999* ]]; then
66 + KDE_BUILD_TYPE="live"
67 +fi
68 +if [[ ${EAPI} == 8 ]] && [[ -n ${KDE_ORG_COMMIT} ]]; then
69 + KDE_BUILD_TYPE="snapshot"
70 +fi
71 +export KDE_BUILD_TYPE
72 +
73 +if [[ ${KDE_BUILD_TYPE} == live ]]; then
74 + inherit git-r3
75 +fi
76
77 # @ECLASS-VARIABLE: KDE_SELINUX_MODULE
78 # @PRE_INHERIT
79 @@ -147,7 +152,7 @@ case ${CATEGORY} in
80 kde-frameworks)
81 HOMEPAGE="https://kde.org/products/frameworks/"
82 SLOT=5/${PV}
83 - [[ ${KDE_BUILD_TYPE} == release ]] && SLOT=$(ver_cut 1)/$(ver_cut 1-2)
84 + [[ ${KDE_BUILD_TYPE} != live ]] && SLOT=$(ver_cut 1)/$(ver_cut 1-2)
85 ;;
86 *) ;;
87 esac
88 @@ -284,6 +289,7 @@ case ${KDE_BUILD_TYPE} in
89 *)
90 _kde.org_calculate_src_uri
91 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
92 + # TODO: simplify after dropping support for EAPI-7
93 if [[ -n ${KDE_ORG_COMMIT} ]]; then
94 S=${WORKDIR}/${KDE_ORG_NAME}-${KDE_ORG_COMMIT}
95 [[ ${CATEGORY} == dev-qt ]] && QT5_BUILD_DIR="${S}_build"

Attachments

File name MIME type
signature.asc application/pgp-signature