anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / tools / yarn-berry / default.nix
blob0f0e7c7f81eca26c8d9f852302a4d3aa5cbda04f
1 { fetchFromGitHub, lib, nodejs, stdenv, testers, yarn }:
3 stdenv.mkDerivation (finalAttrs: {
4   pname = "yarn-berry";
5   version = "4.5.0";
7   src = fetchFromGitHub {
8     owner = "yarnpkg";
9     repo = "berry";
10     rev = "@yarnpkg/cli/${finalAttrs.version}";
11     hash = "sha256-OTCFUoEgj1kY8QSqaYIqtSoWBYR0i0ao2dNRBhijEzc=";
12   };
14   buildInputs = [
15     nodejs
16   ];
18   nativeBuildInputs = [
19     yarn
20   ];
22   dontConfigure = true;
24   buildPhase = ''
25     runHook preBuild
26     yarn workspace @yarnpkg/cli build:cli
27     runHook postBuild
28   '';
30   installPhase = ''
31     runHook preInstall
32     install -Dm 755 ./packages/yarnpkg-cli/bundles/yarn.js "$out/bin/yarn"
33     runHook postInstall
34   '';
36   passthru.updateScript = ./update.sh;
38   passthru.tests = {
39     version = testers.testVersion {
40       package = finalAttrs.finalPackage;
41     };
42   };
44   meta = with lib; {
45     homepage = "https://yarnpkg.com/";
46     description = "Fast, reliable, and secure dependency management";
47     license = licenses.bsd2;
48     maintainers = with maintainers; [ ryota-ka pyrox0 DimitarNestorov ];
49     platforms = platforms.unix;
50     mainProgram = "yarn";
51   };