#!/bin/sh set -e readonly version="3.27.6" case "$(uname -s)-$(uname -m)" in Linux-x86_64) shatool="sha256sum" sha256sum="26373a283daa8490d772dc8a179450cd6d391cb2a9db8d4242fe09e361efc42e" platform="linux-x86_64" ;; Linux-aarch64) shatool="sha256sum" sha256sum="811e5040ad7f3fb4924a875373d2a1a174a01400233a81a638a989157438a5e3" platform="linux-aarch64" ;; Darwin-*) shatool="shasum -a 256" sha256sum="a66b497289ab8c769b601d93833448eaae985beb762993837a51a79916d12f23" platform="macos-universal" ;; *) echo "Unrecognized platform $(uname -s)-$(uname -m)" exit 1 ;; esac readonly shatool readonly sha256sum readonly platform readonly filename="cmake-$version-$platform" readonly tarball="$filename.tar.gz" cd .gitlab echo "$sha256sum $tarball" > cmake.sha256sum curl -OL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" $shatool --check cmake.sha256sum tar xf "$tarball" mv "$filename" cmake if [ "$( uname -s )" = "Darwin" ]; then ln -s CMake.app/Contents/bin cmake/bin fi