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