SLIB: Add setup hook.

svn path=/nixpkgs/trunk/; revision=17548
This commit is contained in:
Ludovic Courtès 2009-09-30 13:11:05 +00:00
parent b3cff1d812
commit 35ae15d5fa
2 changed files with 16 additions and 1 deletions

View File

@ -27,12 +27,14 @@ stdenv.mkDerivation rec {
SCHEME_LIBRARY_PATH="$out/lib/slib" make catalogs
sed -i "$out/bin/slib" \
-e "/^SCHEME_LIBRARY_PATH/i export PATH=\"${scheme}/bin:$PATH\""
-e "/^SCHEME_LIBRARY_PATH/i export PATH=\"${scheme}/bin:\$PATH\""
'';
# There's no test suite (?!).
doCheck = false;
setupHook = ./setup-hook.sh;
meta = {
description = "The SLIB Portable Scheme Library";

View File

@ -0,0 +1,13 @@
addSlibPath () {
if test -f "$1/lib/slib/slibcat"
then
export SCHEME_LIBRARY_PATH="$1/lib/slib/"
echo "SLIB found in \`$1'; setting \$SCHEME_LIBRARY_PATH to \`$SCHEME_LIBRARY_PATH'"
# This is needed so that `(load-from-path "slib/guile.init")' works.
export GUILE_LOAD_PATH="$1/lib:$GUILE_LOAD_PATH"
echo "SLIB: setting \$GUILE_LOAD_PATH to \`$GUILE_LOAD_PATH'"
fi
}
envHooks=(${envHooks[@]} addSlibPath)