From a0df6180b7c99f7cb78493bd1c103012e3e328b1 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sun, 23 Sep 2012 20:57:41 -0400 Subject: [PATCH] Set DEVELOPER_DIR; Fixes bad xcode-select path In cases where the xcode-select -print-path is '/' xcrun still hangs indefinitely, setting DEVELOPER_DIR to something (preferably the Xcode path) fixes that. So let's. --- Library/Homebrew/superenv.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb index 91b302e65f..cefacdae39 100644 --- a/Library/Homebrew/superenv.rb +++ b/Library/Homebrew/superenv.rb @@ -16,7 +16,6 @@ def superbin end def superenv? - not MacOS::Xcode.bad_xcode_select_path? and # because xcrun won't work not MacOS::Xcode.folder.nil? and # because xcrun won't work superbin and superbin.directory? and not ARGV.include? "--env=std" @@ -55,6 +54,7 @@ class << ENV ENV['CMAKE_LIBRARY_PATH'] = determine_cmake_library_path ENV['ACLOCAL_PATH'] = determine_aclocal_path ENV['VERBOSE'] = '1' if ARGV.verbose? + ENV['DEVELOPER_DIR'] = determine_developer_dir end def check @@ -179,6 +179,15 @@ class << ENV s end + def determine_developer_dir + # If Xcode path is fucked then this is basically a fix. In the case where + # nothing is valid, it still fixes most usage to supply a valid path that + # is not "/". + if MacOS::Xcode.bad_xcode_select_path? + (Xcode.prefix || HOMEBREW_PREFIX).to_s + end + end + public ### NO LONGER NECESSARY OR NO LONGER SUPPORTED