From 81165aa69e7b2ceee26cc60df5255797739b1d58 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 20 Oct 2022 04:20:00 +0000 Subject: [PATCH] nodejs-19_x: init at 19.0.0 https://github.com/nodejs/node/releases/tag/v19.0.0 --- ...win-v8-system-instrumentation-node19.patch | 16 ++++++++++++ pkgs/development/web/nodejs/nodejs.nix | 2 +- pkgs/development/web/nodejs/v19.nix | 25 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 8 ++++-- 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/web/nodejs/disable-darwin-v8-system-instrumentation-node19.patch create mode 100644 pkgs/development/web/nodejs/v19.nix diff --git a/pkgs/development/web/nodejs/disable-darwin-v8-system-instrumentation-node19.patch b/pkgs/development/web/nodejs/disable-darwin-v8-system-instrumentation-node19.patch new file mode 100644 index 000000000000..5d56af784973 --- /dev/null +++ b/pkgs/development/web/nodejs/disable-darwin-v8-system-instrumentation-node19.patch @@ -0,0 +1,16 @@ +Disable v8 system instrumentation on Darwin + +On Darwin, the v8 system instrumentation requires the header "os/signpost.h" +which is available since apple_sdk 11+. See: https://github.com/nodejs/node/issues/39584 + +--- old/tools/v8_gypfiles/features.gypi ++++ new/tools/v8_gypfiles/features.gypi +@@ -62,7 +62,7 @@ + }, { + 'is_component_build': 0, + }], +- ['OS == "win" or OS == "mac"', { ++ ['OS == "win"', { + # Sets -DENABLE_SYSTEM_INSTRUMENTATION. Enables OS-dependent event tracing + 'v8_enable_system_instrumentation': 1, + }, { diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 6d9a3392a7a9..27bc3edb276f 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -67,7 +67,7 @@ let configureFlags = let isCross = stdenv.hostPlatform != stdenv.buildPlatform; inherit (stdenv.hostPlatform) gcc isAarch32; - in sharedConfigureFlags ++ [ + in sharedConfigureFlags ++ optionals (versionOlder version "19") [ "--without-dtrace" ] ++ (optionals isCross [ "--cross-compiling" diff --git a/pkgs/development/web/nodejs/v19.nix b/pkgs/development/web/nodejs/v19.nix new file mode 100644 index 000000000000..cb34e1c919d8 --- /dev/null +++ b/pkgs/development/web/nodejs/v19.nix @@ -0,0 +1,25 @@ +{ callPackage, openssl, fetchpatch, python3, enableNpm ? true }: + +let + buildNodejs = callPackage ./nodejs.nix { + inherit openssl; + python = python3; + }; +in +buildNodejs { + inherit enableNpm; + version = "19.0.0"; + sha256 = "sha256-C3LSB6WBXxznskezPL+aLIb20BJT+jmQyXROJdl1BQ0="; + patches = [ + (fetchpatch { + # Fixes cross compilation to aarch64-linux by reverting https://github.com/nodejs/node/pull/43200 + name = "revert-arm64-pointer-auth.patch"; + url = "https://github.com/nodejs/node/pull/43200/commits/d42c42cc8ac652ab387aa93205aed6ece8a5040a.patch"; + sha256 = "sha256-ipGzg4lEoftTJbt6sW+0QJO/AZqHvUkFKe0qlum+iLY="; + revert = true; + }) + + ./disable-darwin-v8-system-instrumentation-node19.patch + ./bypass-darwin-xcrun-node16.patch + ]; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b0a70f3eec31..7a3ba45e037e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8691,9 +8691,13 @@ with pkgs; nodejs-slim-18_x = callPackage ../development/web/nodejs/v18.nix { enableNpm = false; }; + nodejs-19_x = callPackage ../development/web/nodejs/v19.nix { }; + nodejs-slim-19_x = callPackage ../development/web/nodejs/v19.nix { + enableNpm = false; + }; # Update this when adding the newest nodejs major version! - nodejs_latest = nodejs-18_x; - nodejs-slim_latest = nodejs-slim-18_x; + nodejs_latest = nodejs-19_x; + nodejs-slim_latest = nodejs-slim-19_x; nodePackages_latest = dontRecurseIntoAttrs nodejs_latest.pkgs;