aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorSamuel John2013-05-31 12:30:25 +0200
committerSamuel John2013-06-03 17:29:43 +0200
commit06889915075a22031463a86c54e54998535d3e07 (patch)
tree548df8ccda233420bd6fb508f7004acbdf0235e2 /Library
parentc5248956662e06094b7c4f7f7475d66771771ff6 (diff)
downloadbrew-06889915075a22031463a86c54e54998535d3e07.tar.bz2
superenv: Work if build tool changes DEVELOPER_DIR
Some build systems still set the DEVELOPER_DIR to /Developer and then nothing works any more (xcrun, xcodebuild etc.) I am looking at you MacVim.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/4.3/xcrun7
-rw-r--r--Library/Homebrew/superenv.rb3
2 files changed, 7 insertions, 3 deletions
diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun
index 4784cd4d5..39821c833 100755
--- a/Library/ENV/4.3/xcrun
+++ b/Library/ENV/4.3/xcrun
@@ -7,6 +7,9 @@
require "#{File.dirname __FILE__}/../libsuperenv"
SUPERBIN = __FILE__.dirname.cleanpath.freeze
+# Some build tools are stupid and still set DEVELOPER_DIR to old /Developer
+ENV['DEVELOPER_DIR'] = ENV['HOMEBREW_DEVELOPER_DIR']
+
exec "/usr/bin/xcrun", *ARGV if ARGV.empty? or ARGV[0][0..0] == '-'
if File.exist?("/usr/bin/#{ARGV.first}")
exec "/usr/bin/#{ARGV.shift}", *ARGV unless ENV['HOMEBREW_SDKROOT'].directory?
@@ -19,8 +22,8 @@ end
arg0 = ARGV.shift
try `/usr/bin/xcrun --find #{arg0}`.chomp
# Nuts, Xcode is not setup properly or something. Try to find the tools anyway!
-try "#{ENV['DEVELOPER_DIR']}/usr/bin/#{arg0}"
-try "#{ENV['DEVELOPER_DIR']}/Toolchains/XcodeDefault.xctoolchain/usr/bin/#{arg0}"
+try "#{ENV['HOMEBREW_DEVELOPER_DIR']}/usr/bin/#{arg0}"
+try "#{ENV['HOMEBREW_DEVELOPER_DIR']}/Toolchains/XcodeDefault.xctoolchain/usr/bin/#{arg0}"
# xcrun won't always be able to find Homebrew's apple-gcc42,
# even when it's in the PATH
ENV['PATH'].split(':').each do |p|
diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb
index 022517534..77b121155 100644
--- a/Library/Homebrew/superenv.rb
+++ b/Library/Homebrew/superenv.rb
@@ -47,7 +47,7 @@ class << ENV
ENV['CXX'] = 'c++'
ENV['OBJC'] = 'cc'
ENV['OBJCXX'] = 'c++'
- ENV['DEVELOPER_DIR'] = determine_developer_dir # effects later settings
+ ENV['DEVELOPER_DIR'] = determine_developer_dir
ENV['MAKEFLAGS'] ||= "-j#{determine_make_jobs}"
ENV['PATH'] = determine_path
ENV['PKG_CONFIG_PATH'] = determine_pkg_config_path
@@ -56,6 +56,7 @@ class << ENV
ENV['HOMEBREW_CCCFG'] = determine_cccfg
ENV['HOMEBREW_BREW_FILE'] = HOMEBREW_BREW_FILE
ENV['HOMEBREW_SDKROOT'] = "#{MacOS.sdk_path}" if MacSystem.xcode43_without_clt?
+ ENV['HOMEBREW_DEVELOPER_DIR'] = determine_developer_dir # used by our xcrun shim
ENV['CMAKE_PREFIX_PATH'] = determine_cmake_prefix_path
ENV['CMAKE_FRAMEWORK_PATH'] = determine_cmake_frameworks_path
ENV['CMAKE_INCLUDE_PATH'] = determine_cmake_include_path