From e6a86e65d94ecbec0ec72901d542d1506101fa53 Mon Sep 17 00:00:00 2001 From: Mathias Schreck Date: Tue, 23 Oct 2018 21:22:50 +0200 Subject: [PATCH] nodejs-11_x: init at 11.5.0 --- pkgs/development/web/nodejs/nodejs.nix | 10 +++++++--- pkgs/development/web/nodejs/v11.nix | 10 ++++++++++ pkgs/top-level/all-packages.nix | 7 +++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/web/nodejs/v11.nix diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index a9c08e1c5b732..c0ba92ad44171 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -12,12 +12,16 @@ with stdenv.lib; { enableNpm ? true, version, sha256, patches ? [] } @args: let - inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; + majorVersion = versions.major version; + minorVersion = versions.minor version; + baseName = if enableNpm then "nodejs" else "nodejs-slim"; - sharedLibDeps = { inherit openssl zlib libuv; } // (optionalAttrs (!stdenv.isDarwin) { inherit http-parser; }); + useSharedHttpParser = !stdenv.isDarwin && versionOlder "${majorVersion}.${minorVersion}" "11.4"; + + sharedLibDeps = { inherit openssl zlib libuv; } // (optionalAttrs useSharedHttpParser { inherit http-parser; }); sharedConfigureFlags = concatMap (name: [ "--shared-${name}" @@ -103,7 +107,7 @@ in passthru.updateScript = import ./update.nix { inherit stdenv writeScript coreutils gnugrep jq curl common-updater-scripts gnupg nix; inherit (stdenv) lib; - majorVersion = with stdenv.lib; elemAt (splitString "." version) 0; + inherit majorVersion; }; meta = { diff --git a/pkgs/development/web/nodejs/v11.nix b/pkgs/development/web/nodejs/v11.nix new file mode 100644 index 0000000000000..b5ff17a67a100 --- /dev/null +++ b/pkgs/development/web/nodejs/v11.nix @@ -0,0 +1,10 @@ +{ stdenv, callPackage, lib, openssl, enableNpm ? true }: + +let + buildNodejs = callPackage ./nodejs.nix { inherit openssl; }; +in + buildNodejs { + inherit enableNpm; + version = "11.5.0"; + sha256 = "07fdpl8wzkcdd8iyaiwf2ah1rgishk2hrl0g73i8aggwplrl69fx"; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7082c1ff536a7..aa8de55e8466c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3875,6 +3875,13 @@ in enableNpm = false; openssl = openssl_1_1; }; + nodejs-11_x = callPackage ../development/web/nodejs/v11.nix { + openssl = openssl_1_1; + }; + nodejs-slim-11_x = callPackage ../development/web/nodejs/v11.nix { + enableNpm = false; + openssl = openssl_1_1; + }; nodePackages_10_x = callPackage ../development/node-packages/default-v10.nix { nodejs = pkgs.nodejs-10_x;