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