pnpm: init at 9.1.1

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
(cherry picked from commit 53af969d62)
This commit is contained in:
Sefa Eyeoglu 2024-05-17 11:09:12 +02:00 committed by Emily
parent 57321d2ed2
commit 8fe4a3a933
3 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,20 @@
{ lib, callPackage }:
let
inherit (lib) mapAttrs' nameValuePair;
variants = {
"8" = {
version = "8.15.8";
hash = "sha256-aR/hdu6pqKgN8g5JdvPftEoEhBzriFY4/iomF0+B5l4=";
};
"9" = {
version = "9.1.1";
hash = "sha256-lVHoA9y3oYOf31QWFTqEQGDHvOATIYzoI0EFMlBKwQs=";
};
};
callPnpm = variant: callPackage ./generic.nix {inherit (variant) version hash;};
mkPnpm = versionSuffix: variant: nameValuePair "pnpm_${versionSuffix}" (callPnpm variant);
in
mapAttrs' mkPnpm variants

View File

@ -0,0 +1,50 @@
{
lib,
stdenvNoCC,
fetchurl,
nodejs,
testers,
withNode ? true,
version,
hash,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "pnpm";
inherit version;
src = fetchurl {
url = "https://registry.npmjs.org/pnpm/-/pnpm-${finalAttrs.version}.tgz";
inherit hash;
};
buildInputs = lib.optionals withNode [ nodejs ];
installPhase = ''
runHook preInstall
install -d $out/{bin,libexec}
cp -R . $out/libexec/pnpm
ln -s $out/libexec/pnpm/bin/pnpm.cjs $out/bin/pnpm
ln -s $out/libexec/pnpm/bin/pnpx.cjs $out/bin/pnpx
runHook postInstall
'';
passthru = {
tests.version = lib.optionalAttrs withNode (
testers.testVersion { package = finalAttrs.finalPackage; }
);
};
meta = with lib; {
description = "Fast, disk space efficient package manager for JavaScript";
homepage = "https://pnpm.io/";
changelog = "https://github.com/pnpm/pnpm/releases/tag/v${finalAttrs.version}";
license = licenses.mit;
maintainers = with maintainers; [ Scrumplex ];
platforms = platforms.all;
mainProgram = "pnpm";
};
})

View File

@ -11891,6 +11891,10 @@ with pkgs;
pngquant = callPackage ../tools/graphics/pngquant { };
inherit (callPackages ../development/tools/pnpm { })
pnpm_8 pnpm_9;
pnpm = pnpm_9;
po4a = perlPackages.Po4a;
poac = callPackage ../development/tools/poac {