Clean up MacOS version method usage
The MacOS.version? family of methods (other than "leopard?") are poorly defined and lead to confusing code. Replace them in formulae with more explicit comparisons. "MacOS.version" is a special version object that can be compared to numerics, symbols, and strings using the standard Ruby comparison methods. The old methods were moved to compat when the version comparison code was merged, and they must remain there "forever", but they should not be used in new code. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
544ba85f97
commit
53473b6bf5
67 changed files with 87 additions and 86 deletions
|
@ -11,7 +11,7 @@ class Abyss < Formula
|
|||
depends_on 'google-sparsehash' => :build
|
||||
|
||||
# Snow Leopard comes with mpi but Lion does not
|
||||
depends_on 'open-mpi' if MacOS.lion?
|
||||
depends_on 'open-mpi' if MacOS.version >= :lion
|
||||
|
||||
# strip breaks the ability to read compressed files.
|
||||
skip_clean 'bin'
|
||||
|
|
|
@ -10,7 +10,7 @@ class Alpine < Formula
|
|||
# http://trac.macports.org/ticket/20971
|
||||
def patches
|
||||
"https://trac.macports.org/export/89747/trunk/dports/mail/alpine/files/alpine-osx-10.6.patch"
|
||||
end if MacOS.snow_leopard?
|
||||
end if MacOS.version >= :snow_leopard
|
||||
|
||||
def install
|
||||
ENV.j1
|
||||
|
|
|
@ -8,7 +8,7 @@ class Aria2 < Formula
|
|||
depends_on 'pkg-config' => :build
|
||||
|
||||
# Leopard's libxml2 is too old.
|
||||
depends_on 'libxml2' if MacOS.leopard?
|
||||
depends_on 'libxml2' if MacOS.version == :leopard
|
||||
|
||||
def install
|
||||
system "./configure", "--disable-dependency-tracking",
|
||||
|
|
|
@ -63,7 +63,7 @@ class Avidemux < Formula
|
|||
|
||||
# For 32-bit compilation under gcc 4.2, see:
|
||||
# http://trac.macports.org/ticket/20938#comment:22
|
||||
if MacOS.leopard? or Hardware.is_32_bit?
|
||||
if MacOS.version == :leopard or Hardware.is_32_bit?
|
||||
inreplace 'cmake/admFFmpegBuild.cmake',
|
||||
'${CMAKE_INSTALL_PREFIX})',
|
||||
'${CMAKE_INSTALL_PREFIX} --extra-cflags=-mdynamic-no-pic)'
|
||||
|
|
|
@ -6,7 +6,7 @@ class Bind < Formula
|
|||
version '9.9.1-p2'
|
||||
sha1 '449b12c32682b5bef64c7b53cd0fc0c6b731c8a7'
|
||||
|
||||
depends_on "openssl" if MacOS.leopard?
|
||||
depends_on "openssl" if MacOS.version == :leopard
|
||||
|
||||
def install
|
||||
ENV.libxml2
|
||||
|
@ -23,7 +23,7 @@ class Bind < Formula
|
|||
|
||||
# For Xcode-only systems we help a bit to find openssl.
|
||||
# If CLT.installed?, it evaluates to "/usr", which works.
|
||||
args << "--with-openssl=#{MacOS.sdk_path.to_s}/usr" unless MacOS.leopard?
|
||||
args << "--with-openssl=#{MacOS.sdk_path.to_s}/usr" unless MacOS.version == :leopard
|
||||
|
||||
system "./configure", *args
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class Cairo < Formula
|
|||
]
|
||||
|
||||
args << '--with-x' unless build.include? 'without-x'
|
||||
args << '--enable-xcb=no' if MacOS.leopard?
|
||||
args << '--enable-xcb=no' if MacOS.version == :leopard
|
||||
|
||||
system "./configure", *args
|
||||
system "make install"
|
||||
|
|
|
@ -42,7 +42,7 @@ class Clisp < Formula
|
|||
# The ulimit must be set, otherwise `make` will fail and tell you to do so
|
||||
system "ulimit -s 16384 && make"
|
||||
|
||||
if MacOS.lion?
|
||||
if MacOS.version >= :lion
|
||||
opoo "`make check` fails on Lion, so we are skipping it."
|
||||
puts "But it probably means there will be other issues too."
|
||||
puts "Please take them upstream to the clisp project itself."
|
||||
|
|
|
@ -27,7 +27,7 @@ class Collectd < Formula
|
|||
--localstatedir=#{var}
|
||||
--with-python=/usr/bin]
|
||||
|
||||
args << "--disable-embedded-perl" if MacOS.leopard?
|
||||
args << "--disable-embedded-perl" if MacOS.version == :leopard
|
||||
|
||||
system "./configure", *args
|
||||
system "make install"
|
||||
|
|
|
@ -11,7 +11,7 @@ class Couchdb < Formula
|
|||
depends_on 'spidermonkey'
|
||||
depends_on 'icu4c'
|
||||
depends_on 'erlang'
|
||||
depends_on 'curl' if MacOS.leopard?
|
||||
depends_on 'curl' if MacOS.version == :leopard
|
||||
|
||||
def install
|
||||
system "./bootstrap" if File.exists? "bootstrap"
|
||||
|
|
|
@ -9,7 +9,7 @@ class Disco < Formula
|
|||
head 'https://github.com/tuulos/disco.git'
|
||||
|
||||
depends_on 'erlang'
|
||||
depends_on 'simplejson' => :python if MacOS.leopard?
|
||||
depends_on 'simplejson' => :python if MacOS.version == :leopard
|
||||
depends_on 'libcmph'
|
||||
|
||||
def install
|
||||
|
|
|
@ -18,7 +18,7 @@ class E2fsprogs < Formula
|
|||
]}
|
||||
|
||||
# MacPorts patch to allow compilation on Leopard.
|
||||
if MacOS.leopard?
|
||||
if MacOS.version == :leopard
|
||||
p[:p0] << "https://trac.macports.org/export/92117/trunk/dports/sysutils/e2fsprogs/files/patch-lib-ext2fs-inline.c.diff"
|
||||
end
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ class Ejabberd < Formula
|
|||
url "http://www.process-one.net/downloads/ejabberd/2.1.11/ejabberd-2.1.11.tgz"
|
||||
sha1 'ae2c521d5e93fbd5bc826052c5524b5222dcfae6'
|
||||
|
||||
depends_on "openssl" if MacOS.leopard?
|
||||
depends_on "openssl" if MacOS.version == :leopard
|
||||
depends_on "erlang"
|
||||
|
||||
option "32-bit"
|
||||
|
@ -28,7 +28,7 @@ class Ejabberd < Formula
|
|||
"--sysconfdir=#{etc}",
|
||||
"--localstatedir=#{var}"]
|
||||
|
||||
if MacOS.leopard?
|
||||
if MacOS.version == :leopard
|
||||
openssl = Formula.factory('openssl')
|
||||
args << "--with-openssl=#{openssl.prefix}"
|
||||
end
|
||||
|
|
|
@ -76,7 +76,7 @@ class Erlang < Formula
|
|||
"--enable-shared-zlib",
|
||||
"--enable-smp-support"]
|
||||
|
||||
args << "--with-dynamic-trace=dtrace" unless MacOS.leopard?
|
||||
args << "--with-dynamic-trace=dtrace" unless MacOS.version == :leopard
|
||||
|
||||
unless build.include? 'disable-hipe'
|
||||
# HIPE doesn't strike me as that reliable on OS X
|
||||
|
|
|
@ -17,7 +17,7 @@ class Ffmbc < Formula
|
|||
option "with-libvpx", "Enable VP8 video format"
|
||||
|
||||
# manpages won't be built without texi2html
|
||||
depends_on 'texi2html' => :build if MacOS.mountain_lion?
|
||||
depends_on 'texi2html' => :build if MacOS.version >= :mountain_lion
|
||||
depends_on 'yasm' => :build
|
||||
|
||||
depends_on 'x264' unless build.include? 'without-x264'
|
||||
|
|
|
@ -26,7 +26,7 @@ class Ffmpeg < Formula
|
|||
option 'with-tools', 'Enable additional FFmpeg tools'
|
||||
|
||||
# manpages won't be built without texi2html
|
||||
depends_on 'texi2html' => :build if MacOS.mountain_lion?
|
||||
depends_on 'texi2html' => :build if MacOS.version >= :mountain_lion
|
||||
depends_on 'yasm' => :build
|
||||
|
||||
depends_on 'x264' unless build.include? 'without-x264'
|
||||
|
@ -79,7 +79,7 @@ class Ffmpeg < Formula
|
|||
|
||||
# For 32-bit compilation under gcc 4.2, see:
|
||||
# http://trac.macports.org/ticket/20938#comment:22
|
||||
ENV.append_to_cflags "-mdynamic-no-pic" if MacOS.leopard? or Hardware.is_32_bit?
|
||||
ENV.append_to_cflags "-mdynamic-no-pic" if MacOS.version == :leopard or Hardware.is_32_bit?
|
||||
|
||||
system "./configure", *args
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class Fontforge < Formula
|
|||
# MACOSX_DEPLOYMENT_TARGET fixes ensuing Python 10.7 vs 10.8 clash.
|
||||
# Discussed: https://github.com/mxcl/homebrew/pull/14097
|
||||
# Reported: Not yet.
|
||||
if MacOS.mountain_lion?
|
||||
if MacOS.version >= :mountain_lion
|
||||
ENV.macosxsdk("10.7")
|
||||
ENV.append "CFLAGS", "-isysroot #{MacOS.sdk_path(10.7)}"
|
||||
ENV["MACOSX_DEPLOYMENT_TARGET"] = "10.8"
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'formula'
|
|||
|
||||
class NeedsSnowLeopard < Requirement
|
||||
def satisfied?
|
||||
MacOS.snow_leopard?
|
||||
MacOS.version >= :snow_leopard
|
||||
end
|
||||
|
||||
def message; <<-EOS.undent
|
||||
|
|
|
@ -33,7 +33,7 @@ class Git < Formula
|
|||
ENV['PYTHON_PATH'] = which 'python' # python can be brewed or unbrewed
|
||||
|
||||
# Clean XCode 4.x installs don't include Perl MakeMaker
|
||||
ENV['NO_PERL_MAKEMAKER'] = '1' if MacOS.lion?
|
||||
ENV['NO_PERL_MAKEMAKER'] = '1' if MacOS.version >= :lion
|
||||
|
||||
ENV['BLK_SHA1'] = '1' if build.include? 'with-blk-sha1'
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class Gnunet < Formula
|
|||
|
||||
depends_on 'libgcrypt'
|
||||
depends_on 'libextractor'
|
||||
depends_on 'curl' unless MacOS.lion? # needs >= v7.20.1
|
||||
depends_on 'curl' if MacOS.version < :lion # needs >= v7.20.1
|
||||
|
||||
def install
|
||||
system "./configure", "--disable-debug",
|
||||
|
|
|
@ -6,7 +6,7 @@ class NeedsSnowLeopard < Requirement
|
|||
end
|
||||
|
||||
def satisfied?
|
||||
MacOS.snow_leopard?
|
||||
MacOS.version >= :snow_leopard
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class Graphicsmagick < Formula
|
|||
"--prefix=#{prefix}",
|
||||
"--enable-shared", "--disable-static"]
|
||||
args << "--without-magick-plus-plus" if build.include? 'without-magick-plus-plus'
|
||||
args << "--disable-openmp" if MacOS.leopard? or ENV.compiler == :clang # libgomp unavailable
|
||||
args << "--disable-openmp" if MacOS.version == :leopard or ENV.compiler == :clang # libgomp unavailable
|
||||
args << "--with-gslib" if ghostscript_srsly?
|
||||
args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" \
|
||||
unless ghostscript_fonts?
|
||||
|
|
|
@ -14,7 +14,7 @@ def headless?
|
|||
#
|
||||
# This restriction can be lifted once WxMac hits a stable release that is
|
||||
# 64-bit capable.
|
||||
ARGV.include? '--without-gui' or MacOS.lion?
|
||||
ARGV.include? '--without-gui' or MacOS.version >= :lion
|
||||
end
|
||||
|
||||
class Grass < Formula
|
||||
|
@ -31,7 +31,7 @@ class Grass < Formula
|
|||
depends_on "libtiff"
|
||||
depends_on "unixodbc"
|
||||
depends_on "fftw"
|
||||
depends_on "cairo" if MacOS.leopard?
|
||||
depends_on "cairo" if MacOS.version == :leopard
|
||||
depends_on :x11
|
||||
|
||||
# Patches ensure 32 bit system python is used for wxWidgets and that files
|
||||
|
@ -101,7 +101,7 @@ class Grass < Formula
|
|||
end
|
||||
|
||||
# Deal with Cairo support
|
||||
if MacOS.leopard?
|
||||
if MacOS.version == :leopard
|
||||
cairo = Formula.factory('cairo')
|
||||
args << "--with-cairo-includes=#{cairo.include}/cairo"
|
||||
args << "--with-cairo-libs=#{cairo.lib}"
|
||||
|
|
|
@ -6,7 +6,7 @@ class ImapUw < Formula
|
|||
sha1 '7a82ebd5aae57a5dede96ac4923b63f850ff4fa7'
|
||||
|
||||
def patches
|
||||
if MacOS.snow_leopard?
|
||||
if MacOS.version >= :snow_leopard
|
||||
{ :p0 =>
|
||||
'https://trac.macports.org/export/63088/trunk/dports/mail/imap-uw/files/patch-snowleopard.diff'
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ class Iodine < Formula
|
|||
sha1 '4fa9a248b8a84df8a727a5d749e669e58136edca'
|
||||
|
||||
def install
|
||||
unless MacOS.leopard?
|
||||
unless MacOS.version == :leopard
|
||||
inreplace ["src/common.c", "src/dns.c", "src/iodine.c", "src/iodined.c"],
|
||||
"arpa/nameser8_compat", "arpa/nameser_compat"
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'formula'
|
|||
|
||||
class NeedsSnowLeopard < Requirement
|
||||
def satisfied?
|
||||
MacOS.snow_leopard?
|
||||
MacOS.version >= :snow_leopard
|
||||
end
|
||||
|
||||
def message
|
||||
|
|
|
@ -11,7 +11,7 @@ class Lftp < Formula
|
|||
|
||||
def install
|
||||
# Bus error
|
||||
ENV.no_optimization if MacOS.leopard?
|
||||
ENV.no_optimization if MacOS.version == :leopard
|
||||
|
||||
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
||||
system "make install"
|
||||
|
|
|
@ -11,7 +11,7 @@ class Libagg < Formula
|
|||
depends_on 'pkg-config' => :build
|
||||
depends_on 'sdl'
|
||||
depends_on :freetype => :optional if build.include? "with-freetype"
|
||||
depends_on :libtool unless MacOS.mountain_lion?
|
||||
depends_on :libtool unless MacOS.version >= :mountain_lion
|
||||
|
||||
fails_with :clang do
|
||||
build 421
|
||||
|
|
|
@ -8,7 +8,7 @@ class Libmemcached < Formula
|
|||
depends_on 'memcached'
|
||||
|
||||
def install
|
||||
ENV.append_to_cflags "-undefined dynamic_lookup" if MacOS.leopard?
|
||||
ENV.append_to_cflags "-undefined dynamic_lookup" if MacOS.version == :leopard
|
||||
|
||||
system "./configure", "--prefix=#{prefix}"
|
||||
system "make install"
|
||||
|
|
|
@ -10,7 +10,7 @@ class Libmms < Formula
|
|||
|
||||
def patches
|
||||
# see https://trac.macports.org/ticket/27988
|
||||
if MacOS.leopard?
|
||||
if MacOS.version == :leopard
|
||||
{ :p0 => "https://trac.macports.org/export/87883/trunk/dports/multimedia/libmms/files/src_mms-common.h.patch" }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ class Librasterlite < Formula
|
|||
url 'http://www.gaia-gis.it/gaia-sins/librasterlite-sources/librasterlite-1.1c.tar.gz'
|
||||
sha1 'c54f38ef2974bc92410e2c2196088af14bd9c21a'
|
||||
|
||||
depends_on "pkg-config" => :build unless MacOS.mountain_lion?
|
||||
depends_on "pkg-config" => :build unless MacOS.version >= :mountain_lion
|
||||
depends_on :libpng
|
||||
depends_on "libgeotiff"
|
||||
depends_on "libspatialite"
|
||||
|
|
|
@ -6,7 +6,7 @@ class Librets < Formula
|
|||
sha1 '2de4d9e9cb26533eb0a9a090b3354a70ed3c41ec'
|
||||
|
||||
depends_on 'boost'
|
||||
depends_on 'swig' if MacOS.lion?
|
||||
depends_on 'swig' if MacOS.version >= :lion
|
||||
|
||||
def install
|
||||
system "./configure", "--disable-debug",
|
||||
|
|
|
@ -16,7 +16,7 @@ class Libvirt < Formula
|
|||
depends_on "gnutls"
|
||||
depends_on "yajl"
|
||||
|
||||
if MacOS.leopard?
|
||||
if MacOS.version == :leopard
|
||||
# Definitely needed on Leopard, but not on Snow Leopard.
|
||||
depends_on "readline"
|
||||
depends_on "libxml2"
|
||||
|
|
|
@ -7,7 +7,7 @@ class Libxmlxx < Formula
|
|||
|
||||
depends_on 'glibmm'
|
||||
# LibXML++ can't compile agains the version of LibXML shipped with Leopard
|
||||
depends_on 'libxml2' if MacOS.leopard?
|
||||
depends_on 'libxml2' if MacOS.version == :leopard
|
||||
|
||||
def install
|
||||
system "./configure", "--disable-dependency-tracking",
|
||||
|
|
|
@ -25,7 +25,7 @@ class Macvim < Formula
|
|||
|
||||
# If building for 10.8, make sure that CC is set to "clang".
|
||||
# Reference: https://github.com/b4winckler/macvim/wiki/building
|
||||
ENV['CC'] = "clang" if MacOS.mountain_lion?
|
||||
ENV['CC'] = "clang" if MacOS.version >= :mountain_lion
|
||||
|
||||
args = %W[
|
||||
--with-features=huge
|
||||
|
|
|
@ -18,7 +18,7 @@ class Mapserver < Formula
|
|||
depends_on 'gdal'
|
||||
|
||||
depends_on 'geos' if build.include? 'with-geos'
|
||||
depends_on 'postgresql' if build.include? 'with-postgresql' and not MacOS.lion?
|
||||
depends_on 'postgresql' if build.include? 'with-postgresql' and not MacOS.version >= :lion
|
||||
depends_on 'fcgi' if build.include? 'with-fastcgi'
|
||||
|
||||
def patches
|
||||
|
@ -41,7 +41,7 @@ class Mapserver < Formula
|
|||
args << "--with-php=/usr/include/php" if build.include? 'with-php'
|
||||
|
||||
if build.include? 'with-postgresql'
|
||||
if MacOS.lion? # Lion ships with PostgreSQL libs
|
||||
if MacOS.version >= :lion # Lion ships with PostgreSQL libs
|
||||
args << "--with-postgis"
|
||||
else
|
||||
args << "--with-postgis=#{HOMEBREW_PREFIX}/bin/pg_config"
|
||||
|
|
|
@ -6,7 +6,7 @@ class Md < Formula
|
|||
sha1 '0128de65a4da2ef9655f3b1e6a94d2f8ae292414'
|
||||
|
||||
# OS X up to and including Lion 10.7 includes 'md'
|
||||
keg_only :provided_by_osx unless MacOS.mountain_lion?
|
||||
keg_only :provided_by_osx unless MacOS.version >= :mountain_lion
|
||||
|
||||
def install
|
||||
cd 'md' do
|
||||
|
|
|
@ -36,7 +36,7 @@ class Mpd < Formula
|
|||
"--enable-fluidsynth",
|
||||
"--enable-zip",
|
||||
"--enable-lame-encoder"]
|
||||
args << "--disable-curl" if MacOS.leopard?
|
||||
args << "--disable-curl" if MacOS.version == :leopard
|
||||
args << "--enable-lastfm" if build.include?("lastfm")
|
||||
|
||||
system "./configure", *args
|
||||
|
|
|
@ -13,7 +13,7 @@ class Mysql < Formula
|
|||
end
|
||||
|
||||
depends_on 'cmake' => :build
|
||||
depends_on 'pidof' unless MacOS.mountain_lion?
|
||||
depends_on 'pidof' unless MacOS.version >= :mountain_lion
|
||||
|
||||
option :universal
|
||||
option 'with-tests', 'Build with unit tests'
|
||||
|
@ -99,7 +99,7 @@ class Mysql < Formula
|
|||
inreplace "#{prefix}/support-files/mysql.server" do |s|
|
||||
s.gsub!(/^(PATH=".*)(")/, "\\1:#{HOMEBREW_PREFIX}/bin\\2")
|
||||
# pidof can be replaced with pgrep from proctools on Mountain Lion
|
||||
s.gsub!(/pidof/, 'pgrep') if MacOS.mountain_lion?
|
||||
s.gsub!(/pidof/, 'pgrep') if MacOS.version >= :mountain_lion
|
||||
end
|
||||
ln_s "#{prefix}/support-files/mysql.server", bin
|
||||
end
|
||||
|
|
|
@ -8,7 +8,7 @@ class Nmap < Formula
|
|||
head 'https://guest:@svn.nmap.org/nmap/', :using => :svn
|
||||
|
||||
# Leopard's version of OpenSSL isn't new enough
|
||||
depends_on "openssl" if MacOS.leopard?
|
||||
depends_on "openssl" if MacOS.version == :leopard
|
||||
|
||||
fails_with :llvm do
|
||||
build 2334
|
||||
|
@ -23,7 +23,7 @@ class Nmap < Formula
|
|||
--without-zenmap
|
||||
--disable-universal]
|
||||
|
||||
if MacOS.leopard?
|
||||
if MacOS.version == :leopard
|
||||
openssl = Formula.factory('openssl')
|
||||
args << "--with-openssl=#{openssl.prefix}"
|
||||
end
|
||||
|
|
|
@ -50,7 +50,7 @@ class Node < Formula
|
|||
head 'https://github.com/joyent/node.git'
|
||||
|
||||
# Leopard OpenSSL is not new enough, so use our keg-only one
|
||||
depends_on 'openssl' if MacOS.leopard?
|
||||
depends_on 'openssl' if MacOS.version == :leopard
|
||||
depends_on NpmNotInstalled.new unless build.include? 'without-npm'
|
||||
depends_on PythonVersion.new
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ class Nspr < Formula
|
|||
cd "mozilla/nsprpub" do
|
||||
# Fixes a bug with linking against CoreFoundation, needed to work with SpiderMonkey
|
||||
# See: http://openradar.appspot.com/7209349
|
||||
target_frameworks = (Hardware.is_32_bit? or MacOS.leopard?) ? "-framework Carbon" : ""
|
||||
target_frameworks = (Hardware.is_32_bit? or MacOS.version == :leopard) ? "-framework Carbon" : ""
|
||||
inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", target_frameworks
|
||||
|
||||
args = ["--prefix=#{prefix}", "--disable-debug", "--enable-strip", "--enable-optimize"]
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'formula'
|
|||
|
||||
class NeedsLion < Requirement
|
||||
def satisfied?
|
||||
MacOS.lion?
|
||||
MacOS.version >= :lion
|
||||
end
|
||||
def message
|
||||
"Nu requires Mac OS X 10.7 or newer"
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
require 'formula'
|
||||
|
||||
def snow_leopard_64?
|
||||
# Leading underscore because this method is defined differently
|
||||
# in compat, and anything that loads this file would end up with
|
||||
# this definition instead!
|
||||
def _snow_leopard_64?
|
||||
# 64 bit builds on 10.6 require some special handling.
|
||||
MacOS.version == :snow_leopard and MacOS.prefer_64_bit?
|
||||
end
|
||||
|
@ -28,10 +31,10 @@ class Octave < Formula
|
|||
# http://www.macresearch.org/lapackblas-fortran-106
|
||||
#
|
||||
# We can work around the issues using dotwrp.
|
||||
depends_on 'dotwrp' if snow_leopard_64?
|
||||
depends_on 'dotwrp' if _snow_leopard_64?
|
||||
# octave refuses to work with BSD readline, so it's either this or --disable-readline
|
||||
depends_on 'readline'
|
||||
depends_on 'curl' if MacOS.leopard? # Leopard's libcurl is too old
|
||||
depends_on 'curl' if MacOS.version == :leopard # Leopard's libcurl is too old
|
||||
|
||||
# additional features
|
||||
depends_on 'suite-sparse'
|
||||
|
@ -63,11 +66,11 @@ class Octave < Formula
|
|||
"--prefix=#{prefix}",
|
||||
# Cant use `-framework Accelerate` because `mkoctfile`, the tool used to
|
||||
# compile extension packages, can't parse `-framework` flags.
|
||||
"--with-blas=#{'-ldotwrp ' if snow_leopard_64?}-Wl,-framework -Wl,Accelerate",
|
||||
"--with-blas=#{'-ldotwrp ' if _snow_leopard_64?}-Wl,-framework -Wl,Accelerate",
|
||||
# SuiteSparse-4.x.x fix, see http://savannah.gnu.org/bugs/?37031
|
||||
"--with-umfpack=-lumfpack -lsuitesparseconfig",
|
||||
]
|
||||
args << "--without-framework-carbon" if MacOS.lion?
|
||||
args << "--without-framework-carbon" if MacOS.version >= :lion
|
||||
# avoid spurious 'invalid assignment to cs-list' erorrs on 32 bit installs:
|
||||
args << 'CXXFLAGS=-O0' unless MacOS.prefer_64_bit?
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class OpenSceneGraph < Formula
|
|||
|
||||
args = std_cmake_args
|
||||
args << '-DBUILD_DOCUMENTATION=' + ((build.include? 'docs') ? 'ON' : 'OFF')
|
||||
if snow_leopard_64?
|
||||
if MacOS.prefer_64_bit?
|
||||
args << "-DCMAKE_OSX_ARCHITECTURES=x86_64"
|
||||
args << "-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio"
|
||||
args << "-DOSG_WINDOWING_SYSTEM=Cocoa"
|
||||
|
|
|
@ -36,7 +36,7 @@ class Opencolorio < Formula
|
|||
# /usr/include
|
||||
# So we just set the sysroot to /
|
||||
|
||||
args << "-DCMAKE_OSX_SYSROOT=/" if ENV.compiler == :llvm and MacOS.lion?
|
||||
args << "-DCMAKE_OSX_SYSROOT=/" if ENV.compiler == :llvm and MacOS.version >= :lion
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'formula'
|
|||
|
||||
class SnowLeopardOrNewer < Requirement
|
||||
def satisfied?
|
||||
MacOS.snow_leopard?
|
||||
MacOS.version >= :snow_leopard
|
||||
end
|
||||
|
||||
def message
|
||||
|
|
|
@ -18,7 +18,7 @@ class Portaudio < Formula
|
|||
{ :p0 =>
|
||||
"https://trac.macports.org/export/94150/trunk/dports/audio/portaudio/files/patch-include__pa_mac_core.h.diff"
|
||||
}
|
||||
end if MacOS.lion?
|
||||
end if MacOS.version >= :lion
|
||||
|
||||
def install
|
||||
ENV.universal_binary if build.universal?
|
||||
|
|
|
@ -6,7 +6,7 @@ class Postgresql < Formula
|
|||
sha1 '8411f39e7cff8d691d908de7823b72426433faa2'
|
||||
|
||||
depends_on 'readline'
|
||||
depends_on 'libxml2' if MacOS.leopard? # Leopard libxml is too old
|
||||
depends_on 'libxml2' if MacOS.version == :leopard # Leopard libxml is too old
|
||||
depends_on 'ossp-uuid' unless build.include? 'without-ossp-uuid'
|
||||
|
||||
option '32-bit'
|
||||
|
@ -24,7 +24,7 @@ class Postgresql < Formula
|
|||
end
|
||||
|
||||
def install
|
||||
ENV.libxml2 if MacOS.snow_leopard?
|
||||
ENV.libxml2 if MacOS.version >= :snow_leopard
|
||||
|
||||
args = ["--disable-debug",
|
||||
"--prefix=#{prefix}",
|
||||
|
|
|
@ -11,7 +11,7 @@ class Povray < Formula
|
|||
# TODO give this a build number (2326?)
|
||||
fails_with :llvm do
|
||||
cause "povray fails with 'terminate called after throwing an instance of int'"
|
||||
end if MacOS.leopard?
|
||||
end if MacOS.version == :leopard
|
||||
|
||||
def install
|
||||
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
||||
|
|
|
@ -22,7 +22,7 @@ class Qt < Formula
|
|||
option 'developer', 'Compile and link Qt with developer options'
|
||||
|
||||
depends_on "d-bus" if build.include? 'with-qtdbus'
|
||||
depends_on 'sqlite' if MacOS.leopard?
|
||||
depends_on 'sqlite' if MacOS.version == :leopard
|
||||
|
||||
fails_with :clang do
|
||||
build 421
|
||||
|
@ -31,11 +31,11 @@ class Qt < Formula
|
|||
def patches
|
||||
# fixes conflict on osx 10.5. See qt bug:
|
||||
# https://bugreports.qt-project.org/browse/QTBUG-23258
|
||||
if MacOS.leopard?
|
||||
if MacOS.version == :leopard
|
||||
"http://bugreports.qt-project.org/secure/attachment/26712/Patch-Qt-4.8-for-10.5"
|
||||
# add support for Mountain Lion
|
||||
# should be unneeded for 4.8.3
|
||||
elsif MacOS.mountain_lion?
|
||||
elsif MacOS.version >= :mountain_lion
|
||||
[ "https://qt.gitorious.org/qt/qt/commit/422f1b?format=patch",
|
||||
"https://qt.gitorious.org/qt/qt/commit/665355?format=patch",
|
||||
"https://raw.github.com/gist/3187034/893252db0ae3bb9bb5fa3ff7c530c7978399b101/0001-Fix-WebKit-on-OS-X-Mountain-Lion.patch" ]
|
||||
|
@ -46,7 +46,7 @@ class Qt < Formula
|
|||
def install
|
||||
# Apply binary git patch; normal patch ignores this.
|
||||
# TODO: Autodetect binary patches and apply them correctly.
|
||||
system "git apply --exclude=*/QtWebKit.pro 002-homebrew.diff" if MacOS.mountain_lion?
|
||||
system "git apply --exclude=*/QtWebKit.pro 002-homebrew.diff" if MacOS.version >= :mountain_lion
|
||||
|
||||
ENV.append "CXXFLAGS", "-fvisibility=hidden"
|
||||
args = ["-prefix", prefix,
|
||||
|
@ -55,7 +55,7 @@ class Qt < Formula
|
|||
"-cocoa", "-fast" ]
|
||||
|
||||
# See: https://github.com/mxcl/homebrew/issues/issue/744
|
||||
args << "-system-sqlite" if MacOS.leopard?
|
||||
args << "-system-sqlite" if MacOS.version == :leopard
|
||||
|
||||
args << "-plugin-sql-mysql" if (HOMEBREW_CELLAR+"mysql").directory?
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ class Rabbitmq < Formula
|
|||
sha1 '50ad453ae6a293c7b314dd2dd24a29648f1acc11'
|
||||
|
||||
depends_on 'erlang'
|
||||
depends_on 'simplejson' => :python if MacOS.leopard?
|
||||
depends_on 'simplejson' => :python if MacOS.version == :leopard
|
||||
|
||||
def install
|
||||
# Install the base files
|
||||
|
|
|
@ -19,7 +19,7 @@ class Recode < Formula
|
|||
s = Formula.factory('libtool').share
|
||||
d = "#{s}/libtool/config"
|
||||
cp ["#{d}/config.guess", "#{d}/config.sub"], "."
|
||||
elsif MacOS.leopard?
|
||||
elsif MacOS.version == :leopard
|
||||
cp Dir["#{MacOS::Xcode.prefix}/usr/share/libtool/config.*"], "."
|
||||
else
|
||||
cp Dir["#{MacOS::Xcode.prefix}/usr/share/libtool/config/config.*"], "."
|
||||
|
|
|
@ -7,7 +7,7 @@ class Rtmpdump < Formula
|
|||
|
||||
head 'git://git.ffmpeg.org/rtmpdump'
|
||||
|
||||
depends_on 'openssl' if MacOS.leopard?
|
||||
depends_on 'openssl' if MacOS.version == :leopard
|
||||
|
||||
fails_with :llvm do
|
||||
build '2336'
|
||||
|
|
|
@ -13,7 +13,7 @@ class Rtorrent < Formula
|
|||
def install
|
||||
args = ["--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"]
|
||||
args << "--with-xmlrpc-c" if Formula.factory("xmlrpc-c").installed?
|
||||
if MacOS.leopard?
|
||||
if MacOS.version == :leopard
|
||||
inreplace 'configure' do |s|
|
||||
s.gsub! ' pkg_cv_libcurl_LIBS=`$PKG_CONFIG --libs "libcurl >= 7.15.4" 2>/dev/null`',
|
||||
' pkg_cv_libcurl_LIBS=`$PKG_CONFIG --libs "libcurl >= 7.15.4" | sed -e "s/-arch [^-]*/-arch $(uname -m) /" 2>/dev/null`'
|
||||
|
|
|
@ -25,7 +25,7 @@ class Sdl < Formula
|
|||
system "./autogen.sh" if build.head?
|
||||
|
||||
args = %W[--prefix=#{prefix}]
|
||||
args << "--disable-nasm" unless MacOS.mountain_lion? # might work with earlier, might only work with new clang
|
||||
args << "--disable-nasm" unless MacOS.version >= :mountain_lion # might work with earlier, might only work with new clang
|
||||
# LLVM-based compilers choke on the assembly code packaged with SDL.
|
||||
args << '--disable-assembly' if ENV.compiler == :llvm or ENV.compiler == :clang and MacOS.clang_build_version < 421
|
||||
args << '--without-x'
|
||||
|
|
|
@ -24,7 +24,7 @@ class Spidermonkey < Formula
|
|||
def install
|
||||
# aparently this flag causes the build to fail for ivanvc on 10.5 with a
|
||||
# penryn (core 2 duo) CPU. So lets be cautious here and remove it.
|
||||
ENV['CFLAGS'] = ENV['CFLAGS'].gsub(/-msse[^\s]+/, '') if MacOS.leopard?
|
||||
ENV['CFLAGS'] = ENV['CFLAGS'].gsub(/-msse[^\s]+/, '') if MacOS.version == :leopard
|
||||
|
||||
# For some reason SpiderMonkey requires Autoconf-2.13
|
||||
ac213_prefix = buildpath/'ac213'
|
||||
|
|
|
@ -8,7 +8,7 @@ class Stormfs < Formula
|
|||
depends_on 'pkg-config' => :build
|
||||
depends_on 'glib'
|
||||
depends_on 'fuse4x'
|
||||
depends_on 'curl' if MacOS.leopard?
|
||||
depends_on 'curl' if MacOS.version == :leopard
|
||||
|
||||
def install
|
||||
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
||||
|
|
|
@ -165,7 +165,7 @@ class Subversion < Formula
|
|||
# Remove hard-coded ppc target, add appropriate ones
|
||||
if build.universal?
|
||||
arches = "-arch x86_64 -arch i386"
|
||||
elsif MacOS.leopard?
|
||||
elsif MacOS.version == :leopard
|
||||
arches = "-arch i386"
|
||||
else
|
||||
arches = "-arch x86_64"
|
||||
|
|
|
@ -21,7 +21,7 @@ class SwiProlog < Formula
|
|||
end
|
||||
|
||||
# 10.5 versions of these are too old
|
||||
if MacOS.leopard?
|
||||
if MacOS.version == :leopard
|
||||
depends_on 'fontconfig'
|
||||
depends_on 'expat'
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ class Tcpflow < Formula
|
|||
s = Formula.factory('libtool').share
|
||||
d = "#{s}/libtool/config"
|
||||
cp ["#{d}/config.guess", "#{d}/config.sub"], "."
|
||||
elsif MacOS.leopard?
|
||||
elsif MacOS.version == :leopard
|
||||
cp Dir["#{MacOS::Xcode.prefix}/usr/share/libtool/config.*"], "."
|
||||
else
|
||||
cp Dir["#{MacOS::Xcode.prefix}/usr/share/libtool/config/config.*"], "."
|
||||
|
|
|
@ -5,7 +5,7 @@ class Texi2html < Formula
|
|||
url 'http://download.savannah.gnu.org/releases/texi2html/texi2html-1.70.tar.gz'
|
||||
sha1 'b3472fb5ef80824177a56a1a37983c13497b23be'
|
||||
|
||||
keg_only :provided_by_osx unless MacOS.mountain_lion?
|
||||
keg_only :provided_by_osx unless MacOS.version >= :mountain_lion
|
||||
|
||||
def install
|
||||
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}",
|
||||
|
|
|
@ -20,7 +20,7 @@ class Trafshow < Formula
|
|||
s = Formula.factory('libtool').share
|
||||
d = "#{s}/libtool/config"
|
||||
cp ["#{d}/config.guess", "#{d}/config.sub"], "."
|
||||
elsif MacOS.leopard?
|
||||
elsif MacOS.version == :leopard
|
||||
cp Dir["#{MacOS::Xcode.prefix}/usr/share/libtool/config.*"], "."
|
||||
else
|
||||
cp Dir["#{MacOS::Xcode.prefix}/usr/share/libtool/config/config.*"], "."
|
||||
|
|
|
@ -16,7 +16,7 @@ class Vpnc < Formula
|
|||
|
||||
# Patch from user @Imagesafari to enable compilation on Lion
|
||||
def patches
|
||||
DATA if MacOS.lion?
|
||||
DATA if MacOS.version >= :lion
|
||||
end
|
||||
|
||||
def install
|
||||
|
|
|
@ -14,7 +14,7 @@ class Wget < Formula
|
|||
option "enable-iri", "Enable iri support"
|
||||
option "enable-debug", "Build with debug support"
|
||||
|
||||
depends_on "openssl" if MacOS.leopard?
|
||||
depends_on "openssl" if MacOS.version == :leopard
|
||||
depends_on "libidn" if build.include? "enable-iri"
|
||||
|
||||
if build.head?
|
||||
|
|
|
@ -72,7 +72,7 @@ class Wine < Formula
|
|||
"--with-x",
|
||||
"--with-coreaudio",
|
||||
"--with-opengl"]
|
||||
args << "--disable-win16" if MacOS.leopard? or ENV.compiler == :clang
|
||||
args << "--disable-win16" if MacOS.version == :leopard or ENV.compiler == :clang
|
||||
|
||||
# 64-bit builds of mpg123 are incompatible with 32-bit builds of Wine
|
||||
args << "--without-mpg123" if Hardware.is_64_bit?
|
||||
|
|
|
@ -9,9 +9,7 @@ class XmlrpcC < Formula
|
|||
# Backport patch for deprecated curl/types.h include, which is gone on 10.8
|
||||
# On 10.6 and 10.7 it's empty, so could probably patch unconditionally
|
||||
# see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636457#10
|
||||
if MacOS.mountain_lion?
|
||||
DATA
|
||||
end
|
||||
DATA if MacOS.version >= :mountain_lion
|
||||
end
|
||||
|
||||
def install
|
||||
|
|
|
@ -12,7 +12,7 @@ class Ykpers < Formula
|
|||
def patches
|
||||
{:p0 =>
|
||||
"https://trac.macports.org/export/96037/trunk/dports/security/ykpers/files/patch-pre-Lion-strnlen.diff"
|
||||
} unless MacOS.lion?
|
||||
} unless MacOS.version >= :lion
|
||||
end
|
||||
|
||||
def install
|
||||
|
|
Loading…
Reference in a new issue