Skip to content

Commit

Permalink
add travis support for testing ImageMagick7
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfx committed Jan 10, 2018
1 parent a91eb2b commit 9bcc58d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
language: go
sudo: required

go:
- 1.9.x

cache:
directories:
- "$HOME/opt"

env:
global:
- GOARCH=amd64
- IMAGEMAGICK_VERSION=7.0.7-21

before_install:
# Update PATH so that travis can find newer imagemagick
- export PATH=$HOME/opt/bin:$PATH

# Build ImageMagick from source
- convert -version | grep $IMAGEMAGICK_VERSION || {
export CORES=$(nproc) &&
echo "Using $CORES cores for compiling..." &&
cd /tmp &&
sudo apt-get install build-essential -y &&
sudo apt-get build-dep imagemagick -y &&
wget "https://www.imagemagick.org/download/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.gz" &&
tar -xvf "ImageMagick-${IMAGEMAGICK_VERSION}.tar.gz" &&
cd "ImageMagick-${IMAGEMAGICK_VERSION}" &&
./configure --prefix=$HOME/opt --without-magick-plus-plus --without-perl --disable-openmp --with-gvc=no &&
make -j$CORES && sudo make install && sudo ldconfig &&
$HOME/opt/bin/convert -version | grep $IMAGEMAGICK_VERSION &&
cd $TRAVIS_BUILD_DIR; }

# Update library paths for programs
- export LD_FLAGS=-L$HOME/opt/lib
- export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/lib
- export CPATH=$CPATH:$HOME/opt/include
- export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/lib
- export PKG_CONFIG_PATH=$HOME/opt/lib/pkgconfig

# Set the import path for the particular branch of imagick bindings
- export IMAGICK_IMPORT_PATH=$(grep gopkg.in/gographics/imagick.v imagick/imagick.go | cut -d\" -f2)

install:
- pkg-config --cflags --libs MagickWand
- go get $IMAGICK_IMPORT_PATH

script:
- go test -v $IMAGICK_IMPORT_PATH
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Go Imagick

[![GoDoc](https://godoc.org/gopkg.in/gographics/imagick.v2/imagick?status.svg)](https://gopkg.in/gographics/imagick.v2/imagick)
[![GoDoc](https://godoc.org/gopkg.in/gographics/imagick.v2/imagick?status.svg)](https://gopkg.in/gographics/imagick.v2/imagick) [![Travis Build Status](https://api.travis-ci.org/gographics/imagick.svg)](https://travis-ci.org/gographics/imagick)

Go Imagick is a Go bind to ImageMagick's MagickWand C API.

Expand Down

0 comments on commit 9bcc58d

Please sign in to comment.