summary refs log tree commit diff
path: root/pkgs/development/web/nodejs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/web/nodejs')
-rw-r--r--pkgs/development/web/nodejs/bypass-xcodebuild.diff28
-rw-r--r--pkgs/development/web/nodejs/nodejs.nix24
-rw-r--r--pkgs/development/web/nodejs/v10.nix9
-rw-r--r--pkgs/development/web/nodejs/v12.nix11
-rw-r--r--pkgs/development/web/nodejs/v14.nix8
-rw-r--r--pkgs/development/web/nodejs/v16.nix13
6 files changed, 68 insertions, 25 deletions
diff --git a/pkgs/development/web/nodejs/bypass-xcodebuild.diff b/pkgs/development/web/nodejs/bypass-xcodebuild.diff
new file mode 100644
index 00000000000..5c900dd2143
--- /dev/null
+++ b/pkgs/development/web/nodejs/bypass-xcodebuild.diff
@@ -0,0 +1,28 @@
+diff -Naur node-v12.18.4/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py node-v12.18.4-new/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
+--- node-v12.18.4/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py	2020-09-15 09:08:46.000000000 +0200
++++ node-v12.18.4-new/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py	2020-12-03 16:55:43.781860687 +0100
+@@ -436,7 +436,14 @@
+     # Since the CLT has no SDK paths anyway, returning None is the
+     # most sensible route and should still do the right thing.
+     try:
+-      return GetStdoutQuiet(['xcodebuild', '-version', '-sdk', sdk, infoitem])
++      # Return fake data that xcodebuild would normally return
++
++      xcodedata = {
++        "Path": "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk",
++        "ProductBuildVersion": "19A547",
++        "ProductVersion": "10.15"
++      }
++      return xcodedata[infoitem]
+     except GypError:
+       pass
+ 
+@@ -1271,7 +1278,7 @@
+   version = ""
+   build = ""
+   try:
+-    version_list = GetStdoutQuiet(['xcodebuild', '-version']).splitlines()
++    version_list = []
+     # In some circumstances xcodebuild exits 0 but doesn't return
+     # the right results; for example, a user on 10.7 or 10.8 with
+     # a bogus path set via xcode-select
diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix
index 12754b6d441..0e52dd5f804 100644
--- a/pkgs/development/web/nodejs/nodejs.nix
+++ b/pkgs/development/web/nodejs/nodejs.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, openssl, python, zlib, libuv, utillinux, http-parser
-, pkgconfig, which
+{ lib, stdenv, fetchurl, openssl, python, zlib, libuv, util-linux, http-parser
+, pkg-config, which
 # Updater dependencies
 , writeScript, coreutils, gnugrep, jq, curl, common-updater-scripts, nix, runtimeShell
 , gnupg
@@ -7,7 +7,7 @@
 , procps, icu
 }:
 
-with stdenv.lib;
+with lib;
 
 { enableNpm ? true, version, sha256, patches ? [] } @args:
 
@@ -28,7 +28,7 @@ let
     "--shared-${name}-libpath=${getLib sharedLibDeps.${name}}/lib"
     /** Closure notes: we explicitly avoid specifying --shared-*-includes,
      *  as that would put the paths into bin/nodejs.
-     *  Including pkgconfig in build inputs would also have the same effect!
+     *  Including pkg-config in build inputs would also have the same effect!
      */
   ]) (builtins.attrNames sharedLibDeps) ++ [
     "--with-intl=system-icu"
@@ -55,23 +55,22 @@ in
     buildInputs = optionals stdenv.isDarwin [ CoreServices ApplicationServices ]
       ++ [ zlib libuv openssl http-parser icu ];
 
-    nativeBuildInputs = [ which utillinux pkgconfig python ]
+    nativeBuildInputs = [ which pkg-config python ]
       ++ optionals stdenv.isDarwin [ xcbuild ];
 
     configureFlags = let
       isCross = stdenv.hostPlatform != stdenv.buildPlatform;
-      host = stdenv.hostPlatform.platform;
-      isAarch32 = stdenv.hostPlatform.isAarch32;
+      inherit (stdenv.hostPlatform) gcc isAarch32;
     in sharedConfigureFlags ++ [
       "--without-dtrace"
     ] ++ (optionals isCross [
       "--cross-compiling"
       "--without-intl"
       "--without-snapshot"
-    ]) ++ (optionals (isCross && isAarch32 && hasAttr "fpu" host.gcc) [
-      "--with-arm-fpu=${host.gcc.fpu}"
-    ]) ++ (optionals (isCross && isAarch32 && hasAttr "float-abi" host.gcc) [
-      "--with-arm-float-abi=${host.gcc.float-abi}"
+    ]) ++ (optionals (isCross && isAarch32 && hasAttr "fpu" gcc) [
+      "--with-arm-fpu=${gcc.fpu}"
+    ]) ++ (optionals (isCross && isAarch32 && hasAttr "float-abi" gcc) [
+      "--with-arm-float-abi=${gcc.float-abi}"
     ]) ++ (optionals (isCross && isAarch32) [
       "--dest-cpu=arm"
     ]) ++ extraConfigFlags;
@@ -133,7 +132,7 @@ in
 
     passthru.updateScript = import ./update.nix {
       inherit writeScript coreutils gnugrep jq curl common-updater-scripts gnupg nix runtimeShell;
-      inherit (stdenv) lib;
+      inherit lib;
       inherit majorVersion;
     };
 
@@ -143,6 +142,7 @@ in
       license = licenses.mit;
       maintainers = with maintainers; [ goibhniu gilligan cko marsam ];
       platforms = platforms.linux ++ platforms.darwin;
+      mainProgram = "node";
     };
 
     passthru.python = python; # to ensure nodeEnv uses the same version
