From 31f1fabd032c7546417c2b5a4e5b874831b32aaa Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sat, 7 Aug 2010 21:04:37 -0700 Subject: Define "snow_leopard_64?" snow_leopard_64? (defined in Hardware) is a short-cut for: MACOS_VERSION >= 10.6 and Hardware.is_64_bit? Signed-off-by: Adam Vandenberg --- Library/Formula/asterisk.rb | 2 +- Library/Formula/chicken.rb | 2 +- Library/Formula/erlang.rb | 20 +++++++++---------- Library/Formula/ffmpeg.rb | 10 +++------- Library/Formula/ical-buddy.rb | 6 +----- Library/Formula/icu4c.rb | 2 +- Library/Formula/mad.rb | 7 +------ Library/Formula/mpg123.rb | 6 ++---- Library/Formula/mplayer.rb | 2 +- Library/Formula/mz-scheme.rb | 9 ++++----- Library/Formula/nspr.rb | 6 +++--- Library/Formula/postgresql.rb | 6 ++---- Library/Formula/qt.rb | 46 +++++++++++++++++++++---------------------- Library/Formula/rrdtool.rb | 6 +----- Library/Formula/ruby-odbc.rb | 2 +- Library/Formula/sbcl.rb | 2 +- Library/Formula/tbb.rb | 7 +------ Library/Formula/virtuoso.rb | 2 +- Library/Formula/wine.rb | 2 +- Library/Formula/x264.rb | 2 +- Library/Homebrew/hardware.rb | 4 ++++ 21 files changed, 63 insertions(+), 88 deletions(-) (limited to 'Library') diff --git a/Library/Formula/asterisk.rb b/Library/Formula/asterisk.rb index 808705933..99b5488d5 100644 --- a/Library/Formula/asterisk.rb +++ b/Library/Formula/asterisk.rb @@ -12,7 +12,7 @@ class Asterisk = 10.6 + configure_flags << "--host=x86_64-darwin" if snow_leopard_64? system "./configure", *configure_flags system "make" system "make install" diff --git a/Library/Formula/chicken.rb b/Library/Formula/chicken.rb index 388517123..c6d41882b 100644 --- a/Library/Formula/chicken.rb +++ b/Library/Formula/chicken.rb @@ -8,7 +8,7 @@ class Chicken = 10.6 + settings << " ARCH=x86-64" if snow_leopard_64? system "make #{settings}" system "make install #{settings}" end diff --git a/Library/Formula/erlang.rb b/Library/Formula/erlang.rb index 950a893cb..20656f68e 100644 --- a/Library/Formula/erlang.rb +++ b/Library/Formula/erlang.rb @@ -36,25 +36,23 @@ class Erlang = 10.6 - config_flags << "--enable-darwin-64bit" - end + args << "--enable-darwin-64bit" if snow_leopard_64? - system "./configure", *config_flags + system "./configure", *args system "touch lib/wx/SKIP" if MACOS_VERSION >= 10.6 system "make" system "make install" diff --git a/Library/Formula/ffmpeg.rb b/Library/Formula/ffmpeg.rb index bc038c7ce..1ac3511db 100644 --- a/Library/Formula/ffmpeg.rb +++ b/Library/Formula/ffmpeg.rb @@ -5,10 +5,6 @@ class Ffmpeg { :trunk => 22916, 'libswscale' => 31045 } - # We probably need new revisions specified here: head 'svn://svn.ffmpeg.org/ffmpeg/trunk' depends_on 'x264' => :optional @@ -26,7 +22,7 @@ class Ffmpeg = 10.6 and Hardware.is_64_bit? + if snow_leopard_64? + inreplace 'config.mak' do |s| shflags = s.get_make_var 'SHFLAGS' s.change_make_var! 'SHFLAGS', shflags.gsub!(' -Wl,-read_only_relocs,suppress', '') end diff --git a/Library/Formula/ical-buddy.rb b/Library/Formula/ical-buddy.rb index 93cdddd99..56f0d5f61 100644 --- a/Library/Formula/ical-buddy.rb +++ b/Library/Formula/ical-buddy.rb @@ -5,11 +5,7 @@ class IcalBuddy :git def install - if MACOS_VERSION >= 10.6 and Hardware.is_64_bit? - arch = "x86_64" - else - arch = "i386" - end + arch = snow_leopard_64? ? "x86_64" : "i386" inreplace "Makefile", "-arch i386 -arch x86_64 -arch ppc", "-arch #{arch}" system "make icalBuddy icalBuddy.1 icalBuddyLocalization.1 icalBuddyConfig.1" diff --git a/Library/Formula/icu4c.rb b/Library/Formula/icu4c.rb index 7b9b6b408..2ee1e40e1 100644 --- a/Library/Formula/icu4c.rb +++ b/Library/Formula/icu4c.rb @@ -15,7 +15,7 @@ class Icu4c = 10.6 and Hardware.is_64_bit? - fpm = '64bit' - else - fpm = 'intel' - end - + fpm = snow_leopard_64? ? '64bit': 'intel' system "./configure", "--disable-debugging", "--enable-fpm=#{fpm}", "--prefix=#{prefix}" # See: http://github.com/mxcl/homebrew/issues/issue/1263 diff --git a/Library/Formula/mpg123.rb b/Library/Formula/mpg123.rb index 7855332db..8f49e8f01 100644 --- a/Library/Formula/mpg123.rb +++ b/Library/Formula/mpg123.rb @@ -17,17 +17,15 @@ class Mpg123 = 10.6 and Hardware.is_64_bit? + if snow_leopard_64? args << "--with-cpu=x86-64" else - # there are no Intel Mac computers without SSE args << "--with-cpu=sse_alone" end system "./configure", *args - # ./configure incorrectly detects 10.5 as 10.4. Cut that crap out. + # ./configure incorrectly detects 10.5 as 10.4; fix it. ['.', 'src', 'src/output', 'src/libmpg123'].each do |path| inreplace "#{path}/Makefile" do |s| s.gsub! "-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk", "" diff --git a/Library/Formula/mplayer.rb b/Library/Formula/mplayer.rb index 0bfc43bed..af8c850e9 100644 --- a/Library/Formula/mplayer.rb +++ b/Library/Formula/mplayer.rb @@ -21,7 +21,7 @@ class Mplayer = 10.6 + args << "--target=x86_64-Darwin" if snow_leopard_64? system './configure', *args system "make" diff --git a/Library/Formula/mz-scheme.rb b/Library/Formula/mz-scheme.rb index 7aad7d27f..b31b94838 100644 --- a/Library/Formula/mz-scheme.rb +++ b/Library/Formula/mz-scheme.rb @@ -9,11 +9,10 @@ class MzScheme = 10.6 + args = ["--disable-debug", "--disable-dependency-tracking", + "--disable-pthread", "--disable-mred", "--enable-xonx", + "--prefix=#{prefix}"] + args << "--enable-mac64" if snow_leopard_64? system "./configure", *args system "make" diff --git a/Library/Formula/nspr.rb b/Library/Formula/nspr.rb index 33a1c8605..f7a827076 100644 --- a/Library/Formula/nspr.rb +++ b/Library/Formula/nspr.rb @@ -13,9 +13,9 @@ class Nspr = 10.6 - system "./configure", *conf + args = ["--prefix=#{prefix}", "--disable-debug", "--enable-strip", "--enable-optimize"] + args << "--enable-64bit" if snow_leopard_64? + system "./configure", *args # Remove the broken (for anyone but Firefox) install_name inreplace "config/autoconf.mk", "-install_name @executable_path/$@ ", "" diff --git a/Library/Formula/postgresql.rb b/Library/Formula/postgresql.rb index 93cf895ef..bb526f39f 100644 --- a/Library/Formula/postgresql.rb +++ b/Library/Formula/postgresql.rb @@ -1,8 +1,6 @@ require 'formula' require 'hardware' -def bits_64?; MACOS_VERSION >= 10.6 && Hardware.is_64_bit?; end - class Postgresql = 10.6 and Hardware.is_64_bit? - conf_args << '-arch' << 'x86_64' + if snow_leopard_64? + args << '-arch' << 'x86_64' else - conf_args << '-arch' << 'x86' + args << '-arch' << 'x86' end - system "./configure", *conf_args + system "./configure", *args system "make install" # stop crazy disk usage diff --git a/Library/Formula/rrdtool.rb b/Library/Formula/rrdtool.rb index cb1eab615..4be02d981 100644 --- a/Library/Formula/rrdtool.rb +++ b/Library/Formula/rrdtool.rb @@ -39,11 +39,7 @@ class Rrdtool = 10.6 - ENV["ARCHFLAGS"] = "-arch x86_64" - else - ENV["ARCHFLAGS"] = "-arch i386" - end + ENV["ARCHFLAGS"] = snow_leopard_64? ? "-arch x86_64" : "-arch i386" system "make install" prefix.install "bindings/ruby/test.rb" diff --git a/Library/Formula/ruby-odbc.rb b/Library/Formula/ruby-odbc.rb index d0ddcba3d..e20217c18 100644 --- a/Library/Formula/ruby-odbc.rb +++ b/Library/Formula/ruby-odbc.rb @@ -19,7 +19,7 @@ class RubyOdbc < Formula s.change_make_var! "prefix", prefix s.change_make_var! "sitearchdir", lib - if Hardware.is_64_bit? and MACOS_VERSION >= 10.6 + if snow_leopard_64? # ruby-odbc still chooses iODBC over unixODBC (even with --with-odbc-dir) # apparently because unixODBC is compiled for only x86_64 and ruby-odbc # and iODBC are both i386 and x86_64. The solution (which works for me on Snow Leopard) diff --git a/Library/Formula/sbcl.rb b/Library/Formula/sbcl.rb index 9f475a3dc..dce232adb 100644 --- a/Library/Formula/sbcl.rb +++ b/Library/Formula/sbcl.rb @@ -2,7 +2,7 @@ require 'formula' require 'hardware' class Sbcl = 10.6 and Hardware.is_64_bit? + if snow_leopard_64? url 'http://downloads.sourceforge.net/project/sbcl/sbcl/1.0.29/sbcl-1.0.29-x86_64-darwin-binary-r2.tar.bz2' md5 '47c99c60ec44e57070807c0890ba1c90' else diff --git a/Library/Formula/tbb.rb b/Library/Formula/tbb.rb index 795afa89b..ce2a67e80 100644 --- a/Library/Formula/tbb.rb +++ b/Library/Formula/tbb.rb @@ -10,12 +10,7 @@ class Tbb = 10.6 and Hardware.is_64_bit? - args << "arch=intel64" - else - args << "arch=ia32" - end + args << (snow_leopard_64? ? "arch=intel64" : "arch=ia32") system "make", *args lib.install Dir['build/BUILDPREFIX_release/*.dylib'] diff --git a/Library/Formula/virtuoso.rb b/Library/Formula/virtuoso.rb index 96526cf3c..2dbccb9c5 100644 --- a/Library/Formula/virtuoso.rb +++ b/Library/Formula/virtuoso.rb @@ -11,7 +11,7 @@ class Virtuoso = 10.6 and Hardware.is_64_bit? + ENV.m64 if snow_leopard_64? system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make install" end diff --git a/Library/Formula/wine.rb b/Library/Formula/wine.rb index 5ed70c061..b89ceac0a 100644 --- a/Library/Formula/wine.rb +++ b/Library/Formula/wine.rb @@ -28,7 +28,7 @@ EOS ENV.append "LDFLAGS", "#{build32} -framework CoreServices -lz -lGL -lGLU" args = ["--prefix=#{prefix}", "--x-include=/usr/X11/include/", "--x-lib=/usr/X11/lib/"] - args << "--without-freetype" if MACOS_VERSION >= 10.6 and Hardware.is_64_bit? + args << "--without-freetype" if snow_leopard_64? args << "--disable-win16" if MACOS_VERSION < 10.6 if Hardware.is_64_bit? and Formula.factory('mpg123').installed? diff --git a/Library/Formula/x264.rb b/Library/Formula/x264.rb index bc5951dc5..af16ce2ce 100644 --- a/Library/Formula/x264.rb +++ b/Library/Formula/x264.rb @@ -16,7 +16,7 @@ class X264 = 10.6 and Hardware.is_64_bit? + if snow_leopard_64? soflags = s.get_make_var 'SOFLAGS' s.change_make_var! 'SOFLAGS', soflags.gsub!(' -Wl,-read_only_relocs,suppress', '') end diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index 3d76a74db..4c7924372 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -69,3 +69,7 @@ protected $?.success? && result == 1 # sysctl call succeded and printed 1 end end + +def snow_leopard_64? + MACOS_VERSION >= 10.6 and Hardware.is_64_bit? +end -- cgit v1.2.3