From 4356d0ccce176b8e13f4dd0a1a6a31cd88486b8f Mon Sep 17 00:00:00 2001 From: Stacey Touset Date: Fri, 29 Jan 2016 17:51:21 -0800 Subject: [PATCH] nodejs: fix Darwin build - Add no-xcode patch back into node v5. Reverts some of 5cb1e43fd6eb7f87c9b17e9dc6d1a92ae7c360a4 - Fix patch to apply correctly - Remove pkg-libpath patch from v4 --- pkgs/development/web/nodejs/no-xcode.patch | 14 +------------- pkgs/development/web/nodejs/pkg-libpath.patch | 13 ------------- pkgs/development/web/nodejs/v4.nix | 2 +- pkgs/development/web/nodejs/v5.nix | 3 +++ 4 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 pkgs/development/web/nodejs/pkg-libpath.patch diff --git a/pkgs/development/web/nodejs/no-xcode.patch b/pkgs/development/web/nodejs/no-xcode.patch index 4754432ba4ab..27c9774ee6b1 100644 --- a/pkgs/development/web/nodejs/no-xcode.patch +++ b/pkgs/development/web/nodejs/no-xcode.patch @@ -1,5 +1,5 @@ diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py -index c002b11..eeb0400 100644 +index 407ead0..8bf64e7 100644 --- a/tools/gyp/pylib/gyp/xcode_emulation.py +++ b/tools/gyp/pylib/gyp/xcode_emulation.py @@ -446,10 +446,16 @@ class XcodeSettings(object): @@ -55,15 +55,3 @@ index c002b11..eeb0400 100644 is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() if sdk_root and is_extension: -@@ -1032,7 +1040,10 @@ class XcodeSettings(object): - sdk_root = self._SdkPath(config_name) - if not sdk_root: - sdk_root = '' -- return l.replace('$(SDKROOT)', sdk_root) -+ if self._SdkPath(): -+ return l.replace('$(SDKROOT)', sdk_root) -+ else: -+ return l - - def AdjustLibraries(self, libraries, config_name=None): - """Transforms entries like 'Cocoa.framework' in libraries into entries like diff --git a/pkgs/development/web/nodejs/pkg-libpath.patch b/pkgs/development/web/nodejs/pkg-libpath.patch deleted file mode 100644 index 8ad94c0e3e2f..000000000000 --- a/pkgs/development/web/nodejs/pkg-libpath.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/configure b/configure -index d199975..66d903b 100755 ---- a/configure -+++ b/configure -@@ -734,7 +734,7 @@ def configure_library(lib, output): - # libpath needs to be provided ahead libraries - if pkg_libpath: - output['libraries'] += ( -- filter(None, map(str.strip, pkg_cflags.split('-L')))) -+ pkg_libpath.split()) - - default_libs = getattr(options, shared_lib + '_libname') - default_libs = map('-l{0}'.format, default_libs.split(',')) diff --git a/pkgs/development/web/nodejs/v4.nix b/pkgs/development/web/nodejs/v4.nix index ad13d108803f..4d2db8c666cd 100644 --- a/pkgs/development/web/nodejs/v4.nix +++ b/pkgs/development/web/nodejs/v4.nix @@ -41,7 +41,7 @@ in stdenv.mkDerivation { sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' tools/gyp/pylib/gyp/xcode_emulation.py ''; - patches = stdenv.lib.optionals stdenv.isDarwin [ ./no-xcode.patch ./pkg-libpath.patch ]; + patches = stdenv.lib.optionals stdenv.isDarwin [ ./no-xcode.patch ]; postFixup = '' sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' $out/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py diff --git a/pkgs/development/web/nodejs/v5.nix b/pkgs/development/web/nodejs/v5.nix index 5c6fc9f644b7..ef91e95a630f 100644 --- a/pkgs/development/web/nodejs/v5.nix +++ b/pkgs/development/web/nodejs/v5.nix @@ -38,8 +38,11 @@ in stdenv.mkDerivation { dontDisableStatic = true; prePatch = '' patchShebangs . + sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' tools/gyp/pylib/gyp/xcode_emulation.py ''; + patches = stdenv.lib.optionals stdenv.isDarwin [ ./no-xcode.patch ]; + buildInputs = [ python which zlib libuv openssl python ] ++ optionals stdenv.isLinux [ utillinux http-parser ] ++ optionals stdenv.isDarwin [ pkgconfig openssl libtool ];