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