Created
February 21, 2016 03:57
-
-
Save felixbuenemann/742f1fdac998b17bfcda to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script to compile vips from git for AWS lambda as dynamic binary | |
# Run on a fresh amzn-ami-hvm-2015.09.1.x86_64-gp2 image. | |
# Tested with image id ami-bff32ccc on t2.micro in eu-west-1. | |
set -e # abort on errors | |
# set -x # for debugging | |
echo Installing build dependencies... | |
sudo yum install git gcc-c++ libtool swig gtk-doc glib2-devel \ | |
gobject-introspection-devel libxml2-devel giflib-devel libpng-devel \ | |
libtiff-devel lcms2-devel ImageMagick-devel | |
if [ -e libvips ]; then | |
echo Fetching vips master... | |
cd libvips | |
git fetch origin | |
git checkout -f master | |
git reset --hard origin/master | |
else | |
echo Cloning vips master... | |
git clone --depth 1 https://github.com/jcupitt/libvips.git | |
cd libvips | |
fi | |
version=`awk '/AC_INIT/ {match($2,"[0-9.]+",a)}END{print a[0]}' < configure.ac` | |
revision=`git rev-parse --short HEAD` | |
echo Compiling and installing vips $version-$revision... | |
./bootstrap.sh | |
./configure --prefix=/tmp/vips --disable-introspection | |
make -j`nproc` install-strip clean | |
cd .. | |
tarball=vips-$version-$revision.tar.bz2 | |
echo Creating tarball $tarball... | |
tar cvjf $tarball -C /tmp vips | |
rm -rf /tmp/vips | |
echo Finished... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment