summaryrefslogtreecommitdiff
path: root/gnu/packages/lisp.scm
diff options
context:
space:
mode:
authorGuillaume Le Vaillant <glv@posteo.net>2024-05-30 15:28:26 +0200
committerGuillaume Le Vaillant <glv@posteo.net>2024-06-07 09:35:40 +0200
commit2f6bc7696edc8425997c343dd59c4e8643ea5ee1 (patch)
tree9f6fc470fdd28a46cfe0f62145ff55996a2be480 /gnu/packages/lisp.scm
parentd8bc7e18458eeb3510645660aaa2d3b5b990b471 (diff)
gnu: lisp: Sort packages.
* gnu/packages/lisp.scm: Sort packages. Change-Id: I5841189c04be6eff3af77e1e72b100db1b1bbf40
Diffstat (limited to 'gnu/packages/lisp.scm')
-rw-r--r--gnu/packages/lisp.scm1953
1 files changed, 976 insertions, 977 deletions
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 70b7bf307f4..ccc931c185c 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -106,6 +106,267 @@
106 #:use-module (ice-9 match) 106 #:use-module (ice-9 match)
107 #:use-module (srfi srfi-1)) 107 #:use-module (srfi srfi-1))
108 108
109(define-public buildapp
110 (package
111 (name "buildapp")
112 (version "1.5.6")
113 (source
114 (origin
115 (method git-fetch)
116 (uri (git-reference
117 (url "https://github.com/xach/buildapp")
118 (commit (string-append "release-" version))))
119 (file-name (git-file-name name version))
120 (sha256
121 (base32 "020ipjfqa3l8skd97cj5kq837wgpj28ygfxnkv64cnjrlbnzh161"))))
122 (build-system gnu-build-system)
123 (native-inputs
124 (list sbcl))
125 (arguments
126 `(#:tests? #f
127 #:make-flags
128 (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
129 #:strip-binaries? #f
130 #:phases
131 (modify-phases %standard-phases
132 (delete 'configure)
133 (add-after 'unpack 'set-home
134 (lambda _
135 (setenv "HOME" "/tmp")
136 #t))
137 (add-before 'install 'create-target-directory
138 (lambda* (#:key outputs #:allow-other-keys)
139 (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
140 (mkdir-p bin)
141 #t))))))
142 (home-page "https://www.xach.com/lisp/buildapp/")
143 (synopsis "Makes easy to build application executables with SBCL")
144 (description
145 "Buildapp is an application for SBCL or CCL that configures and saves an
146executable Common Lisp image. It is similar to cl-launch and hu.dwim.build.")
147 (license license:bsd-2)))
148
149(define-public carp
150 ;; Release 0.5.5 does not support GHC 9.2.
151 (let ((commit "339722325ec607091f6035866ebedea2b69080fe")
152 (revision "1"))
153 (package
154 (name "carp")
155 (version (git-version "0.5.5" revision commit))
156 (source (origin
157 (method git-fetch)
158 (uri (git-reference
159 (url "https://github.com/carp-lang/Carp")
160 (commit commit)))
161 (file-name (git-file-name name version))
162 (sha256
163 (base32
164 "0w0j3imi4270dsmrh96spsc9xllsk5rrh817l80q1nyay9p53xwd"))))
165 (build-system haskell-build-system)
166 (arguments
167 (list #:phases
168 #~(modify-phases %standard-phases
169 ;; Carp looks inside the sources checkout to know where to
170 ;; find its core libraries and other files.
171 ;; Carp emits C code and tries to compile it with an external
172 ;; C compiler. On Linux it defaults to Clang.
173 (add-after 'install 'wrap-programs
174 (lambda* (#:key inputs #:allow-other-keys)
175 (define (wrap-carp-program program)
176 (wrap-program (string-append
177 #$output "/bin/" program)
178 `("CARP_DIR" prefix
179 (#$(package-source this-package)))
180 `("PATH" prefix
181 ,(list (dirname
182 (search-input-file inputs "bin/clang"))
183 (dirname
184 (search-input-file inputs "bin/ld"))))
185 `("C_INCLUDE_PATH" prefix
186 ,(list (dirname
187 (search-input-directory
188 inputs "include/linux"))
189 (dirname
190 (search-input-file
191 inputs "include/stdlib.h"))))))
192
193 (for-each wrap-carp-program
194 (list "carp"
195 "carp-header-parse")))))))
196 (inputs
197 (list bash-minimal
198 clang
199 ghc-blaze-markup
200 ghc-blaze-html
201 ghc-split
202 ghc-ansi-terminal
203 ghc-cmark
204 ghc-edit-distance
205 ghc-hashable
206 ghc-open-browser
207 ghc-optparse-applicative))
208 (native-inputs
209 (list ghc-hunit))
210 (home-page "https://carp-lang.org/")
211 (synopsis "Statically typed Lisp without a garbage collector")
212 (description
213 "@code{carp} is a Lisp-like programming language that compiles to
214C. It features inferred static typing, macros, automatic memory
215management without a garbage collector, a REPL, and straightforward
216integration with code written in C.")
217 (license license:asl2.0))))
218
219(define-public ccl
220 ;; Warning: according to upstream, CCL is not bootstrappable.
221 ;; See https://github.com/Clozure/ccl/issues/222 from 2019-09-02:
222 ;;
223 ;; "As far as I know, there is no way to build CCL without an existing
224 ;; running CCL image. It was bootstrapped back in 1986 or so as
225 ;; Macintosh Common Lisp, by Gary Byers, I believe, who is no longer on
226 ;; the planet to tell us the story. It SHOULD be possible to port the
227 ;; CCL compiler to portable Common Lisp, so that ANY lisp could build
228 ;; it, as is the case for SBCL, but I know of no attempt to do so."
229 (package
230 (name "ccl")
231 ;; XXX When updating this package, check whether we can simply append
232 ;; VERSION to the ccl-bootstrap URL again, instead of per architecture.
233 (version "1.12.1")
234 (source (origin
235 (method git-fetch)
236 (uri (git-reference
237 (url "https://github.com/Clozure/ccl/")
238 (commit (string-append "v" version))))
239 (file-name (git-file-name "ccl" version))
240 (sha256
241 (base32
242 "1zz291lvsrr7pps8wfl2kdxsnzjngqi4v3mil14pga4r5zanmsi7"))))
243 (build-system gnu-build-system)
244 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
245 ;; shipped in precompiled form in source tarballs. The former is a C
246 ;; program which we can rebuild from scratch, but the latter cannot be
247 ;; generated without an already working copy of CCL, and is platform
248 ;; dependent, so we need to fetch the correct tarball for the platform.
249 (inputs
250 `(("ccl-bootstrap"
251 ,(origin
252 (method url-fetch)
253 (uri (string-append
254 "https://github.com/Clozure/ccl/releases/download/v"
255 (match (%current-system)
256 ("armhf-linux" "1.12/linuxarm")
257 ;; XXX: This source only works on x86, but provide it as a
258 ;; catch-all to prevent errors when querying this package
259 ;; on unsupported platforms.
260 (_ "1.12.1/linuxx86"))
261 ".tar.gz"))
262 (sha256
263 (base32
264 (match (%current-system)
265 ("armhf-linux"
266 "0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
267 (_ "0ll017ajcfsyx8f7zsy4394y8xxvz40iz0gcsmznp0n3mf0xi67c"))))))))
268 (native-inputs
269 (list cl-asdf m4))
270 (arguments
271 `(#:tests? #f ;no 'check' target
272 #:modules ((ice-9 match)
273 (srfi srfi-26)
274 (guix build utils)
275 (guix build gnu-build-system))
276 #:phases
277 (modify-phases %standard-phases
278 (add-after 'unpack 'unpack-image
279 (lambda* (#:key inputs #:allow-other-keys)
280 (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
281 (add-after 'unpack 'replace-asdf
282 ;; Use system ASDF instead of bundled one.
283 (lambda* (#:key inputs #:allow-other-keys)
284 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
285 (guix-asdf (string-append
286 cl-asdf
287 "/share/common-lisp/source/asdf/asdf.lisp"))
288 (contrib-asdf "tools/asdf.lisp"))
289 (delete-file contrib-asdf)
290 (copy-file guix-asdf contrib-asdf))))
291 (delete 'configure)
292 (add-before 'build 'pre-build
293 ;; Enter the source directory for the current platform's lisp
294 ;; kernel, and run 'make clean' to remove the precompiled one.
295 (lambda* (#:key system #:allow-other-keys)
296 (substitute* "lisp-kernel/m4macros.m4"
297 (("/bin/pwd") (which "pwd")))
298 (chdir (string-append
299 "lisp-kernel/"
300 (match system
301 ("i686-linux" "linuxx8632")
302 ("x86_64-linux" "linuxx8664")
303 ("armhf-linux" "linuxarm")
304 (_ (string-append "unknown system: " system)))))
305 (substitute* '("Makefile")
306 (("/bin/rm") "rm"))
307 (setenv "CC" "gcc")
308 (invoke "make" "clean")))
309 ;; XXX Do we need to recompile the heap image as well for Guix?
310 ;; For now just use the one we already got in the tarball.
311 (replace 'install
312 (lambda* (#:key outputs inputs system #:allow-other-keys)
313 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
314 ;; is put back into the original directory, so go back. The heap
315 ;; image is there as well.
316 (chdir "../..")
317 (let* ((out (assoc-ref outputs "out"))
318 (libdir (string-append out "/lib/"))
319 (bindir (string-append out "/bin/"))
320 (wrapper (string-append bindir "ccl"))
321 (bash (assoc-ref inputs "bash"))
322 (kernel
323 (match system
324 ("i686-linux" "lx86cl")
325 ("x86_64-linux" "lx86cl64")
326 ("armhf-linux" "armcl")
327 ;; Unlikely to work, but try it anyway...
328 (_ system)))
329 (heap (string-append kernel ".image")))
330 (install-file kernel libdir)
331 (install-file heap libdir)
332
333 (let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
334 ,@(match system
335 ("x86_64-linux"
336 '("x86-headers64"))
337 ("i686-linux"
338 '("x86-headers"))
339 (_ '())))))
340 (for-each copy-recursively
341 dirs
342 (map (cut string-append libdir <>) dirs)))
343
344 (mkdir-p bindir)
345 (with-output-to-file wrapper
346 (lambda ()
347 (display
348 (string-append
349 "#!" bash "/bin/sh\n"
350 "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
351 "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
352 (chmod wrapper #o755))
353 #t)))))
354 (native-search-paths
355 (list (search-path-specification
356 (variable "XDG_DATA_DIRS")
357 (files '("share")))
358 (search-path-specification
359 (variable "XDG_CONFIG_DIRS")
360 (files '("etc")))))
361 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
362 (home-page "https://ccl.clozure.com/")
363 (synopsis "Common Lisp implementation")
364 (description "Clozure CL (often called CCL for short) is a Common Lisp
365implementation featuring fast compilation speed, native threads, a precise,
366generational, compacting garbage collector, and a convenient foreign-function
367interface.")
368 (license license:asl2.0)))
369
109(define-public cl-asdf 370(define-public cl-asdf
110 (package 371 (package
111 (name "cl-asdf") 372 (name "cl-asdf")
@@ -149,6 +410,276 @@ Definition Facility.")
149 ;; MIT License 410 ;; MIT License
150 (license license:expat))) 411 (license license:expat)))
151 412
413(define-public clisp
414 (package
415 (name "clisp")
416 (version "2.49-92")
417 (source
418 (origin
419 (method git-fetch)
420 (uri (git-reference
421 (url "https://gitlab.com/gnu-clisp/clisp")
422 (commit "clisp-2.49.92-2018-02-18")))
423 (file-name (git-file-name name version))
424 (sha256
425 (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb"))))
426 (build-system gnu-build-system)
427 (native-inputs
428 (list cl-asdf))
429 (inputs (list libffcall ncurses readline libsigsegv))
430 (arguments
431 `(#:configure-flags '(,@(if (string-prefix? "armhf-linux"
432 (or (%current-system)
433 (%current-target-system)))
434 '("CFLAGS=-falign-functions=4")
435 '())
436 ,@(if (target-x86-64?)
437 '("--enable-portability"
438 "--with-threads=POSIX_THREADS")
439 '())
440 "--with-dynamic-ffi"
441 "--with-dynamic-modules"
442 "--with-ffcall"
443 "--with-readline"
444 "--with-sigsegv"
445 "--with-module=asdf"
446 "--with-module=rawsock")
447 #:phases
448 (modify-phases %standard-phases
449 (add-after 'unpack 'patch-sh-and-pwd
450 (lambda _
451 ;; The package is very messy with its references to "/bin/sh" and
452 ;; some other absolute paths to traditional tools. These appear in
453 ;; many places where our automatic patching misses them. Therefore
454 ;; we do the following, in this early (post-unpack) phase, to solve
455 ;; the problem from its root.
456 (substitute* '("src/clisp-link.in"
457 "src/unix.d"
458 "src/makemake.in")
459 (("/bin/sh") (which "sh")))
460 (substitute* (find-files "." "configure|Makefile")
461 (("/bin/sh") "sh"))
462 (substitute* '("src/clisp-link.in")
463 (("/bin/pwd") "pwd"))
464 #t))
465 (add-after 'unpack 'replace-asdf
466 ;; Use system ASDF instead of bundled one.
467 (lambda* (#:key inputs #:allow-other-keys)
468 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
469 (guix-asdf (string-append
470 cl-asdf
471 "/share/common-lisp/source/asdf/asdf.lisp"))
472 (contrib-asdf "modules/asdf/asdf.lisp"))
473 (delete-file contrib-asdf)
474 (copy-file guix-asdf contrib-asdf)))))))
475 (native-search-paths
476 (list (search-path-specification
477 (variable "XDG_DATA_DIRS")
478 (files '("share")))
479 (search-path-specification
480 (variable "XDG_CONFIG_DIRS")
481 (files '("etc")))))
482 (home-page "https://clisp.sourceforge.io/")
483 (synopsis "Common Lisp implementation")
484 (description
485 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a
486high-level, object-oriented functional programming language. CLISP includes
487an interpreter, a compiler, a debugger, and much more.")
488 (license license:gpl2+)))
489
490(define-public confusion-mdl
491 (let* ((commit "12a055581fc262225272df43287dae48281900f5"))
492 (package
493 (name "confusion-mdl")
494 (version "0.2")
495 (source (origin
496 (method git-fetch)
497 (uri (git-reference
498 (url (string-append "https://gitlab.com/emacsomancer/" name))
499 (commit commit)))
500 (sha256
501 (base32
502 "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d"))
503 (file-name (git-file-name name version))))
504 (build-system gnu-build-system)
505 (arguments
506 `(#:tests? #f ; there are no tests
507 #:phases
508 (modify-phases %standard-phases
509 (delete 'configure)
510 (replace 'build
511 (lambda* (#:key (make-flags '()) #:allow-other-keys)
512 (apply invoke "make" "CC=gcc" make-flags)))
513 (replace 'install
514 (lambda* (#:key outputs #:allow-other-keys)
515 (let* ((out (assoc-ref outputs "out"))
516 (bin (string-append out "/bin")))
517 (install-file "mdli" bin)
518 #t))))))
519 (native-inputs
520 (list perl))
521 (inputs
522 (list libgc))
523 (synopsis "Interpreter for the MIT Design Language (MDL)")
524 (description "MDL (the MIT Design Language) is a descendant of Lisp. It
525was originally developed in 1971 on the PDP-10 computer under the Incompatible
526Timesharing System (ITS) to provide high level language support for the
527Dynamic Modeling Group at MIT's Project MAC. Infocom built the original
528PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was
529based on a subset of MDL. Confusion is a MDL interpreter that works just well
530enough to play the original mainframe Zork all the way through.")
531 (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README")
532 (license license:gpl3+))))
533
534(define-public ecl
535 (package
536 (name "ecl")
537 (version "24.5.10")
538 (source
539 (origin
540 (method url-fetch)
541 (uri (string-append
542 "https://ecl.common-lisp.dev/static/files/release/"
543 name "-" version ".tgz"))
544 (sha256
545 (base32 "0av2prf474cg0glr37fgsfb4w0dxfg38pykb72ay9q3132xnbsp4"))))
546 (build-system gnu-build-system)
547 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
548 (native-inputs
549 (list cl-asdf which texinfo))
550 (inputs (list bash-minimal))
551 ;; When ECL is embedded in a program that wants to use Common Lisp as an
552 ;; extension language, libgmp, libatomic-ops, libgc and libffi must be
553 ;; present when compiling the program because they are required by ECL's
554 ;; header file.
555 ;; Therefore we put these libraries in 'propagated-inputs' instead
556 ;; of 'inputs'.
557 (propagated-inputs
558 (list gmp libatomic-ops libgc libffi))
559 (arguments
560 `(#:configure-flags '("--without-rt")
561 #:parallel-tests? #f
562 #:phases
563 (modify-phases %standard-phases
564 ;; FIXME: As of version 20.4.24, we pass 17995 tests and fail 7.
565 ;; 2-3 tests may be due to FHS assumptions.
566 (delete 'check)
567 (add-after 'unpack 'replace-asdf
568 ;; Use system ASDF instead of bundled one.
569 (lambda* (#:key inputs #:allow-other-keys)
570 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
571 (guix-asdf (string-append
572 cl-asdf
573 "/share/common-lisp/source/asdf/asdf.lisp"))
574 (contrib-asdf "contrib/asdf/asdf.lisp"))
575 (copy-file guix-asdf contrib-asdf))))
576 (add-after 'install 'remove-build-stamp
577 (lambda* (#:key outputs #:allow-other-keys)
578 (delete-file (string-append (assoc-ref outputs "out")
579 "/lib/ecl-" ,version "/build-stamp"))))
580 (add-after 'remove-build-stamp 'wrap
581 (lambda* (#:key inputs outputs #:allow-other-keys)
582 (let* ((ecl (assoc-ref outputs "out"))
583 (input-path (lambda (lib path)
584 (string-append
585 (assoc-ref inputs lib) path)))
586 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc"))
587 (binaries '("gcc" "ld-wrapper" "binutils"))
588 (library-directories
589 (map (lambda (lib) (input-path lib "/lib"))
590 libraries)))
591 (wrap-program (string-append ecl "/bin/ecl")
592 `("PATH" prefix
593 ,(map (lambda (binary)
594 (input-path binary "/bin"))
595 binaries))
596 `("CPATH" suffix
597 ,(map (lambda (lib)
598 (input-path lib "/include"))
599 `("kernel-headers" ,@libraries)))
600 `("LIBRARY_PATH" suffix ,library-directories)
601 `("LD_LIBRARY_PATH" suffix ,library-directories)))))
602 (add-after 'wrap 'check (assoc-ref %standard-phases 'check))
603 (add-before 'check 'fix-path-to-ecl
604 (lambda _
605 (substitute* "build/tests/Makefile"
606 (("\\$\\{exec_prefix\\}/") "")))))))
607 (native-search-paths
608 (list (search-path-specification
609 (variable "XDG_DATA_DIRS")
610 (files '("share")))
611 (search-path-specification
612 (variable "XDG_CONFIG_DIRS")
613 (files '("etc")))))
614 (home-page "https://ecl.common-lisp.dev/")
615 (synopsis "Embeddable Common Lisp")
616 (supported-systems (delete "i586-gnu" %supported-systems))
617 (description "ECL is an implementation of the Common Lisp language as
618defined by the ANSI X3J13 specification. Its most relevant features are: a
619bytecode compiler and interpreter, being able to compile Common Lisp with any
620C/C++ compiler, being able to build standalone executables and libraries, and
621supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
622 ;; Note that the file "Copyright" points to some files and directories
623 ;; which aren't under the lgpl2.1+ and instead contain many different,
624 ;; non-copyleft licenses.
625 ;; See https://common-lisp.net/project/ecl/posts/ECL-license.html.
626 (license license:lgpl2.1+)))
627
628(define-public eisl
629 (package
630 (name "eisl")
631 (version "3.50")
632 (source
633 (origin
634 (method git-fetch)
635 (uri (git-reference
636 (url "https://github.com/sasagawa888/eisl")
637 (commit (string-append "v" version))))
638 (file-name (git-file-name name version))
639 (sha256
640 (base32 "18alxwpvkcjfm63bc5kp6nn8351fl0p0ccxc8j9a7nb3fmg4fvyb"))))
641 (build-system gnu-build-system)
642 (inputs
643 (list bash-minimal freeglut gdbm libiconv ncurses tcl tk))
644 (native-inputs
645 (list cppcheck))
646 (arguments
647 (list #:make-flags
648 #~(list (string-append "PREFIX=" #$output)
649 (string-append "CC=" #$(cc-for-target)))
650 #:phases
651 #~(modify-phases %standard-phases
652 (add-after 'unpack 'fix-paths
653 (lambda* (#:key inputs #:allow-other-keys)
654 (substitute* "library/compiler.lsp"
655 (("\"cc ")
656 "\"gcc "))
657 (substitute* "library/tcltk.lsp"
658 (("include <tcl/tcl\\.h>")
659 "include <tcl.h>")
660 (("c-option \"-ltcl -ltk\" linux")
661 "c-option \"-ltcl8.6 -ltk8.6\" linux"))))
662 (delete 'configure)
663 (add-after 'install 'wrap
664 (lambda* (#:key inputs #:allow-other-keys)
665 (wrap-program (string-append #$output "/bin/eisl")
666 `("PATH" prefix
667 ,(map (lambda (bin)
668 (string-append (assoc-ref inputs bin) "/bin"))
669 '("binutils" "coreutils" "gcc" "ld-wrapper")))
670 `("LIBRARY_PATH" suffix
671 ,(map (lambda (lib)
672 (string-append (assoc-ref inputs lib) "/lib"))
673 '("libc")))))))))
674 (home-page "https://github.com/sasagawa888/eisl")
675 (synopsis "Implementation of ISLisp")
676 (description "Easy ISLISP (eisl) is an implementation of ISLisp which
677includes a compiler as well as an interpreter.")
678 (license (list license:bsd-2 ;; documents/license.txt
679 license:expat ;; cii/LICENSE
680 license:gpl2+ ;; nana/gdb/test.c and others under nana/
681 license:bsd-3)))) ;; bench/*
682
152(define-public gcl 683(define-public gcl
153 (package 684 (package
154 (name "gcl") 685 (name "gcl")
@@ -269,177 +800,474 @@ stratified garbage collection strategy, a source-level debugger and a built-in
269interface to the Tk widget system.") 800interface to the Tk widget system.")
270 (license license:lgpl2.0+))) 801 (license license:lgpl2.0+)))
271 802
272(define-public ecl 803(define-public janet
273 (package 804 (package
274 (name "ecl") 805 (name "janet")
275 (version "24.5.10") 806 (version "1.33.0")
276 (source 807 (source
277 (origin 808 (origin
278 (method url-fetch) 809 (method git-fetch)
279 (uri (string-append 810 (uri (git-reference
280 "https://ecl.common-lisp.dev/static/files/release/" 811 (url "https://github.com/janet-lang/janet")
281 name "-" version ".tgz")) 812 (commit (string-append "v" version))))
813 (file-name (git-file-name name version))
282 (sha256 814 (sha256
283 (base32 "0av2prf474cg0glr37fgsfb4w0dxfg38pykb72ay9q3132xnbsp4")))) 815 (base32 "16wgljca7hp29fz5p2dnvy2cbscjx4imf85rhjwc1jkgdjswjxli"))))
284 (build-system gnu-build-system) 816 (build-system gnu-build-system)
285 ;; src/configure uses 'which' to confirm the existence of 'gzip'.
286 (native-inputs
287 (list cl-asdf which texinfo))
288 (inputs (list bash-minimal))
289 ;; When ECL is embedded in a program that wants to use Common Lisp as an
290 ;; extension language, libgmp, libatomic-ops, libgc and libffi must be
291 ;; present when compiling the program because they are required by ECL's
292 ;; header file.
293 ;; Therefore we put these libraries in 'propagated-inputs' instead
294 ;; of 'inputs'.
295 (propagated-inputs
296 (list gmp libatomic-ops libgc libffi))
297 (arguments 817 (arguments
298 `(#:configure-flags '("--without-rt") 818 (list #:make-flags
299 #:parallel-tests? #f 819 #~(list
820 (string-append "DESTDIR=" #$output)
821 (string-append "PREFIX=")
822 (string-append "CC=" #$(cc-for-target)))
823 #:test-target "test"
824 #:phases
825 #~(modify-phases %standard-phases
826 (delete 'configure))))
827 (home-page "https://janet-lang.org/")
828 (synopsis "Functional, imperative and embeddable programming language")
829 (description
830 "Janet is a functional and imperative programming language. It can be
831used for rapid prototyping, dynamic systems, and other domains where dynamic
832languages shine. You can also add Janet scripting to an application by
833embedding a single C file and two headers. It can be easily ported to new
834platforms. The entire language (core library, interpreter, compiler,
835assembler, PEG) is less than 1MB.")
836 (license license:expat)))
837
838(define-public lisp-repl-core-dumper
839 (package
840 (name "lisp-repl-core-dumper")
841 (version "0.8.0")
842 (source
843 (origin
844 (method git-fetch)
845 (uri (git-reference
846 (url "https://gitlab.com/ambrevar/lisp-repl-core-dumper.git")
847 (commit version)))
848 (file-name (git-file-name name version))
849 (sha256
850 (base32 "04c12gi5izpkv8ha98z9qdkbmyrsq6ga060adrx53da8z31gnhk1"))))
851 (build-system copy-build-system)
852 (arguments
853 '(#:install-plan
854 '(("lisp-repl-core-dumper" "bin/"))
300 #:phases 855 #:phases
301 (modify-phases %standard-phases 856 (modify-phases %standard-phases
302 ;; FIXME: As of version 20.4.24, we pass 17995 tests and fail 7. 857 (add-before 'install 'fix-utils-path
303 ;; 2-3 tests may be due to FHS assumptions.
304 (delete 'check)
305 (add-after 'unpack 'replace-asdf
306 ;; Use system ASDF instead of bundled one.
307 (lambda* (#:key inputs #:allow-other-keys) 858 (lambda* (#:key inputs #:allow-other-keys)
308 (let* ((cl-asdf (assoc-ref inputs "cl-asdf")) 859 (let* ((cat (search-input-file inputs "/bin/cat"))
309 (guix-asdf (string-append 860 (paste (search-input-file inputs "/bin/paste"))
310 cl-asdf 861 (sort (search-input-file inputs "/bin/sort"))
311 "/share/common-lisp/source/asdf/asdf.lisp")) 862 (basename (search-input-file inputs "/bin/basename"))
312 (contrib-asdf "contrib/asdf/asdf.lisp")) 863 (sed (search-input-file inputs "/bin/sed")))
313 (copy-file guix-asdf contrib-asdf)))) 864 (substitute* "lisp-repl-core-dumper"
314 (add-after 'install 'remove-build-stamp 865 (("\\$\\(basename") (string-append "$(" basename))
315 (lambda* (#:key outputs #:allow-other-keys) 866 (("\\<cat\\>") cat)
316 (delete-file (string-append (assoc-ref outputs "out") 867 (("\\<paste\\>") paste)
317 "/lib/ecl-" ,version "/build-stamp")))) 868 (("\\<sed\\>") sed)
318 (add-after 'remove-build-stamp 'wrap 869 (("\\<sort\\>") sort))))))))
319 (lambda* (#:key inputs outputs #:allow-other-keys) 870 (inputs
320 (let* ((ecl (assoc-ref outputs "out")) 871 `(("coreutils" ,coreutils-minimal)
321 (input-path (lambda (lib path) 872 ("sed" ,sed)))
322 (string-append 873 (home-page "https://gitlab.com/ambrevar/lisp-repl-core-dumper")
323 (assoc-ref inputs lib) path))) 874 (synopsis "Generate REPL-optimized Lisp cores on demand")
324 (libraries '("gmp" "libatomic-ops" "libgc" "libffi" "libc")) 875 (description
325 (binaries '("gcc" "ld-wrapper" "binutils")) 876 "This tool generates Lisp images that can embed the provided systems
326 (library-directories 877and make for REPLs that start blazing fast.
327 (map (lambda (lib) (input-path lib "/lib"))
328 libraries)))
329 878
330 (wrap-program (string-append ecl "/bin/ecl") 879@itemize
331 `("PATH" prefix 880@item It’s portable and should work with any compiler.
332 ,(map (lambda (binary) 881@item It works for any REPL.
333 (input-path binary "/bin")) 882@item It allows you to include arbitrary libraries.
334 binaries)) 883@end itemize\n")
335 `("CPATH" suffix 884 (license license:gpl3+)))
336 ,(map (lambda (lib) 885
337 (input-path lib "/include")) 886(define-public lush2
338 `("kernel-headers" ,@libraries))) 887 (package
339 `("LIBRARY_PATH" suffix ,library-directories) 888 (name "lush2")
340 `("LD_LIBRARY_PATH" suffix ,library-directories))))) 889 (version "2.0.1")
341 (add-after 'wrap 'check (assoc-ref %standard-phases 'check)) 890 (source
342 (add-before 'check 'fix-path-to-ecl 891 (origin
343 (lambda _ 892 (method url-fetch)
344 (substitute* "build/tests/Makefile" 893 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
345 (("\\$\\{exec_prefix\\}/") ""))))))) 894 version ".tar.gz"))
346 (native-search-paths 895 (modules '((guix build utils)))
347 (list (search-path-specification 896 (snippet
348 (variable "XDG_DATA_DIRS") 897 '(begin
349 (files '("share"))) 898 (substitute* "src/unix.c"
350 (search-path-specification 899 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
351 (variable "XDG_CONFIG_DIRS") 900 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
352 (files '("etc"))))) 901 (substitute* "src/main.c"
353 (home-page "https://ecl.common-lisp.dev/") 902 (("\" \\(built \" __DATE__ \"\\)\"") ""))
354 (synopsis "Embeddable Common Lisp") 903 #t))
355 (supported-systems (delete "i586-gnu" %supported-systems)) 904 (sha256
356 (description "ECL is an implementation of the Common Lisp language as 905 (base32
357defined by the ANSI X3J13 specification. Its most relevant features are: a 906 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
358bytecode compiler and interpreter, being able to compile Common Lisp with any 907 (build-system gnu-build-system)
359C/C++ compiler, being able to build standalone executables and libraries, and 908 (arguments
360supporting ASDF, Sockets, Gray streams, MOP, and other useful components.") 909 `(;; We have to add these LIBS so that they are found.
361 ;; Note that the file "Copyright" points to some files and directories 910 #:configure-flags (list "LIBS=-lz"
362 ;; which aren't under the lgpl2.1+ and instead contain many different, 911 "X_EXTRA_LIBS=-lfontconfig"
363 ;; non-copyleft licenses. 912 "--with-x")
364 ;; See https://common-lisp.net/project/ecl/posts/ECL-license.html. 913 #:tests? #f)) ; No make check.
914 (native-inputs (list intltool))
915 (inputs
916 `(("alsa-lib" ,alsa-lib)
917 ("sdl" ,sdl)
918 ("sdl-image" ,sdl-image)
919 ("sdl-mixer" ,sdl-mixer)
920 ("sdl-net" ,sdl-net)
921 ("sdl-ttf" ,sdl-ttf)
922 ("libxft" ,libxft)
923 ("fontconfig" ,fontconfig)
924 ("gsl" ,gsl)
925 ("openblas" ,openblas)
926 ("glu" ,glu)
927 ("mesa" ,mesa)
928 ("mesa-utils" ,mesa-utils)
929 ("binutils" ,binutils)
930 ("libiberty" ,libiberty)
931 ("readline" ,readline)
932 ("zlib" ,zlib)
933 ("gettext-minimal" ,gettext-minimal)))
934 (synopsis "Lisp Universal Shell")
935 (description
936 "Lush is an object-oriented Lisp interpreter/compiler with features
937designed to please people who want to prototype large numerical
938applications. Lush includes an extensive library of
939vector/matrix/tensor manipulation, numerous numerical libraries
940(including GSL, LAPACK, and BLAS), a set of graphic functions, a
941simple GUI toolkit, and interfaces to various graphic and multimedia
942libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
943grabbing), and others. Lush is an ideal frontend script language for
944programming projects written in C or other languages. Lush also has
945libraries for Machine Learning, Neural Nets and statistical estimation.")
946 (home-page "https://lush.sourceforge.net/")
365 (license license:lgpl2.1+))) 947 (license license:lgpl2.1+)))
366 948
367(define-public clisp 949(define picolisp32
368 (package 950 (package
369 (name "clisp") 951 (name "picolisp32")
370 (version "2.49-92") 952 (version "19.12")
371 (source 953 (source
372 (origin 954 (origin
373 (method git-fetch) 955 (method url-fetch)
374 (uri (git-reference 956 (uri (string-append "https://software-lab.de/picoLisp-" version ".tgz"))
375 (url "https://gitlab.com/gnu-clisp/clisp")
376 (commit "clisp-2.49.92-2018-02-18")))
377 (file-name (git-file-name name version))
378 (sha256 957 (sha256
379 (base32 "0k2dmgl0miz3767iks4p0mvp6xw0ysyxhjpklyh11j010rmh6hqb")))) 958 (base32 "10np0mhihr47r3201617zccrvzpkhdl1jwvz7zimk8kxpriydq2j"))
959 (modules '((guix build utils)))
960 (snippet '(begin
961 ;; Delete the pre-compiled jar file.
962 (delete-file "ersatz/picolisp.jar")
963 #t))))
380 (build-system gnu-build-system) 964 (build-system gnu-build-system)
381 (native-inputs 965 (inputs
382 (list cl-asdf)) 966 `(("openssl" ,openssl)))
383 (inputs (list libffcall ncurses readline libsigsegv))
384 (arguments 967 (arguments
385 `(#:configure-flags '(,@(if (string-prefix? "armhf-linux" 968 `(#:system ,(match (%current-system)
386 (or (%current-system) 969 ((or "armhf-linux" "aarch64-linux")
387 (%current-target-system))) 970 "armhf-linux")
388 '("CFLAGS=-falign-functions=4") 971 (_
389 '()) 972 "i686-linux"))
390 ,@(if (target-x86-64?)
391 '("--enable-portability"
392 "--with-threads=POSIX_THREADS")
393 '())
394 "--with-dynamic-ffi"
395 "--with-dynamic-modules"
396 "--with-ffcall"
397 "--with-readline"
398 "--with-sigsegv"
399 "--with-module=asdf"
400 "--with-module=rawsock")
401 #:phases 973 #:phases
402 (modify-phases %standard-phases 974 (modify-phases %standard-phases
403 (add-after 'unpack 'patch-sh-and-pwd 975 (delete 'configure)
976 (add-after 'unpack 'fix-paths
977 (lambda* (#:key outputs #:allow-other-keys)
978 (let* ((out (assoc-ref outputs "out"))
979 (shebang-line (string-append
980 "#!" out "/bin/picolisp "
981 out "/lib/picolisp/lib.l")))
982 (substitute* '("bin/pil"
983 "bin/pilIndent"
984 "bin/pilPretty"
985 "bin/psh"
986 "bin/replica"
987 "bin/vip"
988 "bin/watchdog"
989 "games/xchess"
990 "misc/bigtest"
991 "misc/calc"
992 "misc/chat"
993 "misc/mailing"
994 "src/mkVers")
995 (("#\\!bin/picolisp lib.l")
996 shebang-line)
997 (("#\\!\\.\\./bin/picolisp \\.\\./lib.l")
998 shebang-line)
999 (("#\\!/usr/bin/picolisp /usr/lib/picolisp/lib.l")
1000 shebang-line)))
1001 #t))
1002 (add-after 'fix-paths 'make-build-reproducible
404 (lambda _ 1003 (lambda _
405 ;; The package is very messy with its references to "/bin/sh" and 1004 (substitute* "src64/lib/asm.l"
406 ;; some other absolute paths to traditional tools. These appear in 1005 (("\\(prinl \"/\\* \" \\(datSym \\(date\\)\\) \" \\*/\\)")
407 ;; many places where our automatic patching misses them. Therefore 1006 ""))
408 ;; we do the following, in this early (post-unpack) phase, to solve
409 ;; the problem from its root.
410 (substitute* '("src/clisp-link.in"
411 "src/unix.d"
412 "src/makemake.in")
413 (("/bin/sh") (which "sh")))
414 (substitute* (find-files "." "configure|Makefile")
415 (("/bin/sh") "sh"))
416 (substitute* '("src/clisp-link.in")
417 (("/bin/pwd") "pwd"))
418 #t)) 1007 #t))
419 (add-after 'unpack 'replace-asdf 1008 (add-after 'make-build-reproducible 'fix-permissions
420 ;; Use system ASDF instead of bundled one. 1009 (lambda _
421 (lambda* (#:key inputs #:allow-other-keys) 1010 (for-each make-file-writable
422 (let* ((cl-asdf (assoc-ref inputs "cl-asdf")) 1011 '("doc/family.tgz"
423 (guix-asdf (string-append 1012 "doc/family64.tgz"
424 cl-asdf 1013 "lib/map"
425 "/share/common-lisp/source/asdf/asdf.lisp")) 1014 "src64/tags"))
426 (contrib-asdf "modules/asdf/asdf.lisp")) 1015 #t))
427 (delete-file contrib-asdf) 1016 (replace 'build
428 (copy-file guix-asdf contrib-asdf))))))) 1017 (lambda _
429 (native-search-paths 1018 (invoke "make" "-C" "src" "picolisp" "tools" "gate")))
430 (list (search-path-specification 1019 (add-before 'check 'set-home-for-tests
431 (variable "XDG_DATA_DIRS") 1020 (lambda _
432 (files '("share"))) 1021 (setenv "HOME" "/tmp")
433 (search-path-specification 1022 #t))
434 (variable "XDG_CONFIG_DIRS") 1023 (replace 'check
435 (files '("etc"))))) 1024 (lambda _
436 (home-page "https://clisp.sourceforge.io/") 1025 (invoke "./pil" "test/lib.l" "-bye" "+")))
437 (synopsis "Common Lisp implementation") 1026 (replace 'install
1027 (lambda* (#:key outputs #:allow-other-keys)
1028 (let* ((out (assoc-ref outputs "out"))
1029 (bin (string-append out "/bin"))
1030 (man (string-append out "/share/man"))
1031 (picolisp (string-append out "/lib/picolisp")))
1032 (copy-recursively "man" man)
1033 (copy-recursively "." picolisp)
1034 (for-each (lambda (name)
1035 (let ((path (string-append picolisp "/" name)))
1036 (delete-file-recursively path)))
1037 '("CHANGES" "COPYING" "CREDITS" "cygwin"
1038 "INSTALL" "man" "pil" "README" "src" "src64"
1039 "test"))
1040 (mkdir-p bin)
1041 (symlink (string-append picolisp "/bin/picolisp")
1042 (string-append bin "/picolisp"))
1043 (symlink (string-append picolisp "/bin/pil")
1044 (string-append bin "/pil")))
1045 #t)))))
1046 (synopsis "Interpreter for the PicoLisp programming language")
438 (description 1047 (description
439 "GNU CLISP is an implementation of ANSI Common Lisp. Common Lisp is a 1048 "PicoLisp is a programming language, or really a programming system,
440high-level, object-oriented functional programming language. CLISP includes 1049including a built-in database engine and a GUI system.")
441an interpreter, a compiler, a debugger, and much more.") 1050 (home-page "https://picolisp.com/wiki/?home")
442 (license license:gpl2+))) 1051 (license license:expat)))
1052
1053(define-public picolisp
1054 (match (%current-system)
1055 ((or "aarch64-linux" "x86_64-linux")
1056 (package
1057 ;; Use the 32-bit picolisp to generate the assembly files required by
1058 ;; the 64-bit picolisp.
1059 (inherit picolisp32)
1060 (name "picolisp")
1061 (native-inputs
1062 (list picolisp32 which))
1063 (arguments
1064 (substitute-keyword-arguments (package-arguments picolisp32)
1065 ((#:system _ "") (%current-system))
1066 ((#:phases phases)
1067 `(modify-phases ,phases
1068 (delete 'fix-paths)
1069 (add-before 'build 'fix-paths
1070 ;; This must run after the other shebang-patching phases,
1071 ;; or they will override our changes.
1072 (lambda* (#:key inputs outputs #:allow-other-keys)
1073 (let* ((picolisp32 (assoc-ref inputs "picolisp32"))
1074 (out (assoc-ref outputs "out"))
1075 (shebang-line (string-append
1076 "#!" out "/bin/picolisp "
1077 out "/lib/picolisp/lib.l")))
1078 (substitute* '("bin/pil"
1079 "bin/pilIndent"
1080 "bin/pilPretty"
1081 "bin/psh"
1082 "bin/replica"
1083 "bin/vip"
1084 "bin/watchdog"
1085 "games/xchess"
1086 "misc/bigtest"
1087 "misc/calc"
1088 "misc/chat"
1089 "misc/mailing"
1090 "src/mkVers")
1091 (("#\\!.*picolisp32.*/bin/picolisp .*lib\\.l")
1092 shebang-line))
1093 (substitute* "src64/mkAsm"
1094 (("/usr/bin/")
1095 (string-append picolisp32 "/bin/"))))
1096 #t))
1097 (replace 'build
1098 (lambda _
1099 (invoke "make" "-C" "src" "tools" "gate")
1100 (invoke "make" "-C" "src64" "CC=gcc" "picolisp")))))))))
1101 (_
1102 (package
1103 (inherit picolisp32)
1104 (name "picolisp")))))
1105
1106(define-public roswell
1107 (package
1108 (name "roswell")
1109 (version "23.10.14.114")
1110 (home-page "https://github.com/roswell/roswell")
1111 (source
1112 (origin
1113 (method git-fetch)
1114 (uri (git-reference
1115 (url "https://github.com/roswell/roswell")
1116 (commit (string-append "v" version))))
1117 (file-name (git-file-name name version))
1118 (sha256
1119 (base32 "05w5sjh1bfy2wnblc09cb9qs8h7hxkx5hcqlbgpn7md32b0m4h7g"))))
1120 (build-system gnu-build-system)
1121 (arguments
1122 (list #:configure-flags #~(list (string-append "--prefix=" #$output))
1123 #:tests? #f))
1124 (native-inputs
1125 (list autoconf automake intltool))
1126 (inputs
1127 (list curl))
1128 (propagated-inputs
1129 ;; Has to be propagated in order to be found during setup.
1130 (list gnu-make patchelf))
1131 (synopsis "Common Lisp implementation manager, launcher, and more")
1132 (description
1133 "Roswell started out as a command-line tool with the aim to make
1134installing and managing Common Lisp implementations really simple and easy.
1135Roswell has now evolved into a full-stack environment for Common Lisp
1136development, and has many features that makes it easy to test, share, and
1137distribute your Lisp applications.
1138
1139Roswell is still in beta. Despite this, the basic interfaces are stable and
1140not likely to change.")
1141 (license license:expat)))
1142
1143(define-public s7-bootstrap
1144 ;; Need s7-bootstrap to build libc_s7.so (for the REPL) and run tests
1145 (let ((commit "23a64facfac06c4bc23a7de8f04691c55f88bd40") ;no releases
1146 (revision "0"))
1147 (hidden-package
1148 (package
1149 (name "s7-bootstrap")
1150 (version (git-version "24.1" revision commit))
1151 (source (origin
1152 (method git-fetch)
1153 (uri (git-reference
1154 (url "https://cm-gitlab.stanford.edu/bil/s7.git")
1155 (commit commit)))
1156 (file-name (git-file-name name version))
1157 (sha256
1158 (base32
1159 "0fiw8lb7rswglixvn271la2q2hgwszrf2ckykhr6jjxdvmb9a7d0"))
1160 (patches (search-patches "s7-flint-3.patch"))))
1161 (build-system gnu-build-system)
1162 (arguments
1163 (list #:tests? #f ;no tests in bootstrap
1164 #:phases #~(modify-phases %standard-phases
1165 (delete 'configure) ;no configure
1166 (replace 'build
1167 (lambda _
1168 ;; using build commands from s7 home page
1169 (display "[BUILD] repl\n")
1170 (invoke #$(cc-for-target) "s7.c" "-o" "repl"
1171 "-I." "-O2" "-g"
1172 "-DWITH_MAIN"
1173 (string-append
1174 "-DS7_LOAD_PATH=\""
1175 #$output "/share/s7/scm\"")
1176 "-ldl" "-lm"
1177 "-Wl,-export-dynamic")
1178 (display "[BUILD] nrepl\n")
1179 (invoke #$(cc-for-target) "s7.c" "-o" "nrepl"
1180 "-I." "-O2" "-g"
1181 "-DWITH_MAIN" "-DWITH_NOTCURSES"
1182 (string-append
1183 "-DS7_LOAD_PATH=\""
1184 #$output "/share/s7/scm\"")
1185 "-ldl" "-lm" "-lnotcurses-core"
1186 "-Wl,-export-dynamic")
1187 (display "[BUILD] libarb_s7.so\n")
1188 (invoke #$(cc-for-target) "libarb_s7.c"
1189 "-I." "-O2" "-g"
1190 "-shared" "-o" "libarb_s7.so"
1191 "-lflint" "-lmpc" "-fPIC")
1192 (display "[BUILD] libnotcurses_s7.so\n")
1193 (invoke #$(cc-for-target) "notcurses_s7.c"
1194 "-I." "-O2" "-g"
1195 "-shared" "-o" "libnotcurses_s7.so"
1196 "-lnotcurses-core" "-fPIC")
1197 ;; Need s7.o and ffitest for tests
1198 (display "[BUILD] s7.o\n")
1199 (invoke #$(cc-for-target) "-c" "s7.c" "-o"
1200 "s7.o" "-I." "-O2" "-ldl" "-lm")
1201 (display "[BUILD] ffitest\n")
1202 (invoke #$(cc-for-target) "-o" "ffitest"
1203 "ffitest.c" "-g2" "s7.o" "-lm" "-I."
1204 "-ldl" "-Wl,-export-dynamic")))
1205 (add-before 'check 'install-scm
1206 ;; scm files need to be installed before testing
1207 (lambda _
1208 (for-each (lambda (x)
1209 (install-file
1210 x (string-append
1211 #$output "/share/s7/scm/")))
1212 (find-files "." "\\.scm"))))
1213 (replace 'install
1214 (lambda _
1215 (let ((bin (string-append #$output "/bin"))
1216 (share (string-append #$output
1217 "/share/s7/"))
1218 (doc (string-append #$output
1219 "/share/doc/s7/"))
1220 (lib (string-append #$output "/lib"))
1221 (inc (string-append #$output "/include/")))
1222 (install-file "repl" bin)
1223 (install-file "nrepl" bin)
1224 (install-file "ffitest" bin)
1225 (install-file "libarb_s7.so" lib)
1226 (install-file "libnotcurses_s7.so" lib)
1227 (install-file "s7.c" share)
1228 (install-file "s7.h" inc)
1229 (install-file "s7.html" doc)))))))
1230 (inputs (list flint mpc notcurses))
1231 (home-page "https://ccrma.stanford.edu/software/snd/snd/s7.html")
1232 (synopsis "Scheme interpreter intended as an extension language")
1233 (description
1234 "s7 is a Scheme interpreter intended as an extension language for
1235other applications. It exists as just two files, @code{s7.c} and @code{s7.h},
1236that may be copied into the source tree of another application. There are no
1237libraries, no run-time init files, and no configuration scripts. It can also
1238be built as a stand-alone REPL interpreter.")
1239 (license license:bsd-0)))))
1240
1241(define-public s7
1242 (package
1243 (inherit s7-bootstrap)
1244 (name "s7")
1245 (arguments
1246 (substitute-keyword-arguments
1247 (strip-keyword-arguments
1248 '(#:tests?)
1249 (package-arguments s7-bootstrap))
1250 ((#:phases phases)
1251 #~(modify-phases #$phases
1252 (add-after 'unpack 'patch
1253 (lambda _
1254 (substitute* "s7.c"
1255 (("libc_s7.so")
1256 (string-append #$output "/lib/libc_s7.so")))))
1257 (add-after 'build 'build-full
1258 (lambda _
1259 (invoke "repl" "./libc.scm")))
1260 (replace 'check
1261 (lambda* (#:key tests? #:allow-other-keys)
1262 (when tests?
1263 (invoke "repl" "./s7test.scm"))))
1264 (add-after 'install 'install-full
1265 (lambda _
1266 (install-file "libc_s7.so"
1267 (string-append #$output "/lib/"))
1268 (delete-file (string-append #$output "/bin/ffitest"))))))))
1269 (native-inputs (list s7-bootstrap))
1270 (properties (alist-delete 'hidden? (package-properties s7-bootstrap)))))
443 1271
444(define-public sbcl 1272(define-public sbcl
445 (package 1273 (package
@@ -684,264 +1512,6 @@ statistical profiler, a code coverage tool, and many other extensions.")
684 (license (list license:public-domain license:bsd-2 1512 (license (list license:public-domain license:bsd-2
685 (license:x11-style "file://src/code/loop.lisp"))))) 1513 (license:x11-style "file://src/code/loop.lisp")))))
686 1514
687(define-public ccl
688 ;; Warning: according to upstream, CCL is not bootstrappable.
689 ;; See https://github.com/Clozure/ccl/issues/222 from 2019-09-02:
690 ;;
691 ;; "As far as I know, there is no way to build CCL without an existing
692 ;; running CCL image. It was bootstrapped back in 1986 or so as
693 ;; Macintosh Common Lisp, by Gary Byers, I believe, who is no longer on
694 ;; the planet to tell us the story. It SHOULD be possible to port the
695 ;; CCL compiler to portable Common Lisp, so that ANY lisp could build
696 ;; it, as is the case for SBCL, but I know of no attempt to do so."
697 (package
698 (name "ccl")
699 ;; XXX When updating this package, check whether we can simply append
700 ;; VERSION to the ccl-bootstrap URL again, instead of per architecture.
701 (version "1.12.1")
702 (source (origin
703 (method git-fetch)
704 (uri (git-reference
705 (url "https://github.com/Clozure/ccl/")
706 (commit (string-append "v" version))))
707 (file-name (git-file-name "ccl" version))
708 (sha256
709 (base32
710 "1zz291lvsrr7pps8wfl2kdxsnzjngqi4v3mil14pga4r5zanmsi7"))))
711 (build-system gnu-build-system)
712 ;; CCL consists of a "lisp kernel" and "heap image", both of which are
713 ;; shipped in precompiled form in source tarballs. The former is a C
714 ;; program which we can rebuild from scratch, but the latter cannot be
715 ;; generated without an already working copy of CCL, and is platform
716 ;; dependent, so we need to fetch the correct tarball for the platform.
717 (inputs
718 `(("ccl-bootstrap"
719 ,(origin
720 (method url-fetch)
721 (uri (string-append
722 "https://github.com/Clozure/ccl/releases/download/v"
723 (match (%current-system)
724 ("armhf-linux" "1.12/linuxarm")
725 ;; XXX: This source only works on x86, but provide it as a
726 ;; catch-all to prevent errors when querying this package
727 ;; on unsupported platforms.
728 (_ "1.12.1/linuxx86"))
729 ".tar.gz"))
730 (sha256
731 (base32
732 (match (%current-system)
733 ("armhf-linux"
734 "0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
735 (_ "0ll017ajcfsyx8f7zsy4394y8xxvz40iz0gcsmznp0n3mf0xi67c"))))))))
736 (native-inputs
737 (list cl-asdf m4))
738 (arguments
739 `(#:tests? #f ;no 'check' target
740 #:modules ((ice-9 match)
741 (srfi srfi-26)
742 (guix build utils)
743 (guix build gnu-build-system))
744 #:phases
745 (modify-phases %standard-phases
746 (add-after 'unpack 'unpack-image
747 (lambda* (#:key inputs #:allow-other-keys)
748 (invoke "tar" "xzvf" (assoc-ref inputs "ccl-bootstrap"))))
749 (add-after 'unpack 'replace-asdf
750 ;; Use system ASDF instead of bundled one.
751 (lambda* (#:key inputs #:allow-other-keys)
752 (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
753 (guix-asdf (string-append
754 cl-asdf
755 "/share/common-lisp/source/asdf/asdf.lisp"))
756 (contrib-asdf "tools/asdf.lisp"))
757 (delete-file contrib-asdf)
758 (copy-file guix-asdf contrib-asdf))))
759 (delete 'configure)
760 (add-before 'build 'pre-build
761 ;; Enter the source directory for the current platform's lisp
762 ;; kernel, and run 'make clean' to remove the precompiled one.
763 (lambda* (#:key system #:allow-other-keys)
764 (substitute* "lisp-kernel/m4macros.m4"
765 (("/bin/pwd") (which "pwd")))
766 (chdir (string-append
767 "lisp-kernel/"
768 (match system
769 ("i686-linux" "linuxx8632")
770 ("x86_64-linux" "linuxx8664")
771 ("armhf-linux" "linuxarm")
772 (_ (string-append "unknown system: " system)))))
773 (substitute* '("Makefile")
774 (("/bin/rm") "rm"))
775 (setenv "CC" "gcc")
776 (invoke "make" "clean")))
777 ;; XXX Do we need to recompile the heap image as well for Guix?
778 ;; For now just use the one we already got in the tarball.
779 (replace 'install
780 (lambda* (#:key outputs inputs system #:allow-other-keys)
781 ;; The lisp kernel built by running 'make' in lisp-kernel/$system
782 ;; is put back into the original directory, so go back. The heap
783 ;; image is there as well.
784 (chdir "../..")
785 (let* ((out (assoc-ref outputs "out"))
786 (libdir (string-append out "/lib/"))
787 (bindir (string-append out "/bin/"))
788 (wrapper (string-append bindir "ccl"))
789 (bash (assoc-ref inputs "bash"))
790 (kernel
791 (match system
792 ("i686-linux" "lx86cl")
793 ("x86_64-linux" "lx86cl64")
794 ("armhf-linux" "armcl")
795 ;; Unlikely to work, but try it anyway...
796 (_ system)))
797 (heap (string-append kernel ".image")))
798 (install-file kernel libdir)
799 (install-file heap libdir)
800
801 (let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
802 ,@(match system
803 ("x86_64-linux"
804 '("x86-headers64"))
805 ("i686-linux"
806 '("x86-headers"))
807 (_ '())))))
808 (for-each copy-recursively
809 dirs
810 (map (cut string-append libdir <>) dirs)))
811
812 (mkdir-p bindir)
813 (with-output-to-file wrapper
814 (lambda ()
815 (display
816 (string-append
817 "#!" bash "/bin/sh\n"
818 "export CCL_DEFAULT_DIRECTORY=" libdir "\n"
819 "exec -a \"$0\" " libdir kernel " \"$@\"\n"))))
820 (chmod wrapper #o755))
821 #t)))))
822 (native-search-paths
823 (list (search-path-specification
824 (variable "XDG_DATA_DIRS")
825 (files '("share")))
826 (search-path-specification
827 (variable "XDG_CONFIG_DIRS")
828 (files '("etc")))))
829 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
830 (home-page "https://ccl.clozure.com/")
831 (synopsis "Common Lisp implementation")
832 (description "Clozure CL (often called CCL for short) is a Common Lisp
833implementation featuring fast compilation speed, native threads, a precise,
834generational, compacting garbage collector, and a convenient foreign-function
835interface.")
836 (license license:asl2.0)))
837
838(define-public lush2
839 (package
840 (name "lush2")
841 (version "2.0.1")
842 (source
843 (origin
844 (method url-fetch)
845 (uri (string-append "mirror://sourceforge/lush/lush2/lush-"
846 version ".tar.gz"))
847 (modules '((guix build utils)))
848 (snippet
849 '(begin
850 (substitute* "src/unix.c"
851 (("\\{ \"LUSH_DATE\", __DATE__ \\},") "")
852 (("\\{ \"LUSH_TIME\", __TIME__ \\},") ""))
853 (substitute* "src/main.c"
854 (("\" \\(built \" __DATE__ \"\\)\"") ""))
855 #t))
856 (sha256
857 (base32
858 "02pkfn3nqdkm9fm44911dbcz0v3r0l53vygj8xigl6id5g3iwi4k"))))
859 (build-system gnu-build-system)
860 (arguments
861 `(;; We have to add these LIBS so that they are found.
862 #:configure-flags (list "LIBS=-lz"
863 "X_EXTRA_LIBS=-lfontconfig"
864 "--with-x")
865 #:tests? #f)) ; No make check.
866 (native-inputs (list intltool))
867 (inputs
868 `(("alsa-lib" ,alsa-lib)
869 ("sdl" ,sdl)
870 ("sdl-image" ,sdl-image)
871 ("sdl-mixer" ,sdl-mixer)
872 ("sdl-net" ,sdl-net)
873 ("sdl-ttf" ,sdl-ttf)
874 ("libxft" ,libxft)
875 ("fontconfig" ,fontconfig)
876 ("gsl" ,gsl)
877 ("openblas" ,openblas)
878 ("glu" ,glu)
879 ("mesa" ,mesa)
880 ("mesa-utils" ,mesa-utils)
881 ("binutils" ,binutils)
882 ("libiberty" ,libiberty)
883 ("readline" ,readline)
884 ("zlib" ,zlib)
885 ("gettext-minimal" ,gettext-minimal)))
886 (synopsis "Lisp Universal Shell")
887 (description
888 "Lush is an object-oriented Lisp interpreter/compiler with features
889designed to please people who want to prototype large numerical
890applications. Lush includes an extensive library of
891vector/matrix/tensor manipulation, numerous numerical libraries
892(including GSL, LAPACK, and BLAS), a set of graphic functions, a
893simple GUI toolkit, and interfaces to various graphic and multimedia
894libraries such as OpenGL, SDL, Video4Linux, and ALSA (video/audio
895grabbing), and others. Lush is an ideal frontend script language for
896programming projects written in C or other languages. Lush also has
897libraries for Machine Learning, Neural Nets and statistical estimation.")
898 (home-page "https://lush.sourceforge.net/")
899 (license license:lgpl2.1+)))
900
901(define-public confusion-mdl
902 (let* ((commit "12a055581fc262225272df43287dae48281900f5"))
903 (package
904 (name "confusion-mdl")
905 (version "0.2")
906 (source (origin
907 (method git-fetch)
908 (uri (git-reference
909 (url (string-append "https://gitlab.com/emacsomancer/" name))
910 (commit commit)))
911 (sha256
912 (base32
913 "1zi8kflzvwqg97ha1sa5xjisbjs5z1mvbpa772vfxiv5ksnpxp0d"))
914 (file-name (git-file-name name version))))
915 (build-system gnu-build-system)
916 (arguments
917 `(#:tests? #f ; there are no tests
918 #:phases
919 (modify-phases %standard-phases
920 (delete 'configure)
921 (replace 'build
922 (lambda* (#:key (make-flags '()) #:allow-other-keys)
923 (apply invoke "make" "CC=gcc" make-flags)))
924 (replace 'install
925 (lambda* (#:key outputs #:allow-other-keys)
926 (let* ((out (assoc-ref outputs "out"))
927 (bin (string-append out "/bin")))
928 (install-file "mdli" bin)
929 #t))))))
930 (native-inputs
931 (list perl))
932 (inputs
933 (list libgc))
934 (synopsis "Interpreter for the MIT Design Language (MDL)")
935 (description "MDL (the MIT Design Language) is a descendant of Lisp. It
936was originally developed in 1971 on the PDP-10 computer under the Incompatible
937Timesharing System (ITS) to provide high level language support for the
938Dynamic Modeling Group at MIT's Project MAC. Infocom built the original
939PDP-10 Zork in MDL and their later ZIL (Zork Implementation Language) was
940based on a subset of MDL. Confusion is a MDL interpreter that works just well
941enough to play the original mainframe Zork all the way through.")
942 (home-page "http://www.russotto.net/git/mrussotto/confusion/src/master/src/README")
943 (license license:gpl3+))))
944
945(define man-for-txr 1515(define man-for-txr
946 (let ((commit "dfbf19b9a96474b8c1bacac85e43605e5691ceb2") 1516 (let ((commit "dfbf19b9a96474b8c1bacac85e43605e5691ceb2")
947 ;; Number of additional commits since the last tag (see the output of 1517 ;; Number of additional commits since the last tag (see the output of
@@ -1077,574 +1647,3 @@ command line, to data scanning and extracting scripts, to full application
1077development in a wide-range of areas.") 1647development in a wide-range of areas.")
1078 (home-page "https://www.nongnu.org/txr/") 1648 (home-page "https://www.nongnu.org/txr/")
1079 (license license:bsd-2))) 1649 (license license:bsd-2)))
1080
1081(define picolisp32
1082 (package
1083 (name "picolisp32")
1084 (version "19.12")
1085 (source
1086 (origin
1087 (method url-fetch)
1088 (uri (string-append "https://software-lab.de/picoLisp-" version ".tgz"))
1089 (sha256
1090 (base32 "10np0mhihr47r3201617zccrvzpkhdl1jwvz7zimk8kxpriydq2j"))
1091 (modules '((guix build utils)))
1092 (snippet '(begin
1093 ;; Delete the pre-compiled jar file.
1094 (delete-file "ersatz/picolisp.jar")
1095 #t))))
1096 (build-system gnu-build-system)
1097 (inputs
1098 `(("openssl" ,openssl)))
1099 (arguments
1100 `(#:system ,(match (%current-system)
1101 ((or "armhf-linux" "aarch64-linux")
1102 "armhf-linux")
1103 (_
1104 "i686-linux"))
1105 #:phases
1106 (modify-phases %standard-phases
1107 (delete 'configure)
1108 (add-after 'unpack 'fix-paths
1109 (lambda* (#:key outputs #:allow-other-keys)
1110 (let* ((out (assoc-ref outputs "out"))
1111 (shebang-line (string-append
1112 "#!" out "/bin/picolisp "
1113 out "/lib/picolisp/lib.l")))
1114 (substitute* '("bin/pil"
1115 "bin/pilIndent"
1116 "bin/pilPretty"
1117 "bin/psh"
1118 "bin/replica"
1119 "bin/vip"
1120 "bin/watchdog"
1121 "games/xchess"
1122 "misc/bigtest"
1123 "misc/calc"
1124 "misc/chat"
1125 "misc/mailing"
1126 "src/mkVers")
1127 (("#\\!bin/picolisp lib.l")
1128 shebang-line)
1129 (("#\\!\\.\\./bin/picolisp \\.\\./lib.l")
1130 shebang-line)
1131 (("#\\!/usr/bin/picolisp /usr/lib/picolisp/lib.l")
1132 shebang-line)))
1133 #t))
1134 (add-after 'fix-paths 'make-build-reproducible
1135 (lambda _
1136 (substitute* "src64/lib/asm.l"
1137 (("\\(prinl \"/\\* \" \\(datSym \\(date\\)\\) \" \\*/\\)")
1138 ""))
1139 #t))
1140 (add-after 'make-build-reproducible 'fix-permissions
1141 (lambda _
1142 (for-each make-file-writable
1143 '("doc/family.tgz"
1144 "doc/family64.tgz"
1145 "lib/map"
1146 "src64/tags"))
1147 #t))
1148 (replace 'build
1149 (lambda _
1150 (invoke "make" "-C" "src" "picolisp" "tools" "gate")))
1151 (add-before 'check 'set-home-for-tests
1152 (lambda _
1153 (setenv "HOME" "/tmp")
1154 #t))
1155 (replace 'check
1156 (lambda _
1157 (invoke "./pil" "test/lib.l" "-bye" "+")))
1158 (replace 'install
1159 (lambda* (#:key outputs #:allow-other-keys)
1160 (let* ((out (assoc-ref outputs "out"))
1161 (bin (string-append out "/bin"))
1162 (man (string-append out "/share/man"))
1163 (picolisp (string-append out "/lib/picolisp")))
1164 (copy-recursively "man" man)
1165 (copy-recursively "." picolisp)
1166 (for-each (lambda (name)
1167 (let ((path (string-append picolisp "/" name)))
1168 (delete-file-recursively path)))
1169 '("CHANGES" "COPYING" "CREDITS" "cygwin"
1170 "INSTALL" "man" "pil" "README" "src" "src64"
1171 "test"))
1172 (mkdir-p bin)
1173 (symlink (string-append picolisp "/bin/picolisp")
1174 (string-append bin "/picolisp"))
1175 (symlink (string-append picolisp "/bin/pil")
1176 (string-append bin "/pil")))
1177 #t)))))
1178 (synopsis "Interpreter for the PicoLisp programming language")
1179 (description
1180 "PicoLisp is a programming language, or really a programming system,
1181including a built-in database engine and a GUI system.")
1182 (home-page "https://picolisp.com/wiki/?home")
1183 (license license:expat)))
1184
1185(define-public picolisp
1186 (match (%current-system)
1187 ((or "aarch64-linux" "x86_64-linux")
1188 (package
1189 ;; Use the 32-bit picolisp to generate the assembly files required by
1190 ;; the 64-bit picolisp.
1191 (inherit picolisp32)
1192 (name "picolisp")
1193 (native-inputs
1194 (list picolisp32 which))
1195 (arguments
1196 (substitute-keyword-arguments (package-arguments picolisp32)
1197 ((#:system _ "") (%current-system))
1198 ((#:phases phases)
1199 `(modify-phases ,phases
1200 (delete 'fix-paths)
1201 (add-before 'build 'fix-paths
1202 ;; This must run after the other shebang-patching phases,
1203 ;; or they will override our changes.
1204 (lambda* (#:key inputs outputs #:allow-other-keys)
1205 (let* ((picolisp32 (assoc-ref inputs "picolisp32"))
1206 (out (assoc-ref outputs "out"))
1207 (shebang-line (string-append
1208 "#!" out "/bin/picolisp "
1209 out "/lib/picolisp/lib.l")))
1210 (substitute* '("bin/pil"
1211 "bin/pilIndent"
1212 "bin/pilPretty"
1213 "bin/psh"
1214 "bin/replica"
1215 "bin/vip"
1216 "bin/watchdog"
1217 "games/xchess"
1218 "misc/bigtest"
1219 "misc/calc"
1220 "misc/chat"
1221 "misc/mailing"
1222 "src/mkVers")
1223 (("#\\!.*picolisp32.*/bin/picolisp .*lib\\.l")
1224 shebang-line))
1225 (substitute* "src64/mkAsm"
1226 (("/usr/bin/")
1227 (string-append picolisp32 "/bin/"))))
1228 #t))
1229 (replace 'build
1230 (lambda _
1231 (invoke "make" "-C" "src" "tools" "gate")
1232 (invoke "make" "-C" "src64" "CC=gcc" "picolisp")))))))))
1233 (_
1234 (package
1235 (inherit picolisp32)
1236 (name "picolisp")))))
1237
1238(define-public janet
1239 (package
1240 (name "janet")
1241 (version "1.33.0")
1242 (source
1243 (origin
1244 (method git-fetch)
1245 (uri (git-reference
1246 (url "https://github.com/janet-lang/janet")
1247 (commit (string-append "v" version))))
1248 (file-name (git-file-name name version))
1249 (sha256
1250 (base32 "16wgljca7hp29fz5p2dnvy2cbscjx4imf85rhjwc1jkgdjswjxli"))))
1251 (build-system gnu-build-system)
1252 (arguments
1253 (list #:make-flags
1254 #~(list
1255 (string-append "DESTDIR=" #$output)
1256 (string-append "PREFIX=")
1257 (string-append "CC=" #$(cc-for-target)))
1258 #:test-target "test"
1259 #:phases
1260 #~(modify-phases %standard-phases
1261 (delete 'configure))))
1262 (home-page "https://janet-lang.org/")
1263 (synopsis "Functional, imperative and embeddable programming language")
1264 (description
1265 "Janet is a functional and imperative programming language. It can be
1266used for rapid prototyping, dynamic systems, and other domains where dynamic
1267languages shine. You can also add Janet scripting to an application by
1268embedding a single C file and two headers. It can be easily ported to new
1269platforms. The entire language (core library, interpreter, compiler,
1270assembler, PEG) is less than 1MB.")
1271 (license license:expat)))
1272
1273(define-public carp
1274 ;; Release 0.5.5 does not support GHC 9.2.
1275 (let ((commit "339722325ec607091f6035866ebedea2b69080fe")
1276 (revision "1"))
1277 (package
1278 (name "carp")
1279 (version (git-version "0.5.5" revision commit))
1280 (source (origin
1281 (method git-fetch)
1282 (uri (git-reference
1283 (url "https://github.com/carp-lang/Carp")
1284 (commit commit)))
1285 (file-name (git-file-name name version))
1286 (sha256
1287 (base32
1288 "0w0j3imi4270dsmrh96spsc9xllsk5rrh817l80q1nyay9p53xwd"))))
1289 (build-system haskell-build-system)
1290 (arguments
1291 (list #:phases
1292 #~(modify-phases %standard-phases
1293 ;; Carp looks inside the sources checkout to know where to
1294 ;; find its core libraries and other files.
1295 ;; Carp emits C code and tries to compile it with an external
1296 ;; C compiler. On Linux it defaults to Clang.
1297 (add-after 'install 'wrap-programs
1298 (lambda* (#:key inputs #:allow-other-keys)
1299 (define (wrap-carp-program program)
1300 (wrap-program (string-append
1301 #$output "/bin/" program)
1302 `("CARP_DIR" prefix
1303 (#$(package-source this-package)))
1304 `("PATH" prefix
1305 ,(list (dirname
1306 (search-input-file inputs "bin/clang"))
1307 (dirname
1308 (search-input-file inputs "bin/ld"))))
1309 `("C_INCLUDE_PATH" prefix
1310 ,(list (dirname
1311 (search-input-directory
1312 inputs "include/linux"))
1313 (dirname
1314 (search-input-file
1315 inputs "include/stdlib.h"))))))
1316
1317 (for-each wrap-carp-program
1318 (list "carp"
1319 "carp-header-parse")))))))
1320 (inputs
1321 (list bash-minimal
1322 clang
1323 ghc-blaze-markup
1324 ghc-blaze-html
1325 ghc-split
1326 ghc-ansi-terminal
1327 ghc-cmark
1328 ghc-edit-distance
1329 ghc-hashable
1330 ghc-open-browser
1331 ghc-optparse-applicative))
1332 (native-inputs
1333 (list ghc-hunit))
1334 (home-page "https://carp-lang.org/")
1335 (synopsis "Statically typed Lisp without a garbage collector")
1336 (description
1337 "@code{carp} is a Lisp-like programming language that compiles to
1338C. It features inferred static typing, macros, automatic memory
1339management without a garbage collector, a REPL, and straightforward
1340integration with code written in C.")
1341 (license license:asl2.0))))
1342
1343(define-public lisp-repl-core-dumper
1344 (package
1345 (name "lisp-repl-core-dumper")
1346 (version "0.8.0")
1347 (source
1348 (origin
1349 (method git-fetch)
1350 (uri (git-reference
1351 (url "https://gitlab.com/ambrevar/lisp-repl-core-dumper.git")
1352 (commit version)))
1353 (file-name (git-file-name name version))
1354 (sha256
1355 (base32 "04c12gi5izpkv8ha98z9qdkbmyrsq6ga060adrx53da8z31gnhk1"))))
1356 (build-system copy-build-system)
1357 (arguments
1358 '(#:install-plan
1359 '(("lisp-repl-core-dumper" "bin/"))
1360 #:phases
1361 (modify-phases %standard-phases
1362 (add-before 'install 'fix-utils-path
1363 (lambda* (#:key inputs #:allow-other-keys)
1364 (let* ((cat (search-input-file inputs "/bin/cat"))
1365 (paste (search-input-file inputs "/bin/paste"))
1366 (sort (search-input-file inputs "/bin/sort"))
1367 (basename (search-input-file inputs "/bin/basename"))
1368 (sed (search-input-file inputs "/bin/sed")))
1369 (substitute* "lisp-repl-core-dumper"
1370 (("\\$\\(basename") (string-append "$(" basename))
1371 (("\\<cat\\>") cat)
1372 (("\\<paste\\>") paste)
1373 (("\\<sed\\>") sed)
1374 (("\\<sort\\>") sort))))))))
1375 (inputs
1376 `(("coreutils" ,coreutils-minimal)
1377 ("sed" ,sed)))
1378 (home-page "https://gitlab.com/ambrevar/lisp-repl-core-dumper")
1379 (synopsis "Generate REPL-optimized Lisp cores on demand")
1380 (description
1381 "This tool generates Lisp images that can embed the provided systems
1382and make for REPLs that start blazing fast.
1383
1384@itemize
1385@item It’s portable and should work with any compiler.
1386@item It works for any REPL.
1387@item It allows you to include arbitrary libraries.
1388@end itemize\n")
1389 (license license:gpl3+)))
1390
1391(define-public buildapp
1392 (package
1393 (name "buildapp")
1394 (version "1.5.6")
1395 (source
1396 (origin
1397 (method git-fetch)
1398 (uri (git-reference
1399 (url "https://github.com/xach/buildapp")
1400 (commit (string-append "release-" version))))
1401 (file-name (git-file-name name version))
1402 (sha256
1403 (base32 "020ipjfqa3l8skd97cj5kq837wgpj28ygfxnkv64cnjrlbnzh161"))))
1404 (build-system gnu-build-system)
1405 (native-inputs
1406 (list sbcl))
1407 (arguments
1408 `(#:tests? #f
1409 #:make-flags
1410 (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
1411 #:strip-binaries? #f
1412 #:phases
1413 (modify-phases %standard-phases
1414 (delete 'configure)
1415 (add-after 'unpack 'set-home
1416 (lambda _
1417 (setenv "HOME" "/tmp")
1418 #t))
1419 (add-before 'install 'create-target-directory
1420 (lambda* (#:key outputs #:allow-other-keys)
1421 (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
1422 (mkdir-p bin)
1423 #t))))))
1424 (home-page "https://www.xach.com/lisp/buildapp/")
1425 (synopsis "Makes easy to build application executables with SBCL")
1426 (description
1427 "Buildapp is an application for SBCL or CCL that configures and saves an
1428executable Common Lisp image. It is similar to cl-launch and hu.dwim.build.")
1429 (license license:bsd-2)))
1430
1431(define-public eisl
1432 (package
1433 (name "eisl")
1434 (version "3.50")
1435 (source
1436 (origin
1437 (method git-fetch)
1438 (uri (git-reference
1439 (url "https://github.com/sasagawa888/eisl")
1440 (commit (string-append "v" version))))
1441 (file-name (git-file-name name version))
1442 (sha256
1443 (base32 "18alxwpvkcjfm63bc5kp6nn8351fl0p0ccxc8j9a7nb3fmg4fvyb"))))
1444 (build-system gnu-build-system)
1445 (inputs
1446 (list bash-minimal freeglut gdbm libiconv ncurses tcl tk))
1447 (native-inputs
1448 (list cppcheck))
1449 (arguments
1450 (list #:make-flags
1451 #~(list (string-append "PREFIX=" #$output)
1452 (string-append "CC=" #$(cc-for-target)))
1453 #:phases
1454 #~(modify-phases %standard-phases
1455 (add-after 'unpack 'fix-paths
1456 (lambda* (#:key inputs #:allow-other-keys)
1457 (substitute* "library/compiler.lsp"
1458 (("\"cc ")
1459 "\"gcc "))
1460 (substitute* "library/tcltk.lsp"
1461 (("include <tcl/tcl\\.h>")
1462 "include <tcl.h>")
1463 (("c-option \"-ltcl -ltk\" linux")
1464 "c-option \"-ltcl8.6 -ltk8.6\" linux"))))
1465 (delete 'configure)
1466 (add-after 'install 'wrap
1467 (lambda* (#:key inputs #:allow-other-keys)
1468 (wrap-program (string-append #$output "/bin/eisl")
1469 `("PATH" prefix
1470 ,(map (lambda (bin)
1471 (string-append (assoc-ref inputs bin) "/bin"))
1472 '("binutils" "coreutils" "gcc" "ld-wrapper")))
1473 `("LIBRARY_PATH" suffix
1474 ,(map (lambda (lib)
1475 (string-append (assoc-ref inputs lib) "/lib"))
1476 '("libc")))))))))
1477 (home-page "https://github.com/sasagawa888/eisl")
1478 (synopsis "Implementation of ISLisp")
1479 (description "Easy ISLISP (eisl) is an implementation of ISLisp which
1480includes a compiler as well as an interpreter.")
1481 (license (list license:bsd-2 ;; documents/license.txt
1482 license:expat ;; cii/LICENSE
1483 license:gpl2+ ;; nana/gdb/test.c and others under nana/
1484 license:bsd-3)))) ;; bench/*
1485
1486(define-public s7-bootstrap
1487 ;; Need s7-bootstrap to build libc_s7.so (for the REPL) and run tests
1488 (let ((commit "23a64facfac06c4bc23a7de8f04691c55f88bd40") ;no releases
1489 (revision "0"))
1490 (hidden-package
1491 (package
1492 (name "s7-bootstrap")
1493 (version (git-version "24.1" revision commit))
1494 (source (origin
1495 (method git-fetch)
1496 (uri (git-reference
1497 (url "https://cm-gitlab.stanford.edu/bil/s7.git")
1498 (commit commit)))
1499 (file-name (git-file-name name version))
1500 (sha256
1501 (base32
1502 "0fiw8lb7rswglixvn271la2q2hgwszrf2ckykhr6jjxdvmb9a7d0"))
1503 (patches (search-patches "s7-flint-3.patch"))))
1504 (build-system gnu-build-system)
1505 (arguments
1506 (list #:tests? #f ;no tests in bootstrap
1507 #:phases #~(modify-phases %standard-phases
1508 (delete 'configure) ;no configure
1509 (replace 'build
1510 (lambda _
1511 ;; using build commands from s7 home page
1512 (display "[BUILD] repl\n")
1513 (invoke #$(cc-for-target) "s7.c" "-o" "repl"
1514 "-I." "-O2" "-g"
1515 "-DWITH_MAIN"
1516 (string-append
1517 "-DS7_LOAD_PATH=\""
1518 #$output "/share/s7/scm\"")
1519 "-ldl" "-lm"
1520 "-Wl,-export-dynamic")
1521 (display "[BUILD] nrepl\n")
1522 (invoke #$(cc-for-target) "s7.c" "-o" "nrepl"
1523 "-I." "-O2" "-g"
1524 "-DWITH_MAIN" "-DWITH_NOTCURSES"
1525 (string-append
1526 "-DS7_LOAD_PATH=\""
1527 #$output "/share/s7/scm\"")
1528 "-ldl" "-lm" "-lnotcurses-core"
1529 "-Wl,-export-dynamic")
1530 (display "[BUILD] libarb_s7.so\n")
1531 (invoke #$(cc-for-target) "libarb_s7.c"
1532 "-I." "-O2" "-g"
1533 "-shared" "-o" "libarb_s7.so"
1534 "-lflint" "-lmpc" "-fPIC")
1535 (display "[BUILD] libnotcurses_s7.so\n")
1536 (invoke #$(cc-for-target) "notcurses_s7.c"
1537 "-I." "-O2" "-g"
1538 "-shared" "-o" "libnotcurses_s7.so"
1539 "-lnotcurses-core" "-fPIC")
1540 ;; Need s7.o and ffitest for tests
1541 (display "[BUILD] s7.o\n")
1542 (invoke #$(cc-for-target) "-c" "s7.c" "-o"
1543 "s7.o" "-I." "-O2" "-ldl" "-lm")
1544 (display "[BUILD] ffitest\n")
1545 (invoke #$(cc-for-target) "-o" "ffitest"
1546 "ffitest.c" "-g2" "s7.o" "-lm" "-I."
1547 "-ldl" "-Wl,-export-dynamic")))
1548 (add-before 'check 'install-scm
1549 ;; scm files need to be installed before testing
1550 (lambda _
1551 (for-each (lambda (x)
1552 (install-file
1553 x (string-append
1554 #$output "/share/s7/scm/")))
1555 (find-files "." "\\.scm"))))
1556 (replace 'install
1557 (lambda _
1558 (let ((bin (string-append #$output "/bin"))
1559 (share (string-append #$output
1560 "/share/s7/"))
1561 (doc (string-append #$output
1562 "/share/doc/s7/"))
1563 (lib (string-append #$output "/lib"))
1564 (inc (string-append #$output "/include/")))
1565 (install-file "repl" bin)
1566 (install-file "nrepl" bin)
1567 (install-file "ffitest" bin)
1568 (install-file "libarb_s7.so" lib)
1569 (install-file "libnotcurses_s7.so" lib)
1570 (install-file "s7.c" share)
1571 (install-file "s7.h" inc)
1572 (install-file "s7.html" doc)))))))
1573 (inputs (list flint mpc notcurses))
1574 (home-page "https://ccrma.stanford.edu/software/snd/snd/s7.html")
1575 (synopsis "Scheme interpreter intended as an extension language")
1576 (description
1577 "s7 is a Scheme interpreter intended as an extension language for
1578other applications. It exists as just two files, @code{s7.c} and @code{s7.h},
1579that may be copied into the source tree of another application. There are no
1580libraries, no run-time init files, and no configuration scripts. It can also
1581be built as a stand-alone REPL interpreter.")
1582 (license license:bsd-0)))))
1583
1584(define-public s7
1585 (package
1586 (inherit s7-bootstrap)
1587 (name "s7")
1588 (arguments
1589 (substitute-keyword-arguments
1590 (strip-keyword-arguments
1591 '(#:tests?)
1592 (package-arguments s7-bootstrap))
1593 ((#:phases phases)
1594 #~(modify-phases #$phases
1595 (add-after 'unpack 'patch
1596 (lambda _
1597 (substitute* "s7.c"
1598 (("libc_s7.so")
1599 (string-append #$output "/lib/libc_s7.so")))))
1600 (add-after 'build 'build-full
1601 (lambda _
1602 (invoke "repl" "./libc.scm")))
1603 (replace 'check
1604 (lambda* (#:key tests? #:allow-other-keys)
1605 (when tests?
1606 (invoke "repl" "./s7test.scm"))))
1607 (add-after 'install 'install-full
1608 (lambda _
1609 (install-file "libc_s7.so"
1610 (string-append #$output "/lib/"))
1611 (delete-file (string-append #$output "/bin/ffitest"))))))))
1612 (native-inputs (list s7-bootstrap))
1613 (properties (alist-delete 'hidden? (package-properties s7-bootstrap)))))
1614
1615(define-public roswell
1616 (package
1617 (name "roswell")
1618 (version "23.10.14.114")
1619 (home-page "https://github.com/roswell/roswell")
1620 (source
1621 (origin
1622 (method git-fetch)
1623 (uri (git-reference
1624 (url "https://github.com/roswell/roswell")
1625 (commit (string-append "v" version))))
1626 (file-name (git-file-name name version))
1627 (sha256
1628 (base32 "05w5sjh1bfy2wnblc09cb9qs8h7hxkx5hcqlbgpn7md32b0m4h7g"))))
1629 (build-system gnu-build-system)
1630 (arguments
1631 (list #:configure-flags #~(list (string-append "--prefix=" #$output))
1632 #:tests? #f))
1633 (native-inputs
1634 (list autoconf automake intltool))
1635 (inputs
1636 (list curl))
1637 (propagated-inputs
1638 ;; Has to be propagated in order to be found during setup.
1639 (list gnu-make patchelf))
1640 (synopsis "Common Lisp implementation manager, launcher, and more")
1641 (description
1642 "Roswell started out as a command-line tool with the aim to make
1643installing and managing Common Lisp implementations really simple and easy.
1644Roswell has now evolved into a full-stack environment for Common Lisp
1645development, and has many features that makes it easy to test, share, and
1646distribute your Lisp applications.
1647
1648Roswell is still in beta. Despite this, the basic interfaces are stable and
1649not likely to change.")
1650 (license license:expat)))