Add haskell.lib.setBuiltTarget, and support non library compiling of a single target
This commit is contained in:
@@ -196,6 +196,16 @@ rec {
|
||||
appendPatch = drv: x: appendPatches drv [x];
|
||||
appendPatches = drv: xs: overrideCabal drv (drv: { patches = (drv.patches or []) ++ xs; });
|
||||
|
||||
/* Set a specific build target instead of compiling all targets in the package.
|
||||
* For example, imagine we have a .cabal file with a library, and 2 executables "dev" and "server".
|
||||
* We can build only "server" and not wait on the compilation of "dev" by useing setBuildTarget as follows:
|
||||
*
|
||||
* setBuildTarget (callCabal2nix "thePackageName" thePackageSrc {}) "server"
|
||||
*
|
||||
*/
|
||||
setBuildTargets = drv: xs: overrideCabal drv (drv: { buildTarget = lib.concatStringsSep " " xs; });
|
||||
setBuildTarget = drv: x: setBuildTargets drv [x];
|
||||
|
||||
doHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = true; });
|
||||
dontHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = false; });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user