about summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix')
-rw-r--r--pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix32
1 files changed, 22 insertions, 10 deletions
diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix
index 8b4399af2076..137647da8b51 100644
--- a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix
+++ b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix
@@ -4,6 +4,7 @@ with haskellLib;
 
 let
   inherit (pkgs.stdenv.hostPlatform) isDarwin;
+  inherit (pkgs) lib;
 in
 
 self: super: {
@@ -58,9 +59,6 @@ self: super: {
   # their existence to callPackages, but their is no shim for lower GHC versions.
   system-cxx-std-lib = null;
 
-  # Additionally depends on OneTuple for GHC < 9.0
-  base-compat-batteries = addBuildDepend self.OneTuple super.base-compat-batteries;
-
   # For GHC < 9.4, some packages need data-array-byte as an extra dependency
   primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
   hashable = addBuildDepends [
@@ -120,13 +118,6 @@ self: super: {
   # Overly-strict bounds introducted by a revision in version 0.3.2.
   text-metrics = doJailbreak super.text-metrics;
 
-  # OneTuple needs hashable (instead of ghc-prim) and foldable1-classes-compat for GHC < 9
-  OneTuple = addBuildDepends [
-    self.foldable1-classes-compat
-  ] (super.OneTuple.override {
-    ghc-prim = self.hashable;
-  });
-
   # Doesn't build with 9.0, see https://github.com/yi-editor/yi/issues/1125
   yi-core = doDistribute (markUnbroken super.yi-core);
 
@@ -170,4 +161,25 @@ self: super: {
 
   # No instance for (Show B.Builder) arising from a use of ‘print’
   http-types = dontCheck super.http-types;
+
+  # Packages which need compat library for GHC < 9.6
+  inherit
+    (lib.mapAttrs
+      (_: addBuildDepends [ self.foldable1-classes-compat ])
+      super)
+    indexed-traversable
+    these
+  ;
+  base-compat-batteries = addBuildDepends [
+    self.foldable1-classes-compat
+    self.OneTuple
+  ] super.base-compat-batteries;
+
+  # OneTuple needs hashable (instead of ghc-prim) and foldable1-classes-compat for GHC < 9
+  OneTuple = addBuildDepends [
+    self.foldable1-classes-compat
+    self.base-orphans
+  ] (super.OneTuple.override {
+    ghc-prim = self.hashable;
+  });
 }