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, 2020 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 Guillaume Le Vaillant <glv@posteo.net>
18 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
20 ;;; This file is part of GNU Guix.
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35 ;;; This file only contains Common Lisp compilers and tooling.
36 ;;; Common Lisp libraries go to lisp-xyz.scm.
37 ;;; Common Lisp applications should go to the most appropriate file,
38 ;;; e.g. StumpWM is in wm.scm.
40 (define-module (gnu packages lisp)
41 #:use-module (gnu packages)
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix packages)
44 #:use-module (guix download)
45 #:use-module (guix git-download)
46 #:use-module (guix utils)
47 #:use-module (guix build-system copy)
48 #:use-module (guix build-system gnu)
49 #:use-module (guix build-system ant)
50 #:use-module (guix build-system asdf)
51 #:use-module (guix build-system trivial)
52 #:use-module (gnu packages admin)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bdw-gc)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages ed)
57 #:use-module (gnu packages fontutils)
58 #:use-module (gnu packages gcc)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages gl)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages m4)
63 #:use-module (gnu packages maths)
64 #:use-module (gnu packages multiprecision)
65 #:use-module (gnu packages ncurses)
66 #:use-module (gnu packages libffcall)
67 #:use-module (gnu packages libffi)
68 #:use-module (gnu packages libsigsegv)
69 #:use-module (gnu packages linux)
70 #:use-module (gnu packages perl)
71 #:use-module (gnu packages readline)
72 #:use-module (gnu packages sdl)
73 #:use-module (gnu packages tex)
74 #:use-module (gnu packages tls)
75 #:use-module (gnu packages texinfo)
76 #:use-module (gnu packages version-control)
77 #:use-module (gnu packages xorg)
78 #:use-module (ice-9 match))
80 (define-public cl-asdf
88 (string-append "https://common-lisp.net/project/asdf/archives/asdf-"
91 (base32 "1hpx30f6yrak15nw992k7x3pn75ahvjs04n4f134k68mhgs62km2"))))
92 (build-system trivial-build-system)
94 `(#:modules ((guix build utils)
95 (guix build lisp-utils))
98 (use-modules (guix build utils)
99 (guix build lisp-utils))
100 (let* ((out (string-append (assoc-ref %outputs "out")))
101 (asdf-install (string-append out %source-install-prefix
103 (src-asdf (string-append (assoc-ref %build-inputs "source")))
104 (dst-asdf (string-append asdf-install "asdf.lisp")))
105 (mkdir-p asdf-install)
106 (copy-file src-asdf dst-asdf)
107 ;; Patch ASDF to make it read the configuration files in all
108 ;; the direcories listed in '$XDG_CONFIG_DIRS' instead of just
110 (substitute* dst-asdf
111 (("\\(xdg-config-pathname \\*source-registry-directory\\* direction\\)")
114 for dir in (xdg-config-dirs
115 \"common-lisp/source-registry.conf.d/\")
116 collect `(:include ,dir))
117 :inherit-configuration)")
118 (("\\(xdg-config-pathname \\*output-translations-directory\\* direction\\)")
119 "`(:output-translations
121 for dir in (xdg-config-dirs
122 \"common-lisp/asdf-output-translations.conf.d/\")
123 collect `(:include ,dir))
124 :inherit-configuration)")))
126 (home-page "https://common-lisp.net/project/asdf/")
127 (synopsis "Another System Definition Facility")
129 "ASDF is what Common Lisp hackers use to build and load software. It is
130 the successor of the Lisp DEFSYSTEM of yore. ASDF stands for Another System
131 Definition Facility.")
133 (license license:expat)))
136 (let ((commit "d3335e2b3deb63f930eb0328e9b05377744c9512")
137 (revision "2")) ;Guix package revision
140 (version (string-append "2.6.12-" revision "."
141 (string-take commit 7)))
146 (url "https://git.savannah.gnu.org/r/gcl.git")
148 (file-name (string-append "gcl-" version "-checkout"))
150 (base32 "05v86lhvsby05nzvcd3c4k0wljvgdgd0i6arzd2fx1yd67dl6fgj"))))
151 (build-system gnu-build-system)
153 `(#:parallel-build? #f ; The build system seems not to be thread safe.
154 #:test-target "ansi-tests/test_results"
155 #:configure-flags '("--enable-ansi") ; required for use by the maxima package
157 (string-append "GCL_CC=" (assoc-ref %build-inputs "gcc")
159 (string-append "CC=" (assoc-ref %build-inputs "gcc")
162 (modify-phases %standard-phases
163 (add-before 'configure 'pre-conf
164 (lambda* (#:key inputs #:allow-other-keys)
168 '("pcl/impl/kcl/makefile.akcl"
170 "unixport/makefile.dos"
172 "gcl-tk/makefile.prev"
174 (find-files "h" "\\.defs"))
176 (string-append "SHELL=" (which "bash")))
178 (string-append "SHELL=" (which "sh"))))
179 (substitute* "h/linux.defs"
181 (("-fwritable-strings") "")
183 (substitute* "lsp/gcl_top.lsp"
185 (string-append "\"" (assoc-ref %build-inputs "gcc")
187 (("\\(or \\(get-path \\*cc\\*\\) \\*cc\\*\\)") "*cc*")
189 (string-append "\"" (assoc-ref %build-inputs "binutils")
191 (("\\(or \\(get-path \\*ld\\*\\) \\*ld\\*\\)") "*ld*")
192 (("\\(get-path \"objdump --source \"\\)")
193 (string-append "\"" (assoc-ref %build-inputs "binutils")
194 "/bin/objdump --source \"")))
196 (add-after 'install 'wrap
197 (lambda* (#:key inputs outputs #:allow-other-keys)
198 (let* ((gcl (assoc-ref outputs "out"))
199 (input-path (lambda (lib path)
201 (assoc-ref inputs lib) path)))
202 (binaries '("binutils")))
203 ;; GCC and the GNU binutils are necessary for GCL to be
204 ;; able to compile Lisp functions and programs (this is
205 ;; a standard feature in Common Lisp). While the
206 ;; the location of GCC is specified in the make-flags,
207 ;; the GNU binutils must be available in GCL's $PATH.
208 (wrap-program (string-append gcl "/bin/gcl")
209 `("PATH" prefix ,(map (lambda (binary)
210 (input-path binary "/bin"))
213 ;; drop strip phase to make maxima build, see
214 ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
218 ("readline" ,readline)))
221 ("texinfo" ,texinfo)))
222 (home-page "https://www.gnu.org/software/gcl/")
223 (synopsis "A Common Lisp implementation")
224 (description "GCL is an implementation of the Common Lisp language. It
225 features the ability to compile to native object code and to load native
226 object code modules directly into its lisp core. It also features a
227 stratified garbage collection strategy, a source-level debugger and a built-in
228 interface to the Tk widget system.")
229 (license license:lgpl2.0+))))
239 "https://common-lisp.net/project/ecl/static/files/release/"
240 name "-" version ".tgz"))
242 (base32 "01qgdmr54wkj854f69qdm9sybrvd6gd21dpx4askdaaqybnkh237"))))
243 (build-system gnu-build-system)
244 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
246 `(("cl-asdf" ,cl-asdf)
248 ("texinfo" ,texinfo)))
251 ("libatomic-ops" ,libatomic-ops)
255 `(#:configure-flags '("--without-rt")
256 ;; FIXME: As of version 20.4.24, we pass 17995 tests and fail 7.
257 ;; 2-3 tests may be due to FHS assumptions.
261 (modify-phases %standard-phases
263 (add-after 'unpack 'replace-asdf
264 ;; Use system ASDF instead of bundled one.
265 (lambda* (#:key inputs outputs #:allow-other-keys)
266 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
267 (guix-asdf (string-append
269 "/share/common-lisp/source/asdf/asdf.lisp"))
270 (out (string-append (assoc-ref outputs "out")))
271 (contrib-asdf "contrib/asdf/asdf.lisp"))
272 (copy-file guix-asdf contrib-asdf))
274 (add-after 'install 'wrap
275 (lambda* (#:key inputs outputs #:allow-other-keys)
276 (let* ((ecl (assoc-ref outputs "out"))
277 (input-path (lambda (lib path)
279 (assoc-ref inputs lib) path)))
280 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
281 (binaries '("gcc" "ld-wrapper" "binutils"))
283 (map (lambda (lib) (input-path lib "/lib"))
286 (wrap-program (string-append ecl "/bin/ecl")
288 ,(map (lambda (binary)
289 (input-path binary "/bin"))
293 (input-path lib "/include"))
294 `("kernel-headers" ,@libraries)))
295 `("LIBRARY_PATH" suffix ,library-directories)
296 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
297 (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
298 (add-before 'check 'fix-path-to-ecl
300 (substitute* "build/tests/Makefile"
301 (("\\$\\{exec_prefix\\}/") ""))
304 (list (search-path-specification
305 (variable "XDG_DATA_DIRS")
307 (search-path-specification
308 (variable "XDG_CONFIG_DIRS")
310 (home-page "http://ecls.sourceforge.net/")
311 (synopsis "Embeddable Common Lisp")
312 (description "ECL is an implementation of the Common Lisp language as
313 defined by the ANSI X3J13 specification. Its most relevant features are: a
314 bytecode compiler and interpreter, being able to compile Common Lisp with any
315 C/C++ compiler, being able to build standalone executables and libraries, and
316 supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
317 ;; Note that the file "Copyright" points to some files and directories
318 ;; which aren't under the lgpl2.1+ and instead contain many different,
319 ;; non-copyleft licenses.
320 ;; See https://common-lisp.net/project/ecl/posts/ECL-license.html.
321 (license license:lgpl2.1+)))
331 (url "https://gitlab.com/gnu-clisp/clisp")
332 (commit "clisp-2.49.92-2018-02-18")))
333 (file-name (git-file-name name version))
335 (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))))
336 (build-system gnu-build-system)
337 (inputs `(("libffcall" ,libffcall)
339 ("readline" ,readline)
340 ("libsigsegv" ,libsigsegv)))
342 `(#:configure-flags '(,@(if (string-prefix? "armhf-linux"
343 (or (%current-system)
344 (%current-target-system)))
345 '("CFLAGS=-falign-functions=4")
348 "--with-dynamic-modules"
353 "--with-module=rawsock")
355 (modify-phases %standard-phases
356 (add-after 'unpack 'patch-sh-and-pwd
358 ;; The package is very messy with its references to "/bin/sh" and
359 ;; some other absolute paths to traditional tools. These appear in
360 ;; many places where our automatic patching misses them. Therefore
361 ;; we do the following, in this early (post-unpack) phase, to solve
362 ;; the problem from its root.
363 (substitute* '("src/clisp-link.in"
366 (("/bin/sh") (which "sh")))
367 (substitute* (find-files "." "configure|Makefile")
369 (substitute* '("src/clisp-link.in")
370 (("/bin/pwd") "pwd"))
372 (home-page "https://clisp.sourceforge.io/")
373 (synopsis "A Common Lisp implementation")
375 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
376 high-level, object-oriented functional programming language. CLISP includes
377 an interpreter, a compiler, a debugger, and much more.")
378 (license license:gpl2+)))
387 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
388 version "-source.tar.bz2"))
390 (base32 "07cpswxh2f38b440xdn3fjk7b4r0ipj3sbwb3jd134phrr9smll7"))))
391 (build-system gnu-build-system)
392 (outputs '("out" "doc"))
395 ;; Supported build hosts are:
398 ;; CCL (formerly known as OpenMCL)
399 ;; ABCL (recent versions only)
400 ;; CLISP (only some versions: 2.44.1 is OK, 2.47 is not)
404 ;; * build enhancement: new host quirks mechanism, support for building under
405 ;; ABCL and ECL (as well as CCL, CMUCL, CLISP and SBCL itself)
407 ;; CCL is not bootstrappable so it won't do. CLISP 2.49 seems to work.
408 ;; ECL too. As of 2020-07-01, ECL was last updated in 2020 while CLISP
409 ;; was last updated in 2010, and both take about the same time to build SBCL.
411 ;; For now we stick to CLISP for all systems. We keep the `match' here
412 ;; to make it easier to change the host compiler for various
413 ;; architectures. Consider switching to ECL if it gets faster than CLISP
414 ;; (maybe post 2020 release).
415 `(,@(match (%current-system)
416 ((or "x86_64-linux" "i686-linux")
419 `(("clisp" ,clisp))))
422 ("inetutils" ,inetutils) ;for hostname(1)
424 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
428 `(#:modules ((guix build gnu-build-system)
432 (modify-phases %standard-phases
434 (add-after 'unpack 'replace-asdf
435 ;; SBCL developers have not committed to keeping ASDF up to date
436 ;; due to breaking changes [1]. Guix can handle this situation
437 ;; easily, and it behooves us to have more control over what version
438 ;; of ASDF we use to build software; therefore, replace the contrib
439 ;; ASDF with the version packaged into Guix.
440 ;; [1] - https://bugs.launchpad.net/sbcl/+bug/1823442
441 (lambda* (#:key inputs outputs #:allow-other-keys)
442 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
443 (guix-asdf (string-append
445 "/share/common-lisp/source/asdf/asdf.lisp"))
446 (out (string-append (assoc-ref outputs "out")))
447 (contrib-asdf "contrib/asdf/asdf.lisp"))
448 (copy-file guix-asdf contrib-asdf))
450 (add-before 'build 'patch-unix-tool-paths
451 (lambda* (#:key outputs inputs #:allow-other-keys)
452 (let ((out (assoc-ref outputs "out"))
453 (bash (assoc-ref inputs "bash"))
454 (coreutils (assoc-ref inputs "coreutils"))
455 (ed (assoc-ref inputs "ed")))
456 (define (quoted-path input path)
457 (string-append "\"" input path "\""))
458 ;; Patch absolute paths in string literals. Note that this
459 ;; occurs in some .sh files too (which contain Lisp code). Use
460 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
461 (with-fluids ((%default-port-encoding #f))
462 ;; The removed file is utf-16-be encoded, which gives substitute*
463 ;; trouble. It does not contain references to the listed programs.
465 "./tests/data/compile-file-pos-utf16be.lisp"
466 (find-files "." "\\.(lisp|sh)$"))
467 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
468 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
469 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
470 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
471 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
472 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
473 ;; This one script has a non-string occurrence of /bin/sh.
474 (substitute* '("tests/foreign.test.sh")
475 ;; Leave whitespace so we don't match the shebang.
476 ((" /bin/sh ") " sh "))
477 ;; This file contains a module that can create executable files
478 ;; which depend on the presence of SBCL. It generates shell
479 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
480 ;; the shebang and the reference to "sbcl", tying the generated
481 ;; executables to the exact SBCL package that generated them.
482 (substitute* '("contrib/sb-executable/sb-executable.lisp")
483 (("/bin/sh") (string-append bash "/bin/sh"))
484 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
485 ;; Disable some tests that fail in our build environment.
486 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
487 ;; This requires /etc/protocols.
488 (("\\(deftest get-protocol-by-name/error" all)
489 (string-append "#+nil ;disabled by Guix\n" all)))
490 (substitute* '("contrib/sb-posix/posix-tests.lisp")
491 ;; These assume some users/groups which we don't have.
492 (("\\(deftest pwent\\.[12]" all)
493 (string-append "#+nil ;disabled by Guix\n" all))
494 (("\\(deftest grent\\.[12]" all)
495 (string-append "#+nil ;disabled by Guix\n" all))))
497 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
498 ;; them in HOME, so it needs to be writeable.
499 (add-before 'build 'set-HOME
500 (lambda _ (setenv "HOME" "/tmp") #t))
502 (lambda* (#:key outputs #:allow-other-keys)
504 (invoke "sh" "make.sh" ,@(match (%current-system)
505 ((or "x86_64-linux" "i686-linux")
509 (string-append "--prefix="
510 (assoc-ref outputs "out"))
511 "--dynamic-space-size=3072"
512 "--with-sb-core-compression"
513 "--with-sb-xref-for-internals")))
516 (invoke "sh" "install.sh")))
517 (add-after 'build 'build-doc
519 ;; TODO: Doc is not deterministic, maybe there is a timespamp?
520 (with-directory-excursion "doc/manual"
521 (and (invoke "make" "info")
522 (invoke "make" "dist")))))
523 (add-after 'build 'build-source
524 (lambda* (#:key outputs #:allow-other-keys)
525 (let* ((out (assoc-ref outputs "out"))
526 (rc (string-append out "/lib/sbcl/sbclrc"))
527 (source-dir (string-append out "/share/sbcl")))
528 (for-each (lambda (p)
529 (copy-recursively p (string-append source-dir "/" p)))
531 (mkdir-p (dirname rc))
532 (with-output-to-file rc
535 (string-append "(sb-ext:set-sbcl-source-location \""
536 source-dir "\")") )))
538 (add-after 'install 'install-doc
539 (lambda* (#:key outputs #:allow-other-keys)
540 (let* ((out (assoc-ref outputs "out"))
541 (doc (assoc-ref outputs "doc"))
542 (old-doc-dir (string-append out "/share/doc"))
543 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
544 (rmdir (string-append old-doc-dir "/sbcl/html"))
545 (mkdir-p new-doc/sbcl-dir)
546 (copy-recursively (string-append old-doc-dir "/sbcl")
548 (delete-file-recursively old-doc-dir)
550 ;; No 'check' target, though "make.sh" (build phase) runs tests.
553 (list (search-path-specification
554 (variable "XDG_DATA_DIRS")
556 (search-path-specification
557 (variable "XDG_CONFIG_DIRS")
559 (home-page "http://www.sbcl.org/")
560 (synopsis "Common Lisp implementation")
561 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
562 Lisp compiler. In addition to the compiler and runtime system for ANSI Common
563 Lisp, it provides an interactive environment including a debugger, a
564 statistical profiler, a code coverage tool, and many other extensions.")
565 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
566 ;; loop macro has its own license. See COPYING file for further notes.
567 (license (list license:public-domain license:bsd-2
568 (license:x11-style "file://src/code/loop.lisp")))))
571 ;; Warning: according to upstream, CCL is not bootstrappable.
572 ;; See https://github.com/Clozure/ccl/issues/222 from 2019-09-02:
574 ;; "As far as I know, there is no way to build CCL without an existing
575 ;; running CCL image. It was bootstrapped back in 1986 or so as
576 ;; Macintosh Common Lisp, by Gary Byers, I believe, who is no longer on
577 ;; the planet to tell us the story. It SHOULD be possible to port the
578 ;; CCL compiler to portable Common Lisp, so that ANY lisp could build
579 ;; it, as is the case for SBCL, but I know of no attempt to do so."
586 (url "https://github.com/Clozure/ccl/")
587 (commit (string-append "v" version))))
588 (file-name (git-file-name "ccl" version))
591 "0kxr24d2fzsmpsilijpwwfl6g89y7fcrwb80kai5nx9pwgxmjbp3"))))
592 (build-system gnu-build-system)
593 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
594 ;; shipped in precompiled form in source tarballs. The former is a C
595 ;; program which we can rebuild from scratch, but the latter cannot be
596 ;; generated without an already working copy of CCL, and is platform
597 ;; dependent, so we need to fetch the correct tarball for the platform.
603 "https://github.com/Clozure/ccl/releases/download/v" version "/"
604 (match (%current-system)
605 ("armhf-linux" "linuxarm")
606 ;; XXX: This source only works on x86, but provide it as a
607 ;; catch-all to prevent errors when querying this package
608 ;; on unsupported platforms.
613 (match (%current-system)
615 "0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
616 (_ "15l7cfa4a7jkfwdzsfm4q3n22jnb57imxahpql3h77xin57v1gbz"))))))))
620 `(#:tests? #f ;no 'check' target
621 #:modules ((ice-9 match)
624 (guix build gnu-build-system))
626 (modify-phases %standard-phases
627 (add-after 'unpack 'unpack-image
628 (lambda* (#:key inputs #:allow-other-keys)
629 (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
631 (add-before 'build 'pre-build
632 ;; Enter the source directory for the current platform's lisp
633 ;; kernel, and run 'make clean' to remove the precompiled one.
634 (lambda* (#:key system #:allow-other-keys)
635 (substitute* "lisp-kernel/m4macros.m4"
636 (("/bin/pwd") (which "pwd")))
637 (chdir (string-append
640 ("i686-linux" "linuxx8632")
641 ("x86_64-linux" "linuxx8664")
642 ("armhf-linux" "linuxarm")
643 (_ (string-append "unknown system: " system)))))
644 (substitute* '("Makefile")
647 (invoke "make" "clean")))
648 ;; XXX Do we need to recompile the heap image as well for Guix?
649 ;; For now just use the one we already got in the tarball.
651 (lambda* (#:key outputs inputs system #:allow-other-keys)
652 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
653 ;; is put back into the original directory, so go back. The heap
654 ;; image is there as well.
656 (let* ((out (assoc-ref outputs "out"))
657 (libdir (string-append out "/lib/"))
658 (bindir (string-append out "/bin/"))
659 (wrapper (string-append bindir "ccl"))
660 (bash (assoc-ref inputs "bash"))
663 ("i686-linux" "lx86cl")
664 ("x86_64-linux" "lx86cl64")
665 ("armhf-linux" "armcl")
666 ;; Unlikely to work, but try it anyway...
668 (heap (string-append kernel ".image")))
669 (install-file kernel libdir)
670 (install-file heap libdir)
672 (let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
679 (for-each copy-recursively
681 (map (cut string-append libdir <>) dirs)))
684 (with-output-to-file wrapper
688 "#!" bash "/bin/sh\n"
689 "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
690 "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
691 (chmod wrapper #o755))
693 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
694 (home-page "https://ccl.clozure.com/")
695 (synopsis "Common Lisp implementation")
696 (description "Clozure CL (often called CCL for short) is a Common Lisp
697 implementation featuring fast compilation speed, native threads, a precise,
698 generational, compacting garbage collector, and a convenient foreign-function
700 (license license:asl2.0)))
709 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
711 (modules '((guix build utils)))
714 (substitute* "src/unix.c"
715 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
716 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
717 (substitute* "src/main.c"
718 (("\" \\(built \" __DATE__ \"\\)\"") ""))
722 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
723 (build-system gnu-build-system)
725 `(;; We have to add these LIBS so that they are found.
726 #:configure-flags (list "LIBS=-lz"
727 "X_EXTRA_LIBS=-lfontconfig"
729 #:tests? #f)) ; No make check.
730 (native-inputs `(("intltool" ,intltool)))
732 `(("alsa-lib" ,alsa-lib)
734 ("sdl-image" ,sdl-image)
735 ("sdl-mixer" ,sdl-mixer)
740 ("fontconfig" ,fontconfig)
742 ("openblas" ,openblas)
745 ("mesa-utils" ,mesa-utils)
746 ("binutils" ,binutils)
747 ("libiberty" ,libiberty)
748 ("readline" ,readline)
750 ("gettext-minimal" ,gettext-minimal)))
751 (synopsis "Lisp Universal Shell")
753 "Lush is an object-oriented Lisp interpreter/compiler with features
754 designed to please people who want to prototype large numerical
755 applications. Lush includes an extensive library of
756 vector/matrix/tensor manipulation, numerous numerical libraries
757 (including GSL, LAPACK, and BLAS), a set of graphic functions, a
758 simple GUI toolkit, and interfaces to various graphic and multimedia
759 libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
760 grabbing), and others. Lush is an ideal frontend script language for
761 programming projects written in C or other languages. Lush also has
762 libraries for Machine Learning, Neural Nets and statistical estimation.")
763 (home-page "http://lush.sourceforge.net/")
764 (license license:lgpl2.1+)))
766 (define-public confusion-mdl
767 (let* ((commit "12a055581fc262225272df43287dae48281900f5"))
769 (name "confusion-mdl")
774 (url (string-append "https://gitlab.com/emacsomancer/" name))
778 "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d"))
779 (file-name (git-file-name name version))))
780 (build-system gnu-build-system)
782 `(#:tests? #f ; there are no tests
784 (modify-phases %standard-phases
787 (lambda* (#:key (make-flags '()) #:allow-other-keys)
788 (apply invoke "make" "CC=gcc" make-flags)))
790 (lambda* (#:key outputs #:allow-other-keys)
791 (let* ((out (assoc-ref outputs "out"))
792 (bin (string-append out "/bin")))
793 (install-file "mdli" bin)
799 (synopsis "Interpreter for the MIT Design Language (MDL)")
800 (description "MDL (the MIT Design Language) is a descendant of Lisp. It
801 was originally developed in 1971 on the PDP-10 computer under the Incompatible
802 Timesharing System (ITS) to provide high level language support for the
803 Dynamic Modeling Group at MIT's Project MAC. Infocom built the original
804 PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was
805 based on a subset of MDL. Confusion is a MDL interpreter that works just well
806 enough to play the original mainframe Zork all the way through.")
807 (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README")
808 (license license:gpl3+))))
818 (url "http://www.kylheku.com/git/txr/")
819 (commit (string-append "txr-" version))))
820 (file-name (git-file-name name version))
822 (base32 "1bzhb1pms6gjzphbsimhwdyq46ik1m7sgldigg5l1q7bppg9r3i0"))))
823 (build-system gnu-build-system)
826 (list ,(string-append "cc=" (cc-for-target))
827 (string-append "--prefix=" (assoc-ref %outputs "out")))
828 #:test-target "tests"
830 (modify-phases %standard-phases
832 ;; ./configure is a hand-written script that can't handle standard
833 ;; autotools arguments like CONFIG_SHELL.
834 (lambda* (#:key configure-flags #:allow-other-keys)
835 (setenv "txr_shell" (which "bash"))
836 (apply invoke "./configure" configure-flags)
838 (add-after 'configure 'fix-tests
840 (substitute* (list "tests/017/realpath.tl"
841 "tests/017/realpath.expected")
845 `(("libffi" ,libffi)))
846 (synopsis "General-purpose, multi-paradigm programming language")
848 "TXR is a general-purpose, multi-paradigm programming language. It
849 comprises two languages integrated into a single tool: a text scanning and
850 extraction language referred to as the TXR Pattern Language (sometimes just
851 \"TXR\"), and a general-purpose dialect of Lisp called TXR Lisp. TXR can be
852 used for everything from \"one liner\" data transformation tasks at the
853 command line, to data scanning and extracting scripts, to full application
854 development in a wide-range of areas.")
855 (home-page "https://nongnu.org/txr/")
856 (license license:bsd-2)))
865 (uri (string-append "https://software-lab.de/picoLisp-" version ".tgz"))
867 (base32 "10np0mhihr47r3201617zccrvzpkhdl1jwvz7zimk8kxpriydq2j"))
868 (modules '((guix build utils)))
870 ;; Delete the pre-compiled jar file.
871 (delete-file "ersatz/picolisp.jar")
873 (build-system gnu-build-system)
875 `(("openssl" ,openssl)))
877 `(#:system ,(match (%current-system)
878 ((or "armhf-linux" "aarch64-linux")
883 (modify-phases %standard-phases
885 (add-after 'unpack 'fix-paths
886 (lambda* (#:key outputs #:allow-other-keys)
887 (let* ((out (assoc-ref outputs "out"))
888 (shebang-line (string-append
889 "#!" out "/bin/picolisp "
890 out "/lib/picolisp/lib.l")))
891 (substitute* '("bin/pil"
904 (("#\\!bin/picolisp lib.l")
906 (("#\\!\\.\\./bin/picolisp \\.\\./lib.l")
908 (("#\\!/usr/bin/picolisp /usr/lib/picolisp/lib.l")
911 (add-after 'fix-paths 'make-build-reproducible
913 (substitute* "src64/lib/asm.l"
914 (("\\(prinl \"/\\* \" \\(datSym \\(date\\)\\) \" \\*/\\)")
917 (add-after 'make-build-reproducible 'fix-permissions
919 (for-each make-file-writable
927 (invoke "make" "-C" "src" "picolisp" "tools" "gate")))
928 (add-before 'check 'set-home-for-tests
930 (setenv "HOME" "/tmp")
934 (invoke "./pil" "test/lib.l" "-bye" "+")))
936 (lambda* (#:key outputs #:allow-other-keys)
937 (let* ((out (assoc-ref outputs "out"))
938 (bin (string-append out "/bin"))
939 (man (string-append out "/share/man"))
940 (picolisp (string-append out "/lib/picolisp")))
941 (copy-recursively "man" man)
942 (copy-recursively "." picolisp)
943 (for-each (lambda (name)
944 (let ((path (string-append picolisp "/" name)))
945 (delete-file-recursively path)))
946 '("CHANGES" "COPYING" "CREDITS" "cygwin"
947 "INSTALL" "man" "pil" "README" "src" "src64"
950 (symlink (string-append picolisp "/bin/picolisp")
951 (string-append bin "/picolisp"))
952 (symlink (string-append picolisp "/bin/pil")
953 (string-append bin "/pil")))
955 (synopsis "Interpreter for the PicoLisp programming language")
957 "PicoLisp is a programming language, or really a programming system,
958 including a built-in database engine and a GUI system.")
959 (home-page "https://picolisp.com/wiki/?home")
960 (license license:expat)))
962 (define-public picolisp
963 (match (%current-system)
964 ((or "aarch64-linux" "x86_64-linux")
966 ;; Use the 32-bit picolisp to generate the assembly files required by
967 ;; the 64-bit picolisp.
971 `(("picolisp32" ,picolisp32)
974 (substitute-keyword-arguments (package-arguments picolisp32)
975 ((#:system _ "") (%current-system))
977 `(modify-phases ,phases
979 (add-before 'build 'fix-paths
980 ;; This must run after the other shebang-patching phases,
981 ;; or they will override our changes.
982 (lambda* (#:key inputs outputs #:allow-other-keys)
983 (let* ((picolisp32 (assoc-ref inputs "picolisp32"))
984 (out (assoc-ref outputs "out"))
985 (shebang-line (string-append
986 "#!" out "/bin/picolisp "
987 out "/lib/picolisp/lib.l")))
988 (substitute* '("bin/pil"
1001 (("#\\!.*picolisp32.*/bin/picolisp .*lib\\.l")
1003 (substitute* "src64/mkAsm"
1005 (string-append picolisp32 "/bin/"))))
1009 (invoke "make" "-C" "src" "tools" "gate")
1010 (invoke "make" "-C" "src64" "CC=gcc" "picolisp")))))))))
1013 (inherit picolisp32)
1014 (name "picolisp")))))
1016 (define-public janet
1024 (url "https://github.com/janet-lang/janet")
1025 (commit (string-append "v" version))))
1026 (file-name (git-file-name name version))
1028 (base32 "0if514zdmbjvvrsa9x5yfvg2b14sz53yaka12g3yhwkq8ls3qk0c"))))
1029 (build-system gnu-build-system)
1031 `(#:make-flags (list
1032 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
1033 (string-append "PREFIX=")
1034 (string-append "CC=" (assoc-ref %build-inputs "gcc")
1037 (modify-phases %standard-phases
1041 (invoke "make" "test"))))))
1042 (home-page "https://janet-lang.org/")
1043 (synopsis "Functional, imperative and embeddable programming language")
1045 "Janet is a functional and imperative programming language. It can be
1046 used for rapid prototyping, dynamic systems, and other domains where dynamic
1047 languages shine. You can also add Janet scripting to an application by
1048 embedding a single C file and two headers. It can be easily ported to new
1049 platforms. The entire language (core library, interpreter, compiler,
1050 assembler, PEG) is less than 1MB.")
1051 (license license:expat)))
1053 (define-public lisp-repl-core-dumper
1055 (name "lisp-repl-core-dumper")
1061 (url "https://gitlab.com/ambrevar/lisp-repl-core-dumper.git")
1063 (file-name (git-file-name name version))
1065 (base32 "1w7x7d7bnrdj0bd04vnjy7d7sngvcx1yjr4iw429hdd9lzlg8rbg"))))
1066 (build-system copy-build-system)
1069 '(("lisp-repl-core-dumper" "bin/"))
1071 (modify-phases %standard-phases
1072 (add-before 'install 'fix-utils-path
1073 (lambda* (#:key inputs #:allow-other-keys)
1074 (let* ((coreutils (string-append (assoc-ref inputs "coreutils") "/bin/"))
1075 (paste (string-append coreutils "paste"))
1076 (sort (string-append coreutils "sort"))
1077 (basename (string-append coreutils "basename"))
1078 (sed (string-append (assoc-ref inputs "sed") "/bin/sed")))
1079 (substitute* "lisp-repl-core-dumper"
1080 (("\\$\\(basename") (string-append "$(" basename))
1081 (("\\<paste\\>") paste)
1083 (("\\<sort\\>") sort))))))))
1085 `(("coreutils" ,coreutils-minimal)
1087 (home-page "https://gitlab.com/ambrevar/lisp-repl-core-dumper")
1088 (synopsis "Generate REPL-optimized Lisp cores on demand")
1090 "This tool generates Lisp images that can embed the provided systems
1091 and make for REPLs that start blazing fast.
1094 @item It’s portable and should work with any compiler.
1095 @item It works for any REPL.
1096 @item It allows you to include arbitrary libraries.
1098 (license license:gpl3+)))