nixpkgs/pkgs/development/tools/yarn/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.4 KiB
Nix
Raw Normal View History

2023-01-27 04:20:00 +00:00
{ lib, fetchFromGitHub, fetchzip, nodejs, stdenvNoCC, testers }:
2017-01-14 19:49:57 +00:00
2023-01-27 04:20:00 +00:00
let
completion = fetchFromGitHub {
owner = "dsifford";
repo = "yarn-completion";
rev = "v0.17.0";
hash = "sha256-z7KPXeYPPRuaEPxgY6YqsLt9n8cSsW3n2FhOzVde1HU=";
};
in
2023-01-27 04:20:00 +00:00
stdenvNoCC.mkDerivation (finalAttrs: {
2019-03-16 23:32:18 +00:00
pname = "yarn";
2022-06-12 00:26:24 +00:00
version = "1.22.19";
2017-01-14 19:49:57 +00:00
src = fetchzip {
2023-01-27 04:20:00 +00:00
url = "https://github.com/yarnpkg/yarn/releases/download/v${finalAttrs.version}/yarn-v${finalAttrs.version}.tar.gz";
2022-06-12 00:26:24 +00:00
sha256 = "sha256-12wUuWH+kkqxAgVYkyhIYVtexjv8DFP9kLpFLWg+h0o=";
2017-01-14 19:49:57 +00:00
};
buildInputs = [ nodejs ];
2017-01-14 19:49:57 +00:00
installPhase = ''
2023-01-27 04:20:00 +00:00
mkdir -p $out/{bin,libexec/yarn/,share/bash-completion/completions/}
2017-01-14 19:49:57 +00:00
cp -R . $out/libexec/yarn
ln -s $out/libexec/yarn/bin/yarn.js $out/bin/yarn
ln -s $out/libexec/yarn/bin/yarn.js $out/bin/yarnpkg
2023-01-27 04:20:00 +00:00
ln -s ${completion}/yarn-completion.bash $out/share/bash-completion/completions/yarn.bash
2017-01-14 19:49:57 +00:00
'';
2023-01-27 04:20:00 +00:00
passthru.tests = testers.testVersion { package = finalAttrs.finalPackage; };
2021-11-07 10:16:30 +00:00
meta = with lib; {
2017-01-14 19:49:57 +00:00
description = "Fast, reliable, and secure dependency management for javascript";
2023-01-27 04:20:00 +00:00
homepage = "https://classic.yarnpkg.com/";
changelog = "https://github.com/yarnpkg/yarn/blob/v${finalAttrs.version}/CHANGELOG.md";
2017-01-14 19:49:57 +00:00
license = licenses.bsd2;
2023-01-27 04:20:00 +00:00
maintainers = with maintainers; [ offline screendriver marsam ];
2023-01-27 04:20:00 +00:00
platforms = nodejs.meta.platforms;
mainProgram = "yarn";
2017-01-14 19:49:57 +00:00
};
2023-01-27 04:20:00 +00:00
})