Skip to content

Commit

Permalink
feat: add cargo_do_fetch step
Browse files Browse the repository at this point in the history
  • Loading branch information
banditopazzo committed May 23, 2024
1 parent 23267b4 commit d7f8bcb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions classes/cargo_bin.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ CARGO_BUILD_FLAGS = "\
${EXTRA_CARGO_FLAGS} \
"

cargo_bin_do_fetch() {
cargo fetch
}

cargo_bin_do_configure() {
mkdir -p "${B}"
mkdir -p "${CARGO_HOME}"
Expand Down Expand Up @@ -99,6 +95,13 @@ cargo_bin_do_configure() {
chmod +x "${WRAPPER_DIR}/linker-native-wrapper.sh"
}

addtask do_cargo_fetch after do_configure before do_compile
do_cargo_fetch[network] = "1"
do_cargo_fetch[dirs]= "${B}"
cargo_bin_do_cargo_fetch() {
cargo fetch --manifest-path ${CARGO_MANIFEST_PATH}
}

cargo_bin_do_compile() {
export TARGET_CC="${WRAPPER_DIR}/cc-wrapper.sh"
export TARGET_CXX="${WRAPPER_DIR}/cxx-wrapper.sh"
Expand Down Expand Up @@ -176,4 +179,4 @@ cargo_bin_do_install() {
fi
}

EXPORT_FUNCTIONS do_configure do_compile do_install
EXPORT_FUNCTIONS do_configure do_cargo_fetch do_compile do_install

0 comments on commit d7f8bcb

Please sign in to comment.