diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2016-11-27 16:34:26 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2016-11-27 16:34:26 +0300 |
commit | 3b67986ff5be490588c00d9b8d3f17a10f3d5e2e (patch) | |
tree | d465ca2ca41adcbdfaff6f90c1961e57780c0664 | |
parent | 4b1804cc57038b1c82c56974a2fe3d53cea7d458 (diff) | |
download | nixsap-3b67986ff5be490588c00d9b8d3f17a10f3d5e2e.tar.gz |
NodeJS: init at 6.9.1 (LTS)
-rw-r--r-- | modules/pkgs/nodejs/default.nix | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/modules/pkgs/nodejs/default.nix b/modules/pkgs/nodejs/default.nix new file mode 100644 index 0000000..a21aaea --- /dev/null +++ b/modules/pkgs/nodejs/default.nix @@ -0,0 +1,57 @@ +{ fetchurl, http-parser, libuv, openssl, python, stdenv, + utillinux, v8, which, zlib }: + +let + + deps = { + inherit openssl zlib libuv http-parser; + }; + + sharedConfigureFlags = name: [ + "--shared-${name}" + "--shared-${name}-includes=${builtins.getAttr name deps}/include" + "--shared-${name}-libpath=${builtins.getAttr name deps}/lib" + ]; + + inherit (stdenv.lib) concatMap licenses ; + +in stdenv.mkDerivation rec { + + version = "6.9.1"; + name = "nodejs-${version}"; + + src = fetchurl { + url = "https://nodejs.org/download/release/v${version}/node-v${version}.tar.xz"; + sha256 = "0a87vzb33xdg8w0xi3c605hfav3c9m4ylab1436whz3p0l9qvp8b"; + }; + + configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps) ++ [ "--without-dtrace" ]; + dontDisableStatic = true; + + postInstall = '' + PATH=$out/bin:$PATH patchShebangs $out + ''; + + buildInputs = + [ http-parser libuv openssl python utillinux which + zlib ]; + + setupHook = builtins.toFile "nodejs-setup-hook" '' + addNodePath () { + addToSearchPath NODE_PATH $1/lib/node_modules + } + + envHooks+=(addNodePath) + ''; + + enableParallelBuilding = true; + + passthru.interpreterName = "nodejs"; + + meta = { + description = "Event-driven I/O framework for the V8 JavaScript engine"; + homepage = http://nodejs.org; + license = licenses.mit; + }; +} + |