2010-05-27 03:33:16 +00:00
|
|
|
require 'formula'
|
2009-08-30 15:12:46 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Imagemagick < Formula
|
2012-02-26 05:00:28 +00:00
|
|
|
homepage 'http://www.imagemagick.org'
|
|
|
|
|
2012-02-27 22:33:43 +00:00
|
|
|
# upstream's stable tarballs tend to disappear, so we provide our own mirror
|
2012-12-16 23:26:07 +00:00
|
|
|
# Tarball from: http://www.imagemagick.org/download/ImageMagick.tar.gz
|
|
|
|
# SHA-256 from: http://www.imagemagick.org/download/digest.rdf
|
|
|
|
url 'http://downloads.sf.net/project/machomebrew/mirror/ImageMagick-6.8.0-10.tar.gz'
|
|
|
|
sha256 'b3dfcb44300f73e73ffa8deef8bba4cf43f03d7150bf1fd0febedceac1a45c7e'
|
2012-02-26 05:00:28 +00:00
|
|
|
|
2012-02-27 22:41:40 +00:00
|
|
|
head 'https://www.imagemagick.org/subversion/ImageMagick/trunk',
|
|
|
|
:using => UnsafeSubversionDownloadStrategy
|
2010-09-22 04:25:33 +00:00
|
|
|
|
2012-09-02 07:59:40 +00:00
|
|
|
option 'with-quantum-depth-8', 'Compile with a quantum depth of 8 bit'
|
|
|
|
option 'with-quantum-depth-16', 'Compile with a quantum depth of 16 bit'
|
|
|
|
option 'with-quantum-depth-32', 'Compile with a quantum depth of 32 bit'
|
|
|
|
|
2013-02-11 01:29:33 +00:00
|
|
|
depends_on :libltdl
|
2012-06-07 01:35:12 +00:00
|
|
|
|
2013-01-27 22:40:56 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-05-27 03:33:16 +00:00
|
|
|
|
2013-01-27 22:40:56 +00:00
|
|
|
depends_on 'jpeg' => :recommended
|
|
|
|
depends_on :libpng => :recommended
|
|
|
|
depends_on :freetype => :recommended
|
|
|
|
|
|
|
|
depends_on :x11 => :optional
|
|
|
|
depends_on :fontconfig => :optional
|
|
|
|
depends_on 'libtiff' => :optional
|
|
|
|
depends_on 'little-cms' => :optional
|
|
|
|
depends_on 'jasper' => :optional
|
|
|
|
depends_on 'libwmf' => :optional
|
|
|
|
depends_on 'librsvg' => :optional
|
|
|
|
depends_on 'liblqr' => :optional
|
|
|
|
depends_on 'openexr' => :optional
|
|
|
|
depends_on 'ghostscript' => :optional
|
|
|
|
|
|
|
|
opoo '--with-ghostscript is not recommended' if build.with? 'ghostscript'
|
|
|
|
if build.with? 'openmp' and (MacOS.version == 10.5 or ENV.compiler == :clang)
|
|
|
|
opoo '--with-openmp is not supported on Leopard or with Clang'
|
|
|
|
end
|
2009-06-28 15:56:15 +00:00
|
|
|
|
2012-08-11 15:08:17 +00:00
|
|
|
bottle do
|
2012-12-16 23:26:07 +00:00
|
|
|
sha1 '543ce5bf72c3897f25b54523a5c3de355a84ff44' => :mountainlion
|
|
|
|
sha1 '1966734b73b2cf77f47e639fe7ae48603dec15bd' => :lion
|
|
|
|
sha1 '1068830a71fb1f990d8fcb06495693eaeb4edafc' => :snowleopard
|
2012-08-11 15:08:17 +00:00
|
|
|
end
|
|
|
|
|
2012-09-09 17:40:18 +00:00
|
|
|
skip_clean :la
|
2010-05-27 03:33:16 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
args = [ "--disable-osx-universal-binary",
|
|
|
|
"--without-perl", # I couldn't make this compile
|
|
|
|
"--prefix=#{prefix}",
|
2010-05-07 18:42:24 +00:00
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--enable-shared",
|
|
|
|
"--disable-static",
|
2012-09-02 07:59:40 +00:00
|
|
|
"--without-pango",
|
2012-09-18 20:33:25 +00:00
|
|
|
"--with-included-ltdl",
|
2010-12-20 17:11:43 +00:00
|
|
|
"--with-modules"]
|
2010-05-07 18:42:24 +00:00
|
|
|
|
2012-09-02 07:59:40 +00:00
|
|
|
args << "--disable-openmp" unless build.include? 'enable-openmp'
|
|
|
|
args << "--disable-opencl" if build.include? 'disable-opencl'
|
2013-01-27 22:40:56 +00:00
|
|
|
args << "--without-gslib" unless build.with? 'ghostscript'
|
|
|
|
args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" unless build.with? 'ghostscript'
|
|
|
|
args << "--without-magick-plus-plus" if build.without? 'magick-plus-plus'
|
2012-09-02 07:59:40 +00:00
|
|
|
args << "--enable-hdri=yes" if build.include? 'enable-hdri'
|
2011-07-28 23:39:05 +00:00
|
|
|
|
2013-01-27 22:40:56 +00:00
|
|
|
if build.with? 'quantum-depth-32'
|
2011-07-28 23:39:05 +00:00
|
|
|
quantum_depth = 32
|
2013-01-27 22:40:56 +00:00
|
|
|
elsif build.with? 'quantum-depth-16'
|
2011-07-28 23:39:05 +00:00
|
|
|
quantum_depth = 16
|
2013-01-27 22:40:56 +00:00
|
|
|
elsif build.with? 'quantum-depth-8'
|
2011-07-28 23:39:05 +00:00
|
|
|
quantum_depth = 8
|
|
|
|
end
|
|
|
|
|
|
|
|
args << "--with-quantum-depth=#{quantum_depth}" if quantum_depth
|
2013-01-27 22:40:56 +00:00
|
|
|
args << "--with-rsvg" if build.with? 'rsvg'
|
2013-03-01 00:40:21 +00:00
|
|
|
args << "--without-x" unless build.with? 'x11'
|
2013-01-27 22:40:56 +00:00
|
|
|
args << "--with-fontconfig=yes" if build.with? 'fontconfig' or MacOS::X11.installed?
|
|
|
|
args << "--with-freetype=yes" if build.with? 'freetype' or MacOS::X11.installed?
|
2009-08-30 15:12:46 +00:00
|
|
|
|
2010-05-07 18:42:24 +00:00
|
|
|
# versioned stuff in main tree is pointless for us
|
|
|
|
inreplace 'configure', '${PACKAGE_NAME}-${PACKAGE_VERSION}', '${PACKAGE_NAME}'
|
2010-05-27 03:33:16 +00:00
|
|
|
system "./configure", *args
|
2009-06-28 15:56:15 +00:00
|
|
|
system "make install"
|
2009-08-08 13:08:13 +00:00
|
|
|
end
|
|
|
|
|
2013-01-27 22:40:56 +00:00
|
|
|
test do
|
2012-09-02 07:59:40 +00:00
|
|
|
system "#{bin}/identify", \
|
|
|
|
"/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/Key_Large.png"
|
2010-06-30 18:27:08 +00:00
|
|
|
end
|
2009-09-26 23:09:50 +00:00
|
|
|
end
|