From 35ae15d5fa26dcdbf80c84f339292b5110236f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 30 Sep 2009 13:11:05 +0000 Subject: [PATCH] SLIB: Add setup hook. svn path=/nixpkgs/trunk/; revision=17548 --- pkgs/development/libraries/slib/default.nix | 4 +++- pkgs/development/libraries/slib/setup-hook.sh | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/slib/setup-hook.sh diff --git a/pkgs/development/libraries/slib/default.nix b/pkgs/development/libraries/slib/default.nix index db85f5233526..952d4ba9f255 100644 --- a/pkgs/development/libraries/slib/default.nix +++ b/pkgs/development/libraries/slib/default.nix @@ -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"; diff --git a/pkgs/development/libraries/slib/setup-hook.sh b/pkgs/development/libraries/slib/setup-hook.sh new file mode 100644 index 000000000000..32dde7d1f7a2 --- /dev/null +++ b/pkgs/development/libraries/slib/setup-hook.sh @@ -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)