3
0
Fork 0
forked from mirrors/nixpkgs

Make ghc-7.0.4 the default. Add experimental ghc-7.2.1rc1.

svn path=/nixpkgs/trunk/; revision=28163
This commit is contained in:
Andres Löh 2011-08-05 08:52:35 +00:00
parent b01cd125d4
commit 8fdb3c9e63
13 changed files with 406 additions and 44 deletions

View file

@ -0,0 +1,104 @@
{stdenv, fetchurl, perl, ncurses, gmp}:
assert stdenv.system == "i686-darwin" || stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux";
stdenv.mkDerivation rec {
version = "6.12.1";
name = "ghc-${version}-binary";
src =
if stdenv.system == "i686-linux" then
fetchurl {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux-n.tar.bz2";
sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
}
else if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux-n.tar.bz2";
sha256 = "bae351afe8cdb323103dcf0ed3a7b480282803d2f812aff0d27808e9df228b21";
}
else throw "cannot bootstrap GHC on this platform";
buildInputs = [perl];
postUnpack =
# Strip is harmful, see also below. It's important that this happens
# first. The GHC Cabal build system makes use of strip by default and
# has hardcoded paths to /usr/bin/strip in many places. We replace
# those below, making them point to our dummy script.
''
mkdir "$TMP/bin"
for i in strip; do
echo '#!/bin/sh' >> "$TMP/bin/$i"
chmod +x "$TMP/bin/$i"
PATH="$TMP/bin:$PATH"
done
'' +
# We have to patch the GMP paths for the integer-gmp package.
''
find . -name integer-gmp.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp}/lib@" {} \;
'' +
# On Linux, use patchelf to modify the executables so that they can
# find editline/gmp.
(if stdenv.isLinux then ''
find . -type f -perm +100 \
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath "${ncurses}/lib:${gmp}/lib" {} \;
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
for prog in ld ar gcc strip ranlib; do
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
done
'' else "");
configurePhase = ''
./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include
'';
# Stripping combined with patchelf breaks the executables (they die
# with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
dontStrip = true;
# No building is necessary, but calling make without flags ironically
# calls install-strip ...
buildPhase = "true";
# The binaries for Darwin use frameworks, so fake those frameworks,
# and create some wrapper scripts that set DYLD_FRAMEWORK_PATH so
# that the executables work with no special setup.
postInstall =
(if stdenv.isDarwin then
''
ensureDir $out/frameworks/GMP.framework/Versions/A
ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP
ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/Versions/A/GMP
# !!! fix this
mv $out/bin $out/bin-orig
mkdir $out/bin
for i in $(cd $out/bin-orig && ls); do
echo \"#! $SHELL -e\" >> $out/bin/$i
echo \"DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \\\"\\$@\\\"\" >> $out/bin/$i
chmod +x $out/bin/$i
done
'' else "")
+
''
# bah, the passing gmp doesn't work, so let's add it to the final package.conf in a quick but dirty way
# sed -i "s@^\(.*pkgName = PackageName \"rts\".*\libraryDirs = \\[\)\(.*\)@\\1\"${gmp}/lib\",\2@" $out/lib/ghc-${version}/package.conf
# Sanity check, can ghc create executables?
cd $TMP
mkdir test-ghc; cd test-ghc
cat > main.hs << EOF
module Main where
main = putStrLn "yes"
EOF
$out/bin/ghc --make main.hs
echo compilation ok
[ $(./main) == "yes" ]
'';
}

View file

@ -0,0 +1,44 @@
{stdenv, fetchurl, ghc, perl, gmp, ncurses, darwinInstallNameToolUtility}:
stdenv.mkDerivation rec {
version = "7.2.0.20110728";
label = "7.2.1-rc1";
name = "ghc-${version}";
src = fetchurl {
url = "http://haskell.org/ghc/dist/${label}/${name}-src.tar.bz2";
sha256 = "8747038f1b863a553f3250a415514705df5919932722e68a1477cf6e13363250";
};
buildInputs = [ghc perl gmp ncurses] ++
(if stdenv.isDarwin then [darwinInstallNameToolUtility] else []);
buildMK = ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
'';
preConfigure = ''
echo "${buildMK}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'';
configureFlags=[
"--with-gcc=${stdenv.gcc}/bin/gcc"
];
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort
stripDebugFlags=["-S" "--keep-file-symbols"];
meta = {
homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler";
maintainers = [
stdenv.lib.maintainers.marcweber
stdenv.lib.maintainers.andres
];
platforms = stdenv.lib.platforms.haskellPlatforms;
};
}

