Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a6549852e829
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 18c2b52314f9
Choose a head ref
  • 1 commit
  • 25 files changed
  • 1 contributor

Commits on Jun 5, 2019

  1. node2nix: 1.6.0 -> 1.7.0 and regenerate all Nix expressions, introduc…

    …e nodePackages_12_x attribute set
    svanderburg committed Jun 5, 2019
    Copy the full SHA
    18c2b52 View commit details
Showing with 2,815 additions and 3,203 deletions.
  1. +1 −1 pkgs/development/node-packages/composition-v10.nix
  2. +17 −0 pkgs/development/node-packages/composition-v12.nix
  3. +1 −1 pkgs/development/node-packages/composition-v8.nix
  4. +16 −0 pkgs/development/node-packages/default-v12.nix
  5. +0 −23 pkgs/development/node-packages/default-v6.nix
  6. +1 −0 pkgs/development/node-packages/generate.sh
  7. +75 −77 pkgs/development/node-packages/node-env.nix
  8. +948 −750 pkgs/development/node-packages/node-packages-v10.nix
  9. +6 −0 pkgs/development/node-packages/node-packages-v12.json
  10. +475 −318 pkgs/development/node-packages/{node-packages-v6.nix → node-packages-v12.nix}
  11. +0 −9 pkgs/development/node-packages/node-packages-v6.json
  12. +35 −24 pkgs/development/node-packages/node-packages-v8.nix
  13. +217 −1,170 pkgs/development/web/remarkjs/node-packages.nix
  14. +1 −1 pkgs/development/web/remarkjs/nodepkgs.nix
  15. +22 −21 pkgs/misc/base16-builder/node-packages-generated.nix
  16. +1 −1 pkgs/misc/base16-builder/node-packages.nix
  17. +30 −22 pkgs/servers/web-apps/codimd/CodeMirror/node-packages.nix
  18. +2 −2 pkgs/servers/web-apps/codimd/CodeMirror/node.nix
  19. +920 −736 pkgs/servers/web-apps/codimd/node-packages.nix
  20. +2 −2 pkgs/servers/web-apps/codimd/node.nix
  21. +37 −42 pkgs/tools/networking/airfield/node-packages.nix
  22. +1 −1 pkgs/tools/networking/airfield/node.nix
  23. +1 −1 pkgs/tools/package-management/nixui/nixui.nix
  24. +2 −1 pkgs/tools/package-management/nixui/node-packages.nix
  25. +4 −0 pkgs/top-level/all-packages.nix
2 changes: 1 addition & 1 deletion pkgs/development/node-packages/composition-v10.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.6.0. Do not edit!
# This file has been generated by node2nix 1.7.0. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
17 changes: 17 additions & 0 deletions pkgs/development/node-packages/composition-v12.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file has been generated by node2nix 1.7.0. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:

let
nodeEnv = import ./node-env.nix {
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages-v12.nix {
inherit (pkgs) fetchurl fetchgit;
inherit nodeEnv;
}
2 changes: 1 addition & 1 deletion pkgs/development/node-packages/composition-v8.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.6.0. Do not edit!
# This file has been generated by node2nix 1.7.0. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
16 changes: 16 additions & 0 deletions pkgs/development/node-packages/default-v12.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ pkgs, nodejs, stdenv }:

let
nodePackages = import ./composition-v12.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
};
in
nodePackages // {
node2nix = nodePackages.node2nix.override {
buildInputs = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram "$out/bin/node2nix" --prefix PATH : ${stdenv.lib.makeBinPath [ pkgs.nix ]}
'';
};
}
23 changes: 0 additions & 23 deletions pkgs/development/node-packages/default-v6.nix

This file was deleted.

1 change: 1 addition & 0 deletions pkgs/development/node-packages/generate.sh
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@ set -eu -o pipefail
rm -f node-env.nix
node2nix -8 -i node-packages-v8.json -o node-packages-v8.nix -c composition-v8.nix
node2nix --nodejs-10 -i node-packages-v10.json -o node-packages-v10.nix -c composition-v10.nix
node2nix --nodejs-12 -i node-packages-v12.json -o node-packages-v12.nix -c composition-v12.nix
152 changes: 75 additions & 77 deletions pkgs/development/node-packages/node-env.nix
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ let
cat > $out/bin/tar <<EOF
#! ${stdenv.shell} -e
$(type -p tar) "\$@" --warning=no-unknown-keyword
$(type -p tar) "\$@" --warning=no-unknown-keyword --delay-directory-restore
EOF
chmod +x $out/bin/tar
@@ -72,7 +72,7 @@ let
packageDir="$(find . -maxdepth 1 -type d | tail -1)"
# Restore write permissions to make building work
find "$packageDir" -type d -print0 | xargs -0 chmod u+x
find "$packageDir" -type d -exec chmod u+x {} \;
chmod -R u+w "$packageDir"
# Move the extracted tarball into the output folder
@@ -219,7 +219,16 @@ let
packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads.
}
packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories.
if(dependency.resolved) {
packageObj["_resolved"] = dependency.resolved; // Adopt the resolved property if one has been provided
} else {
packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories.
}
if(dependency.from !== undefined) { // Adopt from property if one has been provided
packageObj["_from"] = dependency.from;
}
fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2));
}
@@ -308,6 +317,61 @@ let
'';
};

