1
0
Fork 0
mirror of https://github.com/xHyroM/void-packages.git synced 2024-11-23 14:51:06 +01:00
void-packages/common/build-style/cargo.sh

29 lines
691 B
Bash
Raw Normal View History

2024-03-29 08:12:19 +01:00
#
# This helper is for building rust projects which use cargo for building
#
do_build() {
: ${make_cmd:=cargo auditable}
${make_cmd} build --release --locked --target ${RUST_TARGET} \
${configure_args} ${make_build_args}
2024-03-29 08:12:19 +01:00
}
do_check() {
: ${make_cmd:=cargo auditable}
${make_check_pre} ${make_cmd} test --release --locked --target ${RUST_TARGET} \
${configure_args} ${make_check_args}
}
do_install() {
: ${make_cmd:=cargo auditable}
: ${make_install_args:=--path .}
${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
}