Skip to content

Commit a412c3e

Browse files
author
Damian Rouson
committed
On Linux, download cmake binary instead of source
1 parent ba8f5dc commit a412c3e

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

prerequisites/build-functions/build_and_install.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ build_and_install()
2323
info "pushd ${build_path}"
2424
pushd "${build_path}"
2525

26-
if [[ "${package_to_build}" != "gcc" ]]; then
26+
if [[ "${package_to_build}" != "gcc" && "${package_to_build}" != "cmake" ]]; then
2727

2828
if [[ "${package_to_build}" == "mpich" && "${version_to_build}" == "3.2" ]]; then
2929
info "Patching MPICH 3.2 on Mac OS due to segfault bug (see http://lists.mpich.org/pipermail/discuss/2016-May/004764.html)."
@@ -46,7 +46,11 @@ build_and_install()
4646
info "Installing with the following command: ${SUDO:-} make install"
4747
${SUDO:-} make install
4848

49-
else # ${package_to_build} == "gcc"
49+
elif [[ ${package_to_build} == "cmake" ]]; then
50+
51+
emergency "Ready to install cmake binary in ${PWD}"
52+
53+
elif [[ ${package_to_build} == "gcc" ]]; then
5054

5155
info "pushd ${download_path}/${package_source_directory} "
5256
pushd "${download_path}/${package_source_directory}"
@@ -83,7 +87,10 @@ build_and_install()
8387
info "Installing with the following command: ${SUDO:-} make install"
8488
${SUDO:-} make install
8589

86-
fi # end if [[ "${package_to_build}" != "gcc" ]]; then
90+
else
91+
emergency "This branch should never be reached."
92+
fi # end if [[ "${package_to_build}" != "gcc" && "${package_to_build}" != "cmake" ]]; then
93+
8794

8895
info "popd"
8996
popd

prerequisites/build-functions/set_or_print_url.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ else
7171
"flex;flex-${version_to_build-}.tar.bz2"
7272
"bison;bison-${version_to_build-}.tar.gz"
7373
"make;make-${version_to_build-}.tar.bz2"
74-
"cmake;cmake-${version_to_build-}.tar.gz"
7574
"subversion;subversion-${version_to_build-}.tar.gz"
7675
)
76+
if [[ $(uname) == "Linux" ]]; then
77+
package_url_tail+=("cmake;cmake-${version_to_build}-Linux-x86_64.sh")
78+
else
79+
package_url_tail+=("cmake;cmake-${version_to_build-}.tar.gz")
80+
fi
7781
for package in "${package_url_tail[@]}" ; do
7882
KEY="${package%%;*}"
7983
VALUE="${package##*;}"
@@ -84,6 +88,7 @@ else
8488
fi
8589
done
8690

91+
8792
if [[ -z "${url_head:-}" || -z "${url_tail}" ]]; then
8893
emergency "Package ${package_name:-} not recognized. Use --l or --list-packages to list the allowable names."
8994
fi

0 commit comments

Comments
 (0)