2018-07-21 02:44:44 +02:00
|
|
|
{stdenv, asdf, which, bash, lisp ? null}:
|
2013-10-13 08:45:07 +02:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "cl-wrapper-script";
|
|
|
|
|
|
|
|
buildPhase="";
|
|
|
|
|
|
|
|
installPhase=''
|
|
|
|
mkdir -p "$out"/bin
|
2017-04-06 18:43:42 +02:00
|
|
|
export head="$(which head)"
|
|
|
|
export ls="$(which ls)"
|
2016-03-25 10:34:51 +01:00
|
|
|
substituteAll ${./common-lisp.sh} "$out"/bin/common-lisp.sh
|
2014-11-14 13:28:54 +01:00
|
|
|
substituteAll "${./build-with-lisp.sh}" "$out/bin/build-with-lisp.sh"
|
2015-04-14 10:51:19 +02:00
|
|
|
substituteAll "${./cl-wrapper.sh}" "$out/bin/cl-wrapper.sh"
|
2017-11-04 12:45:51 +01:00
|
|
|
patchShebangs "$out/bin"
|
2013-10-13 08:45:07 +02:00
|
|
|
chmod a+x "$out"/bin/*
|
2017-04-10 01:10:39 +02:00
|
|
|
|
2017-03-31 22:46:32 +02:00
|
|
|
substituteAll "${./setup-hook.sh}" "setup-hook-parsed"
|
|
|
|
source setup-hook-parsed
|
|
|
|
setLisp "${lisp}"
|
|
|
|
echo "$NIX_LISP"
|
|
|
|
|
2017-04-06 18:43:42 +02:00
|
|
|
mkdir -p "$out/lib/common-lisp/"
|
|
|
|
cp -r "${asdf}/lib/common-lisp"/* "$out/lib/common-lisp/"
|
|
|
|
chmod u+rw -R "$out/lib/common-lisp/"
|
|
|
|
|
2017-04-10 01:10:39 +02:00
|
|
|
NIX_LISP_PRELAUNCH_HOOK='
|
|
|
|
NIX_LISP_FASL_TYPE=lisp
|
|
|
|
nix_lisp_run_single_form "(progn
|
2017-04-06 18:43:42 +02:00
|
|
|
(uiop/lisp-build:compile-file* \"'"$out"'/lib/common-lisp/asdf/build/asdf.lisp\")
|
2017-04-01 08:08:02 +02:00
|
|
|
(asdf:load-system :uiop :force :all)
|
|
|
|
(asdf:load-system :asdf :force :all)
|
2017-04-16 19:25:36 +02:00
|
|
|
(ignore-errors (asdf:load-system :uiop/version :force :all))
|
2017-04-01 08:08:02 +02:00
|
|
|
)"' \
|
2017-04-06 18:43:42 +02:00
|
|
|
"$out/bin/common-lisp.sh"
|
2013-10-13 08:45:07 +02:00
|
|
|
'';
|
|
|
|
|
2017-04-06 18:43:42 +02:00
|
|
|
buildInputs = [which];
|
|
|
|
|
2018-02-17 21:05:35 +01:00
|
|
|
inherit asdf lisp bash;
|
2017-03-30 13:00:43 +02:00
|
|
|
stdenv_shell = stdenv.shell;
|
2013-10-13 08:45:07 +02:00
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
|
|
|
phases="installPhase fixupPhase";
|
|
|
|
|
2017-04-06 18:43:42 +02:00
|
|
|
ASDF_OUTPUT_TRANSLATIONS="${builtins.storeDir}/:${builtins.storeDir}";
|
2014-02-10 21:03:17 +01:00
|
|
|
|
2013-10-13 08:45:07 +02:00
|
|
|
passthru = {
|
2017-04-06 18:43:42 +02:00
|
|
|
inherit lisp;
|
2013-10-13 08:45:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = ''Script used to wrap Common Lisp implementations'';
|
|
|
|
maintainers = [stdenv.lib.maintainers.raskin];
|
|
|
|
};
|
|
|
|
}
|