diff options
Diffstat (limited to 'pkgs/development/web')
-rw-r--r-- | pkgs/development/web/nodejs/default-arch.patch | 24 | ||||
-rw-r--r-- | pkgs/development/web/nodejs/default.nix | 7 | ||||
-rw-r--r-- | pkgs/development/web/nodejs/no-xcode-4.1.0.patch | 95 | ||||
-rw-r--r-- | pkgs/development/web/nodejs/no-xcode.patch | 21 | ||||
-rw-r--r-- | pkgs/development/web/nodejs/pkg-libpath.patch | 13 | ||||
-rw-r--r-- | pkgs/development/web/nodejs/v0_10.nix | 2 | ||||
-rw-r--r-- | pkgs/development/web/nodejs/v4_1_0.nix | 53 |
7 files changed, 173 insertions, 42 deletions
diff --git a/pkgs/development/web/nodejs/default-arch.patch b/pkgs/development/web/nodejs/default-arch.patch deleted file mode 100644 index 3c7eb1014de..00000000000 --- a/pkgs/development/web/nodejs/default-arch.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Naur a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py ---- a/tools/gyp/pylib/gyp/xcode_emulation.py 2014-01-23 06:05:51.000000000 +0100 -+++ b/tools/gyp/pylib/gyp/xcode_emulation.py 2014-02-04 17:49:48.000000000 +0100 -@@ -1018,12 +1033,16 @@ - # Since the value returned by this function is only used when ARCHS is not - # set, then on iOS we return "i386", as the default xcode project generator - # does not set ARCHS if it is not set in the .gyp file. -- if self.isIOS: -+ -+ try: -+ if self.isIOS: -+ return 'i386' -+ version, build = self._XcodeVersion() -+ if version >= '0500': -+ return 'x86_64' - return 'i386' -- version, build = self._XcodeVersion() -- if version >= '0500': -+ except: - return 'x86_64' -- return 'i386' - - class MacPrefixHeader(object): - """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. diff --git a/pkgs/development/web/nodejs/default.nix b/pkgs/development/web/nodejs/default.nix index 2a4a7244d4d..1bd8dbec1e6 100644 --- a/pkgs/development/web/nodejs/default.nix +++ b/pkgs/development/web/nodejs/default.nix @@ -38,13 +38,12 @@ 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 ./pkg-libpath.patch ]; + patches = stdenv.lib.optional stdenv.isDarwin ./no-xcode.patch; - buildInputs = [ python which zlib libuv openssl python ] - ++ optionals stdenv.isLinux [ utillinux http-parser ] + buildInputs = [ python which http-parser zlib libuv openssl python ] + ++ (optional stdenv.isLinux utillinux) ++ optionals stdenv.isDarwin [ pkgconfig openssl libtool ]; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/web/nodejs/no-xcode-4.1.0.patch b/pkgs/development/web/nodejs/no-xcode-4.1.0.patch new file mode 100644 index 00000000000..137158b01b7 --- /dev/null +++ b/pkgs/development/web/nodejs/no-xcode-4.1.0.patch @@ -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] diff --git a/pkgs/development/web/nodejs/no-xcode.patch b/pkgs/development/web/nodejs/no-xcode.patch index 244a55e9aeb..e88168b68a7 100644 --- a/pkgs/development/web/nodejs/no-xcode.patch +++ b/pkgs/development/web/nodejs/no-xcode.patch @@ -70,3 +70,24 @@ diff -Naur a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_ def AdjustLibraries(self, libraries, config_name=None): """Transforms entries like 'Cocoa.framework' in libraries into entries like +@@ -1018,12 +1033,16 @@ + # Since the value returned by this function is only used when ARCHS is not + # set, then on iOS we return "i386", as the default xcode project generator + # does not set ARCHS if it is not set in the .gyp file. +- if self.isIOS: ++ ++ try: ++ if self.isIOS: ++ return 'i386' ++ version, build = self._XcodeVersion() ++ if version >= '0500': ++ return 'x86_64' + return 'i386' +- version, build = self._XcodeVersion() +- if version >= '0500': ++ except: + return 'x86_64' +- return 'i386' + + class MacPrefixHeader(object): + """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. diff --git a/pkgs/development/web/nodejs/pkg-libpath.patch b/pkgs/development/web/nodejs/pkg-libpath.patch deleted file mode 100644 index 8ad94c0e3e2..00000000000 --- 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/v0_10.nix b/pkgs/development/web/nodejs/v0_10.nix index a5ee621de34..838f1419f2c 100644 --- a/pkgs/development/web/nodejs/v0_10.nix +++ b/pkgs/development/web/nodejs/v0_10.nix @@ -42,7 +42,7 @@ in stdenv.mkDerivation { patchShebangs . ''; - patches = stdenv.lib.optionals stdenv.isDarwin [ ./default-arch.patch ./no-xcode.patch ]; + patches = stdenv.lib.optional stdenv.isDarwin ./no-xcode.patch; postPatch = stdenv.lib.optionalString stdenv.isDarwin '' (cd tools/gyp; patch -Np1 -i ${../../python-modules/gyp/no-darwin-cflags.patch}) diff --git a/pkgs/development/web/nodejs/v4_1_0.nix b/pkgs/development/web/nodejs/v4_1_0.nix new file mode 100644 index 00000000000..de8fa5f6bd3 --- /dev/null +++ b/pkgs/development/web/nodejs/v4_1_0.nix @@ -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; + }; +} |