nodePackages: meguca: use node2nix 1.6.0

This commit is contained in:
Okina Matara 2018-06-30 19:58:14 -05:00
parent 82a501d92f
commit 70acec8ae5
7 changed files with 4919 additions and 3635 deletions

View File

@ -1,8 +1,8 @@
# This file has been generated by node2nix 1.5.3. Do not edit!
# This file has been generated by node2nix 1.6.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-4_x"}:
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-10_x"}:
let
nodeEnv = import ./node-env.nix {

View File

@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.5.3. Do not edit!
# This file has been generated by node2nix 1.6.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;

View File

@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.5.3. Do not edit!
# This file has been generated by node2nix 1.6.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;

View File

@ -27,7 +27,7 @@ let
buildInputs = [ nodejs ];
buildPhase = ''
export HOME=$TMPDIR
tgzFile=$(npm pack)
tgzFile=$(npm pack | tail -n 1) # Hooks to the pack command will add output (https://docs.npmjs.com/misc/scripts)
'';
installPhase = ''
mkdir -p $out/tarballs
@ -309,31 +309,42 @@ let
};
# Builds and composes an NPM package including all its dependencies
buildNodePackage = { name, packageName, version, dependencies ? [], production ? true, npmFlags ? "", dontNpmInstall ? false, bypassCache ? false, preRebuild ? "", ... }@args:
buildNodePackage =
{ name
, packageName
, version
, dependencies ? []
, buildInputs ? []
, production ? true
, npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, preRebuild ? ""
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, ... }@args:
let
forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" ];
in
stdenv.lib.makeOverridable stdenv.mkDerivation (builtins.removeAttrs args [ "dependencies" ] // {
stdenv.mkDerivation ({
name = "node-${name}-${version}";
buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ args.buildInputs or [];
dontStrip = args.dontStrip or true; # Striping may fail a build for some package deployments
++ buildInputs;
inherit dontNpmInstall preRebuild;
unpackPhase = args.unpackPhase or "true";
buildPhase = args.buildPhase or "true";
inherit dontStrip; # Stripping may fail a build for some package deployments
inherit dontNpmInstall preRebuild unpackPhase buildPhase;
compositionScript = composePackage args;
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
passAsFile = [ "compositionScript" "pinpointDependenciesScript" ];
installPhase = args.installPhase or ''
installPhase = ''
# Create and enter a root node_modules/ folder
mkdir -p $out/lib/node_modules
cd $out/lib/node_modules
@ -406,27 +417,47 @@ let
# Run post install hook, if provided
runHook postInstall
'';
});
} // extraArgs);
# Builds a development shell
buildNodeShell = { name, packageName, version, src, dependencies ? [], production ? true, npmFlags ? "", dontNpmInstall ? false, bypassCache ? false, ... }@args:
buildNodeShell =
{ name
, packageName
, version
, src
, dependencies ? []
, buildInputs ? []
, production ? true
, npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, ... }@args:
let
forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
nodeDependencies = stdenv.mkDerivation {
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ];
nodeDependencies = stdenv.mkDerivation ({
name = "node-dependencies-${name}-${version}";
buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ args.buildInputs or [];
++ buildInputs;
inherit dontStrip; # Stripping may fail a build for some package deployments
inherit dontNpmInstall unpackPhase buildPhase;
includeScript = includeDependencies { inherit dependencies; };
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
passAsFile = [ "includeScript" "pinpointDependenciesScript" ];
buildCommand = ''
installPhase = ''
mkdir -p $out/${packageName}
cd $out/${packageName}
@ -438,13 +469,15 @@ let
${stdenv.lib.optionalString bypassCache ''
if [ -f ${src}/package-lock.json ]
then
cp ${src}/package-lock.json .
cp ${src}/package-lock.json .
fi
''}
# Pinpoint the versions of all dependencies to the ones that are actually being used
echo "pinpointing versions of dependencies..."
cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
source $pinpointDependenciesScriptPath
cd ${packageName}
@ -474,15 +507,17 @@ let
''}
cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
mv ${packageName} lib
ln -s $out/lib/node_modules/.bin $out/bin
'';
};
} // extraArgs);
in
stdenv.lib.makeOverridable stdenv.mkDerivation {
stdenv.mkDerivation {
name = "node-shell-${name}-${version}";
buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ args.buildInputs or [];
buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
buildCommand = ''
mkdir -p $out/bin
cat > $out/bin/shell <<EOF
@ -500,4 +535,8 @@ let
'';
};
in
{ inherit buildNodeSourceDist buildNodePackage buildNodeShell; }
{
buildNodeSourceDist = stdenv.lib.makeOverridable buildNodeSourceDist;
buildNodePackage = stdenv.lib.makeOverridable buildNodePackage;
buildNodeShell = stdenv.lib.makeOverridable buildNodeShell;
}

View File

@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.5.3. Do not edit!
# This file has been generated by node2nix 1.6.0. Do not edit!
{nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}:
@ -10,7 +10,7 @@ let
version = "1.1.1";
src = fetchurl {
url = "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz";
sha512 = "38s4f3id97wsb0rg9nm9zvxyq0nvwrmrpa5dzvrkp36mf5ibs98b4z6lvsbrwzzs0sbcank6c7gpp06vcwp9acfhp41rzlhi3ybsxwy";
sha512 = "nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==";
};
};
"balanced-match-1.0.0" = {
@ -28,7 +28,7 @@ let
version = "1.1.11";
src = fetchurl {
url = "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz";
sha512 = "248cnpbbf0p32h53rd3g8wzpgrkaj4p078ra1g6l16f82i6bzkvmhwqan5rk88apbll9ly1476kngd7f7z27i3b3zxpbb3064f8yaw8";
sha512 = "iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==";
};
};
"concat-map-0.0.1" = {
@ -91,7 +91,7 @@ let
version = "3.0.4";
src = fetchurl {
url = "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz";
sha512 = "1879a3j85h92ypvb7lpv1dqpcxl49rqnbgs5la18zmj1yqhwl60c2m74254wbr5pp3znckqpkg9dvjyrz6hfz8b9vag5a3j910db4f8";
sha512 = "yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==";
};
};
"nopt-3.0.6" = {
@ -157,7 +157,7 @@ in
license = "MIT";
};
production = true;
bypassCache = false;
bypassCache = true;
};
coffee-script = nodeEnv.buildNodePackage {
name = "coffee-script";
@ -165,7 +165,7 @@ in
version = "1.12.7";
src = fetchurl {
url = "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz";
sha512 = "29mq40padyvizg4f141b00p0p74hx9v06d7gxk84ggsiyw6rf5bb65gnfwk1i02r276jwqybmi5hx98s943slyazjnqd69jmj389dvw";
sha512 = "fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==";
};
buildInputs = globalBuildInputs;
meta = {
@ -174,7 +174,7 @@ in
license = "MIT";
};
production = true;
bypassCache = false;
bypassCache = true;
};
grunt-cli = nodeEnv.buildNodePackage {
name = "grunt-cli";
@ -185,43 +185,21 @@ in
sha1 = "562b119ebb069ddb464ace2845501be97b35b6a8";
};
dependencies = [
(sources."findup-sync-0.3.0" // {
dependencies = [
(sources."glob-5.0.15" // {
dependencies = [
(sources."inflight-1.0.6" // {
dependencies = [
sources."wrappy-1.0.2"
];
})
sources."inherits-2.0.3"
(sources."minimatch-3.0.4" // {
dependencies = [
(sources."brace-expansion-1.1.11" // {
dependencies = [
sources."balanced-match-1.0.0"
sources."concat-map-0.0.1"
];
})
];
})
(sources."once-1.4.0" // {
dependencies = [
sources."wrappy-1.0.2"
];
})
sources."path-is-absolute-1.0.1"
];
})
];
})
sources."abbrev-1.1.1"
sources."balanced-match-1.0.0"
sources."brace-expansion-1.1.11"
sources."concat-map-0.0.1"
sources."findup-sync-0.3.0"
sources."glob-5.0.15"
sources."grunt-known-options-1.1.0"
(sources."nopt-3.0.6" // {
dependencies = [
sources."abbrev-1.1.1"
];
})
sources."inflight-1.0.6"
sources."inherits-2.0.3"
sources."minimatch-3.0.4"
sources."nopt-3.0.6"
sources."once-1.4.0"
sources."path-is-absolute-1.0.1"
sources."resolve-1.1.7"
sources."wrappy-1.0.2"
];
buildInputs = globalBuildInputs;
meta = {
@ -230,6 +208,6 @@ in
license = "MIT";
};
production = true;
bypassCache = false;
bypassCache = true;
};
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff