Merge pull request #259098 from dotlambda/vercel-pkg-fetchYarnDeps

vercel-pkg: use fetchYarnDeps
This commit is contained in:
Robert Schütz 2023-10-14 16:31:59 -07:00 committed by GitHub
commit 369f974d07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 77 additions and 169 deletions

View File

@ -0,0 +1,76 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchYarnDeps
, makeWrapper
, nodejs
, prefetch-yarn-deps
, yarn
}:
stdenv.mkDerivation rec {
pname = "pkg";
version = "5.8.1";
src = fetchFromGitHub {
owner = "vercel";
repo = "pkg";
rev = version;
hash = "sha256-h3rHR3JE9hVcd3oiE7VL2daYXGTQo7NcOHGC6pmE/xs=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-KesP3X7LwZ7KSIxcCPXdn/sWcX9TJlwT9z/SdotS2ZQ=";
};
nativeBuildInputs = [
makeWrapper
nodejs
prefetch-yarn-deps
yarn
];
configurePhase = ''
runHook preConfigure
export HOME=$(mktemp -d)
yarn config --offline set yarn-offline-mirror "$offlineCache"
fixup-yarn-lock yarn.lock
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
patchShebangs node_modules
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
yarn --offline prepare
runHook postBuild
'';
installPhase = ''
runHook preInstall
yarn --offline --production install
mkdir -p "$out/lib/node_modules/pkg"
cp -r . "$out/lib/node_modules/pkg"
makeWrapper "${nodejs}/bin/node" "$out/bin/pkg" \
--add-flags "$out/lib/node_modules/pkg/lib-es5/bin.js"
runHook postInstall
'';
meta = {
description = "Package your Node.js project into an executable";
homepage = "https://github.com/vercel/pkg";
license = lib.licenses.mit;
mainProgram = "pkg";
maintainers = with lib.maintainers; [ cmcdragonkai ];
platforms = lib.platforms.all;
};
}

View File

