summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2024-04-09 07:41:50 -0500
committerGitHub <noreply@github.com>2024-04-09 07:41:50 -0500
commitbea21e5fa998eab952d8c1419b0ea89d7e6d6f24 (patch)
tree3fd79ac53718e86281688a2843e118b0370c4c49
parenta76c4553d7e741e17f289224eda135423de0491d (diff)
parent8c29b8d726bc0e6dbaef1c6cf0439e8af3d1d307 (diff)
Merge pull request #302696 from marsam/yarn-without-node
yarn: allow install without node
-rw-r--r--pkgs/development/tools/yarn/default.nix25
1 files changed, 21 insertions, 4 deletions
diff --git a/pkgs/development/tools/yarn/default.nix b/pkgs/development/tools/yarn/default.nix
index 1a9a619c7b15..9d95676ec2ce 100644
--- a/pkgs/development/tools/yarn/default.nix
+++ b/pkgs/development/tools/yarn/default.nix
@@ -1,4 +1,12 @@
-{ lib, fetchFromGitHub, fetchzip, nodejs, stdenvNoCC, testers }:
+{ lib
+, fetchFromGitHub
+, fetchzip
+, nodejs
+, stdenvNoCC
+, testers
+, gitUpdater
+, withNode ? true
+}:
let
completion = fetchFromGitHub {
@@ -17,7 +25,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
sha256 = "sha256-kFa+kmnBerTB7fY/IvfAFy/4LWvrl9lrRHMOUdOZ+Wg=";
};
- buildInputs = [ nodejs ];
+ buildInputs = lib.optionals withNode [ nodejs ];
installPhase = ''
mkdir -p $out/{bin,libexec/yarn/,share/bash-completion/completions/}
@@ -27,7 +35,16 @@ stdenvNoCC.mkDerivation (finalAttrs: {
ln -s ${completion}/yarn-completion.bash $out/share/bash-completion/completions/yarn.bash
'';
- passthru.tests = testers.testVersion { package = finalAttrs.finalPackage; };
+ passthru = {
+ tests.version = lib.optionalAttrs withNode (testers.testVersion {
+ package = finalAttrs.finalPackage;
+ });
+
+ updateScript = gitUpdater {
+ url = "https://github.com/yarnpkg/yarn.git";
+ rev-prefix = "v";
+ };
+ };
meta = with lib; {
description = "Fast, reliable, and secure dependency management for javascript";
@@ -35,7 +52,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
changelog = "https://github.com/yarnpkg/yarn/blob/v${finalAttrs.version}/CHANGELOG.md";
license = licenses.bsd2;
maintainers = with maintainers; [ offline screendriver marsam ];
- platforms = nodejs.meta.platforms;
+ platforms = platforms.all;
mainProgram = "yarn";
};
})