lispPackages: load precompiled asdf; support more implementations

This commit is contained in:
Michael Raskin 2017-04-10 01:10:39 +02:00
parent b64163a90d
commit 58d6b50232
3 changed files with 37 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#!@stdenv_shell@
# Part of NixPkgs package collection
# This script can be used at your option under the same license as NixPkgs or
# This script can be used at your option under the same license as NixPkgs or
# under MIT/X11 license
eval "$NIX_LISP_PREHOOK"
@ -24,6 +24,7 @@ case "$NIX_LISP" in
NIX_LISP_QUIT="(quit)"
NIX_LISP_NODEBUG='--non-interactive'
NIX_LISP_FINAL_PARAMETERS=
NIX_LISP_FASL_TYPE="fasl"
;;
ecl)
NIX_LISP_LOAD_FILE="-load"
@ -31,6 +32,7 @@ case "$NIX_LISP" in
NIX_LISP_QUIT="(quit)"
NIX_LISP_NODEBUG='--nodebug'
NIX_LISP_FINAL_PARAMETERS=
NIX_LISP_FASL_TYPE="fas"
;;
clisp)
NIX_LISP_LOAD_FILE="-c -l"
@ -38,6 +40,31 @@ case "$NIX_LISP" in
NIX_LISP_QUIT="(quit)"
NIX_LISP_NODEBUG='-on-error exit'
NIX_LISP_FINAL_PARAMETERS="-repl"
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"
;;
esac
@ -59,7 +86,7 @@ nix_lisp_run_single_form(){
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_LOAD:-"(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.$NIX_LISP_FASL_TYPE\")"}" \
$NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \
${NIX_LISP_FINAL_PARAMETERS[*]:+"${NIX_LISP_FINAL_PARAMETERS[@]}"} \
"$@"

View File

@ -12,7 +12,7 @@ stdenv.mkDerivation {
substituteAll "${./build-with-lisp.sh}" "$out/bin/build-with-lisp.sh"
substituteAll "${./cl-wrapper.sh}" "$out/bin/cl-wrapper.sh"
chmod a+x "$out"/bin/*
substituteAll "${./setup-hook.sh}" "setup-hook-parsed"
source setup-hook-parsed
setLisp "${lisp}"
@ -22,7 +22,9 @@ stdenv.mkDerivation {
cp -r "${asdf}/lib/common-lisp"/* "$out/lib/common-lisp/"
chmod u+rw -R "$out/lib/common-lisp/"
NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(progn
NIX_LISP_PRELAUNCH_HOOK='
NIX_LISP_FASL_TYPE=lisp
nix_lisp_run_single_form "(progn
(uiop/lisp-build:compile-file* \"'"$out"'/lib/common-lisp/asdf/build/asdf.lisp\")
(asdf:load-system :uiop :force :all)
(asdf:load-system :asdf :force :all)

View File

@ -1,7 +1,7 @@
args @ {stdenv, clwrapper, baseName, testSystems ? [baseName], version ? "latest"
, src, description, deps, buildInputs ? [], meta ? {}, overrides?(x: {})
, propagatedBuildInputs ? []}:
let
let
deployConfigScript = ''
outhash="$out"
outhash="''${outhash##*/}"
@ -39,7 +39,7 @@ let
echo "#! /bin/sh" >> "$launch_script"
echo "source '$config_script'" >> "$launch_script"
echo "export LD_LIBRARY_PATH=\"\$NIX_LISP_LD_LIBRARY_PATH\''${NIX_LISP_LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH\"" >> "$launch_script"
echo '"${clwrapper}/bin/common-lisp.sh" "$@"' >> "$launch_script"
echo '"${clwrapper}/bin/common-lisp.sh" "$@"' >> "$launch_script"
'';
basePackage = {
name = "lisp-${baseName}-${version}";
@ -66,12 +66,12 @@ basePackage = {
(asdf:operate (quote asdf::compile-bundle-op) :${testSystem})
(ignore-errors (asdf:operate (quote asdf::deploy-asd-op) :${testSystem}))
)"' \
"$out/bin/${args.baseName}-lisp-launcher.sh" ""
"$out/bin/${args.baseName}-lisp-launcher.sh"
'') testSystems}
eval "$postInstall"
'';
propagatedBuildInputs = (args.deps or []) ++ [clwrapper clwrapper.lisp clwrapper.asdf]
propagatedBuildInputs = (args.deps or []) ++ [clwrapper clwrapper.lisp clwrapper.asdf]
++ (args.propagatedBuildInputs or []);
buildInputs = buildInputs;
dontStrip=true;