summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/cargo.eclass10
1 files changed, 10 insertions, 0 deletions
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index dec56b48fc9c..bbb3d40a6206 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -265,6 +265,7 @@ cargo_gen_config() {
_EOF_
export CARGO_HOME="${ECARGO_HOME}"
+ _CARGO_GEN_CONFIG_HAS_RUN=1
}
# @FUNCTION: cargo_src_configure
@@ -321,6 +322,9 @@ cargo_src_configure() {
cargo_src_compile() {
debug-print-function ${FUNCNAME} "$@"
+ [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
+ die "FATAL: please call cargo_gen_config before using ${FUNCNAME}"
+
tc-export AR CC CXX
set -- cargo build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
@@ -338,6 +342,9 @@ cargo_src_compile() {
cargo_src_install() {
debug-print-function ${FUNCNAME} "$@"
+ [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
+ die "FATAL: please call cargo_gen_config before using ${FUNCNAME}"
+
set -- cargo install $(has --path ${@} || echo --path ./) \
--root "${ED}/usr" \
$(usex debug --debug "") \
@@ -357,6 +364,9 @@ cargo_src_install() {
cargo_src_test() {
debug-print-function ${FUNCNAME} "$@"
+ [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
+ die "FATAL: please call cargo_gen_config before using ${FUNCNAME}"
+
set -- cargo test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
"${@}" || die "cargo test failed"