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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
52 (define (asdf-substitutions lisp)
53 ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's
54 ;; 'default-system-source-registry'.
55 `((("\\(,dir \"systems/\"\\)\\)")
57 "(,dir \"~a-bundle-systems\")))
59 ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\")
60 :collect `(:directory (,dir \"systems\"))"
70 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
72 (base32 "1s4hs2qbjqmn9h88l4xvsifq5c3dlc5s74lyb61rdi5grhdlkf4f"))))
73 (build-system gnu-build-system)
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
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;"))
90 '("pcl/impl/kcl/makefile.akcl"
92 "unixport/makefile.dos"
94 "gcl-tk/makefile.prev"
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
105 ("readline" ,readline)
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+)))
125 "https://common-lisp.net/project/ecl/static/files/release/"
126 name "-" version ".tgz"))
128 (base32 "16ab8qs3awvdxy8xs8jy82v8r04x4wr70l9l2j45vgag18d2nj1d"))
129 (modules '((guix build utils)))
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)
143 #:make-flags `(,(string-append "ECL="
144 (assoc-ref %outputs "out")
148 (modify-phases %standard-phases
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)
155 (assoc-ref inputs lib) path)))
156 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
157 (binaries '("gcc" "ld-wrapper" "binutils"))
159 (map (lambda (lib) (input-path lib "/lib"))
162 (wrap-program (string-append ecl "/bin/ecl")
164 ,(map (lambda (binary)
165 (input-path binary "/bin"))
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)))))
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+)))
197 (uri (string-append "mirror://gnu/clisp/release/" version
198 "/clisp-" version ".tar.gz"))
200 (base32 "0rp82nqp5362isl9i34rwgg04cidz7izljd9d85pqcw1qr964bxx"))))
201 (build-system gnu-build-system)
202 (inputs `(("libffcall" ,libffcall)
203 ("readline" ,readline-6.2)
204 ("libsigsegv" ,libsigsegv)))
206 '(;; XXX The custom configure script does not cope well when passed
207 ;; --build=<triplet>.
211 'unpack 'patch-sh-and-pwd
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")
220 (substitute* '("src/clisp-link.in")
221 (("/bin/pwd") "pwd")))
223 'build 'chdir-to-source
225 ;; We are supposed to call make under the src sub-directory.
228 ;; Makefiles seem to have race conditions.
229 #:parallel-build? #f))
230 (home-page "http://www.clisp.org/")
231 (synopsis "A Common Lisp implementation")
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+)))
248 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
249 version "-source.tar.bz2"))
251 (base32 "0fjdqnb2rsm2vi9794ywp27jr239ddvzc4xfr0dk49jd4v7p2kc5"))
252 (modules '((guix build utils)))
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.
263 ("inetutils" ,inetutils) ;for hostname(1)
266 ("texinfo" ,texinfo)))
269 (modify-phases %standard-phases
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.
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))))))
318 (lambda* (#:key outputs #:allow-other-keys)
320 (zero? (system* "sh" "make.sh" "clisp"
321 (string-append "--prefix="
322 (assoc-ref outputs "out"))))))
325 (zero? (system* "sh" "install.sh"))))
326 (add-after 'build 'build-doc
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")
341 (delete-file-recursively old-doc-dir)
343 ;; No 'check' target, though "make.sh" (build phase) runs tests.
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")))))
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.
376 "ftp://ftp.clozure.com/pub/release/" 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="
387 (match (%current-system)
388 ((or "i686-linux" "x86_64-linux")
389 "0w3dmj7q9kqyra3yrf1lxclnjz151yvf5s5q8ayllvmvqbl8bs08")
391 "1x487aaz2rqcb6k301sy2p39a1m4qdhg6z9p9fb76ssipqgr38b4")
395 ("subversion" ,subversion)))
397 `(#:tests? #f ;no 'check' target
401 (lambda* (#:key inputs #:allow-other-keys)
402 (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl")))
403 (begin (chdir "ccl") #t)))
408 ;; Enter the source directory for the current platform's lisp
409 ;; kernel, and run 'make clean' to remove the precompiled one.
411 (chdir (string-append
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="
421 (substitute* '("Makefile")
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.
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.
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"))
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="
448 (heap (string-append kernel ".image")))
451 (copy-file kernel (string-append libdir kernel))
452 (copy-file heap (string-append libdir heap))
453 (with-output-to-file wrapper
457 "#!" bash "/bin/sh\n"
458 "if [ -z \"$CCL_DEFAULT_DIRECTORY\" ]; then\n"
459 " CCL_DEFAULT_DIRECTORY=" libdir "\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
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
477 (define-public femtolisp
478 (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b")
482 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
486 (url "https://github.com/JeffBezanson/femtolisp.git")
488 (file-name (string-append name "-" version "-checkout"))
491 "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja"))))
492 ;; See "utils.h" for supported systems. Upstream bug:
493 ;; https://github.com/JeffBezanson/femtolisp/issues/25
495 (fold delete %supported-systems
496 '("armhf-linux" "mips64el-linux")))
497 (build-system gnu-build-system)
499 `(#:make-flags '("CC=gcc" "release")
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)
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")))
517 (zero? (system* "./bootstrap.sh"))
518 (install-file "flisp.boot" bin))))))))
519 (synopsis "Scheme-like lisp implementation")
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))))
527 (define-public sbcl-alexandria
529 (commit "926a066611b7b11cb71e26c827a271e500888c30"))
531 (name "sbcl-alexandria")
532 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
537 (url "https://gitlab.common-lisp.net/alexandria/alexandria.git")
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")
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))))
552 (define-public cl-alexandria
553 (sbcl-package->cl-source-package sbcl-alexandria))
555 (define-public ecl-alexandria
556 (sbcl-package->ecl-package sbcl-alexandria))
558 (define-public sbcl-fiveam
566 "https://github.com/sionescu/fiveam/archive/v"
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)))
580 (define-public cl-fiveam
581 (sbcl-package->cl-source-package sbcl-fiveam))
583 (define-public ecl-fiveam
584 (sbcl-package->ecl-package sbcl-fiveam))
586 (define-public sbcl-bordeaux-threads
588 (name "sbcl-bordeaux-threads")
593 "https://github.com/sionescu/bordeaux-threads/archive/v"
596 (base32 "10ryrcx832fwqdawb6jmknymi7wpdzhi30qzx7cbrk0cpnka71w2"))
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
606 (home-page "https://common-lisp.net/project/bordeaux-threads/")
607 (license license:x11)))
609 (define-public cl-bordeaux-threads
610 (sbcl-package->cl-source-package sbcl-bordeaux-threads))
612 (define-public ecl-bordeaux-threads
613 (sbcl-package->ecl-package sbcl-bordeaux-threads))
615 (define-public sbcl-trivial-gray-streams
617 (commit "0483ade330508b4b2edeabdb47d16ec9437ee1cb"))
619 (name "sbcl-trivial-gray-streams")
620 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
626 (url "https://github.com/trivial-gray-streams/trivial-gray-streams.git")
629 (base32 "0m3rpf2x0zmdk3nf1qfa01j6a55vj7gkwhyw78qslcgbjlgh8p4d"))
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))))
641 (define-public cl-trivial-gray-streams
642 (sbcl-package->cl-source-package sbcl-trivial-gray-streams))
644 (define-public ecl-trivial-gray-streams
645 (sbcl-package->ecl-package sbcl-trivial-gray-streams))
647 (define-public sbcl-flexi-streams
649 (name "sbcl-flexi-streams")
655 "https://github.com/edicl/flexi-streams/archive/v"
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)))
671 (define-public cl-flexi-streams
672 (sbcl-package->cl-source-package sbcl-flexi-streams))
674 (define-public ecl-flexi-streams
675 (sbcl-package->ecl-package sbcl-flexi-streams))
677 (define-public sbcl-cl-ppcre
679 (name "sbcl-cl-ppcre")
685 "https://github.com/edicl/cl-ppcre/archive/v"
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)))
699 (define-public cl-ppcre
700 (sbcl-package->cl-source-package sbcl-cl-ppcre))
702 (define-public ecl-cl-ppcre
703 (sbcl-package->ecl-package sbcl-cl-ppcre))
705 (define-public sbcl-clx
707 (commit "1c62774b03c1cf3fe6e5cb532df8b14b44c96b95"))
710 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
716 (url "https://github.com/sharplispers/clx.git")
719 (base32 "0qffag03ns52kwq9xjns2qg1yr0bf3ba507iwq5cmx5xz0b0rmjm"))
720 (file-name (string-append "clx-" version "-checkout"))
723 (search-patch "clx-remove-demo.patch")))
724 (modules '((guix build utils)))
727 ;; These removed files cause the compiled system to crash when
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)
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))))
744 (define-public cl-clx
745 (sbcl-package->cl-source-package sbcl-clx))
747 (define-public ecl-clx
748 (sbcl-package->ecl-package sbcl-clx))
750 (define-public sbcl-stumpwm
752 (name "sbcl-stumpwm")
757 "https://github.com/stumpwm/stumpwm/archive/"
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"))
767 '(#:special-dependencies '("sb-posix")
769 (modify-phases %standard-phases
770 (add-after 'create-symlinks 'build-program
771 (lambda* (#:key lisp outputs inputs #:allow-other-keys)
774 (string-append (assoc-ref outputs "bin") "/bin/stumpwm")
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))
784 (string-append output xsessions
790 Comment=The Stump Window Manager~@
791 Exec=~a/bin/stumpwm~@
792 TryExec=~@*~a/bin/stumpwm~@
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))))))
806 (define-public cl-stumpwm
807 (sbcl-package->cl-source-package sbcl-stumpwm))
809 (define-public ecl-stumpwm
810 (let ((base (sbcl-package->ecl-package sbcl-stumpwm)))
816 (define sbcl-slynk-boot0
818 (commit "5706cd45d484a4f25795abe8e643509d31968aa2"))
821 (version (string-append "1.0.0-beta-" revision "." (string-take commit 7)))
827 (url "https://github.com/joaotavora/sly.git")
830 (base32 "0h4gg3sndl2bf6jdnx9nrf14p9hhi43hagrl0f4v4l11hczl8w81"))
831 (file-name (string-append "slynk-" version "-checkout"))
832 (modules '((guix build utils)
836 ;; Move the contribs into the main source directory for easier
838 (substitute* "slynk/slynk.asd"
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
846 (substitute* "contrib/slynk-profiler.lisp"
848 "slynk-pprint-to-line"))
849 (rename-file "contrib" "slynk/contrib")
850 ;; Move slynk's contents into the base directory for easier
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)
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
867 (home-page "https://github.com/joaotavora/sly")
868 (license license:public-domain)
869 (properties `((cl-source-variant . ,(delay cl-slynk)))))))
871 (define-public cl-slynk
872 (sbcl-package->cl-source-package sbcl-slynk-boot0))
874 (define ecl-slynk-boot0
875 (sbcl-package->ecl-package sbcl-slynk-boot0))
877 (define sbcl-slynk-arglists
879 (inherit sbcl-slynk-boot0)
880 (name "sbcl-slynk-arglists")
881 (inputs `(("sbcl-slynk" ,sbcl-slynk-boot0)))
883 `(#:asd-file "slynk.asd"
884 ,@(package-arguments sbcl-slynk-boot0)))))
886 (define ecl-slynk-arglists
887 (sbcl-package->ecl-package sbcl-slynk-arglists))
889 (define sbcl-slynk-util
891 (inherit sbcl-slynk-arglists)
892 (name "sbcl-slynk-util")))
894 (define ecl-slynk-util
895 (sbcl-package->ecl-package sbcl-slynk-util))
897 (define sbcl-slynk-fancy-inspector
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)))))
904 (define ecl-slynk-fancy-inspector
905 (sbcl-package->ecl-package sbcl-slynk-fancy-inspector))
907 (define sbcl-slynk-package-fu
909 (inherit sbcl-slynk-arglists)
910 (name "sbcl-slynk-package-fu")))
912 (define ecl-slynk-package-fu
913 (sbcl-package->ecl-package sbcl-slynk-package-fu))
915 (define sbcl-slynk-mrepl
917 (inherit sbcl-slynk-arglists)
918 (name "sbcl-slynk-mrepl")))
920 (define ecl-slynk-mrepl
921 (sbcl-package->ecl-package sbcl-slynk-mrepl))
923 (define sbcl-slynk-trace-dialog
925 (inherit sbcl-slynk-arglists)
926 (name "sbcl-slynk-trace-dialog")))
928 (define ecl-slynk-trace-dialog
929 (sbcl-package->ecl-package sbcl-slynk-trace-dialog))
931 (define sbcl-slynk-profiler
933 (inherit sbcl-slynk-arglists)
934 (name "sbcl-slynk-profiler")))
936 (define ecl-slynk-profiler
937 (sbcl-package->ecl-package sbcl-slynk-profiler))
939 (define sbcl-slynk-stickers
941 (inherit sbcl-slynk-arglists)
942 (name "sbcl-slynk-stickers")))
944 (define ecl-slynk-stickers
945 (sbcl-package->ecl-package sbcl-slynk-stickers))
947 (define sbcl-slynk-indentation
949 (inherit sbcl-slynk-arglists)
950 (name "sbcl-slynk-indentation")))
952 (define ecl-slynk-indentation
953 (sbcl-package->ecl-package sbcl-slynk-indentation))
955 (define sbcl-slynk-retro
957 (inherit sbcl-slynk-arglists)
958 (name "sbcl-slynk-retro")))
960 (define ecl-slynk-retro
961 (sbcl-package->ecl-package sbcl-slynk-retro))
963 (define slynk-systems
967 "slynk-fancy-inspector"
976 (define-public sbcl-slynk
978 (inherit sbcl-slynk-boot0)
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)
994 (outputs '("out" "image"))
996 `(#:modules ((guix build union)
998 (guix build lisp-utils))
1001 (use-modules (ice-9 match)
1004 (guix build lisp-utils))
1007 (assoc-ref %outputs "out")
1011 (if (string-prefix? "slynk" name) path #f)))
1014 (prepend-to-source-registry
1015 (string-append (assoc-ref %outputs "out") "//"))
1018 (assoc-ref %outputs "image")
1020 #:inputs %build-inputs
1021 #:dependencies ',slynk-systems))))))
1023 (define-public ecl-slynk
1025 (inherit sbcl-slynk)
1030 (list name (sbcl-package->ecl-package pkg))))
1031 (package-inputs sbcl-slynk)))
1035 '(#:modules ((guix build union))
1038 (use-modules (ice-9 match)
1040 (match %build-inputs
1041 (((names . paths) ...)
1042 (union-build (assoc-ref %outputs "out")
1045 (define-public sbcl-stumpwm+slynk
1047 (inherit sbcl-stumpwm)
1048 (name "sbcl-stumpwm-with-slynk")
1051 `(("stumpwm" ,sbcl-stumpwm)
1052 ("slynk" ,sbcl-slynk)))
1054 (substitute-keyword-arguments (package-arguments sbcl-stumpwm)
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
1063 #:entry-program '((stumpwm:stumpwm) 0)
1064 #:dependencies '("stumpwm"
1066 ;; Remove unneeded file.
1067 (delete-file (string-append out "/bin/stumpwm-exec.fasl"))
1069 (delete 'copy-source)
1072 (delete 'link-dependencies)
1074 (delete 'create-symlinks)))))))