Avoid referencing MACOS_VERSION directly

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-09-04 18:15:31 -05:00
parent 4dee0b1413
commit 018dabf584
9 changed files with 13 additions and 14 deletions

View file

@ -21,7 +21,7 @@ class Dnsmasq < Formula
end
# Fix compilation on Lion
ENV.append_to_cflags "-D__APPLE_USE_RFC_3542" if 10.7 <= MACOS_VERSION
ENV.append_to_cflags "-D__APPLE_USE_RFC_3542" if MacOS.version >= :lion
inreplace "Makefile" do |s|
s.change_make_var! "CFLAGS", ENV.cflags
end

View file

@ -22,10 +22,10 @@ class Fuse4xKext < Formula
args = [
"-sdk",
"macosx#{MACOS_VERSION}",
"macosx#{MacOS.version}",
"-configuration", "Release",
"-alltargets",
"MACOSX_DEPLOYMENT_TARGET=#{MACOS_VERSION}",
"MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}",
"SYMROOT=build",
# Build a 32-bit kernel extension on Leopard and a fat binary for Snow
# Leopard/Lion.

View file

@ -15,13 +15,12 @@ class GfortranPkgDownloadStrategy < CurlDownloadStrategy
end
class Gfortran < Formula
if MacOS.leopard?
if MacOS.version == :leopard
url 'http://r.research.att.com/gfortran-42-5577.pkg'
md5 '30fb495c93cf514003cdfcb7846dc701'
version "4.2.4-5577"
elsif MACOS_VERSION == 10.6
# Snow Leopard
case gcc_42_build
elsif MacOS.version == :snow_leopard
case MacOS.gcc_42_build_version
when 5659
url 'http://r.research.att.com/gfortran-42-5659.pkg'
md5 '71bd546baa45c9c0fb4943cdd72ee274'
@ -64,7 +63,7 @@ class Gfortran < Formula
skip_clean :all
def install
if MacOS::Xcode.version >= '4.2' and MACOS_VERSION >= 10.7
if MacOS::Xcode.version >= '4.2' and MacOS.version >= :lion
ohai "Installing gfortran 4.2.4 for XCode 4.2 (build 5666) or higher"
safe_system "pax --insecure -rz -f Payload.gz -s ',./usr,#{prefix},'"

View file

@ -35,7 +35,7 @@ class Ghostscript < Formula
# the version included in ghostscript, we get errors
# Taken from the MacPorts portfile - http://bit.ly/ghostscript-portfile
renames = %w(jpeg libpng tiff zlib lcms2 jbig2dec)
renames << "freetype" if 10.7 <= MACOS_VERSION
renames << "freetype" if MacOS.version >= :lion
renames.each do |lib|
mv lib, "#{lib}_local"
end

View file

@ -8,7 +8,7 @@ class Imagesnap < Formula
depends_on :xcode # For working xcodebuild.
def install
system "xcodebuild -project ImageSnap.xcodeproj SYMROOT=build -sdk macosx#{MACOS_VERSION}"
system "xcodebuild -project ImageSnap.xcodeproj SYMROOT=build -sdk macosx#{MacOS.version}"
bin.install "build/Release/imagesnap"
end
end

View file

@ -33,7 +33,7 @@ class IscDhcp < Formula
end
# See discussion at: https://gist.github.com/1157223
if 10.7 <= MACOS_VERSION
if MacOS.version >= :lion
ENV.append 'CFLAGS', "-D__APPLE_USE_RFC_3542"
end

View file

@ -2,7 +2,7 @@ require 'formula'
class NeedsSnowLeopard < Requirement
def satisfied?
MACOS_VERSION >= 10.6
MacOS.version >= :snow_leopard
end
def fatal?

View file

@ -14,7 +14,7 @@ end
def snow_leopard_64?
# 64 bit builds on 10.6 require some special handling.
MACOS_VERSION == 10.6 and MacOS.prefer_64_bit?
MacOS.version == :snow_leopard and MacOS.prefer_64_bit?
end
class Octave < Formula

View file

@ -13,7 +13,7 @@ class Thrift < Formula
# No reason for this step is known. On Lion at least the pkg.m4 doesn't
# even exist. Turns out that it isn't needed on Lion either. Possibly it
# isn't needed anymore at all but I can't test that.
cp "#{MacOS::X11.share}/aclocal/pkg.m4", "aclocal" if MACOS_VERSION < 10.7
cp "#{MacOS::X11.share}/aclocal/pkg.m4", "aclocal" if MacOS.version < :lion
system "./bootstrap.sh" if build.head?