From f8315a1d87e06e315457e08e304b7f1500a3f58c Mon Sep 17 00:00:00 2001 From: Alan Peabody Date: Tue, 19 Jan 2016 17:00:44 -0500 Subject: [PATCH] Update to use newer imagemagick, fail on dl fail. Also explicity sets CACHEDIR which fixes cache fail. --- README.md | 2 ++ bin/compile | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ab376ca..08cd36a 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,5 @@ heroku-buildpack-imagemagick ================================= This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) for vendoring the ImageMagick binaries into your project. + +Set the version using the IMAGE_MAGICK_VERSION env var in your environment. diff --git a/bin/compile b/bin/compile index 0f2e1d5..63cf2c5 100644 --- a/bin/compile +++ b/bin/compile @@ -7,6 +7,7 @@ indent() { echo "-----> Install ImageMagick" BUILD_DIR=$1 +CACHE_DIR=$2 VENDOR_DIR="$BUILD_DIR/vendor" INSTALL_DIR="$VENDOR_DIR/imagemagick" CACHE_FILE="$CACHE_DIR/imagemagick.tar.gz" @@ -14,13 +15,22 @@ CACHE_FILE="$CACHE_DIR/imagemagick.tar.gz" if [ ! -f $CACHE_FILE ]; then # install imagemagick - IMAGE_MAGICK_VERSION="6.9.2-0" + IMAGE_MAGICK_VERSION="${IMAGE_MAGICK_VERSION:-6.9.3-1}" IMAGE_MAGICK_FILE="ImageMagick-$IMAGE_MAGICK_VERSION.tar.gz" IMAGE_MAGICK_DIR="ImageMagick-$IMAGE_MAGICK_VERSION" - IMAGE_MAGICK_URL="http://www.imagemagick.org/download/$IMAGE_MAGICK_FILE" + # SSL cert used on imagemagick not recognized by heroku. + IMAGE_MAGICK_URL="http://www.imagemagick.org/download/releases/$IMAGE_MAGICK_FILE" echo "-----> Downloading ImageMagick from $IMAGE_MAGICK_URL" - curl -L --silent $IMAGE_MAGICK_URL | tar xz + wget $IMAGE_MAGICK_URL -P $BUILD_DIR | indent + + echo "-----> Extracting ImageMagick from $BUILD_DIR/$IMAGE_MAGICK_FILE" + if [ ! -f $BUILD_DIR/$IMAGE_MAGICK_FILE ]; then + echo "Error: Unable to download image magick" | indent + ls $BUILD_DIR | indent + exit 1; + fi + tar xvf $BUILD_DIR/$IMAGE_MAGICK_FILE | indent echo "-----> Building ImageMagick" cd $IMAGE_MAGICK_DIR