-
Notifications
You must be signed in to change notification settings - Fork 64
/
build.sh
executable file
·57 lines (45 loc) · 1.34 KB
/
build.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
##
# Install GDAL from within a docker container
#
# This script is designed to be run from within a docker container in order to
# install GDAL. It delegates to `before_install.sh` and `install.sh` which are
# patched from the Travis CI configuration in the GDAL repository.
#
set -e
DIR=$(dirname "$(readlink -f "$0")")
GDAL_VERSION=$(cat ${DIR}/gdal-checkout.txt)
export DEBIAN_FRONTEND=noninteractive
# Set the locale. Required for subversion to work on the repository.
update-locale LANG="C.UTF-8"
dpkg-reconfigure locales
. /etc/default/locale
export LANG
# Instell prerequisites.
apt-get update -y
apt-get install -y \
software-properties-common \
wget \
unzip \
subversion \
ccache \
clang-3.5 \
patch \
python-dev \
ant
# Everything happens under here.
cd /tmp
# Get GDAL.
svn checkout --quiet "http://svn.osgeo.org/gdal/${GDAL_VERSION}/" /tmp/gdal/
# Install GDAL.
cd /tmp/gdal
# Apply our build patches.
patch ./gdal/ci/travis/trusty_clang/before_install.sh ${DIR}/before_install.sh.patch
patch ./gdal/ci/travis/trusty_clang/install.sh ${DIR}/install.sh.patch
# Do the build.
. ./gdal/ci/travis/trusty_clang/before_install.sh
. ./gdal/ci/travis/trusty_clang/install.sh
# Clean up.
apt-get autoremove -y
apt-get clean
rm -rf /var/lib/apt/lists/partial/* /tmp/* /var/tmp/*