cargo.sh (591B)
1# 2# This helper is for building rust projects which use cargo for building 3# 4 5do_build() { 6 : ${make_cmd:=cargo} 7 8 ${make_cmd} build --release --target ${RUST_TARGET} ${configure_args} 9} 10 11do_check() { 12 : ${make_cmd:=cargo} 13 14 ${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \ 15 ${make_check_args} 16} 17 18do_install() { 19 : ${make_cmd:=cargo} 20 : ${make_install_args:=--path .} 21 22 ${make_cmd} install --target ${RUST_TARGET} --root="${DESTDIR}/usr" \ 23 --locked ${configure_args} ${make_install_args} 24 25 rm -f "${DESTDIR}"/usr/.crates.toml 26 rm -f "${DESTDIR}"/usr/.crates2.json 27}