aboutsummaryrefslogtreecommitdiffstats
path: root/community/sccache/APKBUILD
blob: d83e7b329bd173fed6294e40c2a371c768323317 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Maintainer: omni <omni+alpine@hack.org>
pkgname=sccache
pkgver=0.7.7
pkgrel=0
pkgdesc="shared compilation cache for C/C++ and Rust"
url="https://github.com/mozilla/sccache/"
# ppc64le, riscv64 & s390x: not supported by ring crate
arch="all !ppc64le !riscv64 !s390x"
license="Apache-2.0"
makedepends="cargo openssl-dev>3 cargo-auditable"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mozilla/sccache/archive/v$pkgver.tar.gz
	test_musl_ldd_parse.patch
	"

case "$CARCH" in
x86_64)
	# only x86_64 supports sccache-dist
	subpackages="$subpackages $pkgname-dist"
	_features="all,dist-server"
	;;
*)
	_features="all"
	;;
esac


prepare() {
	default_prepare
	cargo fetch --locked
}

build() {
	cargo auditable build --release --frozen --features $_features
}

check() {
	cargo test --frozen
}

package() {
	install -Dm0755 target/release/sccache -t "$pkgdir"/usr/bin

	case "$CARCH" in
	x86_64)
		install -Dm0755 target/release/sccache-dist \
			-t "$pkgdir"/usr/bin
		;;
	esac

	install -Dm0644 -t "$pkgdir"/usr/share/doc/"$pkgname" \
		docs/*.md
	rm "$pkgdir"/usr/share/doc/"$pkgname"/DistributedFreeBSD.md \
	   "$pkgdir"/usr/share/doc/"$pkgname"/Releasing.md
}

dist() {
	pkgdesc="$pkgdesc (dist server)"

	amove usr/bin/sccache-dist
}

sha512sums="
b1a204e6638e2224af055f290df0c9f3a5cd30f43c720b9ddee194adb0c6290feb20badcdbd8f04a5830088b25b27665a617e6f20a3a60b2849b4ad81d48a25a  sccache-0.7.7.tar.gz
41086a95ffa6119e6e9eab14ba5e3e8452121ad357a560928eeba21b76674133f936b4e7b9b4a8ac0e15d87dac7ebcf7e635390692467ca4e0c5b16d50426696  test_musl_ldd_parse.patch
"