1#!/bin/sh 2 3set -e 4 5CONDA_PREFIX=/usr/local/miniconda/envs/test 6 7# Few tricks from https://github.com/conda-forge/gdal-feedstock/blob/master/recipe/build.sh 8 9# recommended in https://gitter.im/conda-forge/conda-forge.github.io?at=5c40da7f95e17b45256960ce 10find ${CONDA_PREFIX}/lib -name '*.la' -delete 11 12# build GDAL 13cd gdal 14# --without-tiledb because of https://github.com/OSGeo/gdal/issues/3122 15./configure --prefix=$HOME/install-gdal \ 16 --enable-debug \ 17 --with-jpeg12 \ 18 --with-geotiff=internal \ 19 --with-png=internal \ 20 --without-pg \ 21 --without-jasper \ 22 --without-webp \ 23 --with-expat=${CONDA_PREFIX} \ 24 --with-sqlite3=${CONDA_PREFIX} \ 25 --with-libjson-c=${CONDA_PREFIX} \ 26 --without-tiledb \ 27 --without-python 28make USER_DEFS="-Wextra -Werror" -j3 29cd apps 30make USER_DEFS="-Wextra -Werror" test_ogrsf 31echo "Show which shared libs got used:" 32otool -L .libs/ogrinfo 33cd .. 34cd swig/python 35python3 setup.py build 36cd ../.. 37make install 38export PATH=$HOME/install-gdal/bin:$PWD/apps/.libs:$PATH 39export DYLD_LIBRARY_PATH=$HOME/install-gdal/lib 40export GDAL_DATA=$HOME/install-gdal/share/gdal 41 42cd ../autotest/cpp 43echo $PATH 44 45gdal-config --version 46gdal-config --cflags 47gdal-config --libs 48make -j3 49cd ../../gdal 50 51# Post-install testing 52# ../autotest/postinstall/test_pkg-config.sh $HOME/install-gdal 53