aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2012-08-09 21:47:23 -0700
committerAdam Vandenberg2012-08-09 21:47:23 -0700
commit3e6533c237372c1bf3c5f1153a53dd074f6e4b9e (patch)
tree6feb98ff815b994e2d6dc14cc7048b5252a47abb /Library
parentb7ddc60645a2750e7c73ae9bee012e53f8b19d8a (diff)
downloadhomebrew-3e6533c237372c1bf3c5f1153a53dd074f6e4b9e.tar.bz2
cairo: use options dsl
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/cairo.rb22
1 files changed, 9 insertions, 13 deletions
diff --git a/Library/Formula/cairo.rb b/Library/Formula/cairo.rb
index c4e04e1d0..7fdff0726 100644
--- a/Library/Formula/cairo.rb
+++ b/Library/Formula/cairo.rb
@@ -9,25 +9,20 @@ class Cairo < Formula
"The Cairo provided by Leopard is too old for newer software to link against." \
if MacOS::X11.installed?
- # Can't currently pass :recommended to the :x11 dep.
- depends_on :libpng # => :recommended
+ option :universal
+ option 'without-x', 'Build without X11 support'
+
+ depends_on :libpng
depends_on 'pixman'
depends_on 'pkg-config' => :build
depends_on 'xz'=> :build
- depends_on :x11 unless ARGV.include? '--without-x'
-
- def options
- [
- ['--universal', 'Build a universal library'],
- ['--without-x', 'Build without X11 support'],
- ]
- end
+ depends_on :x11 unless build.include? 'without-x'
# Fixes a build error with clang & universal, where a function was implicit.
def patches; DATA; end
def install
- ENV.universal_binary if ARGV.build_universal?
+ ENV.universal_binary if build.universal?
pixman = Formula.factory('pixman')
ENV['pixman_CFLAGS'] = "-I#{pixman.include}/pixman-1"
@@ -35,9 +30,10 @@ class Cairo < Formula
args = %W[
--disable-dependency-tracking
- --prefix=#{prefix}]
+ --prefix=#{prefix}
+ ]
- args << '--with-x' unless ARGV.include? '--without-x'
+ args << '--with-x' unless build.include? 'without-x'
args << '--enable-xcb=no' if MacOS.leopard?
system "./configure", *args