From d9dc4b0a0752aa26cece191e1ca6f7ef3b01210e Mon Sep 17 00:00:00 2001 From: Ivan Trubach Date: Sun, 18 Jun 2023 01:20:53 +0300 Subject: [PATCH] nodejs: patch shebangs for shell scripts when cross-compiling --- pkgs/development/web/nodejs/nodejs.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 7af19b39db05..b0e032abc495 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, openssl, python, zlib, libuv, util-linux, http-parser +{ lib, stdenv, fetchurl, openssl, python, zlib, libuv, util-linux, http-parser, runtimeShellPackage , pkg-config, which, buildPackages # for `.pkgs` attribute , callPackage @@ -55,6 +55,7 @@ let depsBuildBuild = [ buildPackages.stdenv.cc openssl libuv zlib ]; buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ] + ++ lib.optional isCross runtimeShellPackage # for patchShebangs ++ [ zlib libuv openssl http-parser icu ]; nativeBuildInputs = [ which pkg-config python ] @@ -132,7 +133,7 @@ let checkFlags = [ "PYTHONDONTWRITEBYTECODE=1" ]; postInstall = '' - HOST_PATH=$out/bin''${HOST_PATH:+:$HOST_PATH} patchShebangs --host $out + HOST_PATH=$out/bin patchShebangs --host $out ${lib.optionalString (enableNpm) '' mkdir -p $out/share/bash-completion/completions