1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
6 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
7 ;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
8 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2017, 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
12 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
13 ;;; Copyright © 2018, 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz>
14 ;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
15 ;;; Copyright © 2019, 2020 Katherine Cox-Buday <cox.katherine.e@gmail.com>
16 ;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve@protonmail.com>
17 ;;; Copyright © 2019, 2020, 2021 Guillaume Le Vaillant <glv@posteo.net>
18 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
20 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
21 ;;; Copyright © 2021 Jack Hill <jackhill@jackhill.us>
23 ;;; This file is part of GNU Guix.
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38 ;;; This file only contains Common Lisp compilers and tooling.
39 ;;; Common Lisp libraries go to lisp-xyz.scm.
40 ;;; Common Lisp applications should go to the most appropriate file,
41 ;;; e.g. StumpWM is in wm.scm.
43 (define-module (gnu packages lisp)
44 #:use-module (gnu packages)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix git-download)
49 #:use-module (guix utils)
50 #:use-module (guix build-system copy)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system ant)
53 #:use-module (guix build-system asdf)
54 #:use-module (guix build-system trivial)
55 #:use-module (gnu packages admin)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages bdw-gc)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages ed)
60 #:use-module (gnu packages fontutils)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages gettext)
63 #:use-module (gnu packages gl)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages m4)
66 #:use-module (gnu packages maths)
67 #:use-module (gnu packages multiprecision)
68 #:use-module (gnu packages ncurses)
69 #:use-module (gnu packages libffcall)
70 #:use-module (gnu packages libffi)
71 #:use-module (gnu packages libsigsegv)
72 #:use-module (gnu packages linux)
73 #:use-module (gnu packages perl)
74 #:use-module (gnu packages readline)
75 #:use-module (gnu packages sdl)
76 #:use-module (gnu packages tex)
77 #:use-module (gnu packages tls)
78 #:use-module (gnu packages texinfo)
79 #:use-module (gnu packages version-control)
80 #:use-module (gnu packages xorg)
81 #:use-module (ice-9 match))
83 (define-public cl-asdf
91 (string-append "https://common-lisp.net/project/asdf/archives/asdf-"
94 (base32 "1hpx30f6yrak15nw992k7x3pn75ahvjs04n4f134k68mhgs62km2"))))
95 (build-system trivial-build-system)
97 `(("config-patch" ,@(search-patches "cl-asdf-config-directories.patch"))
100 `(#:modules ((guix build utils)
101 (guix build lisp-utils))
104 (use-modules (guix build utils)
105 (guix build lisp-utils))
106 (let* ((out (string-append (assoc-ref %outputs "out")))
107 (asdf-install (string-append out %source-install-prefix
109 (src-asdf (string-append (assoc-ref %build-inputs "source")))
110 (dst-asdf (string-append asdf-install "asdf.lisp"))
111 (patch (string-append (assoc-ref %build-inputs "patch")
113 (config-patch (assoc-ref %build-inputs "config-patch")))
114 (mkdir-p asdf-install)
115 (copy-file src-asdf dst-asdf)
116 (invoke patch "-p1" "-i" config-patch dst-asdf)))))
117 (home-page "https://common-lisp.net/project/asdf/")
118 (synopsis "Another System Definition Facility")
120 "ASDF is what Common Lisp hackers use to build and load software. It is
121 the successor of the Lisp DEFSYSTEM of yore. ASDF stands for Another System
122 Definition Facility.")
124 (license license:expat)))
127 (let ((commit "d3335e2b3deb63f930eb0328e9b05377744c9512")
128 (revision "2")) ;Guix package revision
131 (version (string-append "2.6.12-" revision "."
132 (string-take commit 7)))
137 (url "https://git.savannah.gnu.org/r/gcl.git")
139 (file-name (string-append "gcl-" version "-checkout"))
141 (base32 "05v86lhvsby05nzvcd3c4k0wljvgdgd0i6arzd2fx1yd67dl6fgj"))))
142 (build-system gnu-build-system)
144 `(#:parallel-build? #f ; The build system seems not to be thread safe.
145 #:test-target "ansi-tests/test_results"
146 #:configure-flags '("--enable-ansi") ; required for use by the maxima package
148 (string-append "GCL_CC=" (assoc-ref %build-inputs "gcc")
150 (string-append "CC=" (assoc-ref %build-inputs "gcc")
153 (modify-phases %standard-phases
154 (add-before 'configure 'pre-conf
155 (lambda* (#:key inputs #:allow-other-keys)
159 '("pcl/impl/kcl/makefile.akcl"
161 "unixport/makefile.dos"
163 "gcl-tk/makefile.prev"
165 (find-files "h" "\\.defs"))
167 (string-append "SHELL=" (which "bash")))
169 (string-append "SHELL=" (which "sh"))))
170 (substitute* "h/linux.defs"
172 (("-fwritable-strings") "")
174 (substitute* "lsp/gcl_top.lsp"
176 (string-append "\"" (assoc-ref %build-inputs "gcc")
178 (("\\(or \\(get-path \\*cc\\*\\) \\*cc\\*\\)") "*cc*")
180 (string-append "\"" (assoc-ref %build-inputs "binutils")
182 (("\\(or \\(get-path \\*ld\\*\\) \\*ld\\*\\)") "*ld*")
183 (("\\(get-path \"objdump --source \"\\)")
184 (string-append "\"" (assoc-ref %build-inputs "binutils")
185 "/bin/objdump --source \"")))
187 (add-after 'install 'wrap
188 (lambda* (#:key inputs outputs #:allow-other-keys)
189 (let* ((gcl (assoc-ref outputs "out"))
190 (input-path (lambda (lib path)
192 (assoc-ref inputs lib) path)))
193 (binaries '("binutils")))
194 ;; GCC and the GNU binutils are necessary for GCL to be
195 ;; able to compile Lisp functions and programs (this is
196 ;; a standard feature in Common Lisp). While the
197 ;; the location of GCC is specified in the make-flags,
198 ;; the GNU binutils must be available in GCL's $PATH.
199 (wrap-program (string-append gcl "/bin/gcl")
200 `("PATH" prefix ,(map (lambda (binary)
201 (input-path binary "/bin"))
204 ;; drop strip phase to make maxima build, see
205 ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
209 ("readline" ,readline)))
212 ("texinfo" ,texinfo)))
213 (home-page "https://www.gnu.org/software/gcl/")
214 (synopsis "A Common Lisp implementation")
215 (description "GCL is an implementation of the Common Lisp language. It
216 features the ability to compile to native object code and to load native
217 object code modules directly into its lisp core. It also features a
218 stratified garbage collection strategy, a source-level debugger and a built-in
219 interface to the Tk widget system.")
220 (license license:lgpl2.0+))))
230 "https://common-lisp.net/project/ecl/static/files/release/"
231 name "-" version ".tgz"))
233 (base32 "000906nnq25177bgsfndiw3iqqgrjc9spk10hzk653sbz3f7anmi"))))
234 (build-system gnu-build-system)
235 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
237 `(("cl-asdf" ,cl-asdf)
239 ("texinfo" ,texinfo)))
240 ;; When ECL is embedded in a program that wants to use Common Lisp as an
241 ;; extension language, libgmp, libatomic-ops, libgc and libffi must be
242 ;; present when compiling the program because they are required by ECL's
244 ;; Therefore we put these libraries in 'propagated-inputs' instead
248 ("libatomic-ops" ,libatomic-ops)
252 `(#:configure-flags '("--without-rt")
253 ;; FIXME: As of version 20.4.24, we pass 17995 tests and fail 7.
254 ;; 2-3 tests may be due to FHS assumptions.
258 (modify-phases %standard-phases
260 (add-after 'unpack 'replace-asdf
261 ;; Use system ASDF instead of bundled one.
262 (lambda* (#:key inputs #:allow-other-keys)
263 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
264 (guix-asdf (string-append
266 "/share/common-lisp/source/asdf/asdf.lisp"))
267 (contrib-asdf "contrib/asdf/asdf.lisp"))
268 (copy-file guix-asdf contrib-asdf))
270 (add-after 'install 'remove-build-stamp
271 (lambda* (#:key outputs #:allow-other-keys)
272 (delete-file (string-append (assoc-ref outputs "out")
273 "/lib/ecl-" ,version "/build-stamp"))
275 (add-after 'remove-build-stamp 'wrap
276 (lambda* (#:key inputs outputs #:allow-other-keys)
277 (let* ((ecl (assoc-ref outputs "out"))
278 (input-path (lambda (lib path)
280 (assoc-ref inputs lib) path)))
281 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
282 (binaries '("gcc" "ld-wrapper" "binutils"))
284 (map (lambda (lib) (input-path lib "/lib"))
287 (wrap-program (string-append ecl "/bin/ecl")
289 ,(map (lambda (binary)
290 (input-path binary "/bin"))
294 (input-path lib "/include"))
295 `("kernel-headers" ,@libraries)))
296 `("LIBRARY_PATH" suffix ,library-directories)
297 `("LD_LIBRARY_PATH" suffix ,library-directories))
299 (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
300 (add-before 'check 'fix-path-to-ecl
302 (substitute* "build/tests/Makefile"
303 (("\\$\\{exec_prefix\\}/") ""))
306 (list (search-path-specification
307 (variable "XDG_DATA_DIRS")
309 (search-path-specification
310 (variable "XDG_CONFIG_DIRS")
312 (home-page "http://ecls.sourceforge.net/")
313 (synopsis "Embeddable Common Lisp")
314 (description "ECL is an implementation of the Common Lisp language as
315 defined by the ANSI X3J13 specification. Its most relevant features are: a
316 bytecode compiler and interpreter, being able to compile Common Lisp with any
317 C/C++ compiler, being able to build standalone executables and libraries, and
318 supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
319 ;; Note that the file "Copyright" points to some files and directories
320 ;; which aren't under the lgpl2.1+ and instead contain many different,
321 ;; non-copyleft licenses.
322 ;; See https://common-lisp.net/project/ecl/posts/ECL-license.html.
323 (license license:lgpl2.1+)))
333 (url "https://gitlab.com/gnu-clisp/clisp")
334 (commit "clisp-2.49.92-2018-02-18")))
335 (file-name (git-file-name name version))
337 (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))))
338 (build-system gnu-build-system)
340 `(("cl-asdf" ,cl-asdf)))
341 (inputs `(("libffcall" ,libffcall)
343 ("readline" ,readline)
344 ("libsigsegv" ,libsigsegv)))
346 `(#:configure-flags '(,@(if (string-prefix? "armhf-linux"
347 (or (%current-system)
348 (%current-target-system)))
349 '("CFLAGS=-falign-functions=4")
352 "--with-dynamic-modules"
357 "--with-module=rawsock")
359 (modify-phases %standard-phases
360 (add-after 'unpack 'patch-sh-and-pwd
362 ;; The package is very messy with its references to "/bin/sh" and
363 ;; some other absolute paths to traditional tools. These appear in
364 ;; many places where our automatic patching misses them. Therefore
365 ;; we do the following, in this early (post-unpack) phase, to solve
366 ;; the problem from its root.
367 (substitute* '("src/clisp-link.in"
370 (("/bin/sh") (which "sh")))
371 (substitute* (find-files "." "configure|Makefile")
373 (substitute* '("src/clisp-link.in")
374 (("/bin/pwd") "pwd"))
376 (add-after 'unpack 'replace-asdf
377 ;; Use system ASDF instead of bundled one.
378 (lambda* (#:key inputs #:allow-other-keys)
379 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
380 (guix-asdf (string-append
382 "/share/common-lisp/source/asdf/asdf.lisp"))
383 (contrib-asdf "modules/asdf/asdf.lisp"))
384 (delete-file contrib-asdf)
385 (copy-file guix-asdf contrib-asdf)))))))
387 (list (search-path-specification
388 (variable "XDG_DATA_DIRS")
390 (search-path-specification
391 (variable "XDG_CONFIG_DIRS")
393 (home-page "https://clisp.sourceforge.io/")
394 (synopsis "A Common Lisp implementation")
396 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
397 high-level, object-oriented functional programming language. CLISP includes
398 an interpreter, a compiler, a debugger, and much more.")
399 (license license:gpl2+)))
408 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
409 version "-source.tar.bz2"))
411 (base32 "1id8r2y8hiz34lmvszikdqgrmr778jshim0fibb915assvn0fn4n"))))
412 (build-system gnu-build-system)
413 (outputs '("out" "doc"))
416 ;; Supported build hosts are:
419 ;; CCL (formerly known as OpenMCL)
420 ;; ABCL (recent versions only)
421 ;; CLISP (only some versions: 2.44.1 is OK, 2.47 is not)
425 ;; * build enhancement: new host quirks mechanism, support for building under
426 ;; ABCL and ECL (as well as CCL, CMUCL, CLISP and SBCL itself)
428 ;; CCL is not bootstrappable so it won't do. CLISP 2.49 seems to work.
429 ;; ECL too. As of 2020-07-01, ECL was last updated in 2020 while CLISP
430 ;; was last updated in 2010, and both take about the same time to build SBCL.
432 ;; For now we stick to CLISP for all systems. We keep the `match' here
433 ;; to make it easier to change the host compiler for various
434 ;; architectures. Consider switching to ECL if it gets faster than CLISP
435 ;; (maybe post 2020 release).
436 `(,@(match (%current-system)
437 ((or "x86_64-linux" "i686-linux")
440 `(("clisp" ,clisp))))
443 ("inetutils" ,inetutils) ;for hostname(1)
445 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
449 `(#:modules ((guix build gnu-build-system)
453 (modify-phases %standard-phases
455 (add-after 'unpack 'replace-asdf
456 ;; SBCL developers have not committed to keeping ASDF up to date
457 ;; due to breaking changes [1]. Guix can handle this situation
458 ;; easily, and it behooves us to have more control over what version
459 ;; of ASDF we use to build software; therefore, replace the contrib
460 ;; ASDF with the version packaged into Guix.
461 ;; [1] - https://bugs.launchpad.net/sbcl/+bug/1823442
462 (lambda* (#:key inputs #:allow-other-keys)
463 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
464 (guix-asdf (string-append
466 "/share/common-lisp/source/asdf/asdf.lisp"))
467 (contrib-asdf "contrib/asdf/asdf.lisp"))
468 (copy-file guix-asdf contrib-asdf))
470 (add-before 'build 'patch-unix-tool-paths
471 (lambda* (#:key outputs inputs #:allow-other-keys)
472 (let ((out (assoc-ref outputs "out"))
473 (bash (assoc-ref inputs "bash"))
474 (coreutils (assoc-ref inputs "coreutils"))
475 (ed (assoc-ref inputs "ed")))
476 (define (quoted-path input path)
477 (string-append "\"" input path "\""))
478 ;; Patch absolute paths in string literals. Note that this
479 ;; occurs in some .sh files too (which contain Lisp code). Use
480 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
481 (with-fluids ((%default-port-encoding #f))
482 ;; The removed file is utf-16-be encoded, which gives substitute*
483 ;; trouble. It does not contain references to the listed programs.
485 "./tests/data/compile-file-pos-utf16be.lisp"
486 (find-files "." "\\.(lisp|sh)$"))
487 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
488 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
489 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
490 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
491 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
492 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
493 ;; This one script has a non-string occurrence of /bin/sh.
494 (substitute* '("tests/foreign.test.sh")
495 ;; Leave whitespace so we don't match the shebang.
496 ((" /bin/sh ") " sh "))
497 ;; This file contains a module that can create executable files
498 ;; which depend on the presence of SBCL. It generates shell
499 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
500 ;; the shebang and the reference to "sbcl", tying the generated
501 ;; executables to the exact SBCL package that generated them.
502 (substitute* '("contrib/sb-executable/sb-executable.lisp")
503 (("/bin/sh") (string-append bash "/bin/sh"))
504 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
505 ;; Disable some tests that fail in our build environment.
506 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
507 ;; This requires /etc/protocols.
508 (("\\(deftest get-protocol-by-name/error" all)
509 (string-append "#+nil ;disabled by Guix\n" all)))
510 (substitute* '("contrib/sb-posix/posix-tests.lisp")
511 ;; These assume some users/groups which we don't have.
512 (("\\(deftest pwent\\.[12]" all)
513 (string-append "#+nil ;disabled by Guix\n" all))
514 (("\\(deftest grent\\.[12]" all)
515 (string-append "#+nil ;disabled by Guix\n" all))))
517 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
518 ;; them in HOME, so it needs to be writeable.
519 (add-before 'build 'set-HOME
520 (lambda _ (setenv "HOME" "/tmp") #t))
522 (lambda* (#:key outputs #:allow-other-keys)
524 (invoke "sh" "make.sh" ,@(match (%current-system)
525 ((or "x86_64-linux" "i686-linux")
529 (string-append "--prefix="
530 (assoc-ref outputs "out"))
531 "--dynamic-space-size=3072"
532 "--with-sb-core-compression"
533 "--with-sb-xref-for-internals")))
536 (invoke "sh" "install.sh")))
537 (add-after 'build 'build-doc
539 ;; TODO: Doc is not deterministic, maybe there is a timespamp?
540 (with-directory-excursion "doc/manual"
541 (and (invoke "make" "info")
542 (invoke "make" "dist")))))
543 (add-after 'build 'build-source
544 (lambda* (#:key outputs #:allow-other-keys)
545 (let* ((out (assoc-ref outputs "out"))
546 (rc (string-append out "/lib/sbcl/sbclrc"))
547 (source-dir (string-append out "/share/sbcl")))
548 (for-each (lambda (p)
549 (copy-recursively p (string-append source-dir "/" p)))
551 (mkdir-p (dirname rc))
552 (with-output-to-file rc
555 (string-append "(sb-ext:set-sbcl-source-location \""
556 source-dir "\")") )))
558 (add-after 'install 'install-doc
559 (lambda* (#:key outputs #:allow-other-keys)
560 (let* ((out (assoc-ref outputs "out"))
561 (doc (assoc-ref outputs "doc"))
562 (old-doc-dir (string-append out "/share/doc"))
563 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
564 (rmdir (string-append old-doc-dir "/sbcl/html"))
565 (mkdir-p new-doc/sbcl-dir)
566 (copy-recursively (string-append old-doc-dir "/sbcl")
568 (delete-file-recursively old-doc-dir)
570 ;; No 'check' target, though "make.sh" (build phase) runs tests.
573 (list (search-path-specification
574 (variable "XDG_DATA_DIRS")
576 (search-path-specification
577 (variable "XDG_CONFIG_DIRS")
579 (home-page "http://www.sbcl.org/")
580 (synopsis "Common Lisp implementation")
581 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
582 Lisp compiler. In addition to the compiler and runtime system for ANSI Common
583 Lisp, it provides an interactive environment including a debugger, a
584 statistical profiler, a code coverage tool, and many other extensions.")
585 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
586 ;; loop macro has its own license. See COPYING file for further notes.
587 (license (list license:public-domain license:bsd-2
588 (license:x11-style "file://src/code/loop.lisp")))))
591 ;; Warning: according to upstream, CCL is not bootstrappable.
592 ;; See https://github.com/Clozure/ccl/issues/222 from 2019-09-02:
594 ;; "As far as I know, there is no way to build CCL without an existing
595 ;; running CCL image. It was bootstrapped back in 1986 or so as
596 ;; Macintosh Common Lisp, by Gary Byers, I believe, who is no longer on
597 ;; the planet to tell us the story. It SHOULD be possible to port the
598 ;; CCL compiler to portable Common Lisp, so that ANY lisp could build
599 ;; it, as is the case for SBCL, but I know of no attempt to do so."
602 ;; XXX When updating this package, check whether we can simply append
603 ;; VERSION to the ccl-bootstrap URL again, instead of per architecture.
608 (url "https://github.com/Clozure/ccl/")
609 (commit (string-append "v" version))))
610 (file-name (git-file-name "ccl" version))
613 "1zz291lvsrr7pps8wfl2kdxsnzjngqi4v3mil14pga4r5zanmsi7"))))
614 (build-system gnu-build-system)
615 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
616 ;; shipped in precompiled form in source tarballs. The former is a C
617 ;; program which we can rebuild from scratch, but the latter cannot be
618 ;; generated without an already working copy of CCL, and is platform
619 ;; dependent, so we need to fetch the correct tarball for the platform.
625 "https://github.com/Clozure/ccl/releases/download/v"
626 (match (%current-system)
627 ("armhf-linux" "1.12/linuxarm")
628 ;; XXX: This source only works on x86, but provide it as a
629 ;; catch-all to prevent errors when querying this package
630 ;; on unsupported platforms.
631 (_ "1.12.1/linuxx86"))
635 (match (%current-system)
637 "0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
638 (_ "0ll017ajcfsyx8f7zsy4394y8xxvz40iz0gcsmznp0n3mf0xi67c"))))))))
640 `(("cl-asdf" ,cl-asdf)
643 `(#:tests? #f ;no 'check' target
644 #:modules ((ice-9 match)
647 (guix build gnu-build-system))
649 (modify-phases %standard-phases
650 (add-after 'unpack 'unpack-image
651 (lambda* (#:key inputs #:allow-other-keys)
652 (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
653 (add-after 'unpack 'replace-asdf
654 ;; Use system ASDF instead of bundled one.
655 (lambda* (#:key inputs #:allow-other-keys)
656 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
657 (guix-asdf (string-append
659 "/share/common-lisp/source/asdf/asdf.lisp"))
660 (contrib-asdf "tools/asdf.lisp"))
661 (delete-file contrib-asdf)
662 (copy-file guix-asdf contrib-asdf))))
664 (add-before 'build 'pre-build
665 ;; Enter the source directory for the current platform's lisp
666 ;; kernel, and run 'make clean' to remove the precompiled one.
667 (lambda* (#:key system #:allow-other-keys)
668 (substitute* "lisp-kernel/m4macros.m4"
669 (("/bin/pwd") (which "pwd")))
670 (chdir (string-append
673 ("i686-linux" "linuxx8632")
674 ("x86_64-linux" "linuxx8664")
675 ("armhf-linux" "linuxarm")
676 (_ (string-append "unknown system: " system)))))
677 (substitute* '("Makefile")
680 (invoke "make" "clean")))
681 ;; XXX Do we need to recompile the heap image as well for Guix?
682 ;; For now just use the one we already got in the tarball.
684 (lambda* (#:key outputs inputs system #:allow-other-keys)
685 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
686 ;; is put back into the original directory, so go back. The heap
687 ;; image is there as well.
689 (let* ((out (assoc-ref outputs "out"))
690 (libdir (string-append out "/lib/"))
691 (bindir (string-append out "/bin/"))
692 (wrapper (string-append bindir "ccl"))
693 (bash (assoc-ref inputs "bash"))
696 ("i686-linux" "lx86cl")
697 ("x86_64-linux" "lx86cl64")
698 ("armhf-linux" "armcl")
699 ;; Unlikely to work, but try it anyway...
701 (heap (string-append kernel ".image")))
702 (install-file kernel libdir)
703 (install-file heap libdir)
705 (let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
712 (for-each copy-recursively
714 (map (cut string-append libdir <>) dirs)))
717 (with-output-to-file wrapper
721 "#!" bash "/bin/sh\n"
722 "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
723 "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
724 (chmod wrapper #o755))
727 (list (search-path-specification
728 (variable "XDG_DATA_DIRS")
730 (search-path-specification
731 (variable "XDG_CONFIG_DIRS")
733 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
734 (home-page "https://ccl.clozure.com/")
735 (synopsis "Common Lisp implementation")
736 (description "Clozure CL (often called CCL for short) is a Common Lisp
737 implementation featuring fast compilation speed, native threads, a precise,
738 generational, compacting garbage collector, and a convenient foreign-function
740 (license license:asl2.0)))
749 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
751 (modules '((guix build utils)))
754 (substitute* "src/unix.c"
755 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
756 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
757 (substitute* "src/main.c"
758 (("\" \\(built \" __DATE__ \"\\)\"") ""))
762 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
763 (build-system gnu-build-system)
765 `(;; We have to add these LIBS so that they are found.
766 #:configure-flags (list "LIBS=-lz"
767 "X_EXTRA_LIBS=-lfontconfig"
769 #:tests? #f)) ; No make check.
770 (native-inputs `(("intltool" ,intltool)))
772 `(("alsa-lib" ,alsa-lib)
774 ("sdl-image" ,sdl-image)
775 ("sdl-mixer" ,sdl-mixer)
780 ("fontconfig" ,fontconfig)
782 ("openblas" ,openblas)
785 ("mesa-utils" ,mesa-utils)
786 ("binutils" ,binutils)
787 ("libiberty" ,libiberty)
788 ("readline" ,readline)
790 ("gettext-minimal" ,gettext-minimal)))
791 (synopsis "Lisp Universal Shell")
793 "Lush is an object-oriented Lisp interpreter/compiler with features
794 designed to please people who want to prototype large numerical
795 applications. Lush includes an extensive library of
796 vector/matrix/tensor manipulation, numerous numerical libraries
797 (including GSL, LAPACK, and BLAS), a set of graphic functions, a
798 simple GUI toolkit, and interfaces to various graphic and multimedia
799 libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
800 grabbing), and others. Lush is an ideal frontend script language for
801 programming projects written in C or other languages. Lush also has
802 libraries for Machine Learning, Neural Nets and statistical estimation.")
803 (home-page "http://lush.sourceforge.net/")
804 (license license:lgpl2.1+)))
806 (define-public confusion-mdl
807 (let* ((commit "12a055581fc262225272df43287dae48281900f5"))
809 (name "confusion-mdl")
814 (url (string-append "https://gitlab.com/emacsomancer/" name))
818 "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d"))
819 (file-name (git-file-name name version))))
820 (build-system gnu-build-system)
822 `(#:tests? #f ; there are no tests
824 (modify-phases %standard-phases
827 (lambda* (#:key (make-flags '()) #:allow-other-keys)
828 (apply invoke "make" "CC=gcc" make-flags)))
830 (lambda* (#:key outputs #:allow-other-keys)
831 (let* ((out (assoc-ref outputs "out"))
832 (bin (string-append out "/bin")))
833 (install-file "mdli" bin)
839 (synopsis "Interpreter for the MIT Design Language (MDL)")
840 (description "MDL (the MIT Design Language) is a descendant of Lisp. It
841 was originally developed in 1971 on the PDP-10 computer under the Incompatible
842 Timesharing System (ITS) to provide high level language support for the
843 Dynamic Modeling Group at MIT's Project MAC. Infocom built the original
844 PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was
845 based on a subset of MDL. Confusion is a MDL interpreter that works just well
846 enough to play the original mainframe Zork all the way through.")
847 (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README")
848 (license license:gpl3+))))
858 (url "http://www.kylheku.com/git/txr/")
859 (commit (string-append "txr-" version))))
860 (file-name (git-file-name name version))
862 (base32 "1awg6l458pl2y340l0vja2j5q636vh2mx2mllxqydg36j89lfniz"))))
863 (build-system gnu-build-system)
866 (list ,(string-append "cc=" (cc-for-target))
867 (string-append "--prefix=" (assoc-ref %outputs "out")))
868 #:test-target "tests"
870 (modify-phases %standard-phases
872 ;; ./configure is a hand-written script that can't handle standard
873 ;; autotools arguments like CONFIG_SHELL.
874 (lambda* (#:key configure-flags #:allow-other-keys)
875 (setenv "txr_shell" (which "bash"))
876 (apply invoke "./configure" configure-flags)
878 (add-after 'configure 'fix-tests
880 (substitute* (list "tests/017/realpath.tl"
881 "tests/017/realpath.expected")
885 `(("libffi" ,libffi)))
886 (synopsis "General-purpose, multi-paradigm programming language")
888 "TXR is a general-purpose, multi-paradigm programming language. It
889 comprises two languages integrated into a single tool: a text scanning and
890 extraction language referred to as the TXR Pattern Language (sometimes just
891 \"TXR\"), and a general-purpose dialect of Lisp called TXR Lisp. TXR can be
892 used for everything from \"one liner\" data transformation tasks at the
893 command line, to data scanning and extracting scripts, to full application
894 development in a wide-range of areas.")
895 (home-page "https://nongnu.org/txr/")
896 (license license:bsd-2)))
905 (uri (string-append "https://software-lab.de/picoLisp-" version ".tgz"))
907 (base32 "10np0mhihr47r3201617zccrvzpkhdl1jwvz7zimk8kxpriydq2j"))
908 (modules '((guix build utils)))
910 ;; Delete the pre-compiled jar file.
911 (delete-file "ersatz/picolisp.jar")
913 (build-system gnu-build-system)
915 `(("openssl" ,openssl)))
917 `(#:system ,(match (%current-system)
918 ((or "armhf-linux" "aarch64-linux")
923 (modify-phases %standard-phases
925 (add-after 'unpack 'fix-paths
926 (lambda* (#:key outputs #:allow-other-keys)
927 (let* ((out (assoc-ref outputs "out"))
928 (shebang-line (string-append
929 "#!" out "/bin/picolisp "
930 out "/lib/picolisp/lib.l")))
931 (substitute* '("bin/pil"
944 (("#\\!bin/picolisp lib.l")
946 (("#\\!\\.\\./bin/picolisp \\.\\./lib.l")
948 (("#\\!/usr/bin/picolisp /usr/lib/picolisp/lib.l")
951 (add-after 'fix-paths 'make-build-reproducible
953 (substitute* "src64/lib/asm.l"
954 (("\\(prinl \"/\\* \" \\(datSym \\(date\\)\\) \" \\*/\\)")
957 (add-after 'make-build-reproducible 'fix-permissions
959 (for-each make-file-writable
967 (invoke "make" "-C" "src" "picolisp" "tools" "gate")))
968 (add-before 'check 'set-home-for-tests
970 (setenv "HOME" "/tmp")
974 (invoke "./pil" "test/lib.l" "-bye" "+")))
976 (lambda* (#:key outputs #:allow-other-keys)
977 (let* ((out (assoc-ref outputs "out"))
978 (bin (string-append out "/bin"))
979 (man (string-append out "/share/man"))
980 (picolisp (string-append out "/lib/picolisp")))
981 (copy-recursively "man" man)
982 (copy-recursively "." picolisp)
983 (for-each (lambda (name)
984 (let ((path (string-append picolisp "/" name)))
985 (delete-file-recursively path)))
986 '("CHANGES" "COPYING" "CREDITS" "cygwin"
987 "INSTALL" "man" "pil" "README" "src" "src64"
990 (symlink (string-append picolisp "/bin/picolisp")
991 (string-append bin "/picolisp"))
992 (symlink (string-append picolisp "/bin/pil")
993 (string-append bin "/pil")))
995 (synopsis "Interpreter for the PicoLisp programming language")
997 "PicoLisp is a programming language, or really a programming system,
998 including a built-in database engine and a GUI system.")
999 (home-page "https://picolisp.com/wiki/?home")
1000 (license license:expat)))
1002 (define-public picolisp
1003 (match (%current-system)
1004 ((or "aarch64-linux" "x86_64-linux")
1006 ;; Use the 32-bit picolisp to generate the assembly files required by
1007 ;; the 64-bit picolisp.
1008 (inherit picolisp32)
1011 `(("picolisp32" ,picolisp32)
1014 (substitute-keyword-arguments (package-arguments picolisp32)
1015 ((#:system _ "") (%current-system))
1017 `(modify-phases ,phases
1019 (add-before 'build 'fix-paths
1020 ;; This must run after the other shebang-patching phases,
1021 ;; or they will override our changes.
1022 (lambda* (#:key inputs outputs #:allow-other-keys)
1023 (let* ((picolisp32 (assoc-ref inputs "picolisp32"))
1024 (out (assoc-ref outputs "out"))
1025 (shebang-line (string-append
1026 "#!" out "/bin/picolisp "
1027 out "/lib/picolisp/lib.l")))
1028 (substitute* '("bin/pil"
1041 (("#\\!.*picolisp32.*/bin/picolisp .*lib\\.l")
1043 (substitute* "src64/mkAsm"
1045 (string-append picolisp32 "/bin/"))))
1049 (invoke "make" "-C" "src" "tools" "gate")
1050 (invoke "make" "-C" "src64" "CC=gcc" "picolisp")))))))))
1053 (inherit picolisp32)
1054 (name "picolisp")))))
1056 (define-public janet
1064 (url "https://github.com/janet-lang/janet")
1065 (commit (string-append "v" version))))
1066 (file-name (git-file-name name version))
1068 (base32 "0gl0p3x0ylj4hxiwjclg1waxq8csadw60qw6pa9h5y4w1bcqffmk"))
1069 (build-system gnu-build-system)
1071 `(#:make-flags (list
1072 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
1073 (string-append "PREFIX=")
1074 (string-append "CC=" (assoc-ref %build-inputs "gcc")
1076 #:test-target "test"
1078 (modify-phases %standard-phases
1079 (delete 'configure))))
1080 (home-page "https://janet-lang.org/")
1081 (synopsis "Functional, imperative and embeddable programming language")
1083 "Janet is a functional and imperative programming language. It can be
1084 used for rapid prototyping, dynamic systems, and other domains where dynamic
1085 languages shine. You can also add Janet scripting to an application by
1086 embedding a single C file and two headers. It can be easily ported to new
1087 platforms. The entire language (core library, interpreter, compiler,
1088 assembler, PEG) is less than 1MB.")
1089 (license license:expat)))
1091 (define-public lisp-repl-core-dumper
1093 (name "lisp-repl-core-dumper")
1099 (url "https://gitlab.com/ambrevar/lisp-repl-core-dumper.git")
1101 (file-name (git-file-name name version))
1103 (base32 "0yfsyxj462yi3bx587yssp4gwb54jdm6fjk9q93gjrfv8a65ilp7"))))
1104 (build-system copy-build-system)
1107 '(("lisp-repl-core-dumper" "bin/"))
1109 (modify-phases %standard-phases
1110 (add-before 'install 'fix-utils-path
1111 (lambda* (#:key inputs #:allow-other-keys)
1112 (let* ((coreutils (string-append (assoc-ref inputs "coreutils") "/bin/"))
1113 (cat (string-append coreutils "cat"))
1114 (paste (string-append coreutils "paste"))
1115 (sort (string-append coreutils "sort"))
1116 (basename (string-append coreutils "basename"))
1117 (sed (string-append (assoc-ref inputs "sed") "/bin/sed")))
1118 (substitute* "lisp-repl-core-dumper"
1119 (("\\$\\(basename") (string-append "$(" basename))
1121 (("\\<paste\\>") paste)
1123 (("\\<sort\\>") sort))))))))
1125 `(("coreutils" ,coreutils-minimal)
1127 (home-page "https://gitlab.com/ambrevar/lisp-repl-core-dumper")
1128 (synopsis "Generate REPL-optimized Lisp cores on demand")
1130 "This tool generates Lisp images that can embed the provided systems
1131 and make for REPLs that start blazing fast.
1134 @item It’s portable and should work with any compiler.
1135 @item It works for any REPL.
1136 @item It allows you to include arbitrary libraries.
1138 (license license:gpl3+)))
1140 (define-public buildapp
1148 (url "https://github.com/xach/buildapp")
1149 (commit (string-append "release-" version))))
1150 (file-name (git-file-name name version))
1152 (base32 "020ipjfqa3l8skd97cj5kq837wgpj28ygfxnkv64cnjrlbnzh161"))))
1153 (build-system gnu-build-system)
1159 (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
1160 #:strip-binaries? #f
1162 (modify-phases %standard-phases
1164 (add-after 'unpack 'set-home
1166 (setenv "HOME" "/tmp")
1168 (add-before 'install 'create-target-directory
1169 (lambda* (#:key outputs #:allow-other-keys)
1170 (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
1173 (home-page "https://www.xach.com/lisp/buildapp/")
1174 (synopsis "Makes easy to build application executables with SBCL")
1176 "Buildapp is an application for SBCL or CCL that configures and saves an
1177 executable Common Lisp image. It is similar to cl-launch and hu.dwim.build. ")
1178 (license license:bsd-2)))