commit:     bb7b1a3a31d8a4bb5de8ab4644dfb566b954fb58
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  9 11:16:39 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Dec  9 11:20:20 2023 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=bb7b1a3a

gear.kde.org.eclass: Add new meta variable KDE_BLOCK_SLOT5

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/gear.kde.org.eclass | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/eclass/gear.kde.org.eclass b/eclass/gear.kde.org.eclass
index 0588951090..226db68a87 100644
--- a/eclass/gear.kde.org.eclass
+++ b/eclass/gear.kde.org.eclass
@@ -25,6 +25,18 @@ esac
 if [[ -z ${_GEAR_KDE_ORG_ECLASS} ]]; then
 _GEAR_KDE_ORG_ECLASS=1
 
+# @ECLASS-VARIABLE: KDE_BLOCK_SLOT5
+# @PRE_INHERIT
+# @DESCRIPTION:
+# By default set to "true", which means for packages in SLOT 6, add RDEPEND
+# block against ${CATEGORY}/${PN}:5.
+# Set to "false" in order to enable side-by-side installability.
+if [[ ${SLOT} == 6 ]]; then
+: ${KDE_BLOCK_SLOT5:=true}
+else
+: ${KDE_BLOCK_SLOT5:=false}
+fi
+
 # @ECLASS_VARIABLE: KDE_PV_UNRELEASED
 # @INTERNAL
 # @DESCRIPTION:
@@ -63,4 +75,15 @@ elif [[ -z ${KDE_ORG_COMMIT} ]]; then
        SRC_URI="${_KDE_SRC_URI}${KDE_ORG_TAR_PN}-${PV}.tar.xz"
 fi
 
+case ${KDE_BLOCK_SLOT5} in
+       true)
+               RDEPEND+=" !${CATEGORY}/${PN}:5"
+               ;;
+       false) ;;
+       *)
+               eerror "Unknown value for \${KDE_BLOCK_SLOT5}"
+               die "Value ${KDE_BLOCK_SLOT5} is not supported"
+               ;;
+esac
+
 fi

Reply via email to