Replace old "haskellPackages" code with Haskell NG.

This commit is contained in:
Peter Simons 2015-04-19 18:47:45 +02:00
parent 90f76ab941
commit c0c82ea2eb
4 changed files with 79 additions and 3606 deletions

View file

@ -3775,42 +3775,9 @@ let
# Haskell and GHC # Haskell and GHC
# Import Haskell infrastructure. haskell = callPackage ./haskell-packages.nix { };
haskell = let pkgs_ = pkgs // { /* add necessary overrides here */ }; haskellPackages = haskell.packages.ghc7101.override {
callPackage = newScope pkgs_;
newScope = extra: lib.callPackageWith (pkgs_ // pkgs_.xorg // extra);
in callPackage ./haskell-defaults.nix { pkgs = pkgs_; inherit callPackage newScope; };
# Available GHC versions.
# For several compiler versions, we export a large set of Haskell-related
# packages.
# NOTE (recurseIntoAttrs): After discussion, we originally decided to
# enable it for all GHC versions. However, this is getting too much,
# particularly in connection with Hydra builds for all these packages.
# So we enable it for selected versions only. We build all ghcs, though
ghc = recurseIntoAttrs (lib.mapAttrs' (name: value:
lib.nameValuePair (builtins.substring (builtins.stringLength "packages_") (builtins.stringLength name) name) value.ghc
) (lib.filterAttrs (name: value:
builtins.substring 0 (builtins.stringLength "packages_") name == "packages_"
) haskell));
haskellPackages_ghc6104 = haskell.packages_ghc6104;
haskellPackages_ghc6123 = haskell.packages_ghc6123;
haskellPackages_ghc704 = haskell.packages_ghc704;
haskellPackages_ghc722 = haskell.packages_ghc722;
haskellPackages_ghc742 = haskell.packages_ghc742;
haskellPackages_ghc763 = haskell.packages_ghc763;
haskellPackages_ghc784_no_profiling = recurseIntoAttrs haskell.packages_ghc784.noProfiling;
haskellPackages_ghc784_profiling = recurseIntoAttrs haskell.packages_ghc784.profiling;
haskellPackages_ghc784 = recurseIntoAttrs haskell.packages_ghc784.highPrio;
haskellPackages = haskellPackages_ghc784;
haskell-ng = callPackage ./haskell-ng.nix { };
haskellngPackages = haskell-ng.packages.ghc7101.override {
overrides = config.haskellPackageOverrides or (self: super: {}); overrides = config.haskellPackageOverrides or (self: super: {});
provideOldAttributeNames = config.provideOldHaskellAttributeNames or false; provideOldAttributeNames = config.provideOldHaskellAttributeNames or false;
}; };
@ -10681,10 +10648,7 @@ let
stratego = callPackage ../applications/editors/emacs-modes/stratego { }; stratego = callPackage ../applications/editors/emacs-modes/stratego { };
structuredHaskellMode = callPackage ../applications/editors/emacs-modes/structured-haskell-mode { structuredHaskellMode = haskellPackages.structured-haskell-mode;
inherit (haskellPackages) cabal ;
haskellSrcExts = haskellPackages.haskellSrcExts_1_15_0_1;
};
sunriseCommander = callPackage ../applications/editors/emacs-modes/sunrise-commander { }; sunriseCommander = callPackage ../applications/editors/emacs-modes/sunrise-commander { };
@ -14462,7 +14426,8 @@ let
buildbotSlave = buildbot-slave; # added 2014-12-09 buildbotSlave = buildbot-slave; # added 2014-12-09
cool-old-term = cool-retro-term; # added 2015-01-31 cool-old-term = cool-retro-term; # added 2015-01-31
rssglx = rss-glx; #added 2015-03-25 rssglx = rss-glx; #added 2015-03-25
haskell-ng = haskell; # 2015-04-19
haskellngPackages = haskellPackages; # 2015-04-19
opentsdb = callPackage ../tools/misc/opentsdb {}; opentsdb = callPackage ../tools/misc/opentsdb {};

View file

