File: system.lisp

package info (click to toggle)
cedilla 0.6-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 812 kB
  • ctags: 308
  • sloc: lisp: 3,716; makefile: 50; sh: 13
file content (72 lines) | stat: -rw-r--r-- 3,111 bytes parent folder | download | duplicates (2)
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
;;; This file is part of Cedilla.
;;; Copyright (C) 2002 by Juliusz Chroboczek.

;;; 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 2 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.

(in-package "CL-USER")

(load "package.lisp")

(defparameter *cedilla-sources*
  '("package.lisp" "macros.lisp" "struct.lisp" "generics.lisp"
    "unicode.lisp" "data.lisp" "data-add.lisp"
    "afm.lisp" "resources.lisp" "typeset.lisp"
    "glyphs.lisp" "ps.lisp" "encodings.lisp" "magic.lisp"
    "named-font.lisp" "fixed-font.lisp" "space-font.lisp" "built-in-font.lisp"
    "transformed.lisp"
    "cedilla.lisp"))

(defun compile-cedilla ()
  (mapc #'(lambda (filename) (load (compile-file filename)
                                   :verbose nil))
        *cedilla-sources*)
  (load "cedilla-config.lisp"))

(defun load-cedilla ()
  (mapc #'(lambda (filename) (load (compile-file-pathname filename)
                                   :verbose nil))
        *cedilla-sources*)
  (load "cedilla-config.lisp"))

(defun make-cedilla-binary (clisp binary installer bindir libdir etcdir mandir)
  (labels ((dir (s) (if (eql #\/ (aref s (- (length s) 1)))
                        s 
                        (concatenate 'string s "/")))
           (make-dir (dir out) (format out "mkdir -p \"$TARGET\"'~A'~%"
                                       (dir dir)))
           (target (file dir) 
             (make-pathname :defaults (pathname file)
                            :directory (pathname (dir dir))))
           (install (file dir out &optional executable (name file))
             (format out "cp -f '~A' \"$TARGET\"'~A'~%" file (target name dir))
             (when executable
               (format out "chmod +x \"$TARGET\"'~A'~%" (target name dir)))))
    (with-open-file (out binary :direction :output)
      (format out "#!~A -ansi -q~%" clisp)
      (format out ";;; Automatically generated file -- do not modify.~%")
      (print '(setq *load-verbose*  nil) out)
      (dolist (f *cedilla-sources*)
        (print `(load ,(target (compile-file-pathname f) libdir)) out))
      (print `(load ,(target "cedilla-config.lisp" etcdir)) out)
      (print `(cedilla:cedilla-main) out)
      (fresh-line out))
    (with-open-file (out installer :direction :output)
      (format out "#!/bin/sh~%")
      (format out "# Automatically generated file -- do not modify.~%")
      (make-dir bindir out)
      (make-dir libdir out)
      (make-dir etcdir out)
      (dolist (f *cedilla-sources*)
        (install (compile-file-pathname f) libdir out))
      (install "cedilla-config.lisp" etcdir out)
      (install "cedilla.man" mandir out nil "cedilla.1")
      (install "cedilla" bindir out t)
      (fresh-line out))))