nixpkgs/pkgs/development/interpreters/guile/setup-hook-2.2.sh
Kovacsics Robert 612ec25256
guile: setup hook, use compiled files
Often packages install the compiled files to
`$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/ccache` (e.g. see
guile-opengl). This path is not explicitly given in the info page, but
is used in a couple of places, and is also part of `%load-compiled-path`
variable in guile (for `"${guile}/lib/guile/2.2/ccache`).

Similarly, the site-ccache is also part of `%load-compiled-path` in
guile.
2020-11-28 11:16:25 +01:00

24 lines
979 B
Bash

addGuileLibPath () {
if test -d "$1/share/guile/site/2.2"
then
export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/2.2"
export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/2.2"
elif test -d "$1/share/guile/site"
then
export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site"
export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site"
fi
if test -d "$1/lib/guile/2.2/ccache"
then
export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.2/ccache"
fi
if test -d "$1/lib/guile/2.2/site-ccache"
then
export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.2/site-ccache"
fi
}
addEnvHooks "$hostOffset" addGuileLibPath