-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinstall_gdal.sh
36 lines (32 loc) · 1.06 KB
/
install_gdal.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
echo "Installing GDAL"
export GDAL="2.0.1"
export GDAL_URL=http://download.osgeo.org/gdal/${GDAL}/gdal-${GDAL}.tar.gz
export PATH=$HOME/.local/bin:$PATH
export GDAL_PREFIX=$HOME/.local/gdal-$GDAL
export GDAL_BIN=$GDAL_PREFIX/bin
export GDAL_LIB=$GDAL_PREFIX/lib
export GDAL_SRC=/tmp/gdal-$GDAL-src
if [ ! -f $GDAL_BIN/gdal-config ]; then
mkdir -p $GDAL_PREFIX
mkdir -p $GDAL_SRC
curl -L $GDAL_URL | tar xz --strip-components=1 -C $GDAL_SRC
pushd $GDAL_SRC
./configure --prefix=$GDAL_PREFIX \
--enable-debug \
--without-libtool \
--without-php \
--without-python \
--without-java \
--without-perl \
--without-ruby \
--without-odbc
make -j3
make install
popd
fi
export PATH=$GDAL_BIN:$PATH
# It seems stack doesn't use the extraLibs and extraLibDirs that we set in
# Setup.hs so the test suite can't link to the library unless we set
# LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$GDAL_LIB:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$GDAL_LIB:$DYLD_LIBRARY_PATH