From f0a76b738a136b9298576820a241dc11cd6aebeb Mon Sep 17 00:00:00 2001 From: Philippe Brochard Date: Sun, 12 Sep 2010 23:16:16 +0200 Subject: [PATCH] contrib/clfswm: Add support to cmucl, ccl and ecl. --- ChangeLog | 4 +++ contrib/clfswm | 69 ++++++++++++++++++++++++++++++++++++------- src/bindings-second-mode.lisp | 4 +-- src/clfswm-util.lisp | 2 +- 4 files changed, 65 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a8f51a..4b3e1db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-09-12 Philippe Brochard + + * contrib/clfswm: Add support to cmucl, ccl and ecl. + 2010-09-11 Philippe Brochard * src/clfswm-util.lisp (set-hide-unmanaged-window) diff --git a/contrib/clfswm b/contrib/clfswm index 6f25140..f04f076 100755 --- a/contrib/clfswm +++ b/contrib/clfswm @@ -31,6 +31,15 @@ # delete the image and restart your X session. # -------------------------------------------------------------------------- + +no_start=no +lisp=clisp +lisp_opt='' +dump_path="$XDG_CACHE_HOME/clfswm/" +asdf_path="$(pwd)/contrib" +clfswm_asd_path="$(pwd)" + + usage() { echo "$0 [options] @@ -38,8 +47,9 @@ usage() { n,no-start don't start CLFSWM after image dump f,force force image dump rebuild same as -f,--force -l,with-lisp= use as the common lisp implementation -d,dump-path= path to the dump directory +l,with-lisp use as the common lisp implementation [$lisp] +o,lisp-opt use as lisp option +d,dump-path path to the dump directory [\$XDG_CACHE_HOME=$XDG_CACHE_HOME] with-clfswm path to clfswm.asd file with-asdf path to the asdf.lisp file" @@ -53,21 +63,46 @@ die() { build_clisp () { - clisp -m 8MB -E ISO-8859-1 -q -K full -i $asdf_path/asdf.lisp -x "(asdf:oos 'asdf:load-op :clfswm)\ - (EXT:SAVEINITMEM \"$dump_image\" :INIT-FUNCTION 'clfswm:main :EXECUTABLE t :norc t)" + clisp $lisp_opt -m 8MB -E ISO-8859-1 -q -i $asdf_path/asdf.lisp -x "(load \"$clfswm_asd_path/clfswm.asd\") + (asdf:oos 'asdf:load-op :clfswm) \ + (EXT:SAVEINITMEM \"$dump_image\" :INIT-FUNCTION (lambda () (clfswm:main) (quit)) :EXECUTABLE t :norc t)" } build_sbcl() { - sbcl --disable-debugger --eval "(mapc 'require '(asdf clfswm))" \ + sbcl $lisp_opt --disable-debugger --eval "(require :asdf)" \ + --eval "(load \"$clfswm_asd_path/clfswm.asd\")" \ + --eval "(require :clfswm)" \ --eval "(save-lisp-and-die \"$dump_image\" :toplevel 'clfswm:main)" } -no_start=no -lisp=clisp -dump_path=$HOME/var/cache -asdf_path=$HOME/usr/src/SVNed/clfswm -clfswm_asd_path=$HOME/usr/share/common-lisp/systems +build_cmucl() +{ + cmucl $lisp_opt -eval "(load \"$asdf_path/asdf.lisp\")" \ + -eval "(load \"$clfswm_asd_path/clfswm.asd\")" \ + -eval "(require :clx)" \ + -eval "(asdf:oos 'asdf:load-op :clfswm)" \ + -eval "(save-lisp \"$dump_image\" :init-function (lambda () (clfswm:main) (quit)))" +} + +build_ccl() +{ + ccl $lisp_opt --eval "(require :asdf)" \ + --eval "(load \"$clfswm_asd_path/clfswm.asd\")" \ + --eval "(asdf:oos 'asdf:load-op :clfswm)" \ + --eval "(save-application \"$dump_image\" :toplevel-function (lambda () (clfswm:main) (quit)))" +} + +build_ecl() +{ + ecl $lisp_opt -eval "(require :asdf)" \ + -eval "(load \"$clfswm_asd_path/clfswm.asd\")" \ + -eval "(asdf:make-build :clfswm :type :program :monolithic t :move-here \".\" :prologue-code '(progn (require :asdf) (require :clx)))" \ + -eval "(ext:quit 0)" + mv ./clfswm-mono $dump_image + echo $dump_image +} + while test $# != 0 do @@ -90,10 +125,13 @@ do case "$1" in '') usage;; - clisp|sbcl) + clisp|sbcl|cmucl|ccl|ecl) lisp="$1" ;; esac ;; + -o|--lisp-opt) + shift + lisp_opt="$1" ;; --) shift break ;; @@ -121,15 +159,24 @@ then test -e $clfswm_asd_path/clfswm.asd || die "can't find clfswm.asd in $clfswm_asd_path" test -e $asdf_path/asdf.lisp || die "can't find asdf.lisp in $asdf_path" + mkdir -p "$dump_path" + mkdir -p "$dump_path/contrib" eval build_$lisp + rm -rf "$dump_path/contrib" + cp -R "$clfswm_asd_path/contrib/" "$dump_path/" + rm -rf $(find "$dump_path/" -name "*svn") fi # Run the resulting image if test no = "$no_start" then + cd $dump_path case $lisp in clisp ) $dump_image ;; sbcl ) exec sbcl --core "$dump_image" ;; + cmucl ) exec cmucl -core "$dump_image" ;; + ccl ) exec ccl -I "$dump_image" ;; + ecl ) $dump_image -eval "(progn (clfswm:main) (ext:quit 0))" ;; *) echo "..." ;; esac else diff --git a/src/bindings-second-mode.lisp b/src/bindings-second-mode.lisp index 678e5f9..336fb3d 100644 --- a/src/bindings-second-mode.lisp +++ b/src/bindings-second-mode.lisp @@ -129,8 +129,8 @@ (define-second-key ("v" :control :shift) 'paste-selection-no-clear) (define-second-key ("Delete" :control) 'remove-current-child) (define-second-key ("Delete") 'delete-current-child) - (define-shell (#\c) b-start-xterm "start an xterm" "exec xterm") - (define-shell (#\e) b-start-emacs "start emacs" "exec emacs") + (define-shell (#\c) b-start-xterm "start an xterm" "cd $HOME && exec xterm") + (define-shell (#\e) b-start-emacs "start emacs" "cd $HOME && exec emacs") (define-shell (#\e :control) b-start-emacsremote "start an emacs for another user" "exec xterm -e emacsremote") diff --git a/src/clfswm-util.lisp b/src/clfswm-util.lisp index 24b27eb..8db4c9f 100644 --- a/src/clfswm-util.lisp +++ b/src/clfswm-util.lisp @@ -355,7 +355,7 @@ (multiple-value-bind (program return) (query-string "Run:") (when (and (equal return :return) program (not (equal program ""))) - (setf *second-mode-program* program) + (setf *second-mode-program* (concatenate 'string "cd $HOME && " program)) (leave-second-mode)))) -- 2.11.4.GIT