summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/sccache.sh
blob: 12b8f9d0d39cc326b5fc55b6490f8b71acb41daf (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
#!/bin/sh

set -e

readonly kernel="$(uname -s)-$(uname -m)"
case $kernel in
    Linux-x86_64)
        version="v0.2.15"
        shatool="sha256sum"
        sha256sum="e5d03a9aa3b9fac7e490391bbe22d4f42c840d31ef9eaf127a03101930cbb7ca"
        platform="x86_64-unknown-linux-musl"
        ;;
    Linux-aarch64)
        version="v0.2.15"
        shatool="sha256sum"
        sha256sum="90d91d21a767e3f558196dbd52395f6475c08de5c4951a4c8049575fa6894489"
        platform="aarch64-unknown-linux-musl"
        ;;
    Darwin-x86_64)
        version="gfe63078"
        shatool="shasum -a 256"
        sha256sum="60a0302b1d7227f7ef56abd82266353f570d27c6e850c56c6448bf62def38888"
        platform="x86_64-apple-darwin"
        url="https://paraview.org/files/dependencies"
        ;;
    Darwin-arm64)
        version="0.2.15-1-disk_cache_init"
        shatool="shasum -a 256"
        sha256sum="f7c9ff78e701810b8b1dbc2a163c7fda1177fc3f69c71f46e7a38242657a99fd"
        platform="aarch64-apple-darwin"
        url="https://cmake.org/files/dependencies/sccache"
        ;;
    *)
        echo "Unrecognized platform $kernel"
        exit 1
        ;;
esac
readonly version
readonly shatool
readonly sha256sum
readonly platform

readonly filename="sccache-$version-$platform"
readonly tarball="$filename.tar.gz"

if [ -z "$url" ]; then
    url="https://github.com/mozilla/sccache/releases/download/$version"
fi
readonly url

cd .gitlab

echo "$sha256sum  $tarball" > sccache.sha256sum
curl -OL "$url/$tarball"
$shatool --check sccache.sha256sum
tar xf "$tarball"
mv "$filename/sccache" .
chmod +x sccache