2017-03-30 12:00:43 +01:00
|
|
|
#!@stdenv_shell@
|
2013-10-13 07:45:07 +01:00
|
|
|
# Part of NixPkgs package collection
|
2017-04-10 00:10:39 +01:00
|
|
|
# This script can be used at your option under the same license as NixPkgs or
|
2013-10-13 07:45:07 +01:00
|
|
|
# under MIT/X11 license
|
|
|
|
|
|
|
|
eval "$NIX_LISP_PREHOOK"
|
|
|
|
|
|
|
|
NIX_LISP_COMMAND="$1"
|
|
|
|
shift
|
|
|
|
|
|
|
|
[ -z "$NIX_LISP" ] && NIX_LISP="${NIX_LISP_COMMAND##*/}"
|
|
|
|
|
|
|
|
export NIX_LISP NIX_LISP_LOAD_FILE NIX_LISP_EXEC_CODE NIX_LISP_COMMAND NIX_LISP_FINAL_PARAMETERS
|
|
|
|
|
2014-11-13 08:11:16 +00:00
|
|
|
test -n "$NIX_LISP_LD_LIBRARY_PATH" &&
|
|
|
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH${LD_LIBRARY_PATH+:}$NIX_LISP_LD_LIBRARY_PATH"
|
|
|
|
|
2017-03-30 12:00:43 +01:00
|
|
|
declare -a NIX_LISP_FINAL_PARAMETERS;
|
|
|
|
|
2013-10-13 07:45:07 +01:00
|
|
|
case "$NIX_LISP" in
|
|
|
|
sbcl)
|
|
|
|
NIX_LISP_LOAD_FILE="--load"
|
|
|
|
NIX_LISP_EXEC_CODE="--eval"
|
2016-03-25 16:57:45 +00:00
|
|
|
NIX_LISP_QUIT="(quit)"
|
2017-03-30 12:00:43 +01:00
|
|
|
NIX_LISP_NODEBUG='--non-interactive'
|
2013-10-13 07:45:07 +01:00
|
|
|
NIX_LISP_FINAL_PARAMETERS=
|
2017-04-10 00:10:39 +01:00
|
|
|
NIX_LISP_FASL_TYPE="fasl"
|
2013-10-13 07:45:07 +01:00
|
|
|
;;
|
|
|
|
ecl)
|
|
|
|
NIX_LISP_LOAD_FILE="-load"
|
|
|
|
NIX_LISP_EXEC_CODE="-eval"
|
2016-03-25 16:57:45 +00:00
|
|
|
NIX_LISP_QUIT="(quit)"
|
2017-03-30 12:00:43 +01:00
|
|
|
NIX_LISP_NODEBUG='--nodebug'
|
2013-10-13 07:45:07 +01:00
|
|
|
NIX_LISP_FINAL_PARAMETERS=
|
2017-04-10 00:10:39 +01:00
|
|
|
NIX_LISP_FASL_TYPE="fas"
|
2013-10-13 07:45:07 +01:00
|
|
|
;;
|
|
|
|
clisp)
|
|
|
|
NIX_LISP_LOAD_FILE="-c -l"
|
|
|
|
NIX_LISP_EXEC_CODE="-x"
|
2016-03-25 16:57:45 +00:00
|
|
|
NIX_LISP_QUIT="(quit)"
|
2017-03-30 12:00:43 +01:00
|
|
|
NIX_LISP_NODEBUG='-on-error exit'
|
2013-10-13 07:45:07 +01:00
|
|
|
NIX_LISP_FINAL_PARAMETERS="-repl"
|
2017-04-10 00:10:39 +01:00
|
|
|
NIX_LISP_FASL_TYPE="fas"
|
|
|
|
;;
|
|
|
|
lx86cl64)
|
|
|
|
NIX_LISP_LOAD_FILE="-l"
|
|
|
|
NIX_LISP_EXEC_CODE="-e"
|
|
|
|
NIX_LISP_QUIT="(quit)"
|
|
|
|
NIX_LISP_NODEBUG='-b'
|
|
|
|
NIX_LISP_FINAL_PARAMETERS=
|
|
|
|
NIX_LISP_FASL_TYPE="lx64fsl"
|
|
|
|
;;
|
|
|
|
lx86cl)
|
|
|
|
NIX_LISP_LOAD_FILE="-l"
|
|
|
|
NIX_LISP_EXEC_CODE="-e"
|
|
|
|
NIX_LISP_QUIT="(quit)"
|
|
|
|
NIX_LISP_NODEBUG='-b'
|
|
|
|
NIX_LISP_FINAL_PARAMETERS=
|
|
|
|
NIX_LISP_FASL_TYPE="lx32fsl"
|
|
|
|
;;
|
|
|
|
abcl)
|
|
|
|
NIX_LISP_LOAD_FILE="--load"
|
|
|
|
NIX_LISP_EXEC_CODE="--eval"
|
|
|
|
NIX_LISP_QUIT="(quit)"
|
|
|
|
NIX_LISP_NODEBUG=''
|
|
|
|
NIX_LISP_FINAL_PARAMETERS=
|
|
|
|
NIX_LISP_FASL_TYPE="abcl"
|
2013-10-13 07:45:07 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
NIX_LISP_ASDF_REGISTRY_CODE="
|
|
|
|
(progn
|
2017-03-30 12:00:43 +01:00
|
|
|
#+asdf3 (setf asdf:*default-source-registries*
|
|
|
|
'(asdf/source-registry:environment-source-registry))
|
2013-10-13 07:45:07 +01:00
|
|
|
(asdf:initialize-source-registry)
|
|
|
|
)
|
|
|
|
"
|
|
|
|
|
2017-04-06 17:43:42 +01:00
|
|
|
NIX_LISP_ASDF="${NIX_LISP_ASDF:-@out@}"
|
2015-04-14 09:51:19 +01:00
|
|
|
|
2017-03-30 12:00:43 +01:00
|
|
|
nix_lisp_run_single_form(){
|
|
|
|
NIX_LISP_FINAL_PARAMETERS=("$NIX_LISP_EXEC_CODE" "$1"
|
|
|
|
"$NIX_LISP_EXEC_CODE" "$NIX_LISP_QUIT" $NIX_LISP_NODEBUG)
|
|
|
|
}
|
|
|
|
|
|
|
|
eval "$NIX_LISP_PRELAUNCH_HOOK"
|
|
|
|
|
2013-10-13 07:45:07 +01:00
|
|
|
[ -z "$NIX_LISP_SKIP_CODE" ] && "$NIX_LISP_COMMAND" $NIX_LISP_EARLY_OPTIONS \
|
2017-04-10 00:10:39 +01:00
|
|
|
$NIX_LISP_EXEC_CODE "${NIX_LISP_ASDF_LOAD:-"(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.$NIX_LISP_FASL_TYPE\")"}" \
|
2013-10-13 07:45:07 +01:00
|
|
|
$NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \
|
2017-03-31 10:13:29 +01:00
|
|
|
${NIX_LISP_FINAL_PARAMETERS[*]:+"${NIX_LISP_FINAL_PARAMETERS[@]}"} \
|
2013-10-13 07:45:07 +01:00
|
|
|
"$@"
|