-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcm.asd
118 lines (107 loc) · 4.07 KB
/
cm.asd
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
;;; **********************************************************************
;;; Copyright (C) 2005 Heinrich Taube, <taube (at) uiuc (dot) edu>
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the Lisp Lesser Gnu Public License.
;;; See http://www.cliki.net/LLGPL for the text of this agreement.
;;; **********************************************************************
(in-package :cl-user)
(defvar *cm-directory*
(namestring
(truename (make-pathname :name nil :type nil
:defaults *load-truename*))))
#-(or allegro clisp cmu lispworks openmcl sbcl ecl)
(error "Sorry, Common Music does not run in this Lisp.")
(defpackage :common-music-system (:use :cl :asdf))
(in-package :common-music-system)
#|
(defmethod perform :after ((op load-op) cm)
;; add cm feature before loading other systems...
(pushnew :cm *features*)
;; load site init file if it exists
(load (merge-pathnames "cminit.lisp" (cm-directory "etc"))
:if-does-not-exist nil)
;; load user init file if it exists
(format t "perform-after ")
(load (merge-pathnames ".cminit.lisp" (user-homedir-pathname))
:if-does-not-exist nil))
|#
;;;
;;; system definition
;;;
(defsystem :cm
:description "Common Music"
:version "2.12.0"
:author "Rick Taube <taube (at) uiuc.edu>"
:licence "LLGPL"
:depends-on (:alexandria #+sbcl :sb-posix)
:components
((:module "src"
:serial t
:components ((:file "pkg")
(:file #+allegro "acl"
#+clisp "clisp"
#+cmu "cmu"
#+ecl "ecl"
#+lispworks "lispworks"
#+(and mcl (not openmcl)) "mcl"
#+openmcl "openmcl"
#+sbcl "sbcl")
(:file "iter")
(:file "level1")
(:file "clos")
(:file "scheme")
(:file "utils")
(:file "mop")
(:file "objects")
(:file "data")
(:file "scales")
(:file "spectral")
(:file "patterns")
(:file "io")
(:file "scheduler")
(:file "gnuplot")
(:file "plt")
(:file "sco")
;;; (:file "clm")
(:file "midi1")
(:file "midi2")
(:file "midi3")
(:file "cmn")
;;; (:file "fomus")
(:file "sc")
(:file "rt")
(:file "parse")
(:file "init")))))
;;;
;;; main functions
;;;
(in-package :cl-user)
(defun use-system (sys &key directory bin-directory
(verbose t) warnings symbols)
(declare (ignore directory bin-directory warnings symbols))
(asdf:load-system sys :verbose verbose))
(defun cm (&rest systems)
(flet ((cmcall (fn &rest args)
(apply (find-symbol (string fn) :cm) args))
(cmvar (var)
(symbol-value (find-symbol (string var) :cm))))
(setf *package* (find-package :cm))
(setf *readtable* (cmvar :*cm-readtable*))
;; add slime readtable mapping...
(let ((swank-pkg (find-package :swank))
(slynk-pkg (find-package :slynk)))
(when swank-pkg
(let ((sym (intern (symbol-name :*readtable-alist*) swank-pkg)))
(setf (symbol-value sym)
(cons (cons (symbol-name :cm) (cmvar :*cm-readtable*))
(symbol-value sym))))
(when slynk-pkg
(let ((sym (intern (symbol-name :*readtable-alist*) slynk-pkg)))
(setf (symbol-value sym)
(cons (cons (symbol-name :cm) (cmvar :*cm-readtable*))
(symbol-value sym)))))))
(let (#-sbcl (*trace-output* nil))
(dolist (s systems) (use-system s :verbose nil)))
(cmcall :cm-logo)))
(export '(cm use-system) :cl-user)