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

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

@ -3,7 +3,7 @@
rec { rec {
overrideCabal = drv: f: (drv.override (args: args // { 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; overrideScope = scope: overrideCabal (drv.overrideScope scope) f;
}; };