Skip to content
Snippets Groups Projects
Commit 064eb3e7 authored by Éloïs's avatar Éloïs
Browse files

Add cmake.sh

parent 48990917
Branches
Tags
No related merge requests found
Pipeline #2671 canceled
cmake.sh 0 → 100644
set -ex
main() {
local version=$1
local dependencies=(
curl
g++
make
)
apt-get update
local purge_list=()
for dep in ${dependencies[@]}; do
if ! dpkg -L $dep; then
apt-get install --no-install-recommends -y $dep
purge_list+=( $dep )
fi
done
local td=$(mktemp -d)
pushd $td
curl https://cmake.org/files/v${version%.*}/cmake-$version.tar.gz | \
tar --strip-components 1 -xz
./bootstrap
nice make -j$(nproc)
make install
# clean up
popd
apt-get purge --auto-remove -y ${purge_list[@]}
rm -rf $td
rm $0
}
main "${@}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment