diff options
author | Tobias Pflug <tobias.pflug@gmail.com> | 2016-11-02 17:46:01 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-11-02 17:46:01 +0100 |
commit | a5dad8aeeb3bc006646e736ae36277a610b5ed22 (patch) | |
tree | cea9ac5b544ab0b36402a8fe2e998d159e0ee039 /pkgs/development/web/nodejs/v6.nix | |
parent | a890d1765b628efd675cbfb0568eb5d479659578 (diff) | |
download | nixpkgs-a5dad8aeeb3bc006646e736ae36277a610b5ed22.tar nixpkgs-a5dad8aeeb3bc006646e736ae36277a610b5ed22.tar.gz nixpkgs-a5dad8aeeb3bc006646e736ae36277a610b5ed22.tar.bz2 nixpkgs-a5dad8aeeb3bc006646e736ae36277a610b5ed22.tar.lz nixpkgs-a5dad8aeeb3bc006646e736ae36277a610b5ed22.tar.xz nixpkgs-a5dad8aeeb3bc006646e736ae36277a610b5ed22.tar.zst nixpkgs-a5dad8aeeb3bc006646e736ae36277a610b5ed22.zip |
nodejs: refactor derivations (#19973)
* refactor and clean up the derivation composition * add slim variation: the slim variations configure node without npm. Building node with npm introduces a python runtime depndency through gyp - slim variation makes sense for building small nodejs production images
Diffstat (limited to 'pkgs/development/web/nodejs/v6.nix')
-rw-r--r-- | pkgs/development/web/nodejs/v6.nix | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/pkgs/development/web/nodejs/v6.nix b/pkgs/development/web/nodejs/v6.nix index a2213546ec4..50bd2cb672e 100644 --- a/pkgs/development/web/nodejs/v6.nix +++ b/pkgs/development/web/nodejs/v6.nix @@ -2,24 +2,27 @@ , pkgconfig, runCommand, which, libtool, fetchpatch , callPackage , darwin ? null +, enableNpm ? true }@args: let - inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; + nodejs = import ./nodejs.nix args; + baseName = if enableNpm then "nodejs" else "nodejs-slim"; +in + stdenv.mkDerivation (nodejs // rec { + version = "6.8.0"; + name = "${baseName}-${version}"; + src = fetchurl { + url = "https://nodejs.org/download/release/v${version}/node-v${version}.tar.xz"; + sha256 = "13arzwki13688hr1lh871y06lrk019g4hkasmg11arm8j1dcwcpq"; + }; + + patches = nodejs.patches ++ [ + (fetchpatch { + url = "https://github.com/nodejs/node/commit/fc164acbbb700fd50ab9c04b47fc1b2687e9c0f4.patch"; + sha256 = "1rms3n09622xmddn013yvf5c6p3s8w8s0d2h813zs8c1l15k4k1i"; + }) + ]; + + }) -in import ./nodejs.nix (args // rec { - version = "6.8.0"; - sha256 = "13arzwki13688hr1lh871y06lrk019g4hkasmg11arm8j1dcwcpq"; - extraBuildInputs = stdenv.lib.optionals stdenv.isDarwin - [ CoreServices ApplicationServices ]; - preBuild = stdenv.lib.optionalString stdenv.isDarwin '' - sed -i -e "s|tr1/type_traits|type_traits|g" \ - -e "s|std::tr1|std|" src/util.h - ''; - patches = [ - (fetchpatch { - url = "https://github.com/nodejs/node/commit/fc164acbbb700fd50ab9c04b47fc1b2687e9c0f4.patch"; - sha256 = "1rms3n09622xmddn013yvf5c6p3s8w8s0d2h813zs8c1l15k4k1i"; - }) - ]; -}) |