aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/--config.rb
diff options
context:
space:
mode:
authorsamueljohn2012-02-26 21:04:15 +0100
committerAdam Vandenberg2012-06-24 19:11:06 -0700
commit725feb3db1da1577a3e1b376934e16aedbd9ded9 (patch)
tree442b4168dde06a09e242a0ab7d4204e274ad60ce /Library/Homebrew/cmd/--config.rb
parent3147dd134a6e919c974b4a8abc93338d489cc31a (diff)
downloadbrew-725feb3db1da1577a3e1b376934e16aedbd9ded9.tar.bz2
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to work with homebrew, so it's not necessary to register an Apple Dev ID and/or go to the XCode prefs and download the CLT. Yay! Further, this commit allows to use the CLT solely (without the need for XCode). Saves quite some megs. (Some furmulae require xcodebuild) Of course XCode together with the CLT is still fine and has been tested on 10.7 and 10.6 with Xcode 4 and Xcode 3. Only on Lion or above, tell the user about the options, which are - Xcode without CLT - CLT without Xcode - both (ok, it's not directly stated, but implicit) So if no Xcode is found and we are on Lion or above, we don't fail but check for the CLTs now. For older Macs, the old message that Xcode is needed and the installer should be run is still displayed. If the CLT are not found but Xcode is, then we print out about the experimental status of this setup. Closes Homebrew/homebrew#10510. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Homebrew/cmd/--config.rb')
-rw-r--r--Library/Homebrew/cmd/--config.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb
index 5fb455d23..a4431eb5e 100644
--- a/Library/Homebrew/cmd/--config.rb
+++ b/Library/Homebrew/cmd/--config.rb
@@ -25,8 +25,21 @@ module Homebrew extend self
@clang_build ||= MacOS.clang_build_version
end
- def xcode_version
- @xcode_version || MacOS.xcode_version
+ def describe_xcode
+ @describe_xcode ||= begin
+ xcode = MacOS.xcode_version
+ if MacOS.xcode_installed?
+ xcode += " in '#{MacOS.xcode_prefix}'" unless MacOS.xcode_prefix.to_s == '/Applications/Xcode.app/Contents/Developer'
+ else
+ xcode += ' (guessed)' unless MacOS.xcode_installed?
+ end
+ xcode += ", CLT #{MacOS.clt_version}" if MacOS.clt_installed?
+ xcode
+ end
+ end
+
+ def describe_default_sdk
+ @describe_default_sdk ||= if MacOS.sdk_path.nil? then "N/A" else MacOS.sdk_path end
end
def sha
@@ -90,7 +103,7 @@ module Homebrew extend self
puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.to_s != "#{HOMEBREW_PREFIX}/Cellar"
puts hardware
puts "MacOS: #{MACOS_FULL_VERSION}-#{kernel}"
- puts "Xcode: #{xcode_version}"
+ puts "Xcode: #{describe_xcode}"
puts "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby:\n #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" if RUBY_VERSION.to_f != 1.8
ponk = macports_or_fink_installed?
@@ -108,7 +121,7 @@ module Homebrew extend self
#{hardware}
OS X: #{MACOS_FULL_VERSION}
Kernel Architecture: #{kernel}
- Xcode: #{xcode_version}
+ Xcode: #{describe_xcode}
GCC-4.0: #{gcc_40 ? "build #{gcc_40}" : "N/A"}
GCC-4.2: #{gcc_42 ? "build #{gcc_42}" : "N/A"}
LLVM: #{llvm ? "build #{llvm}" : "N/A"}