Add option for building bottles.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2011-12-31 19:09:49 +00:00
parent 555e7ff893
commit a3db9a42e8
2 changed files with 10 additions and 5 deletions

View File

@ -81,12 +81,13 @@ module HomebrewArgvExtension
include? '--32-bit'
end
def build_bottle?
MacOS.bottles_supported? and include? '--build-bottle'
end
def build_from_source?
return true if flag? '--build-from-source' or ENV['HOMEBREW_BUILD_FROM_SOURCE'] \
or not MacOS.lion? or HOMEBREW_PREFIX.to_s != '/usr/local'
options = options_only
options.delete '--universal'
not options.empty?
flag? '--build-from-source' or ENV['HOMEBREW_BUILD_FROM_SOURCE'] \
or not MacOS.bottles_supported? or not options_only.empty?
end
def flag? flag

View File

@ -398,6 +398,10 @@ module MacOS extend self
def prefer_64_bit?
Hardware.is_64_bit? and 10.6 <= MACOS_VERSION
end
def bottles_supported?
lion? and HOMEBREW_PREFIX.to_s == '/usr/local'
end
end
module GitHub extend self