forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sefa Eyeoglu <[email protected]>
- Loading branch information
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters