Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at litex 57 lines 1.6 kB view raw
1{lib, stdenv, asdf, which, bash, lisp ? null}: 2stdenv.mkDerivation { 3 name = "cl-wrapper-script"; 4 5 buildPhase=""; 6 7 installPhase='' 8 mkdir -p "$out"/bin 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/* 16 17 substituteAll "${./setup-hook.sh}" "setup-hook-parsed" 18 addEnvHooks(){ true; }; 19 source setup-hook-parsed 20 setLisp "${lisp}" 21 echo "$NIX_LISP" 22 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/" 26 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)) 34 )"' \ 35 "$out/bin/common-lisp.sh" 36 ''; 37 38 buildInputs = [which]; 39 40 inherit asdf lisp bash; 41 stdenv_shell = stdenv.shell; 42 43 setupHook = ./setup-hook.sh; 44 45 dontUnpack = true; 46 47 ASDF_OUTPUT_TRANSLATIONS="${builtins.storeDir}/:${builtins.storeDir}"; 48 49 passthru = { 50 inherit lisp; 51 }; 52 53 meta = { 54 description = "Script used to wrap Common Lisp implementations"; 55 maintainers = [lib.maintainers.raskin]; 56 }; 57}