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 Dec 11, 2023
1 parent 7a01ccc commit cad67a7
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 @@ -54,10 +54,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 @@ -91,6 +87,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 @@ -166,4 +169,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 cad67a7

Please sign in to comment.