diff options
| author | David Rice | 2013-06-25 16:49:08 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2013-06-26 19:09:06 +0100 |
| commit | 0367072c9893fff803cc00817cd1a42df33f9a8e (patch) | |
| tree | d90d739400e12cf2a9e3e8f97975878400828305 /Library | |
| parent | f3ff194cfe307f1d0108a98dee1a8559facc337a (diff) | |
| download | homebrew-0367072c9893fff803cc00817cd1a42df33f9a8e.tar.bz2 | |
Detect Command Line Tools on Mavericks.
Closes #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? |
