From efdb847441313ad355e25058dc69ccc527f2ea33 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 2 Oct 2005 18:48:08 +0000 Subject: [PATCH] * Use the new patchelf to build GHC in a fully pure way. Should be checked on NixOS. svn path=/nixpkgs/trunk/; revision=3993 --- pkgs/development/compilers/ghc/boot.nix | 15 ++++++++------- pkgs/development/compilers/ghc/boot.sh | 11 +++++++++++ pkgs/development/compilers/ghc/default.nix | 8 +++----- pkgs/system/all-packages-generic.nix | 9 ++++++++- 4 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 pkgs/development/compilers/ghc/boot.sh diff --git a/pkgs/development/compilers/ghc/boot.nix b/pkgs/development/compilers/ghc/boot.nix index c46b3aa2fff..a6e04b4d448 100644 --- a/pkgs/development/compilers/ghc/boot.nix +++ b/pkgs/development/compilers/ghc/boot.nix @@ -1,14 +1,15 @@ -{stdenv, fetchurl, perl}: - -assert perl != null; +{stdenv, fetchurl, perl, patchelf, readline, ncurses}: assert stdenv.system == "i686-linux"; stdenv.mkDerivation { - name = "ghc-6.2.1"; + name = "ghc-6.4.1"; + builder = ./boot.sh; src = fetchurl { - url = http://nix.cs.uu.nl/dist/tarballs/ghc-6.2.1-i386-unknown-linux.tar.bz2; - md5 = "48d9d6b9f7bf1f15d69e8bd732ee254c"; + url = http://www.haskell.org/ghc/dist/6.4.1/ghc-6.4.1-i386-unknown-linux.tar.bz2; + md5 = "9cd18a8e946da91b373b8ec855cd842e"; }; - buildInputs = [perl]; + buildInputs = [perl patchelf]; + propagatedBuildInputs = [readline ncurses]; + inherit readline ncurses; } diff --git a/pkgs/development/compilers/ghc/boot.sh b/pkgs/development/compilers/ghc/boot.sh new file mode 100644 index 00000000000..c4db43d735f --- /dev/null +++ b/pkgs/development/compilers/ghc/boot.sh @@ -0,0 +1,11 @@ +source $stdenv/setup + +postBuild=postBuild +postBuild () { + glibc=$(cat $NIX_GCC/nix-support/orig-glibc) + find . -type f -perm +100 \ + -exec patchelf --interpreter $glibc/lib/ld-linux.so.* \ + --set-rpath "$readline/lib:$ncurses/lib" {} \; +} + +genericBuild diff --git a/pkgs/development/compilers/ghc/default.nix b/pkgs/development/compilers/ghc/default.nix index f6142f434ec..b26a5154bf6 100644 --- a/pkgs/development/compilers/ghc/default.nix +++ b/pkgs/development/compilers/ghc/default.nix @@ -1,12 +1,10 @@ {stdenv, fetchurl, perl, ghc, m4}: -assert perl != null && ghc != null && m4 != null; - stdenv.mkDerivation { - name = "ghc-6.2.1"; + name = "ghc-6.4.1"; src = fetchurl { - url = http://nix.cs.uu.nl/dist/tarballs/ghc-6.2.1-src.tar.bz2; - md5 = "fa9f90fd6b8852679c5fc16509e94d7a"; + url = http://www.haskell.org/ghc/dist/6.4.1/ghc-6.4.1-src.tar.bz2; + md5 = "fd289bc7c3afa272ff831a71a50b5b00"; }; buildInputs = [perl ghc m4]; } diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index 65c5e538bb2..43ec4458de5 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -287,6 +287,10 @@ rec { inherit fetchurl stdenv; }; + patchelfNew = (import ../development/tools/misc/patchelf/new.nix) { + inherit fetchurl stdenv; + }; + gnum4 = (import ../development/tools/misc/gnum4) { inherit fetchurl stdenv; }; @@ -549,7 +553,9 @@ rec { #}; ghcboot = (import ../development/compilers/ghc/boot.nix) { - inherit fetchurl stdenv perl; + inherit fetchurl stdenv perl ncurses; + readline = readline4; + patchelf = patchelfNew; }; ghc = (import ../development/compilers/ghc) { @@ -1548,6 +1554,7 @@ rec { inherit (xlibs) libXt libXp libXext libX11; inherit (gtkLibs) glib pango atk gtk; libstdcpp5 = gcc33.gcc; +# patchelf = patchelfNew; }; eclipse = (import ../applications/editors/eclipse) {