From f8710f9d81d198ea39538c6a492893005f54051f Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Mon, 19 Jan 2015 14:59:04 +0100 Subject: [PATCH] haskell-ng: fix several builds with old versions of GHC --- .../haskell-modules/configuration-common.nix | 15 +++++++++++++++ .../haskell-modules/configuration-ghc-6.12.x.nix | 15 ++++++++++++++- .../haskell-modules/configuration-ghc-7.0.x.nix | 6 ++++++ .../haskell-modules/configuration-ghc-7.6.x.nix | 8 ++++++-- .../haskell-modules/hackage-packages.nix | 13 +++++++++++++ pkgs/development/haskell-modules/lib.nix | 3 +++ 6 files changed, 57 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 5d928851a744..00eb3f32621e 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -134,6 +134,21 @@ self: super: { # tests don't compile for some odd reason jwt = dontCheck super.jwt; + + # Allow building with mtl 2.2. Upstream has been notified by e-mail. + tabular = doJailbreak super.tabular; + + # https://github.com/liamoc/wizards/issues/5 + wizards = doJailbreak super.wizards; + + # https://github.com/ekmett/trifecta/issues/41 + trifecta = overrideCabal super.trifecta (drv: { + patches = [ + (pkgs.fetchpatch { + url = "https://github.com/ekmett/trifecta/pull/40.patch"; + sha256 = "0q8j9zwi5q651q5zd3mz52nz4ki36rvixbkp20nx2vf5imi050bq"; + })];}); + } // { # Not on Hackage yet. diff --git a/pkgs/development/haskell-modules/configuration-ghc-6.12.x.nix b/pkgs/development/haskell-modules/configuration-ghc-6.12.x.nix index 6641b27f0fd7..63a94f1585fb 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-6.12.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-6.12.x.nix @@ -41,7 +41,8 @@ self: super: { binary = self.binary_0_7_2_3; # deepseq is not a core library for this compiler. - deepseq = self.deepseq_1_4_0_0; + deepseq_1_3_0_1 = dontJailbreak super.deepseq_1_3_0_1; + deepseq = self.deepseq_1_3_0_1; # transformers is not a core library for this compiler. transformers = self.transformers_0_4_2_0; @@ -62,4 +63,16 @@ self: super: { patchPhase = "sed -ir -e 's|Extensions: | Extensions: UndecidableInstances, |' utf8-string.cabal"; }); + # https://github.com/haskell/HTTP/issues/80 + HTTP = doJailbreak super.HTTP; + + # 6.12.3 doesn't support the latest version. + primitive = self.primitive_0_5_1_0; + + # These packages need more recent versions of core libraries to compile. + happy = addBuildTools super.happy [self.Cabal_1_18_1_6 self.containers_0_4_2_1]; + network-uri = addBuildTool super.network-uri self.Cabal_1_18_1_6; + stm = addBuildTool super.stm self.Cabal_1_18_1_6; + split = super.split_0_1_4_3; + } diff --git a/pkgs/development/haskell-modules/configuration-ghc-7.0.x.nix b/pkgs/development/haskell-modules/configuration-ghc-7.0.x.nix index bd8b09d040d7..78f3479ddb58 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-7.0.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-7.0.x.nix @@ -51,4 +51,10 @@ self: super: { # Haddock chokes on the prologue from the cabal file. ChasingBottoms = dontHaddock super.ChasingBottoms; + # https://github.com/haskell/containers/issues/134 + containers_0_4_2_1 = doJailbreak super.containers_0_4_2_1; + + # These packages need more recent versions of core libraries to compile. + happy = addBuildTools super.happy [self.containers_0_4_2_1 self.deepseq_1_3_0_1 self.containers_0_4_2_1]; + } diff --git a/pkgs/development/haskell-modules/configuration-ghc-7.6.x.nix b/pkgs/development/haskell-modules/configuration-ghc-7.6.x.nix index 820a44c6b4ff..e9bef1e6c9a2 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-7.6.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-7.6.x.nix @@ -16,7 +16,6 @@ self: super: { directory = null; filepath = null; ghc-prim = null; - haskeline = null; haskell2010 = null; haskell98 = null; hoopl = null; @@ -28,7 +27,6 @@ self: super: { process = null; rts = null; template-haskell = null; - terminfo = null; time = null; unix = null; @@ -37,6 +35,10 @@ self: super: { mtl = self.mtl_2_2_1; transformers-compat = disableCabalFlag super.transformers-compat "three"; + # haskeline and terminfo are not core libraries for this compiler. + haskeline = self.haskeline_0_7_1_3; + terminfo = self.terminfo_0_4_0_0; + # https://github.com/haskell/cabal/issues/2322 Cabal_1_22_0_0 = super.Cabal_1_22_0_0.override { binary = self.binary_0_7_2_3; }; @@ -49,4 +51,6 @@ self: super: { # Haddock chokes on the prologue from the cabal file. ChasingBottoms = dontHaddock super.ChasingBottoms; + # wizards = doJailbreak super.wizards; + } diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index d64a748e0e46..59999ae59849 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -104788,6 +104788,19 @@ self: { hydraPlatforms = stdenv.lib.platforms.none; }) {}; + "split_0_1_4_3" = callPackage + ({ mkDerivation, base }: + mkDerivation { + pname = "split"; + version = "0.1.4.3"; + sha256 = "1i9vmb0zvmhqj6qcbnsapsk9lhsyzznz336c8s7v4sz20s99hsby"; + buildDepends = [ base ]; + jailbreak = true; + homepage = "http://code.haskell.org/~byorgey/code/split"; + description = "Combinator library for splitting lists"; + license = stdenv.lib.licenses.bsd3; + }) {}; + "split" = callPackage ({ mkDerivation, base, QuickCheck }: mkDerivation { diff --git a/pkgs/development/haskell-modules/lib.nix b/pkgs/development/haskell-modules/lib.nix index 4d0afb33ca01..cc2077ebf86c 100644 --- a/pkgs/development/haskell-modules/lib.nix +++ b/pkgs/development/haskell-modules/lib.nix @@ -22,6 +22,9 @@ rec { appendConfigureFlag = drv: x: overrideCabal drv (drv: { configureFlags = (drv.configureFlags or []) ++ [x]; }); removeConfigureFlag = drv: x: overrideCabal drv (drv: { configureFlags = pkgs.stdenv.lib.remove x (drv.configureFlags or []); }); + addBuildTool = drv: x: addBuildTools drv [x]; + addBuildTools = drv: xs: overrideCabal drv (drv: { buildTools = (drv.buildTools or []) ++ xs; }); + enableCabalFlag = drv: x: appendConfigureFlag (removeConfigureFlag drv "-f-${x}") "-f${x}"; disableCabalFlag = drv: x: appendConfigureFlag (removeConfigureFlag drv "-f${x}") "-f-${x}";