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 gnu)
48 #:use-module (guix build-system ant)
49 #:use-module (guix build-system asdf)
50 #:use-module (guix build-system trivial)
51 #:use-module (gnu packages admin)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bdw-gc)
54 #:use-module (gnu packages bison)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages ed)
57 #:use-module (gnu packages flex)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages gcc)
60 #:use-module (gnu packages gettext)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages m4)
64 #:use-module (gnu packages maths)
65 #:use-module (gnu packages multiprecision)
66 #:use-module (gnu packages ncurses)
67 #:use-module (gnu packages libffcall)
68 #:use-module (gnu packages libffi)
69 #:use-module (gnu packages libsigsegv)
70 #:use-module (gnu packages linux)
71 #:use-module (gnu packages perl)
72 #:use-module (gnu packages readline)
73 #:use-module (gnu packages sdl)
74 #:use-module (gnu packages tex)
75 #:use-module (gnu packages tls)
76 #:use-module (gnu packages texinfo)
77 #:use-module (gnu packages version-control)
78 #:use-module (gnu packages xorg)
79 #:use-module (ice-9 match))
81 (define (asdf-substitutions lisp)
82 ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's
83 ;; 'default-system-source-registry'.
84 `((("\\(,dir \"systems/\"\\)\\)")
86 "(,dir \"~a-bundle-systems\")))
88 ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\")
89 :collect `(:directory (,dir \"systems\"))"
92 (define-public cl-asdf
100 (string-append "https://common-lisp.net/project/asdf/archives/asdf-"
103 (base32 "18lr6kxvzhr79c9rx3sdricz30aby866fj0m24w27zxsqlyvn3rd"))))
104 (build-system trivial-build-system)
106 `(#:modules ((guix build utils)
107 (guix build lisp-utils))
110 (use-modules (guix build utils)
111 (guix build lisp-utils))
112 (let* ((out (string-append (assoc-ref %outputs "out")))
113 (asdf-install (string-append out %source-install-prefix
115 (asdf (string-append (assoc-ref %build-inputs "source"))))
116 (mkdir-p asdf-install)
117 (copy-file asdf (string-append asdf-install "asdf.lisp"))))))
118 (home-page "https://common-lisp.net/project/asdf/")
119 (synopsis "Another System Definition Facility")
121 "ASDF is what Common Lisp hackers use to build and load software. It is
122 the successor of the Lisp DEFSYSTEM of yore. ASDF stands for Another System
123 Definition Facility.")
125 (license license:expat)))
128 (let ((commit "d3335e2b3deb63f930eb0328e9b05377744c9512")
129 (revision "2")) ;Guix package revision
132 (version (string-append "2.6.12-" revision "."
133 (string-take commit 7)))
138 (url "https://git.savannah.gnu.org/r/gcl.git")
140 (file-name (string-append "gcl-" version "-checkout"))
142 (base32 "05v86lhvsby05nzvcd3c4k0wljvgdgd0i6arzd2fx1yd67dl6fgj"))))
143 (build-system gnu-build-system)
145 `(#:parallel-build? #f ; The build system seems not to be thread safe.
146 #:test-target "ansi-tests/test_results"
147 #:configure-flags '("--enable-ansi") ; required for use by the maxima package
149 (string-append "GCL_CC=" (assoc-ref %build-inputs "gcc")
151 (string-append "CC=" (assoc-ref %build-inputs "gcc")
154 (modify-phases %standard-phases
155 (add-before 'configure 'pre-conf
156 (lambda* (#:key inputs #:allow-other-keys)
160 '("pcl/impl/kcl/makefile.akcl"
162 "unixport/makefile.dos"
164 "gcl-tk/makefile.prev"
166 (find-files "h" "\\.defs"))
168 (string-append "SHELL=" (which "bash")))
170 (string-append "SHELL=" (which "sh"))))
171 (substitute* "h/linux.defs"
173 (("-fwritable-strings") "")
175 (substitute* "lsp/gcl_top.lsp"
177 (string-append "\"" (assoc-ref %build-inputs "gcc")
179 (("\\(or \\(get-path \\*cc\\*\\) \\*cc\\*\\)") "*cc*")
181 (string-append "\"" (assoc-ref %build-inputs "binutils")
183 (("\\(or \\(get-path \\*ld\\*\\) \\*ld\\*\\)") "*ld*")
184 (("\\(get-path \"objdump --source \"\\)")
185 (string-append "\"" (assoc-ref %build-inputs "binutils")
186 "/bin/objdump --source \"")))
188 (add-after 'install 'wrap
189 (lambda* (#:key inputs outputs #:allow-other-keys)
190 (let* ((gcl (assoc-ref outputs "out"))
191 (input-path (lambda (lib path)
193 (assoc-ref inputs lib) path)))
194 (binaries '("binutils")))
195 ;; GCC and the GNU binutils are necessary for GCL to be
196 ;; able to compile Lisp functions and programs (this is
197 ;; a standard feature in Common Lisp). While the
198 ;; the location of GCC is specified in the make-flags,
199 ;; the GNU binutils must be available in GCL's $PATH.
200 (wrap-program (string-append gcl "/bin/gcl")
201 `("PATH" prefix ,(map (lambda (binary)
202 (input-path binary "/bin"))
205 ;; drop strip phase to make maxima build, see
206 ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
210 ("readline" ,readline)))
213 ("texinfo" ,texinfo)))
214 (home-page "https://www.gnu.org/software/gcl/")
215 (synopsis "A Common Lisp implementation")
216 (description "GCL is an implementation of the Common Lisp language. It
217 features the ability to compile to native object code and to load native
218 object code modules directly into its lisp core. It also features a
219 stratified garbage collection strategy, a source-level debugger and a built-in
220 interface to the Tk widget system.")
221 (license license:lgpl2.0+))))
231 "https://common-lisp.net/project/ecl/static/files/release/"
232 name "-" version ".tgz"))
234 (base32 "01qgdmr54wkj854f69qdm9sybrvd6gd21dpx4askdaaqybnkh237"))))
235 (build-system gnu-build-system)
236 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
238 `(("cl-asdf" ,cl-asdf)
240 ("texinfo" ,texinfo)))
243 ("libatomic-ops" ,libatomic-ops)
247 `(#:configure-flags '("--without-rt")
248 ;; FIXME: As of version 20.4.24, we pass 17995 tests and fail 7.
249 ;; 2-3 tests may be due to FHS assumptions.
253 (modify-phases %standard-phases
255 (add-after 'unpack 'replace-asdf
256 ;; Use system ASDF instead of bundled one.
257 (lambda* (#:key inputs outputs #:allow-other-keys)
258 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
259 (guix-asdf (string-append
261 "/share/common-lisp/source/asdf/asdf.lisp"))
262 (out (string-append (assoc-ref outputs "out")))
263 (contrib-asdf "contrib/asdf/asdf.lisp"))
264 (copy-file guix-asdf contrib-asdf)
265 ;; Add ecl-bundle-systems to 'default-system-source-registry'.
266 (substitute* contrib-asdf
267 ,@(asdf-substitutions name)))
269 (add-after 'install 'wrap
270 (lambda* (#:key inputs outputs #:allow-other-keys)
271 (let* ((ecl (assoc-ref outputs "out"))
272 (input-path (lambda (lib path)
274 (assoc-ref inputs lib) path)))
275 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
276 (binaries '("gcc" "ld-wrapper" "binutils"))
278 (map (lambda (lib) (input-path lib "/lib"))
281 (wrap-program (string-append ecl "/bin/ecl")
283 ,(map (lambda (binary)
284 (input-path binary "/bin"))
288 (input-path lib "/include"))
289 `("kernel-headers" ,@libraries)))
290 `("LIBRARY_PATH" suffix ,library-directories)
291 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
292 (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
293 (add-before 'check 'fix-path-to-ecl
295 (substitute* "build/tests/Makefile"
296 (("\\$\\{exec_prefix\\}/") ""))
299 (list (search-path-specification
300 (variable "XDG_DATA_DIRS")
301 (files '("share")))))
302 (home-page "http://ecls.sourceforge.net/")
303 (synopsis "Embeddable Common Lisp")
304 (description "ECL is an implementation of the Common Lisp language as
305 defined by the ANSI X3J13 specification. Its most relevant features are: a
306 bytecode compiler and interpreter, being able to compile Common Lisp with any
307 C/C++ compiler, being able to build standalone executables and libraries, and
308 supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
309 ;; Note that the file "Copyright" points to some files and directories
310 ;; which aren't under the lgpl2.1+ and instead contain many different,
311 ;; non-copyleft licenses.
312 ;; See https://common-lisp.net/project/ecl/posts/ECL-license.html.
313 (license license:lgpl2.1+)))
323 (url "https://gitlab.com/gnu-clisp/clisp")
324 (commit "clisp-2.49.92-2018-02-18")))
325 (file-name (git-file-name name version))
327 (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))
328 (patches (search-patches "clisp-remove-failing-test.patch"))))
329 (build-system gnu-build-system)
330 (inputs `(("libffcall" ,libffcall)
332 ("readline" ,readline)
333 ("libsigsegv" ,libsigsegv)))
335 `(#:configure-flags '(,@(if (string-prefix? "armhf-linux"
336 (or (%current-system)
337 (%current-target-system)))
338 '("CFLAGS=-falign-functions=4")
341 "--with-dynamic-modules"
342 "--with-module=rawsock")
345 (modify-phases %standard-phases
346 (add-after 'unpack 'patch-sh-and-pwd
348 ;; The package is very messy with its references to "/bin/sh" and
349 ;; some other absolute paths to traditional tools. These appear in
350 ;; many places where our automatic patching misses them. Therefore
351 ;; we do the following, in this early (post-unpack) phase, to solve
352 ;; the problem from its root.
353 (substitute* '("src/clisp-link.in"
356 (("/bin/sh") (which "sh")))
357 (substitute* (find-files "." "configure|Makefile")
359 (substitute* '("src/clisp-link.in")
360 (("/bin/pwd") "pwd"))
362 ;; Makefiles seem to have race conditions.
363 #:parallel-build? #f))
364 (home-page "https://clisp.sourceforge.io/")
365 (synopsis "A Common Lisp implementation")
367 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
368 high-level, object-oriented functional programming language. CLISP includes
369 an interpreter, a compiler, a debugger, and much more.")
370 (license license:gpl2+)))
379 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
380 version "-source.tar.bz2"))
382 (base32 "1jz26w1i3riv032aa35vww4cv7cjk2ww7dp70c7wk4r8s66zhl00"))))
383 (build-system gnu-build-system)
384 (outputs '("out" "doc"))
387 ;; Supported build hosts are:
390 ;; CCL (formerly known as OpenMCL)
391 ;; ABCL (recent versions only)
392 ;; CLISP (only some versions: 2.44.1 is OK, 2.47 is not)
396 ;; * build enhancement: new host quirks mechanism, support for building under
397 ;; ABCL and ECL (as well as CCL, CMUCL, CLISP and SBCL itself)
399 ;; CCL is not bootstrappable so it won't do. CLISP 2.49 seems to work.
400 ;; ECL too. ECL builds SBCL about 20% slower than CLISP. As of
401 ;; 2019-09-05, ECL was last updated in 2020 while CLISP was last updated
404 ;; For now we stick to CLISP for all systems. We keep the `match' here to
405 ;; make it easier to change the host compiler for various architectures.
406 `(,@(match (%current-system)
407 ((or "x86_64-linux" "i686-linux")
410 `(("clisp" ,clisp))))
413 ("inetutils" ,inetutils) ;for hostname(1)
415 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
419 `(#:modules ((guix build gnu-build-system)
423 (modify-phases %standard-phases
425 (add-after 'unpack 'replace-asdf
426 ;; SBCL developers have not committed to keeping ASDF up to date
427 ;; due to breaking changes [1]. Guix can handle this situation
428 ;; easily, and it behooves us to have more control over what version
429 ;; of ASDF we use to build software; therefore, replace the contrib
430 ;; ASDF with the version packaged into Guix.
431 ;; [1] - https://bugs.launchpad.net/sbcl/+bug/1823442
432 (lambda* (#:key inputs outputs #:allow-other-keys)
433 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
434 (guix-asdf (string-append
436 "/share/common-lisp/source/asdf/asdf.lisp"))
437 (out (string-append (assoc-ref outputs "out")))
438 (contrib-asdf "contrib/asdf/asdf.lisp"))
439 (copy-file guix-asdf contrib-asdf)
440 (substitute* contrib-asdf
441 ,@(asdf-substitutions name)))
443 (add-before 'build 'patch-unix-tool-paths
444 (lambda* (#:key outputs inputs #:allow-other-keys)
445 (let ((out (assoc-ref outputs "out"))
446 (bash (assoc-ref inputs "bash"))
447 (coreutils (assoc-ref inputs "coreutils"))
448 (ed (assoc-ref inputs "ed")))
449 (define (quoted-path input path)
450 (string-append "\"" input path "\""))
451 ;; Patch absolute paths in string literals. Note that this
452 ;; occurs in some .sh files too (which contain Lisp code). Use
453 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
454 (with-fluids ((%default-port-encoding #f))
455 ;; The removed file is utf-16-be encoded, which gives substitute*
456 ;; trouble. It does not contain references to the listed programs.
458 "./tests/data/compile-file-pos-utf16be.lisp"
459 (find-files "." "\\.(lisp|sh)$"))
460 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
461 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
462 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
463 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
464 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
465 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
466 ;; This one script has a non-string occurrence of /bin/sh.
467 (substitute* '("tests/foreign.test.sh")
468 ;; Leave whitespace so we don't match the shebang.
469 ((" /bin/sh ") " sh "))
470 ;; This file contains a module that can create executable files
471 ;; which depend on the presence of SBCL. It generates shell
472 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
473 ;; the shebang and the reference to "sbcl", tying the generated
474 ;; executables to the exact SBCL package that generated them.
475 (substitute* '("contrib/sb-executable/sb-executable.lisp")
476 (("/bin/sh") (string-append bash "/bin/sh"))
477 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
478 ;; Disable some tests that fail in our build environment.
479 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
480 ;; This requires /etc/protocols.
481 (("\\(deftest get-protocol-by-name/error" all)
482 (string-append "#+nil ;disabled by Guix\n" all)))
483 (substitute* '("contrib/sb-posix/posix-tests.lisp")
484 ;; These assume some users/groups which we don't have.
485 (("\\(deftest pwent\\.[12]" all)
486 (string-append "#+nil ;disabled by Guix\n" all))
487 (("\\(deftest grent\\.[12]" all)
488 (string-append "#+nil ;disabled by Guix\n" all))))
490 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
491 ;; them in HOME, so it needs to be writeable.
492 (add-before 'build 'set-HOME
493 (lambda _ (setenv "HOME" "/tmp") #t))
495 (lambda* (#:key outputs #:allow-other-keys)
497 (invoke "sh" "make.sh" ,@(match (%current-system)
498 ((or "x86_64-linux" "i686-linux")
502 (string-append "--prefix="
503 (assoc-ref outputs "out"))
504 "--dynamic-space-size=2Gb"
505 "--with-sb-core-compression"
506 "--with-sb-xref-for-internals")))
509 (invoke "sh" "install.sh")))
510 (add-after 'build 'build-doc
512 ;; TODO: Doc is not deterministic, maybe there is a timespamp?
513 (with-directory-excursion "doc/manual"
514 (and (invoke "make" "info")
515 (invoke "make" "dist")))))
516 (add-after 'build 'build-source
517 (lambda* (#:key outputs #:allow-other-keys)
518 (let* ((out (assoc-ref outputs "out"))
519 (rc (string-append out "/lib/sbcl/sbclrc"))
520 (source-dir (string-append out "/share/sbcl")))
521 (for-each (lambda (p)
522 (copy-recursively p (string-append source-dir "/" p)))
524 (mkdir-p (dirname rc))
525 (with-output-to-file rc
528 (string-append "(sb-ext:set-sbcl-source-location \""
529 source-dir "\")") )))
531 (add-after 'install 'install-doc
532 (lambda* (#:key outputs #:allow-other-keys)
533 (let* ((out (assoc-ref outputs "out"))
534 (doc (assoc-ref outputs "doc"))
535 (old-doc-dir (string-append out "/share/doc"))
536 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
537 (rmdir (string-append old-doc-dir "/sbcl/html"))
538 (mkdir-p new-doc/sbcl-dir)
539 (copy-recursively (string-append old-doc-dir "/sbcl")
541 (delete-file-recursively old-doc-dir)
543 ;; No 'check' target, though "make.sh" (build phase) runs tests.
546 (list (search-path-specification
547 (variable "XDG_DATA_DIRS")
548 (files '("share")))))
549 (home-page "http://www.sbcl.org/")
550 (synopsis "Common Lisp implementation")
551 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
552 Lisp compiler. In addition to the compiler and runtime system for ANSI Common
553 Lisp, it provides an interactive environment including a debugger, a
554 statistical profiler, a code coverage tool, and many other extensions.")
555 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
556 ;; loop macro has its own license. See COPYING file for further notes.
557 (license (list license:public-domain license:bsd-2
558 (license:x11-style "file://src/code/loop.lisp")))))
561 ;; Warning: according to upstream, CCL is not bootstrappable.
562 ;; See https://github.com/Clozure/ccl/issues/222 from 2019-09-02:
564 ;; "As far as I know, there is no way to build CCL without an existing
565 ;; running CCL image. It was bootstrapped back in 1986 or so as
566 ;; Macintosh Common Lisp, by Gary Byers, I believe, who is no longer on
567 ;; the planet to tell us the story. It SHOULD be possible to port the
568 ;; CCL compiler to portable Common Lisp, so that ANY lisp could build
569 ;; it, as is the case for SBCL, but I know of no attempt to do so."
576 (url "https://github.com/Clozure/ccl/")
577 (commit (string-append "v" version))))
578 (file-name (git-file-name "ccl" version))
581 "0kxr24d2fzsmpsilijpwwfl6g89y7fcrwb80kai5nx9pwgxmjbp3"))))
582 (build-system gnu-build-system)
583 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
584 ;; shipped in precompiled form in source tarballs. The former is a C
585 ;; program which we can rebuild from scratch, but the latter cannot be
586 ;; generated without an already working copy of CCL, and is platform
587 ;; dependent, so we need to fetch the correct tarball for the platform.
593 "https://github.com/Clozure/ccl/releases/download/v" version "/"
594 (match (%current-system)
595 ("armhf-linux" "linuxarm")
596 ;; XXX: This source only works on x86, but provide it as a
597 ;; catch-all to prevent errors when querying this package
598 ;; on unsupported platforms.
603 (match (%current-system)
605 "0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
606 (_ "15l7cfa4a7jkfwdzsfm4q3n22jnb57imxahpql3h77xin57v1gbz"))))))))
610 `(#:tests? #f ;no 'check' target
611 #:modules ((ice-9 match)
614 (guix build gnu-build-system))
616 (modify-phases %standard-phases
617 (add-after 'unpack 'unpack-image
618 (lambda* (#:key inputs #:allow-other-keys)
619 (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
621 (add-before 'build 'pre-build
622 ;; Enter the source directory for the current platform's lisp
623 ;; kernel, and run 'make clean' to remove the precompiled one.
624 (lambda* (#:key system #:allow-other-keys)
625 (substitute* "lisp-kernel/m4macros.m4"
626 (("/bin/pwd") (which "pwd")))
627 (chdir (string-append
630 ("i686-linux" "linuxx8632")
631 ("x86_64-linux" "linuxx8664")
632 ("armhf-linux" "linuxarm")
633 (_ (string-append "unknown system: " system)))))
634 (substitute* '("Makefile")
637 (invoke "make" "clean")))
638 ;; XXX Do we need to recompile the heap image as well for Guix?
639 ;; For now just use the one we already got in the tarball.
641 (lambda* (#:key outputs inputs system #:allow-other-keys)
642 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
643 ;; is put back into the original directory, so go back. The heap
644 ;; image is there as well.
646 (let* ((out (assoc-ref outputs "out"))
647 (libdir (string-append out "/lib/"))
648 (bindir (string-append out "/bin/"))
649 (wrapper (string-append bindir "ccl"))
650 (bash (assoc-ref inputs "bash"))
653 ("i686-linux" "lx86cl")
654 ("x86_64-linux" "lx86cl64")
655 ("armhf-linux" "armcl")
656 ;; Unlikely to work, but try it anyway...
658 (heap (string-append kernel ".image")))
659 (install-file kernel libdir)
660 (install-file heap libdir)
662 (let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
669 (for-each copy-recursively
671 (map (cut string-append libdir <>) dirs)))
674 (with-output-to-file wrapper
678 "#!" bash "/bin/sh\n"
679 "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
680 "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
681 (chmod wrapper #o755))
683 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
684 (home-page "https://ccl.clozure.com/")
685 (synopsis "Common Lisp implementation")
686 (description "Clozure CL (often called CCL for short) is a Common Lisp
687 implementation featuring fast compilation speed, native threads, a precise,
688 generational, compacting garbage collector, and a convenient foreign-function
690 (license license:asl2.0)))
699 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
701 (modules '((guix build utils)))
704 (substitute* "src/unix.c"
705 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
706 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
707 (substitute* "src/main.c"
708 (("\" \\(built \" __DATE__ \"\\)\"") ""))
712 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
713 (build-system gnu-build-system)
715 `(;; We have to add these LIBS so that they are found.
716 #:configure-flags (list "LIBS=-lz"
717 "X_EXTRA_LIBS=-lfontconfig"
719 #:tests? #f)) ; No make check.
720 (native-inputs `(("intltool" ,intltool)))
722 `(("alsa-lib" ,alsa-lib)
724 ("sdl-image" ,sdl-image)
725 ("sdl-mixer" ,sdl-mixer)
730 ("fontconfig" ,fontconfig)
732 ("openblas" ,openblas)
735 ("mesa-utils" ,mesa-utils)
736 ("binutils" ,binutils)
737 ("libiberty" ,libiberty)
738 ("readline" ,readline)
740 ("gettext-minimal" ,gettext-minimal)))
741 (synopsis "Lisp Universal Shell")
743 "Lush is an object-oriented Lisp interpreter/compiler with features
744 designed to please people who want to prototype large numerical
745 applications. Lush includes an extensive library of
746 vector/matrix/tensor manipulation, numerous numerical libraries
747 (including GSL, LAPACK, and BLAS), a set of graphic functions, a
748 simple GUI toolkit, and interfaces to various graphic and multimedia
749 libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
750 grabbing), and others. Lush is an ideal frontend script language for
751 programming projects written in C or other languages. Lush also has
752 libraries for Machine Learning, Neural Nets and statistical estimation.")
753 (home-page "http://lush.sourceforge.net/")
754 (license license:lgpl2.1+)))
756 (define-public confusion-mdl
757 (let* ((commit "12a055581fc262225272df43287dae48281900f5"))
759 (name "confusion-mdl")
764 (url (string-append "https://gitlab.com/emacsomancer/" name))
768 "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d"))
769 (file-name (git-file-name name version))))
770 (build-system gnu-build-system)
772 `(#:tests? #f ; there are no tests
774 (modify-phases %standard-phases
777 (lambda* (#:key (make-flags '()) #:allow-other-keys)
778 (apply invoke "make" "CC=gcc" make-flags)))
780 (lambda* (#:key outputs #:allow-other-keys)
781 (let* ((out (assoc-ref outputs "out"))
782 (bin (string-append out "/bin")))
783 (install-file "mdli" bin)
789 (synopsis "Interpreter for the MIT Design Language (MDL)")
790 (description "MDL (the MIT Design Language) is a descendant of Lisp. It
791 was originally developed in 1971 on the PDP-10 computer under the Incompatible
792 Timesharing System (ITS) to provide high level language support for the
793 Dynamic Modeling Group at MIT's Project MAC. Infocom built the original
794 PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was
795 based on a subset of MDL. Confusion is a MDL interpreter that works just well
796 enough to play the original mainframe Zork all the way through.")
797 (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README")
798 (license license:gpl3+))))
808 (url "http://www.kylheku.com/git/txr/")
809 (commit (string-append "txr-" version))))
810 (file-name (git-file-name name version))
812 (base32 "1jldpkd5f855m3z4zjpd1ha64f405pcdwwrnr8jnk66v22dsvdwx"))))
813 (build-system gnu-build-system)
816 (list ,(string-append "cc=" (cc-for-target))
817 (string-append "--prefix=" (assoc-ref %outputs "out")))
818 #:test-target "tests"
820 (modify-phases %standard-phases
822 ;; ./configure is a hand-written script that can't handle standard
823 ;; autotools arguments like CONFIG_SHELL.
824 (lambda* (#:key configure-flags #:allow-other-keys)
825 (setenv "txr_shell" (which "bash"))
826 (apply invoke "./configure" configure-flags)
828 (add-after 'configure 'fix-tests
830 (substitute* (list "tests/017/realpath.tl"
831 "tests/017/realpath.expected")
838 `(("libffi" ,libffi)))
839 (synopsis "General-purpose, multi-paradigm programming language")
841 "TXR is a general-purpose, multi-paradigm programming language. It
842 comprises two languages integrated into a single tool: a text scanning and
843 extraction language referred to as the TXR Pattern Language (sometimes just
844 \"TXR\"), and a general-purpose dialect of Lisp called TXR Lisp. TXR can be
845 used for everything from \"one liner\" data transformation tasks at the
846 command line, to data scanning and extracting scripts, to full application
847 development in a wide-range of areas.")
848 (home-page "https://nongnu.org/txr/")
849 (license license:bsd-2)))
858 (uri (string-append "https://software-lab.de/picoLisp-" version ".tgz"))
860 (base32 "10np0mhihr47r3201617zccrvzpkhdl1jwvz7zimk8kxpriydq2j"))
861 (modules '((guix build utils)))
863 ;; Delete the pre-compiled jar file.
864 (delete-file "ersatz/picolisp.jar")
866 (build-system gnu-build-system)
868 `(("openssl" ,openssl)))
870 `(#:system ,(match (%current-system)
871 ((or "armhf-linux" "aarch64-linux")
876 (modify-phases %standard-phases
878 (add-after 'unpack 'fix-paths
879 (lambda* (#:key outputs #:allow-other-keys)
880 (let* ((out (assoc-ref outputs "out"))
881 (shebang-line (string-append
882 "#!" out "/bin/picolisp "
883 out "/lib/picolisp/lib.l")))
884 (substitute* '("bin/pil"
897 (("#\\!bin/picolisp lib.l")
899 (("#\\!\\.\\./bin/picolisp \\.\\./lib.l")
901 (("#\\!/usr/bin/picolisp /usr/lib/picolisp/lib.l")
904 (add-after 'fix-paths 'make-build-reproducible
906 (substitute* "src64/lib/asm.l"
907 (("\\(prinl \"/\\* \" \\(datSym \\(date\\)\\) \" \\*/\\)")
910 (add-after 'make-build-reproducible 'fix-permissions
912 (for-each make-file-writable
920 (invoke "make" "-C" "src" "picolisp" "tools" "gate")))
921 (add-before 'check 'set-home-for-tests
923 (setenv "HOME" "/tmp")
927 (invoke "./pil" "test/lib.l" "-bye" "+")))
929 (lambda* (#:key outputs #:allow-other-keys)
930 (let* ((out (assoc-ref outputs "out"))
931 (bin (string-append out "/bin"))
932 (man (string-append out "/share/man"))
933 (picolisp (string-append out "/lib/picolisp")))
934 (copy-recursively "man" man)
935 (copy-recursively "." picolisp)
936 (for-each (lambda (name)
937 (let ((path (string-append picolisp "/" name)))
938 (delete-file-recursively path)))
939 '("CHANGES" "COPYING" "CREDITS" "cygwin"
940 "INSTALL" "man" "pil" "README" "src" "src64"
943 (symlink (string-append picolisp "/bin/picolisp")
944 (string-append bin "/picolisp"))
945 (symlink (string-append picolisp "/bin/pil")
946 (string-append bin "/pil")))
948 (synopsis "Interpreter for the PicoLisp programming language")
950 "PicoLisp is a programming language, or really a programming system,
951 including a built-in database engine and a GUI system.")
952 (home-page "https://picolisp.com/wiki/?home")
953 (license license:expat)))
955 (define-public picolisp
956 (match (%current-system)
957 ((or "aarch64-linux" "x86_64-linux")
959 ;; Use the 32-bit picolisp to generate the assembly files required by
960 ;; the 64-bit picolisp.
964 `(("picolisp32" ,picolisp32)
967 (substitute-keyword-arguments (package-arguments picolisp32)
968 ((#:system _ "") (%current-system))
970 `(modify-phases ,phases
972 (add-before 'build 'fix-paths
973 ;; This must run after the other shebang-patching phases,
974 ;; or they will override our changes.
975 (lambda* (#:key inputs outputs #:allow-other-keys)
976 (let* ((picolisp32 (assoc-ref inputs "picolisp32"))
977 (out (assoc-ref outputs "out"))
978 (shebang-line (string-append
979 "#!" out "/bin/picolisp "
980 out "/lib/picolisp/lib.l")))
981 (substitute* '("bin/pil"
994 (("#\\!.*picolisp32.*/bin/picolisp .*lib\\.l")
996 (substitute* "src64/mkAsm"
998 (string-append picolisp32 "/bin/"))))
1002 (invoke "make" "-C" "src" "tools" "gate")
1003 (invoke "make" "-C" "src64" "CC=gcc" "picolisp")))))))))
1006 (inherit picolisp32)
1007 (name "picolisp")))))