e2b8cf4241257f52a95d5b549390e05e938d5896
[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 Nikita <nikita@n0.is>
7 ;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
8 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2017, 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
12 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
13 ;;; Copyright © 2018, 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz>
14 ;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
15 ;;; Copyright © 2019, 2020 Katherine Cox-Buday <cox.katherine.e@gmail.com>
16 ;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve@protonmail.com>
17 ;;; Copyright © 2019, 2020, 2021 Guillaume Le Vaillant <glv@posteo.net>
18 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
20 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
21 ;;; Copyright © 2021 Jack Hill <jackhill@jackhill.us>
22 ;;;
23 ;;; This file is part of GNU Guix.
24 ;;;
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
29 ;;;
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
34 ;;;
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38 ;;; This file only contains Common Lisp compilers and tooling.
39 ;;; Common Lisp libraries go to lisp-xyz.scm.
40 ;;; Common Lisp applications should go to the most appropriate file,
41 ;;; e.g. StumpWM is in wm.scm.
42
43 (define-module (gnu packages lisp)
44 #:use-module (gnu packages)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix git-download)
49 #:use-module (guix utils)
50 #:use-module (guix build-system copy)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system ant)
53 #:use-module (guix build-system asdf)
54 #:use-module (guix build-system trivial)
55 #:use-module (gnu packages admin)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages bdw-gc)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages ed)
60 #:use-module (gnu packages fontutils)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages gettext)
63 #:use-module (gnu packages gl)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages m4)
66 #:use-module (gnu packages maths)
67 #:use-module (gnu packages multiprecision)
68 #:use-module (gnu packages ncurses)
69 #:use-module (gnu packages libffcall)
70 #:use-module (gnu packages libffi)
71 #:use-module (gnu packages libsigsegv)
72 #:use-module (gnu packages linux)
73 #:use-module (gnu packages perl)
74 #:use-module (gnu packages readline)
75 #:use-module (gnu packages sdl)
76 #:use-module (gnu packages tex)
77 #:use-module (gnu packages tls)
78 #:use-module (gnu packages texinfo)
79 #:use-module (gnu packages version-control)
80 #:use-module (gnu packages xorg)
81 #:use-module (ice-9 match))
82
83 (define-public cl-asdf
84 (package
85 (name "cl-asdf")
86 (version "3.3.4")
87 (source
88 (origin
89 (method url-fetch)
90 (uri
91 (string-append "https://common-lisp.net/project/asdf/archives/asdf-"
92 version ".lisp"))
93 (sha256
94 (base32 "1hpx30f6yrak15nw992k7x3pn75ahvjs04n4f134k68mhgs62km2"))))
95 (build-system trivial-build-system)
96 (native-inputs
97 `(("config-patch" ,@(search-patches "cl-asdf-config-directories.patch"))
98 ("patch" ,patch)))
99 (arguments
100 `(#:modules ((guix build utils)
101 (guix build lisp-utils))
102 #:builder
103 (begin
104 (use-modules (guix build utils)
105 (guix build lisp-utils))
106 (let* ((out (string-append (assoc-ref %outputs "out")))
107 (asdf-install (string-append out %source-install-prefix
108 "/source/asdf/"))
109 (src-asdf (string-append (assoc-ref %build-inputs "source")))
110 (dst-asdf (string-append asdf-install "asdf.lisp"))
111 (patch (string-append (assoc-ref %build-inputs "patch")
112 "/bin/patch"))
113 (config-patch (assoc-ref %build-inputs "config-patch")))
114 (mkdir-p asdf-install)
115 (copy-file src-asdf dst-asdf)
116 (invoke patch "-p1" "-i" config-patch dst-asdf)))))
117 (home-page "https://common-lisp.net/project/asdf/")
118 (synopsis "Another System Definition Facility")
119 (description
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.")
123 ;; MIT License
124 (license license:expat)))
125
126 (define-public gcl
127 (let ((commit "d3335e2b3deb63f930eb0328e9b05377744c9512")
128 (revision "2")) ;Guix package revision
129 (package
130 (name "gcl")
131 (version (string-append "2.6.12-" revision "."
132 (string-take commit 7)))
133 (source
134 (origin
135 (method git-fetch)
136 (uri (git-reference
137 (url "https://git.savannah.gnu.org/r/gcl.git")
138 (commit commit)))
139 (file-name (string-append "gcl-" version "-checkout"))
140 (sha256
141 (base32 "05v86lhvsby05nzvcd3c4k0wljvgdgd0i6arzd2fx1yd67dl6fgj"))))
142 (build-system gnu-build-system)
143 (arguments
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
147 #:make-flags (list
148 (string-append "GCL_CC=" (assoc-ref %build-inputs "gcc")
149 "/bin/gcc")
150 (string-append "CC=" (assoc-ref %build-inputs "gcc")
151 "/bin/gcc"))
152 #:phases
153 (modify-phases %standard-phases
154 (add-before 'configure 'pre-conf
155 (lambda* (#:key inputs #:allow-other-keys)
156 (chdir "gcl")
157 (substitute*
158 (append
159 '("pcl/impl/kcl/makefile.akcl"
160 "add-defs"
161 "unixport/makefile.dos"
162 "add-defs.bat"
163 "gcl-tk/makefile.prev"
164 "add-defs1")
165 (find-files "h" "\\.defs"))
166 (("SHELL=/bin/bash")
167 (string-append "SHELL=" (which "bash")))
168 (("SHELL=/bin/sh")
169 (string-append "SHELL=" (which "sh"))))
170 (substitute* "h/linux.defs"
171 (("#CC") "CC")
172 (("-fwritable-strings") "")
173 (("-Werror") ""))
174 (substitute* "lsp/gcl_top.lsp"
175 (("\"cc\"")
176 (string-append "\"" (assoc-ref %build-inputs "gcc")
177 "/bin/gcc\""))
178 (("\\(or \\(get-path \\*cc\\*\\) \\*cc\\*\\)") "*cc*")
179 (("\"ld\"")
180 (string-append "\"" (assoc-ref %build-inputs "binutils")
181 "/bin/ld\""))
182 (("\\(or \\(get-path \\*ld\\*\\) \\*ld\\*\\)") "*ld*")
183 (("\\(get-path \"objdump --source \"\\)")
184 (string-append "\"" (assoc-ref %build-inputs "binutils")
185 "/bin/objdump --source \"")))
186 #t))
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)
191 (string-append
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"))
202 binaries))))
203 #t))
204 ;; drop strip phase to make maxima build, see
205 ;; https://www.ma.utexas.edu/pipermail/maxima/2008/009769.html
206 (delete 'strip))))
207 (inputs
208 `(("gmp" ,gmp)
209 ("readline" ,readline)))
210 (native-inputs
211 `(("m4" ,m4)
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+))))
221
222 (define-public ecl
223 (package
224 (name "ecl")
225 (version "21.2.1")
226 (source
227 (origin
228 (method url-fetch)
229 (uri (string-append
230 "https://common-lisp.net/project/ecl/static/files/release/"
231 name "-" version ".tgz"))
232 (sha256
233 (base32 "000906nnq25177bgsfndiw3iqqgrjc9spk10hzk653sbz3f7anmi"))))
234 (build-system gnu-build-system)
235 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
236 (native-inputs
237 `(("cl-asdf" ,cl-asdf)
238 ("which" ,which)
239 ("texinfo" ,texinfo)))
240 ;; When ECL is embedded in a program that wants to use Common Lisp as an
241 ;; extension language, libgmp, libatomic-ops, libgc and libffi must be
242 ;; present when compiling the program because they are required by ECL's
243 ;; header file.
244 ;; Therefore we put these libraries in 'propagated-inputs' instead
245 ;; of 'inputs'.
246 (propagated-inputs
247 `(("gmp" ,gmp)
248 ("libatomic-ops" ,libatomic-ops)
249 ("libgc" ,libgc)
250 ("libffi" ,libffi)))
251 (arguments
252 `(#:configure-flags '("--without-rt")
253 ;; FIXME: As of version 20.4.24, we pass 17995 tests and fail 7.
254 ;; 2-3 tests may be due to FHS assumptions.
255 #:tests? #t
256 #:parallel-tests? #f
257 #:phases
258 (modify-phases %standard-phases
259 (delete 'check)
260 (add-after 'unpack 'replace-asdf
261 ;; Use system ASDF instead of bundled one.
262 (lambda* (#:key inputs #:allow-other-keys)
263 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
264 (guix-asdf (string-append
265 cl-asdf
266 "/share/common-lisp/source/asdf/asdf.lisp"))
267 (contrib-asdf "contrib/asdf/asdf.lisp"))
268 (copy-file guix-asdf contrib-asdf))
269 #t))
270 (add-after 'install 'remove-build-stamp
271 (lambda* (#:key outputs #:allow-other-keys)
272 (delete-file (string-append (assoc-ref outputs "out")
273 "/lib/ecl-" ,version "/build-stamp"))
274 #t))
275 (add-after 'remove-build-stamp 'wrap
276 (lambda* (#:key inputs outputs #:allow-other-keys)
277 (let* ((ecl (assoc-ref outputs "out"))
278 (input-path (lambda (lib path)
279 (string-append
280 (assoc-ref inputs lib) path)))
281 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
282 (binaries '("gcc" "ld-wrapper" "binutils"))
283 (library-directories
284 (map (lambda (lib) (input-path lib "/lib"))
285 libraries)))
286
287 (wrap-program (string-append ecl "/bin/ecl")
288 `("PATH" prefix
289 ,(map (lambda (binary)
290 (input-path binary "/bin"))
291 binaries))
292 `("CPATH" suffix
293 ,(map (lambda (lib)
294 (input-path lib "/include"))
295 `("kernel-headers" ,@libraries)))
296 `("LIBRARY_PATH" suffix ,library-directories)
297 `("LD_LIBRARY_PATH" suffix ,library-directories))
298 #t)))
299 (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
300 (add-before 'check 'fix-path-to-ecl
301 (lambda _
302 (substitute* "build/tests/Makefile"
303 (("\\$\\{exec_prefix\\}/") ""))
304 #t)))))
305 (native-search-paths
306 (list (search-path-specification
307 (variable "XDG_DATA_DIRS")
308 (files '("share")))
309 (search-path-specification
310 (variable "XDG_CONFIG_DIRS")
311 (files '("etc")))))
312 (home-page "http://ecls.sourceforge.net/")
313 (synopsis "Embeddable Common Lisp")
314 (description "ECL is an implementation of the Common Lisp language as
315 defined by the ANSI X3J13 specification. Its most relevant features are: a
316 bytecode compiler and interpreter, being able to compile Common Lisp with any
317 C/C++ compiler, being able to build standalone executables and libraries, and
318 supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
319 ;; Note that the file "Copyright" points to some files and directories
320 ;; which aren't under the lgpl2.1+ and instead contain many different,
321 ;; non-copyleft licenses.
322 ;; See https://common-lisp.net/project/ecl/posts/ECL-license.html.
323 (license license:lgpl2.1+)))
324
325 (define-public clisp
326 (package
327 (name "clisp")
328 (version "2.49-92")
329 (source
330 (origin
331 (method git-fetch)
332 (uri (git-reference
333 (url "https://gitlab.com/gnu-clisp/clisp")
334 (commit "clisp-2.49.92-2018-02-18")))
335 (file-name (git-file-name name version))
336 (sha256
337 (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))))
338 (build-system gnu-build-system)
339 (native-inputs
340 `(("cl-asdf" ,cl-asdf)))
341 (inputs `(("libffcall" ,libffcall)
342 ("ncurses" ,ncurses)
343 ("readline" ,readline)
344 ("libsigsegv" ,libsigsegv)))
345 (arguments
346 `(#:configure-flags '(,@(if (string-prefix? "armhf-linux"
347 (or (%current-system)
348 (%current-target-system)))
349 '("CFLAGS=-falign-functions=4")
350 '())
351 "--with-dynamic-ffi"
352 "--with-dynamic-modules"
353 "--with-ffcall"
354 "--with-readline"
355 "--with-sigsegv"
356 "--with-module=asdf"
357 "--with-module=rawsock")
358 #:phases
359 (modify-phases %standard-phases
360 (add-after 'unpack 'patch-sh-and-pwd
361 (lambda _
362 ;; The package is very messy with its references to "/bin/sh" and
363 ;; some other absolute paths to traditional tools. These appear in
364 ;; many places where our automatic patching misses them. Therefore
365 ;; we do the following, in this early (post-unpack) phase, to solve
366 ;; the problem from its root.
367 (substitute* '("src/clisp-link.in"
368 "src/unix.d"
369 "src/makemake.in")
370 (("/bin/sh") (which "sh")))
371 (substitute* (find-files "." "configure|Makefile")
372 (("/bin/sh") "sh"))
373 (substitute* '("src/clisp-link.in")
374 (("/bin/pwd") "pwd"))
375 #t))
376 (add-after 'unpack 'replace-asdf
377 ;; Use system ASDF instead of bundled one.
378 (lambda* (#:key inputs #:allow-other-keys)
379 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
380 (guix-asdf (string-append
381 cl-asdf
382 "/share/common-lisp/source/asdf/asdf.lisp"))
383 (contrib-asdf "modules/asdf/asdf.lisp"))
384 (delete-file contrib-asdf)
385 (copy-file guix-asdf contrib-asdf)))))))
386 (native-search-paths
387 (list (search-path-specification
388 (variable "XDG_DATA_DIRS")
389 (files '("share")))
390 (search-path-specification
391 (variable "XDG_CONFIG_DIRS")
392 (files '("etc")))))
393 (home-page "https://clisp.sourceforge.io/")
394 (synopsis "A Common Lisp implementation")
395 (description
396 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
397 high-level, object-oriented functional programming language. CLISP includes
398 an interpreter, a compiler, a debugger, and much more.")
399 (license license:gpl2+)))
400
401 (define-public sbcl
402 (package
403 (name "sbcl")
404 (version "2.1.5")
405 (source
406 (origin
407 (method url-fetch)
408 (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
409 version "-source.tar.bz2"))
410 (sha256
411 (base32 "1id8r2y8hiz34lmvszikdqgrmr778jshim0fibb915assvn0fn4n"))))
412 (build-system gnu-build-system)
413 (outputs '("out" "doc"))
414 (native-inputs
415 ;; From INSTALL:
416 ;; Supported build hosts are:
417 ;; SBCL
418 ;; CMUCL
419 ;; CCL (formerly known as OpenMCL)
420 ;; ABCL (recent versions only)
421 ;; CLISP (only some versions: 2.44.1 is OK, 2.47 is not)
422 ;; XCL
423 ;;
424 ;; From NEWS:
425 ;; * build enhancement: new host quirks mechanism, support for building under
426 ;; ABCL and ECL (as well as CCL, CMUCL, CLISP and SBCL itself)
427 ;;
428 ;; CCL is not bootstrappable so it won't do. CLISP 2.49 seems to work.
429 ;; ECL too. As of 2020-07-01, ECL was last updated in 2020 while CLISP
430 ;; was last updated in 2010, and both take about the same time to build SBCL.
431 ;;
432 ;; For now we stick to CLISP for all systems. We keep the `match' here
433 ;; to make it easier to change the host compiler for various
434 ;; architectures. Consider switching to ECL if it gets faster than CLISP
435 ;; (maybe post 2020 release).
436 `(,@(match (%current-system)
437 ((or "x86_64-linux" "i686-linux")
438 `(("clisp" ,clisp)))
439 (_
440 `(("clisp" ,clisp))))
441 ("cl-asdf" ,cl-asdf)
442 ("ed" ,ed)
443 ("inetutils" ,inetutils) ;for hostname(1)
444 ("texinfo" ,texinfo)
445 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
446 ("which" ,which)
447 ("zlib" ,zlib)))
448 (arguments
449 `(#:modules ((guix build gnu-build-system)
450 (guix build utils)
451 (srfi srfi-1))
452 #:phases
453 (modify-phases %standard-phases
454 (delete 'configure)
455 (add-after 'unpack 'replace-asdf
456 ;; SBCL developers have not committed to keeping ASDF up to date
457 ;; due to breaking changes [1]. Guix can handle this situation
458 ;; easily, and it behooves us to have more control over what version
459 ;; of ASDF we use to build software; therefore, replace the contrib
460 ;; ASDF with the version packaged into Guix.
461 ;; [1] - https://bugs.launchpad.net/sbcl/+bug/1823442
462 (lambda* (#:key inputs #:allow-other-keys)
463 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
464 (guix-asdf (string-append
465 cl-asdf
466 "/share/common-lisp/source/asdf/asdf.lisp"))
467 (contrib-asdf "contrib/asdf/asdf.lisp"))
468 (copy-file guix-asdf contrib-asdf))
469 #t))
470 (add-before 'build 'patch-unix-tool-paths
471 (lambda* (#:key outputs inputs #:allow-other-keys)
472 (let ((out (assoc-ref outputs "out"))
473 (bash (assoc-ref inputs "bash"))
474 (coreutils (assoc-ref inputs "coreutils"))
475 (ed (assoc-ref inputs "ed")))
476 (define (quoted-path input path)
477 (string-append "\"" input path "\""))
478 ;; Patch absolute paths in string literals. Note that this
479 ;; occurs in some .sh files too (which contain Lisp code). Use
480 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
481 (with-fluids ((%default-port-encoding #f))
482 ;; The removed file is utf-16-be encoded, which gives substitute*
483 ;; trouble. It does not contain references to the listed programs.
484 (substitute* (delete
485 "./tests/data/compile-file-pos-utf16be.lisp"
486 (find-files "." "\\.(lisp|sh)$"))
487 (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
488 (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
489 (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
490 (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
491 (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
492 (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
493 ;; This one script has a non-string occurrence of /bin/sh.
494 (substitute* '("tests/foreign.test.sh")
495 ;; Leave whitespace so we don't match the shebang.
496 ((" /bin/sh ") " sh "))
497 ;; This file contains a module that can create executable files
498 ;; which depend on the presence of SBCL. It generates shell
499 ;; scripts doing "exec sbcl ..." to achieve this. We patch both
500 ;; the shebang and the reference to "sbcl", tying the generated
501 ;; executables to the exact SBCL package that generated them.
502 (substitute* '("contrib/sb-executable/sb-executable.lisp")
503 (("/bin/sh") (string-append bash "/bin/sh"))
504 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
505 ;; Disable some tests that fail in our build environment.
506 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
507 ;; This requires /etc/protocols.
508 (("\\(deftest get-protocol-by-name/error" all)
509 (string-append "#+nil ;disabled by Guix\n" all)))
510 (substitute* '("contrib/sb-posix/posix-tests.lisp")
511 ;; These assume some users/groups which we don't have.
512 (("\\(deftest pwent\\.[12]" all)
513 (string-append "#+nil ;disabled by Guix\n" all))
514 (("\\(deftest grent\\.[12]" all)
515 (string-append "#+nil ;disabled by Guix\n" all))))
516 #t))
517 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
518 ;; them in HOME, so it needs to be writeable.
519 (add-before 'build 'set-HOME
520 (lambda _ (setenv "HOME" "/tmp") #t))
521 (replace 'build
522 (lambda* (#:key outputs #:allow-other-keys)
523 (setenv "CC" "gcc")
524 (invoke "sh" "make.sh" ,@(match (%current-system)
525 ((or "x86_64-linux" "i686-linux")
526 `("clisp"))
527 (_
528 `("clisp")))
529 (string-append "--prefix="
530 (assoc-ref outputs "out"))
531 "--dynamic-space-size=3072"
532 "--with-sb-core-compression"
533 "--with-sb-xref-for-internals")))
534 (replace 'install
535 (lambda _
536 (invoke "sh" "install.sh")))
537 (add-after 'build 'build-doc
538 (lambda _
539 ;; TODO: Doc is not deterministic, maybe there is a timespamp?
540 (with-directory-excursion "doc/manual"
541 (and (invoke "make" "info")
542 (invoke "make" "dist")))))
543 (add-after 'build 'build-source
544 (lambda* (#:key outputs #:allow-other-keys)
545 (let* ((out (assoc-ref outputs "out"))
546 (rc (string-append out "/lib/sbcl/sbclrc"))
547 (source-dir (string-append out "/share/sbcl")))
548 (for-each (lambda (p)
549 (copy-recursively p (string-append source-dir "/" p)))
550 '("src" "contrib"))
551 (mkdir-p (dirname rc))
552 (with-output-to-file rc
553 (lambda ()
554 (display
555 (string-append "(sb-ext:set-sbcl-source-location \""
556 source-dir "\")") )))
557 #t)))
558 (add-after 'install 'install-doc
559 (lambda* (#:key outputs #:allow-other-keys)
560 (let* ((out (assoc-ref outputs "out"))
561 (doc (assoc-ref outputs "doc"))
562 (old-doc-dir (string-append out "/share/doc"))
563 (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
564 (rmdir (string-append old-doc-dir "/sbcl/html"))
565 (mkdir-p new-doc/sbcl-dir)
566 (copy-recursively (string-append old-doc-dir "/sbcl")
567 new-doc/sbcl-dir)
568 (delete-file-recursively old-doc-dir)
569 #t))))
570 ;; No 'check' target, though "make.sh" (build phase) runs tests.
571 #:tests? #f))
572 (native-search-paths
573 (list (search-path-specification
574 (variable "XDG_DATA_DIRS")
575 (files '("share")))
576 (search-path-specification
577 (variable "XDG_CONFIG_DIRS")
578 (files '("etc")))))
579 (home-page "http://www.sbcl.org/")
580 (synopsis "Common Lisp implementation")
581 (description "Steel Bank Common Lisp (SBCL) is a high performance Common
582 Lisp compiler. In addition to the compiler and runtime system for ANSI Common
583 Lisp, it provides an interactive environment including a debugger, a
584 statistical profiler, a code coverage tool, and many other extensions.")
585 ;; Public domain in jurisdictions that allow it, bsd-2 otherwise. MIT
586 ;; loop macro has its own license. See COPYING file for further notes.
587 (license (list license:public-domain license:bsd-2
588 (license:x11-style "file://src/code/loop.lisp")))))
589
590 (define-public ccl
591 ;; Warning: according to upstream, CCL is not bootstrappable.
592 ;; See https://github.com/Clozure/ccl/issues/222 from 2019-09-02:
593 ;;
594 ;; "As far as I know, there is no way to build CCL without an existing
595 ;; running CCL image. It was bootstrapped back in 1986 or so as
596 ;; Macintosh Common Lisp, by Gary Byers, I believe, who is no longer on
597 ;; the planet to tell us the story. It SHOULD be possible to port the
598 ;; CCL compiler to portable Common Lisp, so that ANY lisp could build
599 ;; it, as is the case for SBCL, but I know of no attempt to do so."
600 (package
601 (name "ccl")
602 ;; XXX When updating this package, check whether we can simply append
603 ;; VERSION to the ccl-bootstrap URL again, instead of per architecture.
604 (version "1.12.1")
605 (source (origin
606 (method git-fetch)
607 (uri (git-reference
608 (url "https://github.com/Clozure/ccl/")
609 (commit (string-append "v" version))))
610 (file-name (git-file-name "ccl" version))
611 (sha256
612 (base32
613 "1zz291lvsrr7pps8wfl2kdxsnzjngqi4v3mil14pga4r5zanmsi7"))))
614 (build-system gnu-build-system)
615 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
616 ;; shipped in precompiled form in source tarballs. The former is a C
617 ;; program which we can rebuild from scratch, but the latter cannot be
618 ;; generated without an already working copy of CCL, and is platform
619 ;; dependent, so we need to fetch the correct tarball for the platform.
620 (inputs
621 `(("ccl-bootstrap"
622 ,(origin
623 (method url-fetch)
624 (uri (string-append
625 "https://github.com/Clozure/ccl/releases/download/v"
626 (match (%current-system)
627 ("armhf-linux" "1.12/linuxarm")
628 ;; XXX: This source only works on x86, but provide it as a
629 ;; catch-all to prevent errors when querying this package
630 ;; on unsupported platforms.
631 (_ "1.12.1/linuxx86"))
632 ".tar.gz"))
633 (sha256
634 (base32
635 (match (%current-system)
636 ("armhf-linux"
637 "0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
638 (_ "0ll017ajcfsyx8f7zsy4394y8xxvz40iz0gcsmznp0n3mf0xi67c"))))))))
639 (native-inputs
640 `(("cl-asdf" ,cl-asdf)
641 ("m4" ,m4)))
642 (arguments
643 `(#:tests? #f ;no 'check' target
644 #:modules ((ice-9 match)
645 (srfi srfi-26)
646 (guix build utils)
647 (guix build gnu-build-system))
648 #:phases
649 (modify-phases %standard-phases
650 (add-after 'unpack 'unpack-image
651 (lambda* (#:key inputs #:allow-other-keys)
652 (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
653 (add-after 'unpack 'replace-asdf
654 ;; Use system ASDF instead of bundled one.
655 (lambda* (#:key inputs #:allow-other-keys)
656 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
657 (guix-asdf (string-append
658 cl-asdf
659 "/share/common-lisp/source/asdf/asdf.lisp"))
660 (contrib-asdf "tools/asdf.lisp"))
661 (delete-file contrib-asdf)
662 (copy-file guix-asdf contrib-asdf))))
663 (delete 'configure)
664 (add-before 'build 'pre-build
665 ;; Enter the source directory for the current platform's lisp
666 ;; kernel, and run 'make clean' to remove the precompiled one.
667 (lambda* (#:key system #:allow-other-keys)
668 (substitute* "lisp-kernel/m4macros.m4"
669 (("/bin/pwd") (which "pwd")))
670 (chdir (string-append
671 "lisp-kernel/"
672 (match system
673 ("i686-linux" "linuxx8632")
674 ("x86_64-linux" "linuxx8664")
675 ("armhf-linux" "linuxarm")
676 (_ (string-append "unknown system: " system)))))
677 (substitute* '("Makefile")
678 (("/bin/rm") "rm"))
679 (setenv "CC" "gcc")
680 (invoke "make" "clean")))
681 ;; XXX Do we need to recompile the heap image as well for Guix?
682 ;; For now just use the one we already got in the tarball.
683 (replace 'install
684 (lambda* (#:key outputs inputs system #:allow-other-keys)
685 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
686 ;; is put back into the original directory, so go back. The heap
687 ;; image is there as well.
688 (chdir "../..")
689 (let* ((out (assoc-ref outputs "out"))
690 (libdir (string-append out "/lib/"))
691 (bindir (string-append out "/bin/"))
692 (wrapper (string-append bindir "ccl"))
693 (bash (assoc-ref inputs "bash"))
694 (kernel
695 (match system
696 ("i686-linux" "lx86cl")
697 ("x86_64-linux" "lx86cl64")
698 ("armhf-linux" "armcl")
699 ;; Unlikely to work, but try it anyway...
700 (_ system)))
701 (heap (string-append kernel ".image")))
702 (install-file kernel libdir)
703 (install-file heap libdir)
704
705 (let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
706 ,@(match system
707 ("x86_64-linux"
708 '("x86-headers64"))
709 ("i686-linux"
710 '("x86-headers"))
711 (_ '())))))
712 (for-each copy-recursively
713 dirs
714 (map (cut string-append libdir <>) dirs)))
715
716 (mkdir-p bindir)
717 (with-output-to-file wrapper
718 (lambda ()
719 (display
720 (string-append
721 "#!" bash "/bin/sh\n"
722 "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
723 "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
724 (chmod wrapper #o755))
725 #t)))))
726 (native-search-paths
727 (list (search-path-specification
728 (variable "XDG_DATA_DIRS")
729 (files '("share")))
730 (search-path-specification
731 (variable "XDG_CONFIG_DIRS")
732 (files '("etc")))))
733 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
734 (home-page "https://ccl.clozure.com/")
735 (synopsis "Common Lisp implementation")
736 (description "Clozure CL (often called CCL for short) is a Common Lisp
737 implementation featuring fast compilation speed, native threads, a precise,
738 generational, compacting garbage collector, and a convenient foreign-function
739 interface.")
740 (license license:asl2.0)))
741
742 (define-public lush2
743 (package
744 (name "lush2")
745 (version "2.0.1")
746 (source
747 (origin
748 (method url-fetch)
749 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
750 version ".tar.gz"))
751 (modules '((guix build utils)))
752 (snippet
753 '(begin
754 (substitute* "src/unix.c"
755 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
756 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
757 (substitute* "src/main.c"
758 (("\" \\(built \" __DATE__ \"\\)\"") ""))
759 #t))
760 (sha256
761 (base32
762 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
763 (build-system gnu-build-system)
764 (arguments
765 `(;; We have to add these LIBS so that they are found.
766 #:configure-flags (list "LIBS=-lz"
767 "X_EXTRA_LIBS=-lfontconfig"
768 "--with-x")
769 #:tests? #f)) ; No make check.
770 (native-inputs `(("intltool" ,intltool)))
771 (inputs
772 `(("alsa-lib" ,alsa-lib)
773 ("sdl" ,sdl)
774 ("sdl-image" ,sdl-image)
775 ("sdl-mixer" ,sdl-mixer)
776 ("sdl-net" ,sdl-net)
777 ("sdl-ttf" ,sdl-ttf)
778 ("lapack" ,lapack)
779 ("libxft" ,libxft)
780 ("fontconfig" ,fontconfig)
781 ("gsl" ,gsl)
782 ("openblas" ,openblas)
783 ("glu" ,glu)
784 ("mesa" ,mesa)
785 ("mesa-utils" ,mesa-utils)
786 ("binutils" ,binutils)
787 ("libiberty" ,libiberty)
788 ("readline" ,readline)
789 ("zlib" ,zlib)
790 ("gettext-minimal" ,gettext-minimal)))
791 (synopsis "Lisp Universal Shell")
792 (description
793 "Lush is an object-oriented Lisp interpreter/compiler with features
794 designed to please people who want to prototype large numerical
795 applications. Lush includes an extensive library of
796 vector/matrix/tensor manipulation, numerous numerical libraries
797 (including GSL, LAPACK, and BLAS), a set of graphic functions, a
798 simple GUI toolkit, and interfaces to various graphic and multimedia
799 libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
800 grabbing), and others. Lush is an ideal frontend script language for
801 programming projects written in C or other languages. Lush also has
802 libraries for Machine Learning, Neural Nets and statistical estimation.")
803 (home-page "http://lush.sourceforge.net/")
804 (license license:lgpl2.1+)))
805
806 (define-public confusion-mdl
807 (let* ((commit "12a055581fc262225272df43287dae48281900f5"))
808 (package
809 (name "confusion-mdl")
810 (version "0.2")
811 (source (origin
812 (method git-fetch)
813 (uri (git-reference
814 (url (string-append "https://gitlab.com/emacsomancer/" name))
815 (commit commit)))
816 (sha256
817 (base32
818 "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d"))
819 (file-name (git-file-name name version))))
820 (build-system gnu-build-system)
821 (arguments
822 `(#:tests? #f ; there are no tests
823 #:phases
824 (modify-phases %standard-phases
825 (delete 'configure)
826 (replace 'build
827 (lambda* (#:key (make-flags '()) #:allow-other-keys)
828 (apply invoke "make" "CC=gcc" make-flags)))
829 (replace 'install
830 (lambda* (#:key outputs #:allow-other-keys)
831 (let* ((out (assoc-ref outputs "out"))
832 (bin (string-append out "/bin")))
833 (install-file "mdli" bin)
834 #t))))))
835 (native-inputs
836 `(("perl" ,perl)))
837 (inputs
838 `(("libgc" ,libgc)))
839 (synopsis "Interpreter for the MIT Design Language (MDL)")
840 (description "MDL (the MIT Design Language) is a descendant of Lisp. It
841 was originally developed in 1971 on the PDP-10 computer under the Incompatible
842 Timesharing System (ITS) to provide high level language support for the
843 Dynamic Modeling Group at MIT's Project MAC. Infocom built the original
844 PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was
845 based on a subset of MDL. Confusion is a MDL interpreter that works just well
846 enough to play the original mainframe Zork all the way through.")
847 (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README")
848 (license license:gpl3+))))
849
850 (define-public txr
851 (package
852 (name "txr")
853 (version "259")
854 (source
855 (origin
856 (method git-fetch)
857 (uri (git-reference
858 (url "http://www.kylheku.com/git/txr/")
859 (commit (string-append "txr-" version))))
860 (file-name (git-file-name name version))
861 (sha256
862 (base32 "1awg6l458pl2y340l0vja2j5q636vh2mx2mllxqydg36j89lfniz"))))
863 (build-system gnu-build-system)
864 (arguments
865 `(#:configure-flags
866 (list ,(string-append "cc=" (cc-for-target))
867 (string-append "--prefix=" (assoc-ref %outputs "out")))
868 #:test-target "tests"
869 #:phases
870 (modify-phases %standard-phases
871 (replace 'configure
872 ;; ./configure is a hand-written script that can't handle standard
873 ;; autotools arguments like CONFIG_SHELL.
874 (lambda* (#:key configure-flags #:allow-other-keys)
875 (setenv "txr_shell" (which "bash"))
876 (apply invoke "./configure" configure-flags)
877 #t))
878 (add-after 'configure 'fix-tests
879 (lambda _
880 (substitute* (list "tests/017/realpath.tl"
881 "tests/017/realpath.expected")
882 (("/usr/bin") "/"))
883 #t)))))
884 (inputs
885 `(("libffi" ,libffi)))
886 (synopsis "General-purpose, multi-paradigm programming language")
887 (description
888 "TXR is a general-purpose, multi-paradigm programming language. It
889 comprises two languages integrated into a single tool: a text scanning and
890 extraction language referred to as the TXR Pattern Language (sometimes just
891 \"TXR\"), and a general-purpose dialect of Lisp called TXR Lisp. TXR can be
892 used for everything from \"one liner\" data transformation tasks at the
893 command line, to data scanning and extracting scripts, to full application
894 development in a wide-range of areas.")
895 (home-page "https://nongnu.org/txr/")
896 (license license:bsd-2)))
897
898 (define picolisp32
899 (package
900 (name "picolisp32")
901 (version "19.12")
902 (source
903 (origin
904 (method url-fetch)
905 (uri (string-append "https://software-lab.de/picoLisp-" version ".tgz"))
906 (sha256
907 (base32 "10np0mhihr47r3201617zccrvzpkhdl1jwvz7zimk8kxpriydq2j"))
908 (modules '((guix build utils)))
909 (snippet '(begin
910 ;; Delete the pre-compiled jar file.
911 (delete-file "ersatz/picolisp.jar")
912 #t))))
913 (build-system gnu-build-system)
914 (inputs
915 `(("openssl" ,openssl)))
916 (arguments
917 `(#:system ,(match (%current-system)
918 ((or "armhf-linux" "aarch64-linux")
919 "armhf-linux")
920 (_
921 "i686-linux"))
922 #:phases
923 (modify-phases %standard-phases
924 (delete 'configure)
925 (add-after 'unpack 'fix-paths
926 (lambda* (#:key outputs #:allow-other-keys)
927 (let* ((out (assoc-ref outputs "out"))
928 (shebang-line (string-append
929 "#!" out "/bin/picolisp "
930 out "/lib/picolisp/lib.l")))
931 (substitute* '("bin/pil"
932 "bin/pilIndent"
933 "bin/pilPretty"
934 "bin/psh"
935 "bin/replica"
936 "bin/vip"
937 "bin/watchdog"
938 "games/xchess"
939 "misc/bigtest"
940 "misc/calc"
941 "misc/chat"
942 "misc/mailing"
943 "src/mkVers")
944 (("#\\!bin/picolisp lib.l")
945 shebang-line)
946 (("#\\!\\.\\./bin/picolisp \\.\\./lib.l")
947 shebang-line)
948 (("#\\!/usr/bin/picolisp /usr/lib/picolisp/lib.l")
949 shebang-line)))
950 #t))
951 (add-after 'fix-paths 'make-build-reproducible
952 (lambda _
953 (substitute* "src64/lib/asm.l"
954 (("\\(prinl \"/\\* \" \\(datSym \\(date\\)\\) \" \\*/\\)")
955 ""))
956 #t))
957 (add-after 'make-build-reproducible 'fix-permissions
958 (lambda _
959 (for-each make-file-writable
960 '("doc/family.tgz"
961 "doc/family64.tgz"
962 "lib/map"
963 "src64/tags"))
964 #t))
965 (replace 'build
966 (lambda _
967 (invoke "make" "-C" "src" "picolisp" "tools" "gate")))
968 (add-before 'check 'set-home-for-tests
969 (lambda _
970 (setenv "HOME" "/tmp")
971 #t))
972 (replace 'check
973 (lambda _
974 (invoke "./pil" "test/lib.l" "-bye" "+")))
975 (replace 'install
976 (lambda* (#:key outputs #:allow-other-keys)
977 (let* ((out (assoc-ref outputs "out"))
978 (bin (string-append out "/bin"))
979 (man (string-append out "/share/man"))
980 (picolisp (string-append out "/lib/picolisp")))
981 (copy-recursively "man" man)
982 (copy-recursively "." picolisp)
983 (for-each (lambda (name)
984 (let ((path (string-append picolisp "/" name)))
985 (delete-file-recursively path)))
986 '("CHANGES" "COPYING" "CREDITS" "cygwin"
987 "INSTALL" "man" "pil" "README" "src" "src64"
988 "test"))
989 (mkdir-p bin)
990 (symlink (string-append picolisp "/bin/picolisp")
991 (string-append bin "/picolisp"))
992 (symlink (string-append picolisp "/bin/pil")
993 (string-append bin "/pil")))
994 #t)))))
995 (synopsis "Interpreter for the PicoLisp programming language")
996 (description
997 "PicoLisp is a programming language, or really a programming system,
998 including a built-in database engine and a GUI system.")
999 (home-page "https://picolisp.com/wiki/?home")
1000 (license license:expat)))
1001
1002 (define-public picolisp
1003 (match (%current-system)
1004 ((or "aarch64-linux" "x86_64-linux")
1005 (package
1006 ;; Use the 32-bit picolisp to generate the assembly files required by
1007 ;; the 64-bit picolisp.
1008 (inherit picolisp32)
1009 (name "picolisp")
1010 (native-inputs
1011 `(("picolisp32" ,picolisp32)
1012 ("which" ,which)))
1013 (arguments
1014 (substitute-keyword-arguments (package-arguments picolisp32)
1015 ((#:system _ "") (%current-system))
1016 ((#:phases phases)
1017 `(modify-phases ,phases
1018 (delete 'fix-paths)
1019 (add-before 'build 'fix-paths
1020 ;; This must run after the other shebang-patching phases,
1021 ;; or they will override our changes.
1022 (lambda* (#:key inputs outputs #:allow-other-keys)
1023 (let* ((picolisp32 (assoc-ref inputs "picolisp32"))
1024 (out (assoc-ref outputs "out"))
1025 (shebang-line (string-append
1026 "#!" out "/bin/picolisp "
1027 out "/lib/picolisp/lib.l")))
1028 (substitute* '("bin/pil"
1029 "bin/pilIndent"
1030 "bin/pilPretty"
1031 "bin/psh"
1032 "bin/replica"
1033 "bin/vip"
1034 "bin/watchdog"
1035 "games/xchess"
1036 "misc/bigtest"
1037 "misc/calc"
1038 "misc/chat"
1039 "misc/mailing"
1040 "src/mkVers")
1041 (("#\\!.*picolisp32.*/bin/picolisp .*lib\\.l")
1042 shebang-line))
1043 (substitute* "src64/mkAsm"
1044 (("/usr/bin/")
1045 (string-append picolisp32 "/bin/"))))
1046 #t))
1047 (replace 'build
1048 (lambda _
1049 (invoke "make" "-C" "src" "tools" "gate")
1050 (invoke "make" "-C" "src64" "CC=gcc" "picolisp")))))))))
1051 (_
1052 (package
1053 (inherit picolisp32)
1054 (name "picolisp")))))
1055
1056 (define-public janet
1057 (package
1058 (name "janet")
1059 (version "1.15.5")
1060 (source
1061 (origin
1062 (method git-fetch)
1063 (uri (git-reference
1064 (url "https://github.com/janet-lang/janet")
1065 (commit (string-append "v" version))))
1066 (file-name (git-file-name name version))
1067 (sha256
1068 (base32 "0gl0p3x0ylj4hxiwjclg1waxq8csadw60qw6pa9h5y4w1bcqffmk"))
1069 (build-system gnu-build-system)
1070 (arguments
1071 `(#:make-flags (list
1072 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
1073 (string-append "PREFIX=")
1074 (string-append "CC=" (assoc-ref %build-inputs "gcc")
1075 "/bin/gcc"))
1076 #:test-target "test"
1077 #:phases
1078 (modify-phases %standard-phases
1079 (delete 'configure))))
1080 (home-page "https://janet-lang.org/")
1081 (synopsis "Functional, imperative and embeddable programming language")
1082 (description
1083 "Janet is a functional and imperative programming language. It can be
1084 used for rapid prototyping, dynamic systems, and other domains where dynamic
1085 languages shine. You can also add Janet scripting to an application by
1086 embedding a single C file and two headers. It can be easily ported to new
1087 platforms. The entire language (core library, interpreter, compiler,
1088 assembler, PEG) is less than 1MB.")
1089 (license license:expat)))
1090
1091 (define-public lisp-repl-core-dumper
1092 (package
1093 (name "lisp-repl-core-dumper")
1094 (version "0.7.0")
1095 (source
1096 (origin
1097 (method git-fetch)
1098 (uri (git-reference
1099 (url "https://gitlab.com/ambrevar/lisp-repl-core-dumper.git")
1100 (commit version)))
1101 (file-name (git-file-name name version))
1102 (sha256
1103 (base32 "0yfsyxj462yi3bx587yssp4gwb54jdm6fjk9q93gjrfv8a65ilp7"))))
1104 (build-system copy-build-system)
1105 (arguments
1106 '(#:install-plan
1107 '(("lisp-repl-core-dumper" "bin/"))
1108 #:phases
1109 (modify-phases %standard-phases
1110 (add-before 'install 'fix-utils-path
1111 (lambda* (#:key inputs #:allow-other-keys)
1112 (let* ((coreutils (string-append (assoc-ref inputs "coreutils") "/bin/"))
1113 (cat (string-append coreutils "cat"))
1114 (paste (string-append coreutils "paste"))
1115 (sort (string-append coreutils "sort"))
1116 (basename (string-append coreutils "basename"))
1117 (sed (string-append (assoc-ref inputs "sed") "/bin/sed")))
1118 (substitute* "lisp-repl-core-dumper"
1119 (("\\$\\(basename") (string-append "$(" basename))
1120 (("\\<cat\\>") cat)
1121 (("\\<paste\\>") paste)
1122 (("\\<sed\\>") sed)
1123 (("\\<sort\\>") sort))))))))
1124 (inputs
1125 `(("coreutils" ,coreutils-minimal)
1126 ("sed" ,sed)))
1127 (home-page "https://gitlab.com/ambrevar/lisp-repl-core-dumper")
1128 (synopsis "Generate REPL-optimized Lisp cores on demand")
1129 (description
1130 "This tool generates Lisp images that can embed the provided systems
1131 and make for REPLs that start blazing fast.
1132
1133 @itemize
1134 @item It’s portable and should work with any compiler.
1135 @item It works for any REPL.
1136 @item It allows you to include arbitrary libraries.
1137 @end itemize\n")
1138 (license license:gpl3+)))
1139
1140 (define-public buildapp
1141 (package
1142 (name "buildapp")
1143 (version "1.5.6")
1144 (source
1145 (origin
1146 (method git-fetch)
1147 (uri (git-reference
1148 (url "https://github.com/xach/buildapp")
1149 (commit (string-append "release-" version))))
1150 (file-name (git-file-name name version))
1151 (sha256
1152 (base32 "020ipjfqa3l8skd97cj5kq837wgpj28ygfxnkv64cnjrlbnzh161"))))
1153 (build-system gnu-build-system)
1154 (native-inputs
1155 `(("sbcl" ,sbcl)))
1156 (arguments
1157 `(#:tests? #f
1158 #:make-flags
1159 (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
1160 #:strip-binaries? #f
1161 #:phases
1162 (modify-phases %standard-phases
1163 (delete 'configure)
1164 (add-after 'unpack 'set-home
1165 (lambda _
1166 (setenv "HOME" "/tmp")
1167 #t))
1168 (add-before 'install 'create-target-directory
1169 (lambda* (#:key outputs #:allow-other-keys)
1170 (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
1171 (mkdir-p bin)
1172 #t))))))
1173 (home-page "https://www.xach.com/lisp/buildapp/")
1174 (synopsis "Makes easy to build application executables with SBCL")
1175 (description
1176 "Buildapp is an application for SBCL or CCL that configures and saves an
1177 executable Common Lisp image. It is similar to cl-launch and hu.dwim.build. ")
1178 (license license:bsd-2)))