Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at release-18.03 56 lines 1.6 kB view raw
1{stdenv, fetchurl, 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 source setup-hook-parsed 19 setLisp "${lisp}" 20 echo "$NIX_LISP" 21 22 mkdir -p "$out/lib/common-lisp/" 23 cp -r "${asdf}/lib/common-lisp"/* "$out/lib/common-lisp/" 24 chmod u+rw -R "$out/lib/common-lisp/" 25 26 NIX_LISP_PRELAUNCH_HOOK=' 27 NIX_LISP_FASL_TYPE=lisp 28 nix_lisp_run_single_form "(progn 29 (uiop/lisp-build:compile-file* \"'"$out"'/lib/common-lisp/asdf/build/asdf.lisp\") 30 (asdf:load-system :uiop :force :all) 31 (asdf:load-system :asdf :force :all) 32 (ignore-errors (asdf:load-system :uiop/version :force :all)) 33 )"' \ 34 "$out/bin/common-lisp.sh" 35 ''; 36 37 buildInputs = [which]; 38 39 inherit asdf lisp bash; 40 stdenv_shell = stdenv.shell; 41 42 setupHook = ./setup-hook.sh; 43 44 phases="installPhase fixupPhase"; 45 46 ASDF_OUTPUT_TRANSLATIONS="${builtins.storeDir}/:${builtins.storeDir}"; 47 48 passthru = { 49 inherit lisp; 50 }; 51 52 meta = { 53 description = ''Script used to wrap Common Lisp implementations''; 54 maintainers = [stdenv.lib.maintainers.raskin]; 55 }; 56}