buildBazelPackage: add flags for build and fetch
They sometimes take separate flags.
This commit is contained in:
parent
019c13616b
commit
e458a34012
|
@ -4,7 +4,7 @@
|
||||||
, lib
|
, lib
|
||||||
}:
|
}:
|
||||||
|
|
||||||
args@{ name, bazelFlags ? [], bazelTarget, buildAttrs, fetchAttrs, ... }:
|
args@{ name, bazelFlags ? [], bazelBuildFlags ? [], bazelFetchFlags ? [], bazelTarget, buildAttrs, fetchAttrs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
fArgs = removeAttrs args [ "buildAttrs" "fetchAttrs" ];
|
fArgs = removeAttrs args [ "buildAttrs" "fetchAttrs" ];
|
||||||
|
@ -12,11 +12,11 @@ let
|
||||||
fFetchAttrs = fArgs // removeAttrs fetchAttrs [ "sha256" ];
|
fFetchAttrs = fArgs // removeAttrs fetchAttrs [ "sha256" ];
|
||||||
|
|
||||||
in stdenv.mkDerivation (fBuildAttrs // {
|
in stdenv.mkDerivation (fBuildAttrs // {
|
||||||
inherit name bazelFlags bazelTarget;
|
inherit name bazelFlags bazelBuildFlags bazelFetchFlags bazelTarget;
|
||||||
|
|
||||||
deps = stdenv.mkDerivation (fFetchAttrs // {
|
deps = stdenv.mkDerivation (fFetchAttrs // {
|
||||||
name = "${name}-deps";
|
name = "${name}-deps";
|
||||||
inherit bazelFlags bazelTarget;
|
inherit bazelFlags bazelBuildFlags bazelFetchFlags bazelTarget;
|
||||||
|
|
||||||
nativeBuildInputs = fFetchAttrs.nativeBuildInputs or [] ++ [ bazel ];
|
nativeBuildInputs = fFetchAttrs.nativeBuildInputs or [] ++ [ bazel ];
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ in stdenv.mkDerivation (fBuildAttrs // {
|
||||||
fetch \
|
fetch \
|
||||||
--loading_phase_threads=1 \
|
--loading_phase_threads=1 \
|
||||||
$bazelFlags \
|
$bazelFlags \
|
||||||
|
$bazelFetchFlags \
|
||||||
$bazelTarget
|
$bazelTarget
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
|
@ -149,6 +150,7 @@ in stdenv.mkDerivation (fBuildAttrs // {
|
||||||
"''${host_linkopts[@]}" \
|
"''${host_linkopts[@]}" \
|
||||||
'' + ''
|
'' + ''
|
||||||
$bazelFlags \
|
$bazelFlags \
|
||||||
|
$bazelBuildFlags \
|
||||||
$bazelTarget
|
$bazelTarget
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
|
|
Loading…
Reference in New Issue