diff options
| author | Misty De Meo | 2013-12-18 19:30:53 -0800 |
|---|---|---|
| committer | Misty De Meo | 2013-12-18 19:30:53 -0800 |
| commit | 5ab432876dd1b397cbe5d4bd8be890b072902429 (patch) | |
| tree | 85d39aa7d6aefe5715d8bce13d97dd43f3d8bbbd /Library | |
| parent | 372be43fa10c3ead8a9b7e0ddec618450f944130 (diff) | |
| download | homebrew-5ab432876dd1b397cbe5d4bd8be890b072902429.tar.bz2 | |
node: fix configure for bad xcode-select path
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/node.rb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Library/Formula/node.rb b/Library/Formula/node.rb index dbd511bba..dd963f86e 100644 --- a/Library/Formula/node.rb +++ b/Library/Formula/node.rb @@ -111,7 +111,7 @@ end __END__ diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py -index 520dcc4..bcc6c71 100644 +index 520dcc4..531e755 100644 --- a/tools/gyp/pylib/gyp/xcode_emulation.py +++ b/tools/gyp/pylib/gyp/xcode_emulation.py @@ -280,7 +280,14 @@ class XcodeSettings(object): @@ -174,10 +174,11 @@ index 520dcc4..bcc6c71 100644 def AdjustLibraries(self, libraries, config_name=None): """Transforms entries like 'Cocoa.framework' in libraries into entries like -@@ -856,6 +868,26 @@ class XcodeSettings(object): +@@ -856,6 +868,27 @@ class XcodeSettings(object): def _BuildMachineOSBuild(self): return self._GetStdout(['sw_vers', '-buildVersion']) ++ # This method ported from the logic in Homebrew's CLT version check + def _CLTVersion(self): + # pkgutil output looks like + # package-id: com.apple.pkg.CLTools_Executables @@ -201,17 +202,27 @@ index 520dcc4..bcc6c71 100644 def _XcodeVersion(self): # `xcodebuild -version` output looks like # Xcode 4.6.3 -@@ -866,13 +898,20 @@ class XcodeSettings(object): +@@ -866,13 +899,30 @@ class XcodeSettings(object): # BuildVersion: 10M2518 # Convert that to '0463', '4H1503'. if len(XcodeSettings._xcode_version_cache) == 0: - version_list = self._GetStdout(['xcodebuild', '-version']).splitlines() + try: + version_list = self._GetStdout(['xcodebuild', '-version']).splitlines() ++ # In some circumstances xcodebuild exits 0 but doesn't return ++ # the right results; for example, a user on 10.7 or 10.8 with ++ # a bogus path set via xcode-select ++ # In that case this may be a CLT-only install so fall back to ++ # checking that version. ++ if len(version_list) < 2: ++ raise GypError, "xcodebuild returned unexpected results" + except: + version = self._CLTVersion() + if version: + version = re.match('(\d\.\d\.?\d*)', version).groups()[0] ++ else: ++ raise GypError, "No Xcode or CLT version detected!" ++ # The CLT has no build information, so we return an empty string. + version_list = [version, ''] version = version_list[0] build = version_list[-1] @@ -224,7 +235,7 @@ index 520dcc4..bcc6c71 100644 XcodeSettings._xcode_version_cache = (version, build) return XcodeSettings._xcode_version_cache -@@ -930,7 +969,11 @@ class XcodeSettings(object): +@@ -930,7 +980,11 @@ class XcodeSettings(object): default_sdk_root = XcodeSettings._sdk_root_cache.get(default_sdk_path) if default_sdk_root: return default_sdk_root |
