diff --git a/pkgs/development/haskell-modules/configuration-ghc-6.12.x.nix b/pkgs/development/haskell-modules/configuration-ghc-6.12.x.nix new file mode 100644 index 000000000000..59280505fb6b --- /dev/null +++ b/pkgs/development/haskell-modules/configuration-ghc-6.12.x.nix @@ -0,0 +1,60 @@ +{ pkgs }: + +with import ./lib.nix { inherit pkgs; }; + +self: super: { + + # Disable GHC 6.12.x core libraries. + array = null; + base = null; + bin-package-db = null; + bytestring = null; + Cabal = null; + containers = null; + directory = null; + dph-base = null; + dph-par = null; + dph-prim-interface = null; + dph-prim-par = null; + dph-prim-seq = null; + dph-seq = null; + extensible-exceptions = null; + ffi = null; + filepath = null; + ghc-binary = null; + ghc-prim = null; + haskell98 = null; + hpc = null; + integer-gmp = null; + old-locale = null; + old-time = null; + pretty = null; + process = null; + random = null; + rts = null; + syb = null; + template-haskell = null; + time = null; + unix = null; + + # binary is not a core library for this compiler. + binary = self.binary_0_7_2_3; + + # deepseq is not a core library for this compiler. + deepseq = self.deepseq_1_4_0_0; + + # transformers is not a core library for this compiler. + transformers = self.transformers_0_4_2_0; + mtl = self.mtl_2_2_1; + transformers-compat = disableCabalFlag super.transformers-compat "three"; + + # https://github.com/tibbe/hashable/issues/85 + hashable = dontCheck super.hashable; + + # Needs Cabal >= 1.18.x. + jailbreak-cabal = super.jailbreak-cabal.override { Cabal = self.Cabal_1_18_1_6; }; + + # Haddock chokes on the prologue from the cabal file. + ChasingBottoms = dontHaddock super.ChasingBottoms; + +} diff --git a/pkgs/development/haskell-modules/configuration-ghc-7.0.x.nix b/pkgs/development/haskell-modules/configuration-ghc-7.0.x.nix new file mode 100644 index 000000000000..bd8b09d040d7 --- /dev/null +++ b/pkgs/development/haskell-modules/configuration-ghc-7.0.x.nix @@ -0,0 +1,54 @@ +{ pkgs }: + +with import ./lib.nix { inherit pkgs; }; + +self: super: { + + # Disable GHC 7.0.x core libraries. + array = null; + base = null; + bin-package-db = null; + bytestring = null; + Cabal = null; + containers = null; + directory = null; + extensible-exceptions = null; + ffi = null; + filepath = null; + ghc-binary = null; + ghc-prim = null; + haskell2010 = null; + haskell98 = null; + hpc = null; + integer-gmp = null; + old-locale = null; + old-time = null; + pretty = null; + process = null; + random = null; + rts = null; + template-haskell = null; + time = null; + unix = null; + + # binary is not a core library for this compiler. + binary = self.binary_0_7_2_3; + + # deepseq is not a core library for this compiler. + deepseq = self.deepseq_1_4_0_0; + + # transformers is not a core library for this compiler. + transformers = self.transformers_0_4_2_0; + mtl = self.mtl_2_2_1; + transformers-compat = disableCabalFlag super.transformers-compat "three"; + + # https://github.com/tibbe/hashable/issues/85 + hashable = dontCheck super.hashable; + + # Needs Cabal >= 1.18.x. + jailbreak-cabal = super.jailbreak-cabal.override { Cabal = self.Cabal_1_18_1_6; }; + + # Haddock chokes on the prologue from the cabal file. + ChasingBottoms = dontHaddock super.ChasingBottoms; + +} diff --git a/pkgs/development/haskell-modules/configuration-ghc-7.2.x.nix b/pkgs/development/haskell-modules/configuration-ghc-7.2.x.nix new file mode 100644 index 000000000000..d35285dea408 --- /dev/null +++ b/pkgs/development/haskell-modules/configuration-ghc-7.2.x.nix @@ -0,0 +1,54 @@ +{ pkgs }: + +with import ./lib.nix { inherit pkgs; }; + +self: super: { + + # Disable GHC 7.2.x core libraries. + array = null; + base = null; + binary = null; + bin-package-db = null; + bytestring = null; + Cabal = null; + containers = null; + directory = null; + extensible-exceptions = null; + ffi = null; + filepath = null; + ghc-prim = null; + haskell2010 = null; + haskell98 = null; + hoopl = null; + hpc = null; + integer-gmp = null; + old-locale = null; + old-time = null; + pretty = null; + process = null; + rts = null; + template-haskell = null; + time = null; + unix = null; + + # deepseq is not a core library for this compiler. + deepseq = self.deepseq_1_4_0_0; + + # transformers is not a core library for this compiler. + transformers = self.transformers_0_4_2_0; + mtl = self.mtl_2_2_1; + transformers-compat = disableCabalFlag super.transformers-compat "three"; + + # 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; }; + + # https://github.com/tibbe/hashable/issues/85 + hashable = dontCheck super.hashable; + + # Needs Cabal >= 1.18.x. + jailbreak-cabal = super.jailbreak-cabal.override { Cabal = self.Cabal_1_18_1_6; }; + + # Haddock chokes on the prologue from the cabal file. + ChasingBottoms = dontHaddock super.ChasingBottoms; + +} diff --git a/pkgs/development/haskell-modules/configuration-ghc-7.4.x.nix b/pkgs/development/haskell-modules/configuration-ghc-7.4.x.nix new file mode 100644 index 000000000000..aa54f736dabf --- /dev/null +++ b/pkgs/development/haskell-modules/configuration-ghc-7.4.x.nix @@ -0,0 +1,51 @@ +{ pkgs }: + +with import ./lib.nix { inherit pkgs; }; + +self: super: { + + # Disable GHC 7.4.x core libraries. + array = null; + base = null; + binary = null; + bin-package-db = null; + bytestring = null; + Cabal = null; + containers = null; + deepseq = null; + directory = null; + extensible-exceptions = null; + filepath = null; + ghc-prim = null; + haskell2010 = null; + haskell98 = null; + hoopl = null; + hpc = null; + integer-gmp = null; + old-locale = null; + old-time = null; + pretty = null; + process = null; + rts = null; + template-haskell = null; + time = null; + unix = null; + + # transformers is not a core library for this compiler. + transformers = self.transformers_0_4_2_0; + mtl = self.mtl_2_2_1; + transformers-compat = disableCabalFlag super.transformers-compat "three"; + + # 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; }; + + # https://github.com/tibbe/hashable/issues/85 + hashable = dontCheck super.hashable; + + # Needs Cabal >= 1.18.x. + jailbreak-cabal = super.jailbreak-cabal.override { Cabal = self.Cabal_1_18_1_6; }; + + # Haddock chokes on the prologue from the cabal file. + ChasingBottoms = dontHaddock super.ChasingBottoms; + +} diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index c0c3be07df30..0f98ded5eb14 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -55,6 +55,9 @@ let main = defaultMain ''; + ghc76xOrLater = stdenv.lib.versionOlder "7.6" ghc.version; + packageDbFlag = if ghc76xOrLater then "package-db" else "package-conf"; + defaultConfigureFlags = [ (enableFeature enableSplitObjs "split-objs") (enableFeature enableLibraryProfiling "library-profiling") @@ -146,7 +149,7 @@ stdenv.mkDerivation ({ fi done done - ghc-pkg --package-db="$packageConfDir" recache + ghc-pkg --${packageDbFlag}="$packageConfDir" recache configureFlags+=" --package-db=$packageConfDir" ${optionalString (editedCabalFile != null) '' @@ -162,7 +165,7 @@ stdenv.mkDerivation ({ for i in Setup.hs Setup.lhs ${defaultSetupHs}; do test -f $i && break done - ghc ${optionalString (! coreSetup) "-package-db=$packageConfDir "}$setupCompileFlags --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i + ghc ${optionalString (! coreSetup) "-${packageDbFlag}=$packageConfDir "}$setupCompileFlags --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i echo configureFlags: $configureFlags unset GHC_PACKAGE_PATH # Cabal complains if this variable is set during configure. diff --git a/pkgs/top-level/haskell-ng.nix b/pkgs/top-level/haskell-ng.nix index ca9982c65ddd..17fe57df5e71 100644 --- a/pkgs/top-level/haskell-ng.nix +++ b/pkgs/top-level/haskell-ng.nix @@ -26,10 +26,22 @@ rec { packages = { ghc6104 = callPackage ../development/haskell-modules { ghc = compiler.ghc6104; }; - ghc6123 = callPackage ../development/haskell-modules { ghc = compiler.ghc6123; }; - ghc704 = callPackage ../development/haskell-modules { ghc = compiler.ghc704; }; - ghc722 = callPackage ../development/haskell-modules { ghc = compiler.ghc722; }; - ghc742 = callPackage ../development/haskell-modules { ghc = compiler.ghc742; }; + ghc6123 = callPackage ../development/haskell-modules { + ghc = compiler.ghc6123; + packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-6.12.x.nix { }; + }; + ghc704 = callPackage ../development/haskell-modules { + ghc = compiler.ghc704; + packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-7.0.x.nix { }; + }; + ghc722 = callPackage ../development/haskell-modules { + ghc = compiler.ghc722; + packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-7.2.x.nix { }; + }; + ghc742 = callPackage ../development/haskell-modules { + ghc = compiler.ghc742; + packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-7.4.x.nix { }; + }; ghc763 = callPackage ../development/haskell-modules { ghc = compiler.ghc763; packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-7.6.x.nix { };