From 275e66e08d3dd8870a8b06b4a1b9e45adf52e1ea Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 20 Apr 2014 16:48:55 -0500 Subject: [PATCH] Stop loading a bunch of monkeypatches every time xcrun is invoked --- Library/ENV/4.3/xcrun | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun index c6f923c16e..0cef2bbfb7 100755 --- a/Library/ENV/4.3/xcrun +++ b/Library/ENV/4.3/xcrun @@ -4,9 +4,14 @@ # But many build-systems expect it to work. This fixes that. # NOTE only works if the build-tool calls xcrun without a path prefixed! -dirname = File.dirname(__FILE__) -require File.expand_path("../libsuperenv", dirname) -SUPERBIN = dirname.cleanpath.freeze +$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8" +require "pathname" + +def canonical_dirname path + Pathname.new(path).dirname.realpath.to_s +end + +SUPERBIN = canonical_dirname(__FILE__) # Some build tools are stupid and still set DEVELOPER_DIR to old /Developer ENV.delete "DEVELOPER_DIR" @@ -18,7 +23,7 @@ if File.exist?("/usr/bin/#{ARGV.first}") end def try path - exec path, *ARGV if File.executable?(path) and File.dirname(path.cleanpath) != SUPERBIN + exec path, *ARGV if File.executable?(path) && canonical_dirname(path) != SUPERBIN end arg0 = ARGV.shift