Revert "gnu: sbcl: Update to 1.5.9."
[jackhill/guix/guix.git] / gnu / packages / lisp.scm
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 Katherine Cox-Buday <cox.katherine.e@gmail.com>
16 ;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve@protonmail.com>
17 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
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.
25 ;;;
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.
30 ;;;
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/>.
33
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.
38
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 texinfo)
75 #:use-module (gnu packages version-control)
76 #:use-module (gnu packages xorg)
77 #:use-module (ice-9 match))
78
79 (define (asdf-substitutions lisp)
80 ;; Prepend XDG_DATA_DIRS/LISP-bundle-systems to ASDF's
81 ;; 'default-system-source-registry'.
82 `((("\\(,dir \"systems/\"\\)\\)")
83 (format #f
84 "(,dir \"~a-bundle-systems\")))
85
86 ,@(loop :for dir :in (xdg-data-dirs \"common-lisp/\")
87 :collect `(:directory (,dir \"systems\"))"
88 ,lisp))))
89
90 (define-public gcl
91 (let ((commit "d3335e2b3deb63f930eb0328e9b05377744c9512")
92 (revision "2")) ;Guix package revision
93 (package
94 (name "gcl")
95 (version (string-append "2.6.12-" revision "."
96 (string-take commit 7)))
97 (source
98 (origin
99 (method git-fetch)
100 (uri (git-reference
101 (url "https://git.savannah.gnu.org/r/gcl.git")
102 (commit commit)))
103 (file-name (string-append "gcl-" version "-checkout"))
104 (sha256
105 (base32 "05v86lhvsby05nzvcd3c4k0wljvgdgd0i6arzd2fx1yd67dl6fgj"))))
106 (build-system gnu-build-system)
107 (arguments
108 `(#:parallel-build? #f ; The build system seems not to be thread safe.
109 #:test-target "ansi-tests/test_results"
110 #:configure-flags '("--enable-ansi") ; required for use by the maxima package
111 #:make-flags (list
112 (string-append "GCL_CC=" (assoc-ref %build-inputs "gcc")
113 "/bin/gcc")
114 (string-append "CC=" (assoc-ref %build-inputs "gcc")
115 "/bin/gcc"))
116 #:phases
117 (modify-phases %standard-phases
118 (add-before 'configure 'pre-conf
119 (lambda* (#:key inputs #:allow-other-keys)
120 (chdir "gcl")
121 (substitute*
122 (append
123 '("pcl/impl/kcl/makefile.akcl"
124 "add-defs"
125 "unixport/makefile.dos"
126 "add-defs.bat"
127 "gcl-tk/makefile.prev"
128 "add-defs1")
129 (find-files "h" "\\.defs"))
130 (("SHELL=/bin/bash")
131 (string-append "SHELL=" (which "bash")))
132 (("SHELL=/bin/sh")
133 (string-append "SHELL=" (which "sh"))))
134 (substitute* "h/linux.defs"
135 (("#CC") "CC")
136 (("-fwritable-strings") "")
137 (("-Werror") ""))
138 (substitute* "lsp/gcl_top.lsp"
139 (("\"cc\"")
140 (string-append "\"" (assoc-ref %build-inputs "gcc")
141 "/bin/gcc\""))
142 (("\\(or \\(get-path \\*cc\\*\\) \\*cc\\*\\)") "*cc*")
143 (("\"ld\"")
144 (string-append "\"" (assoc-ref %build-inputs "binutils")
145 "/bin/ld\""))
146 (("\\(or \\(get-path \\*ld\\*\\) \\*ld\\*\\)") "*ld*")
147 (("\\(get-path \"objdump --source \"\\)")
148 (string-append "\"" (assoc-ref %build-inputs "binutils")
149 "/bin/objdump --source \"")))
150 #t))
151 (add-after 'install 'wrap
152 (lambda* (#:key inputs outputs #:allow-other-keys)
153 (let* ((gcl (assoc-ref outputs "out"))
154 (input-path (lambda (lib path)
155 (string-append
156 (assoc-ref inputs lib) path)))
157 (binaries '("binutils")))
158 ;; GCC and the GNU binutils are necessary for GCL to be
159 ;; able to compile Lisp functions and programs (this is
160 ;; a standard feature in Common Lisp). While the
161 ;; the location of GCC is specified in the make-flags,
162 ;; the GNU binutils must be available in GCL's $PATH.
163 (wrap-program (string-append gcl "/bin/gcl")
164 `("PATH" prefix ,(map (lambda (binary)
165 (input-path binary "/bin"))
166 binaries))))
167 #t))
168 ;; drop strip phase to make maxima build, see
169 ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
170 (delete 'strip))))
171 (inputs
172 `(("gmp" ,gmp)
173 ("readline" ,readline)))
174 (native-inputs
175 `(("m4" ,m4)
176 ("texinfo" ,texinfo)))
177 (home-page "https://www.gnu.org/software/gcl/")
178 (synopsis "A Common Lisp implementation")
179 (description "GCL is an implementation of the Common Lisp language. It
180 features the ability to compile to native object code and to load native
181 object code modules directly into its lisp core. It also features a
182 stratified garbage collection strategy, a source-level debugger and a built-in
183 interface to the Tk widget system.")
184 (license license:lgpl2.0+))))
185
186 (define-public ecl
187 (package
188 (name "ecl")
189 (version "16.1.3")
190 (source
191 (origin
192 (method url-fetch)
193 (uri (string-append
194 "https://common-lisp.net/project/ecl/static/files/release/"
195 name "-" version ".tgz"))
196 (sha256
197 (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn"))
198 (modules '((guix build utils)))
199 (snippet
200 ;; Add ecl-bundle-systems to 'default-system-source-registry'.
201 `(begin
202 (substitute* "contrib/asdf/asdf.lisp"
203 ,@(asdf-substitutions name))
204 #t))))
205 (build-system gnu-build-system)
206 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
207 (native-inputs `(("which" ,which)))
208 (inputs `(("gmp" ,gmp)
209 ("libatomic-ops" ,libatomic-ops)
210 ("libgc" ,libgc)
211 ("libffi" ,libffi)))
212 (arguments
213 '(#:configure-flags '("--without-rt")
214 #:tests? #t
215 #:parallel-tests? #f
216 #:phases
217 (modify-phases %standard-phases
218 (delete 'check)
219 (add-after 'install 'wrap
220 (lambda* (#:key inputs outputs #:allow-other-keys)
221 (let* ((ecl (assoc-ref outputs "out"))
222 (input-path (lambda (lib path)
223 (string-append
224 (assoc-ref inputs lib) path)))
225 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
226 (binaries '("gcc" "ld-wrapper" "binutils"))
227 (library-directories
228 (map (lambda (lib) (input-path lib "/lib"))
229 libraries)))
230
231 (wrap-program (string-append ecl "/bin/ecl")
232 `("PATH" prefix
233 ,(map (lambda (binary)
234 (input-path binary "/bin"))
235 binaries))
236 `("CPATH" suffix
237 ,(map (lambda (lib)
238 (input-path lib "/include"))
239 `("kernel-headers" ,@libraries)))
240 `("LIBRARY_PATH" suffix ,library-directories)
241 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
242 (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
243 (add-before 'check 'fix-path-to-ecl
244 (lambda _
245 (substitute* "build/tests/Makefile"
246 (("\\$\\{exec_prefix\\}/") ""))
247 #t)))))
248 (native-search-paths
249 (list (search-path-specification
250 (variable "XDG_DATA_DIRS")
251 (files '("share")))))
252 (home-page "http://ecls.sourceforge.net/")
253 (synopsis "Embeddable Common Lisp")
254 (description "ECL is an implementation of the Common Lisp language as
255 defined by the ANSI X3J13 specification. Its most relevant features are: a
256 bytecode compiler and interpreter, being able to compile Common Lisp with any
257 C/C++ compiler, being able to build standalone executables and libraries, and
258 supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
259 ;; Note that the file "Copyright" points to some files and directories
260 ;; which aren't under the lgpl2.0+ and instead contain many different,
261 ;; non-copyleft licenses.
262 (license license:lgpl2.0+)))
263
264 (define-public clisp
265 (package
266 (name "clisp")
267 (version "2.49-92")
268 (source
269 (origin
270 (method git-fetch)
271 (uri (git-reference
272 (url "https://gitlab.com/gnu-clisp/clisp")
273 (commit "clisp-2.49.92-2018-02-18")))
274 (file-name (git-file-name name version))
275 (sha256
276 (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))
277 (patches (search-patches "clisp-remove-failing-test.patch"))))
278 (build-system gnu-build-system)
279 (inputs `(("libffcall" ,libffcall)
280 ("ncurses" ,ncurses)
281 ("readline" ,readline)
282 ("libsigsegv" ,libsigsegv)))
283 (arguments
284 `(#:configure-flags '(,@(if (string-prefix? "armhf-linux"
285 (or (%current-system)
286 (%current-target-system)))
287 '("CFLAGS=-falign-functions=4")
288 '())
289 "--with-dynamic-ffi"
290 "--with-dynamic-modules"
291 "--with-module=rawsock")
292 #:build #f
293 #:phases
294 (modify-phases %standard-phases
295 (add-after 'unpack 'patch-sh-and-pwd
296 (lambda _
297 ;; The package is very messy with its references to "/bin/sh" and
298 ;; some other absolute paths to traditional tools. These appear in
299 ;; many places where our automatic patching misses them. Therefore
300 ;; we do the following, in this early (post-unpack) phase, to solve
301 ;; the problem from its root.
302 (substitute* '("src/clisp-link.in"
303 "src/unix.d"
304 "src/makemake.in")
305 (("/bin/sh") (which "sh")))
306 (substitute* (find-files "." "configure|Makefile")
307 (("/bin/sh") "sh"))
308 (substitute* '("src/clisp-link.in")
309 (("/bin/pwd") "pwd"))
310 #t)))
311 ;; Makefiles seem to have race conditions.
312 #:parallel-build? #f))
313 (home-page "https://clisp.sourceforge.io/")
314 (synopsis "A Common Lisp implementation")
315 (description
316 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
317 high-level, object-oriented functional programming language. CLISP includes
318 an interpreter, a compiler, a debugger, and much more.")
319 (license license:gpl2+)))
320
321 (define-public sbcl
322 (package
323 (name "sbcl")
324 (version "1.5.8")
325 (source
326 (origin
327 (method url-fetch)
328 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
329 version "-source.tar.bz2"))
330 (sha256
331 (base32 "0k7zjrky8r2krkd8780cph214hiihg9nh5rxn4nrhg6i6f8jymw4"))
332 (modules '((guix build utils)))
333 (snippet
334 ;; Add sbcl-bundle-systems to 'default-system-source-registry'.
335 `(begin
336 (substitute* "contrib/asdf/asdf.lisp"
337 ,@(asdf-substitutions name))
338 #t))))
339 (build-system gnu-build-system)
340 (outputs '("out" "doc"))
341 (native-inputs
342 ;; From INSTALL:
343 ;; Supported build hosts are:
344 ;; SBCL
345 ;; CMUCL
346 ;; CCL (formerly known as OpenMCL)
347 ;; ABCL (recent versions only)
348 ;; CLISP (only some versions: 2.44.1 is OK, 2.47 is not)
349 ;; XCL
350 ;;
351 ;; From NEWS:
352 ;; * build enhancement: new host quirks mechanism, support for building under
353 ;; ABCL and ECL (as well as CCL, CMUCL, CLISP and SBCL itself)
354 ;;
355 ;; CCL is not bootstrappable so it won't do. CLISP 2.49 seems to work.
356 ;; ECL too. ECL builds SBCL about 20% slower than CLISP. As of
357 ;; 2019-09-05, ECL was last updated in 2016 while CLISP was last updated
358 ;; in 2010.
359 ;;
360 ;; For now we stick to CLISP for all systems. We keep the `match' here to
361 ;; make it easier to change the host compiler for various architectures.
362 `(,@(match (%current-system)
363 ((or "x86_64-linux" "i686-linux")
364 `(("clisp" ,clisp)))
365 (_
366 `(("clisp" ,clisp))))
367 ("which" ,which)
368 ("inetutils" ,inetutils) ;for hostname(1)
369 ("ed" ,ed)
370 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
371 ("texinfo" ,texinfo)
372 ("zlib" ,zlib)))
373 (arguments
374 `(#:modules ((guix build gnu-build-system)
375 (guix build utils)
376 (srfi srfi-1))
377 #:phases
378 (modify-phases %standard-phases
379 (delete 'configure)
380 (add-before 'build 'patch-unix-tool-paths
381 (lambda* (#:key outputs inputs #:allow-other-keys)
382 (let ((out (assoc-ref outputs "out"))
383 (bash (assoc-ref inputs "bash"))
384 (coreutils (assoc-ref inputs "coreutils"))
385 (ed (assoc-ref inputs "ed")))
386 (define (quoted-path input path)
387 (string-append "\"" input path "\""))
388 ;; Patch absolute paths in string literals. Note that this
389 ;; occurs in some .sh files too (which contain Lisp code). Use
390 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
391 (with-fluids ((%default-port-encoding #f))
392 ;; The removed file is utf-16-be encoded, which gives substitute*
393 ;; trouble. It does not contain references to the listed programs.
394 (substitute* (delete
395 "./tests/data/compile-file-pos-utf16be.lisp"
396 (find-files "." "\\.(lisp|sh)$"))
397 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
398 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
399 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
400 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
401 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
402 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
403 ;; This one script has a non-string occurrence of /bin/sh.
404 (substitute* '("tests/foreign.test.sh")
405 ;; Leave whitespace so we don't match the shebang.
406 ((" /bin/sh ") " sh "))
407 ;; This file contains a module that can create executable files
408 ;; which depend on the presence of SBCL. It generates shell
409 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
410 ;; the shebang and the reference to "sbcl", tying the generated
411 ;; executables to the exact SBCL package that generated them.
412 (substitute* '("contrib/sb-executable/sb-executable.lisp")
413 (("/bin/sh") (string-append bash "/bin/sh"))
414 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
415 ;; Disable some tests that fail in our build environment.
416 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
417 ;; This requires /etc/protocols.
418 (("\\(deftest get-protocol-by-name/error" all)
419 (string-append "#+nil ;disabled by Guix\n" all)))
420 (substitute* '("contrib/sb-posix/posix-tests.lisp")
421 ;; These assume some users/groups which we don't have.
422 (("\\(deftest pwent\\.[12]" all)
423 (string-append "#+nil ;disabled by Guix\n" all))
424 (("\\(deftest grent\\.[12]" all)
425 (string-append "#+nil ;disabled by Guix\n" all))))
426 #t))
427 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
428 ;; them in HOME, so it needs to be writeable.
429 (add-before 'build 'set-HOME
430 (lambda _ (setenv "HOME" "/tmp") #t))
431 (replace 'build
432 (lambda* (#:key outputs #:allow-other-keys)
433 (setenv "CC" "gcc")
434 (invoke "sh" "make.sh" ,@(match (%current-system)
435 ((or "x86_64-linux" "i686-linux")
436 `("clisp"))
437 (_
438 `("clisp")))
439 (string-append "--prefix="
440 (assoc-ref outputs "out"))
441 "--with-sb-core-compression"
442 "--with-sb-xref-for-internals")))
443 (replace 'install
444 (lambda _
445 (invoke "sh" "install.sh")))
446 (add-after 'build 'build-doc
447 (lambda _
448 ;; TODO: Doc is not deterministic, maybe there is a timespamp?
449 (with-directory-excursion "doc/manual"
450 (and (invoke "make" "info")
451 (invoke "make" "dist")))))
452 (add-after 'build 'build-source
453 (lambda* (#:key outputs #:allow-other-keys)
454 (let* ((out (assoc-ref outputs "out"))
455 (rc (string-append out "/lib/sbcl/sbclrc"))
456 (source-dir (string-append out "/share/sbcl")))
457 (for-each (lambda (p)
458 (copy-recursively p (string-append source-dir "/" p)))
459 '("src" "contrib"))
460 (mkdir-p (dirname rc))
461 (with-output-to-file rc
462 (lambda ()
463 (display
464 (string-append "(sb-ext:set-sbcl-source-location \""
465 source-dir "\")") )))
466 #t)))
467 (add-after 'install 'install-doc
468 (lambda* (#:key outputs #:allow-other-keys)
469 (let* ((out (assoc-ref outputs "out"))
470 (doc (assoc-ref outputs "doc"))
471 (old-doc-dir (string-append out "/share/doc"))
472 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
473 (rmdir (string-append old-doc-dir "/sbcl/html"))
474 (mkdir-p new-doc/sbcl-dir)
475 (copy-recursively (string-append old-doc-dir "/sbcl")
476 new-doc/sbcl-dir)
477 (delete-file-recursively old-doc-dir)
478 #t))))
479 ;; No 'check' target, though "make.sh" (build phase) runs tests.
480 #:tests? #f))
481 (native-search-paths
482 (list (search-path-specification
483 (variable "XDG_DATA_DIRS")
484 (files '("share")))))
485 (home-page "http://www.sbcl.org/")
486 (synopsis "Common Lisp implementation")
487 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
488 Lisp compiler. In addition to the compiler and runtime system for ANSI Common
489 Lisp, it provides an interactive environment including a debugger, a
490 statistical profiler, a code coverage tool, and many other extensions.")
491 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
492 ;; loop macro has its own license. See COPYING file for further notes.
493 (license (list license:public-domain license:bsd-2
494 (license:x11-style "file://src/code/loop.lisp")))))
495
496 (define-public ccl
497 ;; Warning: according to upstream, CCL is not bootstrappable.
498 ;; See https://github.com/Clozure/ccl/issues/222 from 2019-09-02:
499 ;;
500 ;; "As far as I know, there is no way to build CCL without an existing
501 ;; running CCL image. It was bootstrapped back in 1986 or so as
502 ;; Macintosh Common Lisp, by Gary Byers, I believe, who is no longer on
503 ;; the planet to tell us the story. It SHOULD be possible to port the
504 ;; CCL compiler to portable Common Lisp, so that ANY lisp could build
505 ;; it, as is the case for SBCL, but I know of no attempt to do so."
506 (package
507 (name "ccl")
508 (version "1.11.5")
509 (source #f)
510 (build-system gnu-build-system)
511 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
512 ;; shipped in precompiled form in source tarballs. The former is a C
513 ;; program which we can rebuild from scratch, but the latter cannot be
514 ;; generated without an already working copy of CCL, and is platform
515 ;; dependent, so we need to fetch the correct tarball for the platform.
516 (inputs
517 `(("ccl"
518 ,(origin
519 (method url-fetch)
520 (uri (string-append
521 "https://github.com/Clozure/ccl/releases/download/v" version
522 "/ccl-" version "-"
523 (match (%current-system)
524 ((or "i686-linux" "x86_64-linux") "linuxx86")
525 ("armhf-linux" "linuxarm")
526 ;; Prevent errors when querying this package on unsupported
527 ;; platforms, e.g. when running "guix package --search="
528 (_ "UNSUPPORTED"))
529 ".tar.gz"))
530 (sha256
531 (base32
532 (match (%current-system)
533 ((or "i686-linux" "x86_64-linux")
534 "0hs1f3z7crgzvinpj990kv9gvbsipxvcvwbmk54n51nasvc5025q")
535 ("armhf-linux"
536 "0p0l1dzsygb6i1xxgbipjpxkn46xhq3jm41a34ga1qqp4x8lkr62")
537 (_ ""))))))))
538 (native-inputs
539 `(("m4" ,m4)
540 ("subversion" ,subversion)))
541 (arguments
542 `(#:tests? #f ;no 'check' target
543 #:modules ((srfi srfi-26)
544 (guix build utils)
545 (guix build gnu-build-system))
546 #:phases
547 (modify-phases %standard-phases
548 (replace 'unpack
549 (lambda* (#:key inputs #:allow-other-keys)
550 (invoke "tar" "xzvf" (assoc-ref inputs "ccl"))
551 (chdir "ccl")
552 #t))
553 (delete 'configure)
554 (add-before 'build 'pre-build
555 ;; Enter the source directory for the current platform's lisp
556 ;; kernel, and run 'make clean' to remove the precompiled one.
557 (lambda _
558 (substitute* "lisp-kernel/m4macros.m4"
559 (("/bin/pwd") (which "pwd")))
560 (chdir (string-append
561 "lisp-kernel/"
562 ,(match (or (%current-target-system) (%current-system))
563 ("i686-linux" "linuxx8632")
564 ("x86_64-linux" "linuxx8664")
565 ("armhf-linux" "linuxarm")
566 ;; Prevent errors when querying this package
567 ;; on unsupported platforms, e.g. when running
568 ;; "guix package --search="
569 (_ "UNSUPPORTED"))))
570 (substitute* '("Makefile")
571 (("/bin/rm") "rm"))
572 (setenv "CC" "gcc")
573 (invoke "make" "clean")))
574 ;; XXX Do we need to recompile the heap image as well for Guix?
575 ;; For now just use the one we already got in the tarball.
576 (replace 'install
577 (lambda* (#:key outputs inputs #:allow-other-keys)
578 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
579 ;; is put back into the original directory, so go back. The heap
580 ;; image is there as well.
581 (chdir "../..")
582 (let* ((out (assoc-ref outputs "out"))
583 (libdir (string-append out "/lib/"))
584 (bindir (string-append out "/bin/"))
585 (wrapper (string-append bindir "ccl"))
586 (bash (assoc-ref inputs "bash"))
587 (kernel
588 ,(match (or (%current-target-system) (%current-system))
589 ("i686-linux" "lx86cl")
590 ("x86_64-linux" "lx86cl64")
591 ("armhf-linux" "armcl")
592 ;; Prevent errors when querying this package
593 ;; on unsupported platforms, e.g. when running
594 ;; "guix package --search="
595 (_ "UNSUPPORTED")))
596 (heap (string-append kernel ".image")))
597 (install-file kernel libdir)
598 (install-file heap libdir)
599
600 (let ((dirs '("lib" "library" "examples" "tools" "objc-bridge"
601 ,@(match (%current-system)
602 ("x86_64-linux"
603 '("x86-headers64"))
604 ("i686-linux"
605 '("x86-headers"))
606 (_ '())))))
607 (for-each copy-recursively
608 dirs
609 (map (cut string-append libdir <>) dirs)))
610
611 (mkdir-p bindir)
612 (with-output-to-file wrapper
613 (lambda ()
614 (display
615 (string-append
616 "#!" bash "/bin/sh\n"
617 "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
618 "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
619 (chmod wrapper #o755))
620 #t)))))
621 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
622 (home-page "https://ccl.clozure.com/")
623 (synopsis "Common Lisp implementation")
624 (description "Clozure CL (often called CCL for short) is a Common Lisp
625 implementation featuring fast compilation speed, native threads, a precise,
626 generational, compacting garbage collector, and a convenient foreign-function
627 interface.")
628 ;; See file doc/LICENSE for clarifications it makes regarding how the LGPL
629 ;; applies to Lisp code according to them.
630 (license (list license:lgpl2.1
631 license:clarified-artistic)))) ;TRIVIAL-LDAP package
632
633 (define-public lush2
634 (package
635 (name "lush2")
636 (version "2.0.1")
637 (source
638 (origin
639 (method url-fetch)
640 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
641 version ".tar.gz"))
642 (modules '((guix build utils)))
643 (snippet
644 '(begin
645 (substitute* "src/unix.c"
646 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
647 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
648 (substitute* "src/main.c"
649 (("\" \\(built \" __DATE__ \"\\)\"") ""))
650 #t))
651 (sha256
652 (base32
653 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
654 (build-system gnu-build-system)
655 (arguments
656 `(;; We have to add these LIBS so that they are found.
657 #:configure-flags (list "LIBS=-lz"
658 "X_EXTRA_LIBS=-lfontconfig"
659 "--with-x")
660 #:tests? #f)) ; No make check.
661 (native-inputs `(("intltool" ,intltool)))
662 (inputs
663 `(("alsa-lib" ,alsa-lib)
664 ("sdl" ,sdl)
665 ("sdl-image" ,sdl-image)
666 ("sdl-mixer" ,sdl-mixer)
667 ("sdl-net" ,sdl-net)
668 ("sdl-ttf" ,sdl-ttf)
669 ("lapack" ,lapack)
670 ("libxft" ,libxft)
671 ("fontconfig" ,fontconfig)
672 ("gsl" ,gsl)
673 ("openblas" ,openblas)
674 ("glu" ,glu)
675 ("mesa" ,mesa)
676 ("mesa-utils" ,mesa-utils)
677 ("binutils" ,binutils)
678 ("libiberty" ,libiberty)
679 ("readline" ,readline)
680 ("zlib" ,zlib)
681 ("gettext-minimal" ,gettext-minimal)))
682 (synopsis "Lisp Universal Shell")
683 (description
684 "Lush is an object-oriented Lisp interpreter/compiler with features
685 designed to please people who want to prototype large numerical
686 applications. Lush includes an extensive library of
687 vector/matrix/tensor manipulation, numerous numerical libraries
688 (including GSL, LAPACK, and BLAS), a set of graphic functions, a
689 simple GUI toolkit, and interfaces to various graphic and multimedia
690 libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
691 grabbing), and others. Lush is an ideal frontend script language for
692 programming projects written in C or other languages. Lush also has
693 libraries for Machine Learning, Neural Nets and statistical estimation.")
694 (home-page "http://lush.sourceforge.net/")
695 (license license:lgpl2.1+)))
696
697 (define-public confusion-mdl
698 (let* ((commit "12a055581fc262225272df43287dae48281900f5"))
699 (package
700 (name "confusion-mdl")
701 (version "0.2")
702 (source (origin
703 (method git-fetch)
704 (uri (git-reference
705 (url (string-append "https://gitlab.com/emacsomancer/" name))
706 (commit commit)))
707 (sha256
708 (base32
709 "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d"))
710 (file-name (git-file-name name version))))
711 (build-system gnu-build-system)
712 (arguments
713 `(#:tests? #f ; there are no tests
714 #:phases
715 (modify-phases %standard-phases
716 (delete 'configure)
717 (replace 'build
718 (lambda* (#:key (make-flags '()) #:allow-other-keys)
719 (apply invoke "make" "CC=gcc" make-flags)))
720 (replace 'install
721 (lambda* (#:key outputs #:allow-other-keys)
722 (let* ((out (assoc-ref outputs "out"))
723 (bin (string-append out "/bin")))
724 (install-file "mdli" bin)
725 #t))))))
726 (native-inputs
727 `(("perl" ,perl)))
728 (inputs
729 `(("libgc" ,libgc)))
730 (synopsis "Interpreter for the MIT Design Language (MDL)")
731 (description "MDL (the MIT Design Language) is a descendant of Lisp. It
732 was originally developed in 1971 on the PDP-10 computer under the Incompatible
733 Timesharing System (ITS) to provide high level language support for the
734 Dynamic Modeling Group at MIT's Project MAC. Infocom built the original
735 PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was
736 based on a subset of MDL. Confusion is a MDL interpreter that works just well
737 enough to play the original mainframe Zork all the way through.")
738 (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README")
739 (license license:gpl3+))))
740
741 (define-public txr
742 (package
743 (name "txr")
744 (version "230")
745 (source
746 (origin
747 (method git-fetch)
748 (uri (git-reference
749 (url "http://www.kylheku.com/git/txr/")
750 (commit (string-append "txr-" version))))
751 (file-name (git-file-name name version))
752 (patches (search-patches "txr-shell.patch"))
753 (sha256
754 (base32
755 "1ma6nbqsnl4f8ndh47zzc8n5vzcny66v0z3ndddgm3g0bqaxzjzm"))))
756 (build-system gnu-build-system)
757 (arguments
758 '(#:configure-flags '("cc=gcc")
759 #:phases (modify-phases %standard-phases
760 (add-after 'configure 'fix-tests
761 (lambda _
762 (substitute* "tests/017/realpath.tl"
763 (("/usr/bin") "/"))
764 (substitute* "tests/017/realpath.expected"
765 (("/usr/bin") "/"))
766 #t))
767 (replace 'check
768 (lambda _
769 (invoke "make" "tests"))))))
770 (native-inputs
771 `(("bison" ,bison)
772 ("flex" ,flex)))
773 (inputs
774 `(("libffi" ,libffi)))
775 (synopsis "General-purpose, multi-paradigm programming language")
776 (description
777 "TXR is a general-purpose, multi-paradigm programming language. It
778 comprises two languages integrated into a single tool: a text scanning and
779 extraction language referred to as the TXR Pattern Language (sometimes just
780 \"TXR\"), and a general-purpose dialect of Lisp called TXR Lisp. TXR can be
781 used for everything from \"one liner\" data transformation tasks at the
782 command line, to data scanning and extracting scripts, to full application
783 development in a wide-range of areas.")
784 (home-page "https://nongnu.org/txr/")
785 (license license:bsd-2)))