ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / sh / shepherd / package.nix
blob19205b6617c658db6ee24bc86d0ddf62dcebb4aa
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchYarnDeps
5 , makeWrapper
6 , nodejs
7 , fixup-yarn-lock
8 , yarn
9 }:
11 stdenv.mkDerivation rec {
12   pname = "shepherd";
13   version = "1.16.0";
15   src = fetchFromGitHub {
16     owner = "NerdWalletOSS";
17     repo = "shepherd";
18     rev = "v${version}";
19     hash = "sha256-LY8Vde4YpGuKnQ5UnSOpsQDY7AOyZRziUrfZb5dRiX4=";
20   };
22   offlineCache = fetchYarnDeps {
23     yarnLock = "${src}/yarn.lock";
24     hash = "sha256-tJXJ8ePr5ArAV+0JcuJsTo/B2PUcgsXfZrSDCpna/9k=";
25   };
27   nativeBuildInputs  = [
28     makeWrapper
29     nodejs
30     fixup-yarn-lock
31     yarn
32   ];
34   configurePhase = ''
35     runHook preConfigure
37     export HOME=$(mktemp -d)
38     yarn config --offline set yarn-offline-mirror "$offlineCache"
39     fixup-yarn-lock yarn.lock
40     yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
41     patchShebangs node_modules
43     runHook postConfigure
44   '';
46   buildPhase = ''
47     runHook preBuild
49     yarn --offline build
51     runHook postBuild
52   '';
54   installPhase = ''
55     runHook preInstall
57     yarn --offline --production install
59     mkdir -p "$out/lib/node_modules/@nerdwallet/shepherd"
60     cp -r . "$out/lib/node_modules/@nerdwallet/shepherd"
62     makeWrapper "${nodejs}/bin/node" "$out/bin/shepherd" \
63       --add-flags "$out/lib/node_modules/@nerdwallet/shepherd/lib/cli.js"
65     runHook postInstall
66   '';
68   meta = {
69     changelog = "https://github.com/NerdWalletOSS/shepherd/blob/${src.rev}/CHANGELOG.md";
70     description = "Utility for applying code changes across many repositories";
71     homepage = "https://github.com/NerdWalletOSS/shepherd";
72     license = lib.licenses.asl20;
73     mainProgram = "shepherd";
74     maintainers = with lib.maintainers; [ dbirks ];
75     platforms = lib.platforms.all;
76   };