Skip to content

Commit

Permalink
Merge #418
Browse files Browse the repository at this point in the history
418: Use pre-compiled CMake and update to 3.17.2. r=adamgreig a=reitermarkus



Co-authored-by: Markus Reiter <[email protected]>
  • Loading branch information
bors[bot] and reitermarkus authored May 7, 2020
2 parents 3e60c8c + a4c1f45 commit 73bcd4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
6 changes: 4 additions & 2 deletions build-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ run() {
local image_name="rustembedded/cross:${1}"
local cache_from_args=

if docker image inspect "${image_name}" &>/dev/null || docker pull "${image_name}"; then
cache_from_args=(--cache-from "${image_name}")
if ! docker image inspect "${image_name}" &>/dev/null; then
if docker pull "${image_name}"; then
cache_from_args=(--cache-from "${image_name}")
fi
fi

docker build ${cache_from_args[@]} --pull -t "${image_name}" -f "${dockerfile}" .
Expand Down
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 73bcd4d

Please sign in to comment.