From f2f7ea87e8e97e20ea21b8125eda3d6845ebcdcb Mon Sep 17 00:00:00 2001 From: Ivan Trubach Date: Tue, 4 Jun 2024 07:13:46 +0300 Subject: [PATCH] nodejs: fix impure configure phase When running configurePhase from impure build environment (i.e. nix develop), default ./configure script was selecting wrong, impure Python installation. https://github.com/nodejs/node/blob/d57af10d1be390f4e33e6efe596133de9da36c86/configure#L7-L15 --- pkgs/development/web/nodejs/nodejs.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 106eaabd1e62..8abca9d24ca4 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -60,8 +60,6 @@ let NIX_CFLAGS_COMPILE = "-D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=101300"; }; - CC_host = "cc"; - CXX_host = "c++"; depsBuildBuild = [ buildPackages.stdenv.cc openssl libuv zlib icu ]; # NB: technically, we do not need bash in build inputs since all scripts are @@ -106,6 +104,11 @@ let dontDisableStatic = true; + configureScript = writeScript "nodejs-configure" '' + export CC_host="$CC_FOR_BUILD" CXX_host="$CXX_FOR_BUILD" + exec ${python.executable} configure.py "$@" + ''; + enableParallelBuilding = true; # Don't allow enabling content addressed conversion as `nodejs`