haskell.packages.*.cabal-install{,-solver}: unify overrides

Since the overrides are practically the same for all but the latest GHC
version, we can move the override into configuration-common.nix and rely
on a few conditionals in the overlay assembly — and end up with less
copying around!
This commit is contained in:
sternenseemann 2023-02-18 19:18:05 +01:00
parent 1a26447738
commit bdbfe10efb
5 changed files with 25 additions and 51 deletions

View file

@ -20,6 +20,31 @@ with haskellLib;
self: super: {
# cabal-install needs most recent versions of Cabal and Cabal-syntax,
# so we need to put some extra work for non-latest GHCs
inherit (
let
# !!! Use cself/csuper inside for the actual overrides
cabalInstallOverlay = cself: csuper:
lib.optionalAttrs (lib.versionOlder self.ghc.version "9.4") {
Cabal = cself.Cabal_3_8_1_0;
Cabal-syntax = cself.Cabal-syntax_3_8_1_0;
process = cself.process_1_6_16_0;
} // lib.optionalAttrs (lib.versions.majorMinor self.ghc.version == "8.10") {
# Prevent dependency on doctest which causes an inconsistent dependency
# due to depending on ghc-8.10.7 (with bundled process) vs. process 1.6.16.0
vector = dontCheck csuper.vector;
};
in
{
cabal-install = super.cabal-install.overrideScope cabalInstallOverlay;
cabal-install-solver = super.cabal-install-solver.overrideScope cabalInstallOverlay;
}
) cabal-install
cabal-install-solver
;
# There are numerical tests on random data, that may fail occasionally
lapack = dontCheck super.lapack;

View file

@ -48,21 +48,6 @@ self: super: {
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_2_2_1;
# cabal-install needs most recent versions of Cabal and Cabal-syntax
cabal-install = super.cabal-install.overrideScope (self: super: {
Cabal = self.Cabal_3_8_1_0;
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
process = self.process_1_6_16_0;
# Prevent dependency on doctest which causes an inconsistent dependency
# due to depending on ghc-8.10.7 (with bundled process) vs. process 1.6.16.0
vector = dontCheck super.vector;
});
cabal-install-solver = super.cabal-install-solver.overrideScope (self: super: {
Cabal = self.Cabal_3_8_1_0;
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
process = self.process_1_6_16_0;
});
# Additionally depends on OneTuple for GHC < 9.0
base-compat-batteries = addBuildDepend self.OneTuple super.base-compat-batteries;

View file

@ -54,18 +54,6 @@ self: super: {
# This build needs a newer version of Cabal.
cabal2spec = super.cabal2spec.override { Cabal = self.Cabal_3_2_1_0; };
# cabal-install needs most recent versions of Cabal and Cabal-syntax
cabal-install = super.cabal-install.overrideScope (self: super: {
Cabal = self.Cabal_3_8_1_0;
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
process = self.process_1_6_16_0;
});
cabal-install-solver = super.cabal-install-solver.overrideScope (self: super: {
Cabal = self.Cabal_3_8_1_0;
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
process = self.process_1_6_16_0;
});
# Additionally depends on OneTuple for GHC < 9.0
base-compat-batteries = addBuildDepend self.OneTuple super.base-compat-batteries;

View file

@ -49,18 +49,6 @@ self: super: {
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_2_2_1;
# cabal-install needs the latest/matching versions of Cabal-syntax and Cabal
cabal-install = super.cabal-install.overrideScope (self: super: {
Cabal = self.Cabal_3_8_1_0;
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
process = self.process_1_6_16_0;
});
cabal-install-solver = super.cabal-install-solver.overrideScope (self: super: {
Cabal = self.Cabal_3_8_1_0;
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
process = self.process_1_6_16_0;
});
# Jailbreaks & Version Updates
# This `doJailbreak` can be removed once the following PR is released to Hackage:

View file

@ -49,18 +49,6 @@ self: super: {
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_2_2_1;
# cabal-install needs most recent versions of Cabal and Cabal-syntax
cabal-install = super.cabal-install.overrideScope (self: super: {
Cabal = self.Cabal_3_8_1_0;
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
process = self.process_1_6_16_0;
});
cabal-install-solver = super.cabal-install-solver.overrideScope (self: super: {
Cabal = self.Cabal_3_8_1_0;
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
process = self.process_1_6_16_0;
});
# weeder == 2.5.* requires GHC 9.4
weeder = doDistribute self.weeder_2_4_1;