Skip to content

Instantly share code, notes, and snippets.

@hugobarauna
Forked from soffes/imagemagick.sh
Created December 9, 2009 13:55
Show Gist options
  • Save hugobarauna/252485 to your computer and use it in GitHub Desktop.
Save hugobarauna/252485 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes
# http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/
# Work with 64bit kernel mode
set -e
PREFIX=/usr/local
# Passenger users: amend your Apache global configuration with the following directive
# SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
# The Apache config file is located at /etc/apache2/httpd.conf
# # FreeType
wget http://sourceforge.net/projects/freetype/files/freetype2/2.3.9/freetype-2.3.9.tar.gz/download -O- | tar xz
cd freetype-2.3.9
./configure --prefix=$PREFIX
make
sudo make install
cd ..
# libpng
wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.41.tar.bz2 -O- | tar xj
cd libpng-1.2.41
./configure --prefix=$PREFIX
make
sudo make install
cd ..
# jpeg
wget http://www.ijg.org/files/jpegsrc.v7.tar.gz -O- | tar xz
cd jpeg-7
ln -s `which glibtool` ./libtool
export MACOSX_DEPLOYMENT_TARGET=10.6
./configure --enable-shared --prefix=$PREFIX
make
sudo make install
cd ..
# libtiff
wget http://dl.maptools.org/dl/libtiff/tiff-3.8.2.tar.gz -O- | tar xz
cd tiff-3.8.2
./configure --prefix=$PREFIX
make
sudo make install
cd ..
# libwmf
wget http://sourceforge.net/projects/wvware/files/libwmf/0.2.8.4/libwmf-0.2.8.4.tar.gz/download -O- | tar xz
cd libwmf-0.2.8.4
./configure --prefix=$PREFIX
make
sudo make install
cd ..
# LittleCms
wget http://www.littlecms.com/lcms-1.18a.tar.gz -O- | tar xz
cd lcms-1.18
./configure --prefix=$PREFIX
make
sudo make install
cd ..
# Ghostscript
wget http://ghostscript.com/releases/ghostscript-8.70.tar.gz -O- | tar xz
cd ghostscript-8.70
./configure --prefix=$PREFIX
make
sudo make install
cd ..
# Ghostscript Fonts
wget http://sourceforge.net/projects/gs-fonts/files/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-8.11.tar.gz/download -O- | tar xz
sudo mv -f fonts $PREFIX/share/ghostscript
# ImageMagick
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.5.7-10.tar.gz -O- | tar xz
cd ImageMagick-6.5.7-10
export CPPFLAGS=-I$PREFIX/include
export LDFLAGS=-L$PREFIX/lib
./configure --prefix=$PREFIX --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --with-gs-font-dir=$PREFIX/share/ghostscript/fonts
make
sudo make install
cd ..
# Clean up
rm -rf freetype-2.3.9 libpng-1.2.41 jpeg-7 tiff-3.8.2 libwmf-0.2.8.4 lcms-1.18 ghostscript-8.70 ImageMagick-6.5.7-10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment