1 { callPackage, lib, overrideCC, pkgs, buildPackages, fetchpatch, openssl, python3, enableNpm ? true }:
4 # Clang 16+ cannot build Node v18 due to -Wenum-constexpr-conversion errors.
5 # Use an older version of clang with the current libc++ for compatibility (e.g., with icu).
6 ensureCompatibleCC = packages:
7 if packages.stdenv.cc.isClang && lib.versionAtLeast (lib.getVersion packages.stdenv.cc.cc) "16"
8 then overrideCC packages.llvmPackages_15.stdenv (packages.llvmPackages_15.stdenv.cc.override {
9 inherit (packages.llvmPackages) libcxx;
13 buildNodejs = callPackage ./nodejs.nix {
15 stdenv = ensureCompatibleCC pkgs;
16 buildPackages = buildPackages // { stdenv = ensureCompatibleCC buildPackages; };
23 sha256 = "sha256-iq6nycfpJ/sJ2RSY2jEbbk0YIzOQ4jxyOlO4kfrUxz8=";
25 ./disable-darwin-v8-system-instrumentation.patch
26 ./bypass-darwin-xcrun-node16.patch
27 ./revert-arm64-pointer-auth.patch
28 ./node-npm-build-npm-package-logic.patch
29 ./trap-handler-backport.patch