From 6bdee9c7300fe415bb74ce93e45fd880445b18c7 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Fri, 10 Nov 2017 20:05:55 +0300 Subject: [PATCH] bazel: add Nix hacks Those are needed to build Bazel packages in Nix. --- pkgs/development/tools/build-managers/bazel/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix index e15b212ebca..724ae2c80ea 100644 --- a/pkgs/development/tools/build-managers/bazel/default.nix +++ b/pkgs/development/tools/build-managers/bazel/default.nix @@ -1,4 +1,8 @@ -{ stdenv, lib, fetchurl, jdk, zip, unzip, bash, writeScriptBin, coreutils, makeWrapper, which, python }: +{ stdenv, lib, fetchurl, jdk, zip, unzip, bash, writeScriptBin, coreutils, makeWrapper, which, python +# Always assume all markers valid (don't redownload dependencies). +# Also, don't clean up environment variables. +, enableNixHacks ? false +}: stdenv.mkDerivation rec { @@ -21,6 +25,8 @@ stdenv.mkDerivation rec { sourceRoot = "."; + patches = lib.optional enableNixHacks ./nix-hacks.patch; + # Bazel expects several utils to be available in Bash even without PATH. Hence this hack. customBash = writeScriptBin "bash" '' @@ -74,7 +80,6 @@ stdenv.mkDerivation rec { ''; # Bazel expects gcc and java to be in the path. - installPhase = '' mkdir -p $out/bin mv output/bazel $out/bin