[clfswm-cvs] r324 - in clfswm: . contrib src

Philippe Brochard pbrochard at common-lisp.net
Sun Sep 12 21:15:31 UTC 2010


Author: pbrochard
Date: Sun Sep 12 17:15:31 2010
New Revision: 324

Log:
contrib/clfswm: Add support to cmucl, ccl and ecl.

Modified:
   clfswm/ChangeLog
   clfswm/contrib/clfswm
   clfswm/src/bindings-second-mode.lisp
   clfswm/src/clfswm-util.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sun Sep 12 17:15:31 2010
@@ -1,3 +1,7 @@
+2010-09-12  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* contrib/clfswm: Add support to cmucl, ccl and ecl.
+
 2010-09-11  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-util.lisp (set-hide-unmanaged-window)

Modified: clfswm/contrib/clfswm
==============================================================================
--- clfswm/contrib/clfswm	(original)
+++ clfswm/contrib/clfswm	Sun Sep 12 17:15:31 2010
@@ -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 @@
 n,no-start           don't start CLFSWM after image dump
 f,force              force image dump
 rebuild              same as -f,--force
-l,with-lisp=         use <lisp> as the common lisp implementation
-d,dump-path=         path to the dump directory
+l,with-lisp          use <lisp> as the common lisp implementation [$lisp]
+o,lisp-opt           use <opt> 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 @@
 
 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 @@
 	    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 @@
     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

Modified: clfswm/src/bindings-second-mode.lisp
==============================================================================
--- clfswm/src/bindings-second-mode.lisp	(original)
+++ clfswm/src/bindings-second-mode.lisp	Sun Sep 12 17:15:31 2010
@@ -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")

Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp	(original)
+++ clfswm/src/clfswm-util.lisp	Sun Sep 12 17:15:31 2010
@@ -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))))
 
 




More information about the clfswm-cvs mailing list