0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

buildNodePackage: Utilize the node setup hook

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-05-29 11:53:36 -04:00
parent 2f024a2ea9
commit d749196f68

View file

@ -26,7 +26,7 @@ stdenv.mkDerivation ({
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild
${nodejs}/bin/npm --registry http://www.example.com --nodedir=${sources} install ${src} ${npmFlags} npm --registry http://www.example.com --nodedir=${sources} install ${src} ${npmFlags}
runHook postBuild runHook postBuild
''; '';
@ -47,4 +47,10 @@ stdenv.mkDerivation ({
preFixup = '' preFixup = ''
find $out -type f -print0 | xargs -0 sed -i 's|${src}|${src.name}|g' find $out -type f -print0 | xargs -0 sed -i 's|${src}|${src.name}|g'
''; '';
} // args) } // args // {
# Run the node setup hook when this package is a build input
propagatedNativeBuildInputs = (args.propagatedNativeBuildInputs or []) ++ [ nodejs ];
# Make buildNodePackage useful with --run-env
nativeBuildInputs = (args.nativeBuildInputs or []) ++ deps;
} )