Merge pull request #89184 from mayflower/continue-pull-85764

This commit is contained in:
Jörg Thalheim 2020-05-30 11:36:56 +01:00 committed by GitHub
commit 87908c3743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 4582 additions and 8877 deletions

View File

@ -12,10 +12,9 @@ When it is desired to use NPM libraries in a development project, use the
`node2nix` generator directly on the `package.json` configuration file of the `node2nix` generator directly on the `package.json` configuration file of the
project. project.
The package set also provides support for multiple Node.js versions. The policy The package set provides support for the official stable Node.js versions.
is that a new package should be added to the collection for the latest stable LTS The latest stable LTS release in `nodePackages`, as well as the latest stable
release (which is currently 10.x), unless there is an explicit reason to support Current release in `nodePackages_latest`.
a different release.
If your package uses native addons, you need to examine what kind of native If your package uses native addons, you need to examine what kind of native
build system it uses. Here are some examples: build system it uses. Here are some examples:
@ -26,7 +25,7 @@ build system it uses. Here are some examples:
After you have identified the correct system, you need to override your package After you have identified the correct system, you need to override your package
expression while adding in build system as a build input. For example, `dat` expression while adding in build system as a build input. For example, `dat`
requires `node-gyp-build`, so we override its expression in `default-v10.nix`: requires `node-gyp-build`, so we override its expression in `default.nix`:
```nix ```nix
dat = nodePackages.dat.override (oldAttrs: { dat = nodePackages.dat.override (oldAttrs: {
@ -36,14 +35,14 @@ dat = nodePackages.dat.override (oldAttrs: {
To add a package from NPM to nixpkgs: To add a package from NPM to nixpkgs:
1. Modify `pkgs/development/node-packages/node-packages-v10.json` to add, update 1. Modify `pkgs/development/node-packages/node-packages.json` to add, update
or remove package entries. (Or `pkgs/development/node-packages/node-packages-v8.json` or remove package entries to have it included in `nodePackages` and
for packages depending on Node.js 8.x) `nodePackages_latest`.
2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`. 2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`.
3. Build your new package to test your changes: 3. Build your new package to test your changes:
`cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`. `cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
To build against a specific Node.js version (e.g. 10.x): To build against the latest stable Current Node.js version (e.g. 14.x):
`nix-build -A nodePackages_10_x.<new-or-updated-package>` `nix-build -A nodePackages_latest.<new-or-updated-package>`
4. Add and commit all modified and generated files. 4. Add and commit all modified and generated files.
For more information about the generation process, consult the For more information about the generation process, consult the

View File

@ -13,7 +13,7 @@ rec {
buildApp = import ./build-app.nix { buildApp = import ./build-app.nix {
inherit (pkgs) stdenv python which file jdk nodejs; inherit (pkgs) stdenv python which file jdk nodejs;
inherit (pkgs.nodePackages_10_x) alloy titanium; inherit (pkgs.nodePackages) alloy titanium;
inherit (androidenv) composeAndroidPackages; inherit (androidenv) composeAndroidPackages;
inherit (xcodeenv) composeXcodeWrapper; inherit (xcodeenv) composeXcodeWrapper;
inherit titaniumsdk; inherit titaniumsdk;

View File

@ -1,17 +0,0 @@
# This file has been generated by node2nix 1.8.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-10_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-v10.nix {
inherit (pkgs) fetchurl fetchgit;
inherit nodeEnv;
}

View File

@ -1,17 +0,0 @@
# This file has been generated by node2nix 1.8.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-13_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-v13.nix {
inherit (pkgs) fetchurl fetchgit;
inherit nodeEnv;
}

View File

@ -11,7 +11,7 @@ let
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
}; };
in in
import ./node-packages-v12.nix { import ./node-packages.nix {
inherit (pkgs) fetchurl fetchgit; inherit (pkgs) fetchurl fetchgit;
inherit nodeEnv; inherit nodeEnv;
} }

View File

@ -1,16 +0,0 @@
{ 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 ]}
'';
};
}

View File

@ -1,16 +0,0 @@
{ pkgs, nodejs, stdenv }:
let
nodePackages = import ./composition-v13.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 ]}
'';
};
}

View File

@ -1,7 +1,9 @@
{ pkgs, nodejs, stdenv }: { pkgs, nodejs, stdenv }:
let let
nodePackages = import ./composition-v10.nix { since = (version: pkgs.lib.versionAtLeast nodejs.version version);
before = (version: pkgs.lib.versionOlder nodejs.version version);
nodePackages = import ./composition.nix {
inherit pkgs nodejs; inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system; inherit (stdenv.hostPlatform) system;
}; };
@ -21,12 +23,21 @@ nodePackages // {
''; '';
}; };
coc-imselect = nodePackages.coc-imselect.override {
meta.broken = since "10";
};
"fast-cli-1.x" = nodePackages."fast-cli-1.x".override {
meta.broken = since "10";
};
jshint = nodePackages.jshint.override { jshint = nodePackages.jshint.override {
buildInputs = [ pkgs.phantomjs2 ]; buildInputs = [ pkgs.phantomjs2 ];
}; };
dat = nodePackages.dat.override { dat = nodePackages.dat.override {
buildInputs = [ nodePackages.node-gyp-build pkgs.libtool pkgs.autoconf pkgs.automake ]; buildInputs = [ nodePackages.node-gyp-build pkgs.libtool pkgs.autoconf pkgs.automake ];
meta.broken = since "12";
}; };
dnschain = nodePackages.dnschain.override { dnschain = nodePackages.dnschain.override {
@ -34,6 +45,7 @@ nodePackages // {
postInstall = '' postInstall = ''
wrapProgram $out/bin/dnschain --suffix PATH : ${pkgs.openssl.bin}/bin wrapProgram $out/bin/dnschain --suffix PATH : ${pkgs.openssl.bin}/bin
''; '';
meta.broken = since "14";
}; };
bitwarden-cli = pkgs.lib.overrideDerivation nodePackages."@bitwarden/cli" (drv: { bitwarden-cli = pkgs.lib.overrideDerivation nodePackages."@bitwarden/cli" (drv: {
@ -48,6 +60,7 @@ nodePackages // {
ln -s /usr/bin/xcodebuild $tmp ln -s /usr/bin/xcodebuild $tmp
export PATH="$PATH:$tmp" export PATH="$PATH:$tmp"
''; '';
meta.platforms = [ pkgs.lib.platforms.darwin ];
}); });
fast-cli = nodePackages."fast-cli-1.x".override { fast-cli = nodePackages."fast-cli-1.x".override {
@ -60,14 +73,17 @@ nodePackages // {
git-ssb = nodePackages.git-ssb.override { git-ssb = nodePackages.git-ssb.override {
buildInputs = [ nodePackages.node-gyp-build ]; buildInputs = [ nodePackages.node-gyp-build ];
meta.broken = since "10";
}; };
insect = nodePackages.insect.override (drv: { insect = nodePackages.insect.override (drv: {
nativeBuildInputs = drv.nativeBuildInputs or [] ++ [ pkgs.psc-package pkgs.purescript nodePackages.pulp ]; nativeBuildInputs = drv.nativeBuildInputs or [] ++ [ pkgs.psc-package pkgs.purescript nodePackages.pulp ];
meta.broken = since "10";
}); });
node-inspector = nodePackages.node-inspector.override { node-inspector = nodePackages.node-inspector.override {
buildInputs = [ nodePackages.node-pre-gyp ]; buildInputs = [ nodePackages.node-pre-gyp ];
meta.broken = since "10";
}; };
node2nix = nodePackages.node2nix.override { node2nix = nodePackages.node2nix.override {
@ -77,6 +93,10 @@ nodePackages // {
''; '';
}; };
node-red = nodePackages.node-red.override {
meta.broken = since "10";
};
pnpm = nodePackages.pnpm.override { pnpm = nodePackages.pnpm.override {
nativeBuildInputs = [ pkgs.makeWrapper ]; nativeBuildInputs = [ pkgs.makeWrapper ];
@ -96,8 +116,13 @@ nodePackages // {
''; '';
}; };
pulp = nodePackages.pulp.override {
meta.broken = since "10";
};
ssb-server = nodePackages.ssb-server.override { ssb-server = nodePackages.ssb-server.override {
buildInputs = [ pkgs.automake pkgs.autoconf nodePackages.node-gyp-build ]; buildInputs = [ pkgs.automake pkgs.autoconf nodePackages.node-gyp-build ];
meta.broken = since "10";
}; };
tedicross = nodePackages."tedicross-git+https://github.com/TediCross/TediCross.git#v0.8.7".override { tedicross = nodePackages."tedicross-git+https://github.com/TediCross/TediCross.git#v0.8.7".override {
@ -108,6 +133,10 @@ nodePackages // {
''; '';
}; };
stf = nodePackages.stf.override {
meta.broken = since "10";
};
webtorrent-cli = nodePackages.webtorrent-cli.override { webtorrent-cli = nodePackages.webtorrent-cli.override {
buildInputs = [ nodePackages.node-gyp-build ]; buildInputs = [ nodePackages.node-gyp-build ];
}; };
@ -125,8 +154,5 @@ nodePackages // {
thelounge = nodePackages.thelounge.override { thelounge = nodePackages.thelounge.override {
buildInputs = [ nodePackages.node-pre-gyp ]; buildInputs = [ nodePackages.node-pre-gyp ];
postInstall = ''
echo /var/lib/thelounge > $out/lib/node_modules/thelounge/.thelounge_home
'';
}; };
} }

View File

@ -6,6 +6,4 @@ node2nix=$(nix-build ../../.. --no-out-link -A nodePackages.node2nix)
cd ${DIR} cd ${DIR}
rm -f ./node-env.nix rm -f ./node-env.nix
for version in 10 12 13; do ${node2nix}/bin/node2nix -i node-packages.json -o node-packages.nix -c composition.nix
"${node2nix}/bin/node2nix" --nodejs-$version -i node-packages-v$version.json -o node-packages-v$version.nix -c composition-v$version.nix
done

View File

@ -1,9 +0,0 @@
[
"coffee-script"
, "grunt-cli"
, "nijs"
, "node2nix"
, "node-gyp"
, "node-gyp-build"
, "node-pre-gyp"
]

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
[
"node2nix"
]

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
{ stdenv, nodePackages_10_x }: { stdenv, nodePackages }:
let let
linkNodeDeps = ({ pkg, deps, name ? "" }: linkNodeDeps = ({ pkg, deps, name ? "" }:
let let
targetModule = if name != "" then name else stdenv.lib.getName pkg; targetModule = if name != "" then name else stdenv.lib.getName pkg;
in nodePackages_10_x.${pkg}.override (oldAttrs: { in nodePackages.${pkg}.override (oldAttrs: {
postInstall = '' postInstall = ''
mkdir -p $out/lib/node_modules/${targetModule}/node_modules mkdir -p $out/lib/node_modules/${targetModule}/node_modules
${stdenv.lib.concatStringsSep "\n" (map (dep: '' ${stdenv.lib.concatStringsSep "\n" (map (dep: ''
ln -s ${nodePackages_10_x.${dep}}/lib/node_modules/${stdenv.lib.getName dep} \ ln -s ${nodePackages.${dep}}/lib/node_modules/${stdenv.lib.getName dep} \
$out/lib/node_modules/${targetModule}/node_modules/${stdenv.lib.getName dep} $out/lib/node_modules/${targetModule}/node_modules/${stdenv.lib.getName dep}
'') deps '') deps
)} )}

View File

@ -1,5 +1,5 @@
# Update script: pkgs/development/tools/rust/rust-analyzer/update.sh # Update script: pkgs/development/tools/rust/rust-analyzer/update.sh
{ lib, stdenv, vscode-utils, jq, rust-analyzer, nodePackages_10_x { lib, stdenv, vscode-utils, jq, rust-analyzer, nodePackages
, setDefaultServerPath ? true , setDefaultServerPath ? true
}: }:
@ -10,7 +10,7 @@ let
# Follow the unstable version of rust-analyzer, since the extension is not stable yet. # Follow the unstable version of rust-analyzer, since the extension is not stable yet.
inherit (rust-analyzer) version; inherit (rust-analyzer) version;
build-deps = nodePackages_10_x."rust-analyzer-build-deps-../../misc/vscode-extensions/rust-analyzer/build-deps"; build-deps = nodePackages."rust-analyzer-build-deps-../../misc/vscode-extensions/rust-analyzer/build-deps";
# FIXME: Making a new derivation to link `node_modules` and run `npm run package` # FIXME: Making a new derivation to link `node_modules` and run `npm run package`
# will cause a build failure. # will cause a build failure.
vsix = build-deps.override { vsix = build-deps.override {

View File

@ -4829,9 +4829,9 @@ in
nixnote2 = libsForQt5.callPackage ../applications/misc/nixnote2 { }; nixnote2 = libsForQt5.callPackage ../applications/misc/nixnote2 { };
nodejs = hiPrio nodejs-10_x; nodejs = hiPrio nodejs-12_x;
nodejs-slim = nodejs-slim-10_x; nodejs-slim = nodejs-slim-12_x;
nodejs-10_x = callPackage ../development/web/nodejs/v10.nix { }; nodejs-10_x = callPackage ../development/web/nodejs/v10.nix { };
@ -4855,20 +4855,14 @@ in
nodejs_latest = nodejs-14_x; nodejs_latest = nodejs-14_x;
nodejs-slim_latest = nodejs-slim-14_x; nodejs-slim_latest = nodejs-slim-14_x;
nodePackages_13_x = dontRecurseIntoAttrs (callPackage ../development/node-packages/default-v13.nix { nodePackages_latest = dontRecurseIntoAttrs (callPackage ../development/node-packages/default.nix {
nodejs = pkgs.nodejs-13_x; nodejs = pkgs.nodejs_latest;
}); });
nodePackages_12_x = dontRecurseIntoAttrs (callPackage ../development/node-packages/default-v12.nix { nodePackages = dontRecurseIntoAttrs (callPackage ../development/node-packages/default.nix {
nodejs = pkgs.nodejs-12_x; nodejs = pkgs.nodejs;
}); });
nodePackages_10_x = dontRecurseIntoAttrs (callPackage ../development/node-packages/default-v10.nix {
nodejs = pkgs.nodejs-10_x;
});
nodePackages = nodePackages_10_x;
now-cli = callPackage ../development/web/now-cli {}; now-cli = callPackage ../development/web/now-cli {};
file-rename = callPackage ../tools/filesystems/file-rename { }; file-rename = callPackage ../tools/filesystems/file-rename { };