2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchYarnDeps
|
|
|
|
, makeWrapper
|
|
|
|
, nodejs
|
2024-04-21 15:54:59 +00:00
|
|
|
, fixup-yarn-lock
|
2023-10-09 19:29:22 +00:00
|
|
|
, yarn
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "shepherd";
|
|
|
|
version = "1.16.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NerdWalletOSS";
|
|
|
|
repo = "shepherd";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-LY8Vde4YpGuKnQ5UnSOpsQDY7AOyZRziUrfZb5dRiX4=";
|
|
|
|
};
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/yarn.lock";
|
|
|
|
hash = "sha256-tJXJ8ePr5ArAV+0JcuJsTo/B2PUcgsXfZrSDCpna/9k=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
nodejs
|
2024-04-21 15:54:59 +00:00
|
|
|
fixup-yarn-lock
|
2023-10-09 19:29:22 +00:00
|
|
|
yarn
|
|
|
|
];
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
yarn config --offline set yarn-offline-mirror "$offlineCache"
|
|
|
|
fixup-yarn-lock yarn.lock
|
|
|
|
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
|
|
|
|
patchShebangs node_modules
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
yarn --offline build
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
yarn --offline --production install
|
|
|
|
|
|
|
|
mkdir -p "$out/lib/node_modules/@nerdwallet/shepherd"
|
|
|
|
cp -r . "$out/lib/node_modules/@nerdwallet/shepherd"
|
|
|
|
|
|
|
|
makeWrapper "${nodejs}/bin/node" "$out/bin/shepherd" \
|
|
|
|
--add-flags "$out/lib/node_modules/@nerdwallet/shepherd/lib/cli.js"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/NerdWalletOSS/shepherd/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
description = "A utility for applying code changes across many repositories";
|
|
|
|
homepage = "https://github.com/NerdWalletOSS/shepherd";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
mainProgram = "shepherd";
|
|
|
|
maintainers = with lib.maintainers; [ dbirks ];
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
}
|