Merge pull request #334377 from dotlambda/node-gyp

node-gyp: init at 10.2.0
This commit is contained in:
Doron Behar 2024-08-16 15:34:47 +00:00 committed by GitHub
commit 24a76db073
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 5112 additions and 170 deletions

View File

@ -6,7 +6,7 @@
nodejs,
pnpm,
python3,
nodePackages,
node-gyp,
cacert,
xcbuild,
libkrb5,
@ -34,7 +34,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
pnpm.configHook
python3 # required to build sqlite3 bindings
nodePackages.node-gyp # required to build sqlite3 bindings
node-gyp # required to build sqlite3 bindings
cacert # required for rustls-native-certs (dependency of turbo build tool)
makeWrapper
] ++ lib.optional stdenv.isDarwin [ xcbuild ];

5034
pkgs/by-name/no/node-gyp/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,41 @@
{
buildNpmPackage,
fetchFromGitHub,
lib,
nodejs,
}:
(buildNpmPackage.override { inherit nodejs; }) rec {
pname = "node-gyp";
version = "10.2.0";
src = fetchFromGitHub {
owner = "nodejs";
repo = "node-gyp";
rev = "refs/tags/v${version}";
hash = "sha256-AxyGE86nuU9VkbLLR/8GKM6bcTgayYodQ0mWiQhQtA0=";
};
npmDepsHash = "sha256-LCm1gF7GfjT13k3fe1A+DNNwP48OtFVbYgwCCLH3eHA=";
postPatch = ''
ln -s ${./package-lock.json} package-lock.json
'';
dontNpmBuild = true;
# Teach node-gyp to use nodejs headers locally rather that download them form https://nodejs.org.
# This is important when build nodejs packages in sandbox.
makeWrapperArgs = [ "--set npm_config_nodedir ${nodejs}" ];
passthru.updateScript = ./update.sh;
meta = {
changelog = "https://github.com/nodejs/node-gyp/blob/${src.rev}/CHANGELOG.md";
description = "Node.js native addon build tool";
homepage = "https://github.com/nodejs/node-gyp";
license = lib.licenses.mit;
mainProgram = "node-gyp";
maintainers = with lib.maintainers; [ dotlambda ];
};
}

View File

@ -0,0 +1,26 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p gnused jq nix-prefetch-github nodejs prefetch-npm-deps wget
set -euo pipefail
pushd "$(dirname "${BASH_SOURCE[0]}")"
version=$(npm view node-gyp version)
if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
echo "Already up to date!"
exit 0
fi
sed -i 's#version = "[^"]*"#version = "'"$version"'"#' package.nix
src_hash=$(nix-prefetch-github nodejs node-gyp --rev "v$version" | jq --raw-output .hash)
sed -i 's#hash = "[^"]*"#hash = "'"$src_hash"'"#' package.nix
rm -f package-lock.json package.json
wget "https://github.com/nodejs/node-gyp/raw/v$version/package.json"
npm i --package-lock-only --ignore-scripts
npm_hash=$(prefetch-npm-deps package-lock.json)
sed -i 's#npmDepsHash = "[^"]*"#npmDepsHash = "'"$npm_hash"'"#' package.nix
rm package.json
popd

View File

