5 (cons (if (featurep 'xemacs)
21 ;; riece-identity -+-> riece-channel
30 ;; riece-layout ---> riece-display
35 ;; riece-channel -+-> riece-naming
40 ;; riece-filter calls riece-{handle,000,200,300,400,500}
53 (defvar riece-mcat-modules
54 '(riece-mcat-japanese))
56 (defvar riece-generated-modules
57 '(riece-package-info))
60 '("riece-command-previous-channel.xpm"
61 "riece-command-next-channel.xpm"
62 "riece-command-configure-windows.xpm"
63 "riece-command-list-addons.xpm"
64 "riece-command-join.xpm"
65 "riece-command-part.xpm"))
71 (defun riece-byte-compile-dest-file-function (filename)
73 (concat (file-name-nondirectory filename) "c")))
75 (defun riece-compile-modules (modules srcdir)
76 (let ((load-path (cons nil (cons srcdir load-path)))
79 (let ((source (expand-file-name
80 (concat (symbol-name (car modules)) ".el")
82 (binary (expand-file-name
83 (concat (symbol-name (car modules)) ".elc"))))
84 (if (file-newer-than-file-p source binary)
86 (let ((byte-compile-dest-file-function
87 #'riece-byte-compile-dest-file-function))
88 (byte-compile-file source))
90 (setq error-modules (cons (car modules) error-modules))))))
91 (setq modules (cdr modules)))
94 WARNING: ---------------------------------------------------------
95 WARNING: Couldn't compile following modules:
97 WARNING: " (mapconcat #'symbol-name error-modules ", ") "\n\
99 WARNING: You should probably stop here, try \"make distclean\" to clear
100 WARNING: the last build, and then reconfigure.
101 WARNING: ---------------------------------------------------------\n\n")))))
103 (defun riece-compile-module ()
104 (let ((load-path (cons nil load-path)))
105 (let ((source (expand-file-name
106 (concat (car command-line-args-left) ".el"))))
107 (if (file-newer-than-file-p source (concat source "c"))
108 (byte-compile-file source))))
109 ;; Workaround for an XEmacs 21.5 bug ("xemacs -batch -f <func> <arg1>"
110 ;; attempts to open <arg1> as a file after <func>).
111 (setq command-line-args-left (cdr command-line-args-left)))
113 (defun riece-install-modules (modules srcdir lispdir just-print)
114 (unless (or just-print (file-exists-p lispdir))
115 (make-directory lispdir t))
116 ;; Workaround for "make distcheck"
117 (set-file-modes lispdir 493)
119 (let ((name (symbol-name (car modules))))
120 (princ (format "%s.el -> %s\n" name lispdir))
122 (copy-file (expand-file-name
124 (if (memq (car modules) riece-generated-modules)
127 (expand-file-name (concat name ".el") lispdir)
129 (princ (format "%s.elc -> %s\n" name lispdir))
131 (if (file-exists-p (expand-file-name (concat name ".elc")))
132 (copy-file (expand-file-name (concat name ".elc"))
133 (expand-file-name (concat name ".elc") lispdir)
135 (princ (format "(%s was not successfully compiled, ignored)\n"
137 (setq modules (cdr modules))))
139 (defun riece-install-icons (icons srcdir lispdir just-print)
140 (unless (or just-print (file-exists-p lispdir))
141 (make-directory lispdir t))
142 ;; Workaround for "make distcheck"
143 (set-file-modes lispdir 493)
145 (when (file-exists-p (expand-file-name (car icons) srcdir))
146 (princ (format "%s -> %s\n" (car icons) lispdir))
148 (copy-file (expand-file-name (car icons) srcdir)
149 (expand-file-name (car icons) lispdir)
151 (setq icons (cdr icons))))
153 (defun riece-install-scripts (scripts srcdir lispdir just-print)
154 (unless (or just-print (file-exists-p lispdir))
155 (make-directory lispdir t))
156 ;; Workaround for "make distcheck"
157 (set-file-modes lispdir 493)
159 (when (file-exists-p (expand-file-name (car scripts) srcdir))
160 (princ (format "%s -> %s\n" (car scripts) lispdir))
162 (copy-file (expand-file-name (car scripts) srcdir)
163 (expand-file-name (car scripts) lispdir)
165 (setq scripts (cdr scripts))))
167 (defun riece-install-just-print-p ()
168 (let ((flag (getenv "MAKEFLAGS"))
171 (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag))))
173 (defun riece-examine-modules (srcdir)
174 (let ((load-path (cons nil (cons srcdir load-path))))
175 (require 'riece-mcat)
176 (require 'riece-addon-modules)
177 (append riece-modules
179 (mapcar #'car riece-addon-modules))))
181 (defun riece-examine ()
182 (princ (mapconcat #'symbol-name
183 (riece-examine-modules (car command-line-args-left))
186 (defun riece-update-mcat ()
187 (let* ((srcdir (car command-line-args-left))
188 (modules (riece-examine-modules srcdir))
189 (pointer riece-mcat-modules)
192 (setq modules (delq (car pointer) modules)
193 pointer (cdr pointer)))
194 (setq files (mapcar (lambda (module)
195 (concat (symbol-name module) ".el"))
197 pointer riece-mcat-modules)
199 (riece-mcat-update files (concat (symbol-name (car pointer)) ".el")
200 (intern (concat (symbol-name (car pointer))
202 (setq pointer (cdr pointer))))
203 ;; Workaround for an XEmacs 21.5 bug ("xemacs -batch -f <func> <arg1>"
204 ;; attempts to open <arg1> as a file after <func>).
205 (setq command-line-args-left (cdr command-line-args-left)))
207 (defun riece-compile ()
208 (let ((srcdir (car command-line-args-left)))
209 (setq command-line-args-left (cdr command-line-args-left))
210 (riece-compile-modules (riece-examine-modules srcdir) srcdir))
211 ;; Workaround for an XEmacs 21.5 bug ("xemacs -batch -f <func> <arg1>"
212 ;; attempts to open <arg1> as a file after <func>).
213 (setq command-line-args-left (cdr command-line-args-left)))
215 (defun riece-install ()
216 (let ((srcdir (car command-line-args-left))
217 (lispdir (nth 1 command-line-args-left)))
218 (riece-install-modules
219 (riece-examine-modules srcdir)
221 (expand-file-name "riece" lispdir)
222 (riece-install-just-print-p))
226 (expand-file-name "riece" lispdir)
227 (riece-install-just-print-p))
228 (riece-install-scripts
231 (expand-file-name "riece" lispdir)
232 (riece-install-just-print-p))
233 ;; Workaround for an XEmacs 21.5 bug ("xemacs -batch -f <func> <arg1>"
234 ;; attempts to open <arg1> as a file after <func>).
235 (setq command-line-args-left (nthcdr 2 command-line-args-left))))
237 (defun riece-uninstall ()
238 (let ((files (directory-files (expand-file-name "riece"
239 (car command-line-args-left))
240 t "\\.\\(elc?\\|rb\\|xpm\\)$")))
242 (delete-file (car files))
243 (setq files (cdr files)))
244 ;; Workaround for an XEmacs 21.5 bug ("xemacs -batch -f <func> <arg1>"
245 ;; attempts to open <arg1> as a file after <func>).
246 (setq command-line-args-left (cdr command-line-args-left))))
248 (defun riece-compile-package ()
249 (let ((srcdir (car command-line-args-left)))
250 (setq command-line-args-left (cdr command-line-args-left))
251 (if (fboundp 'batch-update-directory-autoloads)
252 (let ((command-line-args-left (list "riece" srcdir)))
253 (batch-update-directory-autoloads))
254 (let ((command-line-args-left (list srcdir)))
255 (setq autoload-package-name "riece")
256 (batch-update-autoloads)))
257 (let ((command-line-args-left (list srcdir)))
258 (Custom-make-dependencies))
259 (riece-compile-modules
260 (append (riece-examine-modules srcdir)
261 '(auto-autoloads custom-load))
264 (defun riece-install-package ()
265 (let ((srcdir (car command-line-args-left)))
266 (setq command-line-args-left (cdr command-line-args-left))
267 (riece-install-modules
268 (append (riece-examine-modules srcdir)
269 '(auto-autoloads custom-load))
271 (expand-file-name "lisp/riece" (car command-line-args-left))
272 (riece-install-just-print-p))
276 (expand-file-name "etc/riece" (car command-line-args-left))
277 (riece-install-just-print-p))
278 (riece-install-scripts
281 (expand-file-name "etc/riece" (car command-line-args-left))
282 (riece-install-just-print-p))))
285 (let* ((srcdir (car command-line-args-left))
286 (load-path (cons (expand-file-name "test" srcdir)
287 (cons srcdir (cons nil load-path))))
288 (files (directory-files (expand-file-name "test" srcdir) t
291 (require 'lunit-report)
292 (setq suite (lunit-make-test-suite))
294 (when (file-regular-p (car files))
295 (load-file (car files))
296 (lunit-test-suite-add-test
298 (lunit-make-test-suite-from-class
299 (intern (file-name-sans-extension
300 (file-name-nondirectory (car files)))))))
301 (setq files (cdr files)))
302 (lunit-report suite (nth 1 command-line-args-left))))