2017-04-06 17:43:42 +01:00
|
|
|
NIX_LISP_ASDF="@out@"
|
2013-10-13 07:45:07 +01:00
|
|
|
|
2017-04-06 17:43:42 +01:00
|
|
|
CL_SOURCE_REGISTRY="${CL_SOURCE_REGISTRY:+$CL_SOURCE_REGISTRY:}@out@/lib/common-lisp/asdf/"
|
2013-10-13 07:45:07 +01:00
|
|
|
|
|
|
|
addASDFPaths () {
|
2017-04-06 17:43:42 +01:00
|
|
|
for j in "$1"/lib/common-lisp-settings/*-path-config.sh; do
|
|
|
|
source "$j"
|
2013-10-13 07:45:07 +01:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
setLisp () {
|
2019-11-22 16:17:18 +00:00
|
|
|
if [ -z "${NIX_LISP_COMMAND:-}" ]; then
|
2013-10-13 07:45:07 +01:00
|
|
|
for j in "$1"/bin/*; do
|
|
|
|
case "$(basename "$j")" in
|
|
|
|
sbcl) NIX_LISP_COMMAND="$j" ;;
|
|
|
|
ecl) NIX_LISP_COMMAND="$j" ;;
|
|
|
|
clisp) NIX_LISP_COMMAND="$j" ;;
|
2018-02-01 18:06:03 +00:00
|
|
|
lx86cl) NIX_LISP_COMMAND="$j" ;;
|
|
|
|
lx86cl64) NIX_LISP_COMMAND="$j" ;;
|
2013-10-13 07:45:07 +01:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
fi
|
2019-11-22 16:17:18 +00:00
|
|
|
if [ -n "${NIX_LISP_COMMAND:-}" ] && [ -z "${NIX_LISP:-}" ]; then
|
2013-10-13 07:45:07 +01:00
|
|
|
NIX_LISP="${NIX_LISP_COMMAND##*/}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-10-29 07:29:46 +00:00
|
|
|
collectNixLispLDLP () {
|
|
|
|
if echo "$1/lib"/lib*.so* | grep . > /dev/null; then
|
2019-11-06 00:45:48 +00:00
|
|
|
export NIX_LISP_LD_LIBRARY_PATH="${NIX_LISP_LD_LIBRARY_PATH-}${NIX_LISP_LD_LIBRARY_PATH:+:}$1/lib"
|
2013-10-29 07:29:46 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-04-06 17:43:42 +01:00
|
|
|
export NIX_LISP_COMMAND NIX_LISP CL_SOURCE_REGISTRY NIX_LISP_ASDF
|
2013-10-13 07:45:07 +01:00
|
|
|
|
2017-08-10 23:22:07 +01:00
|
|
|
addEnvHooks "$targetOffset" addASDFPaths setLisp collectNixLispLDLP
|
2013-10-13 07:45:07 +01:00
|
|
|
|
2019-11-22 16:17:18 +00:00
|
|
|
mkdir -p "$HOME"/.cache/common-lisp || HOME="$TMP/.temp-${USER:-nixbld}-home"
|
2013-10-13 07:45:07 +01:00
|
|
|
mkdir -p "$HOME"/.cache/common-lisp
|