gnu: python-statsmodels: Fix build
[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 ng0 <ngillmann@runbox.com>
7 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages lisp)
25 #:use-module (gnu packages)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (gnu packages readline)
29 #:use-module (gnu packages texinfo)
30 #:use-module (gnu packages tex)
31 #:use-module (gnu packages m4)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix utils)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system asdf)
37 #:use-module (guix build-system trivial)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages multiprecision)
40 #:use-module (gnu packages bdw-gc)
41 #:use-module (gnu packages libffi)
42 #:use-module (gnu packages libffcall)
43 #:use-module (gnu packages readline)
44 #:use-module (gnu packages libsigsegv)
45 #:use-module (gnu packages admin)
46 #:use-module (gnu packages ed)
47 #:use-module (gnu packages m4)
48 #:use-module (gnu packages version-control)
49 #:use-module (ice-9 match)
50 #:use-module (srfi srfi-1))
51
52 (define (asdf-substitutions lisp)
53 ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's
54 ;; 'default-system-source-registry'.
55 `((("\\(,dir \"systems/\"\\)\\)")
56 (format #f
57 "(,dir \"~a-bundle-systems\")))
58
59 ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\")
60 :collect `(:directory (,dir \"systems\"))"
61 ,lisp))))
62
63 (define-public gcl
64 (package
65 (name "gcl")
66 (version "2.6.12")
67 (source
68 (origin
69 (method url-fetch)
70 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
71 (sha256
72 (base32 "1s4hs2qbjqmn9h88l4xvsifq5c3dlc5s74lyb61rdi5grhdlkf4f"))))
73 (build-system gnu-build-system)
74 (arguments
75 `(#:parallel-build? #f ; The build system seems not to be thread safe.
76 #:tests? #f ; There does not seem to be make check or anything similar.
77 #:configure-flags '("--enable-ansi") ; required for use by the maxima package
78 #:phases (alist-cons-before
79 'configure 'pre-conf
80 (lambda _
81 ;; Patch bug when building readline support. This bug was
82 ;; also observed by Debian
83 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741819
84 (substitute* "o/gcl_readline.d"
85 (("rl_attempted_completion_function = \
86 \\(CPPFunction \\*\\)rl_completion;")
87 "rl_attempted_completion_function = rl_completion;"))
88 (substitute*
89 (append
90 '("pcl/impl/kcl/makefile.akcl"
91 "add-defs"
92 "unixport/makefile.dos"
93 "add-defs.bat"
94 "gcl-tk/makefile.prev"
95 "add-defs1")
96 (find-files "h" "\\.defs"))
97 (("SHELL=/bin/(ba)?sh")
98 (string-append "SHELL=" (which "bash")))))
99 ;; drop strip phase to make maxima build, see
100 ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
101 (alist-delete 'strip
102 %standard-phases))))
103 (native-inputs
104 `(("m4" ,m4)
105 ("readline" ,readline)
106 ("texinfo" ,texinfo)
107 ("texlive" ,texlive)))
108 (home-page "http://www.gnu.org/software/gcl")
109 (synopsis "A Common Lisp implementation")
110 (description "GCL is an implementation of the Common Lisp language. It
111 features the ability to compile to native object code and to load native
112 object code modules directly into its lisp core. It also features a
113 stratified garbage collection strategy, a source-level debugger and a built-in
114 interface to the Tk widget system.")
115 (license license:lgpl2.0+)))
116
117 (define-public ecl
118 (package
119 (name "ecl")
120 (version "16.1.2")
121 (source
122 (origin
123 (method url-fetch)
124 (uri (string-append
125 "https://common-lisp.net/project/ecl/static/files/release/"
126 name "-" version ".tgz"))
127 (sha256
128 (base32 "16ab8qs3awvdxy8xs8jy82v8r04x4wr70l9l2j45vgag18d2nj1d"))
129 (modules '((guix build utils)))
130 (snippet
131 ;; Add ecl-bundle-systems to 'default-system-source-registry'.
132 `(substitute* "contrib/asdf/asdf.lisp"
133 ,@(asdf-substitutions name)))))
134 (build-system gnu-build-system)
135 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
136 (native-inputs `(("which" ,which)))
137 (inputs `(("gmp" ,gmp)
138 ("libatomic-ops" ,libatomic-ops)
139 ("libgc" ,libgc)
140 ("libffi" ,libffi)))
141 (arguments
142 '(#:tests? #t
143 #:make-flags `(,(string-append "ECL="
144 (assoc-ref %outputs "out")
145 "/bin/ecl"))
146 #:parallel-tests? #f
147 #:phases
148 (modify-phases %standard-phases
149 (delete 'check)
150 (add-after 'install 'wrap
151 (lambda* (#:key inputs outputs #:allow-other-keys)
152 (let* ((ecl (assoc-ref outputs "out"))
153 (input-path (lambda (lib path)
154 (string-append
155 (assoc-ref inputs lib) path)))
156 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
157 (binaries '("gcc" "ld-wrapper" "binutils"))
158 (library-directories
159 (map (lambda (lib) (input-path lib "/lib"))
160 libraries)))
161
162 (wrap-program (string-append ecl "/bin/ecl")
163 `("PATH" prefix
164 ,(map (lambda (binary)
165 (input-path binary "/bin"))
166 binaries))
167 `("CPATH" suffix
168 ,(map (lambda (lib)
169 (input-path lib "/include"))
170 `("kernel-headers" ,@libraries)))
171 `("LIBRARY_PATH" suffix ,library-directories)
172 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
173 (add-after 'wrap 'check (assoc-ref %standard-phases 'check)))))
174 (native-search-paths
175 (list (search-path-specification
176 (variable "XDG_DATA_DIRS")
177 (files '("share")))))
178 (home-page "http://ecls.sourceforge.net/")
179 (synopsis "Embeddable Common Lisp")
180 (description "ECL is an implementation of the Common Lisp language as
181 defined by the ANSI X3J13 specification. Its most relevant features are: a
182 bytecode compiler and interpreter, being able to compile Common Lisp with any
183 C/C++ compiler, being able to build standalone executables and libraries, and
184 supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
185 ;; Note that the file "Copyright" points to some files and directories
186 ;; which aren't under the lgpl2.0+ and instead contain many different,
187 ;; non-copyleft licenses.
188 (license license:lgpl2.0+)))
189
190 (define-public clisp
191 (package
192 (name "clisp")
193 (version "2.49")
194 (source
195 (origin
196 (method url-fetch)
197 (uri (string-append "mirror://gnu/clisp/release/" version
198 "/clisp-" version ".tar.gz"))
199 (sha256
200 (base32 "0rp82nqp5362isl9i34rwgg04cidz7izljd9d85pqcw1qr964bxx"))))
201 (build-system gnu-build-system)
202 (inputs `(("libffcall" ,libffcall)
203 ("readline" ,readline-6.2)
204 ("libsigsegv" ,libsigsegv)))
205 (arguments
206 '(;; XXX The custom configure script does not cope well when passed
207 ;; --build=<triplet>.
208 #:build #f
209 #:phases
210 (alist-cons-after
211 'unpack 'patch-sh-and-pwd
212 (lambda _
213 ;; The package is very messy with its references to "/bin/sh" and
214 ;; some other absolute paths to traditional tools. These appear in
215 ;; many places where our automatic patching misses them. Therefore
216 ;; we do the following, in this early (post-unpack) phase, to solve
217 ;; the problem from its root.
218 (substitute* (find-files "." "configure|Makefile")
219 (("/bin/sh") "sh"))
220 (substitute* '("src/clisp-link.in")
221 (("/bin/pwd") "pwd")))
222 (alist-cons-before
223 'build 'chdir-to-source
224 (lambda _
225 ;; We are supposed to call make under the src sub-directory.
226 (chdir "src"))
227 %standard-phases))
228 ;; Makefiles seem to have race conditions.
229 #:parallel-build? #f))
230 (home-page "http://www.clisp.org/")
231 (synopsis "A Common Lisp implementation")
232 (description
233 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
234 high-level, object-oriented functional programming language. CLISP includes
235 an interpreter, a compiler, a debugger, and much more.")
236 ;; Website says gpl2+, COPYRIGHT file says gpl2; actual source files have
237 ;; a lot of gpl3+. (Also some parts are under non-copyleft licenses, such
238 ;; as CLX by Texas Instruments.) In that case gpl3+ wins out.
239 (license license:gpl3+)))
240
241 (define-public sbcl
242 (package
243 (name "sbcl")
244 (version "1.3.7")
245 (source
246 (origin
247 (method url-fetch)
248 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
249 version "-source.tar.bz2"))
250 (sha256
251 (base32 "0fjdqnb2rsm2vi9794ywp27jr239ddvzc4xfr0dk49jd4v7p2kc5"))
252 (modules '((guix build utils)))
253 (snippet
254 ;; Add sbcl-bundle-systems to 'default-system-source-registry'.
255 `(substitute* "contrib/asdf/asdf.lisp"
256 ,@(asdf-substitutions name)))))
257 (build-system gnu-build-system)
258 (outputs '("out" "doc"))
259 ;; Bootstrap with CLISP.
260 (native-inputs
261 `(("clisp" ,clisp)
262 ("which" ,which)
263 ("inetutils" ,inetutils) ;for hostname(1)
264 ("ed" ,ed)
265 ("texlive" ,texlive)
266 ("texinfo" ,texinfo)))
267 (arguments
268 '(#:phases
269 (modify-phases %standard-phases
270 (delete 'configure)
271 (add-before 'build 'patch-unix-tool-paths
272 (lambda* (#:key outputs inputs #:allow-other-keys)
273 (let ((out (assoc-ref outputs "out"))
274 (bash (assoc-ref inputs "bash"))
275 (coreutils (assoc-ref inputs "coreutils"))
276 (ed (assoc-ref inputs "ed")))
277 (define (quoted-path input path)
278 (string-append "\"" input path "\""))
279 ;; Patch absolute paths in string literals. Note that this
280 ;; occurs in some .sh files too (which contain Lisp code). Use
281 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
282 (with-fluids ((%default-port-encoding #f))
283 ;; The removed file is utf-16-be encoded, which gives substitute*
284 ;; trouble. It does not contain references to the listed programs.
285 (substitute* (delete
286 "./tests/data/compile-file-pos-utf16be.lisp"
287 (find-files "." "\\.(lisp|sh)$"))
288 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
289 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
290 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
291 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
292 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
293 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
294 ;; This one script has a non-string occurrence of /bin/sh.
295 (substitute* '("tests/foreign.test.sh")
296 ;; Leave whitespace so we don't match the shebang.
297 ((" /bin/sh ") " sh "))
298 ;; This file contains a module that can create executable files
299 ;; which depend on the presence of SBCL. It generates shell
300 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
301 ;; the shebang and the reference to "sbcl", tying the generated
302 ;; executables to the exact SBCL package that generated them.
303 (substitute* '("contrib/sb-executable/sb-executable.lisp")
304 (("/bin/sh") (string-append bash "/bin/sh"))
305 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
306 ;; Disable some tests that fail in our build environment.
307 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
308 ;; This requires /etc/protocols.
309 (("\\(deftest get-protocol-by-name/error" all)
310 (string-append "#+nil ;disabled by Guix\n" all)))
311 (substitute* '("contrib/sb-posix/posix-tests.lisp")
312 ;; These assume some users/groups which we don't have.
313 (("\\(deftest pwent\\.[12]" all)
314 (string-append "#+nil ;disabled by Guix\n" all))
315 (("\\(deftest grent\\.[12]" all)
316 (string-append "#+nil ;disabled by Guix\n" all))))))
317 (replace 'build
318 (lambda* (#:key outputs #:allow-other-keys)
319 (setenv "CC" "gcc")
320 (zero? (system* "sh" "make.sh" "clisp"
321 (string-append "--prefix="
322 (assoc-ref outputs "out"))))))
323 (replace 'install
324 (lambda _
325 (zero? (system* "sh" "install.sh"))))
326 (add-after 'build 'build-doc
327 (lambda _
328 (with-directory-excursion "doc/manual"
329 (and (zero? (system* "make" "info"))
330 (zero? (system* "make" "dist"))))))
331 (add-after 'install 'install-doc
332 (lambda* (#:key outputs #:allow-other-keys)
333 (let* ((out (assoc-ref outputs "out"))
334 (doc (assoc-ref outputs "doc"))
335 (old-doc-dir (string-append out "/share/doc"))
336 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
337 (rmdir (string-append old-doc-dir "/sbcl/html"))
338 (mkdir-p new-doc/sbcl-dir)
339 (copy-recursively (string-append old-doc-dir "/sbcl")
340 new-doc/sbcl-dir)
341 (delete-file-recursively old-doc-dir)
342 #t))))
343 ;; No 'check' target, though "make.sh" (build phase) runs tests.
344 #:tests? #f))
345 (native-search-paths
346 (list (search-path-specification
347 (variable "XDG_DATA_DIRS")
348 (files '("share")))))
349 (home-page "http://www.sbcl.org/")
350 (synopsis "Common Lisp implementation")
351 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
352 Lisp compiler. In addition to the compiler and runtime system for ANSI Common
353 Lisp, it provides an interactive environment including a debugger, a
354 statistical profiler, a code coverage tool, and many other extensions.")
355 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
356 ;; loop macro has its own license. See COPYING file for further notes.
357 (license (list license:public-domain license:bsd-2
358 (license:x11-style "file://src/code/loop.lisp")))))
359
360 (define-public ccl
361 (package
362 (name "ccl")
363 (version "1.11")
364 (source #f)
365 (build-system gnu-build-system)
366 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
367 ;; shipped in precompiled form in source tarballs. The former is a C
368 ;; program which we can rebuild from scratch, but the latter cannot be
369 ;; generated without an already working copy of CCL, and is platform
370 ;; dependent, so we need to fetch the correct tarball for the platform.
371 (inputs
372 `(("ccl"
373 ,(origin
374 (method url-fetch)
375 (uri (string-append
376 "ftp://ftp.clozure.com/pub/release/" version
377 "/ccl-" version "-"
378 (match (%current-system)
379 ((or "i686-linux" "x86_64-linux") "linuxx86")
380 ("armhf-linux" "linuxarm")
381 ;; Prevent errors when querying this package on unsupported
382 ;; platforms, e.g. when running "guix package --search="
383 (_ "UNSUPPORTED"))
384 ".tar.gz"))
385 (sha256
386 (base32
387 (match (%current-system)
388 ((or "i686-linux" "x86_64-linux")
389 "0w3dmj7q9kqyra3yrf1lxclnjz151yvf5s5q8ayllvmvqbl8bs08")
390 ("armhf-linux"
391 "1x487aaz2rqcb6k301sy2p39a1m4qdhg6z9p9fb76ssipqgr38b4")
392 (_ ""))))))))
393 (native-inputs
394 `(("m4" ,m4)
395 ("subversion" ,subversion)))
396 (arguments
397 `(#:tests? #f ;no 'check' target
398 #:phases
399 (alist-replace
400 'unpack
401 (lambda* (#:key inputs #:allow-other-keys)
402 (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl")))
403 (begin (chdir "ccl") #t)))
404 (alist-delete
405 'configure
406 (alist-cons-before
407 'build 'pre-build
408 ;; Enter the source directory for the current platform's lisp
409 ;; kernel, and run 'make clean' to remove the precompiled one.
410 (lambda _
411 (chdir (string-append
412 "lisp-kernel/"
413 ,(match (or (%current-target-system) (%current-system))
414 ("i686-linux" "linuxx8632")
415 ("x86_64-linux" "linuxx8664")
416 ("armhf-linux" "linuxarm")
417 ;; Prevent errors when querying this package
418 ;; on unsupported platforms, e.g. when running
419 ;; "guix package --search="
420 (_ "UNSUPPORTED"))))
421 (substitute* '("Makefile")
422 (("/bin/rm") "rm"))
423 (setenv "CC" "gcc")
424 (zero? (system* "make" "clean")))
425 ;; XXX Do we need to recompile the heap image as well for Guix?
426 ;; For now just use the one we already got in the tarball.
427 (alist-replace
428 'install
429 (lambda* (#:key outputs inputs #:allow-other-keys)
430 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
431 ;; is put back into the original directory, so go back. The heap
432 ;; image is there as well.
433 (chdir "../..")
434 (let* ((out (assoc-ref outputs "out"))
435 (libdir (string-append out "/lib/"))
436 (bindir (string-append out "/bin/"))
437 (wrapper (string-append bindir "ccl"))
438 (bash (assoc-ref inputs "bash"))
439 (kernel
440 ,(match (or (%current-target-system) (%current-system))
441 ("i686-linux" "lx86cl")
442 ("x86_64-linux" "lx86cl64")
443 ("armhf-linux" "armcl")
444 ;; Prevent errors when querying this package
445 ;; on unsupported platforms, e.g. when running
446 ;; "guix package --search="
447 (_ "UNSUPPORTED")))
448 (heap (string-append kernel ".image")))
449 (mkdir-p libdir)
450 (mkdir-p bindir)
451 (copy-file kernel (string-append libdir kernel))
452 (copy-file heap (string-append libdir heap))
453 (with-output-to-file wrapper
454 (lambda ()
455 (display
456 (string-append
457 "#!" bash "/bin/sh\n"
458 "if [ -z \"$CCL_DEFAULT_DIRECTORY\" ]; then\n"
459 " CCL_DEFAULT_DIRECTORY=" libdir "\n"
460 "fi\n"
461 "export CCL_DEFAULT_DIRECTORY\n"
462 "exec " libdir kernel "\n"))))
463 (chmod wrapper #o755)))
464 %standard-phases))))))
465 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
466 (home-page "http://ccl.clozure.com/")
467 (synopsis "Common Lisp implementation")
468 (description "Clozure CL (often called CCL for short) is a Common Lisp
469 implementation featuring fast compilation speed, native threads, a precise,
470 generational, compacting garbage collector, and a convenient foreign-function
471 interface.")
472 ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL
473 ;; applies to Lisp code according to them.
474 (license (list license:lgpl2.1
475 license:clarified-artistic)))) ;TRIVIAL-LDAP package
476
477 (define-public femtolisp
478 (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b")
479 (revision "1"))
480 (package
481 (name "femtolisp")
482 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
483 (source (origin
484 (method git-fetch)
485 (uri (git-reference
486 (url "https://github.com/JeffBezanson/femtolisp.git")
487 (commit commit)))
488 (file-name (string-append name "-" version "-checkout"))
489 (sha256
490 (base32
491 "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja"))))
492 ;; See "utils.h" for supported systems. Upstream bug:
493 ;; https://github.com/JeffBezanson/femtolisp/issues/25
494 (supported-systems
495 (fold delete %supported-systems
496 '("armhf-linux" "mips64el-linux")))
497 (build-system gnu-build-system)
498 (arguments
499 `(#:make-flags '("CC=gcc" "release")
500 #:test-target "test"
501 #:phases
502 (modify-phases %standard-phases
503 (delete 'configure) ; No configure script
504 (replace 'install ; Makefile has no 'install phase
505 (lambda* (#:key outputs #:allow-other-keys)
506 (let* ((out (assoc-ref outputs "out"))
507 (bin (string-append out "/bin")))
508 (install-file "flisp" bin)
509 #t)))
510 ;; The flisp binary is now available, run bootstrap to
511 ;; generate flisp.boot and afterwards runs make test.
512 (add-after 'install 'bootstrap-gen-and-test
513 (lambda* (#:key outputs #:allow-other-keys)
514 (let* ((out (assoc-ref outputs "out"))
515 (bin (string-append out "/bin")))
516 (and
517 (zero? (system* "./bootstrap.sh"))
518 (install-file "flisp.boot" bin))))))))
519 (synopsis "Scheme-like lisp implementation")
520 (description
521 "@code{femtolisp} is a scheme-like lisp implementation with a
522 simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
523 The core is 12 builtin special forms and 33 builtin functions.")
524 (home-page "https://github.com/JeffBezanson/femtolisp")
525 (license license:bsd-3))))
526
527 (define-public sbcl-alexandria
528 (let ((revision "1")
529 (commit "926a066611b7b11cb71e26c827a271e500888c30"))
530 (package
531 (name "sbcl-alexandria")
532 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
533 (source
534 (origin
535 (method git-fetch)
536 (uri (git-reference
537 (url "https://gitlab.common-lisp.net/alexandria/alexandria.git")
538 (commit commit)))
539 (sha256
540 (base32
541 "18yncicdkh294j05rhgm23gzi36y9qy6vrfba8vg69jrxjp1hx8l"))
542 (file-name (string-append "alexandria-" version "-checkout"))))
543 (build-system asdf-build-system/sbcl)
544 (synopsis "Collection of portable utilities for Common Lisp")
545 (description
546 "Alexandria is a collection of portable utilities. It does not contain
547 conceptual extensions to Common Lisp. It is conservative in scope, and
548 portable between implementations.")
549 (home-page "https://common-lisp.net/project/alexandria/")
550 (license license:public-domain))))
551
552 (define-public cl-alexandria
553 (sbcl-package->cl-source-package sbcl-alexandria))
554
555 (define-public ecl-alexandria
556 (sbcl-package->ecl-package sbcl-alexandria))
557
558 (define-public sbcl-fiveam
559 (package
560 (name "sbcl-fiveam")
561 (version "1.2")
562 (source
563 (origin
564 (method url-fetch)
565 (uri (string-append
566 "https://github.com/sionescu/fiveam/archive/v"
567 version ".tar.gz"))
568 (sha256
569 (base32 "0f48pcbhqs3wwwzjl5nk57d4hcbib4l9xblxc66b8c2fhvhmhxnv"))
570 (file-name (string-append "fiveam-" version ".tar.gz"))))
571 (inputs `(("sbcl-alexandria" ,sbcl-alexandria)))
572 (build-system asdf-build-system/sbcl)
573 (synopsis "Common Lisp testing framework")
574 (description "FiveAM is a simple (as far as writing and running tests
575 goes) regression testing framework. It has been designed with Common Lisp's
576 interactive development model in mind.")
577 (home-page "https://common-lisp.net/project/fiveam/")
578 (license license:bsd-3)))
579
580 (define-public cl-fiveam
581 (sbcl-package->cl-source-package sbcl-fiveam))
582
583 (define-public ecl-fiveam
584 (sbcl-package->ecl-package sbcl-fiveam))
585
586 (define-public sbcl-bordeaux-threads
587 (package
588 (name "sbcl-bordeaux-threads")
589 (version "0.8.5")
590 (source (origin
591 (method url-fetch)
592 (uri (string-append
593 "https://github.com/sionescu/bordeaux-threads/archive/v"
594 version ".tar.gz"))
595 (sha256
596 (base32 "10ryrcx832fwqdawb6jmknymi7wpdzhi30qzx7cbrk0cpnka71w2"))
597 (file-name
598 (string-append "bordeaux-threads-" version ".tar.gz"))))
599 (inputs `(("sbcl-alexandria" ,sbcl-alexandria)))
600 (native-inputs `(("tests:cl-fiveam" ,sbcl-fiveam)))
601 (build-system asdf-build-system/sbcl)
602 (synopsis "Portable shared-state concurrency library for Common Lisp")
603 (description "BORDEAUX-THREADS is a proposed standard for a minimal
604 MP/Threading interface. It is similar to the CLIM-SYS threading and lock
605 support.")
606 (home-page "https://common-lisp.net/project/bordeaux-threads/")
607 (license license:x11)))
608
609 (define-public cl-bordeaux-threads
610 (sbcl-package->cl-source-package sbcl-bordeaux-threads))
611
612 (define-public ecl-bordeaux-threads
613 (sbcl-package->ecl-package sbcl-bordeaux-threads))
614
615 (define-public sbcl-trivial-gray-streams
616 (let ((revision "1")
617 (commit "0483ade330508b4b2edeabdb47d16ec9437ee1cb"))
618 (package
619 (name "sbcl-trivial-gray-streams")
620 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
621 (source
622 (origin
623 (method git-fetch)
624 (uri
625 (git-reference
626 (url "https://github.com/trivial-gray-streams/trivial-gray-streams.git")
627 (commit commit)))
628 (sha256
629 (base32 "0m3rpf2x0zmdk3nf1qfa01j6a55vj7gkwhyw78qslcgbjlgh8p4d"))
630 (file-name
631 (string-append "trivial-gray-streams-" version "-checkout"))))
632 (build-system asdf-build-system/sbcl)
633 (synopsis "Compatibility layer for Gray streams implementations")
634 (description "Gray streams is an interface proposed for inclusion with
635 ANSI CL by David N. Gray. The proposal did not make it into ANSI CL, but most
636 popular CL implementations implement it. This package provides an extremely
637 thin compatibility layer for gray streams.")
638 (home-page "http://www.cliki.net/trivial-gray-streams")
639 (license license:x11))))
640
641 (define-public cl-trivial-gray-streams
642 (sbcl-package->cl-source-package sbcl-trivial-gray-streams))
643
644 (define-public ecl-trivial-gray-streams
645 (sbcl-package->ecl-package sbcl-trivial-gray-streams))
646
647 (define-public sbcl-flexi-streams
648 (package
649 (name "sbcl-flexi-streams")
650 (version "1.0.12")
651 (source
652 (origin
653 (method url-fetch)
654 (uri (string-append
655 "https://github.com/edicl/flexi-streams/archive/v"
656 version ".tar.gz"))
657 (sha256
658 (base32 "16grnxvs7vqm5s6myf8a5s7vwblzq1kgwj8i7ahz8vwvihm9gzfi"))
659 (file-name (string-append "flexi-streams-" version ".tar.gz"))))
660 (build-system asdf-build-system/sbcl)
661 (inputs `(("sbcl-trivial-gray-streams" ,sbcl-trivial-gray-streams)))
662 (synopsis "Implementation of virtual bivalent streams for Common Lisp")
663 (description "Flexi-streams is an implementation of \"virtual\" bivalent
664 streams that can be layered atop real binary or bivalent streams and that can
665 be used to read and write character data in various single- or multi-octet
666 encodings which can be changed on the fly. It also supplies in-memory binary
667 streams which are similar to string streams.")
668 (home-page "http://weitz.de/flexi-streams/")
669 (license license:bsd-3)))
670
671 (define-public cl-flexi-streams
672 (sbcl-package->cl-source-package sbcl-flexi-streams))
673
674 (define-public ecl-flexi-streams
675 (sbcl-package->ecl-package sbcl-flexi-streams))
676
677 (define-public sbcl-cl-ppcre
678 (package
679 (name "sbcl-cl-ppcre")
680 (version "2.0.11")
681 (source
682 (origin
683 (method url-fetch)
684 (uri (string-append
685 "https://github.com/edicl/cl-ppcre/archive/v"
686 version ".tar.gz"))
687 (sha256
688 (base32 "1i7daxf0wnydb0pgwiym7qh2wy70n14lxd6dyv28sy0naa8p31gd"))
689 (file-name (string-append "cl-ppcre-" version ".tar.gz"))))
690 (build-system asdf-build-system/sbcl)
691 (native-inputs `(("tests:cl-flexi-streams" ,sbcl-flexi-streams)))
692 (synopsis "Portable regular expression library for Common Lisp")
693 (description "CL-PPCRE is a portable regular expression library for Common
694 Lisp, which is compatible with perl. It is pretty fast, thread-safe, and
695 compatible with ANSI-compliant Common Lisp implementations.")
696 (home-page "http://weitz.de/cl-ppcre/")
697 (license license:bsd-2)))
698
699 (define-public cl-ppcre
700 (sbcl-package->cl-source-package sbcl-cl-ppcre))
701
702 (define-public ecl-cl-ppcre
703 (sbcl-package->ecl-package sbcl-cl-ppcre))
704
705 (define-public sbcl-clx
706 (let ((revision "1")
707 (commit "1c62774b03c1cf3fe6e5cb532df8b14b44c96b95"))
708 (package
709 (name "sbcl-clx")
710 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
711 (source
712 (origin
713 (method git-fetch)
714 (uri
715 (git-reference
716 (url "https://github.com/sharplispers/clx.git")
717 (commit commit)))
718 (sha256
719 (base32 "0qffag03ns52kwq9xjns2qg1yr0bf3ba507iwq5cmx5xz0b0rmjm"))
720 (file-name (string-append "clx-" version "-checkout"))
721 (patches
722 (list
723 (search-patch "clx-remove-demo.patch")))
724 (modules '((guix build utils)))
725 (snippet
726 '(begin
727 ;; These removed files cause the compiled system to crash when
728 ;; loading.
729 (delete-file-recursively "demo")
730 (delete-file "test/trapezoid.lisp")
731 (substitute* "clx.asd"
732 (("\\(:file \"trapezoid\"\\)") ""))))))
733 (build-system asdf-build-system/sbcl)
734 (arguments
735 '(#:special-dependencies '("sb-bsd-sockets")))
736 (home-page "http://www.cliki.net/portable-clx")
737 (synopsis "X11 client library for Common Lisp")
738 (description "CLX is an X11 client library for Common Lisp. The code was
739 originally taken from a CMUCL distribution, was modified somewhat in order to
740 make it compile and run under SBCL, then a selection of patches were added
741 from other CLXes around the net.")
742 (license license:x11))))
743
744 (define-public cl-clx
745 (sbcl-package->cl-source-package sbcl-clx))
746
747 (define-public ecl-clx
748 (sbcl-package->ecl-package sbcl-clx))
749
750 (define-public sbcl-stumpwm
751 (package
752 (name "sbcl-stumpwm")
753 (version "0.9.9")
754 (source (origin
755 (method url-fetch)
756 (uri (string-append
757 "https://github.com/stumpwm/stumpwm/archive/"
758 version ".tar.gz"))
759 (sha256
760 (base32 "1fqabij4zcsqg1ywgdv2irp1ys23dwc8ms9ai55lb2i47hgv7z3x"))
761 (file-name (string-append "stumpwm-" version ".tar.gz"))))
762 (build-system asdf-build-system/sbcl)
763 (inputs `(("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
764 ("sbcl-clx" ,sbcl-clx)))
765 (outputs '("out" "bin"))
766 (arguments
767 '(#:special-dependencies '("sb-posix")
768 #:phases
769 (modify-phases %standard-phases
770 (add-after 'create-symlinks 'build-program
771 (lambda* (#:key lisp outputs inputs #:allow-other-keys)
772 (build-program
773 lisp
774 (string-append (assoc-ref outputs "bin") "/bin/stumpwm")
775 #:inputs inputs
776 #:entry-program '((stumpwm:stumpwm) 0))))
777 (add-after 'build-program 'create-desktop-file
778 (lambda* (#:key outputs lisp binary? #:allow-other-keys)
779 (let ((output (or (assoc-ref outputs "bin")
780 (assoc-ref outputs "out")))
781 (xsessions "/share/xsessions"))
782 (mkdir-p (string-append output xsessions))
783 (with-output-to-file
784 (string-append output xsessions
785 "/stumpwm.desktop")
786 (lambda _
787 (format #t
788 "[Desktop Entry]~@
789 Name=stumpwm~@
790 Comment=The Stump Window Manager~@
791 Exec=~a/bin/stumpwm~@
792 TryExec=~@*~a/bin/stumpwm~@
793 Icon=~@
794 Type=Application~%"
795 output)))
796 #t))))))
797 (synopsis "Window manager written in Common Lisp")
798 (description "Stumpwm is a window manager written entirely in Common Lisp.
799 It attempts to be highly customizable while relying entirely on the keyboard
800 for input. These design decisions reflect the growing popularity of
801 productive, customizable lisp based systems.")
802 (home-page "http://github.com/stumpwm/stumpwm")
803 (license license:gpl2+)
804 (properties `((ecl-variant . ,(delay ecl-stumpwm))))))
805
806 (define-public cl-stumpwm
807 (sbcl-package->cl-source-package sbcl-stumpwm))
808
809 (define-public ecl-stumpwm
810 (let ((base (sbcl-package->ecl-package sbcl-stumpwm)))
811 (package
812 (inherit base)
813 (outputs '("out"))
814 (arguments '()))))
815
816 (define sbcl-slynk-boot0
817 (let ((revision "1")
818 (commit "5706cd45d484a4f25795abe8e643509d31968aa2"))
819 (package
820 (name "sbcl-slynk")
821 (version (string-append "1.0.0-beta-" revision "." (string-take commit 7)))
822 (source
823 (origin
824 (method git-fetch)
825 (uri
826 (git-reference
827 (url "https://github.com/joaotavora/sly.git")
828 (commit commit)))
829 (sha256
830 (base32 "0h4gg3sndl2bf6jdnx9nrf14p9hhi43hagrl0f4v4l11hczl8w81"))
831 (file-name (string-append "slynk-" version "-checkout"))
832 (modules '((guix build utils)
833 (ice-9 ftw)))
834 (snippet
835 '(begin
836 ;; Move the contribs into the main source directory for easier
837 ;; access
838 (substitute* "slynk/slynk.asd"
839 (("\\.\\./contrib")
840 "contrib")
841 (("\\(defsystem :slynk-util")
842 "(defsystem :slynk-util :depends-on (:slynk)"))
843 (substitute* "contrib/slynk-trace-dialog.lisp"
844 (("\\(slynk::reset-inspector\\)") ; Causes problems on load
845 "nil"))
846 (substitute* "contrib/slynk-profiler.lisp"
847 (("slynk:to-line")
848 "slynk-pprint-to-line"))
849 (rename-file "contrib" "slynk/contrib")
850 ;; Move slynk's contents into the base directory for easier
851 ;; access
852 (for-each
853 (lambda (file)
854 (unless (string-prefix? "." file)
855 (rename-file (string-append "slynk/" file)
856 (string-append "./" (basename file)))))
857 (scandir "slynk"))))))
858 (build-system asdf-build-system/sbcl)
859 (arguments
860 `(#:tests? #f)) ; No test suite
861 (synopsis "Common Lisp IDE for Emacs")
862 (description "SLY is a fork of SLIME. It also features a completely
863 redesigned REPL based on Emacs's own full-featured comint.el, live code
864 annotations, and a consistent interactive button interface. Everything can be
865 copied to the REPL. One can create multiple inspectors with independent
866 history.")
867 (home-page "https://github.com/joaotavora/sly")
868 (license license:public-domain)
869 (properties `((cl-source-variant . ,(delay cl-slynk)))))))
870
871 (define-public cl-slynk
872 (sbcl-package->cl-source-package sbcl-slynk-boot0))
873
874 (define ecl-slynk-boot0
875 (sbcl-package->ecl-package sbcl-slynk-boot0))
876
877 (define sbcl-slynk-arglists
878 (package
879 (inherit sbcl-slynk-boot0)
880 (name "sbcl-slynk-arglists")
881 (inputs `(("sbcl-slynk" ,sbcl-slynk-boot0)))
882 (arguments
883 `(#:asd-file "slynk.asd"
884 ,@(package-arguments sbcl-slynk-boot0)))))
885
886 (define ecl-slynk-arglists
887 (sbcl-package->ecl-package sbcl-slynk-arglists))
888
889 (define sbcl-slynk-util
890 (package
891 (inherit sbcl-slynk-arglists)
892 (name "sbcl-slynk-util")))
893
894 (define ecl-slynk-util
895 (sbcl-package->ecl-package sbcl-slynk-util))
896
897 (define sbcl-slynk-fancy-inspector
898 (package
899 (inherit sbcl-slynk-arglists)
900 (name "sbcl-slynk-fancy-inspector")
901 (inputs `(("sbcl-slynk-util" ,sbcl-slynk-util)
902 ,@(package-inputs sbcl-slynk-arglists)))))
903
904 (define ecl-slynk-fancy-inspector
905 (sbcl-package->ecl-package sbcl-slynk-fancy-inspector))
906
907 (define sbcl-slynk-package-fu
908 (package
909 (inherit sbcl-slynk-arglists)
910 (name "sbcl-slynk-package-fu")))
911
912 (define ecl-slynk-package-fu
913 (sbcl-package->ecl-package sbcl-slynk-package-fu))
914
915 (define sbcl-slynk-mrepl
916 (package
917 (inherit sbcl-slynk-arglists)
918 (name "sbcl-slynk-mrepl")))
919
920 (define ecl-slynk-mrepl
921 (sbcl-package->ecl-package sbcl-slynk-mrepl))
922
923 (define sbcl-slynk-trace-dialog
924 (package
925 (inherit sbcl-slynk-arglists)
926 (name "sbcl-slynk-trace-dialog")))
927
928 (define ecl-slynk-trace-dialog
929 (sbcl-package->ecl-package sbcl-slynk-trace-dialog))
930
931 (define sbcl-slynk-profiler
932 (package
933 (inherit sbcl-slynk-arglists)
934 (name "sbcl-slynk-profiler")))
935
936 (define ecl-slynk-profiler
937 (sbcl-package->ecl-package sbcl-slynk-profiler))
938
939 (define sbcl-slynk-stickers
940 (package
941 (inherit sbcl-slynk-arglists)
942 (name "sbcl-slynk-stickers")))
943
944 (define ecl-slynk-stickers
945 (sbcl-package->ecl-package sbcl-slynk-stickers))
946
947 (define sbcl-slynk-indentation
948 (package
949 (inherit sbcl-slynk-arglists)
950 (name "sbcl-slynk-indentation")))
951
952 (define ecl-slynk-indentation
953 (sbcl-package->ecl-package sbcl-slynk-indentation))
954
955 (define sbcl-slynk-retro
956 (package
957 (inherit sbcl-slynk-arglists)
958 (name "sbcl-slynk-retro")))
959
960 (define ecl-slynk-retro
961 (sbcl-package->ecl-package sbcl-slynk-retro))
962
963 (define slynk-systems
964 '("slynk"
965 "slynk-util"
966 "slynk-arglists"
967 "slynk-fancy-inspector"
968 "slynk-package-fu"
969 "slynk-mrepl"
970 "slynk-profiler"
971 "slynk-trace-dialog"
972 "slynk-stickers"
973 "slynk-indentation"
974 "slynk-retro"))
975
976 (define-public sbcl-slynk
977 (package
978 (inherit sbcl-slynk-boot0)
979 (inputs
980 `(("slynk" ,sbcl-slynk-boot0)
981 ("slynk-util" ,sbcl-slynk-util)
982 ("slynk-arglists" ,sbcl-slynk-arglists)
983 ("slynk-fancy-inspector" ,sbcl-slynk-fancy-inspector)
984 ("slynk-package-fu" ,sbcl-slynk-package-fu)
985 ("slynk-mrepl" ,sbcl-slynk-mrepl)
986 ("slynk-profiler" ,sbcl-slynk-profiler)
987 ("slynk-trace-dialog" ,sbcl-slynk-trace-dialog)
988 ("slynk-stickers" ,sbcl-slynk-stickers)
989 ("slynk-indentation" ,sbcl-slynk-indentation)
990 ("slynk-retro" ,sbcl-slynk-retro)))
991 (native-inputs `(("sbcl" ,sbcl)))
992 (build-system trivial-build-system)
993 (source #f)
994 (outputs '("out" "image"))
995 (arguments
996 `(#:modules ((guix build union)
997 (guix build utils)
998 (guix build lisp-utils))
999 #:builder
1000 (begin
1001 (use-modules (ice-9 match)
1002 (srfi srfi-1)
1003 (guix build union)
1004 (guix build lisp-utils))
1005
1006 (union-build
1007 (assoc-ref %outputs "out")
1008 (filter-map
1009 (match-lambda
1010 ((name . path)
1011 (if (string-prefix? "slynk" name) path #f)))
1012 %build-inputs))
1013
1014 (prepend-to-source-registry
1015 (string-append (assoc-ref %outputs "out") "//"))
1016 (build-image "sbcl"
1017 (string-append
1018 (assoc-ref %outputs "image")
1019 "/bin/slynk")
1020 #:inputs %build-inputs
1021 #:dependencies ',slynk-systems))))))
1022
1023 (define-public ecl-slynk
1024 (package
1025 (inherit sbcl-slynk)
1026 (name "ecl-slynk")
1027 (inputs
1028 (map (match-lambda
1029 ((name pkg . _)
1030 (list name (sbcl-package->ecl-package pkg))))
1031 (package-inputs sbcl-slynk)))
1032 (native-inputs '())
1033 (outputs '("out"))
1034 (arguments
1035 '(#:modules ((guix build union))
1036 #:builder
1037 (begin
1038 (use-modules (ice-9 match)
1039 (guix build union))
1040 (match %build-inputs
1041 (((names . paths) ...)
1042 (union-build (assoc-ref %outputs "out")
1043 paths))))))))
1044
1045 (define-public sbcl-stumpwm+slynk
1046 (package
1047 (inherit sbcl-stumpwm)
1048 (name "sbcl-stumpwm-with-slynk")
1049 (outputs '("out"))
1050 (native-inputs
1051 `(("stumpwm" ,sbcl-stumpwm)
1052 ("slynk" ,sbcl-slynk)))
1053 (arguments
1054 (substitute-keyword-arguments (package-arguments sbcl-stumpwm)
1055 ((#:phases phases)
1056 `(modify-phases ,phases
1057 (replace 'build-program
1058 (lambda* (#:key lisp inputs outputs #:allow-other-keys)
1059 (let* ((out (assoc-ref outputs "out"))
1060 (program (string-append out "/bin/stumpwm")))
1061 (build-program lisp program
1062 #:inputs inputs
1063 #:entry-program '((stumpwm:stumpwm) 0)
1064 #:dependencies '("stumpwm"
1065 ,@slynk-systems))
1066 ;; Remove unneeded file.
1067 (delete-file (string-append out "/bin/stumpwm-exec.fasl"))
1068 #t)))
1069 (delete 'copy-source)
1070 (delete 'build)
1071 (delete 'check)
1072 (delete 'link-dependencies)
1073 (delete 'cleanup)
1074 (delete 'create-symlinks)))))))