I wanted to convert png images to webp alternatives in travis but Travis CI uses quite old ubuntu version 12.04 so the bundled imagemagick wasn't really up to date:
$ convert -version
Version: ImageMagick 6.6.9-7 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
I know that I can use sudo: required to use travis in virtual machine and install and build things over there. Instead I would like to use the containerized build environment with sudo: false because it's much faster.
If I try to compile libwepb or imagemagick travis gives me permission denied errors because I don't have permissions to /usr/local/ folder:
$ make install
...
/bin/mkdir -p '/usr/local/include/webp'
/bin/mkdir: cannot create directory `/usr/local/include/webp': Permission denied
...
The command "make install" failed and exited with 2 during .
Travis allows users to change
$PATHand install binaries into$HOMEdirectory.Here's complete example for ruby. It only compiles the binaries once and caches them. It only installs them again if the version numbers don't match.
Credits: I looked how this ruby library installs
libwebpand figuring out the rest was easy: https://github.com/le0pard/webp-ffi/blob/master/.travis.yml