2010-11-10 18:16:28 +00:00
|
|
|
# some credit to https://github.com/maddox/magick-installer
|
2010-05-27 03:33:16 +00:00
|
|
|
require 'formula'
|
2009-08-30 15:12:46 +00:00
|
|
|
|
2009-12-11 13:14:47 +00:00
|
|
|
def ghostscript_srsly?
|
2012-09-02 07:59:40 +00:00
|
|
|
build.include? 'with-ghostscript'
|
2009-12-11 13:14:47 +00:00
|
|
|
end
|
|
|
|
|
2010-05-07 18:42:24 +00:00
|
|
|
def ghostscript_fonts?
|
|
|
|
File.directory? "#{HOMEBREW_PREFIX}/share/ghostscript/fonts"
|
|
|
|
end
|
|
|
|
|
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-06-07 01:36:59 +00:00
|
|
|
url 'http://downloads.sf.net/project/machomebrew/mirror/ImageMagick-6.7.7-6.tar.bz2'
|
|
|
|
sha256 'fb32cdeef812bc2c3bb9e9f48f3cfc75c1e2640f784ef2670a0dbf948e538677'
|
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-ghostscript', 'Compile against ghostscript (not recommended.)'
|
|
|
|
option 'use-tiff', 'Compile with libtiff support.'
|
|
|
|
option 'use-cms', 'Compile with little-cms support.'
|
|
|
|
option 'use-jpeg2000', 'Compile with jasper support.'
|
|
|
|
option 'use-wmf', 'Compile with libwmf support.'
|
|
|
|
option 'use-rsvg', 'Compile with librsvg support.'
|
|
|
|
option 'use-lqr', 'Compile with liblqr support.'
|
|
|
|
option 'use-exr', 'Compile with openexr support.'
|
|
|
|
option 'enable-openmp', 'Enable OpenMP (not supported on Leopard or with Clang).'
|
|
|
|
option 'disable-opencl', 'Disable OpenCL.'
|
|
|
|
option 'enable-hdri', 'Compile with HDRI support enabled'
|
|
|
|
option 'without-magick-plus-plus', "Don't compile C++ interface."
|
|
|
|
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'
|
2012-09-05 05:10:56 +00:00
|
|
|
option 'without-x', 'Compile without x11'
|
2012-09-02 07:59:40 +00:00
|
|
|
|
2012-02-29 20:19:07 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-05-27 03:33:16 +00:00
|
|
|
|
2012-09-02 07:59:40 +00:00
|
|
|
depends_on 'jpeg' => :recommended
|
2012-07-30 20:22:25 +00:00
|
|
|
depends_on :libpng
|
2012-09-05 05:10:56 +00:00
|
|
|
depends_on :x11 unless build.include? 'without-x'
|
2012-06-07 01:35:12 +00:00
|
|
|
|
2012-09-02 07:59:40 +00:00
|
|
|
depends_on 'ghostscript' => :optional if ghostscript_srsly?
|
2010-05-27 03:33:16 +00:00
|
|
|
|
2012-09-02 07:59:40 +00:00
|
|
|
depends_on 'libtiff' => :optional if build.include? 'use-tiff'
|
|
|
|
depends_on 'little-cms' => :optional if build.include? 'use-cms'
|
|
|
|
depends_on 'jasper' => :optional if build.include? 'use-jpeg2000'
|
|
|
|
depends_on 'libwmf' => :optional if build.include? 'use-wmf'
|
|
|
|
depends_on 'librsvg' => :optional if build.include? 'use-rsvg'
|
|
|
|
depends_on 'liblqr' => :optional if build.include? 'use-lqr'
|
|
|
|
depends_on 'openexr' => :optional if build.include? 'use-exr'
|
2009-06-28 15:56:15 +00:00
|
|
|
|
2012-08-11 15:08:17 +00:00
|
|
|
bottle do
|
2012-08-12 04:17:49 +00:00
|
|
|
version 1
|
|
|
|
sha1 'fde8ed2686740ed83efd0626dd20170d9d3096b7' => :mountainlion
|
|
|
|
sha1 'e2c4d5b9e5f37e5f20dec36f3f3cbfc65821e164' => :lion
|
|
|
|
sha1 '019400feda06e4f277187702a4baeacdfdbf4851' => :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
|
|
|
|
2012-04-25 22:23:04 +00:00
|
|
|
def patches
|
|
|
|
# Fixes xml2-config that can be missing --prefix. See issue #11789
|
|
|
|
# Remove if the final Mt. Lion xml2-config supports --prefix.
|
|
|
|
# Not reporting this upstream until the final Mt. Lion is released.
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
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",
|
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'
|
|
|
|
args << "--without-gslib" unless build.include? 'with-ghostscript'
|
2010-07-28 06:01:12 +00:00
|
|
|
args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" \
|
2010-05-07 18:42:24 +00:00
|
|
|
unless ghostscript_srsly? or ghostscript_fonts?
|
2012-09-02 07:59:40 +00:00
|
|
|
args << "--without-magick-plus-plus" if build.include? 'without-magick-plus-plus'
|
|
|
|
args << "--enable-hdri=yes" if build.include? 'enable-hdri'
|
2011-07-28 23:39:05 +00:00
|
|
|
|
2012-09-02 07:59:40 +00:00
|
|
|
if build.include? 'with-quantum-depth-32'
|
2011-07-28 23:39:05 +00:00
|
|
|
quantum_depth = 32
|
2012-09-02 07:59:40 +00:00
|
|
|
elsif build.include? 'with-quantum-depth-16'
|
2011-07-28 23:39:05 +00:00
|
|
|
quantum_depth = 16
|
2012-09-02 07:59:40 +00:00
|
|
|
elsif build.include? '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
|
2012-09-02 07:59:40 +00:00
|
|
|
args << "--with-rsvg" if build.include? 'use-rsvg'
|
2012-09-05 05:10:56 +00:00
|
|
|
args << "--without-x" if build.include? 'without-x'
|
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
|
|
|
|
|
|
|
|
def caveats
|
2010-09-22 04:25:33 +00:00
|
|
|
unless ghostscript_fonts? or ghostscript_srsly?
|
2011-07-29 10:40:43 +00:00
|
|
|
<<-EOS.undent
|
|
|
|
Some tools will complain unless the ghostscript fonts are installed to:
|
2010-09-22 04:25:33 +00:00
|
|
|
#{HOMEBREW_PREFIX}/share/ghostscript/fonts
|
|
|
|
EOS
|
|
|
|
end
|
2010-01-16 17:01:12 +00:00
|
|
|
end
|
2010-06-30 18:27:08 +00:00
|
|
|
|
|
|
|
def test
|
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
|
2012-04-25 22:23:04 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
--- a/configure 2012-02-25 09:03:23.000000000 -0800
|
|
|
|
+++ b/configure 2012-04-26 03:32:15.000000000 -0700
|
|
|
|
@@ -31924,7 +31924,7 @@
|
|
|
|
# Debian installs libxml headers under /usr/include/libxml2/libxml with
|
|
|
|
# the shared library installed under /usr/lib, whereas the package
|
|
|
|
# installs itself under $prefix/libxml and $prefix/lib.
|
|
|
|
- xml2_prefix=`xml2-config --prefix`
|
|
|
|
+ xml2_prefix=/usr
|
|
|
|
if test -d "${xml2_prefix}/include/libxml2"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
|
|
|
|
fi
|