mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 05:33:23 +00:00
d44439d03e
Features: + configurable via environment variables + can skip the actual launching of the lisp implementation (source it with NIX_LISP_SKIP_CODE=1 to get all the settings) + currently supports SBCL, CLisp, ECL + determines lisp implementation from NIX_LISP_COMMAND variable or from buildInputs + sets ASDF search path for packages using buildInputs
45 lines
1.1 KiB
Bash
Executable File
45 lines
1.1 KiB
Bash
Executable File
#! /bin/sh
|
|
# Part of NixPkgs package collection
|
|
# This script can be used at your option under the same license as NixPkgs or
|
|
# 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
|
|
|
|
case "$NIX_LISP" in
|
|
sbcl)
|
|
NIX_LISP_LOAD_FILE="--load"
|
|
NIX_LISP_EXEC_CODE="--eval"
|
|
NIX_LISP_FINAL_PARAMETERS=
|
|
;;
|
|
ecl)
|
|
NIX_LISP_LOAD_FILE="-load"
|
|
NIX_LISP_EXEC_CODE="-eval"
|
|
NIX_LISP_FINAL_PARAMETERS=
|
|
;;
|
|
clisp)
|
|
NIX_LISP_LOAD_FILE="-c -l"
|
|
NIX_LISP_EXEC_CODE="-x"
|
|
NIX_LISP_FINAL_PARAMETERS="-repl"
|
|
;;
|
|
esac
|
|
|
|
NIX_LISP_ASDF_REGISTRY_CODE="
|
|
(progn
|
|
(setf asdf:*default-source-registries* '(asdf/source-registry:environment-source-registry))
|
|
(asdf:initialize-source-registry)
|
|
)
|
|
"
|
|
|
|
[ -z "$NIX_LISP_SKIP_CODE" ] && "$NIX_LISP_COMMAND" $NIX_LISP_EARLY_OPTIONS \
|
|
$NIX_LISP_EXEC_CODE "(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.lisp\")" \
|
|
$NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \
|
|
$NIX_LISP_FINAL_PARAMETERS \
|
|
"$@"
|