forked from the-distro/infra
Raito Bezarius
98a33e4300
With: - A package hierarchy - A source-based Gerrit deployment Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
36 lines
858 B
Nix
36 lines
858 B
Nix
{ buildGerrit, gerrit, runCommandLocal, lib }:
|
|
{ name
|
|
, src
|
|
, depsOutputHash
|
|
, overlayPluginCmd ? ''
|
|
cp -R "${src}" "$out/plugins/${name}"
|
|
''
|
|
, postPatch ? ""
|
|
, patches ? [ ]
|
|
}: (buildGerrit {
|
|
name = "${name}.jar";
|
|
|
|
src = runCommandLocal "${name}-src" { } ''
|
|
cp -R "${gerrit.src}" "$out"
|
|
chmod +w "$out/plugins"
|
|
${overlayPluginCmd}
|
|
'';
|
|
|
|
bazelTargets = [ "//plugins/${name}" ];
|
|
}).overrideAttrs (super: {
|
|
deps = super.deps.overrideAttrs (superDeps: {
|
|
outputHash = depsOutputHash;
|
|
});
|
|
installPhase = ''
|
|
cp "bazel-bin/plugins/${name}/${name}.jar" "$out"
|
|
'';
|
|
postPatch = ''
|
|
${super.postPatch or ""}
|
|
pushd "plugins/${name}"
|
|
${lib.concatMapStringsSep "\n" (patch: ''
|
|
patch -p1 < ${patch}
|
|
'') patches}
|
|
popd
|
|
${postPatch}
|
|
'';
|
|
})
|