@ -8,7 +8,7 @@
, Security
, AppKit
, pkg-config
, nodePackages
, node-gyp
, runCommand
, vscode-js-debug
, nix-update-script
@ -29,7 +29,7 @@ buildNpmPackage rec {
nativeBuildInputs = [
pkg-config
nodePackages.node-gyp
node-gyp
] ++ lib.optionals stdenv.isDarwin [ xcbuild ];
buildInputs =

View File

@ -126,6 +126,7 @@ mapAliases {
musescore-downloader = pkgs.dl-librescore; # added 2023-08-19
inherit (pkgs) near-cli; # added 2023-09-09
node-inspector = throw "node-inspector was removed because it was broken"; # added 2023-08-21
inherit (pkgs) node-gyp; # added 2024-08-13
inherit (pkgs) node-pre-gyp; # added 2024-08-05
inherit (pkgs) nodemon; # added 2024-06-28
inherit (pkgs) npm-check-updates; # added 2023-08-22

View File

@ -150,7 +150,6 @@
, "multi-file-swagger"
, "neovim"
, "nijs"
, "node-gyp"
, "node-gyp-build"
, "node-red"
, "node2nix"

View File

@ -78254,153 +78254,6 @@ in
bypassCache = true;
reconstructLock = true;
};
node-gyp = nodeEnv.buildNodePackage {
name = "node-gyp";
packageName = "node-gyp";
version = "10.2.0";
src = fetchurl {
url = "https://registry.npmjs.org/node-gyp/-/node-gyp-10.2.0.tgz";
sha512 = "sp3FonBAaFe4aYTcFdZUn2NYkbP7xroPGYvQmP4Nl5PxamznItBnNCgjrVTKrEfQynInMsJvZrdmqUnysCJ8rw==";
};
dependencies = [
sources."@isaacs/cliui-8.0.2"
sources."@npmcli/agent-2.2.2"
sources."@npmcli/fs-3.1.1"
sources."abbrev-2.0.0"
sources."agent-base-7.1.1"
sources."aggregate-error-3.1.0"
sources."ansi-regex-5.0.1"
sources."ansi-styles-6.2.1"
sources."balanced-match-1.0.2"
sources."brace-expansion-2.0.1"
sources."cacache-18.0.4"
sources."chownr-2.0.0"
sources."clean-stack-2.2.0"
sources."color-convert-2.0.1"
sources."color-name-1.1.4"
(sources."cross-spawn-7.0.3" // {
dependencies = [
sources."which-2.0.2"
];
})
sources."debug-4.3.5"
sources."eastasianwidth-0.2.0"
sources."emoji-regex-9.2.2"
sources."env-paths-2.2.1"
sources."err-code-2.0.3"
sources."exponential-backoff-3.1.1"
sources."foreground-child-3.2.1"
sources."fs-minipass-3.0.3"
sources."glob-10.4.5"
sources."graceful-fs-4.2.11"
sources."http-cache-semantics-4.1.1"
sources."http-proxy-agent-7.0.2"
sources."https-proxy-agent-7.0.5"
sources."imurmurhash-0.1.4"
sources."indent-string-4.0.0"
sources."ip-address-9.0.5"
sources."is-fullwidth-code-point-3.0.0"
sources."is-lambda-1.0.1"
sources."isexe-2.0.0"
sources."jackspeak-3.4.3"
sources."jsbn-1.1.0"
sources."lru-cache-10.4.3"
sources."make-fetch-happen-13.0.1"
sources."minimatch-9.0.5"
sources."minipass-7.1.2"
sources."minipass-collect-2.0.1"
sources."minipass-fetch-3.0.5"
(sources."minipass-flush-1.0.5" // {
dependencies = [
sources."minipass-3.3.6"
];
})
(sources."minipass-pipeline-1.2.4" // {
dependencies = [
sources."minipass-3.3.6"
];
})
(sources."minipass-sized-1.0.3" // {
dependencies = [
sources."minipass-3.3.6"
];
})
(sources."minizlib-2.1.2" // {
dependencies = [
sources."minipass-3.3.6"
];
})
sources."mkdirp-1.0.4"
sources."ms-2.1.2"
sources."negotiator-0.6.3"
sources."nopt-7.2.1"
sources."p-map-4.0.0"
sources."package-json-from-dist-1.0.0"
sources."path-key-3.1.1"
sources."path-scurry-1.11.1"
sources."proc-log-4.2.0"
sources."promise-retry-2.0.1"
sources."retry-0.12.0"
sources."semver-7.6.3"
sources."shebang-command-2.0.0"
sources."shebang-regex-3.0.0"
sources."signal-exit-4.1.0"
sources."smart-buffer-4.2.0"
sources."socks-2.8.3"
sources."socks-proxy-agent-8.0.4"
sources."sprintf-js-1.1.3"
sources."ssri-10.0.6"
sources."string-width-5.1.2"
(sources."string-width-cjs-4.2.3" // {
dependencies = [
sources."emoji-regex-8.0.0"
sources."strip-ansi-6.0.1"
];
})
(sources."strip-ansi-7.1.0" // {
dependencies = [
sources."ansi-regex-6.0.1"
];
})
sources."strip-ansi-cjs-6.0.1"
(sources."tar-6.2.1" // {
dependencies = [
(sources."fs-minipass-2.1.0" // {
dependencies = [
sources."minipass-3.3.6"
];
})
sources."minipass-5.0.0"
];
})
sources."unique-filename-3.0.0"
sources."unique-slug-4.0.0"
(sources."which-4.0.0" // {
dependencies = [
sources."isexe-3.1.1"
];
})
sources."wrap-ansi-8.1.0"
(sources."wrap-ansi-cjs-7.0.0" // {
dependencies = [
sources."ansi-styles-4.3.0"
sources."emoji-regex-8.0.0"
sources."string-width-4.2.3"
sources."strip-ansi-6.0.1"
];
})
sources."yallist-4.0.0"
];
buildInputs = globalBuildInputs;
meta = {
description = "Node.js native addon build tool";
homepage = "https://github.com/nodejs/node-gyp#readme";
license = "MIT";
};
production = true;
bypassCache = true;
reconstructLock = true;
};
node-gyp-build = nodeEnv.buildNodePackage {
name = "node-gyp-build";
packageName = "node-gyp-build";

View File

@ -168,16 +168,6 @@ final: prev: {
'';
};
node-gyp = prev.node-gyp.override {
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];
# Teach node-gyp to use nodejs headers locally rather that download them form https://nodejs.org.
# This is important when build nodejs packages in sandbox.
postInstall = ''
wrapProgram "$out/bin/node-gyp" \
--set npm_config_nodedir ${nodejs}
'';
};
node-red = prev.node-red.override {
buildInputs = [ pkgs.node-pre-gyp ];
};

