aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike McQuaid2013-01-27 22:40:56 +0000
committerMike McQuaid2013-01-30 21:51:20 -0800
commit7af6c1e2bbfb7c04fc526c03542f09470edca883 (patch)
treef00e6059790f45a67b8704c8360c519e73771546 /Library/Formula
parent336c97637c5449018cde59f7d2a87a298692da08 (diff)
downloadhomebrew-7af6c1e2bbfb7c04fc526c03542f09470edca883.tar.bz2
imagemagick: cleanup with new auto-options.
Most options can autocreated now. This means have been are renamed (`brew options imagemagick`).
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/imagemagick.rb91
1 files changed, 31 insertions, 60 deletions
diff --git a/Library/Formula/imagemagick.rb b/Library/Formula/imagemagick.rb
index a7b9f1d9f..fdb7e939c 100644
--- a/Library/Formula/imagemagick.rb
+++ b/Library/Formula/imagemagick.rb
@@ -1,13 +1,5 @@
require 'formula'
-def ghostscript_srsly?
- build.include? 'with-ghostscript'
-end
-
-def ghostscript_fonts?
- File.directory? "#{HOMEBREW_PREFIX}/share/ghostscript/fonts"
-end
-
class Imagemagick < Formula
homepage 'http://www.imagemagick.org'
@@ -20,44 +12,33 @@ class Imagemagick < Formula
head 'https://www.imagemagick.org/subversion/ImageMagick/trunk',
:using => UnsafeSubversionDownloadStrategy
- 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'
- option 'with-x', 'Compile with X11 support.'
- option 'with-fontconfig', 'Compile with fontconfig support.'
- option 'without-freetype', 'Compile without freetype support.'
- depends_on 'pkg-config' => :build
-
- depends_on 'jpeg' => :recommended
- depends_on :libpng
depends_on :libtool
- depends_on :x11 if build.include? 'with-x'
- # Can't use => with symbol deps
- depends_on :fontconfig if build.include? 'with-fontconfig' or MacOS::X11.installed? # => :optional
- depends_on :freetype unless build.include? 'without-freetype' and not MacOS::X11.installed? # => :recommended
- depends_on 'ghostscript' => :optional if ghostscript_srsly?
+ depends_on 'pkg-config' => :build
- 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'
+ 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
bottle do
sha1 '543ce5bf72c3897f25b54523a5c3de355a84ff44' => :mountainlion
@@ -80,25 +61,24 @@ class Imagemagick < Formula
args << "--disable-openmp" unless build.include? 'enable-openmp'
args << "--disable-opencl" if build.include? 'disable-opencl'
- args << "--without-gslib" unless build.include? 'with-ghostscript'
- args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" \
- unless ghostscript_srsly? or ghostscript_fonts?
- args << "--without-magick-plus-plus" if build.include? 'without-magick-plus-plus'
+ 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'
args << "--enable-hdri=yes" if build.include? 'enable-hdri'
- if build.include? 'with-quantum-depth-32'
+ if build.with? 'quantum-depth-32'
quantum_depth = 32
- elsif build.include? 'with-quantum-depth-16'
+ elsif build.with? 'quantum-depth-16'
quantum_depth = 16
- elsif build.include? 'with-quantum-depth-8'
+ elsif build.with? 'quantum-depth-8'
quantum_depth = 8
end
args << "--with-quantum-depth=#{quantum_depth}" if quantum_depth
- args << "--with-rsvg" if build.include? 'use-rsvg'
- args << "--without-x" unless build.include? 'with-x'
- args << "--with-fontconfig=yes" if build.include? 'with-fontconfig' or MacOS::X11.installed?
- args << "--with-freetype=yes" unless build.include? 'without-freetype' and not MacOS::X11.installed?
+ args << "--with-rsvg" if build.with? 'rsvg'
+ args << "--without-x" unless build.with? 'x'
+ args << "--with-fontconfig=yes" if build.with? 'fontconfig' or MacOS::X11.installed?
+ args << "--with-freetype=yes" if build.with? 'freetype' or MacOS::X11.installed?
# versioned stuff in main tree is pointless for us
inreplace 'configure', '${PACKAGE_NAME}-${PACKAGE_VERSION}', '${PACKAGE_NAME}'
@@ -106,16 +86,7 @@ class Imagemagick < Formula
system "make install"
end
- def caveats
- unless ghostscript_fonts? or ghostscript_srsly?
- <<-EOS.undent
- Some tools will complain unless the ghostscript fonts are installed to:
- #{HOMEBREW_PREFIX}/share/ghostscript/fonts
- EOS
- end
- end
-
- def test
+ test do
system "#{bin}/identify", \
"/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/Key_Large.png"
end