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)))))
110 (defun riece-install-modules (modules srcdir lispdir just-print)
111 (unless (or just-print (file-exists-p lispdir))
112 (make-directory lispdir t))
113 ;; Workaround for "make distcheck"
114 (set-file-modes lispdir 493)
116 (let ((name (symbol-name (car modules))))
117 (princ (format "%s.el -> %s\n" name lispdir))
119 (copy-file (expand-file-name
121 (if (memq (car modules) riece-generated-modules)
124 (expand-file-name (concat name ".el") lispdir)
126 (princ (format "%s.elc -> %s\n" name lispdir))
128 (if (file-exists-p (expand-file-name (concat name ".elc")))
129 (copy-file (expand-file-name (concat name ".elc"))
130 (expand-file-name (concat name ".elc") lispdir)
132 (princ (format "(%s was not successfully compiled, ignored)\n"
134 (setq modules (cdr modules))))
136 (defun riece-install-icons (icons srcdir lispdir just-print)
137 (unless (or just-print (file-exists-p lispdir))
138 (make-directory lispdir t))
139 ;; Workaround for "make distcheck"
140 (set-file-modes lispdir 493)
142 (when (file-exists-p (expand-file-name (car icons) srcdir))
143 (princ (format "%s -> %s\n" (car icons) lispdir))
145 (copy-file (expand-file-name (car icons) srcdir)
146 (expand-file-name (car icons) lispdir)
148 (setq icons (cdr icons))))
150 (defun riece-install-scripts (scripts srcdir lispdir just-print)
151 (unless (or just-print (file-exists-p lispdir))
152 (make-directory lispdir t))
153 ;; Workaround for "make distcheck"
154 (set-file-modes lispdir 493)
156 (when (file-exists-p (expand-file-name (car scripts) srcdir))
157 (princ (format "%s -> %s\n" (car scripts) lispdir))
159 (copy-file (expand-file-name (car scripts) srcdir)
160 (expand-file-name (car scripts) lispdir)
162 (setq scripts (cdr scripts))))
164 (defun riece-install-just-print-p ()
165 (let ((flag (getenv "MAKEFLAGS"))
168 (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag))))
170 (defun riece-examine-modules (srcdir)
171 (let ((load-path (cons nil (cons srcdir load-path))))
172 (require 'riece-mcat)
173 (require 'riece-addon-modules)
174 (append riece-modules
176 (mapcar #'car riece-addon-modules))))
178 (defun riece-examine ()
179 (princ (mapconcat #'symbol-name
180 (riece-examine-modules (car command-line-args-left))
183 (defun riece-update-mcat ()
184 (let* ((srcdir (car command-line-args-left))
185 (modules (riece-examine-modules srcdir))
186 (pointer riece-mcat-modules)
189 (setq modules (delq (car pointer) modules)
190 pointer (cdr pointer)))
191 (setq files (mapcar (lambda (module)
192 (concat (symbol-name module) ".el"))
194 pointer riece-mcat-modules)
196 (riece-mcat-update files (concat (symbol-name (car pointer)) ".el")
197 (intern (concat (symbol-name (car pointer))
199 (setq pointer (cdr pointer)))))
201 (defun riece-compile ()
202 (let ((srcdir (car command-line-args-left)))
203 (riece-compile-modules (riece-examine-modules srcdir) srcdir)))
205 (defun riece-install ()
206 (let ((srcdir (car command-line-args-left))
207 (lispdir (nth 1 command-line-args-left)))
208 (riece-install-modules
209 (riece-examine-modules srcdir)
211 (expand-file-name "riece" lispdir)
212 (riece-install-just-print-p))
216 (expand-file-name "riece" lispdir)
217 (riece-install-just-print-p))
218 (riece-install-scripts
221 (expand-file-name "riece" lispdir)
222 (riece-install-just-print-p))
223 ;; Workaround for an XEmacs 21.5 bug ("xemacs -batch -f <func> <arg1>"
224 ;; attempts to open <arg1> as a file after <func>).
225 (setq command-line-args-left (nthcdr 2 command-line-args-left))))
227 (defun riece-uninstall ()
228 (let ((files (directory-files (expand-file-name "riece"
229 (car command-line-args-left))
230 t "\\.\\(elc?\\|rb\\|xpm\\)$")))
232 (delete-file (car files))
233 (setq files (cdr files)))
234 ;; Workaround for an XEmacs 21.5 bug ("xemacs -batch -f <func> <arg1>"
235 ;; attempts to open <arg1> as a file after <func>).
236 (setq command-line-args-left (cdr command-line-args-left))))
238 (defun riece-compile-package ()
239 (let ((srcdir (car command-line-args-left)))
240 (setq command-line-args-left (cdr command-line-args-left))
241 (if (fboundp 'batch-update-directory-autoloads)
242 (let ((command-line-args-left (list srcdir "riece")))
243 (batch-update-directory-autoloads))
244 (let ((command-line-args-left (list srcdir)))
245 (setq autoload-package-name "riece")
246 (batch-update-autoloads)))
247 (let ((command-line-args-left (list srcdir)))
248 (Custom-make-dependencies))
249 (riece-compile-modules
250 (append (riece-examine-modules srcdir)
251 '(auto-autoloads custom-load))
254 (defun riece-install-package ()
255 (let ((srcdir (car command-line-args-left)))
256 (setq command-line-args-left (cdr command-line-args-left))
257 (riece-install-modules
258 (append (riece-examine-modules srcdir)
259 '(auto-autoloads custom-load))
261 (expand-file-name "lisp/riece" (car command-line-args-left))
262 (riece-install-just-print-p))
266 (expand-file-name "etc/riece" (car command-line-args-left))
267 (riece-install-just-print-p))
268 (riece-install-scripts
271 (expand-file-name "etc/riece" (car command-line-args-left))
272 (riece-install-just-print-p))))
275 (let* ((srcdir (car command-line-args-left))
276 (load-path (cons (expand-file-name "test" srcdir)
277 (cons srcdir (cons nil load-path))))
278 (files (directory-files (expand-file-name "test" srcdir) t
281 (require 'lunit-report)
282 (setq suite (lunit-make-test-suite))
284 (when (file-regular-p (car files))
285 (load-file (car files))
286 (lunit-test-suite-add-test
288 (lunit-make-test-suite-from-class
289 (intern (file-name-sans-extension
290 (file-name-nondirectory (car files)))))))
291 (setq files (cdr files)))
292 (lunit-report suite (nth 1 command-line-args-left))))