Skip to content

Commit

Permalink
Issue 420 (go-spatial#471)
Browse files Browse the repository at this point in the history
* use xgo for cross compiling. closes go-spatial#420
* bump postgres version in CI
* update postgis datafile URL
  • Loading branch information
ARolek authored Jul 26, 2018
1 parent 9a981d4 commit 2c5d902
Show file tree
Hide file tree
Showing 8 changed files with 767 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ services:
- redis-server

addons:
postgresql: "9.4"
postgresql: "9.6"
apt:
packages:
- postgresql-9.4-postgis-2.3
- postgresql-9.6-postgis-2.3

install:
- echo $TRAVIS_GO_VERSION
Expand Down
11 changes: 6 additions & 5 deletions ci/build_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# This script will build the necessary binaries for tegola.
################################################################################

# xgo is used for cross compiling cgo. use the docker container and xgo wrapper tool
docker pull karalabe/xgo-latest
source $CI_DIR/install_go_bin.sh
go_install github.com/karalabe/xgo

OLDDIR=$(pwd)
VERSION_TAG=$TRAVIS_TAG
if [ -z "$VERSION_TAG" ]; then
Expand Down Expand Up @@ -35,7 +40,7 @@ do
FILENAME="${FILENAME}.exe"
fi

GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags "${LDFLAGS}" -o ${FILENAME} github.com/go-spatial/tegola/cmd/tegola
GOOS=${GOOS} GOARCH=${GOARCH} xgo build -ldflags "${LDFLAGS}" -o ${FILENAME} github.com/go-spatial/tegola/cmd/tegola
chmod a+x ${FILENAME}
dir=$(dirname $FILENAME)
fn=$(basename $FILENAME)
Expand All @@ -47,7 +52,3 @@ do
done
done
cd $OLDDIR




2 changes: 1 addition & 1 deletion ci/config_postgis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -ex
# this command uses pg_restore and therefore leverages the environment variables document at https://www.postgresql.org/docs/9.2/static/libpq-envars.html
configure_postgis() {
local test_data="tegola.backup"
local test_data_url="https://s3-us-west-1.amazonaws.com/tegola-test-data/tegola-postgis-test-data.backup"
local test_data_url="https://raw.githubusercontent.com/go-spatial/tegola-testdata/master/tegola.backup"

# fetch our test data
curl $test_data_url > $test_data
Expand Down
21 changes: 21 additions & 0 deletions vendor/github.com/karalabe/xgo/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

272 changes: 272 additions & 0 deletions vendor/github.com/karalabe/xgo/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2c5d902

Please sign in to comment.