This repository has been archived by the owner on Jan 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
load.lisp
174 lines (141 loc) · 4.87 KB
/
load.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
;;; --------------------------------------------------------------------------
;;; CLFSWM - FullScreen Window Manager
;;;
;;; --------------------------------------------------------------------------
;;; Documentation: System loading functions
;;; --------------------------------------------------------------------------
;;;
;;; (C) 2005-2015 Philippe Brochard <hocwp@free.fr>
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; This program 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. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; 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)
(defparameter *build-original-doc* t
"Set to t to use original configuration or to nil to use your own configuration
from $XDG_CONFIG_HOME/clfswm/clfswmrc")
;;; 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-build-doc *features*)
(defparameter *binary-name* "clfswm")
;;;;; 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
;;;------------------
#+(or :CMU :ECL)
(require :clx)
;;;------------------
;;; 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
(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
(progn
(load-info "Compiling CLFSWM")
(load "clfswm.asd")
(asdf:oos 'asdf:load-op :clfswm))
;;;-------------------------
;;; Starting clfswm
;;;-------------------------
#+(or :clfswm-run :clfswm-build-doc :clfswm-build-image)
(in-package :clfswm)
#+(or :clfswm-run :clfswm-build-doc)
(progn
(cl-user::load-info "Running CLFSWM")
(ignore-errors
(main :read-conf-file-p (not cl-user::*build-original-doc*))))
;;;-------------------------
;;; Building documentation
;;;-------------------------
#+:clfswm-build-doc
(progn
(cl-user::load-info "Building documentation")
(produce-all-docs))
;;;-----------------------
;;; Building image part
;;;-----------------------
;;; Uncomment the line below to set the contrib directory in the image
;; (setf *contrib-dir* "/usr/local/lib/clfswm/")
#+:clfswm-build-image
(progn
(cl-user::load-info "Building CLFSWM executable image")
(build-lisp-image "clfswm"))