summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorArie Middelkoop <amiddelk@gmail.com>2006-12-15 13:32:55 +0000
committerArie Middelkoop <amiddelk@gmail.com>2006-12-15 13:32:55 +0000
commitafde8e6270b8dca793d1f541224013a8e3bcd687 (patch)
tree17bbf8f172c71740c03f91c857d11683fc0f5ebd /pkgs/development
parent4ae30fee90603b4cac7c0e3a9db0b31d6b540818 (diff)
downloadnixlib-afde8e6270b8dca793d1f541224013a8e3bcd687.tar
nixlib-afde8e6270b8dca793d1f541224013a8e3bcd687.tar.gz
nixlib-afde8e6270b8dca793d1f541224013a8e3bcd687.tar.bz2
nixlib-afde8e6270b8dca793d1f541224013a8e3bcd687.tar.lz
nixlib-afde8e6270b8dca793d1f541224013a8e3bcd687.tar.xz
nixlib-afde8e6270b8dca793d1f541224013a8e3bcd687.tar.zst
nixlib-afde8e6270b8dca793d1f541224013a8e3bcd687.zip
Added GHC 6.6.
note: the old GHC 6.4(.2?) version is still there. I reused the bootstrap-version to bootstrap GHC-6.6. And some other packages depend on the old GHC 
version as well.

note: only use this package for building other packages. If you install it as an end-user, you'll only be able to use the default GHC libraries, 
because other libraries are only privately registered to this GHC version during a nix-build by hooks (which are not executed when you run GHC 
yourself as an end-user).

Consequently, also added a newer version of uulib and uuagc.

