summary refs log tree commit diff
path: root/pkgs/development/libraries/v8/no-xcode.patch
blob: 5562ffaf64e16a5214b3bae312086d171dc9e5b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
+++ a/tools/gyp/pylib/gyp/xcode_emulation.py
@@ -473,10 +473,16 @@
 
   def _XcodeSdkPath(self, sdk_root):
     if sdk_root not in XcodeSettings._sdk_path_cache:
-      sdk_path = self._GetSdkVersionInfoItem(sdk_root, '--show-sdk-path')
-      XcodeSettings._sdk_path_cache[sdk_root] = sdk_path
-      if sdk_root:
-        XcodeSettings._sdk_root_cache[sdk_path] = sdk_root
+      try:
+        sdk_path = self._GetSdkVersionInfoItem(sdk_root, '--show-sdk-path')
+        XcodeSettings._sdk_path_cache[sdk_root] = sdk_path
+        if sdk_root:
+          XcodeSettings._sdk_root_cache[sdk_path] = sdk_root
+      except:
+        # if this fails it's because xcodebuild failed, which means
+        # the user is probably on a CLT-only system, where there
+        # is no valid SDK root
+        XcodeSettings._sdk_path_cache[sdk_root] = None
     return XcodeSettings._sdk_path_cache[sdk_root]
 
   def _AppendPlatformVersionMinFlags(self, lst):
@@ -606,10 +612,11 @@
       framework_root = sdk_root
     else:
       framework_root = ''
-    config = self.spec['configurations'][self.configname]
-    framework_dirs = config.get('mac_framework_dirs', [])
-    for directory in framework_dirs:
-      cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
+    if 'SDKROOT' in self._Settings():
+      config = self.spec['configurations'][self.configname]
+      framework_dirs = config.get('mac_framework_dirs', [])
+      for directory in framework_dirs:
+        cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
 
     self.configname = None
     return cflags
@@ -861,10 +868,11 @@
     sdk_root = self._SdkPath()
     if not sdk_root:
       sdk_root = ''
-    config = self.spec['configurations'][self.configname]
-    framework_dirs = config.get('mac_framework_dirs', [])
-    for directory in framework_dirs:
-      ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
+    if 'SDKROOT' in self._Settings():
+      config = self.spec['configurations'][self.configname]
+      framework_dirs = config.get('mac_framework_dirs', [])
+      for directory in framework_dirs:
+        ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
 
     platform_root = self._XcodePlatformPath(configname)
     if sdk_root and platform_root and self._IsXCTest():
@@ -1358,7 +1366,7 @@
     if version:
       version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
     else:
-      raise GypError("No Xcode or CLT version detected!")
+      version = "7.0.0"
     # The CLT has no build information, so we return an empty string.
     version_list = [version, '']
   version = version_list[0]