3
0
Fork 0
forked from mirrors/nixpkgs

bazel: add Nix hacks

Those are needed to build Bazel packages in Nix.
This commit is contained in:
Nikolay Amiantov 2017-11-10 20:05:55 +03:00
parent 5022edd9ea
commit 6bdee9c730

View file

@ -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