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:
parent
aa1d424421
commit
97fd905823
@ -47,6 +47,7 @@
|
|||||||
, shellHook ? ""
|
, shellHook ? ""
|
||||||
, coreSetup ? false # Use only core packages to build Setup.hs.
|
, coreSetup ? false # Use only core packages to build Setup.hs.
|
||||||
, useCpphs ? false
|
, useCpphs ? false
|
||||||
|
, hardeningDisable ? []
|
||||||
} @ args:
|
} @ args:
|
||||||
|
|
||||||
assert editedCabalFile != null -> revision != null;
|
assert editedCabalFile != null -> revision != null;
|
||||||
@ -329,5 +330,6 @@ stdenv.mkDerivation ({
|
|||||||
// optionalAttrs (preFixup != "") { inherit preFixup; }
|
// optionalAttrs (preFixup != "") { inherit preFixup; }
|
||||||
// optionalAttrs (postFixup != "") { inherit postFixup; }
|
// optionalAttrs (postFixup != "") { inherit postFixup; }
|
||||||
// optionalAttrs (dontStrip) { inherit dontStrip; }
|
// optionalAttrs (dontStrip) { inherit dontStrip; }
|
||||||
|
// optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; }
|
||||||
// optionalAttrs (stdenv.isLinux) { LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
|
// optionalAttrs (stdenv.isLinux) { LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
|
||||||
)
|
)
|
||||||
|
@ -62,6 +62,8 @@ rec {
|
|||||||
doHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = true; });
|
doHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = true; });
|
||||||
dontHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = false; });
|
dontHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = false; });
|
||||||
|
|
||||||
|
disableHardening = drv: flags: overrideCabal drv (drv: { hardeningDisable = flags; });
|
||||||
|
|
||||||
sdistTarball = pkg: pkgs.lib.overrideDerivation pkg (drv: {
|
sdistTarball = pkg: pkgs.lib.overrideDerivation pkg (drv: {
|
||||||
name = "${drv.pname}-source-${drv.version}";
|
name = "${drv.pname}-source-${drv.version}";
|
||||||
buildPhase = "./Setup sdist";
|
buildPhase = "./Setup sdist";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user