forked from mirrors/nixpkgs
Added setup hook that adds a Node package automatically to NODE_PATH, if included in the buildInputs parameter
This commit is contained in:
parent
805b7783d4
commit
c89187cc3c
|
@ -32,6 +32,8 @@ stdenv.mkDerivation rec {
|
|||
|
||||
buildInputs = [ python openssl v8 zlib ] ++ stdenv.lib.optional stdenv.isLinux utillinux;
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Event-driven I/O framework for the V8 JavaScript engine";
|
||||
homepage = http://nodejs.org;
|
||||
|
|
5
pkgs/development/web/nodejs/setup-hook.sh
Normal file
5
pkgs/development/web/nodejs/setup-hook.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
addNodePath () {
|
||||
addToSearchPath NODE_PATH $1/node_modules
|
||||
}
|
||||
|
||||
envHooks=(${envHooks[@]} addNodePath)
|
Loading…
Reference in a new issue