Skip to content

Commit

Permalink
Use pre-compiled CMake.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed May 3, 2020
1 parent de91808 commit 20e6574
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions docker/cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@ set -x
set -euo pipefail

main() {
local version=3.16.5
local version=3.17.2

local dependencies=(
curl
g++
libssl-dev
make
zlib1g-dev
)
local dependencies=(curl)

apt-get update
local purge_list=()
for dep in ${dependencies[@]}; do
if ! dpkg -L $dep; then
apt-get install --no-install-recommends --assume-yes $dep
apt-get install --assume-yes --no-install-recommends $dep
purge_list+=( $dep )
fi
done
Expand All @@ -27,21 +21,17 @@ main() {

pushd $td

curl https://cmake.org/files/v${version%.*}/cmake-$version.tar.gz | \
tar --strip-components 1 -xz
curl -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-Linux-x86_64.sh" -o cmake.sh
sh cmake.sh --skip-license --prefix=/usr/local

./bootstrap
make -j$(nproc)
make install

# clean up
popd

if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
apt-get purge --assume-yes --auto-remove ${purge_list[@]}
fi

rm -rf $td
rm -rf /var/lib/apt/lists/*
rm $0
}

Expand Down

0 comments on commit 20e6574

Please sign in to comment.