diff --git a/pkgs/development/web/nodejs/v10.nix b/pkgs/development/web/nodejs/v10.nix
index 4cd2502f196..5c107b20f4a 100644
--- a/pkgs/development/web/nodejs/v10.nix
+++ b/pkgs/development/web/nodejs/v10.nix
@@ -1,13 +1,14 @@
-{ callPackage, openssl, icu, python2, enableNpm ? true }:
+{ callPackage, openssl, icu, python2, lib, stdenv, enableNpm ? true }:
 
 let
-  buildNodejs = callPackage ./nodejs.nix { 
+  buildNodejs = callPackage ./nodejs.nix {
     inherit openssl icu;
     python = python2;
   };
 in
   buildNodejs {
     inherit enableNpm;
-    version = "10.22.0";
-    sha256 = "1nz18fa550li10r0kzsm28c2rvvq61nq8bqdygip0rmvbi2paxg0";
+    version = "10.24.1";
+    sha256 = "032801kg24j04xmf09m0vxzlcz86sv21s24lv9l4cfv08k1c4byp";
+    patches = lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff;
   }
diff --git a/pkgs/development/web/nodejs/v12.nix b/pkgs/development/web/nodejs/v12.nix
index 571042b73c2..cfd6c211ab5 100644
--- a/pkgs/development/web/nodejs/v12.nix
+++ b/pkgs/development/web/nodejs/v12.nix
@@ -1,13 +1,14 @@
-{ callPackage, openssl, icu, python2, enableNpm ? true }:
+{ callPackage, icu68, python2, lib, stdenv, enableNpm ? true }:
 
 let
-  buildNodejs = callPackage ./nodejs.nix { 
-    inherit openssl icu;
+  buildNodejs = callPackage ./nodejs.nix {
+    icu = icu68;
     python = python2;
   };
 in
   buildNodejs {
     inherit enableNpm;
-    version = "12.18.3";
-    sha256 = "03hdds6ghlmbz8q61alqj18pdnyd6hxmbhiws4pl51wlawk805bi";
+    version = "12.22.3";
+    sha256 = "143ihn30jd08nk19saxn6qp3ldc9yvy8w338i4cg9256wgx120im";
+    patches = lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff;
   }
diff --git a/pkgs/development/web/nodejs/v14.nix b/pkgs/development/web/nodejs/v14.nix
index b3daab5000c..ad6c8aacddc 100644
--- a/pkgs/development/web/nodejs/v14.nix
+++ b/pkgs/development/web/nodejs/v14.nix
@@ -1,13 +1,13 @@
-{ callPackage, openssl, python3, enableNpm ? true }:
+{ callPackage, python3, lib, stdenv, enableNpm ? true }:
 
 let
   buildNodejs = callPackage ./nodejs.nix {
-    inherit openssl;
     python = python3;
   };
 in
   buildNodejs {
     inherit enableNpm;
-    version = "14.8.0";
-    sha256 = "0vghz7g7mih7idgknwzdc2zfw82qqq497m727ydhkas1wvj6i7lv";
+    version = "14.17.3";
+    sha256 = "0j3zd5vavsapqs9h682mr8r5i7xp47n0w4vjvm8rw3rn3dg4p2sb";
+    patches = lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff;
   }
diff --git a/pkgs/development/web/nodejs/v16.nix b/pkgs/development/web/nodejs/v16.nix
new file mode 100644
index 00000000000..766df734a4a
--- /dev/null
+++ b/pkgs/development/web/nodejs/v16.nix
@@ -0,0 +1,13 @@
+{ callPackage, openssl, python3, enableNpm ? true }:
+
+let
+  buildNodejs = callPackage ./nodejs.nix {
+    inherit openssl;
+    python = python3;
+  };
+in
+  buildNodejs {
+    inherit enableNpm;
+    version = "16.5.0";
+    sha256 = "16dapj5pm2y1m3ldrjjlz8rq9axk85nn316iz02nk6qjs66y6drz";
+  }