language: generic

os: osx
osx_image: xcode9.2

env:
  global:
    - COLUMNS=240

before_install:
  - brew cleanup
  - brew uninstall boost carthage cgal dirmngr freexl gdal go libgeotiff liblwgeom libspatialite libtiff maven mercurial postgis postgresql python sfcgal swiftlint
  - brew update
  - brew upgrade
  - brew cleanup

install:
  - brew install advancecomp
  - brew tap lovell/package-libvips-darwin https://github.com/lovell/package-libvips-darwin.git
  - brew install lovell/package-libvips-darwin/libtiff --build-bottle
  - brew install lovell/package-libvips-darwin/gdk-pixbuf --build-bottle
  - brew postinstall lovell/package-libvips-darwin/gdk-pixbuf
  - brew install lovell/package-libvips-darwin/vips --build-bottle

script:
  - export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/jpeg-turbo/lib/pkgconfig"
  - ./package.sh

addons:
  artifacts:
    s3_region: eu-west-1

language: generic

os: osx
osx_image: xcode9.3

env:
  global:
    - COLUMNS=240
    - PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/jpeg-turbo/lib/pkgconfig:$PKG_CONFIG_PATH"
    - HOMEBREW_NO_AUTO_UPDATE=1
    - HOMEBREW_NO_INSTALL_CLEANUP=1
    - KEEP_PACKAGES="cmake gdbm gettext giflib git jpeg libffi libpng libxml2 openssl openssl@1.1 pcre pkg-config python readline sqlite xz"

before_install:
  - brew cleanup
  # Remove pre-installed Travis packages
  # See: https://github.com/travis-ci/packer-templates-mac/blob/master/playbooks/roles/homebrew/defaults/main.yml
  - brew list -1 | grep -Ev ${KEEP_PACKAGES// /|} | xargs brew rm -f
  - brew update
  - brew upgrade

install:
  - brew install advancecomp
  - brew tap lovell/package-libvips-darwin https://github.com/lovell/package-libvips-darwin.git
  - brew install lovell/package-libvips-darwin/libtiff --build-bottle
  - brew install lovell/package-libvips-darwin/gdk-pixbuf --build-bottle
  - brew postinstall lovell/package-libvips-darwin/gdk-pixbuf
  - brew install lovell/package-libvips-darwin/vips --build-bottle

script:
  - ./package.sh

before_cache:
  - brew cleanup

cache:
  directories:
    # Cache downloaded bottles
    - $HOME/Library/Caches/Homebrew

addons:
  artifacts:
    s3_region: eu-west-1

Upgrade macOS to 10.13 (High Sierra)
Upgrade macOS to 10.13 (High Sierra)

macOS 10.12 (Sierra) no longer seems to be supported.
