Ported to old no-xcode patch to the current nodejs, so that it can be built on Darwin again

+14 -27
+1 -1
pkgs/development/web/nodejs/default.nix
··· 52 52 homepage = http://nodejs.org; 53 53 license = licenses.mit; 54 54 maintainers = [ maintainers.goibhniu maintainers.shlevy ]; 55 - platforms = platforms.linux; 55 + platforms = platforms.linux ++ platforms.darwin; 56 56 }; 57 57 }
+13 -26
pkgs/development/web/nodejs/no-xcode.patch
··· 1 - diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py 2 - index 806f92b..5256856 100644 3 - --- a/tools/gyp/pylib/gyp/xcode_emulation.py 4 - +++ b/tools/gyp/pylib/gyp/xcode_emulation.py 5 - @@ -224,8 +224,7 @@ class XcodeSettings(object): 6 - 7 - def _GetSdkVersionInfoItem(self, sdk, infoitem): 8 - job = subprocess.Popen(['xcodebuild', '-version', '-sdk', sdk, infoitem], 9 - - stdout=subprocess.PIPE, 10 - - stderr=subprocess.STDOUT) 11 - + stdout=subprocess.PIPE) 12 - out = job.communicate()[0] 13 - if job.returncode != 0: 14 - sys.stderr.write(out + '\n') 15 - @@ -234,9 +233,17 @@ class XcodeSettings(object): 16 - 17 - def _SdkPath(self): 18 - sdk_root = self.GetPerTargetSetting('SDKROOT', default='macosx') 19 - + if sdk_root.startswith('/'): 20 - + return sdk_root 1 + diff -Naur a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py 2 + --- a/tools/gyp/pylib/gyp/xcode_emulation.py 2013-11-12 21:22:12.000000000 +0100 3 + +++ b/tools/gyp/pylib/gyp/xcode_emulation.py 2013-12-17 11:07:11.000000000 +0100 4 + @@ -285,8 +285,15 @@ 5 + if sdk_root.startswith('/'): 6 + return sdk_root 21 7 if sdk_root not in XcodeSettings._sdk_path_cache: 22 8 - XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem( 23 9 - sdk_root, 'Path') ··· 29 15 + # the user is probably on a CLT-only system, where there 30 16 + # is no valid SDK root 31 17 + XcodeSettings._sdk_path_cache[sdk_root] = None 18 + + 32 19 return XcodeSettings._sdk_path_cache[sdk_root] 33 20 34 21 def _AppendPlatformVersionMinFlags(self, lst): 35 - @@ -339,10 +346,11 @@ class XcodeSettings(object): 22 + @@ -397,10 +404,11 @@ 36 23 37 24 cflags += self._Settings().get('WARNING_CFLAGS', []) 38 25 ··· 48 35 49 36 self.configname = None 50 37 return cflags 51 - @@ -572,10 +580,11 @@ class XcodeSettings(object): 38 + @@ -647,10 +655,11 @@ 52 39 for rpath in self._Settings().get('LD_RUNPATH_SEARCH_PATHS', []): 53 40 ldflags.append('-Wl,-rpath,' + rpath) 54 41 ··· 64 51 65 52 self.configname = None 66 53 return ldflags 67 - @@ -700,7 +709,10 @@ class XcodeSettings(object): 54 + @@ -826,7 +835,10 @@ 68 55 l = '-l' + m.group(1) 69 56 else: 70 57 l = library 71 - - return l.replace('$(SDKROOT)', self._SdkPath()) 58 + - return l.replace('$(SDKROOT)', self._SdkPath(config_name)) 72 59 + if self._SdkPath(): 73 - + return l.replace('$(SDKROOT)', self._SdkPath()) 60 + + return l.replace('$(SDKROOT)', self._SdkPath(config_name)) 74 61 + else: 75 62 + return l 76 63 77 - def AdjustLibraries(self, libraries): 64 + def AdjustLibraries(self, libraries, config_name=None): 78 65 """Transforms entries like 'Cocoa.framework' in libraries into entries like