mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-16 18:37:04 +03:00
buildNodePackage: Move dependency symlinks out of the top-level node_modules directory
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
ea7f862aeb
commit
8247806090
@ -1,15 +1,18 @@
|
||||
{ stdenv, runCommand, nodejs, neededNatives}:
|
||||
|
||||
args @ { src, deps ? [], flags ? [], ... }:
|
||||
args @ { name, src, deps ? [], flags ? [], ... }:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let npmFlags = concatStringsSep " " (map (v: "--${v}") flags);
|
||||
sources = runCommand "node-sources" {} ''
|
||||
tar xf ${nodejs.src}
|
||||
mv *node* $out
|
||||
'';
|
||||
let
|
||||
npmFlags = concatStringsSep " " (map (v: "--${v}") flags);
|
||||
|
||||
sources = runCommand "node-sources" {} ''
|
||||
tar xf ${nodejs.src}
|
||||
mv *node* $out
|
||||
'';
|
||||
|
||||
requireName = (builtins.parseDrvName name).name;
|
||||
in
|
||||
stdenv.mkDerivation ({
|
||||
unpackPhase = "true";
|
||||
@ -34,8 +37,10 @@ stdenv.mkDerivation ({
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir $out
|
||||
mv node_modules $out
|
||||
mkdir -p $out/node_modules
|
||||
mv node_modules/${requireName} $out/node_modules
|
||||
mv node_modules/.bin $out/node_modules 2>/dev/null || true
|
||||
mv node_modules $out/node_modules/${requireName}
|
||||
if [ -d "$out/node_modules/.bin" ]; then
|
||||
ln -sv node_modules/.bin $out/bin
|
||||
find -L $out/node_modules/.bin/* -type f -print0 | \
|
||||
|
Loading…
Reference in New Issue
Block a user