-
Notifications
You must be signed in to change notification settings - Fork 3
/
COMPILING.txt
144 lines (101 loc) · 5.19 KB
/
COMPILING.txt
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
HOW TO COMPILE
Below is the basic procedure of setting up Common Lisp on Windows and running City of the Damned from source for those who have never tried Lisp before.
1. Create Lisp folders.
You need two:
- a general one, where you will keep all Lisp-related files, for example, C:\Lisp.
- a specific one, where you will keep your own Lisp projects (like CotD), for example, C:\Lisp\libraries.
2. Install SBCL
Download Steel Bank Common Lisp from www.sbcl.org. Install it somewhere to C:\Lisp\SBCL\<SBCL version>.
3. Set up Environmental Variables.
You need to create the following environmental variables for your user:
- HOME with the value C:\Lisp
- CL_SOURCE_REGISTRY with the value (:source-registry (:tree "C:/Lisp/libraries/") :inherit-configuration)
- ASDF_OUTPUT_TRANSLATIONS with the value (:output-translations (T ("C:/Lisp/fasl-cache/" :implementation)) :inherit-configuration)
4. Install Quicklisp
Quicklisp is a packet manager for Common Lisp, which contains the most popular Lisp libraries.
Download the file https://beta.quicklisp.org/quicklisp.lisp, run sbcl.exe from cmd.exe and enter the following command in the SBCL prompt:
(load "C:/Lisp/quicklisp.lisp")
Quicklisp will respond with something like:
=== quicklisp quickstart 2015-01-28 loaded ===
To continue with installation, evaluate: (quicklisp-quickstart:install)
So you need to enter in the SBCL prompt:
(quicklisp-quickstart:install)
Once Quicklisp finished downloading itself, you'll want to start it whenever you use SBCL. To do so, enter the following command in the SBCL prompt:
(ql:add-to-init-file)
5. Install Emacs
You'll want to install Emacs as you IDE. Download Emacs binaries for Windows (http://ftp.gnu.org/gnu/emacs/windows/) and install them to C:\Lisp\emacs.
You may also run addpm.exe to add Emacs to the Start menu.
6. Install and configure SLIME
Download SLIME that ensures connection from Emacs to SBCL from https://github.com/slime/slime/releases. Unpack SLIME to C:\Lisp\libraries\.
Create the file C:\Lisp\.emacs.d\init.el and put the following inside it:
(set-language-environment 'UTF-8)
(setq default-buffer-file-coding-system 'utf-8-unix)
(setq-default make-backup-files nil)
(setq-default auto-save-defaults t)
(setq-default indent-tabs-mode nil)
(setq w32-use-visible-system-caret t)
(cua-mode)
(show-paren-mode)
(setq inferior-lisp-program "C:/Lisp/SBCL/1.3.12/sbcl.exe")
(add-to-list 'load-path "C:/Lisp/libraries/slime-2.15")
(require 'slime)
(setq slime-net-coding-system 'utf-8-unix)
(slime-setup '(slime-repl
slime-fuzzy
slime-fancy-inspector
slime-indentation))
(define-key slime-mode-map (kbd "TAB")
'slime-indent-and-complete-symbol)
(define-key slime-mode-map (kbd "C-c TAB")
'slime-complete-symbol)
(setq lisp-indent-function 'common-lisp-indent-function)
(define-common-lisp-style "my-indent-style"
"My custom indent style."
(:inherit "modern")
(:variables
(lisp-loop-indent-subclauses t))
(:indentation
(if (4 2 2))
(define (&lambda 2))
(with-gensyms ((&whole 4 &rest 1) &body))
(once-only (as with-gensyms))))
(setq common-lisp-style-default "my-indent-style")
(setq word-wrap nil)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(cua-mode t nil (cua-base))
'(show-paren-mode t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:family "Courier New" :foundry "outline" :slant normal :weight normal :height 90 :width normal)))))
The key strings here are:
- (setq inferior-lisp-program "C:/Lisp/SBCL/1.3.12/sbcl.exe") which sets the path to you SBCL executable file. Change as appropriate.
- (add-to-list 'load-path "C:/Lisp/libraries/slime-2.15") which sets the path to SLIME. Change as appropriate.
5. Install dependencies
Download SDL 1.2 runtime library from www.libsdl.org and put SDL.dll into C:\Lisp\SBCL\1.3.12.
Start Emacs, press Alt + X (M x) and enter the word "slime" (without quotes) to run SLIME.
In the SLIME prompt enter the following command to load LISPBUILDER-SDL:
(ql:quickload "lispbuilder-sdl")
Enter the following command to load BORDEAUX-THREADS:
(ql:quickload "bordeaux-threads")
Enter the following command to load DEFENUM:
(ql:quickload "defenum")
Enter the following command to load Cl-STORE
(ql:quickload "cl-store")
Enter the following command to load UIOP
(ql:quickload "uiop")
Enter the following command to load LOG4CL
(ql:quickload "log4cl")
6. Fetch CotD source files
Fetch CotD source files from GitHub (clone the repository) and put them to C:\Lisp\libraries.
7. Run CotD
In Lisp command prompt (SBCL or Emacs SLIME), enter the following commands one after another:
(asdf:oos 'asdf:load-op :cotd)
(cotd:cotd-main)
The first one loads the game to Lisp. The second one runs the game.