2020-07-26 14:51:49 +02:00
|
|
|
{ depot, pkgs, ... }:
|
|
|
|
{
|
|
|
|
buildGerritBazelPlugin =
|
|
|
|
{ name
|
|
|
|
, src
|
|
|
|
, depsOutputHash
|
|
|
|
, overlayPluginCmd ? ''
|
|
|
|
cp -R "${src}" "$out/plugins/${name}"
|
|
|
|
''
|
2021-04-03 16:15:30 +02:00
|
|
|
, postPatch ? ""
|
2022-01-30 17:06:58 +01:00
|
|
|
,
|
2020-07-26 14:51:49 +02:00
|
|
|
}: ((depot.third_party.gerrit.override {
|
|
|
|
name = "${name}.jar";
|
|
|
|
|
|
|
|
src = pkgs.runCommandLocal "${name}-src" { } ''
|
|
|
|
cp -R "${depot.third_party.gerrit.src}" "$out"
|
|
|
|
chmod +w "$out/plugins"
|
|
|
|
${overlayPluginCmd}
|
|
|
|
'';
|
|
|
|
|
|
|
|
bazelTarget = "//plugins/${name}";
|
|
|
|
}).overrideAttrs (super: {
|
|
|
|
deps = super.deps.overrideAttrs (superDeps: {
|
|
|
|
outputHash = depsOutputHash;
|
|
|
|
});
|
|
|
|
installPhase = ''
|
|
|
|
cp "bazel-bin/plugins/${name}/${name}.jar" "$out"
|
|
|
|
'';
|
2021-04-03 16:15:30 +02:00
|
|
|
postPatch =
|
|
|
|
if super ? postPatch then ''
|
|
|
|
${super.postPatch}
|
|
|
|
${postPatch}
|
|
|
|
'' else postPatch;
|
2020-07-26 14:51:49 +02:00
|
|
|
}));
|
|
|
|
}
|