haskell infra: Adds buildFlags logic
This commit is contained in:
parent
affeb0cb80
commit
87afa66a63
@ -19,6 +19,7 @@ in
|
||||
, buildTarget ? ""
|
||||
, buildTools ? [], libraryToolDepends ? [], executableToolDepends ? [], testToolDepends ? [], benchmarkToolDepends ? []
|
||||
, configureFlags ? []
|
||||
, buildFlags ? []
|
||||
, description ? ""
|
||||
, doCheck ? !isCross && stdenv.lib.versionOlder "7.4" ghc.version
|
||||
, doBenchmark ? false
|
||||
@ -130,6 +131,8 @@ let
|
||||
crossCabalFlagsString =
|
||||
stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags);
|
||||
|
||||
buildFlagsString = optionalString (buildFlags != []) (" " + concatStringsSep " " buildFlags);
|
||||
|
||||
defaultConfigureFlags = [
|
||||
"--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid"
|
||||
(optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
|
||||
@ -345,7 +348,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
${setupCommand} build ${buildTarget}${crossCabalFlagsString}
|
||||
${setupCommand} build ${buildTarget}${crossCabalFlagsString}${buildFlagsString}
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
|
@ -131,6 +131,8 @@ rec {
|
||||
*/
|
||||
appendConfigureFlag = drv: x: overrideCabal drv (drv: { configureFlags = (drv.configureFlags or []) ++ [x]; });
|
||||
|
||||
appendBuildFlag = drv: x: overrideCabal drv (drv: { buildFlags = (drv.buildFlags or []) ++ [x]; });
|
||||
appendBuildFlags = drv: xs: overrideCabal drv (drv: { buildFlags = (drv.buildFlags or []) ++ xs; });
|
||||
/* removeConfigureFlag drv x is a Haskell package like drv, but with
|
||||
all cabal configure arguments that are equal to x removed.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user