brew/Library/Homebrew/superenv/macsystem.rb
Samuel John c6b0b563e8 Better superenv support for Xcode elsewhere
- The Library/ENV/4.3/xcrun shim now respects
  ENV['DEVELOPER_DIR'] instead assuming the location
  of /Applications/Xcode.app/Contents/Developer.
- The env var DEVELOPER_DIR is set if it is not
  already. So, during superenv this var is always set
  and we no longer have to care about people with unset
  or wrongly set xcode-select stuff. This has been
  a major PITA in the past.
- determine_developer_dir (which is used to set
  the DEVELOPER_DIR var) now uses MacOS::Xcode.prefix
  which is proven and very capable and uses splotlight
  correctly.
- Replace (and remove) MacSystem.xcode43_developer_dir
  with Xcode.prefix

Closes Homebrew/homebrew#18618
2013-03-21 17:10:32 +01:00

24 lines
687 B
Ruby

# new code because I don't really trust the Xcode code now having researched it more
module MacSystem extend self
def xcode_clt_installed?
File.executable? "/usr/bin/clang" and File.executable? "/usr/bin/lldb" and File.executable? "/usr/bin/make"
end
def xcode43_without_clt?
MacOS::Xcode.version >= "4.3" and not MacSystem.xcode_clt_installed?
end
def x11_prefix
@x11_prefix ||= %W[/opt/X11 /usr/X11
#{MacOS.sdk_path}/usr/X11].find{|path| File.directory? "#{path}/include" }
end
private
def tst prefix
prefix = prefix.to_s.chomp
xcrun = "#{prefix}/usr/bin/xcrun"
prefix if xcrun != "/usr/bin/xcrun" and File.executable? xcrun
end
end