@ -1,223 +0,0 @@
# Haskell / GHC infrastructure in Nixpkgs
#
# In this file, we
#
# * define sets of default package versions for each GHC compiler version,
# * associate GHC versions with bootstrap compiler versions and package defaults.
#
# The actual Haskell packages are composed in haskell-packages.nix. There is
# more documentation in there.
{ makeOverridable, lowPrio, hiPrio, stdenv, pkgs, newScope, config, callPackage } : rec {
# haskell-packages.nix provides the latest possible version of every package,
# and this file overrides those version choices per compiler when appropriate.
# Older compilers inherit the overrides from newer ones.
ghcHEADPrefs = self : super : super // {
cabalInstall_1_20_0_6 = super.cabalInstall_1_20_0_6.override { Cabal = null; };
mtl = self.mtl_2_2_1;
};
ghc784Prefs = self : super : ghcHEADPrefs self super // {
cabalInstall_1_20_0_6 = super.cabalInstall_1_20_0_6.override { Cabal = self.Cabal_1_20_0_3; };
codex = super.codex.override { hackageDb = super.hackageDb.override { Cabal = self.Cabal_1_20_0_3; }; };
jailbreakCabal = super.jailbreakCabal.override { Cabal = self.Cabal_1_20_0_3; };
MonadRandom = self.MonadRandom_0_2_0_1; # newer versions require transformers >= 0.4.x
mtl = self.mtl_2_1_3_1;
xhtml = null;
transformersCompat = super.transformersCompat.override { cabal = self.cabal.override {
extension = self: super: { configureFlags = "-fthree " + super.configureFlags or ""; };
}; };
};
ghc763Prefs = self : super : ghc784Prefs self super // {
Cabal_1_22_0_0 = super.Cabal_1_22_0_0.override {
binary = self.binary_0_7_2_2.override { cabal = self.cabal.override { extension = self: super: { doCheck = false; }; }; };
};
aeson = self.aeson_0_7_0_4;
ariadne = super.ariadne.override {
haskellNames = self.haskellNames.override {
haskellPackages = self.haskellPackages.override { Cabal = self.Cabal_1_18_1_3; };
};
};
attoparsec = self.attoparsec_0_11_3_1;
binaryConduit = super.binaryConduit.override { binary = self.binary_0_7_2_2; };
bson = super.bson.override { dataBinaryIeee754 = self.dataBinaryIeee754.override { binary = self.binary_0_7_2_2; }; };
cabalInstall_1_16_0_2 = super.cabalInstall_1_16_0_2.override {
HTTP = self.HTTP.override { network = self.network_2_5_0_0; };
network = self.network_2_5_0_0;
};
criterion = super.criterion.override {
statistics = self.statistics.override {
vectorBinaryInstances = self.vectorBinaryInstances.override { binary = self.binary_0_7_2_2; };
};
};
entropy = super.entropy.override { cabal = self.cabal.override { Cabal = self.Cabal_1_18_1_3; }; };
gloss = null; # requires base >= 4.7
modularArithmetic = null; # requires base >= 4.7
pipesBinary = super.pipesBinary.override { binary = self.binary_0_7_2_2; };
rank1dynamic = super.rank1dynamic.override { binary = self.binary_0_7_2_2; };
distributedStatic = super.distributedStatic.override { binary = self.binary_0_7_2_2; };
networkTransport = super.networkTransport.override { binary = self.binary_0_7_2_2; };
distributedProcess = super.distributedProcess.override { binary = self.binary_0_7_2_2; };
scientific = self.scientific_0_2_0_2;
singletons = null; # requires base >= 4.7
transformers = self.transformers_0_3_0_0; # core packagen in ghc > 7.6.x
zipArchive = super.zipArchive_0_2_2_1; # works without binary 0.7.x
};
ghc742Prefs = self : super : ghc763Prefs self super // {
aeson = self.aeson_0_7_0_4.override { blazeBuilder = self.blazeBuilder; };
extensibleExceptions = null; # core package in ghc <= 7.4.x
hackageDb = super.hackageDb.override { Cabal = self.Cabal_1_16_0_3; };
haskeline = super.haskeline.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
primitive = self.primitive_0_5_3_0; # later versions don't compile
random = self.random_1_0_1_1; # requires base >= 4.6.x
};
ghc722Prefs = self : super : ghc742Prefs self super // {
cabalInstall = self.cabalInstall_1_20_0_6;
caseInsensitive = self.caseInsensitive_1_0_0_1;
deepseq = self.deepseq_1_3_0_2;
DrIFT = null; # doesn't compile with old GHC versions
syb = self.syb_0_4_0;
};
ghc704Prefs = self : super : ghc722Prefs self super // {
binary = self.binary_0_7_2_2; # core package in ghc >= 7.2.2
caseInsensitive = super.caseInsensitive; # undo the override from ghc 7.2.2
HsSyck = self.HsSyck_0_51;
random = null; # core package in ghc <= 7.0.x
};
ghc6123Prefs = self : super : ghc704Prefs self super // {
alex = self.alex_3_1_3;
async = self.async_2_0_1_4;
attoparsec = self.attoparsec_0_10_4_0;
cabalInstall = self.cabalInstall_1_16_0_2;
cgi = self.cgi_3001_1_7_5;
deepseq = self.deepseq_1_2_0_1;
dlist = super.dlist.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
exceptions = null; # none of our versions compile
jailbreakCabal = super.jailbreakCabal.override { Cabal = self.Cabal_1_16_0_3; };
logict = super.logict.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
monadPar = self.monadPar_0_1_0_3;
nats = null; # none of our versions compile
networkUri = super.networkUri.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
parallel = self.parallel_3_2_0_3;
primitive = self.primitive_0_5_0_1;
reflection = super.reflection.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
scientific = null; # none of our versions compile
split = self.split_0_1_4_3;
stm = self.stm_2_4_2;
syb = null; # core package in ghc < 7
tagged = super.tagged.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
temporary = null; # none of our versions compile
vector = super.vector_0_10_9_3;
vectorAlgorithms = super.vectorAlgorithms.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
};
ghc6104Prefs = self : super : ghc6123Prefs self super // {
alex = self.alex_2_3_5.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
async = null; # none of our versions compile
attoparsec = null; # none of our versions compile
binary = super.binary_0_7_2_2.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
cabalInstall_1_16_0_2 = super.cabalInstall_1_16_0_2;
caseInsensitive = super.caseInsensitive.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
happy = super.happy.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
hashable = super.hashable.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
hashtables = super.hashtables.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
hsyslog = super.hsyslog.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
HTTP = super.HTTP.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
HUnit = super.HUnit.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
network = super.network_2_2_1_7.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
parsec = super.parsec.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
QuickCheck = super.QuickCheck.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
stm = self.stm_2_4_2.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
systemFilepath = super.systemFilepath.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
systemFileio = super.systemFileio.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
tar = super.tar.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
text = self.text_0_11_2_3.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
tfRandom = null; # does not compile
time = self.time_1_1_2_4.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
zlib = super.zlib.override { cabal = self.cabal.override { Cabal = self.Cabal_1_16_0_3; }; };
};
# Abstraction for Haskell packages collections
packagesFun = makeOverridable
({ ghc
, prefFun
, extension ? (self : super : {})
, profExplicit ? false, profDefault ? false
, modifyPrio ? lowPrio
} :
let haskellPackagesClass = import ./haskell-packages.nix {
inherit pkgs newScope ghc modifyPrio;
enableLibraryProfiling =
if profExplicit then profDefault
else config.cabal.libraryProfiling or profDefault;
};
haskellPackagesPrefsClass = self : let super = haskellPackagesClass self; in super // prefFun self super;
haskellPackagesExtensionClass = self : let super = haskellPackagesPrefsClass self; in super // extension self super;
haskellPackages = haskellPackagesExtensionClass haskellPackages;
in haskellPackages);
defaultVersionPrioFun =
profDefault :
if config.cabal.libraryProfiling or false == profDefault
then (x : x)
else lowPrio;
packages = args : let r = packagesFun args;
in r // { lowPrio = r.override { modifyPrio = lowPrio; };
highPrio = r.override { modifyPrio = hiPrio; };
noProfiling = r.override { profDefault = false;
profExplicit = true;
modifyPrio = defaultVersionPrioFun false; };
profiling = r.override { profDefault = true;
profExplicit = true;
modifyPrio = defaultVersionPrioFun true; };
};
# Compiler configurations
#
# Here, we associate compiler versions with bootstrap compiler versions and
# preference functions.
packages_ghc784 =
packages { ghc = pkgs.haskell-ng.compiler.ghc784;
prefFun = ghc784Prefs;
};
packages_ghc763 =
packages { ghc = pkgs.haskell-ng.compiler.ghc763;
prefFun = ghc763Prefs;
};
packages_ghc742 =
packages { ghc = pkgs.haskell-ng.compiler.ghc742;
prefFun = ghc742Prefs;
};
packages_ghc722 =
packages { ghc = pkgs.haskell-ng.compiler.ghc722;
prefFun = ghc722Prefs;
};
packages_ghc704 =
packages { ghc = pkgs.haskell-ng.compiler.ghc704;
prefFun = ghc704Prefs;
};
packages_ghc6123 =
packages { ghc = pkgs.haskell-ng.compiler.ghc6123;
prefFun = ghc6123Prefs;
};
packages_ghc6104 =
packages { ghc = pkgs.haskell-ng.compiler.ghc6104;
prefFun = ghc6104Prefs;
};
}

