pax_global_header00006660000000000000000000000064125536205000014510gustar00rootroot0000000000000052 comment=4f4c7d031ae582a3f2780617030595bcb5f464d9 cl-launch-4.1.4/000077500000000000000000000000001255362050000133645ustar00rootroot00000000000000cl-launch-4.1.4/.gitignore000066400000000000000000000006061255362050000153560ustar00rootroot00000000000000# Generated during a build build.xcvb cl-launch cl-launch.asd cl-launch.1 cl-launch.1.md launcher.lisp wrapper.sh cl-shim cl # Generated when compiling with e.g. SLIME *.*f*sl *.fas *.lib *.o # Generated by dpkg-buildpackage debian/cl-launch.debhelper.log debian/cl-launch.postinst.debhelper debian/cl-launch.prerm.debhelper debian/cl-launch.substvars debian/cl-launch/ debian/files .pc/ cl-launch-4.1.4/00INSTALL000066400000000000000000000054231255362050000145610ustar00rootroot00000000000000INSTALLING cl-launch ==================== If you're going to build things that depend on cl-launch using ASDF or XCVB, you need to install cl-launch. However, even without installation, cl-launch will work happily as a standalone script that drives the building of simple executables or ones that use ASDF. Simple installation ------------------- If you want to install cl-launch at its default location in ``/usr/local``, just you:: sudo make install If instead you want it in ``/usr``, do:: sudo make install PREFIX=/usr A list of variables you may want to modify or override is at the beginning of the ``Makefile``. Wherever you install cl-launch, we recommend you have a symlink from /usr/bin/cl to wherever you installed cl-launch, so that everyone may be able rely on that location for scripts that start with: #!/usr/bin/cl Advanced installation --------------------- You can decide separately where the binary will be using ``INSTALL_BIN`` (to override the default of ``$PREFIX/bin``) and where the Lisp source code will go using ``INSTALL_SOURCE`` (to override the default of ``$PREFIX/share/common-lisp/source/cl-launch``) with a symlink to the asd file going in ``INSTALL_SYSTEMS`` (to override the default of ``$PREFIX/share/common-lisp/systems``). Update and reinstallation ------------------------- Personally, I have a ``./reinstall`` script that does:: make install_system PREFIX=$HOME/.local and if not for a judicious symlink from ``$HOME/bin/cl-launch`` to my checkout, it would also do:: make install_binary PREFIX=$HOME Configuration ------------- Of course you should adjust your ``PATH`` and your ``CL_SOURCE_REGISTRY`` coherently with where you install cl-launch. Faking the installation ----------------------- If you just want to see what cl-launch will create without installing it to the final destination, you can install to a fake destination:: mkdir -p build/bin build/systems build/source make install INSTALL_BIN=${PWD}/build/bin INSTALL_SOURCE=${PWD}/build/source INSTALL_SYSTEMS=${PWD}/build/systems Using it -------- Get short help with cl-launch --help Get long help with cl-launch --more-help | ${PAGER:-less} Here are three examples: 1- Running code directly from the command line: cl -sp lisp-stripper "(count-lisp-loc \"asdf.lisp\")" 2- Defining a script that counts lines of Lisp code a la wc : #!/usr/bin/cl -sp lisp-stripper -E main (defun main (argv) (if argv (map () 'print-loc-count argv) (print-loc-count *standard-input*))) 3- Comparing how the many implementations evaluate a same form: for l in sbcl ccl clisp cmucl ecl abcl scl allegro lispworks gcl xcl ; do cl-launch -l $l -i '(format t "'$l': ~S~%" `#5(1 ,@`(2 3)))' \ 2>&1 | grep "^$l:" # LW, GCL are verbose done More examples in XCVB and Exscribe source code. cl-launch-4.1.4/90INTERNALS000066400000000000000000000030311255362050000150140ustar00rootroot00000000000000NOTE TO HACKERS WHO'D LIKE TO HACK cl-launch INTERNALS I conceive cl-launch as the ultimate exercise in "useful quining". It's a shell script, it's a Lisp program header and library, it outputs shell scripts and Lisp programs that may include parts of cl-launch. It also includes its own test system (no more: mostly moved to another file) and documentation (still). cl-launch is very hard to hack. A change you'd think is innocuous will actually break some complex combination of options on some Lisp implementation and shell variant. Even for the simplest of changes, I recommend running a full test before you release, which may involve: LISPS="clisp sbcl ccl ecl gclcvs cmucl gcl" # include whatever you have mkdir -p ${TMP:-/tmp}/cl-launch-test && cd ${TMP:-/tmp}/cl-launch-test && ${CL-LAUNCH} -l "${LISPS}" -B tests && ${CL-LAUNCH} -l clisp -B shell_tests If you add a new option, you probably should be adding a test for it somewhere in the shell function do_tests, which will double the testing time, currently over an hour for me. Happy hacking! Bibliography: * For how #! works, see the NetBSD man page on "script" in section 7: man 7 script http://netbsd.gw.com/cgi-bin/man-cgi?script+7+NetBSD-current Note that Linux recursively accepts a shell script as a script interpreter, and therefore does not need the cl-shim binary, whereas MacOS splits the argument of a #! script by spaces, and so it is not portable to use any space or shell-special character in the first line, for that will only work on Linux. cl-launch-4.1.4/95TODO000066400000000000000000000067541255362050000142460ustar00rootroot00000000000000TODO for cl-launch as of 4.1.4 * When resuming from an image then dumping another, the INCLUDE_PATH becomes a very bad variable to look for the image. Include a test case and fix it. More generally, test with directory differences between image and other stuff. * Maybe: add "dump from previous image" support for ECL? One limitation that cl-launch has on ECL (vs on e.g. SBCL) is the inability to "dump an image from a previous image". This could be achieved by hacking asdf:make-build (from ecl/contrib/asdf/asdf-ecl.lisp) to intercept in a (defmethod perform :before ((op monolithic-bundle-op) (c system)) ...) the arguments to the last call to c::builder, and to re-inject those arguments in same call them the next time around, assuming (which is somewhat fragile) that objects won't have been moved or deleted by then. I do not currently intend to support this feature in cl-launch, but will hopefully support it in XCVB that can do the bookkeeping on its side. NB: as in uiop/lisp-build:compile-file*, use (with-enough-pathname (input-file :defaults *base-build-directory*) * Add support for the REPL and/or interpreting commands from stdin; it can be called explicitly with --repl or disabled explicitly with --no-repl, but it otherwise provided as the default fallback behavior when neither script nor build or execution command is provided. This brings behavior to par with /bin/sh. For extra brownies, automatically wrap inside rlwrap or some such if at the terminal (or conversely, disable GNU CLISP interactivity when not wanted). * Convert cl-launch to a pure Lisp program, that can create a shell script for bootstrap purposes? Therefore, /usr/bin/cl can have fast startup, and not have to spawn an external program unless explicitly requested a non-default implementation. Maybe just add all the cl-launch features to buildapp. * Support these other options from Xach's buildapp? --load-path --asdf-path --asdf-tree --manifest-file --logfile * asdf-path and asdf-tree would be accumulated into a source-registry argument to be passed to cl-launch. * load-path would not only require something similar, but also using a SEARCH-AND-LOAD function that consults this path before it loads something. * Maybe add these SBCL-specific options, too? * --compress-core this one is trivial to add -- currently, buildapp silently ignores the option on CCL, but Xach feels like he may issue an error in the future instead. * --dynamic-space-size a lot of implementation have something like that. Abstract it away, or leave it implementation-specific? Can already be done with: --wrap 'SBCL_OPTIONS="--dynamic-space-size 1024" * --sbcl Can already be done with: --wrap 'SBCL="/opt/sbcl/bin/sbcl" Implement it that way? * --core-only That's hard to add, not that useful, and may require hacking both uiop and cl-launch to get it right. Lots of pain, no gain. * Find a way to load faster? When starting cl-launch, I experience a pause of ~1s. Half of it is loading the asdf fasl, then the upgraded asdf fasl. The other half is scanning the source registry. At least this scanning can be sped up, using ASDF 3.1.4's tools/cl-source-registry-cache.lisp * Use #+sbcl (setf sb-ext:*evaluator-mode* :interpret) and a series of (declaim (optimize (speed 0) (size 0) (debug 0) (compilation-speed 3))) and such to speed up the cl-launch bootstrap? cl-launch-4.1.4/Makefile000066400000000000000000000060741255362050000150330ustar00rootroot00000000000000# See 00INSTALL for instructions. # Tweak this configuration to your preferences: PREFIX ?= /usr/local INSTALL_BIN ?= ${PREFIX}/bin INSTALL_SOURCE ?= ${PREFIX}/share/common-lisp/source/cl-launch INSTALL_SYSTEMS ?= ${PREFIX}/share/common-lisp/systems LISPS ?= sbcl clisp ccl ecl cmucl gclcvs lispworks allegro gcl abcl scl # No user-serviceable part below CL_LAUNCH := ./cl-launch.sh all: source source: @echo "Building Lisp source code for cl-launch in current directory" @${CL_LAUNCH} --include ${PWD} -B install_path > /dev/null install: install_binary install_source install_system install_cl install_binary: install_binary_standalone install_source: @echo "Installing Lisp source code for cl-launch in ${INSTALL_SOURCE}" @mkdir -p ${INSTALL_SOURCE}/ @${CL_LAUNCH} --include ${INSTALL_SOURCE} -B install_path > /dev/null @if [ ! $${PWD} = ${INSTALL_SOURCE} ] ; then \ @cp dispatch.lisp ${INSTALL_SOURCE}/ ; \ fi install_system: install_source @echo "Linking .asd file for cl-launch into ${INSTALL_SYSTEMS}/" @mkdir -p ${INSTALL_SYSTEMS}/ @if [ `dirname ${INSTALL_SYSTEMS}`/source/cl-launch = ${INSTALL_SOURCE} ] ; then \ ln -sf ../source/cl-launch/cl-launch.asd ${INSTALL_SYSTEMS}/ ; \ else \ ln -sf ${INSTALL_SOURCE}/cl-launch.asd ${INSTALL_SYSTEMS}/ ; \ fi install_binary_standalone: @echo "Installing a standalone binary of cl-launch in ${INSTALL_BIN}/" @sh ./cl-launch.sh --no-include --no-rc \ --lisp '$(LISPS)' \ --output ${INSTALL_BIN}/cl-launch -B install_bin > /dev/null install-with-include: install_binary_with_include install_source install_system install_binary_with_include: @echo "Installing a binary of cl-launch in ${INSTALL_BIN}/" @echo "that will (by default) link its output to the code in ${INSTALL_SOURCE}" @sh ./cl-launch.sh --include ${INSTALL_SOURCE} --rc \ --lisp '$(LISPS)' \ --output ${INSTALL_BIN}/cl-launch -B install_bin > /dev/null cl-shim: cl-shim.c cc -Os -s -W -Wall -Werror -DCL_LAUNCH_SCRIPT="\"${INSTALL_BIN}/cl-launch\"" -o $@ $< ifeq ($(shell uname), Linux) install_cl: install_binary ln -s cl-launch ${INSTALL_BIN}/cl else install_cl: cl-shim cp -p cl-shim ${INSTALL_BIN}/cl endif clean: git clean -xfd mrproper: clean debian-package: source ./release.lisp debian-package # This fits my own system. YMMV. Try make install for a more traditional install reinstall: make install_system PREFIX=$${HOME}/.local # This might fit your system, installing from same directory reinstall_here: -git clean -xfd make install_source install_binary_standalone INSTALL_SOURCE=$$PWD INSTALL_BIN=$$PWD test: ./cl-launch.sh -l "${LISPS}" -B tests WRONGFUL_TAGS := RELEASE upstream # Delete wrongful tags from local repository fix-local-git-tags: for i in ${WRONGFUL_TAGS} ; do git tag -d $$i ; done # Delete wrongful tags from remote repository fix-remote-git-tags: for i in ${WRONGFUL_TAGS} ; do git push $${REMOTE:-origin} :refs/tags/$$i ; done push: git status git push --tags origin master git fetch git status debian-package-all: source ./release.lisp debian-package-all quickrelease: reinstall_here ./release.lisp quickrelease cl-launch-4.1.4/cl-launch-tests.sh000077500000000000000000000230151255362050000167320ustar00rootroot00000000000000foo_provide () { echo "(tst \"$1\"(defparameter *$2* 0)(defvar *err* 0)(format t \"--$2 worked, \"))" } foo_require () { echo "(tst \"$1\"(defvar *$2* 1)(defvar *err* 0)(incf *err* *$2*) (unless (zerop *$2*) (format t \"--$2 ~A, \" :failed)))" } t_env () { [ -n "$BEGIN_TESTS" ] && return export DOH=doh export ASDF_OUTPUT_TRANSLATIONS="(:output-translations :inherit-configuration (\"$PWD\" (\"$PWD\" \"cache\")))" TCURR= BEGIN_TESTS='(in-package :cl-user) ;;(eval-when (:compile-toplevel) (format *trace-output* "~&Prologue compiled~%")) ;;(eval-when (:load-toplevel) (format *trace-output* "~&Prologue loaded~%")) ;;(eval-when (:execute) (format *trace-output* "~&Prologue executed~%")) #+gcl (si::use-fast-links nil) ;; enable debugging information. (defmacro tst (x &body body) `(eval-when (:compile-toplevel :load-toplevel :execute)(handler-bind ((warning (function muffle-warning))) (eval (quote (progn (defvar *f* ()) (defparameter *n* ,x) (push (quote(progn ,@body)) *f*))))))) (defparameter *f* ())(defvar *n*) (defun tt () (dolist (x (reverse *f*)) (eval x))) (tst`:begin-tests(defvar *err* 0)(defvar *begin* 0) (format t "Hello, world, ~A speaking.~%" (uiop:implementation-identifier))) ' END_TESTS="$(foo_require t begin)"' (tst t(if (equal "won" (first uiop:*command-line-arguments*)) (format t "argument passing worked, ") (progn (incf *err*) (format t "argument passing failed,~%*c-l-a* = ~S~%r-c-l-a = ~S~%c-l-a = ~S~%" uiop:*command-line-arguments* (uiop:raw-command-line-arguments) (uiop:command-line-arguments)))) (if (equal "doh" (cl-launch::getenv "DOH")) (format t "getenv worked, ") (progn (incf *err*) (format t "getenv failed, "))) (if (zerop *err*) (format t "all tests ~a~a.~%" :o :k) (format t "~a ~a.~%" :error :detected)))' case "$LISP" in ecl) CLOUT="$PWD/clt-out-sh" ;; *) CLOUT="$PWD/clt-out.sh" ;; esac TFILE="clt-src.lisp" } t_begin () { remain="$#" ARGS= TORIG= TOUT= TINC2= HELLO="$BEGIN_TESTS" GOODBYE= TESTS="" BEGUN= ENDING="$END_TESTS" t_lisp "$@" t_end ;} t_lisp () { if [ -n "$LISP" ] ; then ARGS="--lisp $LISP" ; "$@" --lisp $LISP ; else "$@" ; fi ;} t_end () { if [ -n "$TEXEC" ] ; then t_end_exec "$@" ; else t_end_out "$@" ; fi ;} t_register () { # SHOW t_register "$@" ; print_var remain HELLO GOODBYE BEGUN=t HELLO="$HELLO$TESTS" if [ $remain = 1 ] || { [ $remain = 2 ] && [ "t_noinit" = "$2" ]; } ; then GOODBYE="$1$ENDING" TESTS= ENDING= #foo=1 else GOODBYE="" TESTS="$1" #foo=2 fi # print_var HELLO GOODBYE foo } t_next () { remain=$(($remain-1)) ; [ -n "$BEGUN" ] && HELLO= ; "$@" ;} t_args () { ARGS="$ARGS $1" ;} t_create () { create_file 644 "$1" echo "$2" TFILES="$TFILES $1" ;} t_cleanup () { rm $TFILES cache/* ; rmdir cache ;} t_file () { t_register "$(foo_require "$NUM:file" file)" $1 t_create $TFILE \ "(in-package :cl-user) $HELLO $(foo_provide "$NUM:file" file) $GOODBYE" if [ -n "$TINC2" ] ; then t_args "--file /..." ; else t_args "--file ..." ; fi t_next "$@" --file "$TFILE" } t_system () { t_register "$(foo_require "$NUM:system" system)" $1 t_create clt-asd.asd \ '(in-package :cl-user)(asdf:defsystem :clt-asd :components ((:file "clt-sys")))' t_create clt-sys.lisp \ "(in-package :cl-user)$HELLO$(foo_provide "$NUM:system" system)$GOODBYE" t_args "--system ..." t_next "$@" --system clt-asd --source-registry \ "(:source-registry \ (:directory \"${PWD}\") \ :ignore-inherited-configuration)" # (:tree ${ASDF_DIR}) \ } t_init () { t_register "$(foo_require "$NUM:init" init)" xxx_t_init t_args "--init ..." t_next "$@" --init "$HELLO$(foo_provide "$NUM:init" init)$GOODBYE(tt)" } t_noinit () { t_args "--restart ..." t_next "$@" --restart cl-user::tt } t_image () { t_args "--image ..." t_register "$(foo_require "$NUM:image" image)" $1 t_create clt-preimage.lisp \ "(in-package :cl-user)$HELLO$(foo_provide "$NUM:image" image)$GOODBYE" if ! [ -f clt.preimage ] ; then t_make --dump clt.preimage --file clt-preimage.lisp --output clt-preimage.sh fi t_next "$@" --image "$PWD/clt.preimage" } t_dump () { t_args "--dump ..." t_next "$@" --dump "$PWD/clt.image" } t_dump_ () { t_args "--dump !" t_next "$@" --dump "!" } t_inc () { ( OPTION --include "$PWD" -B install_path ) >&2 t_args "--include ..." t_next "$@" --include "$PWD" } t_inc1 () { TFILE=clt-src.lisp ; t_inc "$@" } t_inc2 () { TINC2=t TFILE="$PWD/clt-src.lisp" ; t_inc "$@" } t_noinc () { t_args "--no-include" t_next "$@" --no-include } t_update () { t_args "--update ..." TORIG=$CLOUT.orig ; cp -f $CLOUT $TORIG t_next "$@" --update $CLOUT } t_noupdate () { TORIG= t_next "$@" } t_end_out () { t_args "--output ... ; out.sh ..." TOUT=$CLOUT t_make "$@" --output $CLOUT t_check $CLOUT } t_end_exec () { t_args "--execute -- ..." t_check t_make "$@" --execute -- } t_make () { XDO t_$TEST_SHELL -x $PROG "$@" } t_check () { echo "cl-launch $ARGS" ( PATH=${PWD}:$PATH "$@" "won" 2>&1) | tee clt.log >&2 : RESULTS: "$(cat clt.log)" if [ -n "$TORIG" ] && [ -n "$TOUT" ] && ! cmp --quiet $TOUT $TORIG ; then echo "the updated file differs from the original one, although execution might not show the difference. Double check that with: diff -uN $TORIG $TOUT | less - $TORIG " t_check_failed elif [ 0 = "$(grep -c OK < clt.log)" ] || [ 0 != "$(grep -c 'ERROR\(:\| DETECTED\)' < clt.log)" ] ; then t_check_failed else t_check_success fi } t_check_success () { echo "success with test $NUM :-)" return 0 } t_check_failed () { echo "FAILURE with test $NUM :-(" [ -n "$NUM" ] && echo "You may restart from this test with: $PROG -l $(kwote1 "$LISPS") -B tests $NUM or $PROG -l $(kwote1 "$LISPS") -B tests $(printf %02d $(( ( $num / 4 ) * 4 )) )" [ -n "$TCURR" ] && echo "You may re-run just this test with: $PROG -B redo_test $TEST_SHELL $LISP $TCURR" [ -n "$NO_STOP" ] || ABORT "FIX THAT BUG!" } t_out () { t_env ; TEXEC= ; t_begin "$@" } t_exec () { t_env ; TEXEC=t ; t_begin "$@" } clisp_tests () { LISPS=clisp ; tests "$@" ;} all_tests () { NO_STOP=t ; tests "$@" ;} tests () { do_tests "$@" 2> tests.log } detect_program () { which "$1" 2>&1 > /dev/null } detect_shells () { # add something wrt ksh, pdksh ? TEST_SHELLS= for i in sh posh dash zsh pdksh bash busybox ; do if detect_program $i ; then TEST_SHELLS="$TEST_SHELLS $i" fi done } t_sh () { sh "$@" ;} t_bash () { bash "$@" ;} t_posh () { posh "$@" ;} t_pdksh () { pdksh "$@" ;} t_dash () { dash "$@" ;} t_zsh () { zsh -fy "$@" ;} t_busybox () { busybox sh "$@" ;} shell_tests () { detect_shells tests "$@" } do_tests () { if [ -n "$TEST_SHELLS" ] ; then echo "Using test shells $TEST_SHELLS" fi t_env num=0 MIN=${1:-0} MAX=${2:-999999} export LISP # Use this with # cl-launch.sh -B test # beware, it will clobber then remove a lot of file clt-* # and exercise your Lisp fasl cache for LISP in $LISPS ; do case $LISP in *) export ASDF_DIR="$($PROG --lisp "$LISP" --quiet --system asdf --init '(uiop:format! t "~%~:@(~A-~A~): ~S~%" :source :registry (asdf:system-source-directory :asdf))' | grep ^SOURCE-REGISTRY: | tail -1 | cut -d' ' -f2- )" ;; esac for TEST_SHELL in ${TEST_SHELLS:-${TEST_SHELL:-sh}} ; do echo "Using lisp implementation $LISP with test shell $TEST_SHELL" for TM in "" "image " ; do for TD in "" "dump " "dump_ " ; do case "$TM:$TD:$LISP" in # we don't know how to dump from a dump with ECL image*:dump*:ecl) ;; # we don't know how to dump at all with ABCL, XCL *:dump*:abcl|image*:*:abcl|*:dump*:xcl|image*:*:xcl) ;; # Unidentified bug using image on CLISP as of 4.0.7.9 image*:clisp) ;; *) for IF in "noinc" "noinc file" "inc" "inc1 file" "inc2 file" ; do TDIF="$TM$TD$IF" for TS in "" " system" ; do TDIFS="$TDIF$TS" case "$TD:$TS:$LISP" in dump_*:cmucl*|dump_*:gcl*|dump_*:allegro|dump_*:scl) : invalid or unsupported combo ;; # actually only available for ecl and sbcl *) for TI in "noinit" "init" ; do TDIFSI="$TDIFS $TI" case "$TDIFSI" in *"inc noinit") : skipping invalid combination ;; *) for TU in "noupdate" "update" ; do TUDIFSI="$TU $TDIFSI" for TO in "exec" "out" ; do case "$TU:$TO:$TD" in update:*:dump_*) : invalid combo ;; *:exec:dump_*) : invalid combo ;; *) TEUDIFSI="$TO $TUDIFSI" do_test $TEUDIFSI ;; esac ; done ; done ;; esac ; done ;; esac ; done ; done ; esac ; done ; done ; done ; done } redo_test () { export TEST_SHELL="$1" LISPS="$2" LISP="$2" ; shift 2 do_test "$@" } do_test () { if [ $MIN -le $num ] && [ $num -le $MAX ] ; then TCURR="$*" if [ -n "$num" ] ; then NUM=$(printf "%02d" $num) case "$*" in *noupdate*) # If we don't clean between runs of test/update, then # we have bizarre transient failures at test 12 or 40 when we e.g. # DEBUG_RACE_CONDITION=t cl-launch -l clisp -B tests 8 12 # There is some race condition somewhere in the cacheing layer, # and even though (trace ...) shows that cl-launch does try to # recompile then file, when it loads, it still find the old version in the cache. [ -n "$DEBUG_RACE_CONDITION" ] || test_clean ;; esac fi eval "$(for i ; do ECHOn " t_$i" ; done)" fi num=$(($num+1)) } test () { tests $@ && test_clean } test_clean () { rm -rfv clt* cache/ >&2 } fakeccl () { DO export LISP=ccl CCL=sbcl CCL_OPTIONS="--noinform --sysinit /dev/null --userinit /dev/null --eval (make-package':ccl) --eval (setf(symbol-function'ccl::quit)(symbol-function'sb-ext:quit)) --eval (setf(symbol-function'ccl::getenv)(symbol-function'sb-ext:posix-getenv))" OPTION "$@" } cl-launch-4.1.4/cl-launch.sh000077500000000000000000003154201255362050000155760ustar00rootroot00000000000000#!/bin/sh #| cl-launch.sh -- shell wrapper for Common Lisp -*- Lisp -*- CL_LAUNCH_VERSION='4.1.4' license_information () { AUTHOR_NOTE="\ # Please send your improvements to the author: # fare at tunes dot org < http://www.cliki.net/Fare%20Rideau >. " SHORT_LICENSE="\ # cl-launch is available under the terms of the bugroff license. # http://tunes.org/legalese/bugroff.html # You may at your leisure use the MIT license instead < http://opensource.org/licenses/MIT > " WEB_SITE="# For the latest version of cl-launch, see its web page at: # http://www.cliki.net/cl-launch " LICENSE_COMMENT="\ # This software can be used in conjunction with any other software: # the result may consist in pieces of the two software glued together in # a same file, but even then these pieces remain well distinguished, and are # each available under its own copyright and licensing terms, as applicable. # The parts that come from the other software are subject to the terms of use # and distribution relative to said software, which may well be # more restrictive than the terms of this software (according to lawyers # and the armed henchmen they got the taxpayers to pay to enforce their laws). # The bits of code generated by cl-launch, however, remain available # under the terms of their own license, and you may service them as you wish: # manually, using cl-launch --update or whichever means you prefer. # That said, if you believe in any of that intellectual property scam, # you may be subject to the terms of my End-Seller License: # http://www.livejournal.com/users/fare/21806.html " DISCLAIMER="\ # This file was automatically generated and contains parts of CL-Launch " } license_information ### Settings for the current installation -- adjust to your convenience ### Or see documentation for using commands -B install and -B install_bin. DEFAULT_LISPS="sbcl ccl clisp abcl allegro lispworks scl cmucl ecl mkcl gcl xcl" DEFAULT_INCLUDE_PATH= DEFAULT_USE_CL_LAUNCHRC= DEFAULT_USE_CLBUILD= DEFAULT_USE_QUICKLISP= ### Initialize cl-launch variables unset \ SOFTWARE_BUILD_FORMS SOFTWARE_FINAL_FORMS SOFTWARE_INIT_FORMS \ SOURCE_REGISTRY INCLUDE_PATH LISPS WRAPPER_CODE \ OUTPUT_FILE UPDATE LISP_CONTENT \ LINE LINE1 LINE2 NO_QUIT \ TRIED_CONFIGURATION HAS_CONFIGURATION \ EXEC_LISP DO_LISP DUMP LOAD_IMAGE RESTART RESTART_PACKAGE IMAGE IMAGE_OPT \ EXTRA_CONFIG_VARIABLES \ EXECUTABLE_IMAGE STANDALONE_EXECUTABLE CL_LAUNCH_STANDALONE \ CL_LAUNCH_FILE __CL_ARGV0 IS_X_SCRIPT DISPATCH_ENTRY_P \ TEST_SHELLS TORIG IMPL LISPS="$DEFAULT_LISPS" INCLUDE_PATH="$DEFAULT_INCLUDE_PATH" USE_CL_LAUNCHRC="$DEFAULT_USE_CL_LAUNCHRC" USE_CLBUILD="$DEFAULT_USE_CLBUILD" USE_QUICKLISP="$DEFAULT_USE_QUICKLISP" UNREAD_DEPTH=0 OUTPUT_FILE="!" PACKAGE=cl-user RESTART_PACKAGE= INIT_PACKAGE= FINAL_PACKAGE= ### Other constants MAGIC_MD5SUM="65bcc57c2179aad145614ec328ce5ba8" # Greenspun's Tenth Rule... CONTENT_DISCLAIMER="\ ;;; THE SOFTWARE AFTER THIS MARKER AND TO THE END OF THE FILE IS NOT PART OF ;;; CL-LAUNCH BUT A PIECE OF SOFTWARE DISTINCT FROM CL-LAUNCH. IT IS OWNED BY ;;; BY ITS OWNERS AND IS SUBJECT ITS OWN INDEPENDENT TERMS OF AVAILABILITY." CONTENT_BEGIN_MARKER="\ ;;; ${MAGIC_MD5SUM} SOFTWARE WRAPPED BY CL-LAUNCH BEGINS HERE:" ### Help ## setup a few environment variables for the program BASIC_ENV_CODE='PROG="$0"' eval "$BASIC_ENV_CODE" PROGBASE="${0##*/}" # "$(basename "$0")" CL_LAUNCH_URL="http://fare.tunes.org/files/cl-launch/cl-launch.sh" HELP_HEADER="cl-launch.sh $CL_LAUNCH_VERSION" print_help_header () { ECHO "$HELP_HEADER" i=0 ; while [ "$i" -lt "${#HELP_HEADER}" ] ; do ECHOn "=" ; i="$[$i+1]" done ; ECHO } print_help () { cat < Note: if this help is too long for you, you may scroll back, or use: $PROGBASE --more-help | less EOF } print_more_help () { cat< si.lisp lispworks-7-0-0-x86-linux -siteinit - -init - -build si.lisp There is no standard name for a console-only variant of LispWorks; older versions of cl-launch assume a default \`lispworks\`; since cl-launch 4.1.2.1, \`lispworks-console\` is assumed instead, to avoid conflicts. You can control the name you use with the shell variable \`\$LISPWORKS\`, or you can just leave \`lispworks-console\` in your path, and use a symlink, copy, shell alias or trivial wrapper script to enable your favorite shorter name \`lispworks\`, \`lw\`, \`lwcon\`, \`lw-console\`, etc. Similarly, a mlisp image for allegro can be created as follows: alisp -e '(progn (build-lisp-image "sys:mlisp.dxl" :case-mode :case-sensitive-lower :include-ide nil :restart-app-function nil) (when (probe-file "sys:mlisp") (delete-file "sys:mlisp")) (sys:copy-file "sys:alisp" "sys:mlisp"))' Additionally, \`cl-launch\` supports the use of \`clbuild\` as a wrapper to invoke the Lisp implementation, with the \`--clbuild\` option. Supported shells ---------------- \`cl-launch\` was tested with all of \`posh\` 0.4.7, \`bash\` 2.05, \`bash\` 3.1, \`zsh\` 4.3.2, \`dash\` 0.5.3 and \`busybox\` 1.01 \`ash\`. Lisp implementation invocation ------------------------------ When a \`cl-launch\` generated script is invoked, the \`cl-launch\` shell wrapper will try to execute the Lisp code with the first Common Lisp implementation it finds in a given list, which can be specified through option \`--lisp\`. The runtime behaviour of the \`cl-launch\` shell wrapper is very configurable through a series of environment variables. These variables can be controlled by the user by exporting them in his environment, or they can be restricted at the time of script generation by using cl-launch option \`--wrap\`. If variable \`LISP\` is defined, the shell wrapper will first try the implementation named by variable \`LISP\`. If that fails, it will try the list of implementations provided at script generation time. The list of implementations generated will be the argument to option \`--lisp\` if specified. Otherwise, \`cl-launch\` will supply its default value. This default value for the current instance of \`cl-launch\` is: $DEFAULT_LISPS This \`LISP\` selection only happens at system preparation time. If you dump an image then the script will always use the Lisp implementation for which an image was dumped. If you don't then the user may override the implementation. Note that these are nicknames built into the \`cl-launch\` shell wrapper, and not necessarily names of actual binary. You may control the mapping of implementation nickname to actual binary pathname to call with an environment variable. For a given implementation nickname, the environment variable will be the capitalization of the given nickname. Hence, variable \`\$SBCL\` controls where to look for the \`sbcl\` implementation, and variable \`\$CMUCL\` controls where to look for the \`cmucl\` implementation. If a binary is found with a matching pathname (using the standard unix \`\$PATH\` as required), then said implementation will be used, using proper command line options, that may be overridden with an environment variable similar to the previous but with \`_OPTIONS\` appended to its name. Hence, \`\$CMUCL_OPTIONS\` for \`cmucl\`, \`\$CLISP_OPTIONS\` for \`clisp\`, etc. Sensible defaults are provided for each implementation, so as to execute the software in non-interactive mode, with debugger disabled, without reading user-specific configuration files, etc. If you want to insist on using a given implementation with given options, you may use option \`--lisp\` and \`--wrap\`, as follows: --lisp 'sbcl clisp' --wrap ' LISP= # do not allow the user to specify his implementation SBCL=/usr/bin/sbcl # not any experimental thing by the user SBCL_OPTIONS="--noinform --sysinit /dev/null --userinit /dev/null \\ --disable-debugger" # predictable Lisp state CLISP=/usr/bin/clisp # fall back on machines that lack SBCL CLISP_OPTIONS=" -norc --quiet --quiet" # configure ASDF: CL_SOURCE_REGISTRY=/usr/local/share/common-lisp/source//: # assuming precompiled fasls there: ASDF_OUTPUT_TRANSLATIONS=/my/cl/src:/my/fasl/cache: ' If you dump an image, you need not unset the \`LISP\` variable, but you might still want to override any user-specified \`SBCL\` and \`SBCL_OPTIONS\` (or corresponding variables for your selected implementation) from what the user may specify. Note that you can use option \`--wrap "\$(cat your_script)"\` to embed into your program a full fledged script from a file. Your script may do arbitrary computations before the shell wrapper is run. It may make some consistency checks and abort before to run Lisp. Or it may analyze invocation arguments and make according adjustments to Lisp implementation options. This can be useful for setting options that cannot be set from the Lisp code, such the path to a runtime image, interactive or non-interactive execution, size of heaps, locale settings for source file encoding, etc. Reading the source code of \`cl-launch\` can be completely crazy. You may have great fun understanding why things are how they are and adding features without breaking anything! However, adding support for a new CL implementation should be straightforward enough: just search the sources for \`clisp\` or \`sbcl\` and mimic what I did for them. Be sure to send me what will get your favorite Lisp flavor of the month rolling. Limited clbuild support ----------------------- \`cl-launch\` 2.12 and later support using \`clbuild\` as a wrapper to configure your Lisp implementation, with option \`--clbuild\` (which can be disabled with option \`--no-clbuild\` if it was enabled by default in your \`cl-launch\` installation). Note that when you use \`clbuild\`, you can no longer override implementation options with say \`SBCL_OPTIONS\`, as clbuild takes care of the options for you. Any implementation banner will not be removed unless you instruct clbuild to do so. Also, you cannot use clbuild with a non-executable image different from \`clbuild\`'s, which precludes image dumping with \`cmucl\` or \`allegro\` (\`allegro\` could probably be updated, but I don't have a recent licence to test and develop). \`clbuild\` support is not fully tested at this point. Please report any bug. Simple cl-launch scripts ------------------------ In simple cases, you may create a Common Lisp shell script with \`cl-launch\` without a script generation step, just because you'll spend a lot of time editing the script and distributing it, and little time waiting for script startup time anyway. This notably is a good idea if you're not spawning many instances of the same version of a script on a given computer. If that's what you want, you may use \`cl-launch\` as a script interpret the following way (stripping leading spaces): #!/path/to/cl-launch ...options... For instance, you may write the following script (stripping leading spaces): #!/usr/bin/cl --entry main (defun main (argv) (format t "Hello, World!~%~S~%" argv)) On a recent Linux kernel, the options may include spaces, parentheses, etc., provided they are quoted as in a shell script. Also, using \`-X\` as your very first option and \`--\` as your last will ensure that the script works even if its name starts with a \`(\` or a \`-\`, in addition to working with older versions of \`cl-launch\`. Note however that Darwin (MacOS X) and other BSD kernels or old Linux kernels don't like the \`#!\` interpreter to itself be interpreted. On these operating system kernels, the system administrator must compile and install a small shim written in C, \`cl-shim.c\`, that will handle the proper script invocation. Most kernels have restrictions on how they handle arguments to a \`#!\` script, that prevent e.g. using \`/usr/bin/env\` as a trampoline; however, you may use the fully portable solution as follows, where the \`":" ;\` ensures that the script should remain valid bilingual shell and Lisp code: #!/bin/sh ":" ; exec cl-launch -X -sp my-package -E main -- "\$0" \${1+"\$@"} || exit (Actually \`"\$@"\` instead of \`\${1+"\$@"}\` should work just fine, unless you have an antique shell.) Note that if you don't need Lisp code to be loaded from your script, with everything happening in the build specification, then you may instead use a simple \`#!/bin/sh\` shell script from which you: exec /path/to/cl-launch -x ... -- "\$@". Also, in case you can't rely on \`cl-launch\` being at a fixed path, or if your shell and/or kernel combination doesn't support using \`cl-launch\` as a script interpreter, then you may instead start your script with the following lines: #!/bin/sh ":" ; exec cl-launch -X -- "\$0" "\$@" || exit (format t "It works!~%") Note that a mainline Linux kernel only supports the recursive \`#!\` implicit in \`#!/usr/bin/cl-launch\` since 2.6.27.9. Dumping images -------------- You can dump an image (for static compilation and fast startup) with option \`--dump IMAGE\` where \`IMAGE\` specifies the path where the image will be dumped. If you use option \`--include PATH\` then the image will be loaded back from that specified directory instead of the directory where you dumped it. This is useful if you're preparing a script to be installed at another place maybe on another computer. This option is currently supported on all CL implementations available with \`cl-launch\`. As a limitation, \`LispWorks\` will print a banner on standard output, unless you use the standalone executable option below. As another limitation, \`ECL\` will not be able to dump an image when running from a previously dumped image (with \`--image\`). This is because of the link model of ECL, whereby you'd need to be able to locate which object files were used in linking the original image, keep track of these files, and prepend the list of them to to the object files linked into the dump. This is not conceptually impossible and patches are welcome. However, we hope to support that someday with a real build system that does it for you, such as XCVB. Standalone executables ---------------------- You can create standalone executables with the option \`--dump '!'\` (or by giving a \`--dump\` argument identical to the \`--output\` argument). This option is currently only supported with \`SBCL\`, \`ECL\`, \`CLISP\`, \`CMUCL\`, \`CCL\` and \`LispWorks\` Professional. Moreover \`CLISP\` has the issues below. \`CLISP\` standalone executables will react magically if invoked with options such as \`--clisp-help\` or \`--clisp-x '(sys::main-loop)'\`. That's a pretty far-fetched thing to hit by mistake, and the \`CLISP\` maintainers consider it a feature (I don't). Don't use such executables as \`setuid\`, and don't let untrusted users control arguments given to such executables that are run with extra privileges. cl-launch runtime API --------------------- \`cl-launch\` provides the following Lisp functions: Function \`cl-launch:compile-and-load-file\` takes as an argument a source pathname designator, and keyword arguments \`force-recompile\` (default \`NIL\`) and \`verbose\` (default \`NIL\`). It will arrange to compile the specified source file if it is explicitly requested, or if the file doesn't exist, or if the fasl is not up-to-date. It will compile and load with the specified verbosity. It will take use \`uiop:compile-file-pathname*\` to determine the fasl pathname. The following variables and functions previously provided by \`cl-launch\` have the following replacement from \`ASDF\` and \`UIOP\`: Variable \`cl-launch:*arguments*\` is replaced by \`uiop:*command-line-arguments*\`. Function \`cl-launch:getenv\` is replaced by \`uiop:getenv\`. Function \`cl-launch:load-system\` is replaced by \`asdf:load-system\`. Function \`cl-launch:quit\` is replaced by \`uiop:quit\` (beware: the lambda-list is slightly different). Additionally, environment variables \`CL_LAUNCH_PID\` and \`CL_LAUNCH_FILE\` will be set to the process ID and the script invocation filename respectively. Verbose output mode ------------------- If the shell variable \`CL_LAUNCH_VERBOSE\` is exported and non-\`nil\`, then \`cl-launch\` and the scripts it generates will produce an abundance of output, display such things as the Lisp invocation command, compiling and loading files with \`:verbose t\` and \`:print t\`, etc. This is only useful for debugging \`cl-launch\` and/or your build process. Option \`--verbose\` sets this variable, whereas option \`--quiet\` resets it. Makefile examples ----------------- ### Automatically download of the current version of cl-launch if not present cl-launch.sh: wget -O cl-launch.sh ${CL_LAUNCH_URL} chmod a+x cl-launch.sh ### Making a shell script executable from a simple Lisp file named foo.lisp foo.sh: cl-launch.sh foo.lisp ./cl-launch.sh --output foo.sh --file foo.lisp ### A more complex example using all options. run-foo.sh: cl-launch.sh preamble.lisp ./cl-launch.sh --output run-foo.sh \\ --file preamble.lisp --system foo \\ --init "(foo:main uiop:*command-line-arguments*)" \\ --source-registry \${PREFIX}/cl-foo/systems: \\ --lisp "ccl sbcl" --wrap 'SBCL=/usr/local/bin/sbcl-no-unicode' \\ --no-include ### An example with horrible nested makefile, shell and Lisp quoting hello: opera=wORlD ; ./cl-launch.sh --execute --init \\ "(format t \\"~25R~A~A~%\\" 6873049 #\\\\space '\$\$opera)" Caveat Lispor ------------- \`cl-launch\` begins evaluation of your Lisp software in the \`cl-user\` package, or whichever package you specify. By the time your initialization forms are evaluated, the package may or may not have changed, depending on the fine-grained semantics of \`load\`. Be sure to use \`in-package\` if these things matter. If you change the readtable, even weirder things may happen. There are lots of ways of making mistakes by improperly quoting things when you write shell commands. \`cl-launch\` does the right thing, but you still must be careful with the nested quoting mechanisms of \`make\`, shell, and Lisp. Here is a simple example use of cl-launch to quickly compare the result of a same computation on a variety of systems: for l in sbcl cmucl clisp gcl ccl ; do ./cl-launch.sh --lisp \$l --execute --init \\ '(format t "'\$l' ~A~%" most-positive-fixnum)' ; done Internally, \`cl-launch\` includes many self-test functions. You may for instance try (from a directory where it may create junk): ./cl-launch.sh -l 'sbcl cmucl clisp gclcvs' -B tests Share and Enjoy! EOF } show_help () { print_help_header echo print_help echo print_help_footer exit "${1:-0}" } show_more_help () { print_help_header echo print_help echo print_more_help echo print_help_footer exit "${1:-0}" } error_help () { show_help "${1:-2}" >& 2 } show_version () { echo "cl-launch ${CL_LAUNCH_VERSION} Supported implementations: sbcl, cmucl (lisp), clisp, ecl, ccl (openmcl), abcl, mkcl, xcl, gcl (gclcvs), allegro (alisp), lispworks, scl Local defaults for generated scripts: will search in this order these supported implementations: ${DEFAULT_LISPS}" if [ -z "$DEFAULT_INCLUDE_PATH" ] ; then echo "\ will generate self-contained scripts using option --no-include by default" else echo "\ will generate scripts by default with runtime dependencies using option --include ${DEFAULT_INCLUDE_PATH}" fi if [ -n "$DEFAULT_USE_CL_LAUNCHRC" ] ; then echo "\ will use /etc/cl-launchrc and ~/.cl-launchrc by default" else echo "\ will not use /etc/cl-launchrc and ~/.cl-launchrc by default" fi if [ -z "$DEFAULT_USE_CLBUILD" ] ; then echo "\ will generate scripts that do not use clbuild by default" else echo "\ will generate scripts that use clbuild by default" fi if [ -z "$DEFAULT_USE_QUICKLISP" ] ; then echo "\ will generate scripts that do not use quicklisp by default" else echo "\ will generate scripts that use quicklisp by default" fi echo exit } ### Generic debugging library excerpted from ~fare/etc/zsh/fun.* print_basic_functions () { cat <<'EOF' ECHOn () { printf '%s' "$*" ;} simple_term_p () { case "$1" in *[!a-zA-Z0-9-+_,.:=%/]*) return 1 ;; *) return 0 ;; esac } if [ -n "$BASH_VERSION$ZSH_VERSION" ] ; then kwote0 () { a="${1//\\/\\\\}" ; a="${a//\`/\\\`}" ; a="${a//\$/\\\$}" ; printf %s "${a//\"/\\\"}" ;} else kwote0 () { ECHOn "$1" | sed -e "s/\([\\\\\"\$\`]\)/\\\\\\1/g" ;} fi kwote () { if simple_term_p "$1" ; then ECHOn "$1" ; else kwote0 "$1" ; fi ;} load_form_0 () { echo "(cl:load $1 :verbose nil :print nil)" ;} load_form () { load_form_0 "\"$(kwote "$1")\"" ;} ECHO () { printf '%s\n' "$*" ;} DBG () { ECHO "$*" >& 2 ;} abort () { ERR="$1" ; shift ; DBG "$*" ; exit "$ERR" ;} ABORT () { abort 42 "$*" ;} EOF } eval "$(print_basic_functions)" kwote1 () { if simple_term_p "$1" ; then ECHOn "$1" else ECHOn "\"$(kwote0 "$1")\"" ; fi ;} SHOW () { ( set +x k="" ; for i ; do ECHOn "$k" ; kwote1 "$i" ; k=" " ; done ; echo ) } XDO () { SHOW "$@" >&2 ; "$@" ;} DO () { SHOW "$@" ; "$@" ;} EVAL () { ECHO "$*" ; eval "$*" ;} fullpath () { # If we were sure readlink is here, we could: for i ; do readlink -f "$i" ; done for i ; do case "$i" in /*) ECHO "$i" ;; *) ECHO "$PWD/$i" ;; esac ; done } print_var () { for var ; do eval "ECHO \"$var=\$(kwote1 \"\${$var}\")\"" ; done ;} create_file () { MOD="$1" OUT="$2" ; shift 2; TMPFILE="$OUT.tmp$$~" if "${@:-cat}" > "$TMPFILE" && chmod "$MOD" "$TMPFILE" && mv -f "$TMPFILE" "$OUT" ; then return 0 ; else rm -f "$TMPFILE" ; return 1 ; fi } ### Process options OPTION () { process_options "$@" ;} process_options () { while [ $# -gt 0 ] ; do x="$1" ; shift case "$x" in -h|"-?"|--help) show_help ;; -H|--more-help) show_more_help ;; -V|--version) show_version ;; -v|--verbose) export CL_LAUNCH_VERBOSE=t ;; -q|--quiet) unset CL_LAUNCH_VERBOSE ;; -e|--eval) add_build_form "(:eval \"(cl:in-package :$PACKAGE)$(kwote "$1")\")" ; shift ;; -L|--load) add_build_form "(:load \"$(kwote "$1")\" :$PACKAGE)" ; shift ;; -f|--file) add_build_form "(:load t :$PACKAGE)" ; set_lisp_content "$1" ; shift ;; -s|--system|--load-system) add_build_form "(:load-system \"$(kwote "$1")\")" ; shift ;; --require) add_build_form "(:require \"$(kwote "$1")\")" ; shift ;; -F|--final) add_final_form "$1" ; shift ;; -i|--init) add_init_form "$1" ; shift ;; -ip|--print) add_init_form "(princ(progn $1))(terpri)" ; shift ;; -iw|--write) add_init_form "(write(progn $1))(terpri)" ; shift ;; -p|--package) in_package "$1" ; shift ;; -sp|--system-package) add_build_form "(:load-system \"$1\")" in_package "$1" ; shift ;; "("*) add_init_form "(princ(progn $x))(terpri)" ;; -p|-pc|+p) ABORT "option $x is not supported anymore." \ "Use option -S instead." ;; --path|--path-current|--no-path) ABORT "option $x is not supported anymore." \ "Use option --source-registry instead." ;; -S|--source-registry) SOURCE_REGISTRY="$1" ; shift ;; -l|--lisp) LISPS="$1" ; shift ;; -w|--wrap) WRAPPER_CODE="$1" ; shift ;; -I|--include) INCLUDE_PATH="$1" ; shift ;; +I|--no-include) INCLUDE_PATH="" ;; -R|--rc) USE_CL_LAUNCHRC=t ;; +R|--no-rc) USE_CL_LAUNCHRC= ;; -b|--clbuild) USE_CLBUILD=t ;; +b|--no-clbuild) USE_CLBUILD= ;; -Q|--quicklisp) USE_QUICKLISP=t ;; +Q|--no-quicklisp) USE_QUICKLISP= ;; -o|--output) OUTPUT_FILE="$1" ; shift ;; -x|--execute) OUTPUT_FILE="!" ;; -u|--update) UPDATE="$1" ; shift ;; -m|--image) LOAD_IMAGE="$1" ; shift ;; -d|--dump) DUMP="$1" ; shift ;; -r|--restart) set_restart "$1" ; shift ;; -E|--entry) set_restart "(lambda()($1 uiop:*command-line-arguments*))" ; shift ;; -DE|--dispatch-entry) add_dispatch_entry "$1" "$PACKAGE" shift ;; -sm|--system-main) add_build_form "(:load-system \"$(kwote "$1")\")" set_entry "$1::main" ; shift ;; -Ds|--dispatch-system) sys="$(kwote "$1")" add_build_form "(:load-system \"$sys\")" add_dispatch_entry "$(basename $sys)" "$sys" ; shift ;; -B|--backdoor) "$@" ; exit ;; --) if [ -n "${IS_X_SCRIPT}" ] ; then add_build_form "(:load \"$(kwote "$1")\" :cl-user)" export __CL_ARGV0="$1" shift fi if [ "x${OUTPUT_FILE}" = "x!" ] ; then do_it "$@" else ABORT "Extra arguments given but not in --execute mode" fi ;; -X) OPTION -x IS_X_SCRIPT=y ;; -X' '*) # DBG "Working around sh script script limitation..." # The below gets the script arguments from the kernel-given argument: # OPTS="$x" ; eval "OPTION $OPTS \"\$@\"" # Unix kernels traditionally lump everything after the interpreter name # from the #! line up to 127 characters into one (optional) argument, # as defined in linux/{fs/binfmt_script.c,include/linux/binfmts.h}. # If we want to allow for a longer in-script command line argument, # and we do if we want to accommodate for inline Lisp code using -i # then we'd need to go fetch the full line and parse it. Here it is: OPTS="$(get_hashbang_arguments "$1")" eval "OPTION $OPTS \"\$@\"" ABORT "The cl-launch script $1 failed to use -X ... --" ;; -*) # Directly handle arguments in a #! script if [ -f "$1" ] ; then OPTS="$(get_hashbang_arguments "$1")" OPTx="$(stringbefore "${#x}" "$OPTS")" if [ "x$x" = "x$OPTx" ] ; then export __CL_ARGV0="$2" eval "OPTION $OPTS \"\$@\"" fi fi DBG "Invalid command line argument '$x'" ; mini_help_abort ;; *) unset IS_X_SCRIPT export __CL_ARGV0="$x" OPTION --load "$x" --execute -- "$@" ;; esac done } in_package () { PACKAGE="$1" } set_restart () { RESTART="$1" RESTART_PACKAGE="$PACKAGE" } set_entry () { set_restart "(cl:lambda()($1 uiop:*command-line-arguments*))" } add_dispatch_entry () { if [ -z "$DISPATCH_ENTRY_P" ] ; then add_build_form "(:load-system \"cl-launch/dispatch\")" DISPATCH_ENTRY_P=t fi if [ -z "$RESTART" ] ; then set_entry "cl-launch/dispatch:dispatch-entry" fi add_build_form "(:eval \"$(kwote "(cl-launch/dispatch:register-name/entry \"$(kwote "$1")\" :$2)")\")" } add_build_form () { SOFTWARE_BUILD_FORMS="$SOFTWARE_BUILD_FORMS${SOFTWARE_BUILD_FORMS+ }$1" } add_init_form () { if ! [ "${INIT_PACKAGE}" = "$PACKAGE" ] ; then package_form="(cl:in-package :$PACKAGE)" INIT_PACKAGE="$PACKAGE" else package_form="" fi SOFTWARE_INIT_FORMS="$SOFTWARE_INIT_FORMS${SOFTWARE_INIT_FORMS+ }${package_form}$1" } add_final_form () { if ! [ "${FINAL_PACKAGE}" = "$PACKAGE" ] ; then package_form="(cl:in-package :$PACKAGE)" FINAL_PACKAGE="$PACKAGE" else package_form="" fi SOFTWARE_FINAL_FORMS="$SOFTWARE_FINAL_FORMS${SOFTWARE_FINAL_FORMS+ }${package_form}$1" } set_lisp_content () { if [ -z "$1" ] ; then ABORT "Empty argument after -f --file" elif [ -n "$LISP_CONTENT" ] ; then ABORT "You may only use option -f --file once" else LISP_CONTENT="$1" fi } if [ -n "$BASH_VERSION$ZSH_VERSION" ] ; then stringbefore () { ECHOn "${2:0:$1}" ;} stringafter () { ECHOn "${2:$1}" ;} else stringbefore () { ECHOn "$2" | cut -c-"$1" ;} stringafter () { ECHOn "$2" | cut -c"$1"- ;} fi get_hashbang_arguments () { stringafter 2 "$(read LINE < "$1" ; ECHOn "$LINE")" | { read INTERP ARGUMENTS ; ECHOn "$ARGUMENTS" ;} } mini_help_abort () { DBG "$HELP_HEADER For help, invoke script with help argument: $PROG -h" ; ABORT } ### Do the job guess_defaults () { if [ -n "$UPDATE" ] ; then : "${OUTPUT_FILE:=$UPDATE}" fi } # Configuration system_preferred_lisps () { if [ "x${SOFTWARE_SYSTEM}" = "x$1" ] ; then shift LISPS="$*" DBG "User configuration for system ${SOFTWARE_SYSTEM} overrides LISPS with $(kwote1 "$LISPS")" fi } try_resource_file () { if [ -f "$1" ] ; then . "$1" fi } try_resource_files () { if [ -n "$USE_CL_LAUNCHRC" ] ; then try_resource_file /etc/cl-launchrc try_resource_file "$HOME/.cl-launchrc" fi } print_configuration () { print_var \ LISP_CONTENT SOFTWARE_SYSTEM SOFTWARE_INIT_FORMS SOFTWARE_FINAL_FORMS \ SOURCE_REGISTRY INCLUDE_PATH LISPS WRAPPER_CODE \ DUMP RESTART IMAGE_BASE IMAGE_DIR IMAGE \ $EXTRA_CONFIG_VARIABLES } include_configuration () { if [ -n "$UPDATE" ] ; then extract_configuration ECHO "$CONFIGURATION" eval "$CONFIGURATION" else extract_configuration print_configuration fi } ensure_configuration () { extract_configuration if [ -n "$UPDATE" ] ; then eval "$CONFIGURATION" adjust_configuration fi } adjust_configuration () { : INCLUDE_PATH="$INCLUDE_PATH" LISP_CONTENT="$LISP_CONTENT" if [ -n "$INCLUDE_PATH" ] ; then AUTHOR_NOTE= SHORT_LICENSE= LICENSE_COMMENT= fi } include_license () { if [ -n "$DISCLAIMER" ] ; then l= for i in "$DISCLAIMER" "$AUTHOR_NOTE" "$SHORT_LICENSE" "$LICENSE_COMMENT" do l="$l$i${i:+# }" ; done ECHOn "$l" fi hide_license } hide_license () { DISCLAIMER= AUTHOR_NOTE= SHORT_LICENSE= LICENSE_COMMENT= CONTENT_DISCLAIMER= } include_lisp_header () { if [ -z "$INCLUDE_PATH" ] ; then print_lisp_header else echo "#-cl-launch" load_form "$INCLUDE_PATH/launcher.lisp" fi } LAUNCH_FUN=cl-launch::run print_lisp_launch () { ECHOn "($LAUNCH_FUN" if [ -n "${SOURCE_REGISTRY}" ] ; then ECHOn " :source-registry \"$(kwote "$SOURCE_REGISTRY")\"" fi if [ -n "${USE_QUICKLISP}" ] ; then ECHOn " :quicklisp t" fi if [ -n "${SOFTWARE_BUILD_FORMS}" ] ; then ECHOn " :build '(${SOFTWARE_BUILD_FORMS})" fi if [ -n "${SOFTWARE_FINAL_FORMS}" ] ; then ECHOn " :final \"$(kwote "${SOFTWARE_FINAL_FORMS}")\"" fi if [ -n "${SOFTWARE_INIT_FORMS}" ] ; then ECHOn " :init \"$(kwote "${SOFTWARE_INIT_FORMS}")\"" fi if [ -n "${NO_QUIT}" ] ; then ECHOn " :quit nil" fi if [ -n "${DUMP}" ] ; then ECHOn " :dump \"$(kwote "${DUMP}")\"" fi if [ -n "${RESTART}" ] ; then ECHOn " :restart '(\"$(kwote "${RESTART}")\" . :${RESTART_PACKAGE})" fi ECHOn ")" } print_lisp_initialization () { echo "#-cl-launched" print_lisp_launch } print_lisp_content () { ECHO "$CONTENT_DISCLAIMER" ECHO "$CONTENT_BEGIN_MARKER" extract_lisp_content } include_lisp_content () { if [ -n "$LISP_CONTENT" ] ; then print_lisp_content ; fi } include_shell_wrapper () { ECHO "$BASIC_ENV_CODE" if [ -z "$INCLUDE_PATH" ] ; then print_shell_wrapper else ECHO ". $(kwote1 "$INCLUDE_PATH/wrapper.sh")" fi } include_script_configuration_and_headers () { ECHOn "\ #!/bin/sh #| CL-LAUNCH ${CL_LAUNCH_VERSION} CONFIGURATION " ; include_configuration ; ECHOn "\ # END OF CL-LAUNCH CONFIGURATION # This file was generated by cl-launch ${CL_LAUNCH_VERSION} " ; include_license } make_loader () { include_script_configuration_and_headers include_shell_wrapper ECHOn ' launch_self "$@" ABORT # |# ' ; include_lisp_stuff } include_lisp_stuff () { include_lisp_header ; ECHOn ' ;;;; CL-LAUNCH LISP INITIALIZATION CODE ' ; print_lisp_initialization ; ECHOn ' ;;;; END OF CL-LAUNCH LISP INITIALIZATION CODE ' ; include_lisp_content } READ () { if [ $UNREAD_DEPTH = 0 ] ; then read -r LINE elif [ $UNREAD_DEPTH = 1 ] ; then UNREAD_DEPTH=0 LINE="$LINE1" elif [ $UNREAD_DEPTH = 2 ] ; then UNREAD_DEPTH=1 LINE="$LINE1" LINE1="$LINE2" else ABORT "error: UNREAD_DEPTH=$UNREAD_DEPTH" fi } UNREAD () { if [ $UNREAD_DEPTH = 0 ] ; then UNREAD_DEPTH=1 LINE1="$1" elif [ $UNREAD_DEPTH = 1 ] ; then UNREAD_DEPTH=2 LINE2="$LINE1" LINE1="$1" else ABORT "error: UNREAD_DEPTH=$UNREAD_DEPTH" fi } extract_configuration () { TRIED_CONFIGURATION=t CONFIGURATION= READ || return : "READ => $LINE" L1="#!/bin/sh" case "$LINE" in "$L1") : "read the SHEBANG" ;; *) : "Not a shell script" ; UNREAD "$LINE" ; return 2 ;; esac if ! READ ; then UNREAD "$L1" ; return 2 ; fi : "READ => $LINE" case "$LINE" in "#| CL-LAUNCH"*" CONFIGURATION") : "read the CL comment start" ;; *) : "Not a cl-launch script" ; UNREAD "$LINE" ; UNREAD "$L1" ; return 2 ;; esac while READ && #: "READ => $LINE" && case "$LINE" in "# END OF CL-LAUNCH CONFIGURATION") ! : ;; *) : ;; esac do CONFIGURATION="$CONFIGURATION${CONFIGURATION:+ }$LINE" ; done HAS_CONFIGURATION=t } extract_lisp_content () { if [ -z "$TRIED_CONFIGURATION" ] ; then extract_configuration fi if [ -n "$HAS_CONFIGURATION" ] ; then skip_to_marker fi cat_with_unread } cat_with_unread () { while [ $UNREAD_DEPTH != 0 ] ; do READ : "READ => $LINE" ECHO "$LINE" done cat } skip_to_marker () { while READ && #: "READ => $LINE" && case "$LINE" in "$CONTENT_BEGIN_MARKER") ! : ;; *) : ;; esac do : ; done } create_output () { create_file 755 "$OUTPUT_FILE" "$@" } with_input_from () { IN="$1" ; shift case "$IN" in ""|/dev/null) : from null ; "$@" < /dev/null ;; -) : from stdin ; "$@" ;; *) : from file "$IN" ; "$@" < "$IN" ;; esac } with_input () { with_input_from "${UPDATE:-$LISP_CONTENT}" "$@" } with_output () { case "${OUTPUT_FILE}" in "") ABORT "output file not specified" ;; /dev/null) : ;; -) "$@" ;; *) create_output "$@" ;; esac } make_output_file () { if [ -n "$DUMP" ] ; then dump_image_and_continue else do_make_output_file fi } do_make_output_file () { with_output with_input make_loader } execute_code () { run_code "$@" } do_run_code () { eval "$(print_shell_wrapper_body)" if [ -n "$LISP_CONTENT" ] ; then export CL_LAUNCH_FILE="$LISP_CONTENT" else unset CL_LAUNCH_FILE fi LAUNCH_FUN='funcall(intern(string :run):cl-launch)' LAUNCH_FORMS="$(load_form "$PROG";print_lisp_launch)" try_all_lisps "$@" } run_code () { ### Note: when dumping an image, run_code gets locally redefined ### by do_dump_image_and_continue, and restored by do_dump_image do_run_code "$@" } dump_image_and_continue () { case "$UPDATE" in -) SOFTWARE_CODE="$(cat)" ECHO "$SOFTWARE_CODE" | do_dump_image_and_continue "$@" ;; *) do_dump_image_and_continue "$@" ;; esac } do_dump_image_and_continue () { ORIG_WRAPPER_CODE="$WRAPPER_CODE" run_code () { WRAPPER_CODE="$WRAPPER_CODE DO_LISP=do_dump_image" do_run_code "$@" } if [ "x$DUMP" = "x!" ] ; then if [ "x$OUTPUT_FILE" = "x!" ] ; then abort 14 "Image dump required but neither dump file nor output file specified" else DUMP="$OUTPUT_FILE" fi fi IMAGE= execute_code "$@" } do_dump_image () { : do_dump_image "$@" run_code () { do_run_code "$@" } if [ -n "$INCLUDE_PATH" ] ; then export CL_LAUNCH_HEADER="$INCLUDE_PATH/launcher.lisp" else export CL_LAUNCH_HEADER="$PROG" fi if [ "x$IMAGE_ARG" = "xNOT_SUPPORTED_YET" ] ; then abort 13 "Image dumping not supported with implementation $IMPL. Try specifying a supported implementation with option --lisp (or \$LISP)" fi if [ -n "$STANDALONE_EXECUTABLE" ] ; then if [ "x$DUMP" = "x$OUTPUT_FILE" ] ; then # disabled optimization: also for || [ "x$OUTPUT_FILE" = "x!" ] # as it doesn't play nice with older versions of SBCL, ECL, etc., # that do not support standalone executables. export CL_LAUNCH_STANDALONE=t fi else if [ "x$DUMP" = "x$OUTPUT_FILE" ] ; then abort 15 "This implementation does not support dumping a standalone executable image" fi fi license_information # Use LOAD_IMAGE if it exists compute_image_path "$LOAD_IMAGE" ( do_exec_lisp ) || abort 22 "Failed to dump an image" case "$UPDATE" in -) ECHO "$SOFTWARE_CODE" | use_dumped_image "$@" ;; *) use_dumped_image "$@" ;; esac } use_dumped_image () { : use_dumped_image $OUTPUT_FILE -- standalone: ${CL_LAUNCH_STANDALONE} compute_image_path "$DUMP" case "${CL_LAUNCH_STANDALONE}:${OUTPUT_FILE}" in :!) invoke_image "$@" ;; :*) make_image_invoker ;; t:!) if [ -n "$CL_LAUNCH_VERBOSE" ] ; then set -x ; fi ; ${IMAGE} "$@" ;; t:*) : nothing to do ;; esac } make_image_invoker () { WRAPPER_CODE="$ORIG_WRAPPER_CODE" with_output with_input make_image_invocation_script } compute_image_path () { if [ -n "$1" ] ; then IMAGE_BASE="$(basename "$1")" IMAGE_DIR="${INCLUDE_PATH:-$(dirname "$1")}" IMAGE=${IMAGE_DIR}/${IMAGE_BASE} else IMAGE_BASE= IMAGE_DIR= IMAGE= fi } prepare_invocation_configuration () { LISP=$IMPL EXTRA_CONFIG_VARIABLES="LISP $OPTIONS_ARG" if eval "[ -n \"\$$BIN_ARG\" ]" ; then EXTRA_CONFIG_VARIABLES="$EXTRA_CONFIG_VARIABLES $BIN_ARG" fi } make_image_invocation_script () { prepare_invocation_configuration include_script_configuration_and_headers make_image_invocation include_lisp_content } make_image_invocation () { include_shell_wrapper if [ "x$IMAGE_ARG" = xEXECUTABLE_IMAGE ] ; then echo "$BIN_ARG=$IMAGE" fi cat< $LOADFILE < /dev/null`" ; then return 0 else return 1 fi } trylisp () { IMPL="$1" ; shift implementation_${IMPL} "$@" } do_exec_lisp () { if [ -n "$IMAGE" ] ; then if [ "x$IMAGE_ARG" = xEXECUTABLE_IMAGE ] ; then LISP_BIN= IMAGE_OPT= else IMAGE_OPT="$IMAGE_ARG" fi fi $EXEC_LISP "$@" } no_implementation_found () { ABORT "$PROG: Cannot find a supported lisp implementation. Tried the following: $*" } ensure_implementation () { trylisp "$1" || no_implementation_found "$1" } try_all_lisps () { for l in $LISP $LISPS ; do if trylisp $l ; then $DO_LISP "$@" return 0 fi done no_implementation_found "$LISP $LISPS" } exec_lisp () { # SBCL wants only one form per --eval so we need put everything in one progn. # However we also want any in-package form to be evaluated before any of the # remaining forms is read, so we get it to be evaluated at read-time as the # first thing in the main progn. # GNU clisp allows multiple forms per -x but prints the result of every form # evaluated and so we also need put everything in a single progn, and that progn # must quit before it may return to the clisp frame that would print its value. # CMUCL allows multiple forms per -eval and won't print values, so is ok anyway. # I don't know about other Lisps, but they will all work this way. LAUNCH_FORM="${PROGN}${MAYBE_PACKAGE_FORM}${HASH_BANG_FORM}${LAUNCH_FORMS}${NGORP}" ### This is partial support for CLBUILD. if [ -n "$USE_CLBUILD" ] ; then if [ -z "$IMAGE_OPT" ] ; then OPTIONS= else ABORT "Cannot use clbuild with a non-executable image different from clbuild's" fi fi if [ -n "$CL_LAUNCH_VERBOSE" ] ; then set -x ; fi exec $LISP_BIN $IMAGE_OPT $IMAGE $OPTIONS $EVAL "$LAUNCH_FORM" $ENDARGS "$@" } launch_self () { LAUNCH_FORMS="$(load_form "$PROG")" try_all_lisps "$@" } invoke_image () { if [ "x$IMAGE_ARG" = xEXECUTABLE_IMAGE ] ; then LISP_BIN= IMAGE_OPT= else IMAGE_OPT="$IMAGE_ARG" fi PACKAGE_FORM= HASH_BANG_FORM= LAUNCH_FORMS="(uiop:restore-image)" "$EXEC_LISP" "$@" } export CL_LAUNCH_PID=$$ export CL_LAUNCH_FILE="$PROG" ## execute configuration-provided code eval "$WRAPPER_CODE" ### END OF CL-LAUNCH SHELL WRAPPER EOF } : ' Useful tidbit for dichotomy-debugging Lisp code: (defvar *x* 0) (defun xx () (format t "*x* ~D~%" (incf *x*) (finish-output))) (xx) (xx) ' cl_fragment () { if [ -n "$CL_HEADER" ] ; then ECHO "#-cl-launch" fi cat } do_print_lisp_implementation () { ECHO "$IMPL" } print_lisp_implementation () { eval "$(print_shell_wrapper_body)" DO_LISP=do_print_lisp_implementation try_all_lisps } do_print_lisp_binary_path () { ECHO "$LISP_BIN" } print_lisp_binary_path () { eval "$(print_shell_wrapper_body)" DO_LISP=do_print_lisp_binary_path try_all_lisps } print_lisp_header () { CL_HEADER=t print_lisp_code echo ";;;;; Return to the default package." echo "(cl:in-package :cl-user)" print_lisp_code_bottom } print_lisp_launcher () { CL_HEADER= print_lisp_code echo ; echo "(cl-launch::compute-arguments)" print_lisp_code_bottom } print_lisp_setup () { OPTION -q print_lisp_launcher OPTION -x -s asdf -i "(let ((*package* (find-package :cl-launch))) (format t \"(cl-launch::initialize-asdf ~S)~%\" \"$(kwote $SOURCE_REGISTRY)\"))" -- } print_lisp_code () { echo "#+xcvb (module (:build-depends-on () :depends-on (\"/asdf\")))" echo "#| ;;; cl-launch ${CL_LAUNCH_VERSION} lisp header" include_license # HACK: this whole file is itself readable as Lisp code, and its meaning # is then that of the cl-launch lisp header code enclosed herein. # |# Last bit of Karma cat<<'NIL' |# ;;;; Silence our lisp implementation for quiet batch use... #| We'd like to evaluate as little as possible of the code without compilation. This poses a typical bootstrapping problem: the more sophistication we want to distinguish what to put where in what dynamic environment, the more code we have to evaluate before we may actually load compiled files. And, then, it is a waste of time to try to compile said code into a file. Moving things to the shell can only help so much, and reduces flexibility. Our best bet is to tell sbcl or cmucl to not try to optimize too hard. |# NIL ":" 't #-cl-launch ;'; cl_fragment<<'NIL' (eval-when (:compile-toplevel :load-toplevel :execute) ;; Configure the printer (setf *print-readably* nil ; allegro 5.0 may bork without this *print-level* nil) ;; Hush the compiler and loader. (setf *load-verbose* nil *compile-verbose* nil *compile-print* nil *load-print* nil) ;; The code below exemplifies how to try super-hard to load ASDF 3 from standard locations, ;; by trying nice methods first, then increasingly desperate ones. ;; Stage 1 is to load ASDF at all. ;; Stage 2 is to upgrade to whichever ASDF installation the user has configured (if any). ;; Versions older than ASDF 3.1 need to be told about ~/common-lisp/ ;; ASDF 1 has no output translation layer, so can be configured to load ASDF 3 ;; only if ASDF 3 is in a predictable place under the user's homedir, thus ;; ~/common-lisp/asdf/ or ~/.local/share/common-lisp/source/asdf/ only. (block nil (let ((required-asdf-version "3.1.2") (verbose *load-verbose*)) (labels ((asdf-symbol (name) (and (find-package :asdf) (find-symbol (string name) :asdf))) (asdf-call (name &rest args) (apply (asdf-symbol name) args)) (asdf-version () (when (find-package :asdf) (or (symbol-value (or (asdf-symbol '*asdf-version*) (asdf-symbol '*asdf-revision*))) "1.0"))) (maybe-display (message) (when (and verbose message) (format t "~&~A~%" message))) (call-maybe-verbosely (message function &rest args) (cond (verbose (maybe-display message) (apply function args)) (t #+abcl ;; Bug in ABCL 1.3.0: without this, loading asdf.fasl shows warnings (let* ((uc (asdf-symbol '*uninteresting-conditions*)) (vars (when uc (list uc))) (vals (when uc (list (cons 'warning (symbol-value uc)))))) (progv vars vals (handler-bind ((warning #'muffle-warning)) (apply function args)))) #-abcl (handler-bind ((warning #'muffle-warning)) (apply function args))))) (try-stage-1 (message function) (ignore-errors (call-maybe-verbosely (format nil "Trying to ~A" message) function)) (maybe-done-stage-1)) (subpath (parent &key directory name type) (merge-pathnames (make-pathname :defaults parent :name name :type type :version nil :directory (cons :relative directory)) parent)) (build/asdf.lisp (x) (subpath x :directory '("build") :name "asdf" :type "lisp")) (visible-default-user-asdf-directory () (subpath (user-homedir-pathname) :directory '("common-lisp" "asdf"))) (visible-default-user-asdf-lisp () (build/asdf.lisp (visible-default-user-asdf-directory))) (hidden-default-user-asdf-directory () (subpath (user-homedir-pathname) :directory '(".local" "share" "common-lisp" "asdf"))) (hidden-default-user-asdf-lisp () (build/asdf.lisp (hidden-default-user-asdf-directory))) (try-file-stage-1 (name explanation base root sub) (try-stage-1 (format nil "load ASDF from ~A/ under the ~A CL source directory ~A~{~A/~}" name explanation root sub) #'(lambda () (load (build/asdf.lisp (subpath base :directory (append sub (list name)))))))) (stage-1 () ;; Try to load ASDF at all, any ASDF. (try-stage-1 ;; Do nothing if ASDF is already loaded "use an already loaded ASDF" (constantly nil)) (try-stage-1 "require ASDF from the implementation" ;; Most implementations provide ASDF, but while most of them are case-insensitive, ;; CLISP is case-sensitive, so we need to specify a lowercase string, ;; and not the keyword :asdf or symbol 'asdf. ;; All recent implementations provide ASDF 3, ;; but older variants in the wild may only provide ASDF 2 or even ASDF 1. #'(lambda () (funcall 'require "asdf"))) (try-file-stage-1 "asdf" "default (visible)" (user-homedir-pathname) "~/" '("common-lisp")) (try-file-stage-1 "asdf" "default (hidden)" (user-homedir-pathname) "~/" '(".local" "share" "common-lisp")) #+(or unix linux bsd darwin) (progn (loop :for (name path) :in '(("local system" ("local")) ("managed system" ())) :do (loop :for sub :in '(() ("source")) :do (try-file-stage-1 "asdf" name #p"/" "/" (append '("usr") path '("share" "common-lisp") sub)))) (try-file-stage-1 "cl-asdf" "managed system" #p"/" "/" '("usr" "share" "common-lisp" "source"))) (error "Could not load ASDF.")) (maybe-done-stage-1 () ;; If we have ASDF, then go to stage 2: have it upgrade itself. (when (member :asdf *features*) (maybe-display (format nil "Found ASDF ~A" (asdf-version))) (stage-2))) ;; doesn't return. (centrally-register (path) (let ((r (asdf-symbol '*central-registry*))) (pushnew path (symbol-value r)) (pushnew (subpath path :directory '("uiop")) (symbol-value r)))) (configure-asdf () ;; configure older versions of ASDF, as needed (cond ((probe-file (visible-default-user-asdf-lisp)) (unless (member :asdf3.1 *features*) (maybe-display "Telling this old ASDF about your ~/common-lisp/asdf/") (centrally-register (visible-default-user-asdf-directory)))) ((probe-file (hidden-default-user-asdf-lisp)) (unless (member :asdf2 *features*) (maybe-display "Telling this antique ASDF about your ~/.local/share/common-lisp/asdf/") (centrally-register (hidden-default-user-asdf-directory)))))) (maybe-done-stage-2 () (when (ignore-errors (asdf-call 'version-satisfies (asdf-version) required-asdf-version)) (when verbose (format t "~&Victory! We now have ASDF ~A~%" (asdf-version))) (return))) (stage-2 () ;; We have ASDF, now have it upgrade itself. (configure-asdf) (when (asdf-call 'find-system :asdf nil) (call-maybe-verbosely "Trying to upgrade ASDF" (asdf-symbol 'operate) (asdf-symbol 'load-op) :asdf) :verbose nil) (maybe-done-stage-2) (error "We could only load ASDF ~A but we need ASDF ~A" (asdf-version) required-asdf-version))) ;; :asdf3.1 is both more recent than required and self-upgrading, so doesn't need this dance ;; :asdf3 is self-upgrading but might not be recent enough (it could be a pre-release). (unless (member :asdf3.1 *features*) (call-maybe-verbosely nil #'stage-1))))) (in-package :asdf)) NIL ":" 't #-cl-launch ;'; cl_fragment<<'NIL' ;; Because of ASDF upgrade punting, this ASDF package may be a new one. (eval-when (:compile-toplevel :load-toplevel :execute) (unless (or #+asdf3 (uiop:version<= "3.1.2" (asdf:asdf-version))) (error "cl-launch requires ASDF 3.1.2 or later"))) NIL ":" 't #-cl-launch ;'; cl_fragment<<'NIL' ;;;; Create cl-launch with UIOP. (progn (uiop:define-package :cl-launch (:use :common-lisp :uiop :asdf) (:export #:compile-and-load-file)) (in-package :cl-launch)) NIL ":" 't #-cl-launch ;'; cl_fragment<<'NIL' ;;;; cl-launch initialization code (progn (defvar *cl-launch-header* nil) ;; name of the file with this Lisp header (if any) (defvar *cl-launch-file* nil) ;; name of the file with the user code (if any) (defvar *verbose* nil) (defun dump-stream-to-file (i n) (with-output-file (o n :if-exists :rename-and-delete) (copy-stream-to-stream i o))) (defun dump-sexp-to-file (x n) (with-output-file (o n :if-exists :rename-and-delete) (write x :stream o :pretty t :readably t))) (defvar *temporary-filenames* nil) (defvar *temporary-file-prefix* (native-namestring (subpathname *temporary-directory* (strcat "cl-launch-" (getenvp "CL_LAUNCH_PID"))))) (defun make-temporary-filename (x) (parse-native-namestring (strcat *temporary-file-prefix* x))) (defun register-temporary-filename (n) (push n *temporary-filenames*) n) (defun temporary-filename (x) (register-temporary-filename (make-temporary-filename x))) (defun temporary-file-from-foo (dumper arg x) (let ((n (temporary-filename x))) (funcall dumper arg n) n)) (defun temporary-file-from-stream (i x) (temporary-file-from-foo #'dump-stream-to-file i x)) (defun temporary-file-from-string (i x) (temporary-file-from-foo #'(lambda (i n) (with-output-file (o n :if-exists :rename-and-delete) (princ i o))) i x)) (defun temporary-file-from-sexp (i x) (temporary-file-from-foo #'dump-sexp-to-file i x)) (defun temporary-file-from-code (i x) (if (stringp i) (temporary-file-from-string i x) (temporary-file-from-sexp i x))) (defun temporary-file-from-file (f x) (with-open-file (i f :direction :input :if-does-not-exist :error) (temporary-file-from-stream i x))) (defun ensure-lisp-file-name (x &optional (name "load.lisp")) (if (equal (pathname-type x) "lisp") x (temporary-file-from-file x name))) (defun ensure-lisp-loadable (x) (cond ((eq x t) (ensure-lisp-loadable (or *cl-launch-file* (error "Missing CL_LAUNCH_FILE")))) ((equal x "-") *standard-input*) ((or (streamp x) (pathnamep x)) x) ((stringp x) (ensure-absolute-pathname (parse-native-namestring x) #'getcwd)))) (defun ensure-lisp-file (x &optional (name "load.lisp")) (let ((x (ensure-lisp-loadable x))) (etypecase x (stream (temporary-file-from-stream x name)) (pathname (ensure-lisp-file-name x name))))) (defun cleanup-temporary-files () (loop :for n = (pop *temporary-filenames*) :while n :do (delete-file-if-exists n))) (defun file-newer-p (new-file old-file) "Returns true if NEW-FILE is strictly newer than OLD-FILE." (> (file-write-date new-file) (file-write-date old-file))) (defun compile-and-load-file (source &key force-recompile (verbose *verbose*) (load t) output-file) "compiles and load specified SOURCE file, if either required by keyword argument FORCE-RECOMPILE, or not yet existing, or not up-to-date. Keyword argument VERBOSE specifies whether to be verbose. Returns two values: the fasl path, and T if the file was (re)compiled" ;; When in doubt, don't trust - recompile. Indeed, there are ;; edge cases cases when on the first time of compiling a simple ;; auto-generated file (e.g. from the automated test suite), the ;; fasl ends up being written to disk within the same second as the ;; source was produced, which cannot be distinguished from the ;; reverse case where the source code was produced in the same split ;; second as the previous version was done compiling. Could be ;; tricky if a big system needs be recompiled as a dependency on an ;; automatically generated file, but for cl-launch those ;; dependencies are not detected anyway (BAD). If/when they are, and ;; lacking better timestamps than the filesystem provides, you ;; should sleep after you generate your source code. (let* (#+gcl (maybe-delete (unless (equal (pathname-type source) "lisp") (let ((temp (make-temporary-filename (strcat (pathname-name source) ".lisp")))) (copy-file source temp) (setf source temp)))) (truesource (truename source)) (fasl (or output-file (compile-file-pathname* truesource))) (compiled-p (when (or force-recompile (not (probe-file fasl)) (not (file-newer-p fasl source))) (ensure-directories-exist fasl) (multiple-value-bind (path warnings failures) (compile-file* truesource :output-file fasl) (declare (ignorable warnings failures)) (unless (equal (truename fasl) (truename path)) (error "cl-launch: file compiled to ~A, expected ~A" path fasl)) (when failures (error "cl-launch: failures while compiling ~A" source))) t))) (when load (load* fasl :verbose verbose)) #+gcl (delete-file-if-exists maybe-delete) (values fasl compiled-p))) (defun load-file (source &key output-file) (declare (ignorable output-file)) #-(or gcl (and ecl (not dlopen))) (compile-and-load-file source :verbose *verbose* :output-file output-file) #+gcl (let* ((pn (parse-namestring source))) ; when compiling, gcl 2.6 will always (if (pathname-type pn) ; add a type .lsp if type is missing, to avoid compilation (compile-and-load-file source :verbose *verbose* :output-file output-file) (load source :verbose *verbose*))) #+(and ecl (not dlopen)) (load source :verbose *verbose*)) (defun compute-arguments () (setf *cl-launch-file* (getenvp "CL_LAUNCH_FILE") *cl-launch-header* (getenvp "CL_LAUNCH_HEADER") *verbose* (when (getenvp "CL_LAUNCH_VERBOSE") t))) (asdf::register-preloaded-system "cl-launch") (defun load-sys (system) (if (find-package :quicklisp) (let ((*standard-output* (make-broadcast-stream))) (symbol-call :quicklisp :quickload system)) (asdf:load-system system))) ;;; We need this on all implementations when dumping an image, ;;; so that --eval and --file statements may properly depend ;;; on previously loaded systems, etc. ;;; To do it right, though, we want to only create a file ;;; for the --eval statement if needed by ECL... (defvar *dependency-counter* 0) (defun cl-launch-files () (when (pathnamep *cl-launch-file*) (list *cl-launch-file*))) (defun make-temporary-system (stem rdeps options) ;; Make a temporary system with given name stem and options ;; return the new list of dependencies, i.e. a singleton of the actual system name. (let ((sys (strcat "cl-launch-" stem))) (eval `(handler-bind ((warning #'muffle-warning)) (defsystem ,sys :version "0" :author "cl-launch user" :description "generated by cl-launch" :pathname ,*temporary-directory* :depends-on ,(reverse rdeps) ,@options) (defmethod input-files ((o operation) (s (eql (find-system ,sys)))) ',(cl-launch-files)))) (list sys))) (defclass asdf::cl-source-file-in-package (cl-source-file) ((package :initarg :package :reader component-package))) (defclass asdf::cl-source-code (source-file) ((code :initarg :code :initform nil :reader component-code) (package :initarg :package :reader component-package))) (handler-bind ((warning #'muffle-warning)) (defmethod perform :around ((o compile-op) (c asdf::cl-source-file-in-package)) (let ((*package* (find-package (component-package c)))) (call-next-method))) (defmethod component-pathname ((c asdf::cl-source-code)) nil) (defmethod perform ((o compile-op) (c asdf::cl-source-code))) (defmethod perform ((o load-op) (c asdf::cl-source-code)) (let ((*package* (find-package (component-package c)))) (eval-thunk (or (component-code c) (component-name c)))))) (defun make-dependency-system (rdeps options) ;; Make a system for given dependencies, ;; return the new list of dependencies, i.e. a singleton of the system name. (let ((name (format nil "build-~D" *dependency-counter*))) (incf *dependency-counter*) (make-temporary-system name rdeps options))) (defun make-dependency (dump fun arg pkg previous) ;; Make a dependency, return the new list of dependencies (ecase fun ((:load) (let ((x (ensure-lisp-loadable arg))) (if (or (pathnamep x) #+(or ecl mkcl) dump) (let ((load-file (ensure-lisp-file x (format nil "load-~D.lisp" *dependency-counter*)))) (make-dependency-system previous `(:components ((:cl-source-file-in-package ,(pathname-name load-file) :package ,pkg :pathname ,(truename load-file)))))) (make-dependency dump :eval `(load* ,x) pkg previous)))) ((:eval) (if (and #+(or ecl mkcl) (not dump)) (make-dependency-system previous `(:components ((:cl-source-code ,(format nil "eval-~D" *dependency-counter*) :code ,arg :package :cl-user)))) #+(or ecl mkcl) (with-input (i (temporary-file-from-code arg (format nil "eval-~D.lisp" *dependency-counter*))) (make-dependency dump :load i :cl-user previous)))) ((:require) (cons `(:require ,arg) previous)) ((:load-system) (cons arg previous)))) (defun build-program (dump build restart final init quit) (unwind-protect (let* ((*compile-verbose* *verbose*) #+ecl (c::*suppress-compiler-warnings* (not *verbose*)) #+ecl (c::*suppress-compiler-notes* (not *verbose*)) (standalone (and (getenvp "CL_LAUNCH_STANDALONE") t)) (op (if standalone 'program-op 'image-op)) (dependencies (loop :with r = () :for (fun arg pkg) :in `((:load-system "asdf") ,@(when dump ;; do we still want to include cl-launch in the dumped code, #+(or ecl mkcl) ;; now that all the relevant runtime support is in UIOP? (let ((header *cl-launch-header*)) ;; maybe for dependency timestamp? (setf *features* (remove :cl-launch *features*)) `((:load ,(ensure-lisp-file header "header.lisp") :cl-user)))) ,@build ,(let ((footer `(setf *package* (find-package :cl-user) *image-dumped-p* ,(when dump (if standalone :executable t)) *image-entry-point* ,(when restart `(ensure-function ,(car restart) :package ,(cdr restart))) *image-prelude* ,init *image-postlude* ,final *lisp-interaction* ,(not quit)))) `(:eval ,footer :cl-user))) :do (setf r (make-dependency dump fun arg pkg r)) :finally (return r))) (program-sys (make-temporary-system "program" dependencies `(:serial t :build-operation ,op :build-pathname ,(when dump (ensure-absolute-pathname dump #'getcwd)) :entry-point ,(when restart `(lambda () (funcall (ensure-function ,(car restart) :package ,(cdr restart))))) ;; For SBCL and other platforms that die on dump-image, clean before the end: :perform (image-op :before (o c) (setf *features* (remove :cl-launched *features*)) (cleanup-temporary-files)))))) (load-sys program-sys) ;; Give quicklisp a chance to download things (when dump (operate op program-sys))) (cleanup-temporary-files)) (unless dump (restore-image)) (quit 0)) (defun load-quicklisp () (block nil (flet ((try (x) (when (probe-file* x) (return (load* x))))) (try (subpathname (user-homedir-pathname) "quicklisp/setup.lisp")) (try (subpathname (user-homedir-pathname) ".quicklisp/setup.lisp")) (error "Couldn't find quicklisp in your home directory. ~ Go get it at http://www.quicklisp.org/beta/index.html")))) (defun run (&key quicklisp source-registry build dump restart final init (quit t)) (setf *lisp-interaction* (not quit)) (with-fatal-condition-handler () (pushnew :cl-launched *features*) (compute-arguments) (when source-registry (initialize-source-registry source-registry)) (when quicklisp (load-quicklisp)) (build-program dump build restart final init quit))) (pushnew :cl-launch *features*)) NIL #| } print_lisp_code_bottom () { # |# ":" ; cat<<'NIL' ;;; END OF CL-LAUNCH LISP HEADER NIL #| } ### There we are. Now do the job [ $# -gt 0 ] || mini_help_abort all "$@" ; exit # |# ; What follows is Lisp code available when loading this file cl-launch-4.1.4/cl-shim.c000066400000000000000000000012071255362050000150640ustar00rootroot00000000000000#include #include #include #include #include #ifndef CL_LAUNCH_SCRIPT #define CL_LAUNCH_SCRIPT "/usr/bin/cl-launch" #endif char me[] = "cl-shim"; char var[] = "CL_ARGV0"; char shell[] = "/bin/sh"; int main (int argc, char**argv) { int res; size_t l; char**args; res = setenv(var, argv[0], 1); if (res == -1) { perror(me); exit(42); } l = (1+argc)*sizeof(char**); args = malloc(l); if (!args) { exit(42); } args[0] = argv[0]; args[1] = CL_LAUNCH_SCRIPT; for(;argc>0;argc--) { args[argc+1] = argv[argc]; } res = execv(shell, args); perror(me); exit(42); } cl-launch-4.1.4/debian/000077500000000000000000000000001255362050000146065ustar00rootroot00000000000000cl-launch-4.1.4/debian/changelog000066400000000000000000001031721255362050000164640ustar00rootroot00000000000000cl-launch (4.1.4-1) unstable; urgency=low * Don't forget to install dispatch.lisp as source! * Minor tweaks for dispatch.lisp. * Minor documentation update. * Update LispWorks support for LW 7.0.0 * Remove support for ASDF < 3.1.2 -- Francois-Rene Rideau Tue, 21 Jul 2015 23:31:13 -0400 cl-launch (4.1.3-1) unstable; urgency=low * New options --system-main and --dispatch-system * updated manual and release script -- Francois-Rene Rideau Wed, 22 Apr 2015 15:01:28 -0400 cl-launch (4.1.2-2) unstable; urgency=low * Multiple entry binaries with --dispatched-entry, mostly compatible with Xach's buildapp. -- Francois-Rene Rideau Wed, 01 Apr 2015 01:09:11 -0400 cl-launch (4.1.1-1) unstable; urgency=low * Portability: better fallbacks for implementations without a recent ASDF, better support for ecl_bytecodes, make cl-shim work on BSD. -- Francois-Rene Rideau Mon, 02 Mar 2015 17:58:34 -0500 cl-launch (4.1-2) unstable; urgency=low * Convert help to markdown, extract man page from it. * Fix support for :require dependencies -- Francois-Rene Rideau Tue, 19 Aug 2014 22:45:10 -0400 cl-launch (4.0.8-1) unstable; urgency=low * Improve --load dependencies so they depend on previously loaded systems. This generalizes to all platforms the technique so far used only by ECL. * Integrate prototypical examples in the head of the manual. * Fix various bugs in some cases when dumping images. * Various small tweaks. -- Francois-Rene Rideau Fri, 01 Aug 2014 22:06:37 -0400 cl-launch (4.0.7-1) unstable; urgency=low * Give Quicklisp a chance to download dependencies: use ql:quickload instead of asdf:load-system. -- Francois-Rene Rideau Thu, 24 Jul 2014 15:42:02 -0400 cl-launch (4.0.6-1) unstable; urgency=low * Separate --load and --file; fix --file - feature. -- Francois-Rene Rideau Sat, 14 Jun 2014 03:25:27 -0400 cl-launch (4.0.5-1) unstable; urgency=low * Fix issues when dumping image on ECL: handle --eval correctly, avoid a costly initialization of source-registry when unnecessary. -- Francois-Rene Rideau Fri, 13 Jun 2014 13:32:46 -0400 cl-launch (4.0.4-1) unstable; urgency=low * Try even harder to load ASDF. * Update documentation, version numbers, etc. Improve release. -- Francois-Rene Rideau Sat, 26 Apr 2014 12:36:51 -0400 cl-launch (4.0.3-1) unstable; urgency=low * ~/common-lisp/ not ~/cl/ is where ASDF 3.1 standardizes the location of per-user CL software. -- Francois-Rene Rideau Sun, 23 Mar 2014 18:13:21 -0400 cl-launch (4.0.2.2-1) unstable; urgency=low * Package control via --package and --system-package * --entry is now a variant of --restart, not of --init. * Fixes for ECL, LispWorks. * Tests moved aside, which reduces script size by over 10%. * ARGV0 support, in conjunction with ASDF 3.1.0.87. * Documentation updated, as well as TODO file. -- Francois-Rene Rideau Mon, 03 Mar 2014 22:03:38 -0500 cl-launch (4.0.1.1-3) unstable; urgency=low * Speed up startup time by not upgrading ASDF unless needed. * Fix 4.0.0 bugs: support old implementations with older ASDF; unbreak working from cl-launch dumped image. * Add alias -E for --entry. * Eat our own dogfood with a CL release script. -- Francois-Rene Rideau Fri, 28 Feb 2014 18:28:26 -0500 cl-launch (4.0.0-1) unstable; urgency=low * Build with --eval --require --file --system in order of appearance. No more limitation to one optional file, one optional system. Note that --eval is before dump, --init is after dump. * Unix interpreter style invocation: /usr/bin/cl script arguments... * Require ASDF3 and its UIOP. No more headbanging with ASDF2. -- Francois-Rene Rideau Thu, 27 Feb 2014 16:49:30 -0500 cl-launch (3.22.1-1) unstable; urgency=low * Tweak to hush ASDF upgrade. Minor edit of documentation. -- Francois-Rene Rideau Mon, 16 May 2013 01:22:49 -0400 cl-launch (3.22-1) unstable; urgency=low * Release of cl-launch to match ASDF 3.0.0 -- Francois-Rene Rideau Mon, 16 May 2013 01:22:49 -0400 cl-launch (3.019-1) unstable; urgency=low * Use TMPDIR, not TMP. * Ensure directories from getenv or not read as file pathnames. * Preliminary support for MKCL -- Francois-Rene Rideau Mon, 15 Oct 2012 19:49:12 -0400 cl-launch (3.018-1) unstable; urgency=low * Work with the newest SBCL's sb-ext:exit replacing sb-ext:quit. * Document that GCL is dead, and how to produce a LispWorks image. -- Francois-Rene Rideau Mon, 14 May 2012 14:05:33 -0400 cl-launch (3.017-1) unstable; urgency=low * let cl-launch work with XCVB even when asdf.asd isn't installed. -- Francois-Rene Rideau Sat, 03 Mar 2012 21:19:14 -0500 cl-launch (3.016-1) unstable; urgency=low * More fixes for ABCL, CLISP, ECL, GCL. -- Francois-Rene Rideau Sat, 03 Mar 2012 21:18:55 -0500 cl-launch (3.015-1) unstable; urgency=low * CLISP: don't (setf *source-file-types* nil custom:*compiled-file-types nil) anymore, because it prevents (require "linux") from working. * ASDF: it's best to always (asdf:load-system :asdf) as soon as we have ASDF2 so refactor load-asdf accordingly. -- Francois-Rene Rideau Tue, 18 Oct 2011 19:29:03 -0400 cl-launch (3.014-1) unstable; urgency=low * XCL now has --noinform, use it! -- Francois-Rene Rideau Thu, 29 Sep 2011 21:57:08 -0400 cl-launch (3.013-2) unstable; urgency=low * Bring it to the latest debian standards -- Francois-Rene Rideau Thu, 29 Sep 2011 21:57:08 -0400 cl-launch (3.013-1) unstable; urgency=low * Gratuitous upgrade to achieve a patchless debian package. -- Francois-Rene Rideau Thu, 29 Sep 2011 20:29:59 -0400 cl-launch (3.012-1) unstable; urgency=low * Simple optimization assuming recentish CMUCL. -- Francois-Rene Rideau Mon, 26 Sep 2011 17:53:04 -0400 cl-launch (3.011-1) unstable; urgency=low * CCL now has standalone applications! * Use (require "asdf") instead of (require :asdf) because of CLISP. -- Francois-Rene Rideau Tue, 07 Jun 2011 18:09:00 -0400 cl-launch (3.010-1) unstable; urgency=low * --final argument (in 3.009) allows to run a form *before* the image is dumped. To do the right thing on ECL, you probably want to use #. to do at read-time things that must be done while building. * Have cl-launch.asd depend on ASDF 2.015. Actually, ASDF must be upgraded to 2.015 *before* anything that system that depends on ASDF and relies on any ASDF extensions is loaded. -- Francois-Rene Rideau Tue, 31 May 2011 15:02:23 -0400 cl-launch (3.008-1) unstable; urgency=low * Always upgrade ASDF before use. Avoids horrible bugs due to ASDF being upgraded while being used. -- Francois-Rene Rideau Wed, 13 Apr 2011 01:08:53 -0400 cl-launch (3.007-1) unstable; urgency=low * Support XCL (requires ASDF 2.014.2) * Fix $abcl -> $ABCL in ABCL support. -- Francois-Rene Rideau Thu, 31 Mar 2011 10:53:35 -0400 cl-launch (3.006-1) unstable; urgency=low * Remove some debugging output left by mistake. -- Francois-Rene Rideau Sun, 20 Mar 2011 13:54:26 -0400 cl-launch (3.005-1) unstable; urgency=low * Fix print_lisp_setup, broken by recent ASDF2-related changes. -- Francois-Rene Rideau Thu, 04 Nov 2010 14:52:10 -0400 cl-launch (3.004-1) unstable; urgency=low * Fix support for ABCL at 0.22.0 * Be ready for ASDF 2.010 as it requires absolute pathnames in source registry. * Avoid some warnings in allegro -- Francois-Rene Rideau Thu, 21 Oct 2010 13:49:59 -0700 cl-launch (3.003-1) unstable; urgency=low * Don't try to load ASDF when not needed. When needed, follow XDG. * Also try to fix ECL. -- Francois-Rene Rideau Thu, 23 Sep 2010 14:10:39 -0400 cl-launch (3.002-1) unstable; urgency=low * Fix CLISP support broken by bad editing in 3.001. -- Francois-Rene Rideau Fri, 17 Sep 2010 17:43:24 -0400 cl-launch (3.001-1) unstable; urgency=low * Add limited ABCL and SCL support. -- Francois-Rene Rideau Tue, 17 Aug 2010 14:40:59 -0400 cl-launch (3.000-1) unstable; urgency=low * Release cl-launch 3 to work with ASDF 2. -- Francois-Rene Rideau Wed, 09 Jun 2010 16:30:15 -0400 cl-launch (2.907-1) unstable; urgency=low * eliminate a warning when compiling with ECL. * simplify the hash bang form. -- Francois-Rene Rideau Wed, 05 May 2010 11:22:24 -0400 cl-launch (2.906-2) unstable; urgency=low * Update debian package information * Switch to dpkg-source 3.0 (quilt) format -- Francois-Rene Rideau Thu, 29 Apr 2010 12:30:34 -0400 cl-launch (2.906-1) unstable; urgency=low * improve support for LispWorks and Allegro. -- Francois-Rene Rideau Thu, 29 Apr 2010 10:03:26 -0400 cl-launch (2.905-1) unstable; urgency=low * don't import find-system, use asdf:find-system. * shuffle code around to make ecl and gcl happy: ecl won't load asdf.lisp, only a compiled version, so oblige. gcl 2.6 happy w/o asdf. -- Francois-Rene Rideau Wed, 28 Apr 2010 20:24:46 -0400 cl-launch (2.904-1) unstable; urgency=low * correctly hush cl_fragment in all cases -- YEAH! * require ASDF 1.702. -- Francois-Rene Rideau Thu, 15 Apr 2010 22:33:35 -0400 cl-launch (2.903-1) unstable; urgency=low * play better with recent XCVB by depending on ASDF 2. * better verbose treatment when loading from stream. * depend on ASDF 1.677. -- Francois-Rene Rideau Wed, 14 Apr 2010 02:13:27 -0400 cl-launch (2.902-1) unstable; urgency=low * ASDF 2 tweak: have cl-launch.asd depend on asdf.asd to avoid asdf upgrade nightmare. -- Francois-Rene Rideau Sat, 03 Apr 2010 00:24:55 -0400 cl-launch (2.901-1) unstable; urgency=low * ASDF 2 support: add --source-registry, deprecate --path and co. * Fix ASDF loading again (dolist has an implicit block nil). * Update tests. -- Francois-Rene Rideau Fri, 19 Mar 2010 00:59:49 -0400 cl-launch (2.900-1) unstable; urgency=low * New CL-Launch, to be used with ASDF 2, and dropping support for ASDF 1. This preliminary version is called 2.900. TODO: add proper support for source-registry, clean things up, etc. When ASDF 2 is released, we should release cl-launch 3.000 with it. Maybe also take heed of Xach's http://www.xach.com/lisp/buildapp/ -- Francois-Rene Rideau Thu, 18 Mar 2010 22:47:42 -0400 cl-launch (2.36-1) unstable; urgency=low * Note that c-l-c's support for ECL is fixed in 7.0. * Recommend c-l-c 7.0 in the debian control. * disable output redirection with asdf2 (has its own system, AOT). * Reformat loops -- Francois-Rene Rideau Tue, 04 Feb 2010 01:19:39 -0500 cl-launch (2.35-1) unstable; urgency=low * Avoid some potential warnings with *asdf-path*: don't refer to a special in the non-toplevel form where I'm defining it. -- Francois-Rene Rideau Tue, 17 Nov 2009 13:54:39 -0500 cl-launch (2.34-1) unstable; urgency=low * in exclude-from-cache, ignore empty strings as well as NILs -- Francois-Rene Rideau Mon, 09 Nov 2009 22:34:28 -0500 cl-launch (2.33-1) unstable; urgency=low * Fixed ECL support. Passes full 234 tests with the latest 9.11.1 from CVS: cl-launch -l ecl -B tests -- Francois-Rene Rideau Mon, 09 Nov 2009 09:46:41 -0500 cl-launch (2.32-1) unstable; urgency=low * better debugging for :load * TODO: fix ecl which has regressed since 0.x -- Francois-Rene Rideau Sun, 08 Nov 2009 14:53:13 -0500 cl-launch (2.31-1) unstable; urgency=low * modify resume so that it's easier to start from an image that has cl-launch loaded but not configured. * passed tests with cl-launch -l clisp -B shell_tests cl-launch -l 'sbcl ccl ecl' -B tests -- Francois-Rene Rideau Fri, 06 Nov 2009 11:21:34 -0500 cl-launch (2.30-1) unstable; urgency=low * use XCVB .403 enhanced :build-depends-on support for Lisp modules. -- Francois-Rene Rideau Tue, 20 Oct 2009 20:24:16 -0400 cl-launch (2.29-1) unstable; urgency=low * don't try to exclude root if it is disabled. -- Francois-Rene Rideau Tue, 20 Oct 2009 20:24:10 -0400 cl-launch (2.28-1) unstable; urgency=low * unbreak arguments for clisp -- Francois-Rene Rideau Fri, 02 Oct 2009 12:57:21 -0400 cl-launch (2.27-1) unstable; urgency=low * Fix issues regarding cl-launch.asd and its installer. -- Francois-Rene Rideau Fri, 02 Oct 2009 10:18:50 -0400 cl-launch (2.26-1) unstable; urgency=low * Rename cache root from ~/.cache/lisp-fasl/ to ~/.cache/common-lisp/ since (a) it holds more than FASLs, and (b) that makes it easier for other people to understand where it comes from. * Tweak implementation directory name to distinguish flavors of ACL (from SLIME). * Exclude the cache itself from recursive redirection. -- Francois-Rene Rideau Mon, 28 Sep 2009 19:14:12 -0400 cl-launch (2.25-1) unstable; urgency=low * Improve command line argument support for allegro and clisp. * the source code repository now includes a Makefile for end-users and a INTERNALS documentation file for hackers. -- Francois-Rene Rideau Fri, 11 Sep 2009 18:47:12 -0400 cl-launch (2.24-1) unstable; urgency=low * Do not load cl-launch eagerly anymore in the cl-launch.asd. Most users of ASDF do not want cl-launch's FASL redirection in their build. Those who do want it can enable it explicitly. The only person I know who did want it am now using XCVB for large systems. * Allow users to have the *lisp-fasl-cache* persistently :disabled. Document it. -- Francois-Rene Rideau Wed, 09 Sep 2009 10:51:02 -0400 cl-launch (2.23-1) unstable; urgency=low * Update Debian package to latest standards + change in sponsor. * Fix bug whereby in include mode compute-arguments was called from the wrong package, cl-user:: instead of cl-launch:: the second time over. * Fix bitrotten support for CCL command-line arguments * Fix ECL dumping. Avoid unsupported dumping from a dump. * asdf::resolve-symlinks was removed in 1.362. Resurrect it here, we use it! * Successfully ran: cl-launch -l 'sbcl clisp ccl ecl gclcvs gcl' -B tests # 1838 tests cl-launch -l clisp -B shell_tests -- Francois-Rene Rideau Tue, 08 Sep 2009 15:29:50 -0400 cl-launch (2.22-1) unstable; urgency=low * Enhance support for Allegro 8 (thanks to John Fromlin) -- Francois-Rene Rideau Sun, 30 Aug 2009 13:47:14 -0400 cl-launch (2.21-1) unstable; urgency=low * add command -B print_lisp_setup to simplify XCVB setup. -- Francois-Rene Rideau Mon, 20 Jul 2009 08:28:56 -0400 cl-launch (2.20-1) unstable; urgency=low * Silence cl-launch when reloading from an image that has it: don't re-evaluate header forms (might cause surprises if the image had a previous instance of cl-launch yet you depend on newer features. GIGO) * ASDF seems to complain when a system's :pathname is NIL. Use /dev/null instead. -- Francois-Rene Rideau Tue, 14 Jul 2009 11:46:04 -0400 cl-launch (2.19-1) unstable; urgency=low * Fix cl-launch when used with XCVB: depend on ASDF, and proper EVAL-WHEN for exporting symbols. -- Francois-Rene Rideau Thu, 09 Jul 2009 11:40:11 -0400 cl-launch (2.18-1) unstable; urgency=low * Rename BUILD.lisp to build.xcvb -- Francois-Rene Rideau Wed, 08 Jul 2009 13:04:40 -0400 cl-launch (2.17-1) unstable; urgency=low * Add functions -B print_lisp_implementation and -B print_lisp_binary_path for the sake of the XCVB Makefile. * tweak comments wrt CLISP version needed for standalone executables (2.48) -- Francois-Rene Rideau Thu, 25 Jun 2009 10:18:01 -0400 cl-launch (2.16-1) unstable; urgency=low * enable standalone executables for clisp. * small documentation updates. -- Francois-Rene Rideau Sat, 13 Jun 2009 02:46:51 -0400 cl-launch (2.15-1) unstable; urgency=low * Add support for option --image, including self-test. * Successfully ran self-test on clisp and sbcl and a variety of shells. -- Joyce Chen Fri, 12 Jun 2009 16:23:27 -0400 cl-launch (2.14-1) unstable; urgency=low * Add preliminary XCVB support. * Fix bitrotten support for #!.../cl-launch -X ... -- * DBG now goes to *trace-output* not *error-output* anymore * make sure --path elements appear in asdf:*central-registry* in their order of appearance -- Francois-Rene Rideau Fri, 29 May 2009 01:05:19 -0400 cl-launch (2.13-1) unstable; urgency=low * Debug clbuild support. * make sbcl the default default lisp, followed by clisp. -- Francois-Rene Rideau Tue, 23 Dec 2008 16:15:19 -0500 cl-launch (2.12-1) unstable; urgency=low * add basic clbuild support. Not included in test suite (yet). * better support :package argument to dump-image. -- Francois-Rene Rideau Mon, 22 Dec 2008 21:23:42 -0500 cl-launch (2.11-1) unstable; urgency=low * Added support for standalone executables on CLISP 2.48. * Debugged image dumping with ECL support some more. The second strategy (creating temporary .asd's) works better. However, ASDF seems confused if you don't rm -rf your object cache in ~/.cache/lisp-fasl/ecl*. * Better document the standalone executable support. -- Francois-Rene Rideau Sun, 09 Nov 2008 23:40:36 -0500 cl-launch (2.10-1) unstable; urgency=low * added a new magic environment variable CL_LAUNCH_DEBUG that enables debugging. * more attempts at debugging ECL support. -- Francois-Rene Rideau Sat, 01 Nov 2008 11:42:23 -0400 cl-launch (2.09-1) unstable; urgency=low * Fixes for GCL. * More failed attempts at getting ECL to reliably dump images. -- Francois-Rene Rideau Thu, 30 Oct 2008 13:22:04 -0400 cl-launch (2.08-1) unstable; urgency=low * Support new SBCL feature (since 1.0.21.24, thanks to Xach and Nikodemus) whereby we can now dump standalone executables. * Rename DIRECT_EXECUTABLE to STANDALONE_EXECUTABLE. * Refactor command-line argument detection for standalone executables. * Actually implement support for LispWorks - for Professional edition only. * Fix bug reported by Koga Kazuo, whereby on Mac OS X (and presumably other systems), /bin/sh doesn't support option -n to echo. Using the POSIX-mandated printf instead (via function ECHOn). * Rename OpenMCL to CCL (ClozureCL), drop support for older (pre)releases. * Remove builder patch for ecl 0.9i -- Francois-Rene Rideau Wed, 29 Oct 2008 09:09:04 -0400 cl-launch (2.07-1) unstable; urgency=low * commented out (sb-pcl::precompile-random-code-segments) in save-image as it may cause some systems to grind to a halt. Users can still do it themselves if they want it, it is purely a performance issue. -- Francois-Rene Rideau Thu, 17 May 2007 18:22:23 -0400 cl-launch (2.06-2) unstable; urgency=low * Improve packaging: suggest rather than depend on c-l-c (for the sake of non-Debian users). * (non-Debian change) make an asdf-installable package for cl-launch. -- Francois-Rene Rideau Tue, 24 Apr 2007 18:54:48 -0400 cl-launch (2.06-1) unstable; urgency=low * extend the API function QUIT with a new optional argument FINISH-OUTPUT (default T). When this argument is T, QUIT will FINISH-OUTPUT on *STANDARD-OUTPUT* and *ERROR-OUTPUT*. This replaces the (removed) internal function %QUIT. -- Francois-Rene Rideau Tue, 10 Apr 2007 17:39:33 -0400 cl-launch (2.05-1) unstable; urgency=low * Fix GCL 2.6 and 2.7, that were broken by the fix in cl-launch 2.04: the former doesn't have ENSURE-DIRECTORY-EXISTS occurrences of which were featured out, and the latter has issues with *LOAD-PATHNAME* incorrectly containing type lisp when it should have no type, which means that :pathname had to be specified in defsystem :cl-launch least it fail when the file has no extension. Also that system::*tmp-dir* ends with a / * Some minor documentation updates * SBCL: enable tail-call optimization; precompile CLOSy things before dump. * made cl-launch to be fully functional if it is the first system dependency in your asdf:defsystem (you still need a system-provided asdf for this to work fully). * OpenMCL: better distinguish FASL versions * completely tested with gcl gclcvs sbcl cmucl clisp ecl openmcl allegro -- Francois-Rene Rideau Tue, 20 Mar 2007 17:25:11 -0400 cl-launch (2.04-1) unstable; urgency=low * make cl-launch more robust wrt missing directories (can't truename or resolve-symlinks then) * mark the ecl patch as not needed for latest CVS (but still for 0.9i) * rename *fasl-cache* to *lisp-fasl-cache* -- Francois-Rene Rideau Fri, 12 Jan 2007 00:25:08 -0500 cl-launch (2.03-1) unstable; urgency=low * fix two bugs found by mkennedy at gentoo: use of truename on the cache path before it may exist call to a deleted shell function in the help. -- Francois-Rene Rideau Tue, 21 Nov 2006 00:08:43 -0500 cl-launch (2.02-1) unstable; urgency=low * completely tested with clisp ecl gcl gclcvs sbcl cmucl openmcl allegro some with and some without clc * wholly untested lispworks support * clarification of the situation of clisp and sbcl wrt DIRECT_EXECUTABLE (i.e. not yet). * self-test framework: account for shell variety, better criterion for cleanup * fix issues wrt pathnames, in resolve-symlinks & lisp-cache env var & gcl2.6 * superficial fixes -- Francois-Rene Rideau Mon, 16 Oct 2006 05:54:47 -0400 cl-launch (2.0-1) unstable; urgency=low * This release 2.0 passes full regression tests on all of clisp ecl gcl gclcvs and should work but hasn't been extensively tested with sbcl cmucl openmcl allegro * New "direct executable" feature supported on clisp and ecl: do away with the intermediate of a wrapper script and directly produce an executable. * We now fully support ECL. Success with dumping image from a system at last! Moreover, we dump a standalone :program, not a :fasl anymore; plus we take precautions to extract correct init-function-name from a library path. Search cl-launch code for "ECL PATCH" for modifications to ecl 0.9i sources. * After testing with not just bash and zsh, but also dash and posh, restore compatibility with posh that doesn't know -a and -o in [ ... ] * update documentation wrt GCL and ECL support, side-effects, etc. -- Francois-Rene Rideau Sat, 14 Oct 2006 13:55:42 -0400 cl-launch (1.93-1) unstable; urgency=low * This "full GCL support" release passes full regression tests on all of clisp sbcl cmucl ecl gclcvs gcl allegro openmcl * GCL: fix issue with compiling scripts without pathname type, and add support for image dump -- many thanks to Camm Maguire. * ECL: fix pathname type issue with build-fasl; desperate (and unsuccessful) attempt to modify builder so as to create a .fas from a system. * General issue with dumping: recompute the dynamic environment at each execution, not just when initially dumping. (I detected this because GCL had a similar bug with its *tmp-dir*, which we now work around.) * Disable the common-lisp-controller cache for GCL, since clc 6 is broken. * Fix bitrot in support for running without clc. * Fixed hairy bugs I could hardly fathom due to the interaction between the many many modes and evaluation times of cl-launch. -- Francois-Rene Rideau Fri, 13 Oct 2006 23:24:26 -0400 cl-launch (1.92-1) unstable; urgency=low * This "quick fix" release passes full regression tests on all of clisp sbcl cmucl ecl gclcvs gcl allegro openmcl * brown bag error for using find-system without nil-errors, that would break all non-clc installed implementations that have no cl-launch system. * until openmcl is fixed wrt -I handling, fall back to using exec_lisp_noarg -- Francois-Rene Rideau Wed, 11 Oct 2006 23:38:52 +0200 cl-launch (1.91-1) unstable; urgency=low * This "corner rounding" release passes full regression tests on all of clisp sbcl cmucl ecl gclcvs gcl allegro openmcl * make gcl load scripts it can't compile because their pathname lacks a type * make clisp properly compile scripts without a pathname type. * work around is a bug in clisp 2.40 option parsing (fixed in 2.41), by introducing a pseudo-filename after -- and skipping it in ext:*args* * use defsystem inside cl-launch, so that there will be no attempt to later miscompile an installed header into something empty due to #-cl-launch, which would confuse other software that depends on cl-launch but is being loaded without cl-launch (e.g. from SLIME). * fix --include /... for all shells by reshuffling BASIC_ENV_CODE * fix and/or work around some race condition in cacheing causing transient errors in the regression test suite, due to compilation happening within the same split second as automatic generation of next source code, which confuses clisp. I'm unable to fathom whether the race is due to a bug in cl-launch, clisp or the linux kernel, and so I won't blame others. * make sure ABORT is defined in the wrapper * regression test report on blefuscu (Pentium-M @1200MHz): cl-launch -l clisp -B tests 0 143 31.20s user 10.86s system 84% cpu 49.755 total cl-launch -l cmucl -B tests 0 143 39.76s user 15.40s system 85% cpu 1:04.81 total cl-launch -l sbcl -B tests 0 143 167.11s user 26.64s system 82% cpu 3:56.11 total cl-launch -l ecl -B tests 0 103 372.40s user 11.56s system 90% cpu 7:04.33 total cl-launch -l gcl -B tests 0 35 5.88s user 1.93s system 51% cpu 15.156 total cl-launch -l gclcvs -B tests 0 71 27.90s user 9.06s system 79% cpu 46.587 total cl-launch -l allegro -B tests 0 143 44.48s user 7.91s system 84% cpu 1:02.10 total on rastapopoulos (PPC 603ev @240MHz): cl-launch -l openmcl -B tests 0 143 888.90s user 234.23s system 82% cpu 22:48.42 total -- Francois-Rene Rideau Tue, 10 Oct 2006 02:06:24 -0400 cl-launch (1.90-1) unstable; urgency=low * This "bit unrot" release passes the full regression test on clisp sbcl cmucl ecl gclcvs gcl allegro * Refactor the way dumping and updates interact, fix some bugs. * avoid #+foo #+foo bar baz idiom to make acl5 happy again. * Fix buglets in the self-test exclusion patterns for gcl and ecl * make gcl-pre2.7 happier by avoiding keyword arguments in COMPILE-FILE * do not default INCLUDE_PATH to IMAGE_DIR when dumping. * update/fix documentation wrt what implementations are supported and how. -- Francois-Rene Rideau Sun, 8 Oct 2006 10:46:57 -0400 cl-launch (1.89-1) unstable; urgency=low * Enhance OpenMCL support: can now dump files and use direct command-line arguments. -- Francois-Rene Rideau Fri, 6 Oct 2006 18:04:09 -0400 cl-launch (1.88-1) unstable; urgency=low * separate the debian thing in a .diff.gz. * The correct command to detect packaging bugs is lintian cl-launch_*.dsc -- Francois-Rene Rideau Thu, 7 Sep 2006 20:00:34 +0200 cl-launch (1.87-1) unstable; urgency=low * due to popular request, add a resource file feature, a --rc/--no-rc option pair to enable/disable this feature, and the ability to configure cl-launch into having it enabled or disabled by default. Closes: #384697. -- Francois-Rene Rideau Wed, 30 Aug 2006 02:51:16 +0200 cl-launch (1.86-1) unstable; urgency=low * include image dumping in automated test suite, catching several bugs. * fix a nasty bug stupidly introduced in 1.83 whereby command-line arguments were not recomputed anymore when restarting from a dumped image (doh). * got --dump to work well with --update * try to get ECL to compile systems further, but hit some c::builder issues. See my messages of this month (august 2006) on the ECL mailing list. * tried to debug support for gcl 2.6.7-17: got --file working again (w/o fasl cache), but --system is hopeless. * gclcvs 2.7.0-54 doesn't even install properly anymore; on a system where it is installed of old its EVAL-WHEN seems badly broken. -- Francois-Rene Rideau Sun, 13 Aug 2006 08:28:03 -0400 cl-launch (1.85-1) unstable; urgency=low * unbreak some recent simplifications that don't work in all failure cases * consequently restore the partial support for GCL * work around current brokenness of ECL in debian * install cl-launch in /usr/share/common-lisp/source/cl-launch with an asd visible by c-l-c so as to allow (require 'cl-launch). -- Francois-Rene Rideau Thu, 10 Aug 2006 19:06:40 -0400 cl-launch (1.84-1) unstable; urgency=low * fix compile-file-pathname* (and thus option -f) in presence of c-l-c * add apply-output-pathname-translations to the API * refactor the image-dumping infrastructure to allow support for ECL; kluges to get around ECL 0.9i bug in c::builder pathname type handling. Many thanks to people on the ecls-list for help. NB: as of debian package ecl-0.9i-2, you must export ECL=/usr/lib/ecl/ecl-original for cl-launch to work with ECL, due to bug in debian packaging of ECL. -- Francois-Rene Rideau Wed, 9 Aug 2006 21:02:42 -0400 cl-launch (1.83-1) unstable; urgency=low * Considering that I am not a proper Debian Developer, add my sponsor as Uploaders: Peter Van Eynde , Rene van Bevern Many thanks to Luca Capello . * Properly declare previous bug fixed. Closes: #379531. * Debian documentation tweaks. * ECL file-compilation support debugged by Juan Jose Garcia-Ripoll. -- Francois-Rene Rideau Tue, 2 Aug 2006 15:53:23 -0400 cl-launch (1.82-1) unstable; urgency=low * explicitly call sh ./cl-launch.sh in the build rules so as to (fix bug #379531 reported by Andreas Jochens (though I suspect he did something wrong and this "fix" wasn't needed). -- Francois-Rene Rideau Tue, 24 Jul 2006 05:00:00 -0400 cl-launch (1.81-1) unstable; urgency=low * fix typo that prevented saving an override of SBCL_OPTIONS. Thanks to Matthew Danish for the bug report. * document the fact that GCL support is currently broken. * preliminary support for ECL. -- Francois-Rene Rideau Tue, 20 Jul 2006 20:00:00 -0400 cl-launch (1.80-1) unstable; urgency=low * work on the latest openmcl, that doesn't have #+ccl anymore, and may have an empty :asdf package. Runtime failure trying to dump image on x86_64. * have *print-readably* nil makes allegro 5 happier with asdf. -- Francois-Rene Rideau Tue, 20 Jun 2006 16:46:00 -0500 cl-launch (1.79-1) unstable; urgency=low * work well with common-lisp-controller when compiling without asdf. -- Francois-Rene Rideau Sat, 17 Jun 2006 22:01:00 -0400 cl-launch (1.78-1) unstable; urgency=low * fix allegro support -- Francois-Rene Rideau Wed, 7 Jun 2006 20:47:00 -0400 cl-launch (1.77-2) unstable; urgency=low * fix some lintian warnings -- Francois-Rene Rideau Thu, 18 May 2006 17:09:00 -0400 cl-launch (1.77-1) unstable; urgency=low * play well with debian and common-lisp-controller for inclusion in debian unstable * make lisp options more static when dumping an image. -- Francois-Rene Rideau Wed, 17 May 2006 12:37:45 -0400 cl-launch (1.76) unstable; urgency=low * fix some issues with dumping, quitting, restarting * improve the documentation some more. -- Francois-Rene Rideau Mon, 1 May 2006 02:23:14 -0400 cl-launch (1.75) unstable; urgency=low * use truename to compile and load files specified with relative path (this opens a can of worm of its own). Issue raised by Vladimir Sekissov . * fix some more bugs in the documentation * some code refactoring, slight bug fixes -- Francois-Rene Rideau Tue, 25 Apr 2006 21:15:24 -0400 cl-launch (1.74) unstable; urgency=low * fix some bugs in the documentation -- Francois-Rene Rideau Tue, 25 Apr 2006 04:15:24 +0200 cl-launch (1.73) unstable; urgency=low * add a symlink alias 'cl' to cl-launch * options --print and --write to evaluate and print expression * default behaviour being --execute * implicit --print if only one argument * options --dump and --restart that dump lisp images for fast startup (more output file optimization could be done here, plus support for :executable t in sbcl and/or clisp; :restart not fully supported) * cmucl now uses the noarg invocation method for safer behaviour. * some slight bug fixes in code and documentation. -- Francois-Rene Rideau Tue, 25 Apr 2006 03:54:20 +0200 cl-launch (1.72) unstable; urgency=low * "Initial" package. Earlier packages never having been accepted by Debian, I didn't actually maintain a changelog about them. -- Francois-Rene Rideau Tue, 28 Mar 2006 11:18:49 -0500 cl-launch-4.1.4/debian/cl-launch.1000066400000000000000000001260041255362050000165410ustar00rootroot00000000000000.\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . .TH "CL\-LAUNCH" "1" "July 2015" "Francois-Rene Rideau" "Shell Scripting with Common Lisp" . .SH "Name" cl\-launch \- shell wrapper for Common Lisp . .SH "Synopsis" . .nf cl [options] \'(lisp (form) to evaluate)\' evaluate specified form, print the results followed by newline as in: cl \-l sbcl \-sp my\-system\-and\-package \'(some form)\' cl [options] script\-file arguments\.\.\. run specified Lisp script, passing arguments, as in a script with #!/usr/bin/cl \-sp my\-system\-and\-package \-E main cl [options] [\-\-execute] [options] [\-\- arguments\.\.\.] run the specified software without generating a script (default) cl [options] \-\-output EXECUTABLE [options] generate an executable script or binary from the software specification . .fi . .SH "Special modes" . .nf \-h or \-? \-\-help display a short help message \-H \-\-more\-help show complete help (you may use a $PAGER) \-V \-\-version display cl\-launch version and configuration \-u FILE \-\-update FILE update a cl\-launch script to current version . .fi . .SH "Software specification" . .nf \-w CODE \-\-wrap CODE shell wrapper CODE to run in cl\-launch \-l LISP\.\.\. \-\-lisp LISP\.\.\. try use these LISP implementations \-m IMAGE \-\-image IMAGE build from Lisp image IMAGE \-f FILE \-\-file FILE include lisp FILE while building \-L FILE \-\-load FILE load lisp FILE while building \-S X \-\-source\-registry X override source registry of asdf systems \-s SYSTEM \-\-system SYSTEM load asdf SYSTEM while building \-\-load\-system SYSTEM same as above (buildapp compatibility) \-p PACKAGE \-\-package PACKAGE change current package to PACKAGE \-sp SP \-\-system\-package SP combination of \-s SP and \-p SP \-e FORM \-\-eval FORM evaluate FORM while building \-\-require MODULE require MODULE while building \-DE N/F \-\-dispatched\-entry N/F if exec\'ed as N, restart from (F argv) \-i FORM \-\-init FORM evaluate FORM at restart \-ip FORM \-\-print FORM evaluate and princ FORM at restart \-iw FORM \-\-write FORM evaluate and write FORM at restart \-r FUNC \-\-restart FUNC complete restart by calling (FUNC) \-E FUNC \-\-entry FUNC complete restart by calling (FUNC argv) \-F FORM \-\-final FORM evaluate FORM before dumping IMAGE \-I PATH \-\-include PATH runtime PATH to cl\-launch installation +I \-\-no\-include disable cl\-launch installation feature \-R \-\-rc try read /etc/cl\-launchrc, ~/\.cl\-launchrc +R \-\-no\-rc skip /etc/cl\-launchrc, ~/\.cl\-launchrc \-Q \-\-quicklisp use quicklisp (see \-\-more\-help) +Q \-\-no\-quicklisp do not use quicklisp \-b \-\-clbuild use clbuild (see \-\-more\-help) +b \-\-no\-clbuild do not use clbuild \-v \-\-verbose be quite noisy while building \-q \-\-quiet be quite quiet while building (default) . .fi . .SH "Output options" . .nf \-x \-o ! \-\-execute run the specified software NOW (default) \-o FILE \-\-output FILE create executable FILE \-d IMAGE \-\-dump IMAGE dump IMAGE for faster startup \-X \.\.\. \-\- (see more help) use #!/\.\.\./cl\-launch as script interpreter \-\- \-\- end of arguments when using \-x or \-X . .fi . .SH "Invocation of cl\-launch" \fBcl\-launch\fR will evaluate Common Lisp code or create shell scripts or executable binaries that evaluate Common Lisp code\. cl\-launch follows the invocation conventions of both Unix script interpreters and Common Lisp implementations\. . .P A suggested short\-hand name for \fBcl\-launch\fR is \fBcl\fR (you may create a symlink if it isn\'t included in your operating system\'s \fBcl\-launch\fR package)\. We\'d like to homestead the path \fB/usr/bin/cl\fR while we can, so that script authors can reasonably expect a script to work when it starts with: . .IP "" 4 . .nf `#!/usr/bin/cl` . .fi . .IP "" 0 . .P (See \fISimple cl\-launch scripts\fR below for caveats with \fB#!\fR scripts though\.) Recent Linux kernels support a script interpreter itself being a script; BSD kernels don\'t and require a small C program cl\-shim to be compiled and installed as /usr/bin/cl to use cl\-launch this way\. . .P To work properly, \fBcl\-launch\fR 4\.1\.4 depends on \fBASDF\fR 3\.1\.2 or later, and on its portability layer \fBUIOP\fR, to manage compilation and image life cycle\. . .P The software is specified as the evaluation of code in several phases; the distinction matters most for creating executable binaries, but understanding the evaluation model can avoid surprises in other cases too\. . .P In the first phase, the Lisp image is initialized: . .IP "\(bu" 4 optionally having your Lisp start from a Lisp \fBIMAGE\fR (option \fB\-I \-\-image\fR) . .IP "\(bu" 4 loading a small header of code that provides common \fBcl\-launch\fR functionality . .IP "\(bu" 4 loading \fBASDF3\fR\. The \fBcl\-launch\fR header will try hard to load \fBASDF 3\.1\.2\fR or later\. If your implementation does not provide it via \fB(require "asdf")\fR, you can configure your implementation\'s \fBASDF\fR (if any) to find it\. Or you can put it in your home, under \fB~/common\-lip/asdf/\fR and \fBcl\-launch\fR will find it\. Or it may be installed in \fB/usr/share/common\-lisp/source/cl\-asdf/\fR in which case \fBcl\-launch\fR will also find it\. Failing any of the above, \fBcl\-launch\fR will be unable to proceed\. . .IP "\(bu" 4 optionally loading quicklisp \fIhttp://beta\.quicklisp\.org/\fR (option \fB\-Q \-\-quicklisp\fR) . .IP "" 0 . .P In a second phase, your software is built, based on the following options, in order of appearance: . .IP "\(bu" 4 evaluating one or several \fBFORMS\fR (option \fB\-e \-\-eval\fR) in the current package\. The series of forms is evaluated as by \fBLOAD\fR, in a context where the \fB*package*\fR has been set to the current package (see below explanations on packages)\. . .IP "\(bu" 4 compiling a \fBFILE\fR and load the fasl (option \fB\-L \-\-load\fR) Files are loaded with \fB*package*\fR bound to the current package (see below)\. . .IP "\(bu" 4 including a \fBFILE\fR, compiling it and loading the fasl (option \fB\-f \-\-file\fR) The contents of the \fBFILE\fR, which will have be included in the output script, will be compiled and the fasl loaded as if by option \fB\-L \-\-load\fR\. The difference matters mostly when creating an output script, as opposed to executing the code immediately or dumping an image\. Only one file may be specified this way\. If a filename specified with \fB\-f \-\-file\fR is \fB\-\fR (after stripping quotes), then the standard input is used\. You may thus concatenate several files and feed them to \fBcl\-launch\fR through a pipe\. To use a file named \fB\-\fR, pass the argument \fB\./\-\fR (same trick as for \fBcat\fR and other Unix commands)\. . .IP "\(bu" 4 A script file, as specified by \fB\-X \.\.\. \-\-\fR or by use of \fB#!\fR or by following options with an immediate filename that does not start with \fB(\fR or \fB\-\fR, counts as if preceded by \fB\-\-package cl\-user \-\-load\fR and followed by \fB\-\-execute \-\-\fR . .IP "\(bu" 4 requiring an implementation\-provided \fBMODULE\fR (option \fB\-\-require\fR) . .IP "\(bu" 4 having \fBASDF3\fR compile and load a \fBSYSTEM\fR (option \fB\-s \-\-system \-\-load\-system\fR)\. Option \fB\-sp \-\-system\-package\fR loads the \fBSYSTEM\fR like \fB\-s \-\-system\fR and also changes the current \fB*package*\fR like \fB\-p \-\-package\fR (see below on packages)\. . .IP "\(bu" 4 optionally having your Lisp \fBDUMP\fR an image to restart from (option \fB\-d \-\-dump\fR), and just before evaluating one or several \fBFINAL\fR forms (option \fB\-F \-\-final\fR)\. See section \fIDumping images\fR\. . .IP "" 0 . .P If you are creating a shell script with option \fB\-o \-\-output\fR but without using option \fB\-d \-\-dump\fR, then these first two phases only happen when the script is invoked\. If you are using option \fB\-d \-\-dump\fR, then these two phases happen immediately, and no compilation happen when invoking the output\. Note that compiled files are cached, so that the compilation only happens the first time a file is loaded via \fB\-\-load of \-\-system\fR, or if the source file has been modified\. This may cause slower startup the first time over\. The cache is controlled by \fBASDF\fR\'s \fBoutput\-translations\fR mechanism\. See your \fBASDF\fR manual regarding the configuration of this cache, which is typically under \fB~/\.cache/common\-lisp/\fR . .P In a third phase, your software is run via \fBUIOP:RESTORE\-IMAGE\fR\. This happens immediately if using option \fB\-x \-\-execute\fR or calling \fBcl\-launch\fR as a Unix interpreter on a script e\.g\. via \fB#!\fR; or it can happen later if you use option \fB\-o \-\-output\fR in combination with (or without) option \fB\-d \-\-dump\fR to dump an image (which gives you faster startup and single\-file or double\-file delivery, at the expense of disk space), at which point it happens when you invoke the executable output file: . .IP "\(bu" 4 Hooks from \fBASDF3\fR\'s \fBUIOP:*IMAGE\-RESTORE\-HOOK*\fR are called (in FIFO order)\. . .IP "\(bu" 4 a series of \fBFORMS\fR specified via options \fB\-i \-\-init\fR, \fB\-ip \-\-print\fR, \fB\-iw \-\-write\fR, stored as a text string, are read and evaluated in order of appearance, each in the context of the package that was current at the time it was requested\. (Concatenated together with separating whitespace, these forms constitute the \fBUIOP:*IMAGE\-PRELUDE*\fR as handled by \fBRESTORE\-IMAGE\fR)\. Arguments that start with an open parenthesis are assumed to be \fBFORMS\fR that follow an implicit \fB\-\-print\fR\. Loading from a stream means you don\'t have to worry about nasty read\-time issues; forms will be read by the fully built Lisp image; however it also means that if you care a lot about the very last drop of startup delay when invoking a dumped image, you\'ll only use option \fB\-r \-\-restart\fR or \fB\-E \-\-entry\fR and avoid using \fB\-\-init\fR and its variants\. Option \fB\-ip \-\-print\fR specifies \fBFORMS\fR such that the result of the last form will be printed as if by \fBPRINC\fR, followed by a newline\. Option \fB\-iw \-\-write\fR is similar to \fB\-\-print\fR, using \fBWRITE\fR instead of \fBPRINC\fR\. . .IP "\(bu" 4 An optional \fBFUNCTION\fR provided option \fB\-r \-\-restart\fR or \fB\-E \-\-entry\fR is invoked after all init forms\. If the function was provided with option \fB\-r \-\-restart\fR (compatible with earlier versions of \fBcl\-launch\fR), it will be called with no argument\. If it was provided with option \fB\-E \-\-entry\fR (compatible with \fBbuildapp\fR), it will be called with one argument, being the list of arguments passed to the program, not including \fBargv[0]\fR, which is available on most implementations via the function \fBuiop:argv0\fR (available in \fBASDF\fR 3\.1\.2 and later)\. Using either option, the argument may be a function name or a lambda expression, that is read from the current package (see below option \fB\-p \-\-package\fR and \fB\-sp \-\-system\-package\fR)\. Only one restart or entry function may be specified; if multiple are provided, the last one provided overrides previous ones\. If you want several functions to be called, you may \fBDEFUN\fR one that calls them and use it as a restart, or you may use multiple init forms as below\. See also below options \fB\-DE \-\-dispatch\-entry\fR, \fB\-sm \-\-system\-main\fR, \fB\-Ds \-\-dispatch\-system\fR that behave as if \fB\-E \-\-entry\fR had been specified among other things\. . .IP "\(bu" 4 If neither restart nor entry function is provided, the program will exit with status \fB0\fR (success)\. If a function was provided, the program will exit after the function returns (if it returns), with status \fB0\fR if and only if the primary return value of result is generalized boolean true, and with status 1 if this value is \fBNIL\fR\. See documentation for \fBUIOP:RESTORE\-IMAGE\fR for details\. . .IP "" 0 . .P The current package can be controlled by option \fB\-p \-\-package\fR and its variant \fB\-sp \-\-system\-package\fR that also behaves like \fB\-s \-\-system\fR\. All forms passed to \fB\-\-eval\fR, \fB\-\-init\fR, \fB\-\-print\fR, \fB\-\-write\fR, \fB\-\-final\fR, \fB\-\-restart\fR, \fB\-\-entry\fR, etc\., are read in the current package\. Files specified with \fB\-f \-\-file \-\-load\fR are read in the current package\. Current means the package specified by the latest option \fB\-p \-\-package\fR or \fB\-sp \-\-system\-package\fR preceding the option being processed, or \fBcl\-user\fR if there was none\. Note that multiple \fB\-i \-\-init\fR or \fB\-F \-\-final\fR forms may be evaluated consecutively after a package has been changed, and that if one of these form itself modifies the package, or some other syntax control mechanism such as the reader, it may adversely affect later forms in the same category, but not those in other categories (if reached)\. . .P The following derived options work as if by a combination of simpler options: . .IP "\(bu" 4 As mentioned above, option \fB\-sp \-\-system\-package\fR combines \fB\-\-system\fR and \fB\-\-package\fR in one option, so that given the argument \fBSYSTEM\fR, the system is loaded as if by \fB\-\-system SYSTEM\fR that creates a package \fBSYSTEM\fR that then becomes the current package\. . .IP "\(bu" 4 If option \fB\-DE \-\-dispatch\-entry\fR is used, then the next argument must follow the format \fBNAME/ENTRY\fR, where \fBNAME\fR is a name that the program may be invoked as (the basename of the \fBuiop:argv0\fR argument), and \fBENTRY\fR is a function to be invoked as if by \fB\-\-entry\fR when that is the case\. If the \fBENTRY\fR is left out, function \fBmain\fR in current package is used\. Support for option \fB\-DE \-\-dispatch\-entry\fR is delegated to a dispatch library, distributed with \fBcl\-launch\fR but not part of \fBcl\-launch\fR itself, by (1) registering a dependency on the dispatch library as if by \fB\-\-system cl\-launch/dispatch\fR (if not already) (2) if neither \fB\-\-restart\fR nor \fB\-\-entry\fR was specified yet, registering a default entry function as if by \fB\-\-entry cl\-launch/dispatch:dispatch\-entry\fR\. (3) registering a build\-form that registers the dispatch entry as if by \fB\-\-eval \'(cl\-launch/dispatch:register\-name/entry "NAME/ENTRY" :PACKAGE)\'\fR where \fBPACKAGE\fR is the current package\. See the documentation of said library for further details\. . .IP "\(bu" 4 If option \fB\-Ds \-\-dispatch\-system\fR is used with \fBSYSTEM\fR as its argument, it is as if option \fB\-s \-\-system\fR had been used with the same argument, followed by option \fB\-DE \-\-dispatch\-entry\fR for the basename of the system (last \fB/\fR (slash) separated component of the system name) and the function \fBmain\fR in the package of the system, but without otherwise changing the current package\. . .IP "\(bu" 4 If option \fB\-sm \-\-system\-main\fR is used with \fBSYSTEM\fR as its argument, it is as if option \fB\-s \-\-system\fR had been used with the same argument, followed by option \fB\-E \-\-entry\fR with the \fBmain\fR function in the package of the system, but without otherwise changing the current package\. . .IP "" 0 . .P General note on \fBcl\-launch\fR invocation: options are processed from left to right; usually, repeated options accumulate their effects, with the earlier instances taking effect before latter instances\. In case of conflicting or redundant options, the latter override the former\. . .P \fBcl\-launch\fR defines a package \fBcl\-launch\fR that exports the following symbol: \fBcompile\-and\-load\-file\fR Runtime functionality formerly provided by \fBcl\-launch\fR is now provided by \fBUIOP\fR, the portability layer provided by \fBASDF3\fR\. See below section \fIcl\-launch runtime API\fR\. . .P When the first non\-recognized option is a filename, \fBcl\-launch\fR will try to load this filename as a script, as if by \fB\-\-load\fR, then execute it immediately as if by \fB\-\-execute \-\-\fR, with the rest of the command line passed as arguments\. The file name may not start with the character \fB\-\fR or a \fB(\fR \-\-\- To use a file with one of these (or something unknown) as a first character, prepend \fB\./\fR to the filename\. Note that it is a security risk to let adversaries control the names of files passed to cl\-launch or other commands\. . .P When option \fB\-\-execute\fR is specified, the specified software is executed\. Command\-line arguments may be given to software being executed by putting them after a special marker \fB\-\-\fR, that ends \fBcl\-launch\fR option processing\. . .P When option \fB\-\-output FILE\fR is used, code will be generated into the specified \fBFILE\fR\. The output file itself will be created atomically from complete generated contents and may thus have the same pathname as the input file\. The restart function and init forms will not be evaluated, but kept for when the output file is executed\. If \fB\-\fR (after quoting) is specified, then the standard output is used\. If \fB!\fR (after quoting) is specified, then option \fB\-\-execute\fR is assumed\. . .P When no \fB\-\-output\fR file is specified, option \fB\-\-execute\fR is implicitly assumed\. The last \fB\-\-output\fR or \fB\-\-execute\fR option takes precedence over the previous ones\. . .P If only one argument exists and it doesn\'t start with \fB\-\fR then the argument is considered as if given to option \fB\-ip\fR, to be evaluated and printed immediately\. . .P The \fBASDF3\fR source\-registry configuration can be overridden with option \fB\-\-source\-registry SOURCE_REGISTRY\fR\. The provided configuration will take priority over anything provided by the environment or configuration files, though it may inherit from them as usual\. See the \fBASDF3\fR manual about that\. . .P Options \fB\-l \-\-lisp\fR and \fB\-w \-\-wrap\fR may be used to control the way that a Common Lisp implementation is found when the software is run\. Option \fB\-l \-\-lisp\fR specifies the list of implementations to try to use; the list is whitespace\-separated, and consists in nicknames recognized by \fBcl\-launch\fR\. Option \fB\-w \-\-wrap\fR supplies arbitrary code to be evaluated by the shell wrapper, after it has read its configuration and defined its internal functions, but before it tries to find and run a Lisp implementation\. Such wrapper code is typically used to modify the variables that control the run\-time behaviour of generated scripts, as documented below\. Use of other internals of \fBcl\-launch\fR is possible, but not supported, which means that it is your responsibility to keep a copy of the specific version of cl\-launch with which your code works and to update your code if you later make an upgrade to an incompatible \fBcl\-launch\fR\. For instance, \fB\-\-lisp "foo bar"\fR is equivalent to \fB\-\-wrap \'LISPS="foo bar"\'\fR\. See below the documentation section on \fILisp implementation invocation\fR\. . .P Option \fB\-\-no\-include\fR specifies that cl\-launch should generate a standalone script that includes the configuration, shell wrapper, Lisp header, and user\-provided Lisp code (from \fB\-\-file\fR)\. If you can rely on the presence of a recent Lisp implementation that provides \fBASDF\fR, then the script is pretty much standalone indeed and may be moved around the filesystem and still used\. However the size of the output will be the size of the user Lisp code plus about 36KiB\. . .P Option \fB\-\-include PATH\fR specifies that \fBcl\-launch\fR should generate a very small script (typically under 1KiB) that when run will read the \fBcl\-launch\fR shell wrapper and Lisp header from a specified installation directory \fBPATH\fR\. Also, if option \fB\-\-include\fR is used, and Lisp code is specified with \fB\-\-file\fR and an absolute pathname starting with \fB/\fR as opposed to a relative pathname or to the standard input, then Lisp code will also be loaded from the specified location at runtime rather than embedded into the script at generation time\. This option generates leaner scripts, but may not be applicable when the very same script is to used in a variety of situations that lack common coherent filesystem management\. . .P Which of \fB\-\-include\fR or \fB\-\-no\-include\fR is the default may depend on your cl\-launch installation\. The version of \fBcl\-launch\fR distributed by the author uses \fB\-\-no\-include\fR by default, but the version of \fBcl\-launch\fR available in your operating system distribution may rely on a well\-managed include path (this is the case with debian for instance)\. You may query the configuration of an instance of \fBcl\-launch\fR with option \fB\-\-version\fR\. . .P For instance, one may expect a debian version of cl\-launch to use: . .IP "" 4 . .nf `/usr/share/common\-lisp/source/cl\-launch/` . .fi . .IP "" 0 . .P as a system\-managed include path\. One may also expect that Lisp implementations managed by the system would come with \fBcl\-launch\fR precompiled in Lisp images\. Since \fBcl\-launch\fR provides feature \fB:cl\-launch\fR, and since the \fBcl\-launch\fR Lisp header is conditionalized to not be read with this feature, this would make \fBcl\-launch\fR startup faster, while still allowing non\-system\-managed Lisp implementations to run fine\. . .P You may create an installation of cl\-launch with such a command as: . .IP "" 4 . .nf cl\-launch \-\-include /usr/share/common\-lisp/source/cl\-launch \e \-\-lisp \'sbcl ccl clisp\' \e \-\-rc \e \-\-output /usr/bin/cl\-launch \-B install . .fi . .IP "" 0 . .P You can use command \fB\-B install_bin\fR if you only want to configure cl\-launch (with a different default for \fB\-\-lisp\fR but no \fB\-\-include\fR, for instance), and command \fB\-B install_path\fR if you only want to create support files\. Note that the \fB\-\-backdoor\fR option \fB\-B\fR must come last in your invocation\. . .P Option \fB+R \-\-no\-rc\fR specifies that \fBcl\-launch\fR should not try to read resource files \fB/etc/cl\-launchrc\fR and \fB~/\.cl\-launchrc\fR\. . .P Option \fB\-R \-\-rc\fR specifies that cl\-launch should try to read resource files \fB/etc/cl\-launchrc\fR and \fB~/\.cl\-launchrc\fR\. These files are notably useful to define override the value of \fB$LISP\fR depending on \fB$SOFTWARE_SYSTEM\fR\. A shell function \fBsystem_preferred_lisps\fR is provided so that your \fBcl\-launchrc\fR might contain lines as follows: . .IP "" 4 . .nf system_preferred_lisps stumpwm cmucl sbcl clisp system_preferred_lisps exscribe clisp cmucl sbcl . .fi . .IP "" 0 . .P Beware that for the sake of parsing option \fB\-\-no\-rc\fR, the resource files are run \fIafter\fR options are processed, and that any overriding of internal variables will thus preempt user\-specified options\. A warning will be printed on the standard error output when such an override happens\. Note that such overrides only happen at script\-creation time\. A script created by \fBcl\-launch\fR will not try to read the \fBcl\-launch\fR resource files\. . .P Option \fB+Q \-\-no\-quicklisp\fR specifies that \fBcl\-launch\fR should not use \fBquicklisp\fR\. Option \fB\-Q \-\-quicklisp\fR specifies that \fBcl\-launch\fR should use \fBquicklisp\fR\. Which is the default depends on your installation\. The default default is \fB+Q\fR\. Quicklisp is loaded from \fB~/quicklisp/setup\.lisp\fR if available, or else \fB~/\.quicklisp/setup\.lisp\fR\. . .P Option \fB\-b \-\-clbuild\fR specifies that \fBcl\-launch\fR should rely on \fBclbuild\fR to find and invoke the Common Lisp implementation\. Option \fB+b \-\-no\-clbuild\fR specifies that \fBcl\-launch\fR should not rely on \fBclbuild\fR to find and invoke the Common Lisp implementation\. Which is the default depends on your installation\. The default default is \fB+b\fR\. . .P Files generated by \fBcl\-launch\fR are made of several well\-identifiable sections\. These sections may thus be considered as distinct software, each available under its own regime of intellectual property (if any)\. In case of an accident, you may still retrieve the exact original code provided with option \fB\-\-file\fR by stripping the wrapper, as delimited by well\-identified markers\. Search for the marker string \fB"BEGINS HERE:"\fR\. Everything after it is not \fBcl\-launch\fR\. This can be done automatically with backdoor option \fB\-B extract_lisp_content\fR\. \fBcl\-launch\fR uses this functionality implicitly when embedding a file specified with the option \fB\-\-file\fR, so that you may process a script previously generated by \fBcl\-launch\fR and change the options with which it wraps the embedded Lisp code into runnable software\. . .P As an alternative, you may also upgrade a previously generated script to use the current version of \fBcl\-launch\fR while preserving its original wrapping options with option \fB\-\-update\fR\. In this case, software specification options are ignored\. Output options still apply\. Specifying \fB\-\fR (after quoting) as the file to update means to read the contents to be read from the standard input\. This feature might not work with scripts generated by very early versions of the \fBcl\-launch\fR utility\. It should work with versions later than 1\.47\. . .SH "Supported Lisp implementations" The implementations supported by current version of cl\-launch are: . .IP "" 4 . .nf abcl allegro ccl clisp cmucl ecl gcl lispworks sbcl scl xcl . .fi . .IP "" 0 . .P Also defined are aliases: . .IP "" 4 . .nf clozurecl gclcvs lisp openmcl . .fi . .IP "" 0 . .P which are name variations for \fBccl\fR, \fBgcl\fR, \fBcmucl\fR and \fBccl\fR again respectively\. . .P Fully supported, including standalone executables: . .IP "" 4 . .nf sbcl: SBCL 1\.2\.2 clisp: GNU CLISP 2\.49 ecl: ECL 13\.5\.1 cmucl: CMUCL 20D ccl: ClozureCL 1\.10 lispworks: LispWorks Professional 7\.0\.0 (no personal ed, banner) . .fi . .IP "" 0 . .P Fully supported, but no standalone executables: . .IP "" 4 . .nf gcl (GCL 2\.7): GCL 2\.7\.0 ansi mode (get a very recent git checkout) allegro: Allegro 9\.0 (also used to work with 5) scl: Scieneer CL 1\.3\.9 . .fi . .IP "" 0 . .P Incomplete support: . .IP "" 4 . .nf abcl: ABCL 1\.3\.1 (no image dumping support, but you may use abcl\-jar) xcl: XCL 0\.0\.0\.291 (cannot dump an image) (get a recent checkout) . .fi . .IP "" 0 . .P \fBGCL\fR is only supported in ANSI mode\. \fBcl\-launch\fR does export GCL_ANSI=t in the hope that the \fBgcl\fR wrapper script does the right thing as it does in Debian\. Also \fBASDF3\fR requires a very recent \fBGCL 2\.7\fR\. Note that \fBGCL\fR seems to not be very actively maintained anymore\. . .P There are some issues regarding standalone executables on \fBCLISP\fR\. See below in the section regarding \fIStandalone executables\fR\. . .P \fBLispWorks\fR requires the Professional Edition; the Personal Edition isn\'t supported as it won\'t let you either control the command line or dump images\. Dumped images will print a banner, unless you dump a standalone executable\. To dump an image, make sure you have a license file in your target directory and/or to \.\.\./lispworks/lib/7\-0\-0\-0/config/lwlicense (or use a trampoline shell script to \fBexec /path/to/lispworks "$@"\fR), create a build script with: . .IP "" 4 . .nf echo \'(hcl:save\-image "lispworks\-console" :environment nil)\' > si\.lisp lispworks\-7\-0\-0\-x86\-linux \-siteinit \- \-init \- \-build si\.lisp . .fi . .IP "" 0 . .P There is no standard name for a console\-only variant of LispWorks; older versions of cl\-launch assume a default \fBlispworks\fR; since cl\-launch 4\.1\.2\.1, \fBlispworks\-console\fR is assumed instead, to avoid conflicts\. You can control the name you use with the shell variable \fB$LISPWORKS\fR, or you can just leave \fBlispworks\-console\fR in your path, and use a symlink, copy, shell alias or trivial wrapper script to enable your favorite shorter name \fBlispworks\fR, \fBlw\fR, \fBlwcon\fR, \fBlw\-console\fR, etc\. . .P Similarly, a mlisp image for allegro can be created as follows: . .IP "" 4 . .nf alisp \-e \'(progn (build\-lisp\-image "sys:mlisp\.dxl" :case\-mode :case\-sensitive\-lower :include\-ide nil :restart\-app\-function nil) (when (probe\-file "sys:mlisp") (delete\-file "sys:mlisp")) (sys:copy\-file "sys:alisp" "sys:mlisp"))\' . .fi . .IP "" 0 . .P Additionally, \fBcl\-launch\fR supports the use of \fBclbuild\fR as a wrapper to invoke the Lisp implementation, with the \fB\-\-clbuild\fR option\. . .SH "Supported shells" \fBcl\-launch\fR was tested with all of \fBposh\fR 0\.4\.7, \fBbash\fR 2\.05, \fBbash\fR 3\.1, \fBzsh\fR 4\.3\.2, \fBdash\fR 0\.5\.3 and \fBbusybox\fR 1\.01 \fBash\fR\. . .SH "Lisp implementation invocation" When a \fBcl\-launch\fR generated script is invoked, the \fBcl\-launch\fR shell wrapper will try to execute the Lisp code with the first Common Lisp implementation it finds in a given list, which can be specified through option \fB\-\-lisp\fR\. The runtime behaviour of the \fBcl\-launch\fR shell wrapper is very configurable through a series of environment variables\. These variables can be controlled by the user by exporting them in his environment, or they can be restricted at the time of script generation by using cl\-launch option \fB\-\-wrap\fR\. . .P If variable \fBLISP\fR is defined, the shell wrapper will first try the implementation named by variable \fBLISP\fR\. If that fails, it will try the list of implementations provided at script generation time\. The list of implementations generated will be the argument to option \fB\-\-lisp\fR if specified\. Otherwise, \fBcl\-launch\fR will supply its default value\. This default value for the current instance of \fBcl\-launch\fR is: . .IP "" 4 . .nf sbcl ccl clisp abcl allegro lispworks scl cmucl ecl mkcl gcl xcl . .fi . .IP "" 0 . .P This \fBLISP\fR selection only happens at system preparation time\. If you dump an image then the script will always use the Lisp implementation for which an image was dumped\. If you don\'t then the user may override the implementation\. . .P Note that these are nicknames built into the \fBcl\-launch\fR shell wrapper, and not necessarily names of actual binary\. You may control the mapping of implementation nickname to actual binary pathname to call with an environment variable\. For a given implementation nickname, the environment variable will be the capitalization of the given nickname\. Hence, variable \fB$SBCL\fR controls where to look for the \fBsbcl\fR implementation, and variable \fB$CMUCL\fR controls where to look for the \fBcmucl\fR implementation\. If a binary is found with a matching pathname (using the standard unix \fB$PATH\fR as required), then said implementation will be used, using proper command line options, that may be overridden with an environment variable similar to the previous but with \fB_OPTIONS\fR appended to its name\. Hence, \fB$CMUCL_OPTIONS\fR for \fBcmucl\fR, \fB$CLISP_OPTIONS\fR for \fBclisp\fR, etc\. Sensible defaults are provided for each implementation, so as to execute the software in non\-interactive mode, with debugger disabled, without reading user\-specific configuration files, etc\. . .P If you want to insist on using a given implementation with given options, you may use option \fB\-\-lisp\fR and \fB\-\-wrap\fR, as follows: . .IP "" 4 . .nf \-\-lisp \'sbcl clisp\' \-\-wrap \' LISP= # do not allow the user to specify his implementation SBCL=/usr/bin/sbcl # not any experimental thing by the user SBCL_OPTIONS="\-\-noinform \-\-sysinit /dev/null \-\-userinit /dev/null \e \-\-disable\-debugger" # predictable Lisp state CLISP=/usr/bin/clisp # fall back on machines that lack SBCL CLISP_OPTIONS=" \-norc \-\-quiet \-\-quiet" # configure ASDF: CL_SOURCE_REGISTRY=/usr/local/share/common\-lisp/source//: # assuming precompiled fasls there: ASDF_OUTPUT_TRANSLATIONS=/my/cl/src:/my/fasl/cache: \' . .fi . .IP "" 0 . .P If you dump an image, you need not unset the \fBLISP\fR variable, but you might still want to override any user\-specified \fBSBCL\fR and \fBSBCL_OPTIONS\fR (or corresponding variables for your selected implementation) from what the user may specify\. . .P Note that you can use option \fB\-\-wrap "$(cat your_script)"\fR to embed into your program a full fledged script from a file\. Your script may do arbitrary computations before the shell wrapper is run\. It may make some consistency checks and abort before to run Lisp\. Or it may analyze invocation arguments and make according adjustments to Lisp implementation options\. This can be useful for setting options that cannot be set from the Lisp code, such the path to a runtime image, interactive or non\-interactive execution, size of heaps, locale settings for source file encoding, etc\. . .P Reading the source code of \fBcl\-launch\fR can be completely crazy\. You may have great fun understanding why things are how they are and adding features without breaking anything! However, adding support for a new CL implementation should be straightforward enough: just search the sources for \fBclisp\fR or \fBsbcl\fR and mimic what I did for them\. Be sure to send me what will get your favorite Lisp flavor of the month rolling\. . .SH "Limited clbuild support" \fBcl\-launch\fR 2\.12 and later support using \fBclbuild\fR as a wrapper to configure your Lisp implementation, with option \fB\-\-clbuild\fR (which can be disabled with option \fB\-\-no\-clbuild\fR if it was enabled by default in your \fBcl\-launch\fR installation)\. . .P Note that when you use \fBclbuild\fR, you can no longer override implementation options with say \fBSBCL_OPTIONS\fR, as clbuild takes care of the options for you\. Any implementation banner will not be removed unless you instruct clbuild to do so\. Also, you cannot use clbuild with a non\-executable image different from \fBclbuild\fR\'s, which precludes image dumping with \fBcmucl\fR or \fBallegro\fR (\fBallegro\fR could probably be updated, but I don\'t have a recent licence to test and develop)\. . .P \fBclbuild\fR support is not fully tested at this point\. Please report any bug\. . .SH "Simple cl\-launch scripts" In simple cases, you may create a Common Lisp shell script with \fBcl\-launch\fR without a script generation step, just because you\'ll spend a lot of time editing the script and distributing it, and little time waiting for script startup time anyway\. This notably is a good idea if you\'re not spawning many instances of the same version of a script on a given computer\. If that\'s what you want, you may use \fBcl\-launch\fR as a script interpret the following way (stripping leading spaces): . .IP "" 4 . .nf #!/path/to/cl\-launch \.\.\.options\.\.\. . .fi . .IP "" 0 . .P For instance, you may write the following script (stripping leading spaces): . .IP "" 4 . .nf #!/usr/bin/cl \-\-entry main (defun main (argv) (format t "Hello, World!~%~S~%" argv)) . .fi . .IP "" 0 . .P On a recent Linux kernel, the options may include spaces, parentheses, etc\., provided they are quoted as in a shell script\. Also, using \fB\-X\fR as your very first option and \fB\-\-\fR as your last will ensure that the script works even if its name starts with a \fB(\fR or a \fB\-\fR, in addition to working with older versions of \fBcl\-launch\fR\. . .P Note however that Darwin (MacOS X) and other BSD kernels or old Linux kernels don\'t like the \fB#!\fR interpreter to itself be interpreted\. On these operating system kernels, the system administrator must compile and install a small shim written in C, \fBcl\-shim\.c\fR, that will handle the proper script invocation\. . .P Most kernels have restrictions on how they handle arguments to a \fB#!\fR script, that prevent e\.g\. using \fB/usr/bin/env\fR as a trampoline; however, you may use the fully portable solution as follows, where the \fB":" ;\fR ensures that the script should remain valid bilingual shell and Lisp code: . .IP "" 4 . .nf #!/bin/sh ":" ; exec cl\-launch \-X \-sp my\-package \-E main \-\- "$0" ${1+"$@"} || exit . .fi . .IP "" 0 . .P (Actually \fB"$@"\fR instead of \fB${1+"$@"}\fR should work just fine, unless you have an antique shell\.) . .P Note that if you don\'t need Lisp code to be loaded from your script, with everything happening in the build specification, then you may instead use a simple \fB#!/bin/sh\fR shell script from which you: . .IP "" 4 . .nf exec /path/to/cl\-launch \-x \.\.\. \-\- "$@"\. . .fi . .IP "" 0 . .P Also, in case you can\'t rely on \fBcl\-launch\fR being at a fixed path, or if your shell and/or kernel combination doesn\'t support using \fBcl\-launch\fR as a script interpreter, then you may instead start your script with the following lines: . .IP "" 4 . .nf #!/bin/sh ":" ; exec cl\-launch \-X \-\- "$0" "$@" || exit (format t "It works!~%") . .fi . .IP "" 0 . .P Note that a mainline Linux kernel only supports the recursive \fB#!\fR implicit in \fB#!/usr/bin/cl\-launch\fR since 2\.6\.27\.9\. . .SH "Dumping images" You can dump an image (for static compilation and fast startup) with option \fB\-\-dump IMAGE\fR where \fBIMAGE\fR specifies the path where the image will be dumped\. . .P If you use option \fB\-\-include PATH\fR then the image will be loaded back from that specified directory instead of the directory where you dumped it\. This is useful if you\'re preparing a script to be installed at another place maybe on another computer\. . .P This option is currently supported on all CL implementations available with \fBcl\-launch\fR\. . .P As a limitation, \fBLispWorks\fR will print a banner on standard output, unless you use the standalone executable option below\. . .P As another limitation, \fBECL\fR will not be able to dump an image when running from a previously dumped image (with \fB\-\-image\fR)\. This is because of the link model of ECL, whereby you\'d need to be able to locate which object files were used in linking the original image, keep track of these files, and prepend the list of them to to the object files linked into the dump\. This is not conceptually impossible and patches are welcome\. However, we hope to support that someday with a real build system that does it for you, such as XCVB\. . .SH "Standalone executables" You can create standalone executables with the option \fB\-\-dump \'!\'\fR (or by giving a \fB\-\-dump\fR argument identical to the \fB\-\-output\fR argument)\. . .P This option is currently only supported with \fBSBCL\fR, \fBECL\fR, \fBCLISP\fR, \fBCMUCL\fR, \fBCCL\fR and \fBLispWorks\fR Professional\. Moreover \fBCLISP\fR has the issues below\. . .P \fBCLISP\fR standalone executables will react magically if invoked with options such as \fB\-\-clisp\-help\fR or \fB\-\-clisp\-x \'(sys::main\-loop)\'\fR\. That\'s a pretty far\-fetched thing to hit by mistake, and the \fBCLISP\fR maintainers consider it a feature (I don\'t)\. Don\'t use such executables as \fBsetuid\fR, and don\'t let untrusted users control arguments given to such executables that are run with extra privileges\. . .SH "cl\-launch runtime API" \fBcl\-launch\fR provides the following Lisp functions: . .P Function \fBcl\-launch:compile\-and\-load\-file\fR takes as an argument a source pathname designator, and keyword arguments \fBforce\-recompile\fR (default \fBNIL\fR) and \fBverbose\fR (default \fBNIL\fR)\. It will arrange to compile the specified source file if it is explicitly requested, or if the file doesn\'t exist, or if the fasl is not up\-to\-date\. It will compile and load with the specified verbosity\. It will take use \fBuiop:compile\-file\-pathname*\fR to determine the fasl pathname\. . .P The following variables and functions previously provided by \fBcl\-launch\fR have the following replacement from \fBASDF\fR and \fBUIOP\fR: . .P Variable \fBcl\-launch:*arguments*\fR is replaced by \fBuiop:*command\-line\-arguments*\fR\. . .P Function \fBcl\-launch:getenv\fR is replaced by \fBuiop:getenv\fR\. . .P Function \fBcl\-launch:load\-system\fR is replaced by \fBasdf:load\-system\fR\. . .P Function \fBcl\-launch:quit\fR is replaced by \fBuiop:quit\fR (beware: the lambda\-list is slightly different)\. . .P Additionally, environment variables \fBCL_LAUNCH_PID\fR and \fBCL_LAUNCH_FILE\fR will be set to the process ID and the script invocation filename respectively\. . .SH "Verbose output mode" If the shell variable \fBCL_LAUNCH_VERBOSE\fR is exported and non\-\fBnil\fR, then \fBcl\-launch\fR and the scripts it generates will produce an abundance of output, display such things as the Lisp invocation command, compiling and loading files with \fB:verbose t\fR and \fB:print t\fR, etc\. This is only useful for debugging \fBcl\-launch\fR and/or your build process\. Option \fB\-\-verbose\fR sets this variable, whereas option \fB\-\-quiet\fR resets it\. . .SH "Makefile examples" . .nf ### Automatically download of the current version of cl\-launch if not present cl\-launch\.sh: wget \-O cl\-launch\.sh http://fare\.tunes\.org/files/cl\-launch/cl\-launch\.sh chmod a+x cl\-launch\.sh ### Making a shell script executable from a simple Lisp file named foo\.lisp foo\.sh: cl\-launch\.sh foo\.lisp \./cl\-launch\.sh \-\-output foo\.sh \-\-file foo\.lisp ### A more complex example using all options\. run\-foo\.sh: cl\-launch\.sh preamble\.lisp \./cl\-launch\.sh \-\-output run\-foo\.sh \e \-\-file preamble\.lisp \-\-system foo \e \-\-init "(foo:main uiop:*command\-line\-arguments*)" \e \-\-source\-registry ${PREFIX}/cl\-foo/systems: \e \-\-lisp "ccl sbcl" \-\-wrap \'SBCL=/usr/local/bin/sbcl\-no\-unicode\' \e \-\-no\-include ### An example with horrible nested makefile, shell and Lisp quoting hello: opera=wORlD ; \./cl\-launch\.sh \-\-execute \-\-init \e "(format t \e"~25R~A~A~%\e" 6873049 #\e\espace \'$$opera)" . .fi . .SH "Caveat Lispor" \fBcl\-launch\fR begins evaluation of your Lisp software in the \fBcl\-user\fR package, or whichever package you specify\. By the time your initialization forms are evaluated, the package may or may not have changed, depending on the fine\-grained semantics of \fBload\fR\. Be sure to use \fBin\-package\fR if these things matter\. If you change the readtable, even weirder things may happen\. . .P There are lots of ways of making mistakes by improperly quoting things when you write shell commands\. \fBcl\-launch\fR does the right thing, but you still must be careful with the nested quoting mechanisms of \fBmake\fR, shell, and Lisp\. . .P Here is a simple example use of cl\-launch to quickly compare the result of a same computation on a variety of systems: . .IP "" 4 . .nf for l in sbcl cmucl clisp gcl ccl ; do \./cl\-launch\.sh \-\-lisp $l \-\-execute \-\-init \e \'(format t "\'$l\' ~A~%" most\-positive\-fixnum)\' ; done . .fi . .IP "" 0 . .P Internally, \fBcl\-launch\fR includes many self\-test functions\. You may for instance try (from a directory where it may create junk): . .IP "" 4 . .nf \&\./cl\-launch\.sh \-l \'sbcl cmucl clisp gclcvs\' \-B tests . .fi . .IP "" 0 . .P Share and Enjoy! . .P See our web page on: . .IP "" 4 . .nf . .fi . .IP "" 0 . .P Note: if this help is too long for you, you may scroll back, or use: . .IP "" 4 . .nf cl \-\-more\-help | less . .fi . .IP "" 0 cl-launch-4.1.4/debian/compat000066400000000000000000000000021255362050000160040ustar00rootroot000000000000007 cl-launch-4.1.4/debian/control000066400000000000000000000041601255362050000162120ustar00rootroot00000000000000Source: cl-launch Section: lisp Priority: optional Homepage: http://www.cliki.net/cl-launch Maintainer: Francois-Rene Rideau Uploaders: Christoph Egger , Kan-Ru Chen , Milan Zamazal , Peter Van Eynde , Julien Danjou Build-Depends: debhelper (>= 9) Standards-Version: 3.9.6.1 Vcs-Git: https://gitlab.common-lisp.net/xcvb/cl-launch.git Package: cl-launch Architecture: all Depends: ${misc:Depends} Suggests: cl-asdf (>= 2:3.1.4) Recommends: sbcl (>= 1:1.2.3), cl-asdf (>= 2:3.1.2) Breaks: cl-asdf (<= 2:3.1.1), common-lisp-controller (<= 7.3) Description: uniform frontend to running Common Lisp code from the shell CL-Launch will allow you to invoke Common Lisp source code from the shell command line, from a shell script or as a Common Lisp script. It will also allow you to turn your Common Lisp source programs into standalone executables or executable shell scripts (optionally using a dumped image), depending on the features available in your underlying implementation. . CL-Launch will automatically detect a supported Common Lisp implementation and use adequate invocation options. It can also be configured to fit exactly the programmer's desires. Fully supported implementations are: Allegro, CLISP, ClozureCL, CMUCL, ECL, MKCL, SBCL, SCL. Partially supported implementations are: LispWorks Professional, ABCL, GCL, XCL. Creating standalone executables is supported on: CLISP, ClozureCL, CMUCL, LispWorks, SBCL, SCL . CL-Launch also offers Common Lisp programs a simple uniform interface to invocation parameters (command-line arguments and environment variables). It relies on ASDF 3 for system construction. See the ASDF 3 manual for more information on how to configure source and object code location. CL-Launch may dump memory images for fast startup (at the expense of disk space). It can also be used as a quick way to evaluate and print simple Lisp forms or scripts from the command-line without invoking a full-fledged REPL, and to easily compare results between implementations. . cl-launch-4.1.4/debian/copyright000066400000000000000000000112361255362050000165440ustar00rootroot00000000000000Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: cl-launch Upstream-Contact: Francois-Rene Rideau Source: http://www.cliki.net/cl-launch Files: * Copyright: 2005 Francois-Rene Rideau License: LLGPL or Bugroff CL-Launch is written and Copyright (c) 2005 by Francois-Rene Rideau. . CL-Launch is available under the terms of the bugroff license. http://tunes.org/legalese/bugroff.html You may at your leisure use the LLGPL instead < http://www.cliki.net/LLGPL > . The LLGPL, or Lisp Lesser GNU Public, consists of a preamble (see below) and the GNU Lesser General Public License 2.1 (LGPL-2.1). Where these conflict, the preamble takes precedence. CL-Launch is referenced in the preamble as the "LIBRARY." . On Debian systems, the full text of the GNU LGPL v2.1 can be found in the file `/usr/share/common-licenses/LGPL-2.1'. . CL-Launch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. . Preamble to the Gnu Lesser General Public License ------------------------------------------------- Copyright (c) 2000 Franz Incorporated, Berkeley, CA 94704 . The concept of the GNU Lesser General Public License version 2.1 ("LGPL") has been adopted to govern the use and distribution of above-mentioned application. However, the LGPL uses terminology that is more appropriate for a program written in C than one written in Lisp. Nevertheless, the LGPL can still be applied to a Lisp program if certain clarifications are made. This document details those clarifications. Accordingly, the license for the open-source Lisp applications consists of this document plus the LGPL. Wherever there is a conflict between this document and the LGPL, this document takes precedence over the LGPL. . A "Library" in Lisp is a collection of Lisp functions, data and foreign modules. The form of the Library can be Lisp source code (for processing by an interpreter) or object code (usually the result of compilation of source code or built with some other mechanisms). Foreign modules are object code in a form that can be linked into a Lisp executable. When we speak of functions we do so in the most general way to include, in addition, methods and unnamed functions. Lisp "data" is also a general term that includes the data structures resulting from defining Lisp classes. A Lisp application may include the same set of Lisp objects as does a Library, but this does not mean that the application is necessarily a "work based on the Library" it contains. . The Library consists of everything in the distribution file set before any modifications are made to the files. If any of the functions or classes in the Library are redefined in other files, then those redefinitions ARE considered a work based on the Library. If additional methods are added to generic functions in the Library, those additional methods are NOT considered a work based on the Library. If Library classes are subclassed, these subclasses are NOT considered a work based on the Library. If the Library is modified to explicitly call other functions that are neither part of Lisp itself nor an available add-on module to Lisp, then the functions called by the modified Library ARE considered a work based on the Library. The goal is to ensure that the Library will compile and run without getting undefined function errors. . It is permitted to add proprietary source code to the Library, but it must be done in a way such that the Library will still run without that proprietary code present. Section 5 of the LGPL distinguishes between the case of a library being dynamically linked at runtime and one being statically linked at build time. Section 5 of the LGPL states that the former results in an executable that is a "work that uses the Library." Section 5 of the LGPL states that the latter results in one that is a "derivative of the Library", which is therefore covered by the LGPL. Since Lisp only offers one choice, which is to link the Library into an executable at build time, we declare that, for the purpose applying the LGPL to the Library, an executable that results from linking a "work that uses the Library" with the Library is considered a "work that uses the Library" and is therefore NOT covered by the LGPL. . Because of this declaration, section 6 of LGPL is not applicable to the Library. However, in connection with each distribution of this executable, you must also deliver, in accordance with the terms and conditions of the LGPL, the source code of Library (or your derivative thereof) that is incorporated into this executable. cl-launch-4.1.4/debian/links000066400000000000000000000001321255362050000156450ustar00rootroot00000000000000usr/bin/cl-launch usr/bin/cl usr/share/man/man1/cl-launch.1.gz usr/share/man/man1/cl.1.gz cl-launch-4.1.4/debian/rules000077500000000000000000000030311255362050000156630ustar00rootroot00000000000000#!/usr/bin/make -f pkg := cl-launch debpkg := cl-launch DESTDIR := debian/$(debpkg) clc-source := usr/share/common-lisp/source clc-systems := usr/share/common-lisp/systems include_dir := $(clc-source)/$(pkg) doc-dir := usr/share/doc/$(debpkg) configure: configure-stamp configure-stamp: dh_testdir touch configure-stamp build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: configure-stamp dh_testdir sh ./cl-launch.sh \ --include /${include_dir} \ --lisp "sbcl ccl clisp abcl cmucl ecl mkcl allegro lispworks scl gcl xcl" \ --rc \ -B generate_install_files touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp rm -f cl-launch cl-launch.asd launcher.lisp wrapper.sh build.xcvb rm -f debian/cl-launch.postinst.* debian/cl-launch.prerm.* dh_clean install: build dh_testdir dh_testroot dh_clean dh_installdirs -p ${debpkg} $(include_dir) $(doc-dir) dh_install -i cl-launch usr/bin dh_install -i launcher.lisp wrapper.sh cl-launch.asd build.xcvb \ dispatch.lisp ${include_dir} dh_installman -i debian/*.1 # Build architecture-independent files here. binary-indep: build install dh_testdir -i dh_testroot -i dh_installdocs -i dh_installchangelogs -i dh_link -i dh_compress -i dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i # Build architecture-dependent files here. binary-arch: build binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure cl-launch-4.1.4/debian/source/000077500000000000000000000000001255362050000161065ustar00rootroot00000000000000cl-launch-4.1.4/debian/source/format000066400000000000000000000000141255362050000173140ustar00rootroot000000000000003.0 (quilt) cl-launch-4.1.4/debian/upstream/000077500000000000000000000000001255362050000164465ustar00rootroot00000000000000cl-launch-4.1.4/debian/upstream/signing-key.asc000066400000000000000000000243321255362050000213660ustar00rootroot00000000000000-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2.0.17 (GNU/Linux) mQQNBFFRJokBIADE6EA0lzzEnSEMDvNHxj3zLBMOdeu784PBAY36bJIjiRoAF7dV 5Z4kVYVldfpFQzkslGVn60b+U2WMfiFlxVqHARWRg5m2s/SEj7P3a2XAA1bEPENc VpieSfeMGcaswA8pyosJgNE9yIbbvQm17NsXpr/UiLjVf8DHbc7Jf1IOePgUB8Xd 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fNpFaPy3kAzRDSyjou8cyrhvPXv38pkMmIGjBE0WYixb3oqAw1/6L Iya6AIZXqEFdG0DzyD25gl06pu0UZzPLa6q3cgOJpMd9Hlzo3T5mIYsykoqsY33j PmGKIk1ngNpXZ54YevY2YnLydqhoCRVw1Z1b+7a9+kCwEQb5pot4XIaqKfjcFVtT SGEULY17+le/cMOvn/YWExBiT8G9sWcU2ZlsRAZM9y+ls8x5pv6yIBuTGf54IlsH kJqtX4PqpPrVj0ll3OeAhCW1mNt+FqN7NKuR8R3SaNiGauRbls6oJcM3FR+X6z8D GuDvGt4= =M2XV -----END PGP PUBLIC KEY BLOCK----- cl-launch-4.1.4/debian/watch000066400000000000000000000001261255362050000156360ustar00rootroot00000000000000version=3 http://common-lisp.net/project/xcvb/cl-launch/ cl-launch-([0-9.]+)\.tar\.gz cl-launch-4.1.4/dispatch.lisp000066400000000000000000000052751255362050000160650ustar00rootroot00000000000000(defpackage :cl-launch/dispatch (:use :uiop :cl) (:export #:dispatch-entry #:get-entry #:register-name/entry #:register-entry #:dispatch-entry-error #:get-name #:basename #:all-entry-names #:dispatcher #:not-found)) (in-package :cl-launch/dispatch) (defvar *default-behavior* 'dispatcher "the default behavior if the argv0 invocation name is not recognized.") (defvar *entries* (make-hash-table :test 'equal) "a table of entries, associating strings (basename of a command) to entry") (define-condition dispatch-entry-error (simple-error) ()) (defun dispatch-entry-error (format &rest arguments) (error 'dispatch-entry-error :format-control format :format-arguments arguments)) ;; TODO: shall we default the name of the entry point to main? (defun split-name/entry (name/entry &optional (package *package*) (default-entry "main")) "split name and entry from a name-entry specification" (flet ((f (name entry) (values (and (not (emptyp name)) name) (ensure-function entry :package package)))) (if-let ((slash (position #\/ name/entry))) (f (subseq name/entry 0 slash) (subseq name/entry (1+ slash))) (f name/entry default-entry)))) (defun register-entry (name entry) (if name (setf (gethash name *entries*) entry) (setf *default-behavior* entry))) (defun register-name/entry (name/entry &optional (package *package*)) (multiple-value-call 'register-entry (split-name/entry name/entry package))) (defun get-entry (name) "Given a string NAME, return the dispatch entry registered for that NAME. If NAME is NIL, return the value of *DEFAULT-BEHAVIOR*." (if name (gethash name *entries*) *default-behavior*)) (defun basename (name) (let ((base (if-let ((slash (position #\/ name :from-end t))) (subseq name (1+ slash)) name))) (and (not (emptyp base)) base))) (defun get-name () (basename (uiop:argv0))) (defun all-entry-names () (sort (loop :for k :being :the :hash-keys :of *entries* :collect k) 'string<)) (defun dispatcher (argv) (if (null argv) (die 2 "~A available commands: ~{~A~^ ~}" (get-name) (all-entry-names)) (dispatch-entry (rest argv) (first argv)))) (defun not-found (argv) (declare (ignore argv)) (if-let ((name (get-name))) (die 3 "~A command not found." (get-name)) (die 4 "could not determine command name"))) (defun dispatch-entry (argv &optional (name (get-name))) (funcall (or (get-entry name) *default-behavior*) argv)) ;; The below function is NOT exported, but you can use :import-from so -Ds works trivially with some system of yours: (defun main (argv) (dispatcher argv)) (when (null *image-entry-point*) (setf *image-entry-point* #'dispatcher)) cl-launch-4.1.4/release.lisp000077500000000000000000000172451255362050000157110ustar00rootroot00000000000000#| -*- Lisp -*- #!/usr/bin/cl -Ds cl-launch/release exec "$(dirname $0)/cl-launch.sh" -X --dispatch-system cl-launch/release -- "$0" "$@" ; exit |# (defpackage :cl-launch/release (:use :cl :uiop :asdf :fare-utils :optima :optima.ppcre :inferior-shell :cl-scripting :cl-launch/dispatch) (:import-from :cl-launch/dispatch #:main) ;; Note: these exports are also the list of available commands. (:export #:rep #:clean #:manpage #:source #:quickrelease #:get-date-from-git #:check-manual #:debian-version #:script-version #:debian-package #:publish-debian-package #:debian-package-all)) (in-package :cl-launch/release) (eval-when (:compile-toplevel :load-toplevel :execute) (flet ((check-system-version (name version) (let ((system (find-system name))) (unless (version-satisfies system version) (die 2 "~A requires ~A at least ~A but only got version ~A" (argv0) name version (component-version system)))))) (check-system-version "asdf" "3.1.2") ;; for package-inferred-system, uiop:argv0 (check-system-version "inferior-shell" "2.0.3"))) ;; for default run outputs, on-error error. (defvar *cl-launch-directory* ;; interactive users may want to override that. (truenamize (pathname-directory-pathname (ensure-absolute-pathname (or (argv0) *compile-file-pathname* *load-pathname* (nil-pathname)) #'getcwd)))) (defun pn (&optional x) (subpathname *cl-launch-directory* x)) (defun rep (argument) ;; read-eval-print, no loop. (eval-input (strcat "(in-package :cl-launch/release) " argument))) (defun script-version () (match (read-file-line (pn "cl-launch.sh") :at 2) ((ppcre "^CL_LAUNCH_VERSION='([0-9]+([.][0-9]+)+)'$" version) version))) (defun debian-version () (match (read-file-line (pn "debian/changelog") :at 0) ((ppcre "^[^(]*\\(([-0-9.]+)\\)" x) x))) (defun debian-version-tag (&optional (version (debian-version))) (first (split-string version :separator "-"))) (defun get-version () (let ((sv (script-version)) (dv (debian-version-tag))) (unless (equal sv dv) (error "version mismatch: cl-launch.sh says ~A whereas the debian/changelog says ~A" sv dv)) sv)) (defun debian-arch () (run/ss `(dpkg --print-architecture))) (defun git-tag (&optional (pattern "4.*")) (with-current-directory ((pn)) (run/ss `(git describe --tags --match ,pattern)))) (defun clean () (with-current-directory ((pn)) (run '(git clean -xfd))) (success)) (defun debian-package () (let* ((debian-version (debian-version)) (version (get-version)) (origtarball (pn (strcat "../cl-launch_" version ".orig.tar.gz"))) (home (user-homedir-pathname)) (cl-launch-version (strcat "cl-launch-" version)) (cldir (subpathname home "files/cl-launch/"))) (check-manual) (with-current-directory ((pn)) (run `(pwd) :show t) (clean) (delete-file-if-exists origtarball) (run `(git-buildpackage --git-debian-branch=master --git-upstream-branch=master (--git-upstream-tag= ,version) --git-tag --git-retag --git-ignore-branch) :show t) (run `(lintian --dont-check-part standards-version --fail-on-warnings --profile debian (../cl-launch_ ,debian-version _ ,(debian-arch) .changes)) :show t) (clean) (run `(pwd) :show t) (run `(./cl-launch.sh --include "." "-B" install_path) :show t) (run `(./cl-launch.sh --no-include -o cl-launch "-B" install_bin) :show t) (run `(cp ./cl-launch.sh (,cldir cl-launch.sh)) :show t)) (with-current-directory ((pn "../")) (run `(pwd) :show t) (run `(rm -f ,cl-launch-version) :show t) (run `(ln -s cl-launch ,cl-launch-version) :show t) (run `(tar zcfh (,cldir ,cl-launch-version .tar.gz) --exclude .git (,cl-launch-version /)) :show t) (run `(mv ,@(directory (merge-pathnames* (strcat "cl-launch_" version "*.*") (pn "../"))) ,cldir) :show t) (run `(rm -f ,cl-launch-version) :show t)) (with-current-directory (cldir) (run `(pwd) :show t) (run/interactive `(gpg -b -a (cl-launch- ,version .tar.gz)) :show t) (run `(ln -sf (,cl-launch-version .tar.gz) cl-launch.tar.gz) :show t) (run `(ln -sf (,cl-launch-version .tar.gz.asc) cl-launch.tar.gz.asc) :show t))) (success)) (defun publish-debian-package () (let* ((debian-version (debian-version)) (home (user-homedir-pathname)) (cldir (subpathname home "files/cl-launch/"))) (with-current-directory (cldir) (run `(dput mentors (cl-launch_ ,debian-version _ ,(debian-arch) .changes)) :show t) (run `(rsync -av --delete ,cldir "common-lisp.net:/project/xcvb/public_html/cl-launch/") :show t))) (success)) (defun source () (with-current-directory ((pn)) (run `(./cl-launch.sh --include ,(getcwd) "-B" install_path))) (success)) (defparameter *months* #("January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December")) (defun get-date-from-manual () ;; Note: we don't put the date there anymore. (with-current-directory ((pn)) (match (first (run/lines `(./cl-launch.sh --help))) ((ppcre "\"[(]([A-Z][a-z]+) ([0-9]+)[)]\"" month year) (if-let (pos (position month *months* :test 'equal)) (list (parse-integer year) (1+ pos)) (error "Invalid month ~a" month))) (_ (error "Can't extract month from manual"))))) (defun get-date-from-git (&optional tag) (with-current-directory ((pn)) (match (first (run/lines `(git log -1 "--pretty=format:%cI" ,tag))) ((ppcre "^([0-9]+)-([0-9]+)-([0-9]+)T" year month day) (list (parse-integer year) (parse-integer month) (parse-integer day)))))) (defun check-manual-git-dates-match () (let ((date-from-manual (get-date-from-manual)) (date-from-git (subseq (get-date-from-git) 0 2))) (assert (equal date-from-manual date-from-git) () "Manual says it's from ~{~D-~2,'0D~} but git commit is from ~{~D-~2,'0D~}" date-from-manual date-from-git)) (success)) (defun manpage () ;;(check-manual-git-dates-match) (with-current-directory ((pn)) (run `(ln -sf cl-launch.sh cl)) (run `(env ("PATH=.:" ,(getenv "PATH")) cl --more-help (> cl-launch.1.md))) (run `(ronn "--roff" "--manual=Shell Scripting with Common Lisp" "--organization=Francois-Rene Rideau" ,(format nil "--date=~{~D-~2,'0D-~2,'0D~}" (get-date-from-git)) cl-launch.1.md (> 2 /dev/null)))) (success)) (defun check-manual () ;;(check-manual-git-dates-match) (manpage) (with-current-directory ((pn)) (run `(cmp ./cl-launch.1 ./debian/cl-launch.1))) (success)) (defun quickrelease () (let* ((version (script-version)) ;; no need to compare with the debian version (link (strcat "cl-launch-" version)) (tarball (strcat link ".tar.gz"))) (check-manual) (with-current-directory ((pn)) (clean) (source)) (with-current-directory ((pn "../")) (run `(pwd) :show t) (run `(rm -f ,link)) (run `(ln -s cl-launch ,link)) (run `(tar zcfh ,tarball --exclude .git ,link)) (run `(rsync -av cl-launch/cl-launch.sh ,tarball "common-lisp.net:/project/xcvb/public_html/cl-launch/")) (run `(ssh common-lisp.net ln -sf ,tarball /project/xcvb/public_html/cl-launch/cl-launch.tar.gz)) (run `(rm -f ,link ,tarball)))) (success)) (defun debian-package-all () (debian-package) (publish-debian-package)) (defun valid-commands () (sort (while-collecting (c) (do-external-symbols (x :cl-launch/release) (c x))) #'string<)) (register-commands :cl-launch/release)