summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2023-03-17 23:04:31 +0100
committerDavid Seifert <soap@gentoo.org>2023-03-17 23:04:31 +0100
commit2cba2db27919bc449ed2a7bf7ed3259c6b96e65f (patch)
treec89a0929ca3e7cc95c737085614214e89450c999 /eclass/cargo.eclass
parentxdg.eclass: remove EAPI 5 (diff)
downloadgentoo-2cba2db27919bc449ed2a7bf7ed3259c6b96e65f.tar.gz
gentoo-2cba2db27919bc449ed2a7bf7ed3259c6b96e65f.tar.bz2
gentoo-2cba2db27919bc449ed2a7bf7ed3259c6b96e65f.zip
eclass: standardize prologue/epilogue
Closes: https://github.com/gentoo/gentoo/pull/30061 Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'eclass/cargo.eclass')
-rw-r--r--eclass/cargo.eclass23
1 files changed, 11 insertions, 12 deletions
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 911ddabced14..e3f36fc6ad9b 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -10,6 +10,11 @@
# @SUPPORTED_EAPIS: 7 8
# @BLURB: common functions and variables for cargo builds
+case ${EAPI} in
+ 7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
if [[ -z ${_CARGO_ECLASS} ]]; then
_CARGO_ECLASS=1
@@ -17,15 +22,11 @@ _CARGO_ECLASS=1
# https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md
RUST_DEPEND="virtual/rust"
-case "${EAPI:-0}" in
- 0|1|2|3|4|5|6)
- die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
- ;;
+case ${EAPI} in
7)
# 1.37 added 'cargo vendor' subcommand and net.offline config knob
RUST_DEPEND=">=virtual/rust-1.37.0"
;;
-
8)
# 1.39 added --workspace
# 1.46 added --target dir
@@ -40,17 +41,11 @@ case "${EAPI:-0}" in
die "CRATES variable not defined"
fi
;;
- *)
- die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
- ;;
esac
inherit multiprocessing toolchain-funcs
-if [[ ! ${CARGO_OPTIONAL} ]]; then
- BDEPEND="${RUST_DEPEND}"
- EXPORT_FUNCTIONS src_unpack src_configure src_compile src_install src_test
-fi
+[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND}"
IUSE="${IUSE} debug"
@@ -549,3 +544,7 @@ cargo_src_test() {
}
fi
+
+if [[ ! ${CARGO_OPTIONAL} ]]; then
+ EXPORT_FUNCTIONS src_unpack src_configure src_compile src_install src_test
+fi