[Ubuntu] Always install latest CMake version (#2131)

* [Ubuntu] Always install latest CMake version

Should fix #2129 and succeeds #2126 

Thanks to @unfor19 for [this solution](https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8#gistcomment-3459923)

Please test extensively.

* [Ubuntu] CMake.sh: Use jq instead of grep

* [Ubuntu] cmake.sh: Extract URL directly from API output

Co-authored by @al-cheb, thanks!
This commit is contained in:
Ewout ter Hoeven
2020-12-02 10:57:05 +01:00
committed by GitHub
parent 7893bb54f3
commit a7287233bc

View File

@@ -9,7 +9,8 @@ echo "Checking to see if the installer script has already been run"
if command -v cmake; then
echo "cmake is already installed"
else
curl -sL https://cmake.org/files/v3.19/cmake-3.19.1-Linux-x86_64.sh -o cmakeinstall.sh \
url=$(curl -s https://api.github.com/repos/Kitware/CMake/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux-x86_64.sh"))')
curl -sL ${url} -o cmakeinstall.sh \
&& chmod +x cmakeinstall.sh \
&& ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
&& rm cmakeinstall.sh