Merge pull request #35116 from adisbladis/nodejs-update-script

nodejs: Add update script
This commit is contained in:
adisbladis
2018-03-06 15:35:14 +08:00
committed by GitHub
4 changed files with 833 additions and 1 deletions

View File

@@ -1,11 +1,14 @@
{ stdenv, fetchurl, openssl, python2, zlib, libuv, utillinux, http-parser
, pkgconfig, which
# Updater dependencies
, writeScript, coreutils, gnugrep, jq, curl, common-updater-scripts, nix
, gnupg
, darwin ? null
}:
with stdenv.lib;
{ enableNpm ? true, version, sha256, patches }:
{ enableNpm ? true, version, sha256, patches } @args:
let
@@ -59,6 +62,8 @@ in
setupHook = ./setup-hook.sh;
pos = builtins.unsafeGetAttrPos "version" args;
inherit patches;
preBuild = optionalString stdenv.isDarwin ''
@@ -84,6 +89,12 @@ in
cp -r ${concatStringsSep " " copyLibHeaders} $out/include/node
'';
passthru.updateScript = import ./update.nix {
inherit writeScript coreutils gnugrep jq curl common-updater-scripts gnupg nix;
inherit (stdenv) lib;
majorVersion = with stdenv.lib; elemAt (splitString "." version) 0;
};
meta = {
description = "Event-driven I/O framework for the V8 JavaScript engine";
homepage = https://nodejs.org;