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