From 3e6533c237372c1bf3c5f1153a53dd074f6e4b9e Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Thu, 9 Aug 2012 21:47:23 -0700 Subject: cairo: use options dsl --- Library/Formula/cairo.rb | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'Library/Formula') 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 -- cgit v1.2.3