about summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2013-05-28 17:27:28 -0400
committerShea Levy <shea@shealevy.com>2013-05-28 18:38:22 -0400
commitc982e84df49494aaf9d8306929ebba60a125aef8 (patch)
tree697bd91e08df4cb308215a822fa505fdbcc0da43 /pkgs/development/python-modules
parentfe009bcbc49ca4c8d20252047888e4b7b3d3fa6e (diff)
downloadnixlib-c982e84df49494aaf9d8306929ebba60a125aef8.tar
nixlib-c982e84df49494aaf9d8306929ebba60a125aef8.tar.gz
nixlib-c982e84df49494aaf9d8306929ebba60a125aef8.tar.bz2
nixlib-c982e84df49494aaf9d8306929ebba60a125aef8.tar.lz
nixlib-c982e84df49494aaf9d8306929ebba60a125aef8.tar.xz
nixlib-c982e84df49494aaf9d8306929ebba60a125aef8.tar.zst
nixlib-c982e84df49494aaf9d8306929ebba60a125aef8.zip
gyp: Fix on darwin
Signed-off-by: Shea Levy <shea@shealevy.com>
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/gyp/no-darwin-cflags.patch40
-rw-r--r--pkgs/development/python-modules/gyp/no-xcode.patch66
2 files changed, 106 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/gyp/no-darwin-cflags.patch b/pkgs/development/python-modules/gyp/no-darwin-cflags.patch
new file mode 100644
index 000000000000..4f95e78a1715
--- /dev/null
+++ b/pkgs/development/python-modules/gyp/no-darwin-cflags.patch
@@ -0,0 +1,40 @@
+Index: gyp/pylib/gyp/xcode_emulation.py
+===================================================================
+--- gyp/pylib/gyp/xcode_emulation.py	(revision 1635)
++++ gyp/pylib/gyp/xcode_emulation.py	(working copy)
+@@ -280,9 +280,6 @@
+     if self._Test('GCC_CHAR_IS_UNSIGNED_CHAR', 'YES', default='NO'):
+       cflags.append('-funsigned-char')
+ 
+-    if self._Test('GCC_CW_ASM_SYNTAX', 'YES', default='YES'):
+-      cflags.append('-fasm-blocks')
+-
+     if 'GCC_DYNAMIC_NO_PIC' in self._Settings():
+       if self._Settings()['GCC_DYNAMIC_NO_PIC'] == 'YES':
+         cflags.append('-mdynamic-no-pic')
+@@ -292,9 +289,6 @@
+       # mdynamic-no-pic by default for executable and possibly static lib
+       # according to mento
+ 
+-    if self._Test('GCC_ENABLE_PASCAL_STRINGS', 'YES', default='YES'):
+-      cflags.append('-mpascal-strings')
+-
+     self._Appendf(cflags, 'GCC_OPTIMIZATION_LEVEL', '-O%s', default='s')
+ 
+     if self._Test('GCC_GENERATE_DEBUGGING_SYMBOLS', 'YES', default='YES'):
+@@ -334,7 +328,6 @@
+       # TODO: Supporting fat binaries will be annoying.
+       self._WarnUnimplemented('ARCHS')
+       archs = ['i386']
+-    cflags.append('-arch ' + archs[0])
+ 
+     if archs[0] in ('i386', 'x86_64'):
+       if self._Test('GCC_ENABLE_SSE3_EXTENSIONS', 'YES', default='NO'):
+@@ -570,7 +563,6 @@
+       # TODO: Supporting fat binaries will be annoying.
+       self._WarnUnimplemented('ARCHS')
+       archs = ['i386']
+-    ldflags.append('-arch ' + archs[0])
+ 
+     # Xcode adds the product directory by default.
+     ldflags.append('-L' + product_dir)
diff --git a/pkgs/development/python-modules/gyp/no-xcode.patch b/pkgs/development/python-modules/gyp/no-xcode.patch
new file mode 100644
index 000000000000..951be7b005ac
--- /dev/null
+++ b/pkgs/development/python-modules/gyp/no-xcode.patch
@@ -0,0 +1,66 @@
+Index: pylib/gyp/xcode_emulation.py
+diff --git a/pylib/gyp/xcode_emulation.py b/pylib/gyp/xcode_emulation.py
+index b2aab986a427d5285d70558bf97f0a42bfe1556e..20592c73fae660009aac621097cf3c4fb61d6cb6 100644
+--- a/pylib/gyp/xcode_emulation.py
++++ b/pylib/gyp/xcode_emulation.py
+@@ -236,8 +236,14 @@ class XcodeSettings(object):
+     if sdk_root.startswith('/'):
+       return sdk_root
+     if sdk_root not in XcodeSettings._sdk_path_cache:
+-      XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem(
+-          sdk_root, 'Path')
++      try:
++        XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem(
++            sdk_root, 'Path')
++      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):
+@@ -340,10 +346,11 @@ class XcodeSettings(object):
+ 
+     cflags += self._Settings().get('WARNING_CFLAGS', [])
+ 
+-    config = self.spec['configurations'][self.configname]
+-    framework_dirs = config.get('mac_framework_dirs', [])
+-    for directory in framework_dirs:
+-      cflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
++    if sdk_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)', sdk_root))
+ 
+     self.configname = None
+     return cflags
+@@ -573,10 +580,11 @@ class XcodeSettings(object):
+     for rpath in self._Settings().get('LD_RUNPATH_SEARCH_PATHS', []):
+       ldflags.append('-Wl,-rpath,' + rpath)
+ 
+-    config = self.spec['configurations'][self.configname]
+-    framework_dirs = config.get('mac_framework_dirs', [])
+-    for directory in framework_dirs:
+-      ldflags.append('-F' + directory.replace('$(SDKROOT)', self._SdkPath()))
++    if self._SdkPath():
++      config = self.spec['configurations'][self.configname]
++      framework_dirs = config.get('mac_framework_dirs', [])
++      for directory in framework_dirs:
++        ldflags.append('-F' + directory.replace('$(SDKROOT)', self._SdkPath()))
+ 
+     self.configname = None
+     return ldflags
+@@ -701,7 +709,10 @@ class XcodeSettings(object):
+         l = '-l' + m.group(1)
+       else:
+         l = library
+-    return l.replace('$(SDKROOT)', self._SdkPath())
++    if self._SdkPath():
++      return l.replace('$(SDKROOT)', self._SdkPath())
++    else:
++      return l
+ 
+   def AdjustLibraries(self, libraries):
+     """Transforms entries like 'Cocoa.framework' in libraries into entries like