View File

@ -3,7 +3,7 @@
, darwin
, fetchFromGitHub
, lib
, nodePackages
, node-gyp
, nodejs
, python3
, stdenv
@ -31,7 +31,7 @@ buildNpmPackage {
npmDepsHash = "sha256-mV6rWNf2p2w4H0ESUT0/Ybtx9YEdvO5l2gCvlWFXK+U=";
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.CoreServices ];
nativeBuildInputs = [ nodePackages.node-gyp python3 ]
nativeBuildInputs = [ node-gyp python3 ]
++ lib.optionals stdenv.isDarwin [ cctools ];
postInstall = ''

View File

@ -5,7 +5,7 @@
, fetchFromGitHub
, testers
, balena-cli
, nodePackages
, node-gyp
, python3
, udev
, cctools
@ -36,7 +36,7 @@ in buildNpmPackage' rec {
makeCacheWritable = true;
nativeBuildInputs = [
nodePackages.node-gyp
node-gyp
python3
] ++ lib.optionals stdenv.isDarwin [
cctools

View File

@ -2,7 +2,7 @@
, lib
, makeWrapper
, nodejs
, nodePackages
, node-gyp
, pnpm_9
, python3
, stdenv
@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
makeWrapper
nodejs
nodePackages.node-gyp # required for sqlite3 bindings
node-gyp # required for sqlite3 bindings
pnpm_9.configHook
python3 # required for sqlite3 bindings
] ++ lib.optional stdenv.isDarwin [ xcbuild ];

View File

@ -34442,13 +34442,11 @@ with pkgs;
openvscode-server = callPackage ../servers/openvscode-server {
nodejs = nodejs_18;
inherit (darwin.apple_sdk.frameworks) AppKit Cocoa Security;
inherit (nodePackages) node-gyp;
};
code-server = callPackage ../servers/code-server {
nodejs = nodejs_20;
inherit (darwin.apple_sdk.frameworks) AppKit Cocoa CoreServices Security;
inherit (nodePackages) node-gyp;
};
vue = callPackage ../applications/misc/vue { };