From 576185d3450f2cf8b7ecf818e155b6c38e639954 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sat, 7 Aug 2010 21:04:37 -0700 Subject: [PATCH] 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 --- Formula/asterisk.rb | 2 +- Formula/chicken.rb | 2 +- Formula/erlang.rb | 20 +++++++++---------- Formula/ffmpeg.rb | 10 +++------- Formula/ical-buddy.rb | 6 +----- Formula/icu4c.rb | 2 +- Formula/mad.rb | 7 +------ Formula/mpg123.rb | 6 ++---- Formula/mplayer.rb | 2 +- Formula/mz-scheme.rb | 9 ++++----- Formula/nspr.rb | 6 +++--- Formula/postgresql.rb | 6 ++---- Formula/qt.rb | 46 +++++++++++++++++++++---------------------- Formula/rrdtool.rb | 6 +----- Formula/ruby-odbc.rb | 2 +- Formula/sbcl.rb | 2 +- Formula/tbb.rb | 7 +------ Formula/virtuoso.rb | 2 +- Formula/wine.rb | 2 +- Formula/x264.rb | 2 +- 20 files changed, 59 insertions(+), 88 deletions(-) diff --git a/Formula/asterisk.rb b/Formula/asterisk.rb index 8087059330..99b5488d56 100644 --- a/Formula/asterisk.rb +++ b/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/Formula/chicken.rb b/Formula/chicken.rb index 388517123c..c6d41882b5 100644 --- a/Formula/chicken.rb +++ b/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/Formula/erlang.rb b/Formula/erlang.rb index 950a893cb3..20656f68e4 100644 --- a/Formula/erlang.rb +++ b/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/Formula/ffmpeg.rb b/Formula/ffmpeg.rb index bc038c7ced..1ac3511db0 100644 --- a/Formula/ffmpeg.rb +++ b/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/Formula/ical-buddy.rb b/Formula/ical-buddy.rb index 93cdddd99c..56f0d5f61a 100644 --- a/Formula/ical-buddy.rb +++ b/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/Formula/icu4c.rb b/Formula/icu4c.rb index 7b9b6b408d..2ee1e40e1c 100644 --- a/Formula/icu4c.rb +++ b/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/Formula/mpg123.rb b/Formula/mpg123.rb index 7855332db4..8f49e8f017 100644 --- a/Formula/mpg123.rb +++ b/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/Formula/mplayer.rb b/Formula/mplayer.rb index 0bfc43bed9..af8c850e97 100644 --- a/Formula/mplayer.rb +++ b/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/Formula/mz-scheme.rb b/Formula/mz-scheme.rb index 7aad7d27f7..b31b948387 100644 --- a/Formula/mz-scheme.rb +++ b/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/Formula/nspr.rb b/Formula/nspr.rb index 33a1c8605f..f7a8270767 100644 --- a/Formula/nspr.rb +++ b/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/Formula/postgresql.rb b/Formula/postgresql.rb index 93cf895efd..bb526f39fe 100644 --- a/Formula/postgresql.rb +++ b/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/Formula/rrdtool.rb b/Formula/rrdtool.rb index cb1eab615d..4be02d981d 100644 --- a/Formula/rrdtool.rb +++ b/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/Formula/ruby-odbc.rb b/Formula/ruby-odbc.rb index d0ddcba3d3..e20217c186 100644 --- a/Formula/ruby-odbc.rb +++ b/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/Formula/sbcl.rb b/Formula/sbcl.rb index 9f475a3dcd..dce232adb0 100644 --- a/Formula/sbcl.rb +++ b/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/Formula/tbb.rb b/Formula/tbb.rb index 795afa89bb..ce2a67e808 100644 --- a/Formula/tbb.rb +++ b/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/Formula/virtuoso.rb b/Formula/virtuoso.rb index 96526cf3ca..2dbccb9c51 100644 --- a/Formula/virtuoso.rb +++ b/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/Formula/wine.rb b/Formula/wine.rb index 5ed70c061d..b89ceac0a7 100644 --- a/Formula/wine.rb +++ b/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/Formula/x264.rb b/Formula/x264.rb index bc5951dc55..af16ce2ce6 100644 --- a/Formula/x264.rb +++ b/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