[clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1106-146-gbbeaf00
Philippe Brochard
pbrochard at common-lisp.net
Sun Oct 21 19:47:20 UTC 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CLFSWM - A(nother) Common Lisp FullScreen Window Manager".
The branch, master has been updated
via bbeaf00f5535328546f506995e429bb791050542 (commit)
from b317f0fde0d41f049d76ecbc0fb3fb4c7aaff299 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bbeaf00f5535328546f506995e429bb791050542
Author: Philippe Brochard <pbrochard at common-lisp.net>
Date: Sun Oct 21 21:46:54 2012 +0200
load.lisp can download ASDF and CLX if needed
diff --git a/contrib/wallpaper.lisp b/contrib/wallpaper.lisp
index cccb982..8ffa75f 100644
--- a/contrib/wallpaper.lisp
+++ b/contrib/wallpaper.lisp
@@ -67,10 +67,8 @@
(setf ind (if (< ind len) (1+ ind) 0))))
(format str "~A" filename))))
(format t "~A~%" command)
- (let ((output (do-shell command nil t)))
- (loop for line = (read-line output nil nil)
- while line
- do (format t "~A~%" line)))))
+ (do-shell-output command)))
+
(defun create-wallpaper (filename &rest images)
(format t "Creating wallpaper ~A from ~{~A ~}~%" filename images)
diff --git a/load.lisp b/load.lisp
index 2ab8436..916f8c2 100644
--- a/load.lisp
+++ b/load.lisp
@@ -22,26 +22,33 @@
;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
;;;
;;; --------------------------------------------------------------------------
+;;;
+;;; Edit this file (or its copy) and load it with your lisp implementation.
+;;; If you want, it can download ASDF and CLX for you. You'll need wget and
+;;; git program.
+;;;
+;;; Here are command line reference:
+;;;
+;;; clisp -E iso-8859-1 load.lisp
+;;; sbcl --load load.lisp
+;;; cmucl -load load.lisp
+;;; ccl -l load.lisp
+;;; ecl -load load.lisp
+;;;
+;;; --------------------------------------------------------------------------
;;;------------------
;;; Customization part
;;;------------------
+(defparameter *interactive* t)
+
+;;; Comment or uncomment the lines above to fit your needs.
(pushnew :clfswm-compile *features*)
(pushnew :clfswm-run *features*)
(pushnew :clfswm-build-image *features*)
-
;;(pushnew :clfswm-install *features*)
-
-;;;;;; Uncomment lines above to build the default documentation.
;;(pushnew :clfswm-build-doc *features*)
-;;;;; Uncomment the line below if you want to see all ignored X errors
-;;(pushnew :xlib-debug *features*)
-
-;;;;; Uncomment the line below if you want to see all event debug messages
-;;(pushnew :event-debug *features*)
-
-
(defparameter *binary-name* "clfswm")
(defparameter *install-prefix* "/tmp/usr/local")
@@ -55,9 +62,29 @@
(defparameter *install-man* (with-prefix "/share/man/man1/"))
+;;;;; Uncomment the line below if you want to see all ignored X errors
+;;(pushnew :xlib-debug *features*)
+
+;;;;; Uncomment the line below if you want to see all event debug messages
+;;(pushnew :event-debug *features*)
+
+
#+:CMU (setf ext:*gc-verbose* nil)
+#+:SBCL
+(require :sb-posix)
+
+(load (compile-file "src/tools.lisp"))
+
+(defun load-info (formatter &rest args)
+ (format t "~& ==> ~A~%" (apply #'format nil formatter args))
+ (force-output))
+
+(defun interactive-ask (formatter &rest args)
+ (when *interactive*
+ (y-or-n-p (apply #'format nil formatter args))))
+
;;;------------------
;;; XLib part 1
;;;------------------
@@ -69,26 +96,54 @@
;;; ASDF part
;;;------------------
;;;; Loading ASDF
+(load-info "Requiring ASDF")
+
#+(or :SBCL :CMUCL :CCL :ECL)
(require :asdf)
+#-ASDF
+(when (probe-file "asdf.lisp")
+ (load "asdf.lisp"))
+
#-:ASDF
-(load "contrib/asdf.lisp")
+(let ((asdf-url "http://common-lisp.net/project/asdf/asdf.lisp"))
+ (when (interactive-ask "ASDF not found. Do you want to download it from ~A ?" asdf-url)
+ (tools:do-shell-output "wget ~A" asdf-url)
+ (load "asdf.lisp")))
+(format t "ASDF version: ~A~%" (asdf:asdf-version))
;;;------------------
;;; XLib part 2
;;;------------------
+(load-info "Requiring CLX")
+
;;; Loading clisp dynamic module. This part needs clisp >= 2.50
;;#+(AND CLISP (not CLX))
;;(when (fboundp 'require)
;; (require "clx.lisp"))
+#-CLX
+(progn
+ (when (probe-file "clx/clx.asd")
+ (load "clx/clx.asd")
+ (asdf:oos 'asdf:load-op :clx)))
+
+#-CLX
+(progn
+ (let ((clx-url "git://github.com/sharplispers/clx.git"))
+ (when (interactive-ask "CLX not found. Do you want to download it from ~A ?" clx-url)
+ (unless (probe-file "clx/clx.asd")
+ (tools:do-shell-output "git clone ~A" clx-url))
+ (load "clx/clx.asd")
+ (asdf:oos 'asdf:load-op :clx))))
;;;------------------
;;; CLFSWM loading
;;;------------------
#+:clfswm-compile
-(asdf:oos 'asdf:load-op :clfswm)
+(progn
+ (load-info "Compiling CLFSWM")
+ (asdf:oos 'asdf:load-op :clfswm))
;;;-------------------------
@@ -98,21 +153,27 @@
(in-package :clfswm)
#+:clfswm-run
-(ignore-errors
- (main :read-conf-file-p t))
+(progn
+ (cl-user::load-info "Running CLFSWM")
+ (ignore-errors
+ (main :read-conf-file-p t)))
;;;-------------------------
;;; Building documentation
;;;-------------------------
#+:clfswm-build-doc
-(produce-all-docs)
+(progn
+ (cl-user::load-info "Building documentation")
+ (produce-all-docs))
;;;-----------------------
;;; Building image part
;;;-----------------------
#+:clfswm-build-image
-(build-lisp-image "clfswm")
+(progn
+ (cl-user::load-info "Building CLFSWM executable image")
+ (build-lisp-image "clfswm"))
;;;-----------------------
;;; Installation part
@@ -120,12 +181,6 @@
#+:clfswm-install
(in-package :cl-user)
-#+:SBCL
-(require :sb-posix)
-
-#+:clfswm-install
-(load (compile-file "src/tools.lisp"))
-
#+:clfswm-install
(defun check-directory (dir)
(format t "Checking ~A~%" dir)
@@ -134,13 +189,14 @@
#+:clfswm-install
(defun move-file (file where)
- (format t "cp -R ~A ~A~%" file where)
- (tools:fdo-shell "cp -R ~A ~A" file where))
+ (format t "cp -Rf ~A ~A~%" file where)
+ (tools:do-shell-output "cp -Rf ~A ~A" file where))
#+:clfswm-install
(progn
+ (load-info "Installing CLFSWM")
(check-directory *install-prefix*)
(check-directory *install-bin*)
(check-directory *install-contrib*)
@@ -152,7 +208,6 @@
(move-file "clfswm.1" *install-man*)
(format t "Please, adjust *contrib-dir* variable to ~A in your configuration file.~%" *install-contrib*)
(format t "Something like: (setf *contrib-dir* ~S)~%" *install-contrib*)
- (sleep 0.5)
- (tools:fdo-shell "rm -f ~A/clfswm.1.gz && gzip ~A/clfswm.1" *install-man* *install-man*)
+ (tools:do-shell-output "rm -f ~A/clfswm.1.gz && gzip ~A/clfswm.1" *install-man* *install-man*)
(tools:uquit))
diff --git a/src/tools.lisp b/src/tools.lisp
index 85252b8..f3920f7 100644
--- a/src/tools.lisp
+++ b/src/tools.lisp
@@ -95,7 +95,7 @@
:date-string
:write-backtrace
:do-execute
- :do-shell :fdo-shell
+ :do-shell :fdo-shell :do-shell-output
:getenv
:uquit
:urun-prog
@@ -730,7 +730,11 @@ of the program to return.
(defun fdo-shell (formatter &rest args)
(do-shell (apply #'format nil formatter args)))
-
+(defun do-shell-output (formatter &rest args)
+ (let ((output (do-shell (apply #'format nil formatter args) nil t)))
+ (loop for line = (read-line output nil nil)
+ while line
+ collect line)))
-----------------------------------------------------------------------
Summary of changes:
contrib/wallpaper.lisp | 6 +--
load.lisp | 107 ++++++++++++++++++++++++++++++++++++------------
src/tools.lisp | 8 +++-
3 files changed, 89 insertions(+), 32 deletions(-)
hooks/post-receive
--
CLFSWM - A(nother) Common Lisp FullScreen Window Manager
More information about the clfswm-cvs
mailing list