From d1818ad6b10e8880f166a0c678389ea89dec88ce Mon Sep 17 00:00:00 2001 From: Uri Baghin Date: Mon, 10 Sep 2018 15:12:22 +1000 Subject: [PATCH] bazel: add bazel_jdk10 variant --- .../development/tools/build-managers/bazel/default.nix | 10 ++++++---- pkgs/top-level/all-packages.nix | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix index 6a25aef8b36a..49d6abdc0098 100644 --- a/pkgs/development/tools/build-managers/bazel/default.nix +++ b/pkgs/development/tools/build-managers/bazel/default.nix @@ -1,11 +1,13 @@ { stdenv, lib, fetchurl, fetchpatch, runCommand, makeWrapper , jdk, zip, unzip, bash, writeCBin, coreutils , which, python, perl, gnused, gnugrep, findutils +# Apple dependencies +, cctools, clang, libcxx, CoreFoundation, CoreServices, Foundation +# Allow to independently override the jdks used to build and run respectively +, buildJdk ? jdk, runJdk ? jdk # Always assume all markers valid (don't redownload dependencies). # Also, don't clean up environment variables. , enableNixHacks ? false -# Apple dependencies -, cctools, clang, libcxx, CoreFoundation, CoreServices, Foundation }: let @@ -152,7 +154,7 @@ stdenv.mkDerivation rec { + genericPatches; buildInputs = [ - jdk + buildJdk ]; nativeBuildInputs = [ @@ -190,7 +192,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin mv output/bazel $out/bin - wrapProgram "$out/bin/bazel" --set JAVA_HOME "${jdk}" + wrapProgram "$out/bin/bazel" --set JAVA_HOME "${runJdk}" mkdir -p $out/share/bash-completion/completions $out/share/zsh/site-functions mv output/bazel-complete.bash $out/share/bash-completion/completions/bazel cp scripts/zsh_completion/_bazel $out/share/zsh/site-functions/ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 26409db6d01d..230f077602fe 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7954,6 +7954,11 @@ with pkgs; inherit (darwin) cctools; inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Foundation; }; + bazel_jdk10 = callPackage ../development/tools/build-managers/bazel { + inherit (darwin) cctools; + inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Foundation; + runJdk = jdk10; + }; bazel-buildtools = callPackage ../development/tools/build-managers/bazel/buildtools { }; buildifier = bazel-buildtools;