Merge pull request #22613 from shajra/fix/9871-3

Haskell infrastructure: fix #9871 (overrideCabal)
This commit is contained in:
Domen Kožar 2017-02-27 12:54:27 +01:00 committed by GitHub
commit e649974271
2 changed files with 5 additions and 6 deletions

View File

@ -6,12 +6,13 @@
let
inherit (stdenv.lib) fix' extends;
inherit (stdenv.lib) fix' extends makeOverridable;
inherit (import ./lib.nix { inherit pkgs; }) overrideCabal;
haskellPackages = self:
let
mkDerivation = pkgs.callPackage ./generic-builder.nix {
mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
inherit stdenv;
inherit (pkgs) fetchurl pkgconfig glibcLocales coreutils gnugrep gnused;
jailbreak-cabal = if (self.ghc.cross or null) != null
@ -37,9 +38,7 @@ let
});
};
overrideCabal = drv: f: drv.override (args: args // {
mkDerivation = drv: args.mkDerivation (drv // f drv);
});
mkDerivation = makeOverridable mkDerivationImpl;
callPackageWithScope = scope: drv: args: (stdenv.lib.callPackageWith scope drv args) // {
overrideScope = f: callPackageWithScope (mkScope (fix' (extends f scope.__unfix__))) drv args;

View File

@ -3,7 +3,7 @@
rec {
overrideCabal = drv: f: (drv.override (args: args // {
mkDerivation = drv: args.mkDerivation (drv // f drv);
mkDerivation = drv: (args.mkDerivation drv).override f;
})) // {
overrideScope = scope: overrideCabal (drv.overrideScope scope) f;
};