Skip to content

Commit

Permalink
Update travis build process.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Mar 22, 2017
1 parent 19a2ce3 commit 8df7592
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 27 deletions.
53 changes: 26 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
language: ruby
dist: trusty
sudo: true
rvm:
- 2.1.8
- 2.2.4
- 2.3.0
- 2.4.0
- ruby-head
- rbx-2
env:
- COVERAGE=true LIBVIPS=8.4.4
matrix:
allow_failures:
- rvm: "rbx-2"
- rvm: "ruby-head"

# Copied from https://github.com/jcupitt/ruby-vips/blob/master/.travis.yml
before_install:
- wget http://www.vips.ecs.soton.ac.uk/supported/current/vips-$LIBVIPS.tar.gz
- tar xvf vips-$LIBVIPS.tar.gz
- cd vips-$LIBVIPS
- >
CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0
./configure --prefix=/usr
- make
- sudo make install
- sudo ldconfig
sudo: false

dist: trusty

addons:
apt:
Expand All @@ -49,3 +25,26 @@ addons:
- libpoppler-glib-dev
- libwebp-dev
- libglib2.0-dev

cache:
directories:
- $HOME/vips

before_install:
- source install-vips.sh

rvm:
- 2.1.8
- 2.2.4
- 2.3.0
- 2.4.0
- ruby-head
- rbx-2

env:
- COVERAGE=true

matrix:
allow_failures:
- rvm: "rbx-2"
- rvm: "ruby-head"
36 changes: 36 additions & 0 deletions install-vips.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
export VIPS_SITE=http://www.vips.ecs.soton.ac.uk/supported
export VIPS_VERSION_MAJOR=8
export VIPS_VERSION_MINOR=4
export VIPS_VERSION_MICRO=5
export VIPS_VERSION=$VIPS_VERSION_MAJOR.$VIPS_VERSION_MINOR
export VIPS_VERSION_FULL=$VIPS_VERSION.$VIPS_VERSION_MICRO
export PATH=$HOME/vips/bin:$PATH
export LD_LIBRARY_PATH=$HOME/vips/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$HOME/vips/lib/pkgconfig:$PKG_CONFIG_PATH
export PYTHONPATH=$HOME/vips/lib/python2.7/site-packages:$PYTHONPATH
export GI_TYPELIB_PATH=$HOME/vips/lib/girepository-1.0:$GI_TYPELIB_PATH

set -e

# do we already have the correct vips built? early exit if yes
# we could check the configure params as well I guess
if [ -d "$HOME/vips/bin" ]; then
version=$($HOME/vips/bin/vips --version)
escaped_version="$VIPS_VERSION_MAJOR\.$VIPS_VERSION_MINOR\.$VIPS_VERSION_MICRO"
echo "Need vips-$VIPS_VERSION_FULL"
echo "Found $version"
if [[ "$version" =~ ^vips-$escaped_version ]]; then
echo "Using cached directory"
exit 0
fi
fi

rm -rf $HOME/vips
wget $VIPS_SITE/$VIPS_VERSION/vips-$VIPS_VERSION_FULL.tar.gz
tar xf vips-$VIPS_VERSION_FULL.tar.gz
cd vips-$VIPS_VERSION_FULL
CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 ./configure --prefix=$HOME/vips $*
make && make install

0 comments on commit 8df7592

Please sign in to comment.