pnpm: refactor derivation
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
@@ -8,10 +8,12 @@
|
||||
installShellFiles,
|
||||
nodejs,
|
||||
testers,
|
||||
buildPackages,
|
||||
bashNonInteractive,
|
||||
|
||||
withNode ? true,
|
||||
version,
|
||||
hash,
|
||||
buildPackages,
|
||||
}:
|
||||
let
|
||||
majorVersion = lib.versions.major version;
|
||||
@@ -24,19 +26,23 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
url = "https://registry.npmjs.org/pnpm/-/pnpm-${finalAttrs.version}.tgz";
|
||||
inherit hash;
|
||||
};
|
||||
# Remove binary files from src, we don't need them, and this way we make sure
|
||||
# our distribution is free of binaryNativeCode
|
||||
preConfigure = ''
|
||||
rm -r dist/reflink.*node dist/vendor
|
||||
'';
|
||||
|
||||
buildInputs = lib.optionals withNode [ nodejs ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
nodejs
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
bashNonInteractive # needed for node-gyp wrapper script
|
||||
]
|
||||
++ lib.optionals withNode [ nodejs ];
|
||||
|
||||
# Remove binary files from src, we don't need them, and this way we make sure
|
||||
# our distribution is free of binaryNativeCode
|
||||
postUnpack = ''
|
||||
rm -r package/dist/reflink.*node package/dist/vendor
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
@@ -129,6 +135,12 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
'';
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
__structuredAttrs = true;
|
||||
|
||||
dontBuild = true;
|
||||
dontConfigure = true;
|
||||
|
||||
meta = {
|
||||
description = "Fast, disk space efficient package manager for JavaScript";
|
||||
homepage = "https://pnpm.io/";
|
||||
|
||||
Reference in New Issue
Block a user