Commit | Line | Data |
---|---|---|
f842bbed JD |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2014 John Darrington <jmd@gnu.org> | |
00ab9458 | 3 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> |
e396976b | 4 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
05f5ce0c | 5 | ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch> |
4a78fd46 | 6 | ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is> |
14afc7b8 | 7 | ;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca> |
636c77d0 | 8 | ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> |
f3cd6633 | 9 | ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il> |
5dff0752 | 10 | ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> |
56c240ba | 11 | ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net> |
f842bbed JD |
12 | ;;; |
13 | ;;; This file is part of GNU Guix. | |
14 | ;;; | |
15 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
16 | ;;; under the terms of the GNU General Public License as published by | |
17 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
18 | ;;; your option) any later version. | |
19 | ;;; | |
20 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
21 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 | ;;; GNU General Public License for more details. | |
24 | ;;; | |
25 | ;;; You should have received a copy of the GNU General Public License | |
26 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
27 | ||
28 | (define-module (gnu packages lisp) | |
29 | #:use-module (gnu packages) | |
b5b73a82 | 30 | #:use-module ((guix licenses) #:prefix license:) |
f842bbed | 31 | #:use-module (guix packages) |
f842bbed | 32 | #:use-module (guix download) |
423eef36 | 33 | #:use-module (guix git-download) |
f842bbed | 34 | #:use-module (guix utils) |
00ab9458 | 35 | #:use-module (guix build-system gnu) |
a72debb7 | 36 | #:use-module (guix build-system asdf) |
e3e171ee | 37 | #:use-module (guix build-system trivial) |
5ff15b86 | 38 | #:use-module (gnu packages admin) |
ce0614dd | 39 | #:use-module (gnu packages base) |
5ff15b86 | 40 | #:use-module (gnu packages bdw-gc) |
05c63898 | 41 | #:use-module (gnu packages compression) |
5ff15b86 | 42 | #:use-module (gnu packages ed) |
05c63898 | 43 | #:use-module (gnu packages fontutils) |
5ff15b86 EF |
44 | #:use-module (gnu packages gcc) |
45 | #:use-module (gnu packages gettext) | |
46 | #:use-module (gnu packages gl) | |
47 | #:use-module (gnu packages glib) | |
48 | #:use-module (gnu packages m4) | |
05c63898 | 49 | #:use-module (gnu packages maths) |
00ab9458 | 50 | #:use-module (gnu packages multiprecision) |
f473b8f1 | 51 | #:use-module (gnu packages ncurses) |
560f51d0 | 52 | #:use-module (gnu packages libffcall) |
5ff15b86 | 53 | #:use-module (gnu packages libffi) |
b702b52d | 54 | #:use-module (gnu packages libsigsegv) |
05c63898 | 55 | #:use-module (gnu packages linux) |
5ff15b86 | 56 | #:use-module (gnu packages perl) |
05c63898 | 57 | #:use-module (gnu packages pkg-config) |
5ff15b86 EF |
58 | #:use-module (gnu packages readline) |
59 | #:use-module (gnu packages sdl) | |
60 | #:use-module (gnu packages tex) | |
61 | #:use-module (gnu packages texinfo) | |
531a9aac | 62 | #:use-module (gnu packages version-control) |
05c63898 | 63 | #:use-module (gnu packages xorg) |
419fb3f1 | 64 | #:use-module (ice-9 match) |
65 | #:use-module (srfi srfi-1)) | |
f842bbed | 66 | |
8d0489ae AP |
67 | (define (asdf-substitutions lisp) |
68 | ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's | |
69 | ;; 'default-system-source-registry'. | |
70 | `((("\\(,dir \"systems/\"\\)\\)") | |
71 | (format #f | |
72 | "(,dir \"~a-bundle-systems\"))) | |
73 | ||
74 | ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\") | |
75 | :collect `(:directory (,dir \"systems\"))" | |
76 | ,lisp)))) | |
77 | ||
f842bbed | 78 | (define-public gcl |
dd0134fc KK |
79 | (let ((commit "5956140b1083e2302a59d7ce2054b0b7c2cbb417") |
80 | (revision "1")) ;Guix package revision | |
81 | (package | |
82 | (name "gcl") | |
83 | (version (string-append "2.6.12-" revision "." | |
84 | (string-take commit 7))) | |
85 | (source | |
86 | (origin | |
87 | (method git-fetch) | |
88 | (uri (git-reference | |
89 | (url "https://git.savannah.gnu.org/r/gcl.git") | |
90 | (commit commit))) | |
91 | (file-name (string-append "gcl-" version "-checkout")) | |
92 | (sha256 | |
93 | (base32 "0mwclf2879mh3d9xqkqhghf58lwy7srsnsq9x0f1cc6j302sy4hb")))) | |
94 | (build-system gnu-build-system) | |
95 | (arguments | |
96 | `(#:parallel-build? #f ; The build system seems not to be thread safe. | |
97 | #:tests? #f ; There does not seem to be make check or anything similar. | |
98 | #:configure-flags '("--enable-ansi") ; required for use by the maxima package | |
99 | #:make-flags (list | |
100 | (string-append "GCL_CC=" (assoc-ref %build-inputs "gcc") | |
101 | "/bin/gcc") | |
102 | (string-append "CC=" (assoc-ref %build-inputs "gcc") | |
103 | "/bin/gcc")) | |
104 | #:phases | |
105 | (modify-phases %standard-phases | |
106 | (add-before 'configure 'pre-conf | |
107 | (lambda* (#:key inputs #:allow-other-keys) | |
108 | (chdir "gcl") | |
109 | (substitute* | |
110 | (append | |
111 | '("pcl/impl/kcl/makefile.akcl" | |
112 | "add-defs" | |
113 | "unixport/makefile.dos" | |
114 | "add-defs.bat" | |
115 | "gcl-tk/makefile.prev" | |
116 | "add-defs1") | |
117 | (find-files "h" "\\.defs")) | |
118 | (("SHELL=/bin/bash") | |
119 | (string-append "SHELL=" (which "bash"))) | |
120 | (("SHELL=/bin/sh") | |
121 | (string-append "SHELL=" (which "sh")))) | |
122 | (substitute* "h/linux.defs" | |
123 | (("#CC") "CC") | |
124 | (("-fwritable-strings") "") | |
125 | (("-Werror") "")) | |
126 | (substitute* "lsp/gcl_top.lsp" | |
127 | (("\"cc\"") | |
128 | (string-append "\"" (assoc-ref %build-inputs "gcc") | |
129 | "/bin/gcc\"")) | |
130 | (("\\(or \\(get-path \\*cc\\*\\) \\*cc\\*\\)") "*cc*") | |
131 | (("\"ld\"") | |
132 | (string-append "\"" (assoc-ref %build-inputs "binutils") | |
133 | "/bin/ld\"")) | |
134 | (("\\(or \\(get-path \\*ld\\*\\) \\*ld\\*\\)") "*ld*") | |
135 | (("\\(get-path \"objdump --source \"\\)") | |
136 | (string-append "\"" (assoc-ref %build-inputs "binutils") | |
137 | "/bin/objdump --source \""))) | |
138 | #t)) | |
139 | (add-after 'install 'wrap | |
140 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
141 | (let* ((gcl (assoc-ref outputs "out")) | |
142 | (input-path (lambda (lib path) | |
143 | (string-append | |
144 | (assoc-ref inputs lib) path))) | |
145 | (binaries '("binutils"))) | |
146 | ;; GCC and the GNU binutils are necessary for GCL to be | |
147 | ;; able to compile Lisp functions and programs (this is | |
148 | ;; a standard feature in Common Lisp). While the | |
149 | ;; the location of GCC is specified in the make-flags, | |
150 | ;; the GNU binutils must be available in GCL's $PATH. | |
151 | (wrap-program (string-append gcl "/bin/gcl") | |
152 | `("PATH" prefix ,(map (lambda (binary) | |
153 | (input-path binary "/bin")) | |
154 | binaries)))) | |
155 | #t)) | |
156 | ;; drop strip phase to make maxima build, see | |
157 | ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html | |
158 | (delete 'strip)))) | |
159 | (inputs | |
160 | `(("gmp" ,gmp) | |
161 | ("readline" ,readline))) | |
162 | (native-inputs | |
163 | `(("gcc" ,gcc-4.9) | |
164 | ("m4" ,m4) | |
165 | ("texinfo" ,texinfo) | |
166 | ("texlive" ,texlive))) | |
167 | (home-page "https://www.gnu.org/software/gcl/") | |
168 | (synopsis "A Common Lisp implementation") | |
169 | (description "GCL is an implementation of the Common Lisp language. It | |
f842bbed JD |
170 | features the ability to compile to native object code and to load native |
171 | object code modules directly into its lisp core. It also features a | |
172 | stratified garbage collection strategy, a source-level debugger and a built-in | |
173 | interface to the Tk widget system.") | |
dd0134fc | 174 | (license license:lgpl2.0+)))) |
f842bbed | 175 | |
00ab9458 TUBK |
176 | (define-public ecl |
177 | (package | |
178 | (name "ecl") | |
108f69c4 | 179 | (version "16.1.3") |
00ab9458 TUBK |
180 | (source |
181 | (origin | |
182 | (method url-fetch) | |
e0524511 AP |
183 | (uri (string-append |
184 | "https://common-lisp.net/project/ecl/static/files/release/" | |
185 | name "-" version ".tgz")) | |
00ab9458 | 186 | (sha256 |
108f69c4 | 187 | (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn")) |
fb7dc6d6 AP |
188 | (modules '((guix build utils))) |
189 | (snippet | |
190 | ;; Add ecl-bundle-systems to 'default-system-source-registry'. | |
6cbee49d MW |
191 | `(begin |
192 | (substitute* "contrib/asdf/asdf.lisp" | |
193 | ,@(asdf-substitutions name)) | |
194 | #t)))) | |
00ab9458 | 195 | (build-system gnu-build-system) |
cb03a9b6 | 196 | ;; src/configure uses 'which' to confirm the existence of 'gzip'. |
00ab9458 TUBK |
197 | (native-inputs `(("which" ,which))) |
198 | (inputs `(("gmp" ,gmp) | |
199 | ("libatomic-ops" ,libatomic-ops) | |
200 | ("libgc" ,libgc) | |
201 | ("libffi" ,libffi))) | |
202 | (arguments | |
60474cd1 | 203 | '(#:tests? #t |
60474cd1 AP |
204 | #:parallel-tests? #f |
205 | #:phases | |
206 | (modify-phases %standard-phases | |
207 | (delete 'check) | |
54a43ff4 AP |
208 | (add-after 'install 'wrap |
209 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
210 | (let* ((ecl (assoc-ref outputs "out")) | |
211 | (input-path (lambda (lib path) | |
212 | (string-append | |
213 | (assoc-ref inputs lib) path))) | |
214 | (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc")) | |
215 | (binaries '("gcc" "ld-wrapper" "binutils")) | |
216 | (library-directories | |
217 | (map (lambda (lib) (input-path lib "/lib")) | |
218 | libraries))) | |
219 | ||
220 | (wrap-program (string-append ecl "/bin/ecl") | |
221 | `("PATH" prefix | |
222 | ,(map (lambda (binary) | |
223 | (input-path binary "/bin")) | |
224 | binaries)) | |
225 | `("CPATH" suffix | |
226 | ,(map (lambda (lib) | |
227 | (input-path lib "/include")) | |
932b2ea2 | 228 | `("kernel-headers" ,@libraries))) |
54a43ff4 AP |
229 | `("LIBRARY_PATH" suffix ,library-directories) |
230 | `("LD_LIBRARY_PATH" suffix ,library-directories))))) | |
108f69c4 AP |
231 | (add-after 'wrap 'check (assoc-ref %standard-phases 'check)) |
232 | (add-before 'check 'fix-path-to-ecl | |
233 | (lambda _ | |
234 | (substitute* "build/tests/Makefile" | |
235 | (("\\$\\{exec_prefix\\}/") "")) | |
236 | #t))))) | |
fb7dc6d6 AP |
237 | (native-search-paths |
238 | (list (search-path-specification | |
239 | (variable "XDG_DATA_DIRS") | |
240 | (files '("share"))))) | |
00ab9458 TUBK |
241 | (home-page "http://ecls.sourceforge.net/") |
242 | (synopsis "Embeddable Common Lisp") | |
243 | (description "ECL is an implementation of the Common Lisp language as | |
244 | defined by the ANSI X3J13 specification. Its most relevant features are: a | |
245 | bytecode compiler and interpreter, being able to compile Common Lisp with any | |
246 | C/C++ compiler, being able to build standalone executables and libraries, and | |
247 | supporting ASDF, Sockets, Gray streams, MOP, and other useful components.") | |
248 | ;; Note that the file "Copyright" points to some files and directories | |
249 | ;; which aren't under the lgpl2.0+ and instead contain many different, | |
250 | ;; non-copyleft licenses. | |
251 | (license license:lgpl2.0+))) | |
560f51d0 TUBK |
252 | |
253 | (define-public clisp | |
254 | (package | |
255 | (name "clisp") | |
e4c399fe | 256 | (version "2.49-92") |
560f51d0 TUBK |
257 | (source |
258 | (origin | |
e4c399fe EF |
259 | (method git-fetch) |
260 | (uri (git-reference | |
261 | (url "https://gitlab.com/gnu-clisp/clisp") | |
262 | (commit "clisp-2.49.92-2018-02-18"))) | |
263 | (file-name (git-file-name name version)) | |
560f51d0 | 264 | (sha256 |
e4c399fe EF |
265 | (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb")) |
266 | (patches (search-patches "clisp-remove-failing-test.patch")))) | |
560f51d0 TUBK |
267 | (build-system gnu-build-system) |
268 | (inputs `(("libffcall" ,libffcall) | |
f473b8f1 EF |
269 | ("ncurses" ,ncurses) |
270 | ("readline" ,readline) | |
560f51d0 TUBK |
271 | ("libsigsegv" ,libsigsegv))) |
272 | (arguments | |
e4c399fe EF |
273 | `(#:configure-flags '(,@(if (string-prefix? "armhf-linux" |
274 | (or (%current-system) | |
275 | (%current-target-system))) | |
276 | '("CFLAGS=-falign-functions=4") | |
277 | '()) | |
278 | "--with-dynamic-ffi" | |
279 | "--with-dynamic-modules" | |
280 | "--with-module=rawsock") | |
f90ef3c3 MW |
281 | #:build #f |
282 | #:phases | |
636c77d0 RW |
283 | (modify-phases %standard-phases |
284 | (add-after 'unpack 'patch-sh-and-pwd | |
285 | (lambda _ | |
286 | ;; The package is very messy with its references to "/bin/sh" and | |
287 | ;; some other absolute paths to traditional tools. These appear in | |
288 | ;; many places where our automatic patching misses them. Therefore | |
289 | ;; we do the following, in this early (post-unpack) phase, to solve | |
290 | ;; the problem from its root. | |
e4c399fe EF |
291 | (substitute* '("src/clisp-link.in" |
292 | "src/unix.d" | |
293 | "src/makemake.in") | |
294 | (("/bin/sh") (which "sh"))) | |
636c77d0 RW |
295 | (substitute* (find-files "." "configure|Makefile") |
296 | (("/bin/sh") "sh")) | |
297 | (substitute* '("src/clisp-link.in") | |
298 | (("/bin/pwd") "pwd")) | |
636c77d0 | 299 | #t))) |
560f51d0 TUBK |
300 | ;; Makefiles seem to have race conditions. |
301 | #:parallel-build? #f)) | |
e4c399fe | 302 | (home-page "https://clisp.sourceforge.io/") |
4cc78cb3 LC |
303 | (synopsis "A Common Lisp implementation") |
304 | (description | |
305 | "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a | |
306 | high-level, object-oriented functional programming language. CLISP includes | |
307 | an interpreter, a compiler, a debugger, and much more.") | |
4bd2e2a5 | 308 | (license license:gpl2+))) |
b702b52d TUBK |
309 | |
310 | (define-public sbcl | |
311 | (package | |
312 | (name "sbcl") | |
3a52bb71 | 313 | (version "1.4.4") |
b702b52d TUBK |
314 | (source |
315 | (origin | |
316 | (method url-fetch) | |
317 | (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-" | |
318 | version "-source.tar.bz2")) | |
319 | (sha256 | |
3a52bb71 | 320 | (base32 "1k6v5b8qv7vyxvh8asx6phf2hbapx5pp5p5j47hgnq123fwnh4fa")) |
8d0489ae AP |
321 | (modules '((guix build utils))) |
322 | (snippet | |
323 | ;; Add sbcl-bundle-systems to 'default-system-source-registry'. | |
6cbee49d MW |
324 | `(begin |
325 | (substitute* "contrib/asdf/asdf.lisp" | |
326 | ,@(asdf-substitutions name)) | |
327 | #t)))) | |
b702b52d | 328 | (build-system gnu-build-system) |
05f5ce0c | 329 | (outputs '("out" "doc")) |
b702b52d TUBK |
330 | ;; Bootstrap with CLISP. |
331 | (native-inputs | |
332 | `(("clisp" ,clisp) | |
333 | ("which" ,which) | |
334 | ("inetutils" ,inetutils) ;for hostname(1) | |
05f5ce0c FB |
335 | ("ed" ,ed) |
336 | ("texlive" ,texlive) | |
337 | ("texinfo" ,texinfo))) | |
b702b52d | 338 | (arguments |
f0b7dc7e ST |
339 | '(#:modules ((guix build gnu-build-system) |
340 | (guix build utils) | |
341 | (srfi srfi-1)) | |
342 | #:phases | |
1ee131df FB |
343 | (modify-phases %standard-phases |
344 | (delete 'configure) | |
345 | (add-before 'build 'patch-unix-tool-paths | |
346 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
347 | (let ((out (assoc-ref outputs "out")) | |
348 | (bash (assoc-ref inputs "bash")) | |
349 | (coreutils (assoc-ref inputs "coreutils")) | |
350 | (ed (assoc-ref inputs "ed"))) | |
351 | (define (quoted-path input path) | |
352 | (string-append "\"" input path "\"")) | |
353 | ;; Patch absolute paths in string literals. Note that this | |
354 | ;; occurs in some .sh files too (which contain Lisp code). Use | |
355 | ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded. | |
356 | (with-fluids ((%default-port-encoding #f)) | |
1925a879 AP |
357 | ;; The removed file is utf-16-be encoded, which gives substitute* |
358 | ;; trouble. It does not contain references to the listed programs. | |
359 | (substitute* (delete | |
360 | "./tests/data/compile-file-pos-utf16be.lisp" | |
361 | (find-files "." "\\.(lisp|sh)$")) | |
1ee131df FB |
362 | (("\"/bin/sh\"") (quoted-path bash "/bin/sh")) |
363 | (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env")) | |
364 | (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat")) | |
365 | (("\"/bin/ed\"") (quoted-path ed "/bin/ed")) | |
366 | (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo")) | |
367 | (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname")))) | |
368 | ;; This one script has a non-string occurrence of /bin/sh. | |
369 | (substitute* '("tests/foreign.test.sh") | |
370 | ;; Leave whitespace so we don't match the shebang. | |
371 | ((" /bin/sh ") " sh ")) | |
372 | ;; This file contains a module that can create executable files | |
373 | ;; which depend on the presence of SBCL. It generates shell | |
374 | ;; scripts doing "exec sbcl ..." to achieve this. We patch both | |
375 | ;; the shebang and the reference to "sbcl", tying the generated | |
376 | ;; executables to the exact SBCL package that generated them. | |
377 | (substitute* '("contrib/sb-executable/sb-executable.lisp") | |
378 | (("/bin/sh") (string-append bash "/bin/sh")) | |
379 | (("exec sbcl") (string-append "exec " out "/bin/sbcl"))) | |
380 | ;; Disable some tests that fail in our build environment. | |
381 | (substitute* '("contrib/sb-bsd-sockets/tests.lisp") | |
382 | ;; This requires /etc/protocols. | |
383 | (("\\(deftest get-protocol-by-name/error" all) | |
384 | (string-append "#+nil ;disabled by Guix\n" all))) | |
385 | (substitute* '("contrib/sb-posix/posix-tests.lisp") | |
386 | ;; These assume some users/groups which we don't have. | |
387 | (("\\(deftest pwent\\.[12]" all) | |
388 | (string-append "#+nil ;disabled by Guix\n" all)) | |
389 | (("\\(deftest grent\\.[12]" all) | |
390 | (string-append "#+nil ;disabled by Guix\n" all)))))) | |
391 | (replace 'build | |
392 | (lambda* (#:key outputs #:allow-other-keys) | |
393 | (setenv "CC" "gcc") | |
394 | (zero? (system* "sh" "make.sh" "clisp" | |
395 | (string-append "--prefix=" | |
396 | (assoc-ref outputs "out")))))) | |
397 | (replace 'install | |
b702b52d | 398 | (lambda _ |
05f5ce0c FB |
399 | (zero? (system* "sh" "install.sh")))) |
400 | (add-after 'build 'build-doc | |
401 | (lambda _ | |
402 | (with-directory-excursion "doc/manual" | |
403 | (and (zero? (system* "make" "info")) | |
404 | (zero? (system* "make" "dist")))))) | |
405 | (add-after 'install 'install-doc | |
406 | (lambda* (#:key outputs #:allow-other-keys) | |
407 | (let* ((out (assoc-ref outputs "out")) | |
408 | (doc (assoc-ref outputs "doc")) | |
409 | (old-doc-dir (string-append out "/share/doc")) | |
410 | (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl"))) | |
411 | (rmdir (string-append old-doc-dir "/sbcl/html")) | |
412 | (mkdir-p new-doc/sbcl-dir) | |
413 | (copy-recursively (string-append old-doc-dir "/sbcl") | |
414 | new-doc/sbcl-dir) | |
415 | (delete-file-recursively old-doc-dir) | |
416 | #t)))) | |
1ee131df FB |
417 | ;; No 'check' target, though "make.sh" (build phase) runs tests. |
418 | #:tests? #f)) | |
8d0489ae AP |
419 | (native-search-paths |
420 | (list (search-path-specification | |
421 | (variable "XDG_DATA_DIRS") | |
422 | (files '("share"))))) | |
b702b52d TUBK |
423 | (home-page "http://www.sbcl.org/") |
424 | (synopsis "Common Lisp implementation") | |
425 | (description "Steel Bank Common Lisp (SBCL) is a high performance Common | |
426 | Lisp compiler. In addition to the compiler and runtime system for ANSI Common | |
427 | Lisp, it provides an interactive environment including a debugger, a | |
428 | statistical profiler, a code coverage tool, and many other extensions.") | |
429 | ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT | |
430 | ;; loop macro has its own license. See COPYING file for further notes. | |
431 | (license (list license:public-domain license:bsd-2 | |
432 | (license:x11-style "file://src/code/loop.lisp"))))) | |
531a9aac TUBK |
433 | |
434 | (define-public ccl | |
435 | (package | |
436 | (name "ccl") | |
04ab38b7 | 437 | (version "1.11.5") |
531a9aac TUBK |
438 | (source #f) |
439 | (build-system gnu-build-system) | |
440 | ;; CCL consists of a "lisp kernel" and "heap image", both of which are | |
441 | ;; shipped in precompiled form in source tarballs. The former is a C | |
442 | ;; program which we can rebuild from scratch, but the latter cannot be | |
443 | ;; generated without an already working copy of CCL, and is platform | |
444 | ;; dependent, so we need to fetch the correct tarball for the platform. | |
445 | (inputs | |
446 | `(("ccl" | |
447 | ,(origin | |
448 | (method url-fetch) | |
449 | (uri (string-append | |
04ab38b7 | 450 | "https://github.com/Clozure/ccl/releases/download/v" version |
3701f014 | 451 | "/ccl-" version "-" |
531a9aac TUBK |
452 | (match (%current-system) |
453 | ((or "i686-linux" "x86_64-linux") "linuxx86") | |
42f11801 MW |
454 | ("armhf-linux" "linuxarm") |
455 | ;; Prevent errors when querying this package on unsupported | |
456 | ;; platforms, e.g. when running "guix package --search=" | |
457 | (_ "UNSUPPORTED")) | |
531a9aac TUBK |
458 | ".tar.gz")) |
459 | (sha256 | |
460 | (base32 | |
461 | (match (%current-system) | |
462 | ((or "i686-linux" "x86_64-linux") | |
04ab38b7 | 463 | "0hs1f3z7crgzvinpj990kv9gvbsipxvcvwbmk54n51nasvc5025q") |
42f11801 | 464 | ("armhf-linux" |
04ab38b7 | 465 | "0p0l1dzsygb6i1xxgbipjpxkn46xhq3jm41a34ga1qqp4x8lkr62") |
42f11801 | 466 | (_ "")))))))) |
531a9aac TUBK |
467 | (native-inputs |
468 | `(("m4" ,m4) | |
469 | ("subversion" ,subversion))) | |
470 | (arguments | |
471 | `(#:tests? #f ;no 'check' target | |
fc7d5a34 AP |
472 | #:modules ((srfi srfi-26) |
473 | (guix build utils) | |
474 | (guix build gnu-build-system)) | |
531a9aac | 475 | #:phases |
dc1d3cde KK |
476 | (modify-phases %standard-phases |
477 | (replace 'unpack | |
478 | (lambda* (#:key inputs #:allow-other-keys) | |
479 | (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl"))) | |
480 | (begin (chdir "ccl") #t)))) | |
481 | (delete 'configure) | |
482 | (add-before 'build 'pre-build | |
483 | ;; Enter the source directory for the current platform's lisp | |
484 | ;; kernel, and run 'make clean' to remove the precompiled one. | |
485 | (lambda _ | |
bcc65510 EF |
486 | (substitute* "lisp-kernel/m4macros.m4" |
487 | (("/bin/pwd") (which "pwd"))) | |
dc1d3cde KK |
488 | (chdir (string-append |
489 | "lisp-kernel/" | |
490 | ,(match (or (%current-target-system) (%current-system)) | |
491 | ("i686-linux" "linuxx8632") | |
492 | ("x86_64-linux" "linuxx8664") | |
493 | ("armhf-linux" "linuxarm") | |
494 | ;; Prevent errors when querying this package | |
495 | ;; on unsupported platforms, e.g. when running | |
496 | ;; "guix package --search=" | |
497 | (_ "UNSUPPORTED")))) | |
498 | (substitute* '("Makefile") | |
499 | (("/bin/rm") "rm")) | |
500 | (setenv "CC" "gcc") | |
501 | (zero? (system* "make" "clean")))) | |
502 | ;; XXX Do we need to recompile the heap image as well for Guix? | |
503 | ;; For now just use the one we already got in the tarball. | |
504 | (replace 'install | |
531a9aac TUBK |
505 | (lambda* (#:key outputs inputs #:allow-other-keys) |
506 | ;; The lisp kernel built by running 'make' in lisp-kernel/$system | |
507 | ;; is put back into the original directory, so go back. The heap | |
508 | ;; image is there as well. | |
509 | (chdir "../..") | |
510 | (let* ((out (assoc-ref outputs "out")) | |
511 | (libdir (string-append out "/lib/")) | |
512 | (bindir (string-append out "/bin/")) | |
513 | (wrapper (string-append bindir "ccl")) | |
514 | (bash (assoc-ref inputs "bash")) | |
515 | (kernel | |
516 | ,(match (or (%current-target-system) (%current-system)) | |
76eb7266 | 517 | ("i686-linux" "lx86cl") |
531a9aac | 518 | ("x86_64-linux" "lx86cl64") |
76eb7266 MW |
519 | ("armhf-linux" "armcl") |
520 | ;; Prevent errors when querying this package | |
521 | ;; on unsupported platforms, e.g. when running | |
522 | ;; "guix package --search=" | |
523 | (_ "UNSUPPORTED"))) | |
531a9aac | 524 | (heap (string-append kernel ".image"))) |
fc7d5a34 AP |
525 | (install-file kernel libdir) |
526 | (install-file heap libdir) | |
527 | ||
528 | (let ((dirs '("lib" "library" "examples" "contrib" | |
529 | "tools" "objc-bridge"))) | |
530 | (for-each copy-recursively | |
531 | dirs | |
532 | (map (cut string-append libdir <>) dirs))) | |
533 | ||
531a9aac | 534 | (mkdir-p bindir) |
531a9aac TUBK |
535 | (with-output-to-file wrapper |
536 | (lambda () | |
537 | (display | |
538 | (string-append | |
539 | "#!" bash "/bin/sh\n" | |
58b24078 | 540 | "CCL_DEFAULT_DIRECTORY=" libdir "\n" |
531a9aac TUBK |
541 | "export CCL_DEFAULT_DIRECTORY\n" |
542 | "exec " libdir kernel "\n")))) | |
dc1d3cde KK |
543 | (chmod wrapper #o755)) |
544 | #t))))) | |
531a9aac TUBK |
545 | (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux")) |
546 | (home-page "http://ccl.clozure.com/") | |
547 | (synopsis "Common Lisp implementation") | |
548 | (description "Clozure CL (often called CCL for short) is a Common Lisp | |
549 | implementation featuring fast compilation speed, native threads, a precise, | |
550 | generational, compacting garbage collector, and a convenient foreign-function | |
551 | interface.") | |
552 | ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL | |
553 | ;; applies to Lisp code according to them. | |
554 | (license (list license:lgpl2.1 | |
555 | license:clarified-artistic)))) ;TRIVIAL-LDAP package | |
423eef36 | 556 | |
995e5092 | 557 | (define-public femtolisp |
558 | (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b") | |
559 | (revision "1")) | |
560 | (package | |
561 | (name "femtolisp") | |
562 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
563 | (source (origin | |
564 | (method git-fetch) | |
565 | (uri (git-reference | |
566 | (url "https://github.com/JeffBezanson/femtolisp.git") | |
567 | (commit commit))) | |
568 | (file-name (string-append name "-" version "-checkout")) | |
569 | (sha256 | |
570 | (base32 | |
571 | "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja")))) | |
419fb3f1 | 572 | ;; See "utils.h" for supported systems. Upstream bug: |
573 | ;; https://github.com/JeffBezanson/femtolisp/issues/25 | |
574 | (supported-systems | |
575 | (fold delete %supported-systems | |
dc00f635 | 576 | '("armhf-linux" "mips64el-linux" "aarch64-linux"))) |
995e5092 | 577 | (build-system gnu-build-system) |
578 | (arguments | |
f7fe5f7a | 579 | `(#:make-flags '("CC=gcc" "release") |
580 | #:test-target "test" | |
995e5092 | 581 | #:phases |
582 | (modify-phases %standard-phases | |
583 | (delete 'configure) ; No configure script | |
995e5092 | 584 | (replace 'install ; Makefile has no 'install phase |
585 | (lambda* (#:key outputs #:allow-other-keys) | |
586 | (let* ((out (assoc-ref outputs "out")) | |
587 | (bin (string-append out "/bin"))) | |
588 | (install-file "flisp" bin) | |
589 | #t))) | |
590 | ;; The flisp binary is now available, run bootstrap to | |
591 | ;; generate flisp.boot and afterwards runs make test. | |
592 | (add-after 'install 'bootstrap-gen-and-test | |
593 | (lambda* (#:key outputs #:allow-other-keys) | |
594 | (let* ((out (assoc-ref outputs "out")) | |
595 | (bin (string-append out "/bin"))) | |
596 | (and | |
597 | (zero? (system* "./bootstrap.sh")) | |
598 | (install-file "flisp.boot" bin)))))))) | |
599 | (synopsis "Scheme-like lisp implementation") | |
600 | (description | |
601 | "@code{femtolisp} is a scheme-like lisp implementation with a | |
602 | simple, elegant Scheme dialect. It is a lisp-1 with lexical scope. | |
603 | The core is 12 builtin special forms and 33 builtin functions.") | |
604 | (home-page "https://github.com/JeffBezanson/femtolisp") | |
605 | (license license:bsd-3)))) | |
a72debb7 | 606 | |
05c63898 | 607 | (define-public lush2 |
608 | (package | |
609 | (name "lush2") | |
610 | (version "2.0.1") | |
611 | (source | |
612 | (origin | |
613 | (method url-fetch) | |
614 | (uri (string-append "mirror://sourceforge/lush/lush2/lush-" | |
615 | version ".tar.gz")) | |
616 | (modules '((guix build utils))) | |
617 | (snippet | |
618 | '(begin | |
619 | (substitute* "src/unix.c" | |
6cbee49d MW |
620 | (("\\{ \"LUSH_DATE\", __DATE__ \\},") "") |
621 | (("\\{ \"LUSH_TIME\", __TIME__ \\},") "")) | |
622 | (substitute* "src/main.c" | |
623 | (("\" \\(built \" __DATE__ \"\\)\"") "")) | |
624 | #t)) | |
05c63898 | 625 | (sha256 |
626 | (base32 | |
627 | "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k")))) | |
628 | (build-system gnu-build-system) | |
629 | (arguments | |
630 | `(;; We have to add these LIBS so that they are found. | |
631 | #:configure-flags (list "LIBS=-lz" | |
632 | "X_EXTRA_LIBS=-lfontconfig" | |
633 | "--with-x") | |
634 | #:tests? #f)) ; No make check. | |
635 | (native-inputs `(("intltool" ,intltool))) | |
636 | (inputs | |
637 | `(("alsa-lib" ,alsa-lib) | |
638 | ("sdl" ,sdl) | |
639 | ("sdl-image" ,sdl-image) | |
640 | ("sdl-mixer" ,sdl-mixer) | |
641 | ("sdl-net" ,sdl-net) | |
642 | ("sdl-ttf" ,sdl-ttf) | |
643 | ("lapack" ,lapack) | |
644 | ("libxft" ,libxft) | |
645 | ("fontconfig" ,fontconfig) | |
646 | ("gsl" ,gsl) | |
647 | ("openblas" ,openblas) | |
648 | ("glu" ,glu) | |
649 | ("mesa" ,mesa) | |
650 | ("mesa-utils" ,mesa-utils) | |
651 | ("binutils" ,binutils) | |
652 | ("libiberty" ,libiberty) | |
653 | ("readline" ,readline) | |
654 | ("zlib" ,zlib) | |
655 | ("gettext-minimal" ,gettext-minimal))) | |
656 | (synopsis "Lisp Universal Shell") | |
657 | (description | |
658 | "Lush is an object-oriented Lisp interpreter/compiler with features | |
659 | designed to please people who want to prototype large numerical | |
660 | applications. Lush includes an extensive library of | |
661 | vector/matrix/tensor manipulation, numerous numerical libraries | |
662 | (including GSL, LAPACK, and BLAS), a set of graphic functions, a | |
663 | simple GUI toolkit, and interfaces to various graphic and multimedia | |
664 | libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio | |
665 | grabbing), and others. Lush is an ideal frontend script language for | |
666 | programming projects written in C or other languages. Lush also has | |
667 | libraries for Machine Learning, Neural Nets and statistical estimation.") | |
668 | (home-page "http://lush.sourceforge.net/") | |
669 | (license license:lgpl2.1+))) | |
670 | ||
a72debb7 AP |
671 | (define-public sbcl-alexandria |
672 | (let ((revision "1") | |
673 | (commit "926a066611b7b11cb71e26c827a271e500888c30")) | |
674 | (package | |
675 | (name "sbcl-alexandria") | |
676 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
677 | (source | |
678 | (origin | |
679 | (method git-fetch) | |
680 | (uri (git-reference | |
681 | (url "https://gitlab.common-lisp.net/alexandria/alexandria.git") | |
682 | (commit commit))) | |
683 | (sha256 | |
684 | (base32 | |
685 | "18yncicdkh294j05rhgm23gzi36y9qy6vrfba8vg69jrxjp1hx8l")) | |
686 | (file-name (string-append "alexandria-" version "-checkout")))) | |
687 | (build-system asdf-build-system/sbcl) | |
688 | (synopsis "Collection of portable utilities for Common Lisp") | |
689 | (description | |
690 | "Alexandria is a collection of portable utilities. It does not contain | |
691 | conceptual extensions to Common Lisp. It is conservative in scope, and | |
692 | portable between implementations.") | |
693 | (home-page "https://common-lisp.net/project/alexandria/") | |
694 | (license license:public-domain)))) | |
695 | ||
696 | (define-public cl-alexandria | |
697 | (sbcl-package->cl-source-package sbcl-alexandria)) | |
698 | ||
699 | (define-public ecl-alexandria | |
700 | (sbcl-package->ecl-package sbcl-alexandria)) | |
86022c92 AP |
701 | |
702 | (define-public sbcl-fiveam | |
703 | (package | |
704 | (name "sbcl-fiveam") | |
705 | (version "1.2") | |
706 | (source | |
707 | (origin | |
708 | (method url-fetch) | |
709 | (uri (string-append | |
710 | "https://github.com/sionescu/fiveam/archive/v" | |
711 | version ".tar.gz")) | |
712 | (sha256 | |
713 | (base32 "0f48pcbhqs3wwwzjl5nk57d4hcbib4l9xblxc66b8c2fhvhmhxnv")) | |
714 | (file-name (string-append "fiveam-" version ".tar.gz")))) | |
0e1371be | 715 | (inputs `(("alexandria" ,sbcl-alexandria))) |
86022c92 AP |
716 | (build-system asdf-build-system/sbcl) |
717 | (synopsis "Common Lisp testing framework") | |
718 | (description "FiveAM is a simple (as far as writing and running tests | |
719 | goes) regression testing framework. It has been designed with Common Lisp's | |
720 | interactive development model in mind.") | |
721 | (home-page "https://common-lisp.net/project/fiveam/") | |
722 | (license license:bsd-3))) | |
723 | ||
724 | (define-public cl-fiveam | |
725 | (sbcl-package->cl-source-package sbcl-fiveam)) | |
726 | ||
727 | (define-public ecl-fiveam | |
728 | (sbcl-package->ecl-package sbcl-fiveam)) | |
8662809d AP |
729 | |
730 | (define-public sbcl-bordeaux-threads | |
543cf6fd AP |
731 | (let ((commit "354abb0ae9f1d9324001e1a8abab3128d7420e0e") |
732 | (revision "1")) | |
733 | (package | |
734 | (name "sbcl-bordeaux-threads") | |
735 | (version (git-version "0.8.5" revision commit)) | |
736 | (source (origin | |
737 | (method git-fetch) | |
738 | (uri (git-reference | |
739 | (url "https://github.com/sionescu/bordeaux-threads.git") | |
740 | (commit commit))) | |
741 | (sha256 | |
742 | (base32 "1hcfp21l6av1xj6z7r77sp6h4mwf9vvx4s745803sysq2qy2mwnq")) | |
743 | (file-name | |
744 | (git-file-name "bordeaux-threads" version)))) | |
745 | (inputs `(("alexandria" ,sbcl-alexandria))) | |
746 | (native-inputs `(("fiveam" ,sbcl-fiveam))) | |
747 | (build-system asdf-build-system/sbcl) | |
748 | (synopsis "Portable shared-state concurrency library for Common Lisp") | |
749 | (description "BORDEAUX-THREADS is a proposed standard for a minimal | |
8662809d AP |
750 | MP/Threading interface. It is similar to the CLIM-SYS threading and lock |
751 | support.") | |
543cf6fd AP |
752 | (home-page "https://common-lisp.net/project/bordeaux-threads/") |
753 | (license license:x11)))) | |
8662809d AP |
754 | |
755 | (define-public cl-bordeaux-threads | |
756 | (sbcl-package->cl-source-package sbcl-bordeaux-threads)) | |
757 | ||
758 | (define-public ecl-bordeaux-threads | |
759 | (sbcl-package->ecl-package sbcl-bordeaux-threads)) | |
059cab30 AP |
760 | |
761 | (define-public sbcl-trivial-gray-streams | |
762 | (let ((revision "1") | |
763 | (commit "0483ade330508b4b2edeabdb47d16ec9437ee1cb")) | |
764 | (package | |
765 | (name "sbcl-trivial-gray-streams") | |
766 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
767 | (source | |
768 | (origin | |
769 | (method git-fetch) | |
770 | (uri | |
771 | (git-reference | |
772 | (url "https://github.com/trivial-gray-streams/trivial-gray-streams.git") | |
773 | (commit commit))) | |
774 | (sha256 | |
775 | (base32 "0m3rpf2x0zmdk3nf1qfa01j6a55vj7gkwhyw78qslcgbjlgh8p4d")) | |
776 | (file-name | |
777 | (string-append "trivial-gray-streams-" version "-checkout")))) | |
778 | (build-system asdf-build-system/sbcl) | |
779 | (synopsis "Compatibility layer for Gray streams implementations") | |
780 | (description "Gray streams is an interface proposed for inclusion with | |
781 | ANSI CL by David N. Gray. The proposal did not make it into ANSI CL, but most | |
782 | popular CL implementations implement it. This package provides an extremely | |
783 | thin compatibility layer for gray streams.") | |
784 | (home-page "http://www.cliki.net/trivial-gray-streams") | |
785 | (license license:x11)))) | |
786 | ||
787 | (define-public cl-trivial-gray-streams | |
788 | (sbcl-package->cl-source-package sbcl-trivial-gray-streams)) | |
789 | ||
790 | (define-public ecl-trivial-gray-streams | |
791 | (sbcl-package->ecl-package sbcl-trivial-gray-streams)) | |
3c55c780 AP |
792 | |
793 | (define-public sbcl-flexi-streams | |
794 | (package | |
795 | (name "sbcl-flexi-streams") | |
5dff0752 | 796 | (version "1.0.16") |
3c55c780 AP |
797 | (source |
798 | (origin | |
799 | (method url-fetch) | |
800 | (uri (string-append | |
801 | "https://github.com/edicl/flexi-streams/archive/v" | |
802 | version ".tar.gz")) | |
803 | (sha256 | |
5dff0752 | 804 | (base32 "1fb0jrwxr5c3i2lhy7kn30m1n0vggfzwjm1dacx6y5wf9wfsbamw")) |
3c55c780 AP |
805 | (file-name (string-append "flexi-streams-" version ".tar.gz")))) |
806 | (build-system asdf-build-system/sbcl) | |
0e1371be | 807 | (inputs `(("trivial-gray-streams" ,sbcl-trivial-gray-streams))) |
3c55c780 AP |
808 | (synopsis "Implementation of virtual bivalent streams for Common Lisp") |
809 | (description "Flexi-streams is an implementation of \"virtual\" bivalent | |
810 | streams that can be layered atop real binary or bivalent streams and that can | |
811 | be used to read and write character data in various single- or multi-octet | |
812 | encodings which can be changed on the fly. It also supplies in-memory binary | |
813 | streams which are similar to string streams.") | |
814 | (home-page "http://weitz.de/flexi-streams/") | |
815 | (license license:bsd-3))) | |
816 | ||
817 | (define-public cl-flexi-streams | |
818 | (sbcl-package->cl-source-package sbcl-flexi-streams)) | |
819 | ||
820 | (define-public ecl-flexi-streams | |
821 | (sbcl-package->ecl-package sbcl-flexi-streams)) | |
5aa608a7 AP |
822 | |
823 | (define-public sbcl-cl-ppcre | |
824 | (package | |
825 | (name "sbcl-cl-ppcre") | |
826 | (version "2.0.11") | |
827 | (source | |
828 | (origin | |
829 | (method url-fetch) | |
830 | (uri (string-append | |
831 | "https://github.com/edicl/cl-ppcre/archive/v" | |
832 | version ".tar.gz")) | |
833 | (sha256 | |
834 | (base32 "1i7daxf0wnydb0pgwiym7qh2wy70n14lxd6dyv28sy0naa8p31gd")) | |
835 | (file-name (string-append "cl-ppcre-" version ".tar.gz")))) | |
836 | (build-system asdf-build-system/sbcl) | |
0e1371be | 837 | (native-inputs `(("flexi-streams" ,sbcl-flexi-streams))) |
5aa608a7 AP |
838 | (synopsis "Portable regular expression library for Common Lisp") |
839 | (description "CL-PPCRE is a portable regular expression library for Common | |
840 | Lisp, which is compatible with perl. It is pretty fast, thread-safe, and | |
841 | compatible with ANSI-compliant Common Lisp implementations.") | |
842 | (home-page "http://weitz.de/cl-ppcre/") | |
843 | (license license:bsd-2))) | |
844 | ||
845 | (define-public cl-ppcre | |
846 | (sbcl-package->cl-source-package sbcl-cl-ppcre)) | |
847 | ||
848 | (define-public ecl-cl-ppcre | |
849 | (sbcl-package->ecl-package sbcl-cl-ppcre)) | |
4b51b21c | 850 | |
ac259253 RW |
851 | (define sbcl-cl-unicode-base |
852 | (let ((revision "1") | |
853 | (commit "9fcd06fba1ddc9e66aed2f2d6c32dc9b764f03ea")) | |
854 | (package | |
855 | (name "sbcl-cl-unicode-base") | |
856 | (version (string-append "0.1.5-" revision "." (string-take commit 7))) | |
857 | (source (origin | |
858 | (method git-fetch) | |
859 | (uri (git-reference | |
860 | (url "https://github.com/edicl/cl-unicode.git") | |
861 | (commit commit))) | |
862 | (file-name (string-append "cl-unicode-" version "-checkout")) | |
863 | (sha256 | |
864 | (base32 | |
865 | "1jicprb5b3bv57dy1kg03572gxkcaqdjhak00426s76g0plmx5ki")))) | |
866 | (build-system asdf-build-system/sbcl) | |
867 | (arguments | |
868 | '(#:asd-file "cl-unicode.asd" | |
869 | #:asd-system-name "cl-unicode/base")) | |
870 | (inputs | |
871 | `(("cl-ppcre" ,sbcl-cl-ppcre))) | |
872 | (home-page "http://weitz.de/cl-unicode/") | |
873 | (synopsis "Portable Unicode library for Common Lisp") | |
874 | (description "CL-UNICODE is a portable Unicode library Common Lisp, which | |
875 | is compatible with perl. It is pretty fast, thread-safe, and compatible with | |
876 | ANSI-compliant Common Lisp implementations.") | |
877 | (license license:bsd-2)))) | |
878 | ||
879 | (define-public sbcl-cl-unicode | |
880 | (package | |
881 | (inherit sbcl-cl-unicode-base) | |
882 | (name "sbcl-cl-unicode") | |
883 | (inputs | |
884 | `(("cl-unicode/base" ,sbcl-cl-unicode-base) | |
885 | ,@(package-inputs sbcl-cl-unicode-base))) | |
886 | (native-inputs | |
887 | `(("flexi-streams" ,sbcl-flexi-streams))) | |
888 | (arguments '()))) | |
889 | ||
890 | (define-public ecl-cl-unicode | |
891 | (sbcl-package->ecl-package sbcl-cl-unicode)) | |
892 | ||
893 | (define-public cl-unicode | |
894 | (sbcl-package->cl-source-package sbcl-cl-unicode)) | |
895 | ||
4b51b21c AP |
896 | (define-public sbcl-clx |
897 | (let ((revision "1") | |
898 | (commit "1c62774b03c1cf3fe6e5cb532df8b14b44c96b95")) | |
899 | (package | |
900 | (name "sbcl-clx") | |
901 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
902 | (source | |
903 | (origin | |
904 | (method git-fetch) | |
905 | (uri | |
906 | (git-reference | |
907 | (url "https://github.com/sharplispers/clx.git") | |
908 | (commit commit))) | |
909 | (sha256 | |
910 | (base32 "0qffag03ns52kwq9xjns2qg1yr0bf3ba507iwq5cmx5xz0b0rmjm")) | |
911 | (file-name (string-append "clx-" version "-checkout")) | |
912 | (patches | |
913 | (list | |
914 | (search-patch "clx-remove-demo.patch"))) | |
915 | (modules '((guix build utils))) | |
916 | (snippet | |
917 | '(begin | |
918 | ;; These removed files cause the compiled system to crash when | |
919 | ;; loading. | |
920 | (delete-file-recursively "demo") | |
921 | (delete-file "test/trapezoid.lisp") | |
922 | (substitute* "clx.asd" | |
6cbee49d MW |
923 | (("\\(:file \"trapezoid\"\\)") "")) |
924 | #t)))) | |
4b51b21c | 925 | (build-system asdf-build-system/sbcl) |
4b51b21c AP |
926 | (home-page "http://www.cliki.net/portable-clx") |
927 | (synopsis "X11 client library for Common Lisp") | |
928 | (description "CLX is an X11 client library for Common Lisp. The code was | |
929 | originally taken from a CMUCL distribution, was modified somewhat in order to | |
930 | make it compile and run under SBCL, then a selection of patches were added | |
931 | from other CLXes around the net.") | |
932 | (license license:x11)))) | |
933 | ||
934 | (define-public cl-clx | |
935 | (sbcl-package->cl-source-package sbcl-clx)) | |
936 | ||
937 | (define-public ecl-clx | |
938 | (sbcl-package->ecl-package sbcl-clx)) | |
d075960f | 939 | |
b693aa6e RW |
940 | (define-public sbcl-cl-ppcre-unicode |
941 | (package (inherit sbcl-cl-ppcre) | |
942 | (name "sbcl-cl-ppcre-unicode") | |
943 | (arguments | |
944 | `(#:tests? #f ; tests fail with "Component :CL-PPCRE-TEST not found" | |
945 | #:asd-file "cl-ppcre-unicode.asd")) | |
946 | (inputs | |
947 | `(("sbcl-cl-ppcre" ,sbcl-cl-ppcre) | |
948 | ("sbcl-cl-unicode" ,sbcl-cl-unicode))))) | |
949 | ||
d075960f AP |
950 | (define-public sbcl-stumpwm |
951 | (package | |
952 | (name "sbcl-stumpwm") | |
abf818bc | 953 | (version "18.05") |
d075960f AP |
954 | (source (origin |
955 | (method url-fetch) | |
956 | (uri (string-append | |
957 | "https://github.com/stumpwm/stumpwm/archive/" | |
958 | version ".tar.gz")) | |
959 | (sha256 | |
abf818bc | 960 | (base32 "1n2gaab3lwgf5r1hmwdcw13dkv9xdd7drn2shx28kfxvhdc9kbb9")) |
d075960f AP |
961 | (file-name (string-append "stumpwm-" version ".tar.gz")))) |
962 | (build-system asdf-build-system/sbcl) | |
0e1371be | 963 | (inputs `(("cl-ppcre" ,sbcl-cl-ppcre) |
abf818bc OP |
964 | ("clx" ,sbcl-clx) |
965 | ("alexandria" ,sbcl-alexandria))) | |
290bf612 | 966 | (outputs '("out" "lib")) |
d075960f | 967 | (arguments |
35189728 | 968 | '(#:phases |
d075960f AP |
969 | (modify-phases %standard-phases |
970 | (add-after 'create-symlinks 'build-program | |
b4c9f0c5 | 971 | (lambda* (#:key outputs #:allow-other-keys) |
d075960f | 972 | (build-program |
290bf612 | 973 | (string-append (assoc-ref outputs "out") "/bin/stumpwm") |
4209c31b | 974 | outputs |
d075960f AP |
975 | #:entry-program '((stumpwm:stumpwm) 0)))) |
976 | (add-after 'build-program 'create-desktop-file | |
290bf612 AP |
977 | (lambda* (#:key outputs #:allow-other-keys) |
978 | (let* ((out (assoc-ref outputs "out")) | |
979 | (xsessions (string-append out "/share/xsessions"))) | |
980 | (mkdir-p xsessions) | |
981 | (call-with-output-file | |
982 | (string-append xsessions "/stumpwm.desktop") | |
983 | (lambda (file) | |
984 | (format file | |
d075960f AP |
985 | "[Desktop Entry]~@ |
986 | Name=stumpwm~@ | |
987 | Comment=The Stump Window Manager~@ | |
988 | Exec=~a/bin/stumpwm~@ | |
989 | TryExec=~@*~a/bin/stumpwm~@ | |
990 | Icon=~@ | |
991 | Type=Application~%" | |
290bf612 | 992 | out))) |
d075960f AP |
993 | #t)))))) |
994 | (synopsis "Window manager written in Common Lisp") | |
995 | (description "Stumpwm is a window manager written entirely in Common Lisp. | |
996 | It attempts to be highly customizable while relying entirely on the keyboard | |
997 | for input. These design decisions reflect the growing popularity of | |
998 | productive, customizable lisp based systems.") | |
7bf837fd | 999 | (home-page "https://github.com/stumpwm/stumpwm") |
d075960f AP |
1000 | (license license:gpl2+) |
1001 | (properties `((ecl-variant . ,(delay ecl-stumpwm)))))) | |
1002 | ||
1003 | (define-public cl-stumpwm | |
1004 | (sbcl-package->cl-source-package sbcl-stumpwm)) | |
1005 | ||
1006 | (define-public ecl-stumpwm | |
1007 | (let ((base (sbcl-package->ecl-package sbcl-stumpwm))) | |
1008 | (package | |
1009 | (inherit base) | |
1010 | (outputs '("out")) | |
1011 | (arguments '())))) | |
e3e171ee | 1012 | |
75e8b3af AP |
1013 | ;; The slynk that users expect to install includes all of slynk's contrib |
1014 | ;; modules. Therefore, we build the base module and all contribs first; then | |
1015 | ;; we expose the union of these as `sbcl-slynk'. The following variable | |
1016 | ;; describes the base module. | |
e3e171ee | 1017 | (define sbcl-slynk-boot0 |
1d98b44e AP |
1018 | (let ((revision "2") |
1019 | (commit "cbf84c36c4eca8b032e3fd16177a7bc02df3ec4c")) | |
e3e171ee | 1020 | (package |
f56da605 | 1021 | (name "sbcl-slynk-boot0") |
e3e171ee AP |
1022 | (version (string-append "1.0.0-beta-" revision "." (string-take commit 7))) |
1023 | (source | |
1024 | (origin | |
1025 | (method git-fetch) | |
1026 | (uri | |
1027 | (git-reference | |
1028 | (url "https://github.com/joaotavora/sly.git") | |
1029 | (commit commit))) | |
1030 | (sha256 | |
1d98b44e | 1031 | (base32 "13dyhsravn591p7g6is01mp2ynzjnnj7pwgi57r6xqmd4611y9vh")) |
e3e171ee AP |
1032 | (file-name (string-append "slynk-" version "-checkout")) |
1033 | (modules '((guix build utils) | |
1034 | (ice-9 ftw))) | |
1035 | (snippet | |
1036 | '(begin | |
1037 | ;; Move the contribs into the main source directory for easier | |
1038 | ;; access | |
1039 | (substitute* "slynk/slynk.asd" | |
1040 | (("\\.\\./contrib") | |
1041 | "contrib") | |
1d98b44e AP |
1042 | (("\\(defsystem :slynk/util") |
1043 | "(defsystem :slynk/util :depends-on (:slynk)") | |
1044 | ((":depends-on \\(:slynk :slynk/util\\)") | |
1045 | ":depends-on (:slynk :slynk-util)")) | |
e3e171ee AP |
1046 | (substitute* "contrib/slynk-trace-dialog.lisp" |
1047 | (("\\(slynk::reset-inspector\\)") ; Causes problems on load | |
1048 | "nil")) | |
1049 | (substitute* "contrib/slynk-profiler.lisp" | |
1050 | (("slynk:to-line") | |
1051 | "slynk-pprint-to-line")) | |
1d98b44e AP |
1052 | (substitute* "contrib/slynk-fancy-inspector.lisp" |
1053 | (("slynk/util") "slynk-util") | |
1054 | ((":compile-toplevel :load-toplevel") "")) | |
e3e171ee AP |
1055 | (rename-file "contrib" "slynk/contrib") |
1056 | ;; Move slynk's contents into the base directory for easier | |
1057 | ;; access | |
6cbee49d MW |
1058 | (for-each (lambda (file) |
1059 | (unless (string-prefix? "." file) | |
1060 | (rename-file (string-append "slynk/" file) | |
1061 | (string-append "./" (basename file))))) | |
1062 | (scandir "slynk")) | |
1063 | #t)))) | |
e3e171ee AP |
1064 | (build-system asdf-build-system/sbcl) |
1065 | (arguments | |
f56da605 AP |
1066 | `(#:tests? #f ; No test suite |
1067 | #:asd-system-name "slynk")) | |
e3e171ee | 1068 | (synopsis "Common Lisp IDE for Emacs") |
14afc7b8 AP |
1069 | (description "SLY is a fork of SLIME, an IDE backend for Common Lisp. |
1070 | It also features a completely redesigned REPL based on Emacs's own | |
1071 | full-featured comint.el, live code annotations, and a consistent interactive | |
1072 | button interface. Everything can be copied to the REPL. One can create | |
1073 | multiple inspectors with independent history.") | |
e3e171ee AP |
1074 | (home-page "https://github.com/joaotavora/sly") |
1075 | (license license:public-domain) | |
1076 | (properties `((cl-source-variant . ,(delay cl-slynk))))))) | |
1077 | ||
1078 | (define-public cl-slynk | |
f56da605 AP |
1079 | (package |
1080 | (inherit (sbcl-package->cl-source-package sbcl-slynk-boot0)) | |
1081 | (name "cl-slynk"))) | |
e3e171ee AP |
1082 | |
1083 | (define ecl-slynk-boot0 | |
1084 | (sbcl-package->ecl-package sbcl-slynk-boot0)) | |
1085 | ||
1086 | (define sbcl-slynk-arglists | |
1087 | (package | |
1088 | (inherit sbcl-slynk-boot0) | |
1089 | (name "sbcl-slynk-arglists") | |
0e1371be | 1090 | (inputs `(("slynk" ,sbcl-slynk-boot0))) |
e3e171ee | 1091 | (arguments |
f56da605 AP |
1092 | (substitute-keyword-arguments (package-arguments sbcl-slynk-boot0) |
1093 | ((#:asd-file _ "") "slynk.asd") | |
1d98b44e | 1094 | ((#:asd-system-name _ #f) "slynk/arglists"))))) |
e3e171ee AP |
1095 | |
1096 | (define ecl-slynk-arglists | |
1097 | (sbcl-package->ecl-package sbcl-slynk-arglists)) | |
1098 | ||
1099 | (define sbcl-slynk-util | |
1100 | (package | |
1d98b44e AP |
1101 | (inherit sbcl-slynk-boot0) |
1102 | (name "sbcl-slynk-util") | |
1103 | (inputs `(("slynk" ,sbcl-slynk-boot0))) | |
1104 | (arguments | |
1105 | (substitute-keyword-arguments (package-arguments sbcl-slynk-boot0) | |
1106 | ((#:asd-file _ "") "slynk.asd") | |
1107 | ((#:asd-system-name _ #f) "slynk/util"))))) | |
e3e171ee AP |
1108 | |
1109 | (define ecl-slynk-util | |
1110 | (sbcl-package->ecl-package sbcl-slynk-util)) | |
1111 | ||
1112 | (define sbcl-slynk-fancy-inspector | |
1113 | (package | |
1114 | (inherit sbcl-slynk-arglists) | |
1115 | (name "sbcl-slynk-fancy-inspector") | |
0e1371be | 1116 | (inputs `(("slynk-util" ,sbcl-slynk-util) |
1d98b44e AP |
1117 | ,@(package-inputs sbcl-slynk-arglists))) |
1118 | (arguments | |
1119 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1120 | ((#:asd-system-name _ #f) "slynk/fancy-inspector"))))) | |
e3e171ee AP |
1121 | |
1122 | (define ecl-slynk-fancy-inspector | |
1123 | (sbcl-package->ecl-package sbcl-slynk-fancy-inspector)) | |
1124 | ||
1125 | (define sbcl-slynk-package-fu | |
1126 | (package | |
1127 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1128 | (name "sbcl-slynk-package-fu") |
1129 | (arguments | |
1130 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1131 | ((#:asd-system-name _ #f) "slynk/package-fu"))))) | |
e3e171ee AP |
1132 | |
1133 | (define ecl-slynk-package-fu | |
1134 | (sbcl-package->ecl-package sbcl-slynk-package-fu)) | |
1135 | ||
1136 | (define sbcl-slynk-mrepl | |
1137 | (package | |
1d98b44e AP |
1138 | (inherit sbcl-slynk-fancy-inspector) |
1139 | (name "sbcl-slynk-mrepl") | |
1140 | (arguments | |
1141 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1142 | ((#:asd-system-name _ #f) "slynk/mrepl"))))) | |
e3e171ee AP |
1143 | |
1144 | (define ecl-slynk-mrepl | |
1145 | (sbcl-package->ecl-package sbcl-slynk-mrepl)) | |
1146 | ||
1147 | (define sbcl-slynk-trace-dialog | |
1148 | (package | |
1149 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1150 | (name "sbcl-slynk-trace-dialog") |
1151 | (arguments | |
1152 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1153 | ((#:asd-system-name _ #f) "slynk/trace-dialog"))))) | |
e3e171ee AP |
1154 | |
1155 | (define ecl-slynk-trace-dialog | |
1156 | (sbcl-package->ecl-package sbcl-slynk-trace-dialog)) | |
1157 | ||
1158 | (define sbcl-slynk-profiler | |
1159 | (package | |
1160 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1161 | (name "sbcl-slynk-profiler") |
1162 | (arguments | |
1163 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1164 | ((#:asd-system-name _ #f) "slynk/profiler"))))) | |
e3e171ee AP |
1165 | |
1166 | (define ecl-slynk-profiler | |
1167 | (sbcl-package->ecl-package sbcl-slynk-profiler)) | |
1168 | ||
1169 | (define sbcl-slynk-stickers | |
1170 | (package | |
1171 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1172 | (name "sbcl-slynk-stickers") |
1173 | (arguments | |
1174 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1175 | ((#:asd-system-name _ #f) "slynk/stickers"))))) | |
e3e171ee AP |
1176 | |
1177 | (define ecl-slynk-stickers | |
1178 | (sbcl-package->ecl-package sbcl-slynk-stickers)) | |
1179 | ||
1180 | (define sbcl-slynk-indentation | |
1181 | (package | |
1182 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1183 | (name "sbcl-slynk-indentation") |
1184 | (arguments | |
1185 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1186 | ((#:asd-system-name _ #f) "slynk/indentation"))))) | |
e3e171ee AP |
1187 | |
1188 | (define ecl-slynk-indentation | |
1189 | (sbcl-package->ecl-package sbcl-slynk-indentation)) | |
1190 | ||
1191 | (define sbcl-slynk-retro | |
1192 | (package | |
1193 | (inherit sbcl-slynk-arglists) | |
1d98b44e AP |
1194 | (name "sbcl-slynk-retro") |
1195 | (arguments | |
1196 | (substitute-keyword-arguments (package-arguments sbcl-slynk-arglists) | |
1197 | ((#:asd-system-name _ #f) "slynk/retro"))))) | |
e3e171ee AP |
1198 | |
1199 | (define ecl-slynk-retro | |
1200 | (sbcl-package->ecl-package sbcl-slynk-retro)) | |
1201 | ||
1202 | (define slynk-systems | |
1203 | '("slynk" | |
1204 | "slynk-util" | |
1205 | "slynk-arglists" | |
1206 | "slynk-fancy-inspector" | |
1207 | "slynk-package-fu" | |
1208 | "slynk-mrepl" | |
1209 | "slynk-profiler" | |
1210 | "slynk-trace-dialog" | |
1211 | "slynk-stickers" | |
1212 | "slynk-indentation" | |
1213 | "slynk-retro")) | |
1214 | ||
1215 | (define-public sbcl-slynk | |
1216 | (package | |
1217 | (inherit sbcl-slynk-boot0) | |
f56da605 | 1218 | (name "sbcl-slynk") |
e3e171ee AP |
1219 | (inputs |
1220 | `(("slynk" ,sbcl-slynk-boot0) | |
1221 | ("slynk-util" ,sbcl-slynk-util) | |
1222 | ("slynk-arglists" ,sbcl-slynk-arglists) | |
1223 | ("slynk-fancy-inspector" ,sbcl-slynk-fancy-inspector) | |
1224 | ("slynk-package-fu" ,sbcl-slynk-package-fu) | |
1225 | ("slynk-mrepl" ,sbcl-slynk-mrepl) | |
1226 | ("slynk-profiler" ,sbcl-slynk-profiler) | |
1227 | ("slynk-trace-dialog" ,sbcl-slynk-trace-dialog) | |
1228 | ("slynk-stickers" ,sbcl-slynk-stickers) | |
1229 | ("slynk-indentation" ,sbcl-slynk-indentation) | |
1230 | ("slynk-retro" ,sbcl-slynk-retro))) | |
1231 | (native-inputs `(("sbcl" ,sbcl))) | |
1232 | (build-system trivial-build-system) | |
1233 | (source #f) | |
1234 | (outputs '("out" "image")) | |
1235 | (arguments | |
1236 | `(#:modules ((guix build union) | |
1237 | (guix build utils) | |
1238 | (guix build lisp-utils)) | |
1239 | #:builder | |
1240 | (begin | |
1241 | (use-modules (ice-9 match) | |
1242 | (srfi srfi-1) | |
1243 | (guix build union) | |
1244 | (guix build lisp-utils)) | |
1245 | ||
1246 | (union-build | |
1247 | (assoc-ref %outputs "out") | |
1248 | (filter-map | |
1249 | (match-lambda | |
1250 | ((name . path) | |
1251 | (if (string-prefix? "slynk" name) path #f))) | |
1252 | %build-inputs)) | |
1253 | ||
1254 | (prepend-to-source-registry | |
1255 | (string-append (assoc-ref %outputs "out") "//")) | |
b4c9f0c5 AP |
1256 | |
1257 | (parameterize ((%lisp-type "sbcl") | |
1258 | (%lisp (string-append (assoc-ref %build-inputs "sbcl") | |
1259 | "/bin/sbcl"))) | |
1260 | (build-image (string-append | |
1261 | (assoc-ref %outputs "image") | |
1262 | "/bin/slynk") | |
4209c31b | 1263 | %outputs |
e3cfef22 MW |
1264 | #:dependencies ',slynk-systems)) |
1265 | #t))))) | |
e3e171ee AP |
1266 | |
1267 | (define-public ecl-slynk | |
1268 | (package | |
1269 | (inherit sbcl-slynk) | |
1270 | (name "ecl-slynk") | |
1271 | (inputs | |
1272 | (map (match-lambda | |
1273 | ((name pkg . _) | |
1274 | (list name (sbcl-package->ecl-package pkg)))) | |
1275 | (package-inputs sbcl-slynk))) | |
1276 | (native-inputs '()) | |
1277 | (outputs '("out")) | |
1278 | (arguments | |
1279 | '(#:modules ((guix build union)) | |
1280 | #:builder | |
1281 | (begin | |
1282 | (use-modules (ice-9 match) | |
1283 | (guix build union)) | |
1284 | (match %build-inputs | |
1285 | (((names . paths) ...) | |
1286 | (union-build (assoc-ref %outputs "out") | |
e3cfef22 MW |
1287 | paths) |
1288 | #t))))))) | |
96784438 AP |
1289 | |
1290 | (define-public sbcl-stumpwm+slynk | |
1291 | (package | |
1292 | (inherit sbcl-stumpwm) | |
1293 | (name "sbcl-stumpwm-with-slynk") | |
1294 | (outputs '("out")) | |
4209c31b | 1295 | (inputs |
290bf612 | 1296 | `(("stumpwm" ,sbcl-stumpwm "lib") |
96784438 AP |
1297 | ("slynk" ,sbcl-slynk))) |
1298 | (arguments | |
1299 | (substitute-keyword-arguments (package-arguments sbcl-stumpwm) | |
1300 | ((#:phases phases) | |
1301 | `(modify-phases ,phases | |
1302 | (replace 'build-program | |
4209c31b | 1303 | (lambda* (#:key inputs outputs #:allow-other-keys) |
96784438 AP |
1304 | (let* ((out (assoc-ref outputs "out")) |
1305 | (program (string-append out "/bin/stumpwm"))) | |
4209c31b | 1306 | (build-program program outputs |
96784438 AP |
1307 | #:entry-program '((stumpwm:stumpwm) 0) |
1308 | #:dependencies '("stumpwm" | |
4209c31b AP |
1309 | ,@slynk-systems) |
1310 | #:dependency-prefixes | |
1311 | (map (lambda (input) (assoc-ref inputs input)) | |
1312 | '("stumpwm" "slynk"))) | |
96784438 AP |
1313 | ;; Remove unneeded file. |
1314 | (delete-file (string-append out "/bin/stumpwm-exec.fasl")) | |
1315 | #t))) | |
1316 | (delete 'copy-source) | |
1317 | (delete 'build) | |
1318 | (delete 'check) | |
290bf612 | 1319 | (delete 'create-asd-file) |
96784438 AP |
1320 | (delete 'cleanup) |
1321 | (delete 'create-symlinks))))))) | |
d00c96d7 RW |
1322 | |
1323 | (define-public sbcl-parse-js | |
1324 | (let ((commit "fbadc6029bec7039602abfc06c73bb52970998f6") | |
1325 | (revision "1")) | |
1326 | (package | |
1327 | (name "sbcl-parse-js") | |
1328 | (version (string-append "0.0.0-" revision "." (string-take commit 9))) | |
1329 | (source | |
1330 | (origin | |
1331 | (method git-fetch) | |
1332 | (uri (git-reference | |
1333 | (url "http://marijn.haverbeke.nl/git/parse-js") | |
1334 | (commit commit))) | |
1335 | (file-name (string-append name "-" commit "-checkout")) | |
1336 | (sha256 | |
1337 | (base32 | |
1338 | "1wddrnr5kiya5s3gp4cdq6crbfy9fqcz7fr44p81502sj3bvdv39")))) | |
1339 | (build-system asdf-build-system/sbcl) | |
1340 | (home-page "http://marijnhaverbeke.nl/parse-js/") | |
1341 | (synopsis "Parse JavaScript") | |
1342 | (description "Parse-js is a Common Lisp package for parsing | |
1343 | JavaScript (ECMAScript 3). It has basic support for ECMAScript 5.") | |
1344 | (license license:zlib)))) | |
d0eec99a RW |
1345 | |
1346 | (define-public sbcl-parse-number | |
1347 | (package | |
1348 | (name "sbcl-parse-number") | |
1349 | (version "1.5") | |
1350 | (source | |
1351 | (origin | |
1352 | (method url-fetch) | |
1353 | (uri (string-append "https://github.com/sharplispers/parse-number/" | |
1354 | "archive/v" version ".tar.gz")) | |
1355 | (file-name (string-append name "-" version ".tar.gz")) | |
1356 | (sha256 | |
1357 | (base32 | |
1358 | "1k6s4v65ksc1j5i0dprvzfvj213v6nah7i0rgd0726ngfjisj9ir")))) | |
1359 | (build-system asdf-build-system/sbcl) | |
1360 | (home-page "http://www.cliki.net/PARSE-NUMBER") | |
1361 | (synopsis "Parse numbers") | |
1362 | (description "@code{parse-number} is a library of functions for parsing | |
1363 | strings into one of the standard Common Lisp number types without using the | |
1364 | reader. @code{parse-number} accepts an arbitrary string and attempts to parse | |
1365 | the string into one of the standard Common Lisp number types, if possible, or | |
1366 | else @code{parse-number} signals an error of type @code{invalid-number}.") | |
1367 | (license license:bsd-3))) | |
1368 | ||
476b583f RW |
1369 | (define-public sbcl-iterate |
1370 | (package | |
1371 | (name "sbcl-iterate") | |
1372 | ;; The latest official release (1.4.3) fails to build so we have to take | |
1373 | ;; the current darcs tarball from quicklisp. | |
1374 | (version "20160825") | |
1375 | (source | |
1376 | (origin | |
1377 | (method url-fetch) | |
1378 | (uri (string-append "http://beta.quicklisp.org/archive/iterate/" | |
1379 | "2016-08-25/iterate-" | |
1380 | version "-darcs.tgz")) | |
1381 | (sha256 | |
1382 | (base32 | |
1383 | "0kvz16gnxnkdz0fy1x8y5yr28nfm7i2qpvix7mgwccdpjmsb4pgm")))) | |
1384 | (build-system asdf-build-system/sbcl) | |
1385 | (home-page "https://common-lisp.net/project/iterate/") | |
1386 | (synopsis "Iteration construct for Common Lisp") | |
1387 | (description "@code{iterate} is an iteration construct for Common Lisp. | |
1388 | It is similar to the @code{CL:LOOP} macro, with these distinguishing marks: | |
1389 | ||
1390 | @itemize | |
1391 | @item it is extensible, | |
1392 | @item it helps editors like Emacs indent iterate forms by having a more | |
1393 | lisp-like syntax, and | |
1394 | @item it isn't part of the ANSI standard for Common Lisp. | |
1395 | @end itemize\n") | |
1396 | (license license:expat))) | |
52650a4d RW |
1397 | |
1398 | (define-public sbcl-cl-uglify-js | |
1399 | ;; There have been many bug fixes since the 2010 release. | |
1400 | (let ((commit "429c5e1d844e2f96b44db8fccc92d6e8e28afdd5") | |
1401 | (revision "1")) | |
1402 | (package | |
1403 | (name "sbcl-cl-uglify-js") | |
1404 | (version (string-append "0.1-" revision "." (string-take commit 9))) | |
1405 | (source | |
1406 | (origin | |
1407 | (method git-fetch) | |
1408 | (uri (git-reference | |
1409 | (url "https://github.com/mishoo/cl-uglify-js.git") | |
1410 | (commit commit))) | |
03e8182b | 1411 | (file-name (git-file-name name version)) |
52650a4d RW |
1412 | (sha256 |
1413 | (base32 | |
1414 | "0k39y3c93jgxpr7gwz7w0d8yknn1fdnxrjhd03057lvk5w8js27a")))) | |
1415 | (build-system asdf-build-system/sbcl) | |
1416 | (inputs | |
1417 | `(("sbcl-parse-js" ,sbcl-parse-js) | |
1418 | ("sbcl-cl-ppcre" ,sbcl-cl-ppcre) | |
1419 | ("sbcl-cl-ppcre-unicode" ,sbcl-cl-ppcre-unicode) | |
1420 | ("sbcl-parse-number" ,sbcl-parse-number) | |
1421 | ("sbcl-iterate" ,sbcl-iterate))) | |
1422 | (home-page "https://github.com/mishoo/cl-uglify-js") | |
1423 | (synopsis "JavaScript compressor library for Common Lisp") | |
1424 | (description "This is a Common Lisp version of UglifyJS, a JavaScript | |
1425 | compressor. It works on data produced by @code{parse-js} to generate a | |
1426 | @dfn{minified} version of the code. Currently it can: | |
1427 | ||
1428 | @itemize | |
1429 | @item reduce variable names (usually to single letters) | |
1430 | @item join consecutive @code{var} statements | |
1431 | @item resolve simple binary expressions | |
1432 | @item group most consecutive statements using the ``sequence'' operator (comma) | |
1433 | @item remove unnecessary blocks | |
1434 | @item convert @code{IF} expressions in various ways that result in smaller code | |
1435 | @item remove some unreachable code | |
1436 | @end itemize\n") | |
1437 | (license license:zlib)))) | |
dd35abfe RW |
1438 | |
1439 | (define-public uglify-js | |
1440 | (package | |
1441 | (inherit sbcl-cl-uglify-js) | |
1442 | (name "uglify-js") | |
1443 | (build-system trivial-build-system) | |
1444 | (arguments | |
1445 | `(#:modules ((guix build utils)) | |
1446 | #:builder | |
1447 | (let* ((bin (string-append (assoc-ref %outputs "out") "/bin/")) | |
1448 | (script (string-append bin "uglify-js"))) | |
1449 | (use-modules (guix build utils)) | |
1450 | (mkdir-p bin) | |
1451 | (with-output-to-file script | |
1452 | (lambda _ | |
1453 | (format #t "#!~a/bin/sbcl --script | |
1454 | (require :asdf) | |
1455 | (push (truename \"~a/lib/sbcl\") asdf:*central-registry*)" | |
1456 | (assoc-ref %build-inputs "sbcl") | |
1457 | (assoc-ref %build-inputs "sbcl-cl-uglify-js")) | |
1458 | ;; FIXME: cannot use progn here because otherwise it fails to | |
1459 | ;; find cl-uglify-js. | |
1460 | (for-each | |
1461 | write | |
1462 | '(;; Quiet, please! | |
1463 | (let ((*standard-output* (make-broadcast-stream)) | |
1464 | (*error-output* (make-broadcast-stream))) | |
1465 | (asdf:load-system :cl-uglify-js)) | |
1466 | (let ((file (cadr *posix-argv*))) | |
1467 | (if file | |
1468 | (format t "~a" | |
1469 | (cl-uglify-js:ast-gen-code | |
1470 | (cl-uglify-js:ast-mangle | |
1471 | (cl-uglify-js:ast-squeeze | |
1472 | (with-open-file (in file) | |
1473 | (parse-js:parse-js in)))) | |
1474 | :beautify nil)) | |
1475 | (progn | |
1476 | (format *error-output* | |
1477 | "Please provide a JavaScript file.~%") | |
1478 | (sb-ext:exit :code 1)))))))) | |
1479 | (chmod script #o755) | |
1480 | #t))) | |
1481 | (inputs | |
1482 | `(("sbcl" ,sbcl) | |
1483 | ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js))) | |
1484 | (synopsis "JavaScript compressor"))) | |
56c240ba LC |
1485 | |
1486 | (define-public confusion-mdl | |
1487 | (let* ((commit "12a055581fc262225272df43287dae48281900f5")) | |
1488 | (package | |
1489 | (name "confusion-mdl") | |
1490 | (version "0.2") | |
1491 | (source (origin | |
1492 | (method git-fetch) | |
1493 | (uri (git-reference | |
1494 | (url (string-append "https://gitlab.com/emacsomancer/" name)) | |
1495 | (commit commit))) | |
1496 | (sha256 | |
1497 | (base32 | |
1498 | "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d")) | |
1499 | (file-name (git-file-name name version)))) | |
1500 | (build-system gnu-build-system) | |
1501 | (arguments | |
1502 | `(#:tests? #f ; there are no tests | |
1503 | #:phases | |
1504 | (modify-phases %standard-phases | |
1505 | (delete 'configure) | |
1506 | (replace 'build | |
1507 | (lambda* (#:key (make-flags '()) #:allow-other-keys) | |
1508 | (apply invoke "make" "CC=gcc" make-flags))) | |
1509 | (replace 'install | |
1510 | (lambda* (#:key outputs #:allow-other-keys) | |
1511 | (let* ((out (assoc-ref outputs "out")) | |
1512 | (bin (string-append out "/bin"))) | |
1513 | (install-file "mdli" bin) | |
1514 | #t)))))) | |
1515 | (native-inputs | |
1516 | `(("perl" ,perl))) | |
1517 | (inputs | |
1518 | `(("libgc" ,libgc))) | |
1519 | (synopsis "Interpreter for the MIT Design Language (MDL)") | |
1520 | (description "MDL (the MIT Design Language) is a descendant of Lisp. It | |
1521 | was originally developed in 1971 on the PDP-10 computer under the Incompatible | |
1522 | Timesharing System (ITS) to provide high level language support for the | |
1523 | Dynamic Modeling Group at MIT's Project MAC. Infocom built the original | |
1524 | PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was | |
1525 | based on a subset of MDL. Confusion is a MDL interpreter that works just well | |
1526 | enough to play the original mainframe Zork all the way through.") | |
1527 | (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README") | |
1528 | (license license:gpl3+)))) |