View file

@ -1,10 +1,10 @@
{cabal, mtl}:
{cabal, mtl, random}:
cabal.mkDerivation (self : {
pname = "QuickCheck";
version = "2.4.0.1"; # Haskell Platform 2011.2.0.0
sha256 = "1x7jc2svpxbll8qkrbswh5q59sqcjf2v5a6jnqslf5gwr5qpq18r";
propagatedBuildInputs = [mtl];
propagatedBuildInputs = [mtl random];
meta = {
description = "Automatic testing of Haskell programs";
license = "BSD";

View file

@ -3,25 +3,29 @@
stm, syb, deepseq, text, transformers, mtl, xhtml, zlib,
cabalInstall, alex, happy, haddock, ghc}:
# This is just a meta-package. Because upstream fails to provide proper versioned
# release tarballs that can be used for the purpose of verifying this package, we
# just create it on the fly from a simple Setup.hs file and a .cabal file that we
# store directly in the nixpkgs repository.
cabal.mkDerivation (self : {
pname = "haskell-platform";
version = "2011.2.0.1";
src = fetchurl {
url = "http://lambda.haskell.org/hp-tmp/2011.2.0.0/cabal/${self.pname}-2011.2.0.0.tar.gz";
sha256 = "01ppv8jdyvbngml9vgvrvnani6fj1nbk8mqmrkd8c508l7q9g6vb";
};
cabalFile = fetchurl {
url = http://code.galois.com/darcs/haskell-platform/haskell-platform.cabal;
sha256 = "158a1g4ak9mm2q5ri4zdpmbvjgfkz7svxnkxlz8117zpnbs12i3d";
};
cabalFile = ./haskell-platform-2011.2.0.1.cabal;
setupFile = ./Setup.hs;
src = null;
propagatedBuildInputs = [
GLUT HTTP HUnit OpenGL QuickCheck cgi fgl
haskellSrc html network parallel parsec regexBase regexCompat regexPosix
stm syb deepseq text transformers mtl xhtml zlib
cabalInstall alex happy ghc haddock
];
preConfigure = ''
cp ${self.cabalFile} ${self.pname}.cabal
unpackPhase = ''
sourceRoot=haskell-platform
mkdir $sourceRoot
cp ${self.cabalFile} $sourceRoot/${self.pname}.cabal
cp ${self.setupFile} $sourceRoot/Setup.hs
touch $sourceRoot/LICENSE
'';
noHaddock = true;
meta = {

View file

@ -0,0 +1,10 @@
import Distribution.Simple
import Distribution.Simple.Program
main = defaultMainWithHooks simpleUserHooks { hookedPrograms = [cabal] }
cabal :: Program
cabal = (simpleProgram "cabal-install") {
programFindLocation = \x -> findProgramLocation x "cabal",
programFindVersion = findProgramVersion "--numeric-version" id
}

View file

@ -0,0 +1,90 @@
name: haskell-platform
version: 2011.2.0.1
homepage: http://haskell.org/platform
license: BSD3
license-file: LICENSE
author: libraries@haskell.org
maintainer: haskell-platform@projects.haskell.org
category: System
synopsis: The Haskell Platform
description:
The Haskell Platform (HP) is the blessed set of libraries and tools on
which to build further Haskell libraries and applications. It is
intended to provide a comprehensive, stable, and quality tested base for
Haskell projects to work from.
.
This version specifies the following additional developer tools be
installed, for a system to be in full compliance:
.
* cabal-install
* alex
* happy
* haddock
cabal-version: >= 1.6
build-type: Custom
tested-with: GHC ==7.0.3
library
build-depends:
-- ghc 7.x
-- Core libraries: provided by every ghc installation
-- We don't include "non-API" packages here.
-- array ==0.3.0.2
-- base ==4.3.1.0
-- bytestring ==0.9.1.10
-- Cabal ==1.10.1.0
-- containers ==0.4.0.0
-- directory ==1.1.0.0
-- extensible-exceptions ==0.1.1.2
-- filepath ==1.2.0.0
-- haskell2010 ==1.0.0.0
-- haskell98 ==1.1.0.1
-- hpc ==0.5.0.6
-- old-locale ==1.0.0.2
-- old-time ==1.0.0.6
-- pretty ==1.0.1.2
-- process ==1.0.1.5
-- random ==1.0.0.3
-- template-haskell ==2.5.0.0
-- time ==1.2.0.3
-- unix ==XXX 2.4.2.0
-- Win32 ==XXX 2.2.0.1
-- Libraries in addition to what GHC provides:
-- Note: newer versions of cgi need monad-catchio.
cgi ==3001.1.7.4,
fgl ==5.4.2.3,
GLUT ==2.1.2.1,
haskell-src ==1.0.1.4,
html ==1.0.1.2,
HUnit ==1.2.2.3,
network ==2.3.0.2,
OpenGL ==2.2.3.0,
parallel ==3.1.0.1,
parsec ==3.1.1,
QuickCheck ==2.4.0.1,
regex-base ==0.93.2,
regex-compat ==0.93.1,
regex-posix ==0.94.4,
stm ==2.2.0.1,
syb ==0.3,
xhtml ==3000.2.0.1,
zlib ==0.5.3.1,
HTTP ==4000.1.1,
deepseq ==1.1.0.2,
-- 2011.1 proposals:
text ==0.11.0.6,
transformers ==0.2.2.0,
mtl ==2.0.1.0
-- Depending on programs does not work, they are not registered
-- We list them to help distro packaging.
build-tools:
cabal-install ==0.10.2,
alex ==2.3.5,
happy ==1.18.6
-- hscolour ==1.17
-- haddock ==2.9.2 -- need to use the one shipped with ghc

View file

@ -0,0 +1,13 @@
{cabal, time}:
cabal.mkDerivation (self : {
pname = "random";
version = "1.0.0.3"; # future platform?
sha256 = "0k2735vrx0id2dxzk7lkm22w07p7gy86zffygk60jxgh9rvignf6";
propagatedBuildInputs = [time];
meta = {
description = "random number library";
license = "BSD";
maintainers = [self.stdenv.lib.maintainers.andres];
};
})

View file

@ -0,0 +1,10 @@
{cabal}:
cabal.mkDerivation (self : {
pname = "syb";
version = "0.3.3"; # for ghc-7.2.1
sha256 = "0jskxbnzariq2ahcymvjrp4bhl9cpflc1nh51whdl9axcrd5c901";
meta = {
description = "generics system described in the Scrap Your Boilerplate papers";
};
})

View file

@ -0,0 +1,14 @@
{cabal, deepseq}:
cabal.mkDerivation (self : {
pname = "text";
version = "0.11.1.3"; # for ghc-7.2.1
sha256 = "1r00azswhb71fi4w3191krs8ajjfbfxivjwx03i0y0rr99bgb9vg";
propagatedBuildInputs = [deepseq];
meta = {
description = "An efficient package Unicode text type";
license = "BSD";
maintainers = [self.stdenv.lib.maintainers.andres];
};
})

View file

@ -0,0 +1,12 @@
{cabal, perl, QuickCheck2}:
cabal.mkDerivation (self : {
pname = "alex";
version = "3.0"; # Haskell Platform future?
name = self.fname;
sha256 = "0vjm58xb64lvhd7h3cfgrm81630pl2avz6v98323s6i9jsizi8js";
extraBuildInputs = [perl QuickCheck2];
meta = {
description = "A lexical analyser generator for Haskell";
};
})

View file

@ -2042,11 +2042,15 @@ let
inherit fetchurl stdenv perl ncurses gmp libedit;
});
ghc6121Binary = lowPrio (import ../development/compilers/ghc/6.12.1-binary.nix {
inherit fetchurl stdenv perl ncurses gmp;
});
# For several compiler versions, we export a large set of Haskell-related
# packages.
# This should point to the current default version.
haskellPackages = haskellPackages_ghc702;
haskellPackages = haskellPackages_ghc704;
# NOTE: After discussion, we decided to enable recurseIntoAttrs for all
# currently available ghc versions. (Before, it used to be enabled only
@ -2055,45 +2059,59 @@ let
# reducing the number or "enabled" versions again.
# Helper functions to abstract away from repetitive instantiations.
haskellPackagesFun = ghcPath : prefFun : profDefault : modifyPrio : recurseIntoAttrs (import ./haskell-packages.nix {
inherit pkgs newScope modifyPrio prefFun;
enableLibraryProfiling = getConfig [ "cabal" "libraryProfiling" ] profDefault;
ghc = callPackage ghcPath { ghc = ghc6101Binary; };
});
haskellPackagesFun =
ghcPath : ghcBinary : prefFun : profDefault : modifyPrio : recurseIntoAttrs
(import ./haskell-packages.nix {
inherit pkgs newScope modifyPrio prefFun;
enableLibraryProfiling = getConfig [ "cabal" "libraryProfiling" ] profDefault;
ghc = callPackage ghcPath { ghc = ghcBinary; };
});
# Currently active GHC versions.
haskellPackages_ghc6104 =
haskellPackagesFun ../development/compilers/ghc/6.10.4.nix (x : x.ghc6104Prefs) false (x : x);
haskellPackagesFun ../development/compilers/ghc/6.10.4.nix
ghc6101Binary (x : x.ghc6104Prefs) false (x : x);
haskellPackages_ghc6121 =
haskellPackagesFun ../development/compilers/ghc/6.12.1.nix (x : x.ghc6121Prefs) false (x : x);
haskellPackagesFun ../development/compilers/ghc/6.12.1.nix
ghc6101Binary (x : x.ghc6121Prefs) false (x : x);
haskellPackages_ghc6122 =
haskellPackagesFun ../development/compilers/ghc/6.12.2.nix (x : x.ghc6122Prefs) false (x : x);
haskellPackagesFun ../development/compilers/ghc/6.12.2.nix
ghc6101Binary (x : x.ghc6122Prefs) false (x : x);
haskellPackages_ghc6123 =
haskellPackagesFun ../development/compilers/ghc/6.12.3.nix (x : x.ghc6123Prefs) false (x : x);
haskellPackagesFun ../development/compilers/ghc/6.12.3.nix
ghc6101Binary (x : x.ghc6123Prefs) false (x : x);
# Will never make it into a platform release, severe bugs; leave at lowPrio.
haskellPackages_ghc701 =
haskellPackagesFun ../development/compilers/ghc/7.0.1.nix (x : x.ghc701Prefs) false lowPrio;
haskellPackagesFun ../development/compilers/ghc/7.0.1.nix
ghc6101Binary (x : x.ghc701Prefs) false lowPrio;
haskellPackages_ghc702 =
haskellPackagesFun ../development/compilers/ghc/7.0.2.nix
ghc6101Binary (x : x.ghc702Prefs) false (x : x);
haskellPackages_ghc703 =
haskellPackagesFun ../development/compilers/ghc/7.0.3.nix
ghc6101Binary (x : x.ghc703Prefs) false (x : x);
# Current default version.
haskellPackages_ghc702 =
haskellPackagesFun ../development/compilers/ghc/7.0.2.nix (x : x.ghc702Prefs) false (x : x);
# The only thing that keeps this one from becoming default is that
# the Haskell Platform based on 703 is released improperly.
# Please keep at lowPrio until fixed.
haskellPackages_ghc703 =
haskellPackagesFun ../development/compilers/ghc/7.0.3.nix (x : x.ghc703Prefs) false lowPrio;
# Just released. Needs some testing first. Please keep at lowPrio for now.
# Note that the platform isn't officially released for ghc-7.0.4, but
# it works without problems.
haskellPackages_ghc704 =
haskellPackagesFun ../development/compilers/ghc/7.0.4.nix (x : x.ghc704Prefs) false lowPrio;
haskellPackagesFun ../development/compilers/ghc/7.0.4.nix
ghc6101Binary (x : x.ghc704Prefs) false (x : x);
# Still a release candidate.
haskellPackages_ghc721 =
haskellPackagesFun ../development/compilers/ghc/7.2.1.nix
ghc6121Binary (x : x.ghc721Prefs) false lowPrio;
haskellPackages_ghcHEAD =
haskellPackagesFun ../development/compilers/ghc/head.nix (x : x.ghcHEADPrefs) false lowPrio;
haskellPackagesFun ../development/compilers/ghc/head.nix
ghc6121Binary (x : x.ghcHEADPrefs) false lowPrio;
haxeDist = import ../development/compilers/haxe {
inherit fetchurl sourceFromHead stdenv lib ocaml zlib makeWrapper neko;

View file

@ -88,7 +88,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
ghc702Prefs = super : super // super.haskellPlatformDefaults_2011_2_0_0 super;
ghc703Prefs = super : super // super.haskellPlatformDefaults_2011_2_0_1 super;
ghc704Prefs = super : super // super.haskellPlatformDefaults_2011_2_0_1 super; # link
ghcHEADPrefs = super : super // super.haskellPlatformDefaults_2011_2_0_1 super; # link
ghc721Prefs = super : super // super.haskellPlatformDefaults_future super;
ghcHEADPrefs = super : super // super.haskellPlatformDefaults_future super; # link
# GHC and its wrapper
#
@ -118,9 +119,49 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
# We try to support several platform versions. For these, we set all
# versions explicitly.
haskellPlatform = self.haskellPlatform_2011_2_0_0; # global platform default
# NOTE: 2011.2.0.0 is the current default. 2011.2.0.1 is not yet released
# and provided for testing purposes.
# NOTE: 2011.2.0.1 is the current default.
haskellPlatformArgs_future = self : {
inherit (self) cabal ghc;
cgi = self.cgi_3001_1_7_4;
fgl = self.fgl_5_4_2_3;
GLUT = self.GLUT_2_1_2_1;
haskellSrc = self.haskellSrc_1_0_1_4;
html = self.html_1_0_1_2;
HUnit = self.HUnit_1_2_2_3;
network = self.network_2_3_0_2;
OpenGL = self.OpenGL_2_2_3_0;
parallel = self.parallel_3_1_0_1;
parsec = self.parsec_3_1_1;
QuickCheck = self.QuickCheck_2_4_0_1;
regexBase = self.regexBase_0_93_2;
regexCompat = self.regexCompat_0_93_1;
regexPosix = self.regexPosix_0_94_4;
stm = self.stm_2_2_0_1;
syb = self.syb_0_3_3;
xhtml = self.xhtml_3000_2_0_1;
zlib = self.zlib_0_5_3_1;
HTTP = self.HTTP_4000_1_1;
deepseq = self.deepseq_1_1_0_2;
text = self.text_0_11_1_5;
transformers = self.transformers_0_2_2_0;
mtl = self.mtl_2_0_1_0;
random = self.random_1_0_0_3;
cabalInstall = self.cabalInstall_0_10_2;
alex = self.alex_3_0;
happy = self.happy_1_18_6;
haddock = self.haddock_2_9_2;
};
haskellPlatformDefaults_future =
self : self.haskellPlatformArgs_future self // {
haskellPlatform = self.haskellPlatform_future;
mtl1 = self.mtl_1_1_1_1;
};
haskellPlatform_future =
callPackage ../development/libraries/haskell/haskell-platform/2011.2.0.1.nix
(self.haskellPlatformArgs_future self);
haskellPlatformArgs_2011_2_0_1 = self : {
inherit (self) cabal ghc;
@ -308,10 +349,6 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
haskellPlatform = self.haskellPlatform_2009_2_0_2;
};
haskellPlatform_2009_2_0_2 =
callPackage ../development/libraries/haskell/haskell-platform/2009.2.0.2.nix
(self.haskellPlatformArgs_2009_2_0_2 self);
# Haskell libraries.
@ -841,9 +878,12 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
RangedSets = callPackage ../development/libraries/haskell/Ranged-sets {};
random_newtime = callPackage ../development/libraries/haskell/random {
random_1_0_0_2_newtime = callPackage ../development/libraries/haskell/random/1.0.0.2.nix {
time = self.time_1_2_0_3;
};
random_1_0_0_3 = callPackage ../development/libraries/haskell/random/1.0.0.3.nix {};
random = null; # core package until ghc-7.2.1
random_newtime = self.random_1_0_0_2_newtime;
randomFu = callPackage ../development/libraries/haskell/random-fu {};
@ -915,6 +955,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
# TODO: investigate status of syb in older platform versions
syb_0_2_2 = callPackage ../development/libraries/haskell/syb/0.2.2.nix {};
syb_0_3 = callPackage ../development/libraries/haskell/syb/0.3.nix {};
syb_0_3_3 = callPackage ../development/libraries/haskell/syb/0.3.3.nix {};
syb02 = self.syb_0_2_2;
syb03 = self.syb_0_3;
syb = null; # by default, we assume that syb ships with GHC, which is
@ -992,6 +1033,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
text_0_11_0_5 = callPackage ../development/libraries/haskell/text/0.11.0.5.nix {};
text_0_11_0_6 = callPackage ../development/libraries/haskell/text/0.11.0.6.nix {};
text_0_11_1_5 = callPackage ../development/libraries/haskell/text/0.11.1.5.nix {};
text = self.text_0_11_0_5;
threadmanager = callPackage ../development/libraries/haskell/threadmanager {};
@ -1165,6 +1207,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
alex_2_3_2 = callPackage ../development/tools/parsing/alex/2.3.2.nix {};
alex_2_3_3 = callPackage ../development/tools/parsing/alex/2.3.3.nix {};
alex_2_3_5 = callPackage ../development/tools/parsing/alex/2.3.5.nix {};
alex_3_0 = callPackage ../development/tools/parsing/alex/3.0.nix {};
alex = self.alex_2_3_1;
cpphs = callPackage ../development/tools/misc/cpphs {};