projects/guix·blob python-team · refs

1497 lines · 64.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 scheme48
337 (package
338 (name "scheme48")
339 (version "1.9.3")
340 (source (origin
341 (method url-fetch)
342 (uri (string-append "https://s48.org/" version
343 "/scheme48-" version ".tgz"))
344 (sha256
345 (base32
346 "0k4hygd0k22g5shnm5wxg6vdz6qzs40mid1iz2q10hd1zkrskxbf"))
347 (patches (search-patches "scheme48-tests.patch"))))
348 (build-system gnu-build-system)
349 (home-page "https://s48.org/")
350 (synopsis "Scheme implementation using a bytecode interpreter")
351 (description
352 "Scheme 48 is an implementation of Scheme based on a byte-code
353interpreter and is designed to be used as a testbed for experiments in
354implementation techniques and as an expository tool.")
355
356 ;; Most files are BSD-3; see COPYING for the few exceptions.
357 (license license:bsd-3)))
358
359(define-public scheme48-prescheme
360 (package
361 (inherit scheme48)
362 (name "scheme48-prescheme")
363 (arguments
364 (list
365 #:tests? #f ; tests only cover scheme48
366 #:modules '((guix build gnu-build-system)
367 (guix build utils)
368 (ice-9 popen)
369 (srfi srfi-1))
370 #:phases
371 #~(modify-phases %standard-phases
372 (add-after 'configure 'patch-prescheme-version
373 (lambda _
374 ;; Ensure the Pre-Scheme version matches the package version
375 (call-with-output-file "ps-compiler/minor-version-number"
376 (lambda (port)
377 (let* ((version #$(package-version this-package))
378 (vparts (string-split version #\.))
379 (vminor (string-join (drop vparts 1) ".")))
380 (write vminor port))))))
381 (add-after 'configure 'patch-prescheme-headers
382 (lambda _
383 ;; Rename "io.h" to play nicely with others
384 (copy-file "c/io.h" "c/prescheme-io.h")
385 (substitute* "c/prescheme.h"
386 (("^#include \"io\\.h\"")
387 "#include \"prescheme-io.h\""))))
388 (add-after 'configure 'generate-pkg-config
389 (lambda _
390 ;; Generate a pkg-config file
391 (call-with-output-file "prescheme.pc"
392 (lambda (port)
393 (let ((s48-version #$(package-version scheme48))
394 (version #$(package-version this-package)))
395 (format port (string-join
396 '("prefix=~a"
397 "exec_prefix=${prefix}"
398 "libdir=${prefix}/lib/scheme48-~a"
399 "includedir=${prefix}/include"
400 ""
401 "Name: Pre-Scheme (Scheme 48)"
402 "Description: Pre-Scheme C runtime"
403 "Version: ~a"
404 "Libs: -L${libdir} -lprescheme"
405 "Cflags: -I${includedir}")
406 "\n" 'suffix)
407 #$output s48-version version))))))
408 (add-after 'configure 'generate-prescheme-wrapper
409 (lambda _
410 ;; Generate a wrapper to load and run ps-compiler.image
411 (call-with-output-file "prescheme"
412 (lambda (port)
413 (let ((s48-version #$(package-version scheme48)))
414 (format port (string-join
415 '("#!/bin/sh"
416 "scheme48=~a/lib/scheme48-~a/scheme48vm"
417 "prescheme=~a/lib/scheme48-~a/prescheme.image"
418 "exec ${scheme48} -i ${prescheme} \"$@\"")
419 "\n" 'suffix)
420 #$scheme48 s48-version #$output s48-version))))
421 (chmod "prescheme" #o755)))
422 (replace 'build
423 (lambda _
424 ;; Build a minimal static library for linking Pre-Scheme code
425 (let ((lib "c/libprescheme.a")
426 (objs '("c/unix/io.o"
427 "c/unix/misc.o")))
428 (apply invoke "make" objs)
429 (apply invoke "ar" "rcs" lib objs))
430 ;; Dump a Scheme 48 image with both the Pre-Scheme compatibility
431 ;; library and compiler pre-loaded, courtesy of Taylor Campbell's
432 ;; Pre-Scheme Manual:
433 ;; https://groups.scheme.org/prescheme/1.3/#Invoking-the-Pre_002dScheme-compiler
434 (with-directory-excursion "ps-compiler"
435 (let ((version #$(package-version this-package))
436 (port (open-pipe* OPEN_WRITE "scheme48")))
437 (format port (string-join
438 '(",batch"
439 ",config ,load ../scheme/prescheme/interface.scm"
440 ",config ,load ../scheme/prescheme/package-defs.scm"
441 ",exec ,load load-ps-compiler.scm"
442 ",in prescheme-compiler prescheme-compiler"
443 ",user (define prescheme-compiler ##)"
444 ",dump ../prescheme.image \"(Pre-Scheme ~a)\""
445 ",exit")
446 "\n" 'suffix)
447 version)
448 (close-pipe port)))))
449 (replace 'install
450 (lambda _
451 (let* ((s48-version #$(package-version scheme48))
452 (bin-dir (string-append #$output "/bin"))
453 (lib-dir (string-append #$output "/lib/scheme48-" s48-version))
454 (pkgconf-dir (string-append #$output "/lib/pkgconfig"))
455 (share-dir (string-append #$output "/share/scheme48-" s48-version))
456 (include-dir (string-append #$output "/include")))
457 ;; Install Pre-Scheme compiler image
458 (install-file "prescheme" bin-dir)
459 (install-file "prescheme.image" lib-dir)
460 ;; Install Pre-Scheme config, headers, and lib
461 (install-file "prescheme.pc" pkgconf-dir)
462 (install-file "c/prescheme.h" include-dir)
463 (install-file "c/prescheme-io.h" include-dir)
464 (install-file "c/libprescheme.a" lib-dir)
465 ;; Install Pre-Scheme sources
466 (copy-recursively "scheme/prescheme"
467 (string-append share-dir "/prescheme"))
468 (copy-recursively "ps-compiler"
469 (string-append share-dir "/ps-compiler"))
470 ;; Remove files specific to building the Scheme 48 VM
471 (for-each (lambda (file)
472 (delete-file (string-append share-dir "/" file)))
473 '("ps-compiler/compile-bibop-gc-32.scm"
474 "ps-compiler/compile-bibop-gc-64.scm"
475 "ps-compiler/compile-gc.scm"
476 "ps-compiler/compile-twospace-gc-32.scm"
477 "ps-compiler/compile-twospace-gc-64.scm"
478 "ps-compiler/compile-vm-no-gc-32.scm"
479 "ps-compiler/compile-vm-no-gc-64.scm"))))))))
480 (propagated-inputs (list scheme48))
481 (home-page "http://s48.org/")
482 (synopsis "Pre-Scheme compiler from Scheme 48")
483 (description
484 "Pre-Scheme is a statically compilable dialect of Scheme, used to implement the
485Scheme 48 virtual machine. Scheme 48 ships with a Pre-Scheme to C compiler written
486in Scheme, and a runtime library which allows Pre-Scheme code to run as Scheme.")
487 (license license:bsd-3)))
488
489(define-public gambit-c
490 (package
491 (name "gambit-c")
492 (version "4.9.7")
493 (source
494 (origin
495 (method url-fetch)
496 (uri (string-append
497 "http://www.gambitscheme.org/" version "/gambit-v"
498 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
499 ".tgz"))
500 (sha256
501 (base32 "08iw6jfvn4l09j52p28s9f8x551590pv300nc0cfg0isrkax6hsj"))))
502 (build-system gnu-build-system)
503 (arguments
504 '(#:configure-flags
505 ;; According to the ./configure script, this makes the build slower and
506 ;; use >= 1 GB memory, but makes Gambit much faster.
507 '("--enable-single-host")))
508 (home-page "http://www.gambitscheme.org/")
509 (synopsis "Efficient Scheme interpreter and compiler")
510 (description
511 "Gambit consists of two main programs: gsi, the Gambit Scheme
512interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
513the complete execution and debugging environment. The compiler is the
514interpreter extended with the capability of generating executable files. The
515compiler can produce standalone executables or compiled modules which can be
516loaded at run time. Interpreted code and compiled code can be freely
517mixed.")
518 ;; Dual license.
519 (license (list license:lgpl2.1+ license:asl2.0))))
520
521(define-public chibi-scheme
522 (package
523 (name "chibi-scheme")
524 (version "0.12")
525 (home-page "https://github.com/ashinn/chibi-scheme")
526 (source
527 (origin
528 (method git-fetch)
529 (uri (git-reference (url home-page) (commit version)))
530 (file-name (git-file-name name version))
531 (sha256
532 (base32 "0dhz141jjix7lsklaxfd6xv32s5wl5a3g2pha7wh70bayvyzf12d"))))
533 (build-system gnu-build-system)
534 (arguments
535 (list #:phases
536 #~(modify-phases %standard-phases
537 (delete 'configure)) ; no configure script
538 #:make-flags
539 #~(list
540 #$@(if
541 (%current-target-system)
542 #~((string-append
543 "CHIBI=" #+(this-package-native-input "chibi-scheme")
544 "/bin/chibi-scheme"))
545 #~())
546 (string-append "PREFIX=" #$output)
547 (string-append "CC=" #$(cc-for-target))
548 (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
549 #:test-target "test"))
550 (native-inputs (if (%current-target-system)
551 (list this-package)
552 (list)))
553 (synopsis "Small embeddable Scheme implementation")
554 (description
555 "Chibi-Scheme is a very small library with no external dependencies
556intended for use as an extension and scripting language in C programs. In
557addition to support for lightweight VM-based threads, each VM itself runs in
558an isolated heap allowing multiple VMs to run simultaneously in different OS
559threads.")
560 (license license:bsd-3)))
561
562(define-public unsyntax
563 (let ((commit "144772eeef4a812dd79515b67010d33ad2e7e890")
564 (revision "0"))
565 (package
566 (name "unsyntax")
567 (version (git-version "0.0.3" revision commit))
568 (source
569 (origin
570 (method git-fetch)
571 (uri (git-reference
572 (url "https://gitlab.com/nieper/unsyntax.git")
573 (commit commit)))
574 (file-name (git-file-name name version))
575 (sha256
576 (base32 "1ia58xdrywsm0dg19kmkghnrgw6gj2bsaypyjmbpirrila73cqk0"))))
577 (build-system gnu-build-system)
578 (arguments
579 (list #:make-flags
580 #~(list "gl_public_submodule_commit=") ; disable submodule checks
581 #:phases
582 #~(modify-phases %standard-phases
583 (add-before 'bootstrap 'prepare-bootstrap
584 (lambda _
585 ;; Unsyntax relies on bootstrap to fetch gnulib, we use
586 ;; the sources from guix's gnulib package instead.
587 (copy-recursively (getenv "GNULIB_SRCDIR") ".gnulib")
588 (setenv "GNULIB_SRCDIR" ".gnulib")
589 (patch-shebang ".gnulib/gnulib-tool")
590 (patch-shebang ".gnulib/build-aux/bootstrap")
591 (patch-shebang ".gnulib/build-aux/git-version-gen")
592 (patch-shebang ".gnulib/build-aux/prefix-gnulib-mk")
593 ;; The bootstrap_sync option updates the bootstrap script
594 ;; and runs it with CONFIG_SHELL, make sure it's correct.
595 (setenv "CONFIG_SHELL" (which "sh"))
596 ;; Tell git-version-gen the correct version number.
597 (call-with-output-file ".tarball-version"
598 (lambda (port)
599 (display #$version port)))))
600 (add-before 'configure 'patch-exec-paths
601 (lambda _
602 ;; Fix hard-coded references to chibi-scheme, using the
603 ;; configured interpreter path instead. This avoids the need
604 ;; for chibi-scheme as a propagated input.
605 (substitute* '("src/compile-unsyntax.in"
606 "src/expand-unsyntax.in"
607 "src/unsyntax-scheme.in")
608 (("chibi-scheme") "'@CHIBI_SCHEME@'")))))))
609 (native-inputs
610 (list autoconf automake libtool git gnulib help2man perl texinfo))
611 (inputs
612 (list chibi-scheme))
613 (home-page "https://www.unsyntax.org")
614 (synopsis "Expander for R7RS programs")
615 (description
616 "Unsyntax is an implementation of the Scheme programming language,
617specifically of its R7RS standard, and includes a number of extensions.
618Unsyntax evaluates Scheme expressions and compiles and runs Scheme programs by
619first expanding them into a minimal dialect of R7RS (small) without any
620syntactic extensions. The resulting expression or program is then evaluated
621by an existing Scheme implementation.")
622 (license license:expat))))
623
624(define-public ypsilon
625 (let ((commit "9982a834cd08bfa45e7db33b6a7b7d39c03f5632")
626 (revision "0"))
627 (package
628 (name "ypsilon")
629 (version "2.0.8")
630 (source
631 (origin
632 (method git-fetch)
633 (uri (git-reference
634 (url "https://github.com/fujita-y/ypsilon")
635 (commit commit)))
636 (sha256
637 (base32 "199bggcdgww2c3r5fzlhzx7mdwl3l579skraar09bpjzp6kcxk1n"))
638 (patches (search-patches "ypsilon-Use-GNU-toolchain-as-default.patch"))
639 (file-name (git-file-name name version))))
640 (build-system cmake-build-system)
641 (inputs (list llvm-15 libffi))
642 (arguments
643 (list
644 #:out-of-source? #f
645 #:phases
646 #~(modify-phases %standard-phases
647 (add-after 'unpack 'disable-asan
648 (lambda _
649 (substitute* "CMakeLists.txt"
650 ;; TODO: Fix reported memory leak when rebuilding heap files
651 (("-fsanitize=address") ""))))
652 (add-after 'disable-asan 'disable-march
653 (lambda _
654 (substitute* "Makefile"
655 (("-march=x86") "")
656 (("-march=x86-64") ""))))
657 (add-after 'disable-march 'fix-test-sitelib
658 (lambda _
659 (substitute* "CMakeLists.txt"
660 (("--sitelib=./test:./sitelib")
661 "--sitelib=./source/test:./source/sitelib"))
662 (substitute* '("CMakeLists.txt" "test/r6rs-lib.scm")
663 (("./test/") "./source/test/"))
664 (substitute* "test/r4rstest.scm"
665 (("(current-directory )\"test\"" all _)
666 (string-append _ "\"source/test\"")))))
667 (add-before 'configure 'set-home
668 (lambda _
669 (setenv "HOME"
670 (getcwd))))
671 (add-after 'build 'rebuild-heap-files
672 (lambda _
673 (substitute* "src/core.h"
674 (("(#define UNBOUND_GLOC_RETURN_UNSPEC )0" all _)
675 (string-append _ "1")))
676 (with-directory-excursion "heap"
677 (invoke "make"))
678 (invoke "make")
679 (with-directory-excursion "heap"
680 (invoke "make"))
681 (substitute* "src/core.h"
682 (("(#define UNBOUND_GLOC_RETURN_UNSPEC )1" all _)
683 (string-append _ "0")))
684 (invoke "make"))))))
685 (synopsis "R7RS/R6RS Scheme Implementation")
686 (description
687 "Ypsilon Scheme is an R7RS/R6RS Scheme implementation with
688on-the-fly FFI and native stub code generation, making use of the LLVM.")
689 (home-page "https://github.com/fujita-y/ypsilon")
690 (license license:bsd-2))))
691
692(define-public scheme48-rx
693 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
694 (revision "2"))
695 (package
696 (name "scheme48-rx")
697 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
698 (source
699 (origin
700 (method git-fetch)
701 (uri (git-reference
702 (url "https://github.com/scheme/rx")
703 (commit commit)))
704 (sha256
705 (base32
706 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
707 (file-name (string-append name "-" version "-checkout"))))
708 (build-system trivial-build-system)
709 (arguments
710 `(#:modules ((guix build utils))
711 #:builder
712 (begin
713 (use-modules (guix build utils))
714 (let ((share (string-append %output
715 "/share/scheme48-"
716 ,(package-version scheme48)
717 "/rx")))
718 (chdir (assoc-ref %build-inputs "source"))
719 (mkdir-p share)
720 (copy-recursively "." share)
721 #t))))
722 (native-inputs
723 `(("source" ,source)
724 ("scheme48" ,scheme48)))
725 (home-page "https://github.com/scheme/rx/")
726 (synopsis "SRE String pattern-matching library for scheme48")
727 (description
728 "String pattern-matching library for scheme48 based on the SRE
729regular-expression notation.")
730 (license license:bsd-3))))
731
732(define-public slib
733 (package
734 (name "slib")
735 (version "3c1")
736 (source (origin
737 (method url-fetch)
738 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
739 version ".zip"))
740 (sha256
741 (base32
742 "10f7l0fmd0xzs6kc2cwqjrx7msdn0fsd918r459xyc05wscfpy62"))))
743 (build-system gnu-build-system)
744 (arguments
745 `(#:tests? #f ; There is no check target.
746 #:phases
747 (modify-phases %standard-phases
748 (add-after 'install 'remove-bin-share
749 (lambda* (#:key inputs outputs #:allow-other-keys)
750 (delete-file-recursively
751 (string-append (assoc-ref outputs "out") "/bin"))
752 #t))
753 (replace 'configure
754 (lambda* (#:key inputs outputs #:allow-other-keys)
755 (invoke "./configure"
756 (string-append "--prefix="
757 (assoc-ref outputs "out"))))))))
758 (native-inputs (list unzip texinfo))
759 (home-page "https://people.csail.mit.edu/jaffer/SLIB.html")
760 (synopsis "Compatibility and utility library for Scheme")
761 (description "SLIB is a portable Scheme library providing compatibility and
762utility functions for all standard Scheme implementations.")
763 (license (license:non-copyleft
764 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
765 "Or see COPYING in the distribution."))))
766
767(define-public tinyscheme
768 (package
769 (name "tinyscheme")
770 (version "1.42")
771 (source (origin
772 (method url-fetch)
773 (uri (string-append "mirror://sourceforge/" name "/" name "/"
774 name "-" version "/" name "-" version ".zip"))
775 (sha256
776 (base32
777 "0rik3qnxqd8wjlazx8rw996pfzkjjg60v6hcbpcqzi7rgml8q4n8"))))
778 (build-system gnu-build-system)
779 (native-inputs
780 (list unzip))
781 (arguments
782 `(#:phases
783 (modify-phases %standard-phases
784 (replace 'unpack
785 (lambda* (#:key source #:allow-other-keys)
786 (invoke "unzip" source)
787 (chdir (string-append ,name "-" ,version))
788 #t))
789 (add-after 'unpack 'set-scm-directory
790 ;; Hard-code ‘our’ init.scm instead of looking in the current
791 ;; working directory, so invoking ‘scheme’ just works.
792 (lambda* (#:key outputs #:allow-other-keys)
793 (let* ((out (assoc-ref outputs "out"))
794 (scm (string-append out "/share/" ,name)))
795 (substitute* "scheme.c"
796 (("init.scm" all)
797 (string-append scm "/" all)))
798 #t)))
799 (delete 'configure) ; no configure script
800 (replace 'install
801 ;; There's no ‘install’ target. Install files manually.
802 (lambda* (#:key outputs #:allow-other-keys)
803 (let* ((out (assoc-ref outputs "out"))
804 (bin (string-append out "/bin"))
805 (doc (string-append out "/share/doc/"
806 ,name "-" ,version))
807 (include (string-append out "/include"))
808 (lib (string-append out "/lib"))
809 (scm (string-append out "/share/" ,name)))
810 (install-file "scheme" bin)
811 (install-file "Manual.txt" doc)
812 (install-file "scheme.h" include)
813 (install-file "libtinyscheme.so" lib)
814 (install-file "init.scm" scm)
815 #t))))
816 #:tests? #f)) ; no tests
817 (home-page "https://tinyscheme.sourceforge.net/")
818 (synopsis "Light-weight interpreter for the Scheme programming language")
819 (description
820 "TinyScheme is a light-weight Scheme interpreter that implements as large a
821subset of R5RS as was possible without getting very large and complicated.
822
823It's meant to be used as an embedded scripting interpreter for other programs.
824As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
825extensive toolkits, although it does sport a small (and optional) top-level
826loop.
827
828As an embedded interpreter, it allows multiple interpreter states to coexist in
829the same program, without any interference between them. Foreign functions in C
830can be added and values can be defined in the Scheme environment. Being quite a
831small program, it is easy to comprehend, get to grips with, and use.")
832 (license license:bsd-3))) ; there are no licence headers
833
834(define-public tr7
835 (package
836 (name "tr7")
837 (version "1.0.10")
838 (source
839 (origin
840 (method git-fetch)
841 (uri (git-reference
842 (url "https://gitlab.com/jobol/tr7")
843 (commit (string-append "v" version))))
844 (sha256
845 (base32 "0n77fkm5kcv2pmwbw5fl8r00aarw8da8gkd9d1ki5fn9kbl4fyk2"))
846 (file-name (git-file-name name version))))
847 (build-system gnu-build-system)
848 (outputs '("out" "doc"))
849 (arguments
850 (list
851 #:phases
852 #~(modify-phases %standard-phases
853 (replace 'configure
854 (lambda _
855 (substitute* "Makefile"
856 (("PREFIX = /usr/local")
857 (string-append "PREFIX=" #$output))
858 (("ALL = \\$\\(LIBSTA\\) \\$\\(TR7I\\) tags")
859 "ALL = $(LIBSTA) $(TR7I)"))))
860 (replace 'build
861 (lambda _
862 (setenv "CC" #$(cc-for-target))
863 (invoke "make")))
864 (replace 'check
865 (lambda* (#:key tests? #:allow-other-keys)
866 (when tests?
867 (invoke "make" "test"))))
868 (replace 'install
869 (lambda _
870 (let* ((share (string-append #$output "/share"))
871 (doc (string-append #$output:doc "/share/doc/"))
872 (bin (string-append #$output "/bin"))
873 (lib (string-append #$output "/lib/"))
874 (tr7 (string-append share "/tr7"))
875 (libs (string-append tr7 "/libs")))
876 (for-each mkdir-p (list tr7 libs bin lib doc))
877 (copy-file "tr7i" (string-append bin "/tr7i"))
878 (copy-file "libtr7.a" (string-append lib "/libtr7.a"))
879 (copy-file "r7rs.pdf" (string-append doc "/r7rs.pdf"))
880 (copy-recursively "tr7libs" libs)))))))
881 (home-page "https://gitlab.com/jobol/tr7")
882 (synopsis "Embedded R7RS small Scheme interpreter")
883 (description
884 "TR7 is a lightweight Scheme interpreter that implements the revision
885R7RS small of scheme programming language.
886
887It is meant to be used as an embedded scripting interpreter for other
888programs. A lot of functionality in TR7 is included conditionally, to allow
889developers freedom in balancing features and footprint.")
890 (license license:bsd-0)))
891
892(define-public stalin
893 (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be"))
894 ;; FIXME: The Stalin "source" contains C code generated by itself:
895 ;; 'stalin-AMD64.c', etc.
896 (package
897 (name "stalin")
898 (version "0.11")
899 (source (origin
900 ;; Use Pearlmutter's upstream branch with AMD64 patches
901 ;; applied. Saves us from including those 20M! patches
902 ;; in Guix. For more info, see:
903 ;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz>
904 (method git-fetch)
905 (uri (git-reference
906 (url "https://github.com/barak/stalin")
907 (commit commit)))
908 (file-name (string-append name "-" version "-checkout"))
909 (sha256
910 (base32
911 "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn"))
912 (modules '((guix build utils)))
913 (snippet
914 ;; remove gc libs from build, we have them as input
915 '(begin
916 (delete-file "gc6.8.tar.gz")
917 (delete-file-recursively "benchmarks")
918 (substitute* "build"
919 ((".*gc6.8.*") "")
920 ((" cd \\.\\.") "")
921 ((".*B include/libgc.a") "")
922 ((".*make.*") ""))
923 #t))))
924 (build-system gnu-build-system)
925 (arguments
926 `(#:make-flags (list "ARCH_OPTS=-freg-struct-return")
927 #:phases
928 (modify-phases %standard-phases
929 (replace 'configure
930 (lambda* (#:key outputs #:allow-other-keys)
931 (let* ((out (assoc-ref outputs "out"))
932 (include-out (string-append out "/include")))
933 (invoke "./build")
934 (for-each (lambda (fname)
935 (install-file fname include-out))
936 (find-files "include"))
937 (substitute* "makefile"
938 (("\\./include") include-out))
939 (substitute* "post-make"
940 (("`pwd`") out))
941 #t)))
942 (delete 'check)
943 (replace 'install
944 (lambda* (#:key outputs #:allow-other-keys)
945 (let ((out (assoc-ref outputs "out")))
946 (install-file "stalin.1"
947 (string-append out "/share/man/man1"))
948 (install-file "stalin"
949 (string-append out "/bin"))
950 #t))))))
951 (inputs
952 (list libx11))
953 (propagated-inputs
954 (list libgc))
955 (supported-systems '("x86_64-linux"))
956 (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf")
957 (synopsis "Brutally efficient Scheme compiler")
958 (description
959 "Stalin is an aggressively optimizing whole-program compiler
960for Scheme that does polyvariant interprocedural flow analysis,
961flow-directed interprocedural escape analysis, flow-directed
962lightweight CPS conversion, flow-directed lightweight closure
963conversion, flow-directed interprocedural lifetime analysis, automatic
964in-lining, unboxing, and flow-directed program-specific and
965program-point-specific low-level representation selection and code
966generation.")
967 (license license:gpl2+))))
968
969(define-public s9fes
970 (package
971 (name "s9fes")
972 (version "20181205")
973 (source
974 (origin
975 (method url-fetch)
976 (uri (string-append "https://www.t3x.org/s9fes/s9fes-" version ".tgz"))
977 (sha256
978 (base32 "0ynpl707bc9drwkdpdgvw14bz9zmwd3wffl1k02sxppjl28xm7rf"))))
979 (build-system gnu-build-system)
980 (arguments
981 `(#:make-flags
982 (list (string-append "CC=" ,(cc-for-target))
983 (string-append "PREFIX=" %output))
984 #:phases
985 (modify-phases %standard-phases
986 (replace 'install
987 (lambda* (#:key make-flags #:allow-other-keys)
988 (apply invoke "make" "install-all" make-flags))))
989 #:tests? #f)) ; No check target.
990 (inputs
991 (list ncurses))
992 (home-page "https://www.t3x.org/s9fes/")
993 (synopsis "Interpreter for R4RS Scheme")
994 (description
995 "Scheme 9 from Empty Space (S9fES) is a mature, portable, and
996comprehensible public-domain interpreter for R4RS Scheme offering:
997@itemize
998@item bignum arithmetics
999@item decimal-based real number arithmetics
1000@item support for low-level Unix programming
1001@item cursor addressing with Curses
1002@item basic networking procedures
1003@item an integrated online help system
1004@item loads of useful library functions
1005@end itemize")
1006 (license license:public-domain)))
1007
1008(define-public femtolisp
1009 (let ((commit "ec7601076a976f845bc05ad6bd3ed5b8cde58a97")
1010 (revision "2"))
1011 (package
1012 (name "femtolisp")
1013 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
1014 (source (origin
1015 (method git-fetch)
1016 (uri (git-reference
1017 (url "https://github.com/JeffBezanson/femtolisp")
1018 (commit commit)))
1019 (file-name (string-append name "-" version "-checkout"))
1020 (sha256
1021 (base32
1022 "1fcyiqlqn27nd4wxi27km8mhmlzpzzsxzpwsl1bxbmhraq468njw"))))
1023 ;; See "utils.h" for supported systems. Upstream bug:
1024 ;; https://github.com/JeffBezanson/femtolisp/issues/25
1025 (supported-systems
1026 (fold delete %supported-systems
1027 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
1028 (build-system gnu-build-system)
1029 (arguments
1030 (list #:make-flags #~(list "CC=gcc" "release")
1031 #:test-target "test"
1032 #:phases
1033 #~(modify-phases %standard-phases
1034 (delete 'bootstrap)
1035 (delete 'configure) ; No configure script
1036 (add-before 'build 'relax-gcc-14-strictness
1037 (lambda _
1038 (setenv "CFLAGS" "-Wno-error=implicit-function-declaration")))
1039 (replace 'install ; Makefile has no 'install phase
1040 (lambda _
1041 (let ((bin (string-append #$output "/bin")))
1042 (install-file "flisp" bin))))
1043 ;; The flisp binary is now available, run bootstrap to
1044 ;; generate flisp.boot and afterwards runs make test.
1045 (add-after 'install 'bootstrap-gen-and-test
1046 (lambda _
1047 (let ((bin (string-append #$output "/bin")))
1048 (invoke "./bootstrap.sh")
1049 (install-file "flisp.boot" bin)))))))
1050 (synopsis "Scheme-like lisp implementation")
1051 (description
1052 "@code{femtolisp} is a scheme-like lisp implementation with a
1053simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
1054The core is 12 builtin special forms and 33 builtin functions.")
1055 (home-page "https://github.com/JeffBezanson/femtolisp")
1056 (license license:bsd-3))))
1057
1058(define-public gauche
1059 (package
1060 (name "gauche")
1061 (version "0.9.15")
1062 (home-page "https://practical-scheme.net/gauche/index.html")
1063 (source
1064 (origin
1065 (method url-fetch)
1066 (uri (string-append
1067 "https://github.com/shirok/Gauche/releases/download/release"
1068 (string-replace-substring version "." "_")
1069 "/Gauche-" version ".tgz"))
1070 (sha256
1071 (base32 "10zpbbikkcpdzk6c52wkckiyhn7nhnqjv2djdzyjr0n8qxxy4hrn"))))
1072 (build-system gnu-build-system)
1073 (inputs
1074 (list libatomic-ops mbedtls-3 slib zlib))
1075 (native-inputs
1076 (list texinfo openssl ; needed for tests
1077 pkg-config)) ; needed to find external libatomic-ops
1078 (arguments
1079 (list #:tests? #f ; 9 ffitest failures, known issue (fixed in 0.9.16):
1080 ;; https://github.com/shirok/Gauche/issues/1044
1081 #:configure-flags
1082 #~(list (string-append "--with-slib=" #$(this-package-input "slib")
1083 "/lib/slib")
1084 "--with-tls=mbedtls")
1085 #:phases
1086 #~(modify-phases %standard-phases
1087 (add-after 'unpack 'patch-/bin/sh
1088 ;; Needed only for tests.
1089 (lambda _
1090 (substitute* '("test/www.scm"
1091 "ext/tls/test.scm"
1092 "lib/gauche/package/util.scm"
1093 "libsrc/gauche/process.scm")
1094 (("/bin/sh") (which "sh")))))
1095 (add-after 'build 'build-doc
1096 (lambda _
1097 (with-directory-excursion "doc"
1098 (invoke "make" "info"))))
1099 (add-before 'check 'patch-network-tests
1100 ;; Remove net checks.
1101 (lambda _
1102 (delete-file "test/net.scm")
1103 (invoke "touch" "test/net.scm")))
1104 (add-after 'install 'install-docs
1105 (lambda _
1106 (with-directory-excursion "doc"
1107 (invoke "make" "install")))))))
1108 (synopsis "Scheme scripting engine")
1109 (description "Gauche is a R7RS Scheme scripting engine aiming at being a
1110handy tool that helps programmers and system administrators to write small to
1111large scripts quickly. Quick startup, built-in system interface, native
1112multilingual support are some of the goals. Gauche comes with a package
1113manager/installer @code{gauche-package} which can download, compile, install
1114and list gauche extension packages.")
1115 (license license:bsd-3)))
1116
1117(define-public sbcl-airship-scheme
1118 (let ((commit "1862db81dfa67729444916c361f39f9f1c5a2ccd")
1119 (revision "0"))
1120 (package
1121 (name "sbcl-airship-scheme")
1122 (version (git-version "0.0.0" revision commit))
1123 (source
1124 (origin
1125 (method git-fetch)
1126 (uri (git-reference
1127 (url "https://gitlab.com/mbabich/airship-scheme.git")
1128 (commit commit)))
1129 (file-name (git-file-name "cl-airship-scheme" version))
1130 (sha256
1131 (base32 "1d1kvrzlx5kcfsn3rn30ww8jihjflpgcka3n3awj2k4f0sq4mplg"))))
1132 (build-system asdf-build-system/sbcl)
1133 (native-inputs (list sbcl-fiveam))
1134 (inputs
1135 (list sbcl-alexandria
1136 sbcl-float-features
1137 sbcl-trivial-features
1138 sbcl-zr-utils))
1139 (synopsis "R7RS Scheme implementation in Common Lisp")
1140 (description
1141 "This is a R7RS Scheme implementation designed to run within
1142a Common Lisp environment.")
1143 (home-page "https://gitlab.com/mbabich/airship-scheme")
1144 (license license:expat))))
1145
1146(define-public cl-airship-scheme
1147 (sbcl-package->cl-source-package sbcl-airship-scheme))
1148
1149(define-public gerbil
1150 (package
1151 (name "gerbil")
1152 (version "0.18.1")
1153 (source
1154 (origin
1155 (method url-fetch)
1156 (uri (string-append
1157 "https://github.com/mighty-gerbils/gerbil/releases/download/v"
1158 version "/gerbil-v" version ".tar.gz"))
1159 (sha256
1160 (base32 "1dff14bzqkq6scyyhnwhc3ky96j6lr84mnghk4da0x6vifw7p0p1"))))
1161 (arguments
1162 (list
1163 ;; Do not build with '-march=native'.
1164 #:configure-flags #~(list "--enable-march=")
1165
1166 #:phases #~(modify-phases %standard-phases
1167 (delete 'bootstrap)
1168 (add-after 'set-paths 'set-cc
1169 (lambda _
1170 (setenv "CC" #$(cc-for-target))))
1171 (add-before 'patch-generated-file-shebangs 'fix-gxi-shebangs
1172 (lambda _
1173 ;; Some .ss files refer to gxi using /usr/bin/env gxi
1174 ;; and 'patch-generated-file-shebangs can't fix that
1175 ;; because gxi has not been compiled yet.
1176 ;; We know where gxi is going to end up so we
1177 ;; Doctor Who our fix here before the problem
1178 ;; happens towards the end of the build.sh script.
1179 (let ((abs-srcdir (getcwd)))
1180 (for-each (lambda (f)
1181 (substitute* f
1182 (("#!/usr/bin/env gxi")
1183 (string-append "#!" abs-srcdir
1184 "/../bin/gxi"))))
1185 '("./src/std/web/rack-test.ss"
1186 "./src/std/web/fastcgi-test.ss"
1187 "./src/std/build.ss"
1188 "./src/build/build-libgerbil.ss"
1189 "./src/gerbil/test/test-build-static-exe.ss"
1190 "./src/gerbil/test/test-build-optimized-static-exe.ss"
1191 "./src/gerbil/test/test-build-optimized-exe.ss"
1192 "./src/gerbil/test/test-build-exe.ss"
1193 "./src/srfi/build.ss"
1194 "./src/r7rs-large/build.ss"
1195 "./src/misc/rpc-perf/build.ss"
1196 "./src/misc/http-perf/build.ss"
1197 "./src/misc/scripts/docsnarf.ss"
1198 "./src/misc/scripts/docstub.ss"
1199 "./src/misc/scripts/docsyms.ss"
1200 "./src/tools/gxpkg.ss"
1201 "./src/tools/build.ss"
1202 "./src/lang/build.ss"
1203 "./src/tutorial/kvstore/build.ss"
1204 "./src/tutorial/httpd/build.ss"
1205 "./src/tutorial/proxy/build.ss"
1206 "./src/tutorial/ensemble/build.ss"
1207 "./src/tutorial/lang/build.ss")))))
1208 (add-before 'build 'set-shell
1209 (lambda _
1210 (setenv "SHELL" "/bin/sh")))
1211 (replace 'build
1212 (lambda _
1213 (setenv "HOME"
1214 (getcwd))
1215 (invoke
1216 ;; The build script needs a tty or it'll crash on an ioctl
1217 ;; trying to find the width of the terminal it's running on.
1218 ;; Calling in script prevents that.
1219 "script"
1220 "-qefc"
1221 "./build.sh"))))
1222 #:tests? #f))
1223 (native-inputs (list gambit-c util-linux))
1224 (propagated-inputs (list gambit-c openssl sqlite zlib))
1225 (build-system gnu-build-system)
1226 (synopsis "Meta-dialect of Scheme with post-modern features")
1227 (description
1228 "Gerbil is an opinionated dialect of Scheme designed for Systems
1229Programming, with a state of the art macro and module system on top of the Gambit
1230runtime. The macro system is based on quote-syntax, and provides the full meta-syntactic
1231tower with a native implementation of syntax-case. It also provides a full-blown module
1232system, similar to PLT Scheme's (sorry, Racket) modules. The main difference from Racket
1233is that Gerbil modules are single instantiation, supporting high performance ahead of
1234time compilation and compiled macros.")
1235 (home-page "https://cons.io")
1236 (license (list license:lgpl2.1
1237 license:asl2.0))))
1238
1239(define-public emacs-gerbil-mode
1240 (package
1241 (inherit gerbil)
1242 (name "emacs-gerbil-mode")
1243 (version "1.0")
1244 (build-system emacs-build-system)
1245 (arguments
1246 (list #:lisp-directory "etc"))
1247 (synopsis "Emacs major-mode for editing Gerbil code")
1248 (description
1249 "Gerbil mode provides font-lock, indentation, navigation, and REPL for
1250Gerbil code within Emacs.")))
1251
1252(define-public owl
1253 (package
1254 (name "owl")
1255 (version "0.2.2")
1256 (source (origin
1257 (method git-fetch)
1258 (uri (git-reference
1259 (url "https://gitlab.com/owl-lisp/owl.git")
1260 (commit (string-append "v" version))))
1261 (sha256
1262 (base32 "0jlmpw14rg63m1q7pjmhjicaqbqgc6gnp53bph0giwg8ha8wxyqr"))
1263 (file-name (git-file-name name version))))
1264 (build-system gnu-build-system)
1265 (arguments
1266 (list
1267 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
1268 (string-append "PREFIX=" #$output))
1269 #:make-flags #~`(,(string-append "PREFIX=" #$output))
1270 #:phases #~(modify-phases %standard-phases
1271 (delete 'configure) ; no configure script
1272 (add-after 'patch-source-shebangs 'patch-ol-shebangs
1273 (lambda _
1274 (lambda _
1275 (substitute* (list "bin/feather"
1276 "tests/hashbang.scm"
1277 "tests/theorem-rand.scm")
1278 (("/usr") #$output))))))
1279 #:test-target "test"))
1280 (native-inputs (list which))
1281 (home-page "https://haltp.org/posts/owl.html")
1282 (synopsis "Functional Scheme dialect")
1283 (description
1284 "Owl Lisp is a simple programming language. It is intended to provide a
1285portable system for writing standalone programs in a subjectively pleasant
1286dialect of Lisp. It has a minimal core and runtime, purely functional
1287operation, and support for asynchronous evaluation.")
1288 (license license:expat)))
1289
1290(define-public stklos
1291 (package
1292 (name "stklos")
1293 (version "2.10")
1294 (source (origin
1295 (method url-fetch)
1296 ;; TODO: Unbundle pcre, libgc, and libffi.
1297 (uri (string-append "https://stklos.net/download/stklos-"
1298 version ".tar.gz"))
1299 (sha256
1300 (base32
1301 "0hd05r5pr3yhgq44n5sqdmvkpgnhf5fybmis2g3gwj10z52h7gvd"))))
1302 (build-system gnu-build-system)
1303 (native-inputs (list pkg-config))
1304 (inputs (list gmp libgc pcre2 libffi readline))
1305 (arguments
1306 (list
1307 #:modules `((ice-9 ftw)
1308 ,@%default-gnu-modules)
1309 #:configure-flags
1310 #~(list (string-append "LDFLAGS=-L"
1311 #$(this-package-input "readline")
1312 "/lib -lreadline"))
1313 #:phases
1314 #~(modify-phases %standard-phases
1315 (add-before 'configure 'patch-sh-references
1316 (lambda* (#:key inputs #:allow-other-keys)
1317 (let ((bash (which "bash")))
1318 (substitute* "configure"
1319 (("/bin/sh") bash)))))
1320 (add-after 'configure 'patch-rm-references
1321 (lambda _
1322 (let ((rm (which "rm")))
1323 (substitute* (find-files "." "^Makefile$")
1324 (("/bin/rm") rm))))))))
1325 (properties
1326 '((release-monitoring-url . "https://stklos.net/download.html")))
1327 (home-page "https://stklos.net")
1328 (synopsis "R7RS Scheme with CLOS-like object system")
1329 (description
1330 "STklos is a free Scheme system mostly compliant with the languages
1331features defined in R7RS small. The aim of this implementation is to be fast
1332as well as light. The implementation is based on an ad-hoc Virtual
1333Machine. STklos can also be compiled as a library and embedded in an
1334application.")
1335 (license license:gpl2+)))
1336
1337(define-public kawa
1338 (package
1339 (name "kawa")
1340 (version "3.1.1")
1341 (source
1342 (origin
1343 (method git-fetch)
1344 (uri (git-reference
1345 (url "https://gitlab.com/kashell/Kawa")
1346 (commit version)))
1347 (file-name (git-file-name name version))
1348 (sha256
1349 (base32 "1qfd0dk4l4dccdhi6lmgv74g98m6mpdiif1qrzgwbj8awbb8x1jy"))
1350 (modules '((guix build utils)))
1351 (snippet
1352 #~(begin
1353 ;; autogen.sh lacks shebang. Let's delete it, the default action
1354 ;; of Guix is equivalent.
1355 (delete-file "autogen.sh")
1356 ;; This duplication of AM_INIT_AUTOMAKE was solved on commit
1357 ;; 85f8e85cb50e79c163951c3d823bbbc7df3cee03 from kawa git repo,
1358 ;; but it was not tagged yet.
1359 (substitute* "bin/configure.ac"
1360 (("AM_INIT_AUTOMAKE\n") ""))))))
1361 (build-system gnu-build-system)
1362 (arguments
1363 (list
1364 #:parallel-build? #f
1365 #:parallel-tests? #f
1366 #:phases
1367 #~(modify-phases %standard-phases
1368 (add-after 'install 'wrap-kawa
1369 (lambda* (#:key inputs #:allow-other-keys)
1370 (wrap-program (string-append #$output "/share/kawa/bin/kawa")
1371 `("JAVA_HOME" ":" = (,#$(this-package-input "icedtea")))))))))
1372 (inputs
1373 (list bash-minimal
1374 `(,icedtea-8 "jdk")))
1375 (native-inputs
1376 (list autoconf
1377 automake
1378 texinfo))
1379 (home-page "https://www.gnu.org/software/kawa/")
1380 (synopsis "Java framework and implementation of Scheme, Elisp, and more")
1381 (description
1382 "GNU Kawa is an implementation of the Scheme programming language that is
1383built on top of the Java platform. It is thus conveniently integrated with
1384Java and benefits from this by having a compiler, optional static typing, and
1385so on. Kawa also serves as a framework for implementing other programming
1386languages on the Java platform.
1387
1388Included in Kawa is qexo, a partial implementation of XQuery in Java.")
1389 (license license:expat)))
1390
1391(define-public loko-scheme
1392 (package
1393 (name "loko-scheme")
1394 (version "0.13.0")
1395 (source
1396 (origin
1397 (method git-fetch)
1398 (uri (git-reference
1399 (url "https://gitlab.com/weinholt/loko")
1400 (commit (string-append "v" version))))
1401 (sha256
1402 (base32 "1hmjmsli2y8wk1whcmk5xylylfrzz33hnzkwbxqwm7mslmd9dagj"))
1403 (file-name (git-file-name name version))))
1404 (build-system gnu-build-system)
1405 (arguments
1406 (list
1407 ;; r7rs tests are a work in progress as of 0.7.0.
1408 #:tests? #f
1409 #:strip-binaries? #f
1410 #:make-flags
1411 #~(list (string-append "PREFIX=" #$output))
1412 #:phases
1413 #~(modify-phases %standard-phases
1414 (delete 'configure)
1415 (add-before 'build 'akku-fixes
1416 (lambda _
1417 (delete-file "Akku.lock")
1418 (substitute* "Akku.manifest"
1419 (("\\(depends.*") "(depends)"))
1420 (invoke "akku" "install")
1421 (let ((dest "./.akku/lib/")
1422 (source "/share/guile/site/3.0/"))
1423 (for-each
1424 (lambda (name prefix)
1425 ;; Symlink the scheme libraries so that Akku can find them
1426 (symlink (string-append prefix source name)
1427 (string-append dest name)))
1428 '("struct" "laesare" "pfds" "machine-code")
1429 (list #$(this-package-native-input "guile-struct-pack")
1430 #$(this-package-native-input "guile-laesare")
1431 #$(this-package-native-input "guile-pfds")
1432 #$(this-package-native-input "guile-machine-code"))))
1433 (substitute* ".akku/env"
1434 (("/bin/sh") (which "sh")))
1435 (substitute* "scheme-wrapper"
1436 (("which ")
1437 "command -v ")))))))
1438 (native-inputs
1439 (list akku
1440 chez-scheme
1441 guile-struct-pack
1442 guile-laesare
1443 guile-pfds
1444 guile-machine-code))
1445 (home-page "https://scheme.fail")
1446 (synopsis "Implementation of the algorithmic language Scheme")
1447 (description
1448 "Loko Scheme is intended to be a platform for application and operating
1449system development. It is written purely in Scheme and some assembler
1450(i.e. no C code at the bottom). Both the R6RS and the R7RS standards are
1451supported.")
1452 (license license:agpl3+)))
1453
1454(define-public r7rs-small-texinfo
1455 (let ((commit "38a703976ea6353e32b52a5187dbdaf77fb2f050")
1456 (revision "3"))
1457 (package
1458 (name "r7rs-small-texinfo")
1459 (version (git-version "0.1.0" revision commit))
1460 (home-page "https://codeberg.org/Zipheir/r7rs-small-texinfo/")
1461 (source
1462 (origin
1463 (uri (git-reference
1464 (url home-page)
1465 (commit commit)))
1466 (method git-fetch)
1467 (file-name (git-file-name name version))
1468 (sha256
1469 (base32 "1fr02fyhiwd364jkfy1n5w31pq3kx1rl5w634421g05702yb47x3"))))
1470 (native-inputs (list bash texinfo))
1471 (inputs '())
1472 (build-system copy-build-system)
1473 (arguments
1474 (list
1475 #:install-plan #~'(("r7rs-small.info" "share/info/"))
1476 #:phases #~(modify-phases %standard-phases
1477 (add-after 'unpack 'compile-the-files
1478 (lambda _
1479 (let* ((source-directory-path (string-append (getcwd)
1480 "/doc/r7rs-small"))
1481 (build-script-path (string-append
1482 source-directory-path
1483 "/build.sh"))
1484 (info-directory-path (string-append #$output
1485 "/share/info")))
1486 (chdir source-directory-path)
1487 (system* "bash" build-script-path "info")
1488 (mkdir-p info-directory-path)
1489 (copy-file (string-append source-directory-path
1490 "/r7rs-small.info")
1491 (string-append info-directory-path
1492 "/r7rs-small.info"))))))))
1493 (synopsis
1494 "R7RS Small standard of the Scheme programming language in Info format")
1495 (description
1496 "Revised^7 Report of the Algorithmic Language Scheme adapted to Texinfo format.")
1497 (license (license:non-copyleft "file://COPYING")))))