aboutsummaryrefslogtreecommitdiffstats
path: root/community/sccache/APKBUILD
blob: b95a1ded70eb5bea94659d84496ec94197b362f0 (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
67
68
69
70
# Contributor: psykose <alice@ayaya.dev>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=sccache
pkgver=0.4.2
pkgrel=0
pkgdesc="shared compilation cache for C/C++ and Rust"
url="https://github.com/mozilla/sccache/"
# s390x & riscv64: limited by cargo
# ppc64le: not supported by ring crate
# armhf: sigbus
arch="all !s390x !ppc64le !armhf !riscv64"
license="Apache-2.0"
makedepends="cargo openssl-dev>3"
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 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/Distributed.md \
		docs/DistributedQuickstart.md \
		docs/Jenkins.md \
		docs/Rust.md
}

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

	amove usr/bin/sccache-dist
}

sha512sums="
7f2c089b74eb5e4f21883d52b1505d335721ec0a031c221a25388eb4e17f4426d3df5d005ee7e6438e7215a0691fba60db23e8f71d783734ee3829b93e59c9e0  sccache-0.4.2.tar.gz
d8e544829df05fd374518f7daa3fc09b129877288594aafedfa43aeaa358779475c763b58801a7591bc4dd5b555ec4326957df18628e661798c73c0dd6da3bec  test_musl_ldd_parse.patch
"