void-packages/common/build-style/cargo.sh
travankor 3610a35271 cargo.sh: don't hardcode the path.
Clean up the cargo remnants in the post install phase.
2020-04-07 21:25:12 +02:00

28 lines
564 B
Bash

#
# 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}
}
do_check() {
: ${make_cmd:=cargo}
${make_cmd} test --release ${make_check_args}
}
do_install() {
: ${make_cmd:=cargo}
: ${make_install_args:=--path .}
${make_cmd} install --target ${RUST_TARGET} --root="${DESTDIR}/usr" \
--locked ${configure_args} ${make_install_args}
}
post_install() {
rm -f "${DESTDIR}"/usr/.crates.toml
rm -f "${DESTDIR}"/usr/.crates2.json
}