nodejs: refactor generic build function

This removes some duplicated and dead code across the different versions of
nodejs.
This commit is contained in:
Mathias Schreck
2017-11-01 01:25:13 +01:00
committed by Robin Gloster
parent 9ac793f860
commit ccbcf15c8e
6 changed files with 56 additions and 106 deletions

View File

@@ -1,19 +1,11 @@
{ stdenv, fetchurl, openssl, python2, zlib, libuv, v8, utillinux, http-parser
, pkgconfig, runCommand, which, libtool, fetchpatch
, callPackage
, darwin ? null
, enableNpm ? true
}@args:
{ stdenv, callPackage, lib, enableNpm ? true }:
let
nodejs = import ./nodejs.nix args;
baseName = if enableNpm then "nodejs" else "nodejs-slim";
buildNodejs = callPackage ./nodejs.nix {};
in
stdenv.mkDerivation (nodejs // rec {
buildNodejs {
inherit enableNpm;
version = "6.11.5";
name = "${baseName}-${version}";
src = fetchurl {
url = "https://nodejs.org/download/release/v${version}/node-v${version}.tar.xz";
sha256 = "1bwakrvy0if5spbymwpb05qwrb47xwzlnc42rapgp6b744ay8v8w";
};
})
sha256 = "1bwakrvy0if5spbymwpb05qwrb47xwzlnc42rapgp6b744ay8v8w";
patches = lib.optionals stdenv.isDarwin [ ./no-xcode.patch ];
}