aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/lisp-modules/clwrapper
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2017-03-30 13:00:43 +0200
committerMichael Raskin <7c6f434c@mail.ru>2017-03-30 13:00:43 +0200
commit953fc6c0a057797c225f8cda787c4348f2b6c2cd (patch)
tree7f8b783001c798d26f0a4cd4a6de54ec4503adbe /pkgs/development/lisp-modules/clwrapper
parentc1f922b0b5641433f1aba67ab7c9a319391b0975 (diff)
clwrapper: better support for ensuring noninteractive execution
Diffstat (limited to 'pkgs/development/lisp-modules/clwrapper')
-rwxr-xr-xpkgs/development/lisp-modules/clwrapper/cl-wrapper.sh19
-rw-r--r--pkgs/development/lisp-modules/clwrapper/default.nix1
2 files changed, 17 insertions, 3 deletions
diff --git a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
index 90fa48814a2..d7485936941 100755
--- a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
+++ b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!@stdenv_shell@
# Part of NixPkgs package collection
# This script can be used at your option under the same license as NixPkgs or
# under MIT/X11 license
@@ -15,38 +15,51 @@ export NIX_LISP NIX_LISP_LOAD_FILE NIX_LISP_EXEC_CODE NIX_LISP_COMMAND NIX_LISP_
test -n "$NIX_LISP_LD_LIBRARY_PATH" &&
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH${LD_LIBRARY_PATH+:}$NIX_LISP_LD_LIBRARY_PATH"
+declare -a NIX_LISP_FINAL_PARAMETERS;
+
case "$NIX_LISP" in
sbcl)
NIX_LISP_LOAD_FILE="--load"
NIX_LISP_EXEC_CODE="--eval"
NIX_LISP_QUIT="(quit)"
+ NIX_LISP_NODEBUG='--non-interactive'
NIX_LISP_FINAL_PARAMETERS=
;;
ecl)
NIX_LISP_LOAD_FILE="-load"
NIX_LISP_EXEC_CODE="-eval"
NIX_LISP_QUIT="(quit)"
+ NIX_LISP_NODEBUG='--nodebug'
NIX_LISP_FINAL_PARAMETERS=
;;
clisp)
NIX_LISP_LOAD_FILE="-c -l"
NIX_LISP_EXEC_CODE="-x"
NIX_LISP_QUIT="(quit)"
+ NIX_LISP_NODEBUG='-on-error exit'
NIX_LISP_FINAL_PARAMETERS="-repl"
;;
esac
NIX_LISP_ASDF_REGISTRY_CODE="
(progn
- (setf asdf:*default-source-registries* '(asdf/source-registry:environment-source-registry))
+ #+asdf3 (setf asdf:*default-source-registries*
+ '(asdf/source-registry:environment-source-registry))
(asdf:initialize-source-registry)
)
"
NIX_LISP_ASDF="${NIX_LISP_ASDF:-@asdf@}"
+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"
+
[ -z "$NIX_LISP_SKIP_CODE" ] && "$NIX_LISP_COMMAND" $NIX_LISP_EARLY_OPTIONS \
$NIX_LISP_EXEC_CODE "${NIX_LISP_ASDF_LOAD:-"(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.lisp\")"}" \
$NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \
- $NIX_LISP_FINAL_PARAMETERS \
+ "${NIX_LISP_FINAL_PARAMETERS[@]}" \
"$@"
diff --git a/pkgs/development/lisp-modules/clwrapper/default.nix b/pkgs/development/lisp-modules/clwrapper/default.nix
index 172af31f834..978e16fd998 100644
--- a/pkgs/development/lisp-modules/clwrapper/default.nix
+++ b/pkgs/development/lisp-modules/clwrapper/default.nix
@@ -13,6 +13,7 @@ stdenv.mkDerivation {
'';
inherit asdf lisp;
+ stdenv_shell = stdenv.shell;
setupHook = ./setup-hook.sh;