bazel: add Nix hacks
Those are needed to build Bazel packages in Nix.
This commit is contained in:
parent
5022edd9ea
commit
6bdee9c730
|
@ -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 {
|
stdenv.mkDerivation rec {
|
||||||
|
|
||||||
|
@ -21,6 +25,8 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
sourceRoot = ".";
|
sourceRoot = ".";
|
||||||
|
|
||||||
|
patches = lib.optional enableNixHacks ./nix-hacks.patch;
|
||||||
|
|
||||||
# Bazel expects several utils to be available in Bash even without PATH. Hence this hack.
|
# Bazel expects several utils to be available in Bash even without PATH. Hence this hack.
|
||||||
|
|
||||||
customBash = writeScriptBin "bash" ''
|
customBash = writeScriptBin "bash" ''
|
||||||
|
@ -74,7 +80,6 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Bazel expects gcc and java to be in the path.
|
# Bazel expects gcc and java to be in the path.
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
mv output/bazel $out/bin
|
mv output/bazel $out/bin
|
||||||
|
|
Loading…
Reference in New Issue