1 {lib, stdenv, asdf, which, bash, lisp ? null}:
3 name = "cl-wrapper-script";
9 export head="$(which head)"
10 export ls="$(which ls)"
11 substituteAll ${./common-lisp.sh} "$out"/bin/common-lisp.sh
12 substituteAll "${./build-with-lisp.sh}" "$out/bin/build-with-lisp.sh"
13 substituteAll "${./cl-wrapper.sh}" "$out/bin/cl-wrapper.sh"
14 patchShebangs "$out/bin"
15 chmod a+x "$out"/bin/*
17 substituteAll "${./setup-hook.sh}" "setup-hook-parsed"
18 addEnvHooks(){ true; };
19 source setup-hook-parsed
23 mkdir -p "$out/lib/common-lisp/"
24 cp -r "${asdf}/lib/common-lisp"/* "$out/lib/common-lisp/"
25 chmod u+rw -R "$out/lib/common-lisp/"
27 NIX_LISP_PRELAUNCH_HOOK='
28 NIX_LISP_FASL_TYPE=lisp
29 nix_lisp_run_single_form "(progn
30 (uiop/lisp-build:compile-file* \"'"$out"'/lib/common-lisp/asdf/build/asdf.lisp\")
31 (asdf:load-system :uiop :force :all)
32 (asdf:load-system :asdf :force :all)
33 (ignore-errors (asdf:load-system :uiop/version :force :all))
35 "$out/bin/common-lisp.sh"
38 buildInputs = [which];
40 inherit asdf lisp bash;
41 stdenv_shell = stdenv.shell;
43 setupHook = ./setup-hook.sh;
47 ASDF_OUTPUT_TRANSLATIONS="${builtins.storeDir}/:${builtins.storeDir}";
54 description = "Script used to wrap Common Lisp implementations";
55 maintainers = [lib.maintainers.raskin];