vp-build/common/build-style/cargo.sh
Michal Vasilek 71b11fdbdb xbps-src: add make_check_pre
$make_check_pre can be used for wrapper commands like xvfb-run or
dbus-run-session which are common ways to make tests work. This way many
templates can avoid defining their own do_check function.
2022-05-04 10:46:53 +02:00

28 lines
609 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_check_pre} ${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \
${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}
rm -f "${DESTDIR}"/usr/.crates.toml
rm -f "${DESTDIR}"/usr/.crates2.json
}