From 1185ae98f0023d6c5497087716705cf5fd07983a Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Fri, 10 Feb 2023 20:07:52 +0000 Subject: [PATCH] copybara: fix --- nix/pkgs/copybara.nix | 15 ++++++--------- nix/pkgs/default.nix | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/nix/pkgs/copybara.nix b/nix/pkgs/copybara.nix index b1b888284e..26c57dfcf6 100644 --- a/nix/pkgs/copybara.nix +++ b/nix/pkgs/copybara.nix @@ -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" ''; }; diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 7cdf3334b0..5d1ac87deb 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -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;