From 467e2131896a3030032cd5b0fab2094a045bf9d0 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 18 Mar 2023 00:29:05 +0000 Subject: gentoo auto-resync : 18:03:2023 - 00:29:05 --- eclass/cargo.eclass | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'eclass/cargo.eclass') 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 -- cgit v1.2.3