View file

@ -1,88 +0,0 @@
{ pkgs, callPackage, stdenv }:
rec {
lib = import ../development/haskell-modules/lib.nix { inherit pkgs; };
compiler = {
ghc6102Binary = callPackage ../development/compilers/ghc/6.10.2-binary.nix { gmp = pkgs.gmp4; };
ghc704Binary = callPackage ../development/compilers/ghc/7.0.4-binary.nix ({ gmp = pkgs.gmp4; } // stdenv.lib.optionalAttrs stdenv.isDarwin {
libiconv = pkgs.darwin.libiconv;
});
ghc742Binary = callPackage ../development/compilers/ghc/7.4.2-binary.nix ({ gmp = pkgs.gmp4; } // stdenv.lib.optionalAttrs stdenv.isDarwin {
libiconv = pkgs.darwin.libiconv;
});
ghc6104 = callPackage ../development/compilers/ghc/6.10.4.nix { ghc = compiler.ghc6102Binary; };
ghc6123 = callPackage ../development/compilers/ghc/6.12.3.nix { ghc = compiler.ghc6102Binary; };
ghc704 = callPackage ../development/compilers/ghc/7.0.4.nix ({ ghc = compiler.ghc704Binary; } // stdenv.lib.optionalAttrs stdenv.isDarwin {
libiconv = pkgs.darwin.libiconv;
});
ghc722 = callPackage ../development/compilers/ghc/7.2.2.nix ({ ghc = compiler.ghc704Binary; } // stdenv.lib.optionalAttrs stdenv.isDarwin {
libiconv = pkgs.darwin.libiconv;
});
ghc742 = callPackage ../development/compilers/ghc/7.4.2.nix ({ ghc = compiler.ghc704Binary; } // stdenv.lib.optionalAttrs stdenv.isDarwin {
libiconv = pkgs.darwin.libiconv;
});
ghc763 = callPackage ../development/compilers/ghc/7.6.3.nix ({ ghc = compiler.ghc704Binary; } // stdenv.lib.optionalAttrs stdenv.isDarwin {
libiconv = pkgs.darwin.libiconv;
});
ghc784 = callPackage ../development/compilers/ghc/7.8.4.nix ({ ghc = compiler.ghc742Binary; } // stdenv.lib.optionalAttrs stdenv.isDarwin {
libiconv = pkgs.darwin.libiconv;
});
ghc7101 = callPackage ../development/compilers/ghc/7.10.1.nix ({ ghc = compiler.ghc784; } // stdenv.lib.optionalAttrs stdenv.isDarwin {
libiconv = pkgs.darwin.libiconv;
});
ghcHEAD = callPackage ../development/compilers/ghc/head.nix ({ inherit (packages.ghc784) ghc alex happy; } // stdenv.lib.optionalAttrs stdenv.isDarwin {
libiconv = pkgs.darwin.libiconv;
});
ghc = compiler.ghc784;
ghcjs = packages.ghc7101.callPackage ../development/compilers/ghcjs {
ghc = compiler.ghc7101;
};
};
packages = {
ghc6104 = callPackage ../development/haskell-modules { ghc = compiler.ghc6104; };
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 { };
};
ghc784 = callPackage ../development/haskell-modules {
ghc = compiler.ghc784;
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-7.8.x.nix { };
};
ghc7101 = callPackage ../development/haskell-modules {
ghc = compiler.ghc7101;
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { };
};
ghcHEAD = callPackage ../development/haskell-modules {
ghc = compiler.ghcHEAD;
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
};
ghcjs = callPackage ../development/haskell-modules {
ghc = compiler.ghcjs;
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { };
};
};
}

File diff suppressed because it is too large Load diff