prepareAndInvokeNPM = {packageName, bypassCache, reconstructLock, npmFlags, production}:
let
forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
in
''
# Pinpoint the versions of all dependencies to the ones that are actually being used
echo "pinpointing versions of dependencies..."
source $pinpointDependenciesScriptPath
# Patch the shebangs of the bundled modules to prevent them from
# calling executables outside the Nix store as much as possible
patchShebangs .
# Deploy the Node.js package by running npm install. Since the
# dependencies have been provided already by ourselves, it should not
# attempt to install them again, which is good, because we want to make
# it Nix's responsibility. If it needs to install any dependencies
# anyway (e.g. because the dependency parameters are
# incomplete/incorrect), it fails.
#
# The other responsibilities of NPM are kept -- version checks, build
# steps, postprocessing etc.
export HOME=$TMPDIR
cd "${packageName}"
runHook preRebuild
${stdenv.lib.optionalString bypassCache ''
${stdenv.lib.optionalString reconstructLock ''
if [ -f package-lock.json ]
then
echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!"
echo "This will most likely result in version mismatches! We will remove the lock file and regenerate it!"
rm package-lock.json
else
echo "No package-lock.json file found, reconstructing..."
fi
node ${reconstructPackageLock}
''}
node ${addIntegrityFieldsScript}
''}
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
if [ "$dontNpmInstall" != "1" ]
then
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
rm -f npm-shrinkwrap.json
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
fi
'';

# Builds and composes an NPM package including all its dependencies
buildNodePackage =
{ name
@@ -319,18 +383,18 @@ let
, npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, reconstructLock ? 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.mkDerivation ({
name = "node-${name}-${version}";
name = "node_${name}-${version}";
buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
@@ -352,47 +416,7 @@ let
# Compose the package and all its dependencies
source $compositionScriptPath
# Pinpoint the versions of all dependencies to the ones that are actually being used
echo "pinpointing versions of dependencies..."
source $pinpointDependenciesScriptPath
# Patch the shebangs of the bundled modules to prevent them from
# calling executables outside the Nix store as much as possible
patchShebangs .
# Deploy the Node.js package by running npm install. Since the
# dependencies have been provided already by ourselves, it should not
# attempt to install them again, which is good, because we want to make
# it Nix's responsibility. If it needs to install any dependencies
# anyway (e.g. because the dependency parameters are
# incomplete/incorrect), it fails.
#
# The other responsibilities of NPM are kept -- version checks, build
# steps, postprocessing etc.
export HOME=$TMPDIR
cd "${packageName}"
runHook preRebuild
${stdenv.lib.optionalString bypassCache ''
if [ ! -f package-lock.json ]
then
echo "No package-lock.json file found, reconstructing..."
node ${reconstructPackageLock}
fi
node ${addIntegrityFieldsScript}
''}
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
if [ "$dontNpmInstall" != "1" ]
then
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
rm -f npm-shrinkwrap.json
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
fi
${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}
# Create symlink to the deployed executable folder, if applicable
if [ -d "$out/lib/node_modules/.bin" ]
@@ -431,14 +455,13 @@ let
, npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, reconstructLock ? false
, 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" ];

nodeDependencies = stdenv.mkDerivation ({
@@ -473,39 +496,13 @@ let
fi
''}
# Pinpoint the versions of all dependencies to the ones that are actually being used
echo "pinpointing versions of dependencies..."
# Go to the parent folder to make sure that all packages are pinpointed
cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
source $pinpointDependenciesScriptPath
cd ${packageName}
# Patch the shebangs of the bundled modules to prevent them from
# calling executables outside the Nix store as much as possible
patchShebangs .
export HOME=$PWD
${stdenv.lib.optionalString bypassCache ''
if [ ! -f package-lock.json ]
then
echo "No package-lock.json file found, reconstructing..."
node ${reconstructPackageLock}
fi
node ${addIntegrityFieldsScript}
''}
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
${stdenv.lib.optionalString (!dontNpmInstall) ''
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
rm -f npm-shrinkwrap.json
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
''}
${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}
# Expose the executables that were installed
cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
@@ -532,6 +529,7 @@ let
inherit nodeDependencies;
shellHook = stdenv.lib.optionalString (dependencies != []) ''
export NODE_PATH=$nodeDependencies/lib/node_modules
export PATH="$nodeDependencies/bin:$PATH"
'';
};
in
Loading