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