Commit 54c2c5f8 authored by Brad King's avatar Brad King
Browse files

ci: generalize ninja download script to support non-upstream builds

parent 88e049e3
......@@ -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"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment