Unverified Commit c395b10e authored by Matthew Brett's avatar Matthew Brett Committed by GitHub
Browse files

Merge pull request #342 from radarhere/cmake

MRG: Install cmake instead if cmake28 cannot be found in yum

When attempting to build on aarch64, I find that cmake28 is not found. However, cmake does exist.

So this PR adds `get_modern_cmake` that searches for cmake28, and if it is not found, then use cmake instead.
parents 9e234983 ce7e7367
...@@ -148,28 +148,36 @@ function build_bzip2 { ...@@ -148,28 +148,36 @@ function build_bzip2 {
function build_tiff { function build_tiff {
build_zlib build_zlib
build_jpeg build_jpeg
build_xz ensure_xz
build_simple tiff $TIFF_VERSION https://download.osgeo.org/libtiff build_simple tiff $TIFF_VERSION https://download.osgeo.org/libtiff
} }
function get_cmake { function get_modern_cmake {
# Install cmake >= 2.8
local cmake=cmake local cmake=cmake
if [ -n "$IS_OSX" ]; then if [ -n "$IS_OSX" ]; then
brew install cmake > /dev/null brew install cmake > /dev/null
else else
yum_install cmake28 > /dev/null if [ "`yum search cmake | grep ^cmake28\.`" ]; then
cmake=cmake28 cmake=cmake28
fi
yum_install $cmake > /dev/null
fi fi
echo $cmake echo $cmake
} }
function get_cmake {
>&2 echo "get_cmake has been deprecated. Please use get_modern_cmake instead."
get_modern_cmake
}
function build_openjpeg { function build_openjpeg {
if [ -e openjpeg-stamp ]; then return; fi if [ -e openjpeg-stamp ]; then return; fi
build_zlib build_zlib
build_libpng build_libpng
build_tiff build_tiff
build_lcms2 build_lcms2
local cmake=$(get_cmake) local cmake=$(get_modern_cmake)
local archive_prefix="v" local archive_prefix="v"
if [ $(lex_ver $OPENJPEG_VERSION) -lt $(lex_ver 2.1.1) ]; then if [ $(lex_ver $OPENJPEG_VERSION) -lt $(lex_ver 2.1.1) ]; then
archive_prefix="version." archive_prefix="version."
...@@ -194,6 +202,12 @@ function build_xz { ...@@ -194,6 +202,12 @@ function build_xz {
build_simple xz $XZ_VERSION https://tukaani.org/xz build_simple xz $XZ_VERSION https://tukaani.org/xz
} }
function ensure_xz {
if [[ ! $(type -P "xz") ]]; then
build_xz
fi
}
function build_libwebp { function build_libwebp {
build_libpng build_libpng
build_tiff build_tiff
...@@ -252,7 +266,7 @@ function build_libaec { ...@@ -252,7 +266,7 @@ function build_libaec {
function build_blosc { function build_blosc {
if [ -e blosc-stamp ]; then return; fi if [ -e blosc-stamp ]; then return; fi
local cmake=$(get_cmake) local cmake=$(get_modern_cmake)
fetch_unpack https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.tar.gz fetch_unpack https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.tar.gz
(cd c-blosc-${BLOSC_VERSION} \ (cd c-blosc-${BLOSC_VERSION} \
&& $cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX . \ && $cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX . \
......
...@@ -40,7 +40,7 @@ suppress build_flex ...@@ -40,7 +40,7 @@ suppress build_flex
suppress build_openblas suppress build_openblas
suppress build_tiff suppress build_tiff
suppress build_lcms2 suppress build_lcms2
suppress build_xz suppress ensure_xz
suppress build_freetype suppress build_freetype
suppress build_libyaml suppress build_libyaml
if [ -z "$IS_OSX" ]; then if [ -z "$IS_OSX" ]; then
...@@ -56,6 +56,7 @@ if [ -z "$IS_OSX" ]; then ...@@ -56,6 +56,7 @@ if [ -z "$IS_OSX" ]; then
fi fi
suppress build_new_zlib suppress build_new_zlib
suppress build_hdf5 suppress build_hdf5
suppress get_modern_cmake
[ ${MB_PYTHON_VERSION+x} ] || ingest "\$MB_PYTHON_VERSION is not set" [ ${MB_PYTHON_VERSION+x} ] || ingest "\$MB_PYTHON_VERSION is not set"
[ "$MB_PYTHON_VERSION" == "$PYTHON_VERSION" ] || ingest "\$MB_PYTHON_VERSION must be equal to \$PYTHON_VERSION" [ "$MB_PYTHON_VERSION" == "$PYTHON_VERSION" ] || ingest "\$MB_PYTHON_VERSION must be equal to \$PYTHON_VERSION"
......
...@@ -44,10 +44,8 @@ if [ -n "$TEST_BUILDS" ]; then ...@@ -44,10 +44,8 @@ if [ -n "$TEST_BUILDS" ]; then
touch config.sh touch config.sh
source travis_linux_steps.sh source travis_linux_steps.sh
my_plat=${PLAT:-x86_64} my_plat=${PLAT:-x86_64}
build_multilinux $my_plat " build_multilinux $my_plat "source tests/test_manylinux_utils_docker.sh"
source tests/test_manylinux_utils_docker.sh build_multilinux $my_plat "source tests/test_library_builders.sh"
source tests/test_library_builders.sh
"
build_multilinux $my_plat "pip install simplejson" build_multilinux $my_plat "pip install simplejson"
CONFIG_PATH=tests/config.sh CONFIG_PATH=tests/config.sh
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment