Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version of imagemagick #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 3 additions & 30 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ VENDOR_DIR="$BUILD_DIR/vendor"
INSTALL_DIR="$VENDOR_DIR/imagemagick"
CACHE_FILE="$CACHE_DIR/imagemagick.tar.gz"


if [ ! -f $CACHE_FILE ]; then
# install imagemagick
IMAGE_MAGICK_VERSION="${IMAGE_MAGICK_VERSION:-6.9.3-10}"
IMAGE_MAGICK_VERSION="${IMAGE_MAGICK_VERSION:-7.0.2-6}"
IMAGE_MAGICK_FILE="ImageMagick-$IMAGE_MAGICK_VERSION.tar.gz"
IMAGE_MAGICK_DIR="ImageMagick-$IMAGE_MAGICK_VERSION"
# SSL cert used on imagemagick not recognized by heroku.
IMAGE_MAGICK_URL="http://www.imagemagick.org/download/releases/$IMAGE_MAGICK_FILE"
IMAGE_MAGICK_URL="https://www.imagemagick.org/download/releases/$IMAGE_MAGICK_FILE"

echo "-----> Downloading ImageMagick from $IMAGE_MAGICK_URL"
wget $IMAGE_MAGICK_URL -P $BUILD_DIR | indent
Expand Down Expand Up @@ -51,20 +49,10 @@ if [ ! -f $CACHE_FILE ]; then
else
# cache exists, extract it
echo "-----> Extracting ImageMagick $CACHE_FILE => $VENDOR_DIR"
mkdir -p $VENDOR_DIR
tar xzf $CACHE_FILE -C $VENDOR_DIR
fi

echo "-----> Writing policy file"
mkdir -p $INSTALL_DIR/etc/ImageMagick
cat > $INSTALL_DIR/policy.xml <<EOF
<policymap>
<policy domain="coder" rights="none" pattern="EPHEMERAL" />
<policy domain="coder" rights="none" pattern="HTTPS" />
<policy domain="coder" rights="none" pattern="MVG" />
<policy domain="coder" rights="none" pattern="MSL" />
</policymap>
EOF

# update PATH and LD_LIBRARY_PATH
echo "-----> Updating environment variables"
PROFILE_PATH="$BUILD_DIR/.profile.d/imagemagick.sh"
Expand All @@ -73,18 +61,3 @@ mkdir -p $(dirname $PROFILE_PATH)
echo "export PATH=$ACTUAL_INSTALL_PATH/bin:\$PATH" >> $PROFILE_PATH
echo "export LD_LIBRARY_PATH=$ACTUAL_INSTALL_PATH/lib:\$LD_LIBRARY_PATH" >> $PROFILE_PATH
echo "export MAGICK_CONFIGURE_PATH=$ACTUAL_INSTALL_PATH" >> $PROFILE_PATH

# DOWNLOAD_URL="http://www.imagemagick.org/download/ImageMagick-6.9.2-0.tar.gz"

# echo "DOWNLOAD_URL = " $DOWNLOAD_URL | indent

# cd $BUILD_DIR
# mkdir -p $VENDOR_DIR
# cd $VENDOR_DIR
# curl -L --silent $DOWNLOAD_URL | tar xz

# echo "exporting PATH and LIBRARY_PATH" | indent
# PROFILE_PATH="$BUILD_DIR/.profile.d/imagemagick.sh"
# mkdir -p $(dirname $PROFILE_PATH)
# echo 'export PATH="$PATH:$HOME/vendor/ImageMagick-6.9.2/bin"' >> $PROFILE_PATH
# echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/vendor/ImageMagick-6.9.2/lib"' >> $PROFILE_PATH