brew/Library/Homebrew/global.rb

43 lines
1.4 KiB
Ruby
Raw Normal View History

require 'extend/pathname'
require 'extend/ARGV'
2010-02-27 17:26:27 +00:00
require 'extend/string'
require 'utils'
ARGV.extend(HomebrewArgvExtension)
HOMEBREW_VERSION = 0.7
HOMEBREW_WWW = 'http://mxcl.github.com/homebrew/'
if Process.uid == 0
# technically this is not the correct place, this cache is for *all users*
# so in that case, maybe we should always use it, root or not?
HOMEBREW_CACHE=Pathname.new("/Library/Caches/Homebrew")
else
HOMEBREW_CACHE=Pathname.new("~/Library/Caches/Homebrew").expand_path
end
if not defined? HOMEBREW_BREW_FILE
2009-11-18 15:39:51 -08:00
HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] || `which brew`.chomp
end
HOMEBREW_PREFIX = Pathname.new(HOMEBREW_BREW_FILE).dirname.parent # Where we link under
HOMEBREW_REPOSITORY = Pathname.new(HOMEBREW_BREW_FILE).realpath.dirname.parent # Where .git is found
2010-06-29 13:53:57 -07:00
# Where we store built products; /usr/local/Cellar if it exists,
# otherwise a Cellar relative to the Repository.
if (HOMEBREW_PREFIX+'Cellar').exist?
HOMEBREW_CELLAR = HOMEBREW_PREFIX+'Cellar'
else
HOMEBREW_CELLAR = HOMEBREW_REPOSITORY+'Cellar'
end
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
MACOS_VERSION = /(10\.\d+)(\.\d+)?/.match(MACOS_FULL_VERSION).captures.first.to_f
HOMEBREW_USER_AGENT = "Homebrew #{HOMEBREW_VERSION} (Ruby #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}; Mac OS X #{MACOS_FULL_VERSION})"
2010-07-21 09:40:28 -07:00
RECOMMENDED_LLVM = 2207
RECOMMENDED_GCC_40 = 5493
2010-07-21 09:40:28 -07:00
RECOMMENDED_GCC_42 = (MACOS_VERSION >= 10.6) ? 5659 : 5577