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