Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update nodePackages with node2nix 1.10.0 #146440

Closed
wants to merge 8 commits into from
Closed
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.9.0. Do not edit!
# This file has been generated by node2nix 1.10.0. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
Expand Down
31 changes: 20 additions & 11 deletions pkgs/applications/version-management/commitizen/node-env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ let
''
+ (lib.concatMapStrings (dependency:
''
if [ ! -e "${dependency.name}" ]; then
if [ ! -e "${dependency.packageName}" ]; then
${composePackage dependency}
fi
''
Expand Down Expand Up @@ -257,8 +257,8 @@ let
var packageLock = JSON.parse(fs.readFileSync("./package-lock.json"));

if(![1, 2].includes(packageLock.lockfileVersion)) {
process.stderr.write("Sorry, I only understand lock file versions 1 and 2!\n");
process.exit(1);
process.stderr.write("Sorry, I only understand lock file versions 1 and 2!\n");
process.exit(1);
}

if(packageLock.dependencies !== undefined) {
Expand Down Expand Up @@ -390,7 +390,7 @@ let
buildNodePackage =
{ name
, packageName
, version
, version ? null
, dependencies ? []
, buildInputs ? []
, production ? true
Expand All @@ -409,7 +409,7 @@ let
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" "meta" ];
in
stdenv.mkDerivation ({
name = "${name}-${version}";
name = "${name}${if version == null then "" else "-${version}"}";
buildInputs = [ tarWrapper python nodejs ]
++ lib.optional (stdenv.isLinux) utillinux
++ lib.optional (stdenv.isDarwin) libtool
Expand Down Expand Up @@ -441,6 +441,14 @@ let
if [ -d "$out/lib/node_modules/.bin" ]
then
ln -s $out/lib/node_modules/.bin $out/bin

# Patch the shebang lines of all the executables
ls $out/bin/* | while read i
do
file="$(readlink -f "$i")"
chmod u+rwx "$file"
patchShebangs "$file"
done
fi

# Create symlinks to the deployed manual page folders, if applicable
Expand Down Expand Up @@ -471,7 +479,7 @@ let
buildNodeDependencies =
{ name
, packageName
, version
, version ? null
, src
, dependencies ? []
, buildInputs ? []
Expand All @@ -489,7 +497,7 @@ let
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ];
in
stdenv.mkDerivation ({
name = "node-dependencies-${name}-${version}";
name = "node-dependencies-${name}${if version == null then "" else "-${version}"}";

buildInputs = [ tarWrapper python nodejs ]
++ lib.optional (stdenv.isLinux) utillinux
Expand Down Expand Up @@ -541,7 +549,7 @@ let
buildNodeShell =
{ name
, packageName
, version
, version ? null
, src
, dependencies ? []
, buildInputs ? []
Expand All @@ -557,9 +565,10 @@ let

let
nodeDependencies = buildNodeDependencies args;
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "unpackPhase" "buildPhase" ];
in
stdenv.mkDerivation {
name = "node-shell-${name}-${version}";
stdenv.mkDerivation ({
name = "node-shell-${name}${if version == null then "" else "-${version}"}";

buildInputs = [ python nodejs ] ++ lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
buildCommand = ''
Expand All @@ -578,7 +587,7 @@ let
export NODE_PATH=${nodeDependencies}/lib/node_modules
export PATH="${nodeDependencies}/bin:$PATH"
'';
};
} // extraArgs);
in
{
buildNodeSourceDist = lib.makeOverridable buildNodeSourceDist;
Expand Down
934 changes: 468 additions & 466 deletions pkgs/applications/version-management/commitizen/node-packages.nix

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkgs/development/misc/google-clasp/google-clasp.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.9.0. Do not edit!
# This file has been generated by node2nix 1.10.0. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
Expand Down
Loading