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"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aefe86bd1eb5..fbda1243b8eb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -206,8 +206,8 @@ rec { # Bring in a path as a source, filtering out all hidden Subversion # directories. TODO: filter out backup files (*~) etc. - cleanSource = builtins.filterSource - (name: baseNameOf (toString name) != ".svn"); + cleanSource = src: builtins.filterSource + (name: baseNameOf (toString name) != ".svn") src; # !!! obsolete substitute = ../build-support/substitute/substitute.sh; @@ -681,6 +681,17 @@ rec { profiledCompiler = true; }); + # ghc66boot = import ../development/compilers/ghc-6.6-boot { + # inherit fetchurl stdenv perl readline; + # m4 = gnum4; + #}; + + ghc66 = import ../development/compilers/ghc-6.6 { + inherit fetchurl stdenv readline perl; + m4 = gnum4; + ghc = ghcboot; + }; + ghc = import ../development/compilers/ghc { inherit fetchurl stdenv perl ncurses readline m4; gcc = stdenv.gcc; @@ -1128,7 +1139,9 @@ rec { }; uuagc = import ../development/tools/haskell/uuagc { - inherit fetchurl stdenv ghc uulib; + inherit fetchurl stdenv; + ghc = ghc66; + uulib = uulib66; }; valgrind = import ../development/tools/misc/valgrind { @@ -1787,6 +1800,11 @@ rec { inherit stdenv fetchurl ghc; }; + uulib66 = import ../development/libraries/haskell/uulib-ghc-6.6 { + inherit stdenv fetchurl autoconf; + ghc = ghc66; + }; + wxHaskell = import ../development/libraries/haskell/wxHaskell { inherit fetchurl unzip ghc; stdenv = stdenvNew;