add nodejs-4.1.0

This commit is contained in:
Jude Taylor 2015-09-23 16:13:29 -07:00
parent d3f4ba9d6f
commit e7605dd08b
4 changed files with 155 additions and 1 deletions

View file

@ -109,4 +109,5 @@ in
mapAttrs (v: h: mkWithAutotools stable (toVersion v) h) {
v1_2_0 = "1nbp8qpgw64gl9nrjzxw0ndv1m64cfms0cy5a2883vw6877kizmx";
v1_6_1 = "10w9pjbmqcv03v04rnjd8mdh886j7v4y0svdsdklz69zskgdvvqg";
v1_7_5 = "18x6cy2xn31am97vn6jli7kmb2fbp4c8kmv7jm97vggh0x55flsc";
}

View file

@ -0,0 +1,95 @@
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/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
index c002b11..fefb765 100644
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py
@@ -446,10 +446,17 @@ class XcodeSettings(object):
def _XcodeSdkPath(self, sdk_root):
if sdk_root not in XcodeSettings._sdk_path_cache:
- sdk_path = self._GetSdkVersionInfoItem(sdk_root, '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, '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):
@@ -572,10 +579,12 @@ class XcodeSettings(object):
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
@@ -826,10 +835,12 @@ class XcodeSettings(object):
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))
is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension()
if sdk_root and is_extension:
@@ -1032,7 +1043,11 @@ 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
@@ -1248,7 +1263,7 @@ def XcodeVersion():
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]

View file

@ -0,0 +1,53 @@
{ stdenv, fetchurl, openssl, python, zlib, libuv, v8, utillinux, http-parser
, pkgconfig, runCommand, which, libtool
}:
let
version = "4.1.0";
deps = {
inherit openssl zlib libuv;
# disabled system v8 because v8 3.14 no longer receives security fixes
# we fall back to nodejs' internal v8 copy which receives backports for now
# inherit v8
} // (stdenv.lib.optionalAttrs (!stdenv.isDarwin) {
inherit http-parser;
});
inherit (stdenv.lib) concatMap optional optionals maintainers licenses platforms;
in stdenv.mkDerivation {
name = "nodejs-${version}";
src = fetchurl {
url = "http://nodejs.org/dist/v${version}/node-v${version}.tar.gz";
sha256 = "025lqmhvl7xpx1ip97jwkz21a97sw9zb4zi3y7fgfag59vv0ac25";
};
configureFlags = map (name: "--shared-${name}") (builtins.attrNames deps) ++ [ "--without-dtrace" ];
dontDisableStatic = true;
prePatch = ''
patchShebangs .
'';
patches = stdenv.lib.optional stdenv.isDarwin ./no-xcode-4.1.0.patch;
buildInputs = [ python which ] ++ (builtins.attrValues deps)
++ optional stdenv.isLinux utillinux
++ optionals stdenv.isDarwin [ openssl libtool ];
setupHook = ./setup-hook.sh;
enableParallelBuilding = true;
passthru.interpreterName = "nodejs";
meta = {
description = "Event-driven I/O framework for the V8 JavaScript engine";
homepage = http://nodejs.org;
license = licenses.mit;
maintainers = [ maintainers.goibhniu maintainers.havvy ];
platforms = platforms.linux ++ platforms.darwin;
};
}

View file

@ -2006,6 +2006,11 @@ let
ninka = callPackage ../development/tools/misc/ninka { };
nodejs-4_1 = callPackage ../development/web/nodejs/v4_1_0.nix {
libuv = libuvVersions.v1_7_5;
openssl = openssl_1_0_2;
};
nodejs-0_12 = callPackage ../development/web/nodejs {
libuv = libuvVersions.v1_6_1;
};
@ -2019,8 +2024,8 @@ let
else
nodejs-0_12;
nodePackages_4_1 = recurseIntoAttrs (callPackage ./node-packages.nix { self = nodePackages_4_1; nodejs = nodejs-4_1; });
nodePackages_0_12 = callPackage ./node-packages.nix { self = nodePackages_0_12; nodejs = nodejs-0_12; };
nodePackages_0_10 = callPackage ./node-packages.nix { self = nodePackages_0_10; nodejs = nodejs-0_10; };
nodePackages = if stdenv.system == "armv5tel-linux" then