2015-01-10 20:26:08 +01:00
|
|
|
{ pkgs }:
|
|
|
|
|
|
|
|
rec {
|
2015-01-07 20:31:32 +01:00
|
|
|
|
2015-01-12 18:20:42 +01:00
|
|
|
overrideCabal = drv: f: (drv.override (args: args // {
|
2015-01-07 20:31:32 +01:00
|
|
|
mkDerivation = drv: args.mkDerivation (drv // f drv);
|
2015-01-12 18:20:42 +01:00
|
|
|
})) // {
|
2015-01-12 18:18:46 +01:00
|
|
|
overrideScope = scope: overrideCabal (drv.overrideScope scope) f;
|
2015-01-12 18:20:42 +01:00
|
|
|
};
|
2015-01-07 20:31:32 +01:00
|
|
|
|
2015-01-18 11:04:38 +01:00
|
|
|
doHaddock = drv: overrideCabal drv (drv: { doHaddock = true; });
|
|
|
|
dontHaddock = drv: overrideCabal drv (drv: { doHaddock = false; });
|
2015-01-10 20:26:08 +01:00
|
|
|
|
|
|
|
doJailbreak = drv: overrideCabal drv (drv: { jailbreak = true; });
|
|
|
|
dontJailbreak = drv: overrideCabal drv (drv: { jailbreak = false; });
|
|
|
|
|
2015-01-12 01:28:15 +01:00
|
|
|
doCheck = drv: overrideCabal drv (drv: { doCheck = true; });
|
2015-01-10 20:26:08 +01:00
|
|
|
dontCheck = drv: overrideCabal drv (drv: { doCheck = false; });
|
|
|
|
|
|
|
|
dontDistribute = drv: overrideCabal drv (drv: { hydraPlatforms = []; });
|
|
|
|
|
2015-01-12 01:28:15 +01:00
|
|
|
appendConfigureFlag = drv: x: overrideCabal drv (drv: { configureFlags = (drv.configureFlags or []) ++ [x]; });
|
2015-01-10 20:26:08 +01:00
|
|
|
removeConfigureFlag = drv: x: overrideCabal drv (drv: { configureFlags = pkgs.stdenv.lib.remove x (drv.configureFlags or []); });
|
|
|
|
|
2015-01-19 14:59:04 +01:00
|
|
|
addBuildTool = drv: x: addBuildTools drv [x];
|
|
|
|
addBuildTools = drv: xs: overrideCabal drv (drv: { buildTools = (drv.buildTools or []) ++ xs; });
|
|
|
|
|
2015-01-20 23:50:38 +01:00
|
|
|
addBuildDepend = drv: x: addBuildDepends drv [x];
|
|
|
|
addBuildDepends = drv: xs: overrideCabal drv (drv: { buildDepends = (drv.buildDepends or []) ++ xs; });
|
|
|
|
|
2015-01-10 20:26:08 +01:00
|
|
|
enableCabalFlag = drv: x: appendConfigureFlag (removeConfigureFlag drv "-f-${x}") "-f${x}";
|
|
|
|
disableCabalFlag = drv: x: appendConfigureFlag (removeConfigureFlag drv "-f${x}") "-f-${x}";
|
|
|
|
|
2015-01-12 16:12:33 +01:00
|
|
|
markBroken = drv: overrideCabal (drv: { broken = true; });
|
|
|
|
|
2015-01-13 12:28:17 +01:00
|
|
|
enableLibraryProfiling = drv: overrideCabal drv (drv: { enableLibraryProfiling = true; });
|
|
|
|
disableLibraryProfiling = drv: overrideCabal drv (drv: { enableLibraryProfiling = false; });
|
|
|
|
|
|
|
|
enableSharedExecutables = drv: overrideCabal drv ( { enableSharedExecutables = true; });
|
|
|
|
disableSharedExecutables = drv: overrideCabal drv ( { enableSharedExecutables = false; });
|
|
|
|
|
|
|
|
enableSharedLibraries = drv: overrideCabal drv (drv: { enableSharedLibraries = true; });
|
|
|
|
disableSharedLibraries = drv: overrideCabal drv (drv: { enableSharedLibraries = false; });
|
|
|
|
|
|
|
|
enableSplitObjs = drv: overrideCabal drv (drv: { enableSplitObjs = true; });
|
|
|
|
disableSplitObjs = drv: overrideCabal drv (drv: { enableSplitObjs = false; });
|
|
|
|
|
|
|
|
enableStaticLibraries = drv: overrideCabal drv (drv: { enableStaticLibraries = true; });
|
|
|
|
disableStaticLibraries = drv: overrideCabal drv (drv: { enableStaticLibraries = false; });
|
|
|
|
|
2015-01-07 20:31:32 +01:00
|
|
|
}
|