svn path=/nixpkgs/trunk/; revision=7346
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/ghc-6.6/builder.sh15
-rw-r--r--pkgs/development/compilers/ghc-6.6/default.nix18
-rw-r--r--pkgs/development/compilers/ghc-6.6/setup-hook.sh41
-rw-r--r--pkgs/development/libraries/haskell/uulib-ghc-6.6/builder.sh21
-rw-r--r--pkgs/development/libraries/haskell/uulib-ghc-6.6/default.nix11
-rw-r--r--pkgs/development/tools/haskell/uuagc/default.nix23
6 files changed, 115 insertions, 14 deletions
diff --git a/pkgs/development/compilers/ghc-6.6/builder.sh b/pkgs/development/compilers/ghc-6.6/builder.sh
new file mode 100644
index 000000000000..716fb38f0dad
--- /dev/null
+++ b/pkgs/development/compilers/ghc-6.6/builder.sh
@@ -0,0 +1,15 @@
+source $stdenv/setup
+
+# Setup isolated package management
+postInstall()
+{
+    ensureDir "$out/nix-support"
+    echo "# Path to the GHC compiler directory in the store" > $out/nix-support/setup-hook
+    echo "ghc=$out" >> $out/nix-support/setup-hook
+    echo ""         >> $out/nix-support/setup-hook
+    cat $setupHook  >> $out/nix-support/setup-hook
+}
+postInstall=postInstall
+
+# Standard configure/make/make install
+genericBuild
diff --git a/pkgs/development/compilers/ghc-6.6/default.nix b/pkgs/development/compilers/ghc-6.6/default.nix
new file mode 100644
index 000000000000..ff9c9fc40ec5
--- /dev/null
+++ b/pkgs/development/compilers/ghc-6.6/default.nix
@@ -0,0 +1,18 @@
+{stdenv, fetchurl, readline, ghc, perl, m4}:
+
+stdenv.mkDerivation
+{
+  name = "ghc-6.6";
+
+  src = map fetchurl [{ url = http://www.haskell.org/ghc/dist/6.6/ghc-6.6-src.tar.bz2; md5 = "2427a8d7d14f86e0878df6b54938acf7"; }
+                      { url = http://www.haskell.org/ghc/dist/6.6/ghc-6.6-src-extralibs.tar.bz2; md5 = "14b22fce36caffa509046361724bc119"; }
+                     ];
+
+  builder = ./builder.sh;
+
+  buildInputs = [ghc readline perl m4];
+
+  setupHook = ./setup-hook.sh;
+
+  meta = { description = "The Glasgow Haskell Compiler v6.6"; };
+}
diff --git a/pkgs/development/compilers/ghc-6.6/setup-hook.sh b/pkgs/development/compilers/ghc-6.6/setup-hook.sh
new file mode 100644
index 000000000000..258c88c43611
--- /dev/null
+++ b/pkgs/development/compilers/ghc-6.6/setup-hook.sh
@@ -0,0 +1,41 @@
+# Support dir for isolating GHC
+ghc_support=$TMPDIR/ghc-6.6-nix-support
+mkdir -p $ghc_support
+
+# Create isolated package config
+packages_db=$ghc_support/package.conf
+cp $ghc/lib/ghc-*/package.conf $packages_db
+chmod +w $packages_db
+
+# Generate wrappers for GHC that use the isolated package config
+makeWrapper() {
+  wrapperName="$1"
+  wrapper="$ghc_support/$wrapperName"
+  shift #the other arguments are passed to the source app
+  echo '#!'"$SHELL" > "$wrapper"
+  echo "exec \"$ghc/bin/$wrapperName\" $@" '"$@"' > "$wrapper"
+  chmod +x "$wrapper"
+}
+
+makeWrapper "ghc"         "-no-user-package-conf -package-conf"  $packages_db
+makeWrapper "ghci"        "-no-user-package-conf -package-conf"  $packages_db
+makeWrapper "runghc"      "-no-user-package-conf -package-conf"  $packages_db
+makeWrapper "runhaskell"  "-no-user-package-conf -package-conf"  $packages_db
+makeWrapper "ghc-pkg"     "--global --global-conf"  $packages_db
+
+# Add wrappers to search path
+export _PATH=$ghc_support:$_PATH
+
+# Env hook to add packages to the package config
+addLibToPackageConf ()
+{
+    local regscript=$1/nix-support/register-ghclib.sh
+    if test -f $regscript; then
+        local oldpath=$PATH
+        export PATH=$ghc_support:$PATH
+        sh $regscript $package_db
+        export PATH=$oldpath
+    fi
+}
+
+envHooks=(${envHooks[@]} addLibToPackageConf)
diff --git a/pkgs/development/libraries/haskell/uulib-ghc-6.6/builder.sh b/pkgs/development/libraries/haskell/uulib-ghc-6.6/builder.sh
new file mode 100644
index 000000000000..bbe21eac49e6
--- /dev/null
+++ b/pkgs/development/libraries/haskell/uulib-ghc-6.6/builder.sh
@@ -0,0 +1,21 @@
+source $stdenv/setup
+
+
+tar xzf "$src" &&
+cd uulib-* &&
+
+
+autoconf &&
+./configure --prefix=$out &&
+
+
+ghc --make Setup.hs -o setup -package Cabal &&
+./setup configure --prefix=$out --with-hc-pkg=ghc-pkg &&
+
+
+./setup build &&
+./setup install &&
+./setup register --gen-script &&
+
+mkdir -p $out/nix-support/ &&
+cp register.sh $out/nix-support/register-ghclib.sh
diff --git a/pkgs/development/libraries/haskell/uulib-ghc-6.6/default.nix b/pkgs/development/libraries/haskell/uulib-ghc-6.6/default.nix
new file mode 100644
index 000000000000..1c315b1cffac
--- /dev/null
+++ b/pkgs/development/libraries/haskell/uulib-ghc-6.6/default.nix
@@ -0,0 +1,11 @@
+{stdenv, fetchurl, autoconf, ghc}:
+
+stdenv.mkDerivation
+{
+  name = "uulib-0.9.2-ghc-6.6";
+  src = fetchurl { url = http://www.cs.uu.nl/~ariem/uulib-2006-10-30-src.tar.gz;
+                   md5 = "d26059447d45fa91f54eca38680be7b7";
+                 };
+  builder = ./builder.sh;
+  buildInputs = [ autoconf ghc ];
+}
diff --git a/pkgs/development/tools/haskell/uuagc/default.nix b/pkgs/development/tools/haskell/uuagc/default.nix
index c3c77a36790b..519244ae7b84 100644
--- a/pkgs/development/tools/haskell/uuagc/default.nix
+++ b/pkgs/development/tools/haskell/uuagc/default.nix
@@ -1,19 +1,14 @@
 {stdenv, fetchurl, ghc, uulib}:
 
-#as long as cabal does not allow to specify which package.conf to use we create a wrapper
+stdenv.mkDerivation
+{
+  name = "uuagc-0.9.2";
 
-let {
-  uulibGHC = (import ../../../compilers/ghc-wrapper) {
-    libraries = [ uulib ];
-    inherit stdenv ghc;
-  };
+  src = fetchurl { url = http://www.cs.uu.nl/~ariem/uuagc-0.9.2-src.tar.gz;
+                   md5 = "cbac92287c9c0a858ccbfa37615d9f5f";
+                 };
 
-  body = stdenv.mkDerivation {
-    name = "uuagc-0.9.1";
-    src = fetchurl {
-      url = http://nix.cs.uu.nl/dist/tarballs/uuagc-0.9.1-src.tar.gz;
-      md5 = "0f29cad75bd759696edc61c24d1a5db9";
-    };
-    buildInputs = [uulibGHC];
-  };
+  buildInputs = [ghc uulib];
+
+  meta = { description = "The UUAG Compiler"; };
 }