@ -106,6 +106,7 @@ mapAliases {
inherit (pkgs) npm-check-updates; # added 2023-08-22
ocaml-language-server = throw "ocaml-language-server was removed because it was abandoned upstream"; # added 2023-09-04
parcel-bundler = parcel; # added 2023-09-04
pkg = pkgs.vercel-pkg; # added 2023-10-04
prettier_d_slim = pkgs.prettier-d-slim; # added 2023-09-14
inherit (pkgs) pxder; # added 2023-09-26
inherit (pkgs) quicktype; # added 2023-09-09

View File

@ -188,7 +188,6 @@
, "peerflix"
, "peerflix-server"
, {"pgrok-build-deps": "../../tools/networking/pgrok/build-deps"}
, "pkg"
, "pm2"
, "pnpm"
, "poor-mans-t-sql-formatter-cli"

View File

@ -90646,174 +90646,6 @@ in
bypassCache = true;
reconstructLock = true;
};
pkg = nodeEnv.buildNodePackage {
name = "pkg";
packageName = "pkg";
version = "5.8.1";
src = fetchurl {
url = "https://registry.npmjs.org/pkg/-/pkg-5.8.1.tgz";
sha512 = "CjBWtFStCfIiT4Bde9QpJy0KeH19jCfwZRJqHFDFXfhUklCx8JoFmMj3wgnEYIwGmZVNkhsStPHEOnrtrQhEXA==";
};
dependencies = [
sources."@babel/generator-7.18.2"
sources."@babel/helper-string-parser-7.22.5"
sources."@babel/helper-validator-identifier-7.22.20"
sources."@babel/parser-7.18.4"
sources."@babel/types-7.19.0"
sources."@jridgewell/gen-mapping-0.3.3"
sources."@jridgewell/resolve-uri-3.1.1"
sources."@jridgewell/set-array-1.1.2"
sources."@jridgewell/sourcemap-codec-1.4.15"
sources."@jridgewell/trace-mapping-0.3.19"
sources."@nodelib/fs.scandir-2.1.5"
sources."@nodelib/fs.stat-2.0.5"
sources."@nodelib/fs.walk-1.2.8"
sources."agent-base-6.0.2"
sources."ansi-regex-5.0.1"
sources."ansi-styles-4.3.0"
sources."array-union-2.1.0"
sources."at-least-node-1.0.0"
sources."base64-js-1.5.1"
(sources."bl-4.1.0" // {
dependencies = [
sources."readable-stream-3.6.2"
];
})
sources."braces-3.0.2"
sources."buffer-5.7.1"
sources."chalk-4.1.2"
sources."chownr-1.1.4"
sources."cliui-7.0.4"
sources."color-convert-2.0.1"
sources."color-name-1.1.4"
sources."core-util-is-1.0.3"
sources."debug-4.3.4"
sources."decompress-response-6.0.0"
sources."deep-extend-0.6.0"
sources."detect-libc-2.0.2"
sources."dir-glob-3.0.1"
sources."emoji-regex-8.0.0"
sources."encoding-0.1.13"
sources."end-of-stream-1.4.4"
sources."escalade-3.1.1"
sources."expand-template-2.0.3"
sources."fast-glob-3.3.1"
sources."fastq-1.15.0"
sources."fill-range-7.0.1"
sources."from2-2.3.0"
sources."fs-constants-1.0.0"
sources."fs-extra-9.1.0"
sources."function-bind-1.1.1"
sources."get-caller-file-2.0.5"
sources."github-from-package-0.0.0"
sources."glob-parent-5.1.2"
sources."globby-11.1.0"
sources."graceful-fs-4.2.11"
sources."growly-1.3.0"
sources."has-1.0.3"
sources."has-flag-4.0.0"
sources."https-proxy-agent-5.0.1"
sources."iconv-lite-0.6.3"
sources."ieee754-1.2.1"
sources."ignore-5.2.4"
sources."inherits-2.0.4"
sources."ini-1.3.8"
sources."into-stream-6.0.0"
sources."is-core-module-2.9.0"
sources."is-docker-2.2.1"
sources."is-extglob-2.1.1"
sources."is-fullwidth-code-point-3.0.0"
sources."is-glob-4.0.3"
sources."is-number-7.0.0"
sources."is-wsl-2.2.0"
sources."isarray-1.0.0"
sources."isexe-2.0.0"
sources."jsesc-2.5.2"
sources."jsonfile-6.1.0"
sources."lru-cache-6.0.0"
sources."merge2-1.4.1"
sources."micromatch-4.0.5"
sources."mimic-response-3.1.0"
sources."minimist-1.2.8"
sources."mkdirp-classic-0.5.3"
sources."ms-2.1.2"
(sources."multistream-4.1.0" // {
dependencies = [
sources."readable-stream-3.6.2"
];
})
sources."napi-build-utils-1.0.2"
sources."node-abi-3.47.0"
sources."node-fetch-2.7.0"
sources."node-notifier-10.0.1"
sources."once-1.4.0"
sources."p-is-promise-3.0.0"
sources."path-parse-1.0.7"
sources."path-type-4.0.0"
sources."picomatch-2.3.1"
sources."pkg-fetch-3.4.2"
sources."prebuild-install-7.1.1"
sources."process-nextick-args-2.0.1"
sources."progress-2.0.3"
sources."pump-3.0.0"
sources."queue-microtask-1.2.3"
sources."rc-1.2.8"
sources."readable-stream-2.3.8"
sources."require-directory-2.1.1"
(sources."resolve-1.22.6" // {
dependencies = [
sources."is-core-module-2.13.0"
];
})
sources."reusify-1.0.4"
sources."run-parallel-1.2.0"
sources."safe-buffer-5.1.2"
sources."safer-buffer-2.1.2"
sources."semver-7.5.4"
sources."shellwords-0.1.1"
sources."simple-concat-1.0.1"
sources."simple-get-4.0.1"
sources."slash-3.0.0"
sources."stream-meter-1.0.4"
sources."string-width-4.2.3"
sources."string_decoder-1.1.1"
sources."strip-ansi-6.0.1"
sources."strip-json-comments-2.0.1"
sources."supports-color-7.2.0"
sources."supports-preserve-symlinks-flag-1.0.0"
sources."tar-fs-2.1.1"
(sources."tar-stream-2.2.0" // {
dependencies = [
sources."readable-stream-3.6.2"
];
})
sources."to-fast-properties-2.0.0"
sources."to-regex-range-5.0.1"
sources."tr46-0.0.3"
sources."tunnel-agent-0.6.0"
sources."universalify-2.0.0"
sources."util-deprecate-1.0.2"
sources."uuid-8.3.2"
sources."webidl-conversions-3.0.1"
sources."whatwg-url-5.0.0"
sources."which-2.0.2"
sources."wrap-ansi-7.0.0"
sources."wrappy-1.0.2"
sources."y18n-5.0.8"
sources."yallist-4.0.0"
sources."yargs-16.2.0"
sources."yargs-parser-20.2.9"
];
buildInputs = globalBuildInputs;
meta = {
description = "Package your Node.js project into an executable";
homepage = "https://github.com/vercel/pkg#readme";
license = "MIT";
};
production = true;
bypassCache = true;
reconstructLock = true;
};
pm2 = nodeEnv.buildNodePackage {
name = "pm2";
packageName = "pm2";