cl-rw

Layered streams for Common Lisp
git clone https://logand.com/git/cl-rw.git/
Log | Files | Refs

default.nix (2742B)


      1 {stdenv, fetchgit, sbcl, ccl, cmucl_binary, clisp, ecl, mkcl, lisptype, demo}:
      2 
      3 stdenv.mkDerivation rec {
      4   name = "cl-rw-demo-${demo}-${lisptype}";
      5 
      6   src = fetchgit {
      7     url = http://logand.com/git/cl-rw.git;
      8     rev = "ec5632cbea261e4fba765d9811b365b3efcb5bde";
      9     sha256 = "03w7rah4bkzqw2m47jrb0nhwcsk3qq90nqd193b7qbcdwjkr6l4b";
     10   };
     11 
     12   buildInputs = if "sbcl" == "${lisptype}" then [sbcl]
     13      else if "ccl" == "${lisptype}" then [ccl]
     14      else if "cmucl" == "${lisptype}" then [cmucl_binary]
     15      else if "clisp" == "${lisptype}" then [clisp]
     16      else if "ecl" == "${lisptype}" then [ecl]
     17      else if "mkcl" == "${lisptype}" then [mkcl]
     18      else [];
     19 
     20   sbclBuild = ''
     21     sbcl \
     22       --lose-on-corruption \
     23       --disable-ldb \
     24       --disable-debugger \
     25       --no-sysinit \
     26       --no-userinit \
     27       --eval '(require :asdf)' \
     28       --eval '(push (truename "./") asdf:*central-registry*)' \
     29       --eval '(require :cl-rw-demo-${demo})' \
     30       --eval '(rw.demo.${demo}::save-image)'
     31   '';
     32   cclBuild = ''
     33     lx86cl64 -K utf-8 -n \
     34       -e '(require :asdf)' \
     35       -e '(push (truename "./") asdf:*central-registry*)' \
     36       -e '(require :cl-rw-demo-${demo})' \
     37       -e '(rw.demo.${demo}::save-image)'
     38   '';
     39   cmuclBuild = ''
     40     lisp \
     41       -batch \
     42       -noinit \
     43       -nositeinit \
     44       -eval '(require :asdf)' \
     45       -eval '(push (truename "./") asdf:*central-registry*)' \
     46       -eval '(require :cl-rw-demo-${demo})' \
     47       -eval '(rw.demo.${demo}::save-image)'
     48   '';
     49   clispBuild = ''
     50     clisp \
     51       -v \
     52       -norc \
     53       -i "${clisp}/lib/clisp/asdf" \
     54       -x '(push (truename "./") asdf:*central-registry*)' \
     55       -x '(require :cl-rw-demo-${demo})' \
     56       -x '(rw.demo.${demo}::save-image)'
     57   '';
     58   eclBuild = ''
     59     ecl \
     60       -norc \
     61       -eval '(require :asdf)' \
     62       -eval '(push (truename "./") asdf:*central-registry*)' \
     63       -eval '(require :cl-rw-demo-${demo})' \
     64       -eval '(rw.demo.${demo}::save-image)'
     65   '';
     66   mkclBuild = ''
     67     mkcl \
     68       -norc \
     69       -eval '(require :asdf)' \
     70       -eval '(push (truename "./") asdf:*central-registry*)' \
     71       -eval '(require :cl-rw-demo-${demo})' \
     72       -eval '(rw.demo.${demo}::save-image)'
     73   '';
     74   buildPhase = ''
     75     export ASDF_OUTPUT_TRANSLATIONS=/:$(pwd)/cache/:
     76   ''
     77   + (if "sbcl" == "${lisptype}" then sbclBuild
     78      else if "ccl" == "${lisptype}" then cclBuild
     79      else if "cmucl" == "${lisptype}" then cmuclBuild
     80      else if "clisp" == "${lisptype}" then clispBuild
     81      else if "ecl" == "${lisptype}" then eclBuild
     82      else if "mkcl" == "${lisptype}" then mkclBuild
     83      else "");
     84 
     85   dontPatchELF = true;
     86   dontStrip = true;
     87 
     88   installPhase = ''
     89     mkdir -p $out/bin
     90     cp cl-rw-demo-${demo} $out/bin/${name}
     91   '';
     92 }