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