copybara: fix

This commit is contained in:
Luke Granger-Brown 2023-02-10 20:07:52 +00:00
parent 4bac34ead1
commit 1185ae98f0
2 changed files with 7 additions and 10 deletions

View file

@ -2,18 +2,15 @@
#
# SPDX-License-Identifier: Apache-2.0
{ pkgs, ... }:
let
jdk = pkgs.openjdk11_headless;
in
pkgs.buildBazelPackage rec {
{ buildBazelPackage, openjdk11_headless, bazel_4, git, mercurial, makeWrapper, fetchFromGitHub }:
buildBazelPackage rec {
name = "copybara";
version = "master";
bazel = bazel_4;
src = ../../third_party/copybara;
nativeBuildInputs = with pkgs; [ git mercurial jdk makeWrapper ];
bazel = pkgs.bazel_3;
nativeBuildInputs = [ git mercurial openjdk11_headless makeWrapper ];
bazelTarget = "//java/com/google/copybara:copybara_deploy.jar";
removeRulesCC = false;
@ -24,7 +21,7 @@ pkgs.buildBazelPackage rec {
];
fetchAttrs = {
sha256 = "sha256:195av0bvgqgs7wwzx14yrrww582ijadvjdx82hx4911lp4jlbg8d";
sha256 = "sha256:1xahy74my2hr9763sv7ch3safj9mp5a78hg163gsnmqhfzvjh2cj";
preHook = ''
export COURSIER_CACHE="$(echo ''${NIX_BUILD_TOP}/tmp/coursier | sed -e 's,//,/,g')"
'';
@ -34,7 +31,7 @@ pkgs.buildBazelPackage rec {
installPhase = ''
mkdir -p $out/bin $out/share/java
install -Dm755 bazel-bin/java/com/google/copybara/copybara_deploy.jar $out/share/java/copybara.jar
makeWrapper ${pkgs.jdk}/bin/java $out/bin/copybara \
makeWrapper ${openjdk11_headless}/bin/java $out/bin/copybara \
--add-flags "-cp $out/share/java/copybara.jar com.google.copybara.Main"
'';
};

View file

@ -8,7 +8,7 @@
javaws-env = import ./javaws-env.nix args;
plex-pass = import ./plex-pass.nix args;
secretsync = import ./secretsync args;
copybara = import ./copybara.nix args;
copybara = pkgs.callPackage ./copybara.nix { };
hg-git = import ./hg-git.nix args;
erbium = import ./erbium args;
sheepshaver = import ./sheepshaver.nix args;