projects/guix·blob ruby-team · refs

1548 lines · 66.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013-2016, 2018-2021 Ludovic Courtès <[email protected]>
3;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <[email protected]>
4;;; Copyright © 2015, 2016 Federico Beffa <[email protected]>
5;;; Copyright © 2016 Ricardo Wurmus <[email protected]>
6;;; Copyright © 2016, 2017, 2020 Efraim Flashner <[email protected]>
7;;; Copyright © 2016 Jan Nieuwenhuizen <[email protected]>
8;;; Copyright © 2016, 2017 Nikita <[email protected]>
9;;; Copyright © 2017 John Darrington <[email protected]>
10;;; Copyright © 2017 Clément Lassieur <[email protected]>
11;;; Copyright © 2017-2020 Tobias Geerinckx-Rice <[email protected]>
12;;; Copyright © 2018 Adam Massmann <[email protected]>
13;;; Copyright © 2018 Gabriel Hondet <[email protected]>
14;;; Copyright © 2019 Carlo Zancanaro <[email protected]>
15;;; Copyright © 2020 Pierre Neidhardt <[email protected]>
16;;; Copyright © 2020 Brett Gilio <[email protected]>
17;;; Copyright © 2020 Edouard Klein <[email protected]>
18;;; Copyright © 2020 Martin Becze <[email protected]>
19;;; Copyright © 2021 Philip McGrath <[email protected]>
20;;; Copyright © 2021 Guillaume Le Vaillant <[email protected]>
21;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
22;;; Copyright © 2022 Morgan Smith <[email protected]>
23;;; Copyright © 2022 jgart <[email protected]>
24;;; Copyright © 2022 Robby Zambito <[email protected]>
25;;; Copyright © 2023, 2024 Andrew Whatson <[email protected]>
26;;; Copyright © 2023, 2024 Juliana Sims <[email protected]>
27;;; Copyright © 2023 Maxim Cournoyer <[email protected]>
28;;; Copyright © 2024 Skylar Hill <[email protected]>
29;;; Copyright © 2024, 2025 Artyom V. Poptsov <[email protected]>
30;;; Copyright © 2024 Zheng Junjie <[email protected]>
31;;; Copyright © 2024 Adam Faiz <[email protected]>
32;;; Copyright © 2024, 2025 Zhu Zihao <[email protected]>
33;;; Copyright © 2025 Ashish SHUKLA <[email protected]>
34;;; Copyright © 2026 Spencer King <[email protected]>
35;;;
36;;; This file is part of GNU Guix.
37;;;
38;;; GNU Guix is free software; you can redistribute it and/or modify it
39;;; under the terms of the GNU General Public License as published by
40;;; the Free Software Foundation; either version 3 of the License, or (at
41;;; your option) any later version.
42;;;
43;;; GNU Guix is distributed in the hope that it will be useful, but
44;;; WITHOUT ANY WARRANTY; without even the implied warranty of
45;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46;;; GNU General Public License for more details.
47;;;
48;;; You should have received a copy of the GNU General Public License
49;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
50
51(define-module (gnu packages scheme)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages bdw-gc)
56 #:use-module (gnu packages build-tools)
57 #:use-module (gnu packages chez)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages databases)
60 #:use-module (gnu packages dns)
61 #:use-module (gnu packages emacs)
62 #:use-module (gnu packages fontutils)
63 #:use-module (gnu packages gcc)
64 #:use-module (gnu packages ghostscript)
65 #:use-module (gnu packages gl)
66 #:use-module (gnu packages glib)
67 #:use-module (gnu packages gtk)
68 #:use-module (gnu packages guile)
69 #:use-module (gnu packages guile-xyz)
70 #:use-module (gnu packages haskell-xyz)
71 #:use-module (gnu packages image)
72 #:use-module (gnu packages java)
73 #:use-module (gnu packages libedit)
74 #:use-module (gnu packages libevent)
75 #:use-module (gnu packages libffi)
76 #:use-module (gnu packages libphidget)
77 #:use-module (gnu packages libunistring)
78 #:use-module (gnu packages linux)
79 #:use-module (gnu packages lisp-check)
80 #:use-module (gnu packages lisp-xyz)
81 #:use-module (gnu packages llvm)
82 #:use-module (gnu packages m4)
83 #:use-module (gnu packages man)
84 #:use-module (gnu packages multiprecision)
85 #:use-module (gnu packages ncurses)
86 #:use-module (gnu packages netpbm)
87 #:use-module (gnu packages package-management)
88 #:use-module (gnu packages pcre)
89 #:use-module (gnu packages perl)
90 #:use-module (gnu packages pkg-config)
91 #:use-module (gnu packages readline)
92 #:use-module (gnu packages sqlite)
93 #:use-module (gnu packages tex)
94 #:use-module (gnu packages texinfo)
95 #:use-module (gnu packages tls)
96 #:use-module (gnu packages version-control)
97 #:use-module (gnu packages xorg)
98 #:use-module (gnu packages)
99 #:use-module (guix build-system asdf)
100 #:use-module (guix build-system cmake)
101 #:use-module (guix build-system copy)
102 #:use-module (guix build-system emacs)
103 #:use-module (guix build-system gnu)
104 #:use-module (guix build-system trivial)
105 #:use-module (guix download)
106 #:use-module (guix gexp)
107 #:use-module (guix git-download)
108 #:use-module ((guix licenses) #:prefix license:)
109 #:use-module (guix packages)
110 #:use-module (guix utils)
111 #:use-module (ice-9 match)
112 #:use-module (srfi srfi-1))
113
114(define-public mit-scheme
115 (package
116 (name "mit-scheme")
117 (version "12.1")
118 (source #f) ; See below.
119 (outputs '("out" "doc"))
120 (build-system gnu-build-system)
121 (arguments
122 (list
123 ;; XXX: Some makefile dependencies are probably wrong, leading to
124 ;; missing files when building in parallel.
125 #:parallel-build? #f
126 #:make-flags #~(list "compile-microcode")
127 #:phases
128 #~(modify-phases %standard-phases
129 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
130 ;; compile from the architecture-specific tarballs, which contain
131 ;; pre-built binaries. It leads to more efficient code than when
132 ;; building the tarball that contains generated C code instead of
133 ;; those binaries.
134 (replace 'unpack
135 (lambda* (#:key inputs #:allow-other-keys)
136 ((assoc-ref %standard-phases 'unpack)
137 #:inputs inputs
138 #:source
139 #+(origin
140 (method url-fetch)
141 (uri
142 (string-append
143 "mirror://gnu/mit-scheme/stable.pkg/" version
144 "/mit-scheme-"
145 (cond
146 ((target-x86-64?)
147 (string-append version "-x86-64"))
148 ((target-aarch64?)
149 (string-append version "-aarch64le"))
150 (else
151 ;; XXX: According to the manual, it should exist, but
152 ;; seems dropped/forgotten starting from version 10.1.
153 (string-append "c-" version)))
154 ".tar.gz"))
155 (sha256
156 (cond
157 ((target-x86-64?)
158 (base32
159 "035f92vni0vqmgj9hq2i7vwasz7crx52wll4823vhfkm1qdv5ywc"))
160 ((target-aarch64?)
161 (base32
162 "12ra9bc93x8g07impbd8jr6djjzwpb9qvh9zhxvvrba3332zx3vh"))
163 (else
164 (base32 "\
165aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))))))
166 (chdir "src")))
167 (add-after 'unpack 'patch-/bin/sh
168 (lambda* (#:key inputs native-inputs #:allow-other-keys)
169 (let ((sh (search-input-file (or native-inputs inputs)
170 "bin/sh")))
171 (setenv "CONFIG_SHELL" sh)
172 (substitute* '("../tests/ffi/autogen.sh"
173 "../tests/ffi/autobuild.sh"
174 "../tests/ffi/test-ffi.sh"
175 "../tests/runtime/test-process.scm"
176 "runtime/unxprm.scm")
177 (("/bin/sh")
178 sh)
179 (("\\./autogen\\.sh")
180 (string-append sh " autogen.sh"))
181 (("\\./configure")
182 (string-append sh " configure"))))))
183 (add-after 'configure 'configure-doc
184 (lambda* (#:key inputs native-inputs #:allow-other-keys)
185 (with-directory-excursion "../doc"
186 (let* ((sh (search-input-file (or native-inputs inputs)
187 "bin/sh")))
188 (mkdir-p #$output:doc)
189 (invoke sh "./configure"
190 (string-append "SHELL=" sh)
191 (string-append "--prefix=" #$output:doc)
192 (string-append "--docdir=" #$output:doc
193 "/share/doc/" #$name "-" #$version))))))
194 (add-after 'build 'build-doc
195 (lambda _
196 (with-directory-excursion "../doc"
197 (invoke "make" "install"))))
198 (add-after 'install 'fixup-install
199 (lambda _
200 (let ((share (string-append #$output "/share"))
201 (dest (string-append #$output:doc "/share/info/")))
202 (for-each
203 (lambda (file) (install-file file dest))
204 (find-files share "\\.info\\.gz$"))
205 (delete-file-recursively share))))
206 (add-before 'check 'disable-slow-tests
207 (lambda* (#:key inputs native-inputs #:allow-other-keys)
208 (setenv "FAST" "y")
209 (setenv "SHELL" (search-input-file (or native-inputs inputs)
210 "bin/sh")))))))
211 (native-inputs
212 ;; XXX: Autoconf, Automake, and Libtool are necessary for the FFI tests.
213 (list bash-minimal
214 autoconf
215 automake
216 libtool
217 (texlive-local-tree (list texlive-epsf texlive-texinfo))
218 texinfo
219 ghostscript
220 m4))
221 (inputs (list libx11 ncurses))
222 ;; XXX: Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
223 (supported-systems '("x86_64-linux" "aarch64-linux"))
224 (home-page "https://www.gnu.org/software/mit-scheme/")
225 (synopsis "Scheme implementation with integrated editor and debugger")
226 (description
227 "GNU/MIT Scheme is an implementation of the Scheme programming
228language. It provides an interpreter, a compiler and a debugger. It also
229features an integrated Emacs-like editor and a large runtime library.")
230 (license license:gpl2+)
231 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
232
233(define-public bigloo
234 ;; Upstream modifies source tarballs in place, making significant changes
235 ;; long after the initial publication: <https://bugs.gnu.org/33525>.
236 (let ((upstream-version "4.6a"))
237 (package
238 (name "bigloo")
239 (version "4.6a")
240 (source (origin
241 (method url-fetch)
242 (uri (string-append
243 "https://www-sop.inria.fr/indes/fp/Bigloo/download/bigloo-"
244 upstream-version ".tar.gz"))
245 (sha256
246 (base32
247 "0xvrd9557x3n9s981ppz27xscrr5lf0g367fxim2xnv2a5rh4wni"))
248 ;; Remove bundled libraries.
249 (modules '((guix build utils)))
250 (snippet
251 #~(begin
252 (for-each delete-file-recursively
253 '("gc" "gmp" "libuv" "libunistring" "pcre"))))))
254 (build-system gnu-build-system)
255 (arguments
256 (list
257 #:test-target "test"
258 #:phases
259 #~(modify-phases %standard-phases
260 (add-after 'unpack 'fix-gmp-detection
261 (lambda _
262 (substitute* "configure"
263 (("gmpversion=`\\$autoconf gmp --lib=\\$gmplib`")
264 "gmpversion=`\\$autoconf gmp --lib=\"\\$gmplib\"`"))))
265 (replace 'configure
266 (lambda _
267
268 (substitute* "configure"
269 (("^shell=.*$")
270 (string-append "shell=" (which "bash") "\n"))
271 (("`date`") "0"))
272 (substitute* "autoconf/runtest.in"
273 ((", @DATE@") ""))
274 (substitute* "autoconf/osversion"
275 (("^version.*$") "version=\"\"\n"))
276 (substitute* "comptime/Makefile"
277 (("\\$\\(LDCOMPLIBS\\)")
278 "$(LDCOMPLIBS) $(LDFLAGS)"))
279
280 ;; The `configure' script doesn't understand options
281 ;; of those of Autoconf.
282 (invoke "./configure"
283 (string-append "--prefix=" #$output)
284 ;; use system libraries
285 "--customgc=no"
286 "--enable-gmp"
287 "--customgmp=no"
288 "--customunistring=no"
289 "--customlibuv=no"
290 (string-append"--mv=" (which "mv"))
291 (string-append "--rm=" (which "rm"))
292 "--cflags=-fPIC"
293 (string-append "--ldflags=-Wl,-rpath=" #$output
294 "/lib/bigloo/" #$version)
295 (string-append "--lispdir=" #$output
296 "/share/emacs/site-lisp")
297 "--sharedbde=yes"
298 "--sharedcompiler=yes"
299 "--disable-patch")))
300 (add-after 'install 'install-emacs-modes
301 (lambda _
302 (invoke "make" "-C" "bmacs" "all" "install"
303 (string-append "EMACSBRAND=emacs25")
304 (string-append "EMACSDIR="
305 #$output "/share/emacs/site-lisp")))))))
306 (inputs
307 (list gmp ;bigloo.h refers to gmp.h
308 (module-ref
309 (resolve-interface '(gnu packages debug)) 'libbacktrace)
310 libgc
311 libunistring
312 libuv
313 openssl
314 pcre2
315 sqlite
316 ;; Optional APIs for which Bigloo has bindings.
317 avahi
318 libphidget
319 pcre))
320 (native-inputs
321 (list emacs ;UDE needs the X version of Emacs
322 pkg-config
323 which))
324 (home-page "https://www-sop.inria.fr/indes/fp/Bigloo/")
325 (synopsis "Efficient Scheme compiler")
326 (description
327 "Bigloo is a Scheme implementation devoted to one goal: enabling Scheme
328based programming style where C(++) is usually required. Bigloo attempts to
329make Scheme practical by offering features usually presented by traditional
330programming languages but not offered by Scheme and functional programming.
331Bigloo compiles Scheme modules. It delivers small and fast stand alone binary
332executables. Bigloo enables full connections between Scheme and C programs
333and between Scheme and Java programs.")
334 (license license:gpl2+))))
335
336(define-public hop
337 (package
338 (name "hop")
339 (version "3.2.0-pre1")
340 (source (origin
341 (method url-fetch)
342 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
343 version ".tar.gz"))
344 (sha256
345 (base32
346 "0jf418d0s9imv98s6qrpjxr1mdaxr37knh5qyfl5y4a9cc41mlg5"))))
347 (build-system gnu-build-system)
348 (arguments
349 `(#:test-target "test"
350 #:make-flags '("BIGLOO=bigloo")
351 #:parallel-build? #f
352 #:phases
353 (modify-phases %standard-phases
354 (replace 'configure
355 (lambda* (#:key inputs outputs #:allow-other-keys)
356 (let ((out (assoc-ref outputs "out")))
357 (substitute* '("tools/Makefile"
358 "test/hopjs/TEST.in")
359 (("/bin/rm") (which "rm")))
360 (invoke "./configure"
361 (string-append "--prefix=" out)
362 "--hostcc=gcc"
363 (string-append "--blflags="
364 ;; user flags completely override useful
365 ;; default flags, so repeat them here.
366 "-copt \\$(CPICFLAGS) "
367 "-L \\$(BUILDLIBDIR) "
368 "-ldopt -Wl,-rpath," out "/lib"))))))))
369 (inputs (list avahi
370 bigloo
371 libgc
372 libunistring
373 libuv
374 pcre
375 sqlite
376 which))
377 (home-page "http://hop.inria.fr/")
378 (synopsis "Multi-tier programming language for the Web 2.0")
379 (description
380 "HOP is a multi-tier programming language for the Web 2.0 and the
381so-called diffuse Web. It is designed for programming interactive web
382applications in many fields such as multimedia (web galleries, music players,
383...), ubiquitous and house automation (SmartPhones, personal appliance),
384mashups, office (web agendas, mail clients, ...), etc.")
385 (license license:gpl2+)))
386
387(define-public scheme48
388 (package
389 (name "scheme48")
390 (version "1.9.3")
391 (source (origin
392 (method url-fetch)
393 (uri (string-append "https://s48.org/" version
394 "/scheme48-" version ".tgz"))
395 (sha256
396 (base32
397 "0k4hygd0k22g5shnm5wxg6vdz6qzs40mid1iz2q10hd1zkrskxbf"))
398 (patches (search-patches "scheme48-tests.patch"))))
399 (build-system gnu-build-system)
400 (home-page "https://s48.org/")
401 (synopsis "Scheme implementation using a bytecode interpreter")
402 (description
403 "Scheme 48 is an implementation of Scheme based on a byte-code
404interpreter and is designed to be used as a testbed for experiments in
405implementation techniques and as an expository tool.")
406
407 ;; Most files are BSD-3; see COPYING for the few exceptions.
408 (license license:bsd-3)))
409
410(define-public scheme48-prescheme
411 (package
412 (inherit scheme48)
413 (name "scheme48-prescheme")
414 (arguments
415 (list
416 #:tests? #f ; tests only cover scheme48
417 #:modules '((guix build gnu-build-system)
418 (guix build utils)
419 (ice-9 popen)
420 (srfi srfi-1))
421 #:phases
422 #~(modify-phases %standard-phases
423 (add-after 'configure 'patch-prescheme-version
424 (lambda _
425 ;; Ensure the Pre-Scheme version matches the package version
426 (call-with-output-file "ps-compiler/minor-version-number"
427 (lambda (port)
428 (let* ((version #$(package-version this-package))
429 (vparts (string-split version #\.))
430 (vminor (string-join (drop vparts 1) ".")))
431 (write vminor port))))))
432 (add-after 'configure 'patch-prescheme-headers
433 (lambda _
434 ;; Rename "io.h" to play nicely with others
435 (copy-file "c/io.h" "c/prescheme-io.h")
436 (substitute* "c/prescheme.h"
437 (("^#include \"io\\.h\"")
438 "#include \"prescheme-io.h\""))))
439 (add-after 'configure 'generate-pkg-config
440 (lambda _
441 ;; Generate a pkg-config file
442 (call-with-output-file "prescheme.pc"
443 (lambda (port)
444 (let ((s48-version #$(package-version scheme48))
445 (version #$(package-version this-package)))
446 (format port (string-join
447 '("prefix=~a"
448 "exec_prefix=${prefix}"
449 "libdir=${prefix}/lib/scheme48-~a"
450 "includedir=${prefix}/include"
451 ""
452 "Name: Pre-Scheme (Scheme 48)"
453 "Description: Pre-Scheme C runtime"
454 "Version: ~a"
455 "Libs: -L${libdir} -lprescheme"
456 "Cflags: -I${includedir}")
457 "\n" 'suffix)
458 #$output s48-version version))))))
459 (add-after 'configure 'generate-prescheme-wrapper
460 (lambda _
461 ;; Generate a wrapper to load and run ps-compiler.image
462 (call-with-output-file "prescheme"
463 (lambda (port)
464 (let ((s48-version #$(package-version scheme48)))
465 (format port (string-join
466 '("#!/bin/sh"
467 "scheme48=~a/lib/scheme48-~a/scheme48vm"
468 "prescheme=~a/lib/scheme48-~a/prescheme.image"
469 "exec ${scheme48} -i ${prescheme} \"$@\"")
470 "\n" 'suffix)
471 #$scheme48 s48-version #$output s48-version))))
472 (chmod "prescheme" #o755)))
473 (replace 'build
474 (lambda _
475 ;; Build a minimal static library for linking Pre-Scheme code
476 (let ((lib "c/libprescheme.a")
477 (objs '("c/unix/io.o"
478 "c/unix/misc.o")))
479 (apply invoke "make" objs)
480 (apply invoke "ar" "rcs" lib objs))
481 ;; Dump a Scheme 48 image with both the Pre-Scheme compatibility
482 ;; library and compiler pre-loaded, courtesy of Taylor Campbell's
483 ;; Pre-Scheme Manual:
484 ;; https://groups.scheme.org/prescheme/1.3/#Invoking-the-Pre_002dScheme-compiler
485 (with-directory-excursion "ps-compiler"
486 (let ((version #$(package-version this-package))
487 (port (open-pipe* OPEN_WRITE "scheme48")))
488 (format port (string-join
489 '(",batch"
490 ",config ,load ../scheme/prescheme/interface.scm"
491 ",config ,load ../scheme/prescheme/package-defs.scm"
492 ",exec ,load load-ps-compiler.scm"
493 ",in prescheme-compiler prescheme-compiler"
494 ",user (define prescheme-compiler ##)"
495 ",dump ../prescheme.image \"(Pre-Scheme ~a)\""
496 ",exit")
497 "\n" 'suffix)
498 version)
499 (close-pipe port)))))
500 (replace 'install
501 (lambda _
502 (let* ((s48-version #$(package-version scheme48))
503 (bin-dir (string-append #$output "/bin"))
504 (lib-dir (string-append #$output "/lib/scheme48-" s48-version))
505 (pkgconf-dir (string-append #$output "/lib/pkgconfig"))
506 (share-dir (string-append #$output "/share/scheme48-" s48-version))
507 (include-dir (string-append #$output "/include")))
508 ;; Install Pre-Scheme compiler image
509 (install-file "prescheme" bin-dir)
510 (install-file "prescheme.image" lib-dir)
511 ;; Install Pre-Scheme config, headers, and lib
512 (install-file "prescheme.pc" pkgconf-dir)
513 (install-file "c/prescheme.h" include-dir)
514 (install-file "c/prescheme-io.h" include-dir)
515 (install-file "c/libprescheme.a" lib-dir)
516 ;; Install Pre-Scheme sources
517 (copy-recursively "scheme/prescheme"
518 (string-append share-dir "/prescheme"))
519 (copy-recursively "ps-compiler"
520 (string-append share-dir "/ps-compiler"))
521 ;; Remove files specific to building the Scheme 48 VM
522 (for-each (lambda (file)
523 (delete-file (string-append share-dir "/" file)))
524 '("ps-compiler/compile-bibop-gc-32.scm"
525 "ps-compiler/compile-bibop-gc-64.scm"
526 "ps-compiler/compile-gc.scm"
527 "ps-compiler/compile-twospace-gc-32.scm"
528 "ps-compiler/compile-twospace-gc-64.scm"
529 "ps-compiler/compile-vm-no-gc-32.scm"
530 "ps-compiler/compile-vm-no-gc-64.scm"))))))))
531 (propagated-inputs (list scheme48))
532 (home-page "http://s48.org/")
533 (synopsis "Pre-Scheme compiler from Scheme 48")
534 (description
535 "Pre-Scheme is a statically compilable dialect of Scheme, used to implement the
536Scheme 48 virtual machine. Scheme 48 ships with a Pre-Scheme to C compiler written
537in Scheme, and a runtime library which allows Pre-Scheme code to run as Scheme.")
538 (license license:bsd-3)))
539
540(define-public gambit-c
541 (package
542 (name "gambit-c")
543 (version "4.9.7")
544 (source
545 (origin
546 (method url-fetch)
547 (uri (string-append
548 "http://www.gambitscheme.org/" version "/gambit-v"
549 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
550 ".tgz"))
551 (sha256
552 (base32 "08iw6jfvn4l09j52p28s9f8x551590pv300nc0cfg0isrkax6hsj"))))
553 (build-system gnu-build-system)
554 (arguments
555 '(#:configure-flags
556 ;; According to the ./configure script, this makes the build slower and
557 ;; use >= 1 GB memory, but makes Gambit much faster.
558 '("--enable-single-host")))
559 (home-page "http://www.gambitscheme.org/")
560 (synopsis "Efficient Scheme interpreter and compiler")
561 (description
562 "Gambit consists of two main programs: gsi, the Gambit Scheme
563interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
564the complete execution and debugging environment. The compiler is the
565interpreter extended with the capability of generating executable files. The
566compiler can produce standalone executables or compiled modules which can be
567loaded at run time. Interpreted code and compiled code can be freely
568mixed.")
569 ;; Dual license.
570 (license (list license:lgpl2.1+ license:asl2.0))))
571
572(define-public chibi-scheme
573 (package
574 (name "chibi-scheme")
575 (version "0.12")
576 (home-page "https://github.com/ashinn/chibi-scheme")
577 (source
578 (origin
579 (method git-fetch)
580 (uri (git-reference (url home-page) (commit version)))
581 (file-name (git-file-name name version))
582 (sha256
583 (base32 "0dhz141jjix7lsklaxfd6xv32s5wl5a3g2pha7wh70bayvyzf12d"))))
584 (build-system gnu-build-system)
585 (arguments
586 (list #:phases
587 #~(modify-phases %standard-phases
588 (delete 'configure)) ; no configure script
589 #:make-flags
590 #~(list
591 #$@(if
592 (%current-target-system)
593 #~((string-append
594 "CHIBI=" #+(this-package-native-input "chibi-scheme")
595 "/bin/chibi-scheme"))
596 #~())
597 (string-append "PREFIX=" #$output)
598 (string-append "CC=" #$(cc-for-target))
599 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
600 #:test-target "test"))
601 (native-inputs (if (%current-target-system)
602 (list this-package)
603 (list)))
604 (synopsis "Small embeddable Scheme implementation")
605 (description
606 "Chibi-Scheme is a very small library with no external dependencies
607intended for use as an extension and scripting language in C programs. In
608addition to support for lightweight VM-based threads, each VM itself runs in
609an isolated heap allowing multiple VMs to run simultaneously in different OS
610threads.")
611 (license license:bsd-3)))
612
613(define-public unsyntax
614 (let ((commit "144772eeef4a812dd79515b67010d33ad2e7e890")
615 (revision "0"))
616 (package
617 (name "unsyntax")
618 (version (git-version "0.0.3" revision commit))
619 (source
620 (origin
621 (method git-fetch)
622 (uri (git-reference
623 (url "https://gitlab.com/nieper/unsyntax.git")
624 (commit commit)))
625 (file-name (git-file-name name version))
626 (sha256
627 (base32 "1ia58xdrywsm0dg19kmkghnrgw6gj2bsaypyjmbpirrila73cqk0"))))
628 (build-system gnu-build-system)
629 (arguments
630 (list #:make-flags
631 #~(list "gl_public_submodule_commit=") ; disable submodule checks
632 #:phases
633 #~(modify-phases %standard-phases
634 (add-before 'bootstrap 'prepare-bootstrap
635 (lambda _
636 ;; Unsyntax relies on bootstrap to fetch gnulib, we use
637 ;; the sources from guix's gnulib package instead.
638 (copy-recursively (getenv "GNULIB_SRCDIR") ".gnulib")
639 (setenv "GNULIB_SRCDIR" ".gnulib")
640 (patch-shebang ".gnulib/gnulib-tool")
641 (patch-shebang ".gnulib/build-aux/bootstrap")
642 (patch-shebang ".gnulib/build-aux/git-version-gen")
643 (patch-shebang ".gnulib/build-aux/prefix-gnulib-mk")
644 ;; The bootstrap_sync option updates the bootstrap script
645 ;; and runs it with CONFIG_SHELL, make sure it's correct.
646 (setenv "CONFIG_SHELL" (which "sh"))
647 ;; Tell git-version-gen the correct version number.
648 (call-with-output-file ".tarball-version"
649 (lambda (port)
650 (display #$version port)))))
651 (add-before 'configure 'patch-exec-paths
652 (lambda _
653 ;; Fix hard-coded references to chibi-scheme, using the
654 ;; configured interpreter path instead. This avoids the need
655 ;; for chibi-scheme as a propagated input.
656 (substitute* '("src/compile-unsyntax.in"
657 "src/expand-unsyntax.in"
658 "src/unsyntax-scheme.in")
659 (("chibi-scheme") "'@CHIBI_SCHEME@'")))))))
660 (native-inputs
661 (list autoconf automake libtool git gnulib help2man perl texinfo))
662 (inputs
663 (list chibi-scheme))
664 (home-page "https://www.unsyntax.org")
665 (synopsis "Expander for R7RS programs")
666 (description
667 "Unsyntax is an implementation of the Scheme programming language,
668specifically of its R7RS standard, and includes a number of extensions.
669Unsyntax evaluates Scheme expressions and compiles and runs Scheme programs by
670first expanding them into a minimal dialect of R7RS (small) without any
671syntactic extensions. The resulting expression or program is then evaluated
672by an existing Scheme implementation.")
673 (license license:expat))))
674
675(define-public ypsilon
676 (let ((commit "9982a834cd08bfa45e7db33b6a7b7d39c03f5632")
677 (revision "0"))
678 (package
679 (name "ypsilon")
680 (version "2.0.8")
681 (source
682 (origin
683 (method git-fetch)
684 (uri (git-reference
685 (url "https://github.com/fujita-y/ypsilon")
686 (commit commit)))
687 (sha256
688 (base32 "199bggcdgww2c3r5fzlhzx7mdwl3l579skraar09bpjzp6kcxk1n"))
689 (patches (search-patches "ypsilon-Use-GNU-toolchain-as-default.patch"))
690 (file-name (git-file-name name version))))
691 (build-system cmake-build-system)
692 (inputs (list llvm-15 libffi))
693 (arguments
694 (list
695 #:out-of-source? #f
696 #:phases
697 #~(modify-phases %standard-phases
698 (add-after 'unpack 'disable-asan
699 (lambda _
700 (substitute* "CMakeLists.txt"
701 ;; TODO: Fix reported memory leak when rebuilding heap files
702 (("-fsanitize=address") ""))))
703 (add-after 'disable-asan 'disable-march
704 (lambda _
705 (substitute* "Makefile"
706 (("-march=x86") "")
707 (("-march=x86-64") ""))))
708 (add-after 'disable-march 'fix-test-sitelib
709 (lambda _
710 (substitute* "CMakeLists.txt"
711 (("--sitelib=./test:./sitelib")
712 "--sitelib=./source/test:./source/sitelib"))
713 (substitute* '("CMakeLists.txt" "test/r6rs-lib.scm")
714 (("./test/") "./source/test/"))
715 (substitute* "test/r4rstest.scm"
716 (("(current-directory )\"test\"" all _)
717 (string-append _ "\"source/test\"")))))
718 (add-before 'configure 'set-home
719 (lambda _
720 (setenv "HOME"
721 (getcwd))))
722 (add-after 'build 'rebuild-heap-files
723 (lambda _
724 (substitute* "src/core.h"
725 (("(#define UNBOUND_GLOC_RETURN_UNSPEC )0" all _)
726 (string-append _ "1")))
727 (with-directory-excursion "heap"
728 (invoke "make"))
729 (invoke "make")
730 (with-directory-excursion "heap"
731 (invoke "make"))
732 (substitute* "src/core.h"
733 (("(#define UNBOUND_GLOC_RETURN_UNSPEC )1" all _)
734 (string-append _ "0")))
735 (invoke "make"))))))
736 (synopsis "R7RS/R6RS Scheme Implementation")
737 (description
738 "Ypsilon Scheme is an R7RS/R6RS Scheme implementation with
739on-the-fly FFI and native stub code generation, making use of the LLVM.")
740 (home-page "https://github.com/fujita-y/ypsilon")
741 (license license:bsd-2))))
742
743(define-public scheme48-rx
744 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
745 (revision "2"))
746 (package
747 (name "scheme48-rx")
748 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
749 (source
750 (origin
751 (method git-fetch)
752 (uri (git-reference
753 (url "https://github.com/scheme/rx")
754 (commit commit)))
755 (sha256
756 (base32
757 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
758 (file-name (string-append name "-" version "-checkout"))))
759 (build-system trivial-build-system)
760 (arguments
761 `(#:modules ((guix build utils))
762 #:builder
763 (begin
764 (use-modules (guix build utils))
765 (let ((share (string-append %output
766 "/share/scheme48-"
767 ,(package-version scheme48)
768 "/rx")))
769 (chdir (assoc-ref %build-inputs "source"))
770 (mkdir-p share)
771 (copy-recursively "." share)
772 #t))))
773 (native-inputs
774 `(("source" ,source)
775 ("scheme48" ,scheme48)))
776 (home-page "https://github.com/scheme/rx/")
777 (synopsis "SRE String pattern-matching library for scheme48")
778 (description
779 "String pattern-matching library for scheme48 based on the SRE
780regular-expression notation.")
781 (license license:bsd-3))))
782
783(define-public slib
784 (package
785 (name "slib")
786 (version "3c1")
787 (source (origin
788 (method url-fetch)
789 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
790 version ".zip"))
791 (sha256
792 (base32
793 "10f7l0fmd0xzs6kc2cwqjrx7msdn0fsd918r459xyc05wscfpy62"))))
794 (build-system gnu-build-system)
795 (arguments
796 `(#:tests? #f ; There is no check target.
797 #:phases
798 (modify-phases %standard-phases
799 (add-after 'install 'remove-bin-share
800 (lambda* (#:key inputs outputs #:allow-other-keys)
801 (delete-file-recursively
802 (string-append (assoc-ref outputs "out") "/bin"))
803 #t))
804 (replace 'configure
805 (lambda* (#:key inputs outputs #:allow-other-keys)
806 (invoke "./configure"
807 (string-append "--prefix="
808 (assoc-ref outputs "out"))))))))
809 (native-inputs (list unzip texinfo))
810 (home-page "https://people.csail.mit.edu/jaffer/SLIB.html")
811 (synopsis "Compatibility and utility library for Scheme")
812 (description "SLIB is a portable Scheme library providing compatibility and
813utility functions for all standard Scheme implementations.")
814 (license (license:non-copyleft
815 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
816 "Or see COPYING in the distribution."))))
817
818(define-public tinyscheme
819 (package
820 (name "tinyscheme")
821 (version "1.42")
822 (source (origin
823 (method url-fetch)
824 (uri (string-append "mirror://sourceforge/" name "/" name "/"
825 name "-" version "/" name "-" version ".zip"))
826 (sha256
827 (base32
828 "0rik3qnxqd8wjlazx8rw996pfzkjjg60v6hcbpcqzi7rgml8q4n8"))))
829 (build-system gnu-build-system)
830 (native-inputs
831 (list unzip))
832 (arguments
833 `(#:phases
834 (modify-phases %standard-phases
835 (replace 'unpack
836 (lambda* (#:key source #:allow-other-keys)
837 (invoke "unzip" source)
838 (chdir (string-append ,name "-" ,version))
839 #t))
840 (add-after 'unpack 'set-scm-directory
841 ;; Hard-code ‘our’ init.scm instead of looking in the current
842 ;; working directory, so invoking ‘scheme’ just works.
843 (lambda* (#:key outputs #:allow-other-keys)
844 (let* ((out (assoc-ref outputs "out"))
845 (scm (string-append out "/share/" ,name)))
846 (substitute* "scheme.c"
847 (("init.scm" all)
848 (string-append scm "/" all)))
849 #t)))
850 (delete 'configure) ; no configure script
851 (replace 'install
852 ;; There's no ‘install’ target. Install files manually.
853 (lambda* (#:key outputs #:allow-other-keys)
854 (let* ((out (assoc-ref outputs "out"))
855 (bin (string-append out "/bin"))
856 (doc (string-append out "/share/doc/"
857 ,name "-" ,version))
858 (include (string-append out "/include"))
859 (lib (string-append out "/lib"))
860 (scm (string-append out "/share/" ,name)))
861 (install-file "scheme" bin)
862 (install-file "Manual.txt" doc)
863 (install-file "scheme.h" include)
864 (install-file "libtinyscheme.so" lib)
865 (install-file "init.scm" scm)
866 #t))))
867 #:tests? #f)) ; no tests
868 (home-page "https://tinyscheme.sourceforge.net/")
869 (synopsis "Light-weight interpreter for the Scheme programming language")
870 (description
871 "TinyScheme is a light-weight Scheme interpreter that implements as large a
872subset of R5RS as was possible without getting very large and complicated.
873
874It's meant to be used as an embedded scripting interpreter for other programs.
875As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
876extensive toolkits, although it does sport a small (and optional) top-level
877loop.
878
879As an embedded interpreter, it allows multiple interpreter states to coexist in
880the same program, without any interference between them. Foreign functions in C
881can be added and values can be defined in the Scheme environment. Being quite a
882small program, it is easy to comprehend, get to grips with, and use.")
883 (license license:bsd-3))) ; there are no licence headers
884
885(define-public tr7
886 (package
887 (name "tr7")
888 (version "1.0.10")
889 (source
890 (origin
891 (method git-fetch)
892 (uri (git-reference
893 (url "https://gitlab.com/jobol/tr7")
894 (commit (string-append "v" version))))
895 (sha256
896 (base32 "0n77fkm5kcv2pmwbw5fl8r00aarw8da8gkd9d1ki5fn9kbl4fyk2"))
897 (file-name (git-file-name name version))))
898 (build-system gnu-build-system)
899 (outputs '("out" "doc"))
900 (arguments
901 (list
902 #:phases
903 #~(modify-phases %standard-phases
904 (replace 'configure
905 (lambda _
906 (substitute* "Makefile"
907 (("PREFIX = /usr/local")
908 (string-append "PREFIX=" #$output))
909 (("ALL = \\$\\(LIBSTA\\) \\$\\(TR7I\\) tags")
910 "ALL = $(LIBSTA) $(TR7I)"))))
911 (replace 'build
912 (lambda _
913 (setenv "CC" #$(cc-for-target))
914 (invoke "make")))
915 (replace 'check
916 (lambda* (#:key tests? #:allow-other-keys)
917 (when tests?
918 (invoke "make" "test"))))
919 (replace 'install
920 (lambda _
921 (let* ((share (string-append #$output "/share"))
922 (doc (string-append #$output:doc "/share/doc/"))
923 (bin (string-append #$output "/bin"))
924 (lib (string-append #$output "/lib/"))
925 (tr7 (string-append share "/tr7"))
926 (libs (string-append tr7 "/libs")))
927 (for-each mkdir-p (list tr7 libs bin lib doc))
928 (copy-file "tr7i" (string-append bin "/tr7i"))
929 (copy-file "libtr7.a" (string-append lib "/libtr7.a"))
930 (copy-file "r7rs.pdf" (string-append doc "/r7rs.pdf"))
931 (copy-recursively "tr7libs" libs)))))))
932 (home-page "https://gitlab.com/jobol/tr7")
933 (synopsis "Embedded R7RS small Scheme interpreter")
934 (description
935 "TR7 is a lightweight Scheme interpreter that implements the revision
936R7RS small of scheme programming language.
937
938It is meant to be used as an embedded scripting interpreter for other
939programs. A lot of functionality in TR7 is included conditionally, to allow
940developers freedom in balancing features and footprint.")
941 (license license:bsd-0)))
942
943(define-public stalin
944 (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be"))
945 ;; FIXME: The Stalin "source" contains C code generated by itself:
946 ;; 'stalin-AMD64.c', etc.
947 (package
948 (name "stalin")
949 (version "0.11")
950 (source (origin
951 ;; Use Pearlmutter's upstream branch with AMD64 patches
952 ;; applied. Saves us from including those 20M! patches
953 ;; in Guix. For more info, see:
954 ;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz>
955 (method git-fetch)
956 (uri (git-reference
957 (url "https://github.com/barak/stalin")
958 (commit commit)))
959 (file-name (string-append name "-" version "-checkout"))
960 (sha256
961 (base32
962 "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn"))
963 (modules '((guix build utils)))
964 (snippet
965 ;; remove gc libs from build, we have them as input
966 '(begin
967 (delete-file "gc6.8.tar.gz")
968 (delete-file-recursively "benchmarks")
969 (substitute* "build"
970 ((".*gc6.8.*") "")
971 ((" cd \\.\\.") "")
972 ((".*B include/libgc.a") "")
973 ((".*make.*") ""))
974 #t))))
975 (build-system gnu-build-system)
976 (arguments
977 `(#:make-flags (list "ARCH_OPTS=-freg-struct-return")
978 #:phases
979 (modify-phases %standard-phases
980 (replace 'configure
981 (lambda* (#:key outputs #:allow-other-keys)
982 (let* ((out (assoc-ref outputs "out"))
983 (include-out (string-append out "/include")))
984 (invoke "./build")
985 (for-each (lambda (fname)
986 (install-file fname include-out))
987 (find-files "include"))
988 (substitute* "makefile"
989 (("\\./include") include-out))
990 (substitute* "post-make"
991 (("`pwd`") out))
992 #t)))
993 (delete 'check)
994 (replace 'install
995 (lambda* (#:key outputs #:allow-other-keys)
996 (let ((out (assoc-ref outputs "out")))
997 (install-file "stalin.1"
998 (string-append out "/share/man/man1"))
999 (install-file "stalin"
1000 (string-append out "/bin"))
1001 #t))))))
1002 (inputs
1003 (list libx11))
1004 (propagated-inputs
1005 (list libgc))
1006 (supported-systems '("x86_64-linux"))
1007 (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf")
1008 (synopsis "Brutally efficient Scheme compiler")
1009 (description
1010 "Stalin is an aggressively optimizing whole-program compiler
1011for Scheme that does polyvariant interprocedural flow analysis,
1012flow-directed interprocedural escape analysis, flow-directed
1013lightweight CPS conversion, flow-directed lightweight closure
1014conversion, flow-directed interprocedural lifetime analysis, automatic
1015in-lining, unboxing, and flow-directed program-specific and
1016program-point-specific low-level representation selection and code
1017generation.")
1018 (license license:gpl2+))))
1019
1020(define-public s9fes
1021 (package
1022 (name "s9fes")
1023 (version "20181205")
1024 (source
1025 (origin
1026 (method url-fetch)
1027 (uri (string-append "https://www.t3x.org/s9fes/s9fes-" version ".tgz"))
1028 (sha256
1029 (base32 "0ynpl707bc9drwkdpdgvw14bz9zmwd3wffl1k02sxppjl28xm7rf"))))
1030 (build-system gnu-build-system)
1031 (arguments
1032 `(#:make-flags
1033 (list (string-append "CC=" ,(cc-for-target))
1034 (string-append "PREFIX=" %output))
1035 #:phases
1036 (modify-phases %standard-phases
1037 (replace 'install
1038 (lambda* (#:key make-flags #:allow-other-keys)
1039 (apply invoke "make" "install-all" make-flags))))
1040 #:tests? #f)) ; No check target.
1041 (inputs
1042 (list ncurses))
1043 (home-page "https://www.t3x.org/s9fes/")
1044 (synopsis "Interpreter for R4RS Scheme")
1045 (description
1046 "Scheme 9 from Empty Space (S9fES) is a mature, portable, and
1047comprehensible public-domain interpreter for R4RS Scheme offering:
1048@itemize
1049@item bignum arithmetics
1050@item decimal-based real number arithmetics
1051@item support for low-level Unix programming
1052@item cursor addressing with Curses
1053@item basic networking procedures
1054@item an integrated online help system
1055@item loads of useful library functions
1056@end itemize")
1057 (license license:public-domain)))
1058
1059(define-public femtolisp
1060 (let ((commit "ec7601076a976f845bc05ad6bd3ed5b8cde58a97")
1061 (revision "2"))
1062 (package
1063 (name "femtolisp")
1064 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
1065 (source (origin
1066 (method git-fetch)
1067 (uri (git-reference
1068 (url "https://github.com/JeffBezanson/femtolisp")
1069 (commit commit)))
1070 (file-name (string-append name "-" version "-checkout"))
1071 (sha256
1072 (base32
1073 "1fcyiqlqn27nd4wxi27km8mhmlzpzzsxzpwsl1bxbmhraq468njw"))))
1074 ;; See "utils.h" for supported systems. Upstream bug:
1075 ;; https://github.com/JeffBezanson/femtolisp/issues/25
1076 (supported-systems
1077 (fold delete %supported-systems
1078 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
1079 (build-system gnu-build-system)
1080 (arguments
1081 (list #:make-flags #~(list "CC=gcc" "release")
1082 #:test-target "test"
1083 #:phases
1084 #~(modify-phases %standard-phases
1085 (delete 'bootstrap)
1086 (delete 'configure) ; No configure script
1087 (add-before 'build 'relax-gcc-14-strictness
1088 (lambda _
1089 (setenv "CFLAGS" "-Wno-error=implicit-function-declaration")))
1090 (replace 'install ; Makefile has no 'install phase
1091 (lambda _
1092 (let ((bin (string-append #$output "/bin")))
1093 (install-file "flisp" bin))))
1094 ;; The flisp binary is now available, run bootstrap to
1095 ;; generate flisp.boot and afterwards runs make test.
1096 (add-after 'install 'bootstrap-gen-and-test
1097 (lambda _
1098 (let ((bin (string-append #$output "/bin")))
1099 (invoke "./bootstrap.sh")
1100 (install-file "flisp.boot" bin)))))))
1101 (synopsis "Scheme-like lisp implementation")
1102 (description
1103 "@code{femtolisp} is a scheme-like lisp implementation with a
1104simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
1105The core is 12 builtin special forms and 33 builtin functions.")
1106 (home-page "https://github.com/JeffBezanson/femtolisp")
1107 (license license:bsd-3))))
1108
1109(define-public gauche
1110 (package
1111 (name "gauche")
1112 (version "0.9.15")
1113 (home-page "https://practical-scheme.net/gauche/index.html")
1114 (source
1115 (origin
1116 (method url-fetch)
1117 (uri (string-append
1118 "https://github.com/shirok/Gauche/releases/download/release"
1119 (string-replace-substring version "." "_")
1120 "/Gauche-" version ".tgz"))
1121 (sha256
1122 (base32 "10zpbbikkcpdzk6c52wkckiyhn7nhnqjv2djdzyjr0n8qxxy4hrn"))))
1123 (build-system gnu-build-system)
1124 (inputs
1125 (list libatomic-ops mbedtls-3 slib zlib))
1126 (native-inputs
1127 (list texinfo openssl ; needed for tests
1128 pkg-config)) ; needed to find external libatomic-ops
1129 (arguments
1130 (list #:tests? #f ; 9 ffitest failures, known issue (fixed in 0.9.16):
1131 ;; https://github.com/shirok/Gauche/issues/1044
1132 #:configure-flags
1133 #~(list (string-append "--with-slib=" #$(this-package-input "slib")
1134 "/lib/slib")
1135 "--with-tls=mbedtls")
1136 #:phases
1137 #~(modify-phases %standard-phases
1138 (add-after 'unpack 'patch-/bin/sh
1139 ;; Needed only for tests.
1140 (lambda _
1141 (substitute* '("test/www.scm"
1142 "ext/tls/test.scm"
1143 "lib/gauche/package/util.scm"
1144 "libsrc/gauche/process.scm")
1145 (("/bin/sh") (which "sh")))))
1146 (add-after 'build 'build-doc
1147 (lambda _
1148 (with-directory-excursion "doc"
1149 (invoke "make" "info"))))
1150 (add-before 'check 'patch-network-tests
1151 ;; Remove net checks.
1152 (lambda _
1153 (delete-file "test/net.scm")
1154 (invoke "touch" "test/net.scm")))
1155 (add-after 'install 'install-docs
1156 (lambda _
1157 (with-directory-excursion "doc"
1158 (invoke "make" "install")))))))
1159 (synopsis "Scheme scripting engine")
1160 (description "Gauche is a R7RS Scheme scripting engine aiming at being a
1161handy tool that helps programmers and system administrators to write small to
1162large scripts quickly. Quick startup, built-in system interface, native
1163multilingual support are some of the goals. Gauche comes with a package
1164manager/installer @code{gauche-package} which can download, compile, install
1165and list gauche extension packages.")
1166 (license license:bsd-3)))
1167
1168(define-public sbcl-airship-scheme
1169 (let ((commit "1862db81dfa67729444916c361f39f9f1c5a2ccd")
1170 (revision "0"))
1171 (package
1172 (name "sbcl-airship-scheme")
1173 (version (git-version "0.0.0" revision commit))
1174 (source
1175 (origin
1176 (method git-fetch)
1177 (uri (git-reference
1178 (url "https://gitlab.com/mbabich/airship-scheme.git")
1179 (commit commit)))
1180 (file-name (git-file-name "cl-airship-scheme" version))
1181 (sha256
1182 (base32 "1d1kvrzlx5kcfsn3rn30ww8jihjflpgcka3n3awj2k4f0sq4mplg"))))
1183 (build-system asdf-build-system/sbcl)
1184 (native-inputs (list sbcl-fiveam))
1185 (inputs
1186 (list sbcl-alexandria
1187 sbcl-float-features
1188 sbcl-trivial-features
1189 sbcl-zr-utils))
1190 (synopsis "R7RS Scheme implementation in Common Lisp")
1191 (description
1192 "This is a R7RS Scheme implementation designed to run within
1193a Common Lisp environment.")
1194 (home-page "https://gitlab.com/mbabich/airship-scheme")
1195 (license license:expat))))
1196
1197(define-public cl-airship-scheme
1198 (sbcl-package->cl-source-package sbcl-airship-scheme))
1199
1200(define-public gerbil
1201 (package
1202 (name "gerbil")
1203 (version "0.18.1")
1204 (source
1205 (origin
1206 (method url-fetch)
1207 (uri (string-append
1208 "https://github.com/mighty-gerbils/gerbil/releases/download/v"
1209 version "/gerbil-v" version ".tar.gz"))
1210 (sha256
1211 (base32 "1dff14bzqkq6scyyhnwhc3ky96j6lr84mnghk4da0x6vifw7p0p1"))))
1212 (arguments
1213 (list
1214 ;; Do not build with '-march=native'.
1215 #:configure-flags #~(list "--enable-march=")
1216
1217 #:phases #~(modify-phases %standard-phases
1218 (delete 'bootstrap)
1219 (add-after 'set-paths 'set-cc
1220 (lambda _
1221 (setenv "CC" #$(cc-for-target))))
1222 (add-before 'patch-generated-file-shebangs 'fix-gxi-shebangs
1223 (lambda _
1224 ;; Some .ss files refer to gxi using /usr/bin/env gxi
1225 ;; and 'patch-generated-file-shebangs can't fix that
1226 ;; because gxi has not been compiled yet.
1227 ;; We know where gxi is going to end up so we
1228 ;; Doctor Who our fix here before the problem
1229 ;; happens towards the end of the build.sh script.
1230 (let ((abs-srcdir (getcwd)))
1231 (for-each (lambda (f)
1232 (substitute* f
1233 (("#!/usr/bin/env gxi")
1234 (string-append "#!" abs-srcdir
1235 "/../bin/gxi"))))
1236 '("./src/std/web/rack-test.ss"
1237 "./src/std/web/fastcgi-test.ss"
1238 "./src/std/build.ss"
1239 "./src/build/build-libgerbil.ss"
1240 "./src/gerbil/test/test-build-static-exe.ss"
1241 "./src/gerbil/test/test-build-optimized-static-exe.ss"
1242 "./src/gerbil/test/test-build-optimized-exe.ss"
1243 "./src/gerbil/test/test-build-exe.ss"
1244 "./src/srfi/build.ss"
1245 "./src/r7rs-large/build.ss"
1246 "./src/misc/rpc-perf/build.ss"
1247 "./src/misc/http-perf/build.ss"
1248 "./src/misc/scripts/docsnarf.ss"
1249 "./src/misc/scripts/docstub.ss"
1250 "./src/misc/scripts/docsyms.ss"
1251 "./src/tools/gxpkg.ss"
1252 "./src/tools/build.ss"
1253 "./src/lang/build.ss"
1254 "./src/tutorial/kvstore/build.ss"
1255 "./src/tutorial/httpd/build.ss"
1256 "./src/tutorial/proxy/build.ss"
1257 "./src/tutorial/ensemble/build.ss"
1258 "./src/tutorial/lang/build.ss")))))
1259 (add-before 'build 'set-shell
1260 (lambda _
1261 (setenv "SHELL" "/bin/sh")))
1262 (replace 'build
1263 (lambda _
1264 (setenv "HOME"
1265 (getcwd))
1266 (invoke
1267 ;; The build script needs a tty or it'll crash on an ioctl
1268 ;; trying to find the width of the terminal it's running on.
1269 ;; Calling in script prevents that.
1270 "script"
1271 "-qefc"
1272 "./build.sh"))))
1273 #:tests? #f))
1274 (native-inputs (list gambit-c util-linux))
1275 (propagated-inputs (list gambit-c openssl sqlite zlib))
1276 (build-system gnu-build-system)
1277 (synopsis "Meta-dialect of Scheme with post-modern features")
1278 (description
1279 "Gerbil is an opinionated dialect of Scheme designed for Systems
1280Programming, with a state of the art macro and module system on top of the Gambit
1281runtime. The macro system is based on quote-syntax, and provides the full meta-syntactic
1282tower with a native implementation of syntax-case. It also provides a full-blown module
1283system, similar to PLT Scheme's (sorry, Racket) modules. The main difference from Racket
1284is that Gerbil modules are single instantiation, supporting high performance ahead of
1285time compilation and compiled macros.")
1286 (home-page "https://cons.io")
1287 (license (list license:lgpl2.1
1288 license:asl2.0))))
1289
1290(define-public emacs-gerbil-mode
1291 (package
1292 (inherit gerbil)
1293 (name "emacs-gerbil-mode")
1294 (version "1.0")
1295 (build-system emacs-build-system)
1296 (arguments
1297 (list #:lisp-directory "etc"))
1298 (synopsis "Emacs major-mode for editing Gerbil code")
1299 (description
1300 "Gerbil mode provides font-lock, indentation, navigation, and REPL for
1301Gerbil code within Emacs.")))
1302
1303(define-public owl
1304 (package
1305 (name "owl")
1306 (version "0.2.2")
1307 (source (origin
1308 (method git-fetch)
1309 (uri (git-reference
1310 (url "https://gitlab.com/owl-lisp/owl.git")
1311 (commit (string-append "v" version))))
1312 (sha256
1313 (base32 "0jlmpw14rg63m1q7pjmhjicaqbqgc6gnp53bph0giwg8ha8wxyqr"))
1314 (file-name (git-file-name name version))))
1315 (build-system gnu-build-system)
1316 (arguments
1317 (list
1318 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
1319 (string-append "PREFIX=" #$output))
1320 #:make-flags #~`(,(string-append "PREFIX=" #$output))
1321 #:phases #~(modify-phases %standard-phases
1322 (delete 'configure) ; no configure script
1323 (add-after 'patch-source-shebangs 'patch-ol-shebangs
1324 (lambda _
1325 (lambda _
1326 (substitute* (list "bin/feather"
1327 "tests/hashbang.scm"
1328 "tests/theorem-rand.scm")
1329 (("/usr") #$output))))))
1330 #:test-target "test"))
1331 (native-inputs (list which))
1332 (home-page "https://haltp.org/posts/owl.html")
1333 (synopsis "Functional Scheme dialect")
1334 (description
1335 "Owl Lisp is a simple programming language. It is intended to provide a
1336portable system for writing standalone programs in a subjectively pleasant
1337dialect of Lisp. It has a minimal core and runtime, purely functional
1338operation, and support for asynchronous evaluation.")
1339 (license license:expat)))
1340
1341(define-public stklos
1342 (package
1343 (name "stklos")
1344 (version "2.10")
1345 (source (origin
1346 (method url-fetch)
1347 ;; TODO: Unbundle pcre, libgc, and libffi.
1348 (uri (string-append "https://stklos.net/download/stklos-"
1349 version ".tar.gz"))
1350 (sha256
1351 (base32
1352 "0hd05r5pr3yhgq44n5sqdmvkpgnhf5fybmis2g3gwj10z52h7gvd"))))
1353 (build-system gnu-build-system)
1354 (native-inputs (list pkg-config))
1355 (inputs (list gmp libgc pcre2 libffi readline))
1356 (arguments
1357 (list
1358 #:modules `((ice-9 ftw)
1359 ,@%default-gnu-modules)
1360 #:configure-flags
1361 #~(list (string-append "LDFLAGS=-L"
1362 #$(this-package-input "readline")
1363 "/lib -lreadline"))
1364 #:phases
1365 #~(modify-phases %standard-phases
1366 (add-before 'configure 'patch-sh-references
1367 (lambda* (#:key inputs #:allow-other-keys)
1368 (let ((bash (which "bash")))
1369 (substitute* "configure"
1370 (("/bin/sh") bash)))))
1371 (add-after 'configure 'patch-rm-references
1372 (lambda _
1373 (let ((rm (which "rm")))
1374 (substitute* (find-files "." "^Makefile$")
1375 (("/bin/rm") rm))))))))
1376 (properties
1377 '((release-monitoring-url . "https://stklos.net/download.html")))
1378 (home-page "https://stklos.net")
1379 (synopsis "R7RS Scheme with CLOS-like object system")
1380 (description
1381 "STklos is a free Scheme system mostly compliant with the languages
1382features defined in R7RS small. The aim of this implementation is to be fast
1383as well as light. The implementation is based on an ad-hoc Virtual
1384Machine. STklos can also be compiled as a library and embedded in an
1385application.")
1386 (license license:gpl2+)))
1387
1388(define-public kawa
1389 (package
1390 (name "kawa")
1391 (version "3.1.1")
1392 (source
1393 (origin
1394 (method git-fetch)
1395 (uri (git-reference
1396 (url "https://gitlab.com/kashell/Kawa")
1397 (commit version)))
1398 (file-name (git-file-name name version))
1399 (sha256
1400 (base32 "1qfd0dk4l4dccdhi6lmgv74g98m6mpdiif1qrzgwbj8awbb8x1jy"))
1401 (modules '((guix build utils)))
1402 (snippet
1403 #~(begin
1404 ;; autogen.sh lacks shebang. Let's delete it, the default action
1405 ;; of Guix is equivalent.
1406 (delete-file "autogen.sh")
1407 ;; This duplication of AM_INIT_AUTOMAKE was solved on commit
1408 ;; 85f8e85cb50e79c163951c3d823bbbc7df3cee03 from kawa git repo,
1409 ;; but it was not tagged yet.
1410 (substitute* "bin/configure.ac"
1411 (("AM_INIT_AUTOMAKE\n") ""))))))
1412 (build-system gnu-build-system)
1413 (arguments
1414 (list
1415 #:parallel-build? #f
1416 #:parallel-tests? #f
1417 #:phases
1418 #~(modify-phases %standard-phases
1419 (add-after 'install 'wrap-kawa
1420 (lambda* (#:key inputs #:allow-other-keys)
1421 (wrap-program (string-append #$output "/share/kawa/bin/kawa")
1422 `("JAVA_HOME" ":" = (,#$(this-package-input "icedtea")))))))))
1423 (inputs
1424 (list bash-minimal
1425 `(,icedtea-8 "jdk")))
1426 (native-inputs
1427 (list autoconf
1428 automake
1429 texinfo))
1430 (home-page "https://www.gnu.org/software/kawa/")
1431 (synopsis "Java framework and implementation of Scheme, Elisp, and more")
1432 (description
1433 "GNU Kawa is an implementation of the Scheme programming language that is
1434built on top of the Java platform. It is thus conveniently integrated with
1435Java and benefits from this by having a compiler, optional static typing, and
1436so on. Kawa also serves as a framework for implementing other programming
1437languages on the Java platform.
1438
1439Included in Kawa is qexo, a partial implementation of XQuery in Java.")
1440 (license license:expat)))
1441
1442(define-public loko-scheme
1443 (package
1444 (name "loko-scheme")
1445 (version "0.13.0")
1446 (source
1447 (origin
1448 (method git-fetch)
1449 (uri (git-reference
1450 (url "https://gitlab.com/weinholt/loko")
1451 (commit (string-append "v" version))))
1452 (sha256
1453 (base32 "1hmjmsli2y8wk1whcmk5xylylfrzz33hnzkwbxqwm7mslmd9dagj"))
1454 (file-name (git-file-name name version))))
1455 (build-system gnu-build-system)
1456 (arguments
1457 (list
1458 ;; r7rs tests are a work in progress as of 0.7.0.
1459 #:tests? #f
1460 #:strip-binaries? #f
1461 #:make-flags
1462 #~(list (string-append "PREFIX=" #$output))
1463 #:phases
1464 #~(modify-phases %standard-phases
1465 (delete 'configure)
1466 (add-before 'build 'akku-fixes
1467 (lambda _
1468 (delete-file "Akku.lock")
1469 (substitute* "Akku.manifest"
1470 (("\\(depends.*") "(depends)"))
1471 (invoke "akku" "install")
1472 (let ((dest "./.akku/lib/")
1473 (source "/share/guile/site/3.0/"))
1474 (for-each
1475 (lambda (name prefix)
1476 ;; Symlink the scheme libraries so that Akku can find them
1477 (symlink (string-append prefix source name)
1478 (string-append dest name)))
1479 '("struct" "laesare" "pfds" "machine-code")
1480 (list #$(this-package-native-input "guile-struct-pack")
1481 #$(this-package-native-input "guile-laesare")
1482 #$(this-package-native-input "guile-pfds")
1483 #$(this-package-native-input "guile-machine-code"))))
1484 (substitute* ".akku/env"
1485 (("/bin/sh") (which "sh")))
1486 (substitute* "scheme-wrapper"
1487 (("which ")
1488 "command -v ")))))))
1489 (native-inputs
1490 (list akku
1491 chez-scheme
1492 guile-struct-pack
1493 guile-laesare
1494 guile-pfds
1495 guile-machine-code))
1496 (home-page "https://scheme.fail")
1497 (synopsis "Implementation of the algorithmic language Scheme")
1498 (description
1499 "Loko Scheme is intended to be a platform for application and operating
1500system development. It is written purely in Scheme and some assembler
1501(i.e. no C code at the bottom). Both the R6RS and the R7RS standards are
1502supported.")
1503 (license license:agpl3+)))
1504
1505(define-public r7rs-small-texinfo
1506 (let ((commit "38a703976ea6353e32b52a5187dbdaf77fb2f050")
1507 (revision "3"))
1508 (package
1509 (name "r7rs-small-texinfo")
1510 (version (git-version "0.1.0" revision commit))
1511 (home-page "https://codeberg.org/Zipheir/r7rs-small-texinfo/")
1512 (source
1513 (origin
1514 (uri (git-reference
1515 (url home-page)
1516 (commit commit)))
1517 (method git-fetch)
1518 (file-name (git-file-name name version))
1519 (sha256
1520 (base32 "1fr02fyhiwd364jkfy1n5w31pq3kx1rl5w634421g05702yb47x3"))))
1521 (native-inputs (list bash texinfo))
1522 (inputs '())
1523 (build-system copy-build-system)
1524 (arguments
1525 (list
1526 #:install-plan #~'(("r7rs-small.info" "share/info/"))
1527 #:phases #~(modify-phases %standard-phases
1528 (add-after 'unpack 'compile-the-files
1529 (lambda _
1530 (let* ((source-directory-path (string-append (getcwd)
1531 "/doc/r7rs-small"))
1532 (build-script-path (string-append
1533 source-directory-path
1534 "/build.sh"))
1535 (info-directory-path (string-append #$output
1536 "/share/info")))
1537 (chdir source-directory-path)
1538 (system* "bash" build-script-path "info")
1539 (mkdir-p info-directory-path)
1540 (copy-file (string-append source-directory-path
1541 "/r7rs-small.info")
1542 (string-append info-directory-path
1543 "/r7rs-small.info"))))))))
1544 (synopsis
1545 "R7RS Small standard of the Scheme programming language in Info format")
1546 (description
1547 "Revised^7 Report of the Algorithmic Language Scheme adapted to Texinfo format.")
1548 (license (license:non-copyleft "file://COPYING")))))