summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-01-26 22:31:14 (GMT)
committerBrad King <brad.king@kitware.com>2021-01-27 15:29:38 (GMT)
commit54c2c5f88906ef2e866053a260479592c38f4a12 (patch)
tree4a1957622d1ee962e9940990b07b95a04dbc1291
parent88e049e327978e8bd84e77cc71287dd2912aa226 (diff)
downloadCMake-54c2c5f88906ef2e866053a260479592c38f4a12.zip
CMake-54c2c5f88906ef2e866053a260479592c38f4a12.tar.gz
CMake-54c2c5f88906ef2e866053a260479592c38f4a12.tar.bz2
ci: generalize ninja download script to support non-upstream builds
-rwxr-xr-x.gitlab/ci/ninja.sh17
1 files changed, 8 insertions, 9 deletions
diff --git a/.gitlab/ci/ninja.sh b/.gitlab/ci/ninja.sh
index 9011bbc..93692f1 100755
--- a/.gitlab/ci/ninja.sh
+++ b/.gitlab/ci/ninja.sh
@@ -3,33 +3,32 @@
set -e
readonly version="1.10.2"
+baseurl="https://github.com/ninja-build/ninja/releases/download/v$version"
-case "$( uname -s )" in
- Linux)
+case "$(uname -s)-$(uname -m)" in
+ Linux-x86_64)
shatool="sha256sum"
sha256sum="763464859c7ef2ea3a0a10f4df40d2025d3bb9438fcb1228404640410c0ec22d"
- platform="linux"
+ filename="ninja-linux"
;;
- Darwin)
+ Darwin-*)
shatool="shasum -a 256"
sha256sum="6fa359f491fac7e5185273c6421a000eea6a2f0febf0ac03ac900bd4d80ed2a5"
- platform="mac"
+ filename="ninja-mac"
;;
*)
- echo "Unrecognized platform $( uname -s )"
+ echo "Unrecognized platform $(uname -s)-$(uname -m)"
exit 1
;;
esac
readonly shatool
readonly sha256sum
-readonly platform
-readonly filename="ninja-$platform"
readonly tarball="$filename.zip"
cd .gitlab
echo "$sha256sum $tarball" > ninja.sha256sum
-curl -OL "https://github.com/ninja-build/ninja/releases/download/v$version/$tarball"
+curl -OL "$baseurl/$tarball"
$shatool --check ninja.sha256sum
./cmake/bin/cmake -E tar xf "$tarball"