diff options
| author | Misty De Meo | 2015-08-21 11:04:22 -0700 |
|---|---|---|
| committer | Misty De Meo | 2015-08-21 11:04:22 -0700 |
| commit | 727239e12f98fafad39aa4f70b37c6d5bf4db1cc (patch) | |
| tree | 6019e597c18c9ea366e7e45be0a3e6fc19335ae1 /Library/Homebrew/os | |
| parent | 1da2855c0b1d884d18944307bdbbe2b64c4dd47d (diff) | |
| parent | 04a0b2aafe2062701be4028f408d0bee15f3815d (diff) | |
| download | brew-727239e12f98fafad39aa4f70b37c6d5bf4db1cc.tar.bz2 | |
Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
Diffstat (limited to 'Library/Homebrew/os')
| -rw-r--r-- | Library/Homebrew/os/mac.rb | 27 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac/xcode.rb | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index ffab00b00..c2c909d76 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -36,6 +36,33 @@ module OS end end + # Locates a (working) copy of install_name_tool, guaranteed to function + # whether the user has developer tools installed or not. + def install_name_tool + if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/install_name_tool") + Pathname.new(path) + else + locate("install_name_tool") + end + end + + # Locates a (working) copy of otool, guaranteed to function whether the user + # has developer tools installed or not. + def otool + if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/otool") + Pathname.new(path) + else + locate("otool") + end + end + + # Checks if the user has any developer tools installed, either via Xcode + # or the CLT. Convenient for guarding against formula builds when building + # is impossible. + def has_apple_developer_tools? + Xcode.installed? || CLT.installed? + end + def active_developer_dir @active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip end diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 9b111e4e6..a79814d0d 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -76,6 +76,8 @@ module OS return "0" unless OS.mac? + return nil if !MacOS::Xcode.installed? && !MacOS::CLT.installed? + %W[#{prefix}/usr/bin/xcodebuild #{which("xcodebuild")}].uniq.each do |path| if File.file? path Utils.popen_read(path, "-version") =~ /Xcode (\d(\.\d)*)/ |
