From 7f402451ec239edc10467d663624982faa755b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andres=20L=C3=B6h?= Date: Wed, 9 Jan 2008 13:08:36 +0000 Subject: [PATCH] * porting changes from ghc-6.8.2 nix expression back to 6.6.1 * cleaning up a bit svn path=/nixpkgs/trunk/; revision=10103 --- .../compilers/ghc-6.6.1/builder.sh | 26 ---------------- .../compilers/ghc-6.6.1/default.nix | 31 +++++++++++++++---- pkgs/development/compilers/ghc-6.8/builder.sh | 26 ---------------- .../development/compilers/ghc-6.8/default.nix | 14 ++++----- .../compilers/ghc-6.8/setup-hook.sh | 2 +- 5 files changed, 33 insertions(+), 66 deletions(-) delete mode 100644 pkgs/development/compilers/ghc-6.6.1/builder.sh delete mode 100644 pkgs/development/compilers/ghc-6.8/builder.sh diff --git a/pkgs/development/compilers/ghc-6.6.1/builder.sh b/pkgs/development/compilers/ghc-6.6.1/builder.sh deleted file mode 100644 index 0ea4fc496f9e..000000000000 --- a/pkgs/development/compilers/ghc-6.6.1/builder.sh +++ /dev/null @@ -1,26 +0,0 @@ -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 - -configureFlags="--with-gmp-libraries=$gmp/lib --with-readline-libraries=\"$readline/lib\"" - -preConfigure() -{ - chmod u+x rts/gmp/configure - # still requires a hack for ncurses - sed -i "s|^\(library-dirs.*$\)|\1 \"$ncurses/lib\"|" libraries/readline/package.conf.in -} -preConfigure=preConfigure - - -# Standard configure/make/make install -genericBuild diff --git a/pkgs/development/compilers/ghc-6.6.1/default.nix b/pkgs/development/compilers/ghc-6.6.1/default.nix index 738b6a79fc74..14a59aeeeba5 100644 --- a/pkgs/development/compilers/ghc-6.6.1/default.nix +++ b/pkgs/development/compilers/ghc-6.6.1/default.nix @@ -1,6 +1,6 @@ {stdenv, fetchurl, readline, ghc, perl, m4, gmp, ncurses}: -stdenv.mkDerivation { +stdenv.mkDerivation (rec { name = "ghc-6.6.1"; src = map fetchurl [ @@ -12,15 +12,34 @@ stdenv.mkDerivation { } ]; - builder = ./builder.sh; - - buildInputs = [ghc readline perl m4]; + buildInputs = [ghc readline perl m4 gmp]; setupHook = ./setup-hook.sh; meta = { - description = "The Glasgow Haskell Compiler v6.6.1"; + description = "The Glasgow Haskell Compiler"; }; + 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 + ''; + + configureFlags=[ + "--with-gmp-libraries=${gmp}/lib" + "--with-readline-libraries=${readline}/lib" + "--with-gmp-includes=${gmp}/include" + "--with-gcc=${gcc}/bin/gcc" + ]; + + preConfigure = '' + # still requires a hack for ncurses + sed -i "s|^\(library-dirs.*$\)|\1 \"${ncurses}/lib\"|" libraries/readline/package.conf.in + ''; + + inherit (stdenv) gcc; inherit readline gmp ncurses; -} +}) diff --git a/pkgs/development/compilers/ghc-6.8/builder.sh b/pkgs/development/compilers/ghc-6.8/builder.sh deleted file mode 100644 index 0ea4fc496f9e..000000000000 --- a/pkgs/development/compilers/ghc-6.8/builder.sh +++ /dev/null @@ -1,26 +0,0 @@ -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 - -configureFlags="--with-gmp-libraries=$gmp/lib --with-readline-libraries=\"$readline/lib\"" - -preConfigure() -{ - chmod u+x rts/gmp/configure - # still requires a hack for ncurses - sed -i "s|^\(library-dirs.*$\)|\1 \"$ncurses/lib\"|" libraries/readline/package.conf.in -} -preConfigure=preConfigure - - -# Standard configure/make/make install -genericBuild diff --git a/pkgs/development/compilers/ghc-6.8/default.nix b/pkgs/development/compilers/ghc-6.8/default.nix index 5bfe82c7a7a0..518b5f391a35 100644 --- a/pkgs/development/compilers/ghc-6.8/default.nix +++ b/pkgs/development/compilers/ghc-6.8/default.nix @@ -21,13 +21,13 @@ stdenv.mkDerivation (rec { description = "The Glasgow Haskell Compiler"; }; - 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 = '' + 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 + ''; configureFlags=[ "--with-gmp-libraries=${gmp}/lib" diff --git a/pkgs/development/compilers/ghc-6.8/setup-hook.sh b/pkgs/development/compilers/ghc-6.8/setup-hook.sh index 23da6de03825..489c8d532b86 100644 --- a/pkgs/development/compilers/ghc-6.8/setup-hook.sh +++ b/pkgs/development/compilers/ghc-6.8/setup-hook.sh @@ -1,5 +1,5 @@ # Support dir for isolating GHC -ghc_support=$TMPDIR/ghc-6.6-nix-support +ghc_support=$TMPDIR/ghc-6.8-nix-support mkdir -p $ghc_support # Create isolated package config