# Template file for 'rust-sccache'
pkgname=rust-sccache
version=0.3.1
revision=1
build_style=cargo
# fails in musl
make_check_args="-- --skip dist::pkg::toolchain_imp::test_ldd_parse_v2_30"
hostmakedepends="pkg-config"
makedepends="openssl-devel"
short_desc="Sccache is a ccache-like tool"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="Apache-2.0"
homepage="https://crates.io/crates/sccache"
distfiles="https://static.crates.io/crates/sccache/sccache-${version}.crate"
checksum=10ee186f1d2f069ce3c62a2995b3cb50a6671b13d65dfbd35d3f62591040184d

case "$XBPS_TARGET_MACHINE" in
	x86_64*|i686*|arm*|aarch64*) ;;
	*) broken="ftbfs in ring" ;;
esac

pre_build() {
	# fixes the usage of yanked versions of crates
	cargo update --package cpufeatures:0.2.1 --precise 0.2.5
	cargo update --package textwrap:0.15.1 --precise 0.15.2
}

pre_check() {
	# tries to spawn /usr/bin/cargo and fails
	rm -f tests/sccache_cargo.rs
}
