summaryrefslogtreecommitdiffstats
path: root/rust-crates/FUNCTIONS
blob: 94e28969be7443917fdcbadc7788b771347240c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#-------------------------------------------------------------------------
## Section-default build script.
#-------------------------------------------------------------------------
function default_build_cargo() {
  env CARGO_HOME="$SOURCE_DIRECTORY/.cargo" cargo build --release $OPTS
}

#-------------------------------------------------------------------------
## Section-default install script.
#-------------------------------------------------------------------------
function default_install_cargo() {
  env CARGO_HOME="$SOURCE_DIRECTORY/.cargo" \
    cargo install --path "$SOURCE_DIRECTORY" --root "${INSTALL_ROOT}/usr" --locked $@ $OPTS&&
  rm -f "$INSTALL_ROOT/usr/.crates.toml" &&
  rm -f "$INSTALL_ROOT/usr/.crates2.json"
}

function default_build() {
   default_build_cargo
}
function default_install() {
   default_install_cargo
}