haskell: add support for 'hardeningDisable' to the generic builder

We also have a new helper function 'disableHardening' to use in
overrides. Fixes https://github.com/NixOS/nixpkgs/issues/14820.
This commit is contained in:
Peter Simons 2016-09-14 18:58:46 +02:00
parent aa1d424421
commit 97fd905823
2 changed files with 4 additions and 0 deletions

View File

@ -47,6 +47,7 @@
, shellHook ? ""
, coreSetup ? false # Use only core packages to build Setup.hs.
, useCpphs ? false
, hardeningDisable ? []
} @ args:
assert editedCabalFile != null -> revision != null;
@ -329,5 +330,6 @@ stdenv.mkDerivation ({
// optionalAttrs (preFixup != "") { inherit preFixup; }
// optionalAttrs (postFixup != "") { inherit postFixup; }
// optionalAttrs (dontStrip) { inherit dontStrip; }
// optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; }
// optionalAttrs (stdenv.isLinux) { LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
)

View File

@ -62,6 +62,8 @@ rec {
doHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = true; });
dontHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = false; });
disableHardening = drv: flags: overrideCabal drv (drv: { hardeningDisable = flags; });
sdistTarball = pkg: pkgs.lib.overrideDerivation pkg (drv: {
name = "${drv.pname}-source-${drv.version}";
buildPhase = "./Setup sdist";