public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] cuda.eclass: Drop EAPI-5 support, move some things around
@ 2021-04-06 22:15 Andreas Sturmlechner
  0 siblings, 0 replies; only message in thread
From: Andreas Sturmlechner @ 2021-04-06 22:15 UTC (permalink / raw
  To: gentoo-dev

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

Just some cheap changes while flag-o-matic.eclass causes cache-regen anyway.
See also: https://github.com/gentoo/gentoo/pull/20207

- Assign inherit guard right on top.
- Consolidate the EAPI switch with inherit

---
 eclass/cuda.eclass | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/eclass/cuda.eclass b/eclass/cuda.eclass
index b1da77c69dd..b23d9f71a8b 100644
--- a/eclass/cuda.eclass
+++ b/eclass/cuda.eclass
@@ -1,21 +1,10 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-case "${EAPI:-0}" in
-	0|1|2|3|4)
-		die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
-		;;
-	5|6|7)
-		;;
-	*)
-		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
-		;;
-esac
-
 # @ECLASS: cuda.eclass
 # @MAINTAINER:
 # Gentoo Science Project <sci@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: Common functions for cuda packages
 # @DESCRIPTION:
 # This eclass contains functions to be used with cuda package. Currently it is
@@ -25,10 +14,19 @@ esac
 # @EXAMPLE:
 # inherit cuda
 
+case "${EAPI:-0}" in
+	[0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
+	6) inherit eapi7-ver ;;
+	7) ;;
+	*) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
+esac
+
 if [[ -z ${_CUDA_ECLASS} ]]; then
+_CUDA_ECLASS=1
+
+EXPORT_FUNCTIONS src_prepare
 
 inherit flag-o-matic toolchain-funcs
-[[ ${EAPI} == [56] ]] && inherit eapi7-ver
 
 # @ECLASS-VARIABLE: NVCCFLAGS
 # @DESCRIPTION:
@@ -195,7 +193,4 @@ cuda_src_prepare() {
 	cuda_sanitize
 }
 
-EXPORT_FUNCTIONS src_prepare
-
-_CUDA_ECLASS=1
 fi
-- 
2.31.1

[-- 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-04-06 22:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-06 22:15 [gentoo-dev] [PATCH] cuda.eclass: Drop EAPI-5 support, move some things around Andreas Sturmlechner

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