void-packages/common/build-style/cargo.sh

28 lines
619 B
Bash
Raw Normal View History

2018-09-16 21:39:23 +02:00
#
# This helper is for building rust projects which use cargo for building
#
do_build() {
: ${make_cmd:=cargo}
${make_cmd} build --release --target ${RUST_TARGET} ${configure_args}
2018-09-16 21:39:23 +02:00
}
do_check() {
: ${make_cmd:=cargo}
${make_check_pre} ${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \
${make_check_args}
2018-09-16 21:39:23 +02:00
}
do_install() {
: ${make_cmd:=cargo}
: ${make_install_args:=--path .}
2018-09-16 21:39:23 +02:00
${make_cmd} install --target ${RUST_TARGET} --root="${DESTDIR}/usr" \
--offline --locked ${configure_args} ${make_install_args}
rm -f "${DESTDIR}"/usr/.crates.toml
rm -f "${DESTDIR}"/usr/.crates2.json
2018-09-16 21:39:23 +02:00
}