gnu: Add cl-stumpwm.
[jackhill/guix/guix.git] / gnu / packages / lisp.scm
CommitLineData
f842bbed
JD
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 John Darrington <jmd@gnu.org>
00ab9458 3;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
e396976b 4;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
05f5ce0c 5;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
419fb3f1 6;;; Copyright © 2016 ng0 <ngillmann@runbox.com>
54a43ff4 7;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
f842bbed
JD
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)
b5b73a82 26 #:use-module ((guix licenses) #:prefix license:)
f842bbed
JD
27 #:use-module (guix packages)
28 #:use-module (gnu packages readline)
29 #:use-module (gnu packages texinfo)
8f9ac901 30 #:use-module (gnu packages tex)
f842bbed
JD
31 #:use-module (gnu packages m4)
32 #:use-module (guix download)
423eef36 33 #:use-module (guix git-download)
f842bbed 34 #:use-module (guix utils)
00ab9458 35 #:use-module (guix build-system gnu)
a72debb7 36 #:use-module (guix build-system asdf)
ce0614dd 37 #:use-module (gnu packages base)
00ab9458
TUBK
38 #:use-module (gnu packages multiprecision)
39 #:use-module (gnu packages bdw-gc)
560f51d0
TUBK
40 #:use-module (gnu packages libffi)
41 #:use-module (gnu packages libffcall)
42 #:use-module (gnu packages readline)
b702b52d
TUBK
43 #:use-module (gnu packages libsigsegv)
44 #:use-module (gnu packages admin)
531a9aac
TUBK
45 #:use-module (gnu packages ed)
46 #:use-module (gnu packages m4)
47 #:use-module (gnu packages version-control)
419fb3f1 48 #:use-module (ice-9 match)
49 #:use-module (srfi srfi-1))
f842bbed 50
8d0489ae
AP
51(define (asdf-substitutions lisp)
52 ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's
53 ;; 'default-system-source-registry'.
54 `((("\\(,dir \"systems/\"\\)\\)")
55 (format #f
56 "(,dir \"~a-bundle-systems\")))
57
58 ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\")
59 :collect `(:directory (,dir \"systems\"))"
60 ,lisp))))
61
f842bbed
JD
62(define-public gcl
63 (package
64 (name "gcl")
e6c1e91d 65 (version "2.6.12")
f842bbed
JD
66 (source
67 (origin
68 (method url-fetch)
69 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
70 (sha256
e6c1e91d 71 (base32 "1s4hs2qbjqmn9h88l4xvsifq5c3dlc5s74lyb61rdi5grhdlkf4f"))))
f842bbed
JD
72 (build-system gnu-build-system)
73 (arguments
74 `(#:parallel-build? #f ; The build system seems not to be thread safe.
75 #:tests? #f ; There does not seem to be make check or anything similar.
76 #:configure-flags '("--enable-ansi") ; required for use by the maxima package
77 #:phases (alist-cons-before
78 'configure 'pre-conf
a124bbd2 79 (lambda _
f842bbed
JD
80 ;; Patch bug when building readline support. This bug was
81 ;; also observed by Debian
82 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741819
83 (substitute* "o/gcl_readline.d"
a124bbd2
SB
84 (("rl_attempted_completion_function = \
85\\(CPPFunction \\*\\)rl_completion;")
f842bbed 86 "rl_attempted_completion_function = rl_completion;"))
a124bbd2
SB
87 (substitute*
88 (append
f842bbed
JD
89 '("pcl/impl/kcl/makefile.akcl"
90 "add-defs"
91 "unixport/makefile.dos"
92 "add-defs.bat"
93 "gcl-tk/makefile.prev"
94 "add-defs1")
95 (find-files "h" "\\.defs"))
96 (("SHELL=/bin/(ba)?sh")
97 (string-append "SHELL=" (which "bash")))))
46251411
AE
98 ;; drop strip phase to make maxima build, see
99 ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
100 (alist-delete 'strip
101 %standard-phases))))
f842bbed
JD
102 (native-inputs
103 `(("m4" ,m4)
104 ("readline" ,readline)
105 ("texinfo" ,texinfo)
106 ("texlive" ,texlive)))
107 (home-page "http://www.gnu.org/software/gcl")
a2b63d58 108 (synopsis "A Common Lisp implementation")
f842bbed
JD
109 (description "GCL is an implementation of the Common Lisp language. It
110features the ability to compile to native object code and to load native
111object code modules directly into its lisp core. It also features a
112stratified garbage collection strategy, a source-level debugger and a built-in
113interface to the Tk widget system.")
114 (license license:lgpl2.0+)))
115
00ab9458
TUBK
116(define-public ecl
117 (package
118 (name "ecl")
e0524511 119 (version "16.1.2")
00ab9458
TUBK
120 (source
121 (origin
122 (method url-fetch)
e0524511
AP
123 (uri (string-append
124 "https://common-lisp.net/project/ecl/static/files/release/"
125 name "-" version ".tgz"))
00ab9458 126 (sha256
fb7dc6d6
AP
127 (base32 "16ab8qs3awvdxy8xs8jy82v8r04x4wr70l9l2j45vgag18d2nj1d"))
128 (modules '((guix build utils)))
129 (snippet
130 ;; Add ecl-bundle-systems to 'default-system-source-registry'.
131 `(substitute* "contrib/asdf/asdf.lisp"
132 ,@(asdf-substitutions name)))))
00ab9458 133 (build-system gnu-build-system)
cb03a9b6 134 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
00ab9458
TUBK
135 (native-inputs `(("which" ,which)))
136 (inputs `(("gmp" ,gmp)
137 ("libatomic-ops" ,libatomic-ops)
138 ("libgc" ,libgc)
139 ("libffi" ,libffi)))
140 (arguments
60474cd1
AP
141 '(#:tests? #t
142 #:make-flags `(,(string-append "ECL="
143 (assoc-ref %outputs "out")
144 "/bin/ecl"))
145 #:parallel-tests? #f
146 #:phases
147 (modify-phases %standard-phases
148 (delete 'check)
54a43ff4
AP
149 (add-after 'install 'wrap
150 (lambda* (#:key inputs outputs #:allow-other-keys)
151 (let* ((ecl (assoc-ref outputs "out"))
152 (input-path (lambda (lib path)
153 (string-append
154 (assoc-ref inputs lib) path)))
155 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
156 (binaries '("gcc" "ld-wrapper" "binutils"))
157 (library-directories
158 (map (lambda (lib) (input-path lib "/lib"))
159 libraries)))
160
161 (wrap-program (string-append ecl "/bin/ecl")
162 `("PATH" prefix
163 ,(map (lambda (binary)
164 (input-path binary "/bin"))
165 binaries))
166 `("CPATH" suffix
167 ,(map (lambda (lib)
168 (input-path lib "/include"))
932b2ea2 169 `("kernel-headers" ,@libraries)))
54a43ff4
AP
170 `("LIBRARY_PATH" suffix ,library-directories)
171 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
172 (add-after 'wrap 'check (assoc-ref %standard-phases 'check)))))
fb7dc6d6
AP
173 (native-search-paths
174 (list (search-path-specification
175 (variable "XDG_DATA_DIRS")
176 (files '("share")))))
00ab9458
TUBK
177 (home-page "http://ecls.sourceforge.net/")
178 (synopsis "Embeddable Common Lisp")
179 (description "ECL is an implementation of the Common Lisp language as
180defined by the ANSI X3J13 specification. Its most relevant features are: a
181bytecode compiler and interpreter, being able to compile Common Lisp with any
182C/C++ compiler, being able to build standalone executables and libraries, and
183supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
184 ;; Note that the file "Copyright" points to some files and directories
185 ;; which aren't under the lgpl2.0+ and instead contain many different,
186 ;; non-copyleft licenses.
187 (license license:lgpl2.0+)))
560f51d0
TUBK
188
189(define-public clisp
190 (package
191 (name "clisp")
192 (version "2.49")
193 (source
194 (origin
195 (method url-fetch)
196 (uri (string-append "mirror://gnu/clisp/release/" version
197 "/clisp-" version ".tar.gz"))
198 (sha256
199 (base32 "0rp82nqp5362isl9i34rwgg04cidz7izljd9d85pqcw1qr964bxx"))))
200 (build-system gnu-build-system)
201 (inputs `(("libffcall" ,libffcall)
202 ("readline" ,readline)
203 ("libsigsegv" ,libsigsegv)))
204 (arguments
f90ef3c3
MW
205 '(;; XXX The custom configure script does not cope well when passed
206 ;; --build=<triplet>.
207 #:build #f
208 #:phases
560f51d0
TUBK
209 (alist-cons-after
210 'unpack 'patch-sh-and-pwd
211 (lambda _
212 ;; The package is very messy with its references to "/bin/sh" and
213 ;; some other absolute paths to traditional tools. These appear in
214 ;; many places where our automatic patching misses them. Therefore
215 ;; we do the following, in this early (post-unpack) phase, to solve
216 ;; the problem from its root.
217 (substitute* (find-files "." "configure|Makefile")
218 (("/bin/sh") "sh"))
219 (substitute* '("src/clisp-link.in")
220 (("/bin/pwd") "pwd")))
221 (alist-cons-before
222 'build 'chdir-to-source
223 (lambda _
224 ;; We are supposed to call make under the src sub-directory.
225 (chdir "src"))
226 %standard-phases))
227 ;; Makefiles seem to have race conditions.
228 #:parallel-build? #f))
229 (home-page "http://www.clisp.org/")
4cc78cb3
LC
230 (synopsis "A Common Lisp implementation")
231 (description
232 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
233high-level, object-oriented functional programming language. CLISP includes
234an interpreter, a compiler, a debugger, and much more.")
560f51d0
TUBK
235 ;; Website says gpl2+, COPYRIGHT file says gpl2; actual source files have
236 ;; a lot of gpl3+. (Also some parts are under non-copyleft licenses, such
237 ;; as CLX by Texas Instruments.) In that case gpl3+ wins out.
238 (license license:gpl3+)))
b702b52d
TUBK
239
240(define-public sbcl
241 (package
242 (name "sbcl")
1925a879 243 (version "1.3.7")
b702b52d
TUBK
244 (source
245 (origin
246 (method url-fetch)
247 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
248 version "-source.tar.bz2"))
249 (sha256
8d0489ae
AP
250 (base32 "0fjdqnb2rsm2vi9794ywp27jr239ddvzc4xfr0dk49jd4v7p2kc5"))
251 (modules '((guix build utils)))
252 (snippet
253 ;; Add sbcl-bundle-systems to 'default-system-source-registry'.
254 `(substitute* "contrib/asdf/asdf.lisp"
255 ,@(asdf-substitutions name)))))
b702b52d 256 (build-system gnu-build-system)
05f5ce0c 257 (outputs '("out" "doc"))
b702b52d
TUBK
258 ;; Bootstrap with CLISP.
259 (native-inputs
260 `(("clisp" ,clisp)
261 ("which" ,which)
262 ("inetutils" ,inetutils) ;for hostname(1)
05f5ce0c
FB
263 ("ed" ,ed)
264 ("texlive" ,texlive)
265 ("texinfo" ,texinfo)))
b702b52d
TUBK
266 (arguments
267 '(#:phases
1ee131df
FB
268 (modify-phases %standard-phases
269 (delete 'configure)
270 (add-before 'build 'patch-unix-tool-paths
271 (lambda* (#:key outputs inputs #:allow-other-keys)
272 (let ((out (assoc-ref outputs "out"))
273 (bash (assoc-ref inputs "bash"))
274 (coreutils (assoc-ref inputs "coreutils"))
275 (ed (assoc-ref inputs "ed")))
276 (define (quoted-path input path)
277 (string-append "\"" input path "\""))
278 ;; Patch absolute paths in string literals. Note that this
279 ;; occurs in some .sh files too (which contain Lisp code). Use
280 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
281 (with-fluids ((%default-port-encoding #f))
1925a879
AP
282 ;; The removed file is utf-16-be encoded, which gives substitute*
283 ;; trouble. It does not contain references to the listed programs.
284 (substitute* (delete
285 "./tests/data/compile-file-pos-utf16be.lisp"
286 (find-files "." "\\.(lisp|sh)$"))
1ee131df
FB
287 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
288 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
289 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
290 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
291 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
292 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
293 ;; This one script has a non-string occurrence of /bin/sh.
294 (substitute* '("tests/foreign.test.sh")
295 ;; Leave whitespace so we don't match the shebang.
296 ((" /bin/sh ") " sh "))
297 ;; This file contains a module that can create executable files
298 ;; which depend on the presence of SBCL. It generates shell
299 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
300 ;; the shebang and the reference to "sbcl", tying the generated
301 ;; executables to the exact SBCL package that generated them.
302 (substitute* '("contrib/sb-executable/sb-executable.lisp")
303 (("/bin/sh") (string-append bash "/bin/sh"))
304 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
305 ;; Disable some tests that fail in our build environment.
306 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
307 ;; This requires /etc/protocols.
308 (("\\(deftest get-protocol-by-name/error" all)
309 (string-append "#+nil ;disabled by Guix\n" all)))
310 (substitute* '("contrib/sb-posix/posix-tests.lisp")
311 ;; These assume some users/groups which we don't have.
312 (("\\(deftest pwent\\.[12]" all)
313 (string-append "#+nil ;disabled by Guix\n" all))
314 (("\\(deftest grent\\.[12]" all)
315 (string-append "#+nil ;disabled by Guix\n" all))))))
316 (replace 'build
317 (lambda* (#:key outputs #:allow-other-keys)
318 (setenv "CC" "gcc")
319 (zero? (system* "sh" "make.sh" "clisp"
320 (string-append "--prefix="
321 (assoc-ref outputs "out"))))))
322 (replace 'install
b702b52d 323 (lambda _
05f5ce0c
FB
324 (zero? (system* "sh" "install.sh"))))
325 (add-after 'build 'build-doc
326 (lambda _
327 (with-directory-excursion "doc/manual"
328 (and (zero? (system* "make" "info"))
329 (zero? (system* "make" "dist"))))))
330 (add-after 'install 'install-doc
331 (lambda* (#:key outputs #:allow-other-keys)
332 (let* ((out (assoc-ref outputs "out"))
333 (doc (assoc-ref outputs "doc"))
334 (old-doc-dir (string-append out "/share/doc"))
335 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
336 (rmdir (string-append old-doc-dir "/sbcl/html"))
337 (mkdir-p new-doc/sbcl-dir)
338 (copy-recursively (string-append old-doc-dir "/sbcl")
339 new-doc/sbcl-dir)
340 (delete-file-recursively old-doc-dir)
341 #t))))
1ee131df
FB
342 ;; No 'check' target, though "make.sh" (build phase) runs tests.
343 #:tests? #f))
8d0489ae
AP
344 (native-search-paths
345 (list (search-path-specification
346 (variable "XDG_DATA_DIRS")
347 (files '("share")))))
b702b52d
TUBK
348 (home-page "http://www.sbcl.org/")
349 (synopsis "Common Lisp implementation")
350 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
351Lisp compiler. In addition to the compiler and runtime system for ANSI Common
352Lisp, it provides an interactive environment including a debugger, a
353statistical profiler, a code coverage tool, and many other extensions.")
354 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
355 ;; loop macro has its own license. See COPYING file for further notes.
356 (license (list license:public-domain license:bsd-2
357 (license:x11-style "file://src/code/loop.lisp")))))
531a9aac
TUBK
358
359(define-public ccl
360 (package
361 (name "ccl")
3701f014 362 (version "1.11")
531a9aac
TUBK
363 (source #f)
364 (build-system gnu-build-system)
365 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
366 ;; shipped in precompiled form in source tarballs. The former is a C
367 ;; program which we can rebuild from scratch, but the latter cannot be
368 ;; generated without an already working copy of CCL, and is platform
369 ;; dependent, so we need to fetch the correct tarball for the platform.
370 (inputs
371 `(("ccl"
372 ,(origin
373 (method url-fetch)
374 (uri (string-append
3701f014
CC
375 "ftp://ftp.clozure.com/pub/release/" version
376 "/ccl-" version "-"
531a9aac
TUBK
377 (match (%current-system)
378 ((or "i686-linux" "x86_64-linux") "linuxx86")
42f11801
MW
379 ("armhf-linux" "linuxarm")
380 ;; Prevent errors when querying this package on unsupported
381 ;; platforms, e.g. when running "guix package --search="
382 (_ "UNSUPPORTED"))
531a9aac
TUBK
383 ".tar.gz"))
384 (sha256
385 (base32
386 (match (%current-system)
387 ((or "i686-linux" "x86_64-linux")
3701f014 388 "0w3dmj7q9kqyra3yrf1lxclnjz151yvf5s5q8ayllvmvqbl8bs08")
42f11801 389 ("armhf-linux"
3701f014 390 "1x487aaz2rqcb6k301sy2p39a1m4qdhg6z9p9fb76ssipqgr38b4")
42f11801 391 (_ ""))))))))
531a9aac
TUBK
392 (native-inputs
393 `(("m4" ,m4)
394 ("subversion" ,subversion)))
395 (arguments
396 `(#:tests? #f ;no 'check' target
397 #:phases
398 (alist-replace
399 'unpack
400 (lambda* (#:key inputs #:allow-other-keys)
401 (and (zero? (system* "tar" "xzvf" (assoc-ref inputs "ccl")))
402 (begin (chdir "ccl") #t)))
403 (alist-delete
404 'configure
405 (alist-cons-before
406 'build 'pre-build
407 ;; Enter the source directory for the current platform's lisp
408 ;; kernel, and run 'make clean' to remove the precompiled one.
409 (lambda _
410 (chdir (string-append
411 "lisp-kernel/"
412 ,(match (or (%current-target-system) (%current-system))
76eb7266 413 ("i686-linux" "linuxx8632")
531a9aac 414 ("x86_64-linux" "linuxx8664")
76eb7266
MW
415 ("armhf-linux" "linuxarm")
416 ;; Prevent errors when querying this package
417 ;; on unsupported platforms, e.g. when running
418 ;; "guix package --search="
419 (_ "UNSUPPORTED"))))
531a9aac
TUBK
420 (substitute* '("Makefile")
421 (("/bin/rm") "rm"))
422 (setenv "CC" "gcc")
423 (zero? (system* "make" "clean")))
424 ;; XXX Do we need to recompile the heap image as well for Guix?
425 ;; For now just use the one we already got in the tarball.
426 (alist-replace
427 'install
428 (lambda* (#:key outputs inputs #:allow-other-keys)
429 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
430 ;; is put back into the original directory, so go back. The heap
431 ;; image is there as well.
432 (chdir "../..")
433 (let* ((out (assoc-ref outputs "out"))
434 (libdir (string-append out "/lib/"))
435 (bindir (string-append out "/bin/"))
436 (wrapper (string-append bindir "ccl"))
437 (bash (assoc-ref inputs "bash"))
438 (kernel
439 ,(match (or (%current-target-system) (%current-system))
76eb7266 440 ("i686-linux" "lx86cl")
531a9aac 441 ("x86_64-linux" "lx86cl64")
76eb7266
MW
442 ("armhf-linux" "armcl")
443 ;; Prevent errors when querying this package
444 ;; on unsupported platforms, e.g. when running
445 ;; "guix package --search="
446 (_ "UNSUPPORTED")))
531a9aac
TUBK
447 (heap (string-append kernel ".image")))
448 (mkdir-p libdir)
449 (mkdir-p bindir)
450 (copy-file kernel (string-append libdir kernel))
451 (copy-file heap (string-append libdir heap))
452 (with-output-to-file wrapper
453 (lambda ()
454 (display
455 (string-append
456 "#!" bash "/bin/sh\n"
457 "if [ -z \"$CCL_DEFAULT_DIRECTORY\" ]; then\n"
458 " CCL_DEFAULT_DIRECTORY=" libdir "\n"
459 "fi\n"
460 "export CCL_DEFAULT_DIRECTORY\n"
461 "exec " libdir kernel "\n"))))
462 (chmod wrapper #o755)))
463 %standard-phases))))))
464 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
465 (home-page "http://ccl.clozure.com/")
466 (synopsis "Common Lisp implementation")
467 (description "Clozure CL (often called CCL for short) is a Common Lisp
468implementation featuring fast compilation speed, native threads, a precise,
469generational, compacting garbage collector, and a convenient foreign-function
470interface.")
471 ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL
472 ;; applies to Lisp code according to them.
473 (license (list license:lgpl2.1
474 license:clarified-artistic)))) ;TRIVIAL-LDAP package
423eef36 475
995e5092 476(define-public femtolisp
477 (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b")
478 (revision "1"))
479 (package
480 (name "femtolisp")
481 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
482 (source (origin
483 (method git-fetch)
484 (uri (git-reference
485 (url "https://github.com/JeffBezanson/femtolisp.git")
486 (commit commit)))
487 (file-name (string-append name "-" version "-checkout"))
488 (sha256
489 (base32
490 "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja"))))
419fb3f1 491 ;; See "utils.h" for supported systems. Upstream bug:
492 ;; https://github.com/JeffBezanson/femtolisp/issues/25
493 (supported-systems
494 (fold delete %supported-systems
495 '("armhf-linux" "mips64el-linux")))
995e5092 496 (build-system gnu-build-system)
497 (arguments
f7fe5f7a 498 `(#:make-flags '("CC=gcc" "release")
499 #:test-target "test"
995e5092 500 #:phases
501 (modify-phases %standard-phases
502 (delete 'configure) ; No configure script
995e5092 503 (replace 'install ; Makefile has no 'install phase
504 (lambda* (#:key outputs #:allow-other-keys)
505 (let* ((out (assoc-ref outputs "out"))
506 (bin (string-append out "/bin")))
507 (install-file "flisp" bin)
508 #t)))
509 ;; The flisp binary is now available, run bootstrap to
510 ;; generate flisp.boot and afterwards runs make test.
511 (add-after 'install 'bootstrap-gen-and-test
512 (lambda* (#:key outputs #:allow-other-keys)
513 (let* ((out (assoc-ref outputs "out"))
514 (bin (string-append out "/bin")))
515 (and
516 (zero? (system* "./bootstrap.sh"))
517 (install-file "flisp.boot" bin))))))))
518 (synopsis "Scheme-like lisp implementation")
519 (description
520 "@code{femtolisp} is a scheme-like lisp implementation with a
521simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
522The core is 12 builtin special forms and 33 builtin functions.")
523 (home-page "https://github.com/JeffBezanson/femtolisp")
524 (license license:bsd-3))))
a72debb7
AP
525
526(define-public sbcl-alexandria
527 (let ((revision "1")
528 (commit "926a066611b7b11cb71e26c827a271e500888c30"))
529 (package
530 (name "sbcl-alexandria")
531 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
532 (source
533 (origin
534 (method git-fetch)
535 (uri (git-reference
536 (url "https://gitlab.common-lisp.net/alexandria/alexandria.git")
537 (commit commit)))
538 (sha256
539 (base32
540 "18yncicdkh294j05rhgm23gzi36y9qy6vrfba8vg69jrxjp1hx8l"))
541 (file-name (string-append "alexandria-" version "-checkout"))))
542 (build-system asdf-build-system/sbcl)
543 (synopsis "Collection of portable utilities for Common Lisp")
544 (description
545 "Alexandria is a collection of portable utilities. It does not contain
546conceptual extensions to Common Lisp. It is conservative in scope, and
547portable between implementations.")
548 (home-page "https://common-lisp.net/project/alexandria/")
549 (license license:public-domain))))
550
551(define-public cl-alexandria
552 (sbcl-package->cl-source-package sbcl-alexandria))
553
554(define-public ecl-alexandria
555 (sbcl-package->ecl-package sbcl-alexandria))
86022c92
AP
556
557(define-public sbcl-fiveam
558 (package
559 (name "sbcl-fiveam")
560 (version "1.2")
561 (source
562 (origin
563 (method url-fetch)
564 (uri (string-append
565 "https://github.com/sionescu/fiveam/archive/v"
566 version ".tar.gz"))
567 (sha256
568 (base32 "0f48pcbhqs3wwwzjl5nk57d4hcbib4l9xblxc66b8c2fhvhmhxnv"))
569 (file-name (string-append "fiveam-" version ".tar.gz"))))
570 (inputs `(("sbcl-alexandria" ,sbcl-alexandria)))
571 (build-system asdf-build-system/sbcl)
572 (synopsis "Common Lisp testing framework")
573 (description "FiveAM is a simple (as far as writing and running tests
574goes) regression testing framework. It has been designed with Common Lisp's
575interactive development model in mind.")
576 (home-page "https://common-lisp.net/project/fiveam/")
577 (license license:bsd-3)))
578
579(define-public cl-fiveam
580 (sbcl-package->cl-source-package sbcl-fiveam))
581
582(define-public ecl-fiveam
583 (sbcl-package->ecl-package sbcl-fiveam))
8662809d
AP
584
585(define-public sbcl-bordeaux-threads
586 (package
587 (name "sbcl-bordeaux-threads")
588 (version "0.8.5")
589 (source (origin
590 (method url-fetch)
591 (uri (string-append
592 "https://github.com/sionescu/bordeaux-threads/archive/v"
593 version ".tar.gz"))
594 (sha256
595 (base32 "10ryrcx832fwqdawb6jmknymi7wpdzhi30qzx7cbrk0cpnka71w2"))
596 (file-name
597 (string-append "bordeaux-threads-" version ".tar.gz"))))
598 (inputs `(("sbcl-alexandria" ,sbcl-alexandria)))
599 (native-inputs `(("tests:cl-fiveam" ,sbcl-fiveam)))
600 (build-system asdf-build-system/sbcl)
601 (synopsis "Portable shared-state concurrency library for Common Lisp")
602 (description "BORDEAUX-THREADS is a proposed standard for a minimal
603MP/Threading interface. It is similar to the CLIM-SYS threading and lock
604support.")
605 (home-page "https://common-lisp.net/project/bordeaux-threads/")
606 (license license:x11)))
607
608(define-public cl-bordeaux-threads
609 (sbcl-package->cl-source-package sbcl-bordeaux-threads))
610
611(define-public ecl-bordeaux-threads
612 (sbcl-package->ecl-package sbcl-bordeaux-threads))
059cab30
AP
613
614(define-public sbcl-trivial-gray-streams
615 (let ((revision "1")
616 (commit "0483ade330508b4b2edeabdb47d16ec9437ee1cb"))
617 (package
618 (name "sbcl-trivial-gray-streams")
619 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
620 (source
621 (origin
622 (method git-fetch)
623 (uri
624 (git-reference
625 (url "https://github.com/trivial-gray-streams/trivial-gray-streams.git")
626 (commit commit)))
627 (sha256
628 (base32 "0m3rpf2x0zmdk3nf1qfa01j6a55vj7gkwhyw78qslcgbjlgh8p4d"))
629 (file-name
630 (string-append "trivial-gray-streams-" version "-checkout"))))
631 (build-system asdf-build-system/sbcl)
632 (synopsis "Compatibility layer for Gray streams implementations")
633 (description "Gray streams is an interface proposed for inclusion with
634ANSI CL by David N. Gray. The proposal did not make it into ANSI CL, but most
635popular CL implementations implement it. This package provides an extremely
636thin compatibility layer for gray streams.")
637 (home-page "http://www.cliki.net/trivial-gray-streams")
638 (license license:x11))))
639
640(define-public cl-trivial-gray-streams
641 (sbcl-package->cl-source-package sbcl-trivial-gray-streams))
642
643(define-public ecl-trivial-gray-streams
644 (sbcl-package->ecl-package sbcl-trivial-gray-streams))
3c55c780
AP
645
646(define-public sbcl-flexi-streams
647 (package
648 (name "sbcl-flexi-streams")
649 (version "1.0.12")
650 (source
651 (origin
652 (method url-fetch)
653 (uri (string-append
654 "https://github.com/edicl/flexi-streams/archive/v"
655 version ".tar.gz"))
656 (sha256
657 (base32 "16grnxvs7vqm5s6myf8a5s7vwblzq1kgwj8i7ahz8vwvihm9gzfi"))
658 (file-name (string-append "flexi-streams-" version ".tar.gz"))))
659 (build-system asdf-build-system/sbcl)
660 (inputs `(("sbcl-trivial-gray-streams" ,sbcl-trivial-gray-streams)))
661 (synopsis "Implementation of virtual bivalent streams for Common Lisp")
662 (description "Flexi-streams is an implementation of \"virtual\" bivalent
663streams that can be layered atop real binary or bivalent streams and that can
664be used to read and write character data in various single- or multi-octet
665encodings which can be changed on the fly. It also supplies in-memory binary
666streams which are similar to string streams.")
667 (home-page "http://weitz.de/flexi-streams/")
668 (license license:bsd-3)))
669
670(define-public cl-flexi-streams
671 (sbcl-package->cl-source-package sbcl-flexi-streams))
672
673(define-public ecl-flexi-streams
674 (sbcl-package->ecl-package sbcl-flexi-streams))
5aa608a7
AP
675
676(define-public sbcl-cl-ppcre
677 (package
678 (name "sbcl-cl-ppcre")
679 (version "2.0.11")
680 (source
681 (origin
682 (method url-fetch)
683 (uri (string-append
684 "https://github.com/edicl/cl-ppcre/archive/v"
685 version ".tar.gz"))
686 (sha256
687 (base32 "1i7daxf0wnydb0pgwiym7qh2wy70n14lxd6dyv28sy0naa8p31gd"))
688 (file-name (string-append "cl-ppcre-" version ".tar.gz"))))
689 (build-system asdf-build-system/sbcl)
690 (native-inputs `(("tests:cl-flexi-streams" ,sbcl-flexi-streams)))
691 (synopsis "Portable regular expression library for Common Lisp")
692 (description "CL-PPCRE is a portable regular expression library for Common
693Lisp, which is compatible with perl. It is pretty fast, thread-safe, and
694compatible with ANSI-compliant Common Lisp implementations.")
695 (home-page "http://weitz.de/cl-ppcre/")
696 (license license:bsd-2)))
697
698(define-public cl-ppcre
699 (sbcl-package->cl-source-package sbcl-cl-ppcre))
700
701(define-public ecl-cl-ppcre
702 (sbcl-package->ecl-package sbcl-cl-ppcre))
4b51b21c
AP
703
704(define-public sbcl-clx
705 (let ((revision "1")
706 (commit "1c62774b03c1cf3fe6e5cb532df8b14b44c96b95"))
707 (package
708 (name "sbcl-clx")
709 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
710 (source
711 (origin
712 (method git-fetch)
713 (uri
714 (git-reference
715 (url "https://github.com/sharplispers/clx.git")
716 (commit commit)))
717 (sha256
718 (base32 "0qffag03ns52kwq9xjns2qg1yr0bf3ba507iwq5cmx5xz0b0rmjm"))
719 (file-name (string-append "clx-" version "-checkout"))
720 (patches
721 (list
722 (search-patch "clx-remove-demo.patch")))
723 (modules '((guix build utils)))
724 (snippet
725 '(begin
726 ;; These removed files cause the compiled system to crash when
727 ;; loading.
728 (delete-file-recursively "demo")
729 (delete-file "test/trapezoid.lisp")
730 (substitute* "clx.asd"
731 (("\\(:file \"trapezoid\"\\)") ""))))))
732 (build-system asdf-build-system/sbcl)
733 (arguments
734 '(#:special-dependencies '("sb-bsd-sockets")))
735 (home-page "http://www.cliki.net/portable-clx")
736 (synopsis "X11 client library for Common Lisp")
737 (description "CLX is an X11 client library for Common Lisp. The code was
738originally taken from a CMUCL distribution, was modified somewhat in order to
739make it compile and run under SBCL, then a selection of patches were added
740from other CLXes around the net.")
741 (license license:x11))))
742
743(define-public cl-clx
744 (sbcl-package->cl-source-package sbcl-clx))
745
746(define-public ecl-clx
747 (sbcl-package->ecl-package sbcl-clx))
d075960f
AP
748
749(define-public sbcl-stumpwm
750 (package
751 (name "sbcl-stumpwm")
752 (version "0.9.9")
753 (source (origin
754 (method url-fetch)
755 (uri (string-append
756 "https://github.com/stumpwm/stumpwm/archive/"
757 version ".tar.gz"))
758 (sha256
759 (base32 "1fqabij4zcsqg1ywgdv2irp1ys23dwc8ms9ai55lb2i47hgv7z3x"))
760 (file-name (string-append "stumpwm-" version ".tar.gz"))))
761 (build-system asdf-build-system/sbcl)
762 (inputs `(("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
763 ("sbcl-clx" ,sbcl-clx)))
764 (outputs '("out" "bin"))
765 (arguments
766 '(#:special-dependencies '("sb-posix")
767 #:phases
768 (modify-phases %standard-phases
769 (add-after 'create-symlinks 'build-program
770 (lambda* (#:key lisp outputs inputs #:allow-other-keys)
771 (build-program
772 lisp
773 (string-append (assoc-ref outputs "bin") "/bin/stumpwm")
774 #:inputs inputs
775 #:entry-program '((stumpwm:stumpwm) 0))))
776 (add-after 'build-program 'create-desktop-file
777 (lambda* (#:key outputs lisp binary? #:allow-other-keys)
778 (let ((output (or (assoc-ref outputs "bin")
779 (assoc-ref outputs "out")))
780 (xsessions "/share/xsessions"))
781 (mkdir-p (string-append output xsessions))
782 (with-output-to-file
783 (string-append output xsessions
784 "/stumpwm.desktop")
785 (lambda _
786 (format #t
787 "[Desktop Entry]~@
788 Name=stumpwm~@
789 Comment=The Stump Window Manager~@
790 Exec=~a/bin/stumpwm~@
791 TryExec=~@*~a/bin/stumpwm~@
792 Icon=~@
793 Type=Application~%"
794 output)))
795 #t))))))
796 (synopsis "Window manager written in Common Lisp")
797 (description "Stumpwm is a window manager written entirely in Common Lisp.
798It attempts to be highly customizable while relying entirely on the keyboard
799for input. These design decisions reflect the growing popularity of
800productive, customizable lisp based systems.")
801 (home-page "http://github.com/stumpwm/stumpwm")
802 (license license:gpl2+)
803 (properties `((ecl-variant . ,(delay ecl-stumpwm))))))
804
805(define-public cl-stumpwm
806 (sbcl-package->cl-source-package sbcl-stumpwm))
807
808(define-public ecl-stumpwm
809 (let ((base (sbcl-package->ecl-package sbcl-stumpwm)))
810 (package
811 (inherit base)
812 (outputs '("out"))
813 (arguments '()))))