diff options
| author | David Rice | 2013-06-25 16:49:08 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2013-06-26 19:09:06 +0100 |
| commit | 59f3d0d6f6585ab2a0f9321acbd257aa0ede595e (patch) | |
| tree | 10f78351e472b2d103554c45b7bb36bf55f63fa9 /Library | |
| parent | 0d35455820f6f3a38fce298262cf23a236906523 (diff) | |
| download | brew-59f3d0d6f6585ab2a0f9321acbd257aa0ede595e.tar.bz2 | |
Detect Command Line Tools on Mavericks.
Closes Homebrew/homebrew#20774.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/macos.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac/xcode.rb | 16 |
2 files changed, 15 insertions, 9 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb index 147676b3c..c56919949 100644 --- a/Library/Homebrew/macos.rb +++ b/Library/Homebrew/macos.rb @@ -40,7 +40,13 @@ module MacOS extend self end def dev_tools_path - @dev_tools_path ||= if File.exist? "/usr/bin/cc" and File.exist? "/usr/bin/make" + @dev_tools_path ||= \ + if File.exist? MacOS::CLT::STANDALONE_PKG_PATH and + File.exist? "#{MacOS::CLT::STANDALONE_PKG_PATH}/usr/bin/cc" and + File.exist? "#{MacOS::CLT::STANDALONE_PKG_PATH}/usr/bin/make" + # In 10.9 the CLT moved from /usr into /Library/Developer/CommandLineTools. + Pathname.new "#{MacOS::CLT::STANDALONE_PKG_PATH}/usr/bin" + elsif File.exist? "/usr/bin/cc" and File.exist? "/usr/bin/make" # probably a safe enough assumption (the unix way) Pathname.new "/usr/bin" # Note that the exit status of system "xcrun foo" isn't always accurate diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 3fa7d62ae..202567eb4 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -154,16 +154,16 @@ end module MacOS::CLT extend self STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" + STANDALONE_PKG_PATH = Pathname.new("/Library/Developer/CommandLineTools") - # This is true ift he standard UNIX tools are present under /usr. For - # Xcode < 4.3, this is the standard location. Otherwise, it means that - # the user has installed the "Command Line Tools for Xcode" package. - # TODO: handle 10.9 CLT which has headers under: - # /Library/Developer/CommandLineTools/usr/include + # This is true if the standard UNIX tools are present in the expected location. For + # Mavericks and above this is /Library/Developer/CommandLineTools otherwise it is /usr. + # For Xcode < 4.3, this is the standard location. Otherwise, it means that the user has + # installed the "Command Line Tools for Xcode" package. def installed? - return false if MacOS.version > :mountain_lion - MacOS.dev_tools_path == Pathname.new("/usr/bin") and - File.directory? "/usr/include" + (MacOS.dev_tools_path == Pathname.new("#{MacOS::CLT::STANDALONE_PKG_PATH}/usr/bin") \ + and File.directory? "#{MacOS::CLT::STANDALONE_PKG_PATH}/usr/include") or + (MacOS.dev_tools_path == Pathname.new("/usr/bin") and File.directory? "/usr/include") end def latest_version? |
