gnu: font-ibm-plex: Update to 4.0.2.
[jackhill/guix/guix.git] / gnu / packages / lisp.scm
CommitLineData
f842bbed
JD
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 John Darrington <jmd@gnu.org>
00ab9458 3;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
e396976b 4;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
05f5ce0c 5;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
47956fa0 6;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
14afc7b8 7;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
e24ef369 8;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
040a7440 9;;; Copyright © 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
46c1c553 10;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
56c240ba 11;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
28e32b14 12;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
02b63821 13;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
c894b803 14;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
5914489d 15;;; Copyright © 2019 Katherine Cox-Buday <cox.katherine.e@gmail.com>
29331827 16;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve@protonmail.com>
a0c3a2e3 17;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
f842bbed
JD
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
88f06fd0
PN
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
f842bbed
JD
39(define-module (gnu packages lisp)
40 #:use-module (gnu packages)
b5b73a82 41 #:use-module ((guix licenses) #:prefix license:)
f842bbed 42 #:use-module (guix packages)
f842bbed 43 #:use-module (guix download)
423eef36 44 #:use-module (guix git-download)
f842bbed 45 #:use-module (guix utils)
00ab9458 46 #:use-module (guix build-system gnu)
28e32b14 47 #:use-module (guix build-system ant)
a72debb7 48 #:use-module (guix build-system asdf)
e3e171ee 49 #:use-module (guix build-system trivial)
5ff15b86 50 #:use-module (gnu packages admin)
ce0614dd 51 #:use-module (gnu packages base)
5ff15b86 52 #:use-module (gnu packages bdw-gc)
a0c3a2e3 53 #:use-module (gnu packages bison)
05c63898 54 #:use-module (gnu packages compression)
5ff15b86 55 #:use-module (gnu packages ed)
a0c3a2e3 56 #:use-module (gnu packages flex)
05c63898 57 #:use-module (gnu packages fontutils)
5ff15b86
EF
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)
05c63898 63 #:use-module (gnu packages maths)
00ab9458 64 #:use-module (gnu packages multiprecision)
f473b8f1 65 #:use-module (gnu packages ncurses)
560f51d0 66 #:use-module (gnu packages libffcall)
5ff15b86 67 #:use-module (gnu packages libffi)
b702b52d 68 #:use-module (gnu packages libsigsegv)
05c63898 69 #:use-module (gnu packages linux)
5ff15b86 70 #:use-module (gnu packages perl)
5ff15b86
EF
71 #:use-module (gnu packages readline)
72 #:use-module (gnu packages sdl)
73 #:use-module (gnu packages tex)
74 #:use-module (gnu packages texinfo)
531a9aac 75 #:use-module (gnu packages version-control)
05c63898 76 #:use-module (gnu packages xorg)
88f06fd0 77 #:use-module (ice-9 match))
f842bbed 78
8d0489ae
AP
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
f842bbed 90(define-public gcl
5a8b00f2
KK
91 (let ((commit "d3335e2b3deb63f930eb0328e9b05377744c9512")
92 (revision "2")) ;Guix package revision
dd0134fc
KK
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
5a8b00f2 105 (base32 "05v86lhvsby05nzvcd3c4k0wljvgdgd0i6arzd2fx1yd67dl6fgj"))))
dd0134fc
KK
106 (build-system gnu-build-system)
107 (arguments
108 `(#:parallel-build? #f ; The build system seems not to be thread safe.
b888396d 109 #:test-target "ansi-tests/test_results"
dd0134fc
KK
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
978154ae 175 `(("m4" ,m4)
27ebd5c4 176 ("texinfo" ,texinfo)))
dd0134fc
KK
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
f842bbed
JD
180features the ability to compile to native object code and to load native
181object code modules directly into its lisp core. It also features a
182stratified garbage collection strategy, a source-level debugger and a built-in
183interface to the Tk widget system.")
dd0134fc 184 (license license:lgpl2.0+))))
f842bbed 185
00ab9458
TUBK
186(define-public ecl
187 (package
188 (name "ecl")
108f69c4 189 (version "16.1.3")
00ab9458
TUBK
190 (source
191 (origin
192 (method url-fetch)
e0524511
AP
193 (uri (string-append
194 "https://common-lisp.net/project/ecl/static/files/release/"
195 name "-" version ".tgz"))
00ab9458 196 (sha256
108f69c4 197 (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn"))
fb7dc6d6
AP
198 (modules '((guix build utils)))
199 (snippet
200 ;; Add ecl-bundle-systems to 'default-system-source-registry'.
6cbee49d
MW
201 `(begin
202 (substitute* "contrib/asdf/asdf.lisp"
203 ,@(asdf-substitutions name))
204 #t))))
00ab9458 205 (build-system gnu-build-system)
cb03a9b6 206 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
00ab9458
TUBK
207 (native-inputs `(("which" ,which)))
208 (inputs `(("gmp" ,gmp)
209 ("libatomic-ops" ,libatomic-ops)
210 ("libgc" ,libgc)
211 ("libffi" ,libffi)))
212 (arguments
fd0f8860
GLV
213 '(#:configure-flags '("--without-rt")
214 #:tests? #t
60474cd1
AP
215 #:parallel-tests? #f
216 #:phases
217 (modify-phases %standard-phases
218 (delete 'check)
54a43ff4
AP
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"))
932b2ea2 239 `("kernel-headers" ,@libraries)))
54a43ff4
AP
240 `("LIBRARY_PATH" suffix ,library-directories)
241 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
108f69c4
AP
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)))))
fb7dc6d6
AP
248 (native-search-paths
249 (list (search-path-specification
250 (variable "XDG_DATA_DIRS")
251 (files '("share")))))
00ab9458
TUBK
252 (home-page "http://ecls.sourceforge.net/")
253 (synopsis "Embeddable Common Lisp")
254 (description "ECL is an implementation of the Common Lisp language as
255defined by the ANSI X3J13 specification. Its most relevant features are: a
256bytecode compiler and interpreter, being able to compile Common Lisp with any
257C/C++ compiler, being able to build standalone executables and libraries, and
258supporting 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+)))
560f51d0
TUBK
263
264(define-public clisp
265 (package
266 (name "clisp")
e4c399fe 267 (version "2.49-92")
560f51d0
TUBK
268 (source
269 (origin
e4c399fe
EF
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))
560f51d0 275 (sha256
e4c399fe
EF
276 (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))
277 (patches (search-patches "clisp-remove-failing-test.patch"))))
560f51d0
TUBK
278 (build-system gnu-build-system)
279 (inputs `(("libffcall" ,libffcall)
f473b8f1
EF
280 ("ncurses" ,ncurses)
281 ("readline" ,readline)
560f51d0
TUBK
282 ("libsigsegv" ,libsigsegv)))
283 (arguments
e4c399fe
EF
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")
f90ef3c3
MW
292 #:build #f
293 #:phases
636c77d0
RW
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.
e4c399fe
EF
302 (substitute* '("src/clisp-link.in"
303 "src/unix.d"
304 "src/makemake.in")
305 (("/bin/sh") (which "sh")))
636c77d0
RW
306 (substitute* (find-files "." "configure|Makefile")
307 (("/bin/sh") "sh"))
308 (substitute* '("src/clisp-link.in")
309 (("/bin/pwd") "pwd"))
636c77d0 310 #t)))
560f51d0
TUBK
311 ;; Makefiles seem to have race conditions.
312 #:parallel-build? #f))
e4c399fe 313 (home-page "https://clisp.sourceforge.io/")
4cc78cb3
LC
314 (synopsis "A Common Lisp implementation")
315 (description
316 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
317high-level, object-oriented functional programming language. CLISP includes
318an interpreter, a compiler, a debugger, and much more.")
4bd2e2a5 319 (license license:gpl2+)))
b702b52d 320
cfff8ebc 321(define-public sbcl
b702b52d 322 (package
cfff8ebc 323 (name "sbcl")
10a8fb47 324 (version "2.0.0")
b702b52d
TUBK
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
10a8fb47 331 (base32 "1krgd69cirp4ili2pfsh1a0mfvq722jbknlvmf17qhsxh1b94dlh"))
8d0489ae
AP
332 (modules '((guix build utils)))
333 (snippet
334 ;; Add sbcl-bundle-systems to 'default-system-source-registry'.
6cbee49d
MW
335 `(begin
336 (substitute* "contrib/asdf/asdf.lisp"
337 ,@(asdf-substitutions name))
338 #t))))
b702b52d 339 (build-system gnu-build-system)
05f5ce0c 340 (outputs '("out" "doc"))
b702b52d 341 (native-inputs
4bddcae9
PN
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
a3439b0c
PN
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
02b63821 357 ;; 2019-09-05, ECL was last updated in 2016 while CLISP was last updated
a3439b0c
PN
358 ;; in 2010.
359 ;;
cfff8ebc
PN
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))))
b702b52d
TUBK
367 ("which" ,which)
368 ("inetutils" ,inetutils) ;for hostname(1)
05f5ce0c 369 ("ed" ,ed)
4bddcae9 370 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
5c8b9a43
PN
371 ("texinfo" ,texinfo)
372 ("zlib" ,zlib)))
b702b52d 373 (arguments
76d520fa 374 `(#:modules ((guix build gnu-build-system)
f0b7dc7e
ST
375 (guix build utils)
376 (srfi srfi-1))
377 #:phases
1ee131df
FB
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))
1925a879
AP
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)$"))
1ee131df
FB
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)
02b63821
PN
425 (string-append "#+nil ;disabled by Guix\n" all))))
426 #t))
4bddcae9
PN
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))
1ee131df
FB
431 (replace 'build
432 (lambda* (#:key outputs #:allow-other-keys)
433 (setenv "CC" "gcc")
cfff8ebc
PN
434 (invoke "sh" "make.sh" ,@(match (%current-system)
435 ((or "x86_64-linux" "i686-linux")
436 `("clisp"))
437 (_
438 `("clisp")))
4bddcae9 439 (string-append "--prefix="
5c8b9a43
PN
440 (assoc-ref outputs "out"))
441 "--with-sb-core-compression"
442 "--with-sb-xref-for-internals")))
1ee131df 443 (replace 'install
b702b52d 444 (lambda _
4bddcae9 445 (invoke "sh" "install.sh")))
05f5ce0c
FB
446 (add-after 'build 'build-doc
447 (lambda _
02b63821 448 ;; TODO: Doc is not deterministic, maybe there is a timespamp?
05f5ce0c 449 (with-directory-excursion "doc/manual"
4bddcae9
PN
450 (and (invoke "make" "info")
451 (invoke "make" "dist")))))
d0480ca1
PN
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)))
05f5ce0c
FB
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))))
1ee131df
FB
479 ;; No 'check' target, though "make.sh" (build phase) runs tests.
480 #:tests? #f))
8d0489ae
AP
481 (native-search-paths
482 (list (search-path-specification
483 (variable "XDG_DATA_DIRS")
484 (files '("share")))))
b702b52d
TUBK
485 (home-page "http://www.sbcl.org/")
486 (synopsis "Common Lisp implementation")
487 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
488Lisp compiler. In addition to the compiler and runtime system for ANSI Common
489Lisp, it provides an interactive environment including a debugger, a
490statistical 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")))))
531a9aac
TUBK
495
496(define-public ccl
a3439b0c
PN
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."
531a9aac
TUBK
506 (package
507 (name "ccl")
04ab38b7 508 (version "1.11.5")
531a9aac
TUBK
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
04ab38b7 521 "https://github.com/Clozure/ccl/releases/download/v" version
3701f014 522 "/ccl-" version "-"
531a9aac
TUBK
523 (match (%current-system)
524 ((or "i686-linux" "x86_64-linux") "linuxx86")
42f11801
MW
525 ("armhf-linux" "linuxarm")
526 ;; Prevent errors when querying this package on unsupported
527 ;; platforms, e.g. when running "guix package --search="
528 (_ "UNSUPPORTED"))
531a9aac
TUBK
529 ".tar.gz"))
530 (sha256
531 (base32
532 (match (%current-system)
533 ((or "i686-linux" "x86_64-linux")
04ab38b7 534 "0hs1f3z7crgzvinpj990kv9gvbsipxvcvwbmk54n51nasvc5025q")
42f11801 535 ("armhf-linux"
04ab38b7 536 "0p0l1dzsygb6i1xxgbipjpxkn46xhq3jm41a34ga1qqp4x8lkr62")
42f11801 537 (_ ""))))))))
531a9aac
TUBK
538 (native-inputs
539 `(("m4" ,m4)
540 ("subversion" ,subversion)))
541 (arguments
542 `(#:tests? #f ;no 'check' target
fc7d5a34
AP
543 #:modules ((srfi srfi-26)
544 (guix build utils)
545 (guix build gnu-build-system))
531a9aac 546 #:phases
dc1d3cde
KK
547 (modify-phases %standard-phases
548 (replace 'unpack
549 (lambda* (#:key inputs #:allow-other-keys)
7d416066
RW
550 (invoke "tar" "xzvf" (assoc-ref inputs "ccl"))
551 (chdir "ccl")
552 #t))
dc1d3cde
KK
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 _
bcc65510
EF
558 (substitute* "lisp-kernel/m4macros.m4"
559 (("/bin/pwd") (which "pwd")))
dc1d3cde
KK
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")
7d416066 573 (invoke "make" "clean")))
dc1d3cde
KK
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
531a9aac
TUBK
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))
76eb7266 589 ("i686-linux" "lx86cl")
531a9aac 590 ("x86_64-linux" "lx86cl64")
76eb7266
MW
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")))
531a9aac 596 (heap (string-append kernel ".image")))
fc7d5a34
AP
597 (install-file kernel libdir)
598 (install-file heap libdir)
599
910ac0ef
PN
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 (_ '())))))
fc7d5a34
AP
607 (for-each copy-recursively
608 dirs
609 (map (cut string-append libdir <>) dirs)))
610
531a9aac 611 (mkdir-p bindir)
531a9aac
TUBK
612 (with-output-to-file wrapper
613 (lambda ()
614 (display
615 (string-append
616 "#!" bash "/bin/sh\n"
eff8e0b4
PN
617 "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
618 "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
dc1d3cde
KK
619 (chmod wrapper #o755))
620 #t)))))
531a9aac 621 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
910ac0ef 622 (home-page "https://ccl.clozure.com/")
531a9aac
TUBK
623 (synopsis "Common Lisp implementation")
624 (description "Clozure CL (often called CCL for short) is a Common Lisp
625implementation featuring fast compilation speed, native threads, a precise,
626generational, compacting garbage collector, and a convenient foreign-function
627interface.")
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
423eef36 632
05c63898 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"
6cbee49d
MW
646 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
647 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
648 (substitute* "src/main.c"
649 (("\" \\(built \" __DATE__ \"\\)\"") ""))
650 #t))
05c63898 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
685designed to please people who want to prototype large numerical
686applications. Lush includes an extensive library of
687vector/matrix/tensor manipulation, numerous numerical libraries
688(including GSL, LAPACK, and BLAS), a set of graphic functions, a
689simple GUI toolkit, and interfaces to various graphic and multimedia
690libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
691grabbing), and others. Lush is an ideal frontend script language for
692programming projects written in C or other languages. Lush also has
693libraries for Machine Learning, Neural Nets and statistical estimation.")
694 (home-page "http://lush.sourceforge.net/")
695 (license license:lgpl2.1+)))
696
56c240ba
LC
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
732was originally developed in 1971 on the PDP-10 computer under the Incompatible
733Timesharing System (ITS) to provide high level language support for the
734Dynamic Modeling Group at MIT's Project MAC. Infocom built the original
735PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was
736based on a subset of MDL. Confusion is a MDL interpreter that works just well
737enough 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+))))
99c61242 740
88f06fd0 741(define-public txr
d9544d91 742 (package
88f06fd0 743 (name "txr")
92fcf985 744 (version "230")
d9544d91
TGR
745 (source
746 (origin
747 (method git-fetch)
748 (uri (git-reference
88f06fd0
PN
749 (url "http://www.kylheku.com/git/txr/")
750 (commit (string-append "txr-" version))))
d9544d91 751 (file-name (git-file-name name version))
88f06fd0 752 (patches (search-patches "txr-shell.patch"))
ed0ddadc
GLV
753 (sha256
754 (base32
92fcf985 755 "1ma6nbqsnl4f8ndh47zzc8n5vzcny66v0z3ndddgm3g0bqaxzjzm"))))
88f06fd0 756 (build-system gnu-build-system)
d9544d91 757 (arguments
88f06fd0
PN
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)))
d9544d91 773 (inputs
88f06fd0
PN
774 `(("libffi" ,libffi)))
775 (synopsis "General-purpose, multi-paradigm programming language")
d9544d91 776 (description
88f06fd0
PN
777 "TXR is a general-purpose, multi-paradigm programming language. It
778comprises two languages integrated into a single tool: a text scanning and
779extraction 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
781used for everything from \"one liner\" data transformation tasks at the
782command line, to data scanning and extracting scripts, to full application
783development in a wide-range of areas.")
784 (home-page "https://nongnu.org/txr/")
785 (license license:bsd-2)))