language: go

go:
  - 1.7
  - 1.8
  - 1.9
  - tip

env:
  - GOARCH=amd64

sudo: required
dist: trusty

before_install:
  - sudo apt-get update -qq
  - sudo apt-get install -qq -y gtk+3.0 libgtk-3-dev
  - sudo apt-get install -qq -y xvfb
  - "export DISPLAY=:99.0"
  - sudo /usr/bin/Xvfb $DISPLAY 2>1 > /dev/null &
  - "export GTK_VERSION=$(pkg-config --modversion gtk+-3.0 | tr . _| cut -d '_' -f 1-2)"
  - "export Glib_VERSION=$(pkg-config --modversion glib-2.0)"
  - "export Cairo_VERSION=$(pkg-config --modversion cairo)"
  - "export Pango_VERSION=$(pkg-config --modversion pango)"
  - echo "GTK version ${GTK_VERSION} (Glib ${Glib_VERSION}, Cairo ${Cairo_VERSION}, Pango ${Pango_VERSION})"

install:
  - go get -t -tags "gtk_${GTK_VERSION}" ./...

script:
  - go test -tags "gtk_${GTK_VERSION}" ./...

language: go

go:
  - 1.7
  - 1.8
  - 1.9
  - tip

env:
  - GOARCH=amd64

sudo: required
dist: trusty

before_install:
  - sudo apt-get update -qq
  - sudo apt-get install -qq -y gtk+3.0 libgtk-3-dev
  - sudo apt-get install -qq -y xvfb
  - "export DISPLAY=:99.0"
  - sudo /usr/bin/Xvfb $DISPLAY 2>1 > /dev/null &
  - "export GTK_VERSION=$(pkg-config --modversion gtk+-3.0 | tr . _| cut -d '_' -f 1-2)"
  - "export Glib_VERSION=$(pkg-config --modversion glib-2.0)"
  - "export Cairo_VERSION=$(pkg-config --modversion cairo)"
  - "export Pango_VERSION=$(pkg-config --modversion pango)"
  - echo "GTK version ${GTK_VERSION} (Glib ${Glib_VERSION}, Cairo ${Cairo_VERSION}, Pango ${Pango_VERSION})"
# hack for building on forks -> move to original repo name:
  - RepoName=`basename $PWD`; SrcDir=`dirname $PWD`; DestDir="`dirname $SrcDir`/gotk3"
  - if [[ "$SrcDir" != "$DestDir" ]]; then mv "$SrcDir" "$DestDir"; cd ../../gotk3/$RepoName; export TRAVIS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/$RepoName; fi

install:
  - go get -t -tags "gtk_${GTK_VERSION}" ./...

script:
  - go test -tags "gtk_${GTK_VERSION}" ./...

Add hack to move the repo to original (gotk3) repo name
Add hack to move the repo to original (gotk3) repo name
