Guile: fix chroot build; make sure guile-snarf' sees gawk'; add a setup hook.

svn path=/nixpkgs/trunk/; revision=10636
This commit is contained in:
Ludovic Courtès 2008-02-12 10:41:00 +00:00
parent 28d2f608c6
commit df17eb0dc3
4 changed files with 35 additions and 2 deletions

View file

@ -6,5 +6,14 @@ stdenv.mkDerivation {
sha256 = "2ab59099cf2d46f57cf5421c9b84aa85f61961640046e8066c6b321257517796";
};
propagatedBuildInputs = [readline libtool gmp];
patches = [ ./snarf-tmpdir.patch ];
buildInputs = [ makeWrapper ];
propagatedBuildInputs = [readline libtool gmp gawk];
postInstall = ''
wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
'';
setupHook = ./setup-hook.sh;
}

View file

@ -0,0 +1,8 @@
addGuileLibPath () {
if test -d "$1/lib/site-guile"
then
export GUILE_LOAD_PATH="${GUILE_LOAD_PATH}${GUILE_LOAD_PATH:+:}$1/lib/site-guile"
fi
}
envHooks=(${envHooks[@]} addGuileLibPath)

View file

@ -0,0 +1,16 @@
--- guile-1.8.3/libguile/guile-snarf.in 2008-02-12 10:32:48.000000000 +0100
+++ guile-1.8.3/libguile/guile-snarf.in 2008-02-12 11:01:53.000000000 +0100
@@ -69,9 +69,12 @@ fi
# set vars and handler -- handle CPP override
cpp_ok_p=false
-tempdir="/tmp/snarf.$$"
+
+if [ x"$TMPDIR" = x ]; then TMPDIR="/tmp" ; else : ; fi
+tempdir="$TMPDIR/guile-snarf.$$"
(umask 077 && mkdir $tempdir) || exit 1
temp="$tempdir/tmp"
+
if [ x"$CPP" = x ] ; then cpp="@CPP@" ; else cpp="$CPP" ; fi
trap "rm -rf $tempdir" 0 1 2 15

View file

@ -1538,7 +1538,7 @@ rec {
};
guile = import ../development/interpreters/guile {
inherit fetchurl stdenv ncurses readline libtool gmp;
inherit fetchurl stdenv ncurses readline libtool gmp gawk makeWrapper;
};
kaffe = import ../development/interpreters/kaffe {