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 ng0 <ng0@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 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 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>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 ;;; This file only contains Common Lisp compilers and tooling.
35 ;;; Common Lisp libraries go to lisp-xyz.scm.
36 ;;; Common Lisp applications should go to the most appropriate file,
37 ;;; e.g. StumpWM is in wm.scm.
39 (define-module (gnu packages lisp)
40 #:use-module (gnu packages)
41 #:use-module ((guix licenses) #:prefix license:)
42 #:use-module (guix packages)
43 #:use-module (guix download)
44 #:use-module (guix git-download)
45 #:use-module (guix utils)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system ant)
48 #:use-module (guix build-system asdf)
49 #:use-module (guix build-system trivial)
50 #:use-module (gnu packages admin)
51 #:use-module (gnu packages base)
52 #:use-module (gnu packages bdw-gc)
53 #:use-module (gnu packages bison)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages ed)
56 #:use-module (gnu packages flex)
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 (asdf-substitutions lisp)
81 ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's
82 ;; 'default-system-source-registry'.
83 `((("\\(,dir \"systems/\"\\)\\)")
85 "(,dir \"~a-bundle-systems\")))
87 ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\")
88 :collect `(:directory (,dir \"systems\"))"
91 (define-public cl-asdf
99 (string-append "https://common-lisp.net/project/asdf/archives/asdf-"
102 (base32 "18lr6kxvzhr79c9rx3sdricz30aby866fj0m24w27zxsqlyvn3rd"))))
103 (build-system trivial-build-system)
105 `(#:modules ((guix build utils)
106 (guix build lisp-utils))
109 (use-modules (guix build utils)
110 (guix build lisp-utils))
111 (let* ((out (string-append (assoc-ref %outputs "out")))
112 (asdf-install (string-append out %source-install-prefix
114 (asdf (string-append (assoc-ref %build-inputs "source"))))
115 (mkdir-p asdf-install)
116 (copy-file asdf (string-append asdf-install "asdf.lisp"))))))
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 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn"))))
234 (build-system gnu-build-system)
235 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
236 (native-inputs `(("cl-asdf" ,cl-asdf)
238 (inputs `(("gmp" ,gmp)
239 ("libatomic-ops" ,libatomic-ops)
243 `(#:configure-flags '("--without-rt")
247 (modify-phases %standard-phases
249 (add-after 'unpack 'replace-asdf
250 ;; Use system ASDF instead of bundled one.
251 (lambda* (#:key inputs outputs #:allow-other-keys)
252 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
253 (guix-asdf (string-append
255 "/share/common-lisp/source/asdf/asdf.lisp"))
256 (out (string-append (assoc-ref outputs "out")))
257 (contrib-asdf "contrib/asdf/asdf.lisp"))
258 (copy-file guix-asdf contrib-asdf)
259 ;; Add ecl-bundle-systems to 'default-system-source-registry'.
260 (substitute* contrib-asdf
261 ,@(asdf-substitutions name)))
263 (add-after 'install 'wrap
264 (lambda* (#:key inputs outputs #:allow-other-keys)
265 (let* ((ecl (assoc-ref outputs "out"))
266 (input-path (lambda (lib path)
268 (assoc-ref inputs lib) path)))
269 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
270 (binaries '("gcc" "ld-wrapper" "binutils"))
272 (map (lambda (lib) (input-path lib "/lib"))
275 (wrap-program (string-append ecl "/bin/ecl")
277 ,(map (lambda (binary)
278 (input-path binary "/bin"))
282 (input-path lib "/include"))
283 `("kernel-headers" ,@libraries)))
284 `("LIBRARY_PATH" suffix ,library-directories)
285 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
286 (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
287 (add-before 'check 'fix-path-to-ecl
289 (substitute* "build/tests/Makefile"
290 (("\\$\\{exec_prefix\\}/") ""))
293 (list (search-path-specification
294 (variable "XDG_DATA_DIRS")
295 (files '("share")))))
296 (home-page "http://ecls.sourceforge.net/")
297 (synopsis "Embeddable Common Lisp")
298 (description "ECL is an implementation of the Common Lisp language as
299 defined by the ANSI X3J13 specification. Its most relevant features are: a
300 bytecode compiler and interpreter, being able to compile Common Lisp with any
301 C/C++ compiler, being able to build standalone executables and libraries, and
302 supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
303 ;; Note that the file "Copyright" points to some files and directories
304 ;; which aren't under the lgpl2.0+ and instead contain many different,
305 ;; non-copyleft licenses.
306 (license license:lgpl2.0+)))
316 (url "https://gitlab.com/gnu-clisp/clisp")
317 (commit "clisp-2.49.92-2018-02-18")))
318 (file-name (git-file-name name version))
320 (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))
321 (patches (search-patches "clisp-remove-failing-test.patch"))))
322 (build-system gnu-build-system)
323 (inputs `(("libffcall" ,libffcall)
325 ("readline" ,readline)
326 ("libsigsegv" ,libsigsegv)))
328 `(#:configure-flags '(,@(if (string-prefix? "armhf-linux"
329 (or (%current-system)
330 (%current-target-system)))
331 '("CFLAGS=-falign-functions=4")
334 "--with-dynamic-modules"
335 "--with-module=rawsock")
338 (modify-phases %standard-phases
339 (add-after 'unpack 'patch-sh-and-pwd
341 ;; The package is very messy with its references to "/bin/sh" and
342 ;; some other absolute paths to traditional tools. These appear in
343 ;; many places where our automatic patching misses them. Therefore
344 ;; we do the following, in this early (post-unpack) phase, to solve
345 ;; the problem from its root.
346 (substitute* '("src/clisp-link.in"
349 (("/bin/sh") (which "sh")))
350 (substitute* (find-files "." "configure|Makefile")
352 (substitute* '("src/clisp-link.in")
353 (("/bin/pwd") "pwd"))
355 ;; Makefiles seem to have race conditions.
356 #:parallel-build? #f))
357 (home-page "https://clisp.sourceforge.io/")
358 (synopsis "A Common Lisp implementation")
360 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
361 high-level, object-oriented functional programming language. CLISP includes
362 an interpreter, a compiler, a debugger, and much more.")
363 (license license:gpl2+)))
372 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
373 version "-source.tar.bz2"))
375 (base32 "1krgd69cirp4ili2pfsh1a0mfvq722jbknlvmf17qhsxh1b94dlh"))))
376 (build-system gnu-build-system)
377 (outputs '("out" "doc"))
380 ;; Supported build hosts are:
383 ;; CCL (formerly known as OpenMCL)
384 ;; ABCL (recent versions only)
385 ;; CLISP (only some versions: 2.44.1 is OK, 2.47 is not)
389 ;; * build enhancement: new host quirks mechanism, support for building under
390 ;; ABCL and ECL (as well as CCL, CMUCL, CLISP and SBCL itself)
392 ;; CCL is not bootstrappable so it won't do. CLISP 2.49 seems to work.
393 ;; ECL too. ECL builds SBCL about 20% slower than CLISP. As of
394 ;; 2019-09-05, ECL was last updated in 2016 while CLISP was last updated
397 ;; For now we stick to CLISP for all systems. We keep the `match' here to
398 ;; make it easier to change the host compiler for various architectures.
399 `(,@(match (%current-system)
400 ((or "x86_64-linux" "i686-linux")
403 `(("clisp" ,clisp))))
406 ("inetutils" ,inetutils) ;for hostname(1)
408 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
412 `(#:modules ((guix build gnu-build-system)
416 (modify-phases %standard-phases
418 (add-after 'unpack 'replace-asdf
419 ;; SBCL developers have not committed to keeping ASDF up to date
420 ;; due to breaking changes [1]. Guix can handle this situation
421 ;; easily, and it behooves us to have more control over what version
422 ;; of ASDF we use to build software; therefore, replace the contrib
423 ;; ASDF with the version packaged into Guix.
424 ;; [1] - https://bugs.launchpad.net/sbcl/+bug/1823442
425 (lambda* (#:key inputs outputs #:allow-other-keys)
426 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
427 (guix-asdf (string-append
429 "/share/common-lisp/source/asdf/asdf.lisp"))
430 (out (string-append (assoc-ref outputs "out")))
431 (contrib-asdf "contrib/asdf/asdf.lisp"))
432 (copy-file guix-asdf contrib-asdf)
433 (substitute* contrib-asdf
434 ,@(asdf-substitutions name)))
436 (add-before 'build 'patch-unix-tool-paths
437 (lambda* (#:key outputs inputs #:allow-other-keys)
438 (let ((out (assoc-ref outputs "out"))
439 (bash (assoc-ref inputs "bash"))
440 (coreutils (assoc-ref inputs "coreutils"))
441 (ed (assoc-ref inputs "ed")))
442 (define (quoted-path input path)
443 (string-append "\"" input path "\""))
444 ;; Patch absolute paths in string literals. Note that this
445 ;; occurs in some .sh files too (which contain Lisp code). Use
446 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
447 (with-fluids ((%default-port-encoding #f))
448 ;; The removed file is utf-16-be encoded, which gives substitute*
449 ;; trouble. It does not contain references to the listed programs.
451 "./tests/data/compile-file-pos-utf16be.lisp"
452 (find-files "." "\\.(lisp|sh)$"))
453 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
454 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
455 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
456 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
457 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
458 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
459 ;; This one script has a non-string occurrence of /bin/sh.
460 (substitute* '("tests/foreign.test.sh")
461 ;; Leave whitespace so we don't match the shebang.
462 ((" /bin/sh ") " sh "))
463 ;; This file contains a module that can create executable files
464 ;; which depend on the presence of SBCL. It generates shell
465 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
466 ;; the shebang and the reference to "sbcl", tying the generated
467 ;; executables to the exact SBCL package that generated them.
468 (substitute* '("contrib/sb-executable/sb-executable.lisp")
469 (("/bin/sh") (string-append bash "/bin/sh"))
470 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
471 ;; Disable some tests that fail in our build environment.
472 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
473 ;; This requires /etc/protocols.
474 (("\\(deftest get-protocol-by-name/error" all)
475 (string-append "#+nil ;disabled by Guix\n" all)))
476 (substitute* '("contrib/sb-posix/posix-tests.lisp")
477 ;; These assume some users/groups which we don't have.
478 (("\\(deftest pwent\\.[12]" all)
479 (string-append "#+nil ;disabled by Guix\n" all))
480 (("\\(deftest grent\\.[12]" all)
481 (string-append "#+nil ;disabled by Guix\n" all))))
483 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
484 ;; them in HOME, so it needs to be writeable.
485 (add-before 'build 'set-HOME
486 (lambda _ (setenv "HOME" "/tmp") #t))
488 (lambda* (#:key outputs #:allow-other-keys)
490 (invoke "sh" "make.sh" ,@(match (%current-system)
491 ((or "x86_64-linux" "i686-linux")
495 (string-append "--prefix="
496 (assoc-ref outputs "out"))
497 "--with-sb-core-compression"
498 "--with-sb-xref-for-internals")))
501 (invoke "sh" "install.sh")))
502 (add-after 'build 'build-doc
504 ;; TODO: Doc is not deterministic, maybe there is a timespamp?
505 (with-directory-excursion "doc/manual"
506 (and (invoke "make" "info")
507 (invoke "make" "dist")))))
508 (add-after 'build 'build-source
509 (lambda* (#:key outputs #:allow-other-keys)
510 (let* ((out (assoc-ref outputs "out"))
511 (rc (string-append out "/lib/sbcl/sbclrc"))
512 (source-dir (string-append out "/share/sbcl")))
513 (for-each (lambda (p)
514 (copy-recursively p (string-append source-dir "/" p)))
516 (mkdir-p (dirname rc))
517 (with-output-to-file rc
520 (string-append "(sb-ext:set-sbcl-source-location \""
521 source-dir "\")") )))
523 (add-after 'install 'install-doc
524 (lambda* (#:key outputs #:allow-other-keys)
525 (let* ((out (assoc-ref outputs "out"))
526 (doc (assoc-ref outputs "doc"))
527 (old-doc-dir (string-append out "/share/doc"))
528 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
529 (rmdir (string-append old-doc-dir "/sbcl/html"))
530 (mkdir-p new-doc/sbcl-dir)
531 (copy-recursively (string-append old-doc-dir "/sbcl")
533 (delete-file-recursively old-doc-dir)
535 ;; No 'check' target, though "make.sh" (build phase) runs tests.
538 (list (search-path-specification
539 (variable "XDG_DATA_DIRS")
540 (files '("share")))))
541 (home-page "http://www.sbcl.org/")
542 (synopsis "Common Lisp implementation")
543 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
544 Lisp compiler. In addition to the compiler and runtime system for ANSI Common
545 Lisp, it provides an interactive environment including a debugger, a
546 statistical profiler, a code coverage tool, and many other extensions.")
547 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
548 ;; loop macro has its own license. See COPYING file for further notes.
549 (license (list license:public-domain license:bsd-2
550 (license:x11-style "file://src/code/loop.lisp")))))
553 ;; Warning: according to upstream, CCL is not bootstrappable.
554 ;; See https://github.com/Clozure/ccl/issues/222 from 2019-09-02:
556 ;; "As far as I know, there is no way to build CCL without an existing
557 ;; running CCL image. It was bootstrapped back in 1986 or so as
558 ;; Macintosh Common Lisp, by Gary Byers, I believe, who is no longer on
559 ;; the planet to tell us the story. It SHOULD be possible to port the
560 ;; CCL compiler to portable Common Lisp, so that ANY lisp could build
561 ;; it, as is the case for SBCL, but I know of no attempt to do so."
566 (build-system gnu-build-system)
567 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
568 ;; shipped in precompiled form in source tarballs. The former is a C
569 ;; program which we can rebuild from scratch, but the latter cannot be
570 ;; generated without an already working copy of CCL, and is platform
571 ;; dependent, so we need to fetch the correct tarball for the platform.
577 "https://github.com/Clozure/ccl/releases/download/v" version
579 (match (%current-system)
580 ((or "i686-linux" "x86_64-linux") "linuxx86")
581 ("armhf-linux" "linuxarm")
582 ;; Prevent errors when querying this package on unsupported
583 ;; platforms, e.g. when running "guix package --search="
588 (match (%current-system)
589 ((or "i686-linux" "x86_64-linux")
590 "0hs1f3z7crgzvinpj990kv9gvbsipxvcvwbmk54n51nasvc5025q")
592 "0p0l1dzsygb6i1xxgbipjpxkn46xhq3jm41a34ga1qqp4x8lkr62")
596 ("subversion" ,subversion)))
598 `(#:tests? #f ;no 'check' target
599 #:modules ((srfi srfi-26)
601 (guix build gnu-build-system))
603 (modify-phases %standard-phases
605 (lambda* (#:key inputs #:allow-other-keys)
606 (invoke "tar" "xzvf" (assoc-ref inputs "ccl"))
610 (add-before 'build 'pre-build
611 ;; Enter the source directory for the current platform's lisp
612 ;; kernel, and run 'make clean' to remove the precompiled one.
614 (substitute* "lisp-kernel/m4macros.m4"
615 (("/bin/pwd") (which "pwd")))
616 (chdir (string-append
618 ,(match (or (%current-target-system) (%current-system))
619 ("i686-linux" "linuxx8632")
620 ("x86_64-linux" "linuxx8664")
621 ("armhf-linux" "linuxarm")
622 ;; Prevent errors when querying this package
623 ;; on unsupported platforms, e.g. when running
624 ;; "guix package --search="
626 (substitute* '("Makefile")
629 (invoke "make" "clean")))
630 ;; XXX Do we need to recompile the heap image as well for Guix?
631 ;; For now just use the one we already got in the tarball.
633 (lambda* (#:key outputs inputs #:allow-other-keys)
634 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
635 ;; is put back into the original directory, so go back. The heap
636 ;; image is there as well.
638 (let* ((out (assoc-ref outputs "out"))
639 (libdir (string-append out "/lib/"))
640 (bindir (string-append out "/bin/"))
641 (wrapper (string-append bindir "ccl"))
642 (bash (assoc-ref inputs "bash"))
644 ,(match (or (%current-target-system) (%current-system))
645 ("i686-linux" "lx86cl")
646 ("x86_64-linux" "lx86cl64")
647 ("armhf-linux" "armcl")
648 ;; Prevent errors when querying this package
649 ;; on unsupported platforms, e.g. when running
650 ;; "guix package --search="
652 (heap (string-append kernel ".image")))
653 (install-file kernel libdir)
654 (install-file heap libdir)
656 (let ((dirs '("lib" "library" "examples" "tools" "objc-bridge"
657 ,@(match (%current-system)
663 (for-each copy-recursively
665 (map (cut string-append libdir <>) dirs)))
668 (with-output-to-file wrapper
672 "#!" bash "/bin/sh\n"
673 "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
674 "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
675 (chmod wrapper #o755))
677 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
678 (home-page "https://ccl.clozure.com/")
679 (synopsis "Common Lisp implementation")
680 (description "Clozure CL (often called CCL for short) is a Common Lisp
681 implementation featuring fast compilation speed, native threads, a precise,
682 generational, compacting garbage collector, and a convenient foreign-function
684 ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL
685 ;; applies to Lisp code according to them.
686 (license (list license:lgpl2.1
687 license:clarified-artistic)))) ;TRIVIAL-LDAP package
696 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
698 (modules '((guix build utils)))
701 (substitute* "src/unix.c"
702 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
703 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
704 (substitute* "src/main.c"
705 (("\" \\(built \" __DATE__ \"\\)\"") ""))
709 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
710 (build-system gnu-build-system)
712 `(;; We have to add these LIBS so that they are found.
713 #:configure-flags (list "LIBS=-lz"
714 "X_EXTRA_LIBS=-lfontconfig"
716 #:tests? #f)) ; No make check.
717 (native-inputs `(("intltool" ,intltool)))
719 `(("alsa-lib" ,alsa-lib)
721 ("sdl-image" ,sdl-image)
722 ("sdl-mixer" ,sdl-mixer)
727 ("fontconfig" ,fontconfig)
729 ("openblas" ,openblas)
732 ("mesa-utils" ,mesa-utils)
733 ("binutils" ,binutils)
734 ("libiberty" ,libiberty)
735 ("readline" ,readline)
737 ("gettext-minimal" ,gettext-minimal)))
738 (synopsis "Lisp Universal Shell")
740 "Lush is an object-oriented Lisp interpreter/compiler with features
741 designed to please people who want to prototype large numerical
742 applications. Lush includes an extensive library of
743 vector/matrix/tensor manipulation, numerous numerical libraries
744 (including GSL, LAPACK, and BLAS), a set of graphic functions, a
745 simple GUI toolkit, and interfaces to various graphic and multimedia
746 libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
747 grabbing), and others. Lush is an ideal frontend script language for
748 programming projects written in C or other languages. Lush also has
749 libraries for Machine Learning, Neural Nets and statistical estimation.")
750 (home-page "http://lush.sourceforge.net/")
751 (license license:lgpl2.1+)))
753 (define-public confusion-mdl
754 (let* ((commit "12a055581fc262225272df43287dae48281900f5"))
756 (name "confusion-mdl")
761 (url (string-append "https://gitlab.com/emacsomancer/" name))
765 "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d"))
766 (file-name (git-file-name name version))))
767 (build-system gnu-build-system)
769 `(#:tests? #f ; there are no tests
771 (modify-phases %standard-phases
774 (lambda* (#:key (make-flags '()) #:allow-other-keys)
775 (apply invoke "make" "CC=gcc" make-flags)))
777 (lambda* (#:key outputs #:allow-other-keys)
778 (let* ((out (assoc-ref outputs "out"))
779 (bin (string-append out "/bin")))
780 (install-file "mdli" bin)
786 (synopsis "Interpreter for the MIT Design Language (MDL)")
787 (description "MDL (the MIT Design Language) is a descendant of Lisp. It
788 was originally developed in 1971 on the PDP-10 computer under the Incompatible
789 Timesharing System (ITS) to provide high level language support for the
790 Dynamic Modeling Group at MIT's Project MAC. Infocom built the original
791 PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was
792 based on a subset of MDL. Confusion is a MDL interpreter that works just well
793 enough to play the original mainframe Zork all the way through.")
794 (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README")
795 (license license:gpl3+))))
805 (url "http://www.kylheku.com/git/txr/")
806 (commit (string-append "txr-" version))))
807 (file-name (git-file-name name version))
808 (patches (search-patches "txr-shell.patch"))
811 "1ma6nbqsnl4f8ndh47zzc8n5vzcny66v0z3ndddgm3g0bqaxzjzm"))))
812 (build-system gnu-build-system)
814 '(#:configure-flags '("cc=gcc")
815 #:phases (modify-phases %standard-phases
816 (add-after 'configure 'fix-tests
818 (substitute* "tests/017/realpath.tl"
820 (substitute* "tests/017/realpath.expected"
825 (invoke "make" "tests"))))))
830 `(("libffi" ,libffi)))
831 (synopsis "General-purpose, multi-paradigm programming language")
833 "TXR is a general-purpose, multi-paradigm programming language. It
834 comprises two languages integrated into a single tool: a text scanning and
835 extraction language referred to as the TXR Pattern Language (sometimes just
836 \"TXR\"), and a general-purpose dialect of Lisp called TXR Lisp. TXR can be
837 used for everything from \"one liner\" data transformation tasks at the
838 command line, to data scanning and extracting scripts, to full application
839 development in a wide-range of areas.")
840 (home-page "https://nongnu.org/txr/")
841 (license license:bsd-2)))
850 (uri (string-append "https://software-lab.de/picoLisp-" version ".tgz"))
852 (base32 "10np0mhihr47r3201617zccrvzpkhdl1jwvz7zimk8kxpriydq2j"))
853 (modules '((guix build utils)))
855 ;; Delete the pre-compiled jar file.
856 (delete-file "ersatz/picolisp.jar")
858 (build-system gnu-build-system)
860 `(("openssl" ,openssl)))
862 `(#:system ,(match (%current-system)
863 ((or "armhf-linux" "aarch64-linux")
868 (modify-phases %standard-phases
870 (add-after 'unpack 'fix-paths
871 (lambda* (#:key outputs #:allow-other-keys)
872 (let* ((out (assoc-ref outputs "out"))
873 (shebang-line (string-append
874 "#!" out "/bin/picolisp "
875 out "/lib/picolisp/lib.l")))
876 (substitute* '("bin/pil"
889 (("#\\!bin/picolisp lib.l")
891 (("#\\!\\.\\./bin/picolisp \\.\\./lib.l")
893 (("#\\!/usr/bin/picolisp /usr/lib/picolisp/lib.l")
896 (add-after 'fix-paths 'make-build-reproducible
898 (substitute* "src64/lib/asm.l"
899 (("\\(prinl \"/\\* \" \\(datSym \\(date\\)\\) \" \\*/\\)")
902 (add-after 'make-build-reproducible 'fix-permissions
904 (for-each make-file-writable
912 (invoke "make" "-C" "src" "picolisp" "tools" "gate")))
913 (add-before 'check 'set-home-for-tests
915 (setenv "HOME" "/tmp")
919 (invoke "./pil" "test/lib.l" "-bye" "+")))
921 (lambda* (#:key outputs #:allow-other-keys)
922 (let* ((out (assoc-ref outputs "out"))
923 (bin (string-append out "/bin"))
924 (man (string-append out "/share/man"))
925 (picolisp (string-append out "/lib/picolisp")))
926 (copy-recursively "man" man)
927 (copy-recursively "." picolisp)
928 (for-each (lambda (name)
929 (let ((path (string-append picolisp "/" name)))
930 (delete-file-recursively path)))
931 '("CHANGES" "COPYING" "CREDITS" "cygwin"
932 "INSTALL" "man" "pil" "README" "src" "src64"
935 (symlink (string-append picolisp "/bin/picolisp")
936 (string-append bin "/picolisp"))
937 (symlink (string-append picolisp "/bin/pil")
938 (string-append bin "/pil")))
940 (synopsis "Interpreter for the PicoLisp programming language")
942 "PicoLisp is a programming language, or really a programming system,
943 including a built-in database engine and a GUI system.")
944 (home-page "https://picolisp.com/wiki/?home")
945 (license license:expat)))
947 (define-public picolisp
948 (match (%current-system)
949 ((or "aarch64-linux" "x86_64-linux")
951 ;; Use the 32-bit picolisp to generate the assembly files required by
952 ;; the 64-bit picolisp.
956 `(("picolisp32" ,picolisp32)
959 (substitute-keyword-arguments (package-arguments picolisp32)
960 ((#:system _ "") (%current-system))
962 `(modify-phases ,phases
964 (add-before 'build 'fix-paths
965 ;; This must run after the other shebang-patching phases,
966 ;; or they will override our changes.
967 (lambda* (#:key inputs outputs #:allow-other-keys)
968 (let* ((picolisp32 (assoc-ref inputs "picolisp32"))
969 (out (assoc-ref outputs "out"))
970 (shebang-line (string-append
971 "#!" out "/bin/picolisp "
972 out "/lib/picolisp/lib.l")))
973 (substitute* '("bin/pil"
986 (("#\\!.*picolisp32.*/bin/picolisp .*lib\\.l")
988 (substitute* "src64/mkAsm"
990 (string-append picolisp32 "/bin/"))))
994 (invoke "make" "-C" "src" "tools" "gate")
995 (invoke "make" "-C" "src64" "CC=gcc" "picolisp")))))))))
999 (name "picolisp")))))