Skip to content

Commit 6aec7b3

Browse files
committed
Download cmake on aarch64 when neccesary
1 parent 101281f commit 6aec7b3

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

docker/cmake.sh

+24-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,33 @@ main() {
1313

1414
local td
1515
td="$(mktemp -d)"
16-
1716
pushd "${td}"
1817

19-
curl --retry 3 -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-linux-x86_64.sh" -o cmake.sh
18+
local cmake_arch
19+
local cmake_sha256
20+
21+
local narch
22+
narch="$(dpkg --print-architecture)"
23+
24+
case "${narch}" in
25+
amd64)
26+
cmake_arch="linux-x86_64"
27+
cmake_sha256="da2a9b18c3bfb136917fa1a579aa5316b01c1d6c111043d03f18877ff05bda30"
28+
;;
29+
arm64)
30+
cmake_arch="linux-aarch64"
31+
cmake_sha256="86122bdfd030208aa36705ef421a218ccec52a14368020b2d67043af5e45490b"
32+
;;
33+
*)
34+
echo "Unsupported architecture: ${narch}" 1>&2
35+
exit 1
36+
;;
37+
esac
38+
39+
curl --retry 3 -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-${cmake_arch}.sh" -o cmake.sh
40+
sha256sum --check <<<"${cmake_sha256} cmake.sh"
2041
sh cmake.sh --skip-license --prefix=/usr/local
42+
cmake --version
2143

2244
popd
2345

0 commit comments

Comments
 (0)