1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
4 ;;; Copyright © 2015, 2016 Federico Beffa <beffa@fbengineering.ch>
5 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
8 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
9 ;;; Copyright © 2017 John Darrington <jmd@gnu.org>
10 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
11 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
13 ;;; Copyright © 2018 Gabriel Hondet <gabrielhondet@gmail.com>
14 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
15 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages scheme)
33 #:use-module (gnu packages)
34 #:use-module ((guix licenses)
35 #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
36 cc-by-sa4.0 non-copyleft expat))
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix utils)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system trivial)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages bdw-gc)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages databases)
47 #:use-module (gnu packages libevent)
48 #:use-module (gnu packages libunistring)
49 #:use-module (gnu packages m4)
50 #:use-module (gnu packages multiprecision)
51 #:use-module (gnu packages ncurses)
52 #:use-module (gnu packages pcre)
53 #:use-module (gnu packages emacs)
54 #:use-module (gnu packages ghostscript)
55 #:use-module (gnu packages netpbm)
56 #:use-module (gnu packages texinfo)
57 #:use-module (gnu packages tex)
58 #:use-module (gnu packages base)
59 #:use-module (gnu packages compression)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages avahi)
62 #:use-module (gnu packages libphidget)
63 #:use-module (gnu packages gcc)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages gtk)
66 #:use-module (gnu packages libffi)
67 #:use-module (gnu packages fontutils)
68 #:use-module (gnu packages image)
69 #:use-module (gnu packages xorg)
70 #:use-module (gnu packages sqlite)
71 #:use-module (gnu packages tls)
72 #:use-module (gnu packages gl)
73 #:use-module (gnu packages libedit)
74 #:use-module (srfi srfi-1)
75 #:use-module (ice-9 match))
77 (define (mit-scheme-source-directory system version)
78 (string-append "mit-scheme-"
79 (if (or (string-prefix? "x86_64" system)
80 (string-prefix? "i686" system))
85 (define-public mit-scheme
89 (source #f) ; see below
90 (outputs '("out" "doc"))
91 (build-system gnu-build-system)
93 `(#:modules ((guix build gnu-build-system)
97 (modify-phases %standard-phases
99 (lambda* (#:key inputs #:allow-other-keys)
101 (assoc-ref inputs "source"))
102 (chdir ,(mit-scheme-source-directory (%current-system)
104 ;; Delete these dangling symlinks since they break
106 (for-each delete-file
107 (find-files "src/compiler" "^make\\."))
110 (add-after 'unpack 'patch-/bin/sh
112 (setenv "CONFIG_SHELL" (which "sh"))
113 (substitute* '("../tests/ffi/autogen.sh"
114 "../tests/ffi/autobuild.sh"
115 "../tests/ffi/test-ffi.sh"
116 "../tests/runtime/test-process.scm"
117 "runtime/unxprm.scm")
118 (("/bin/sh") (which "sh"))
119 (("\\./autogen\\.sh")
120 (string-append (which "sh") " autogen.sh"))
122 (string-append (which "sh") " configure")))
124 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
125 ;; them in HOME, so it needs to be writeable.
126 (add-before 'build 'set-HOME
127 (lambda _ (setenv "HOME" "/tmp") #t))
129 (lambda* (#:key system outputs #:allow-other-keys)
130 (let ((out (assoc-ref outputs "out")))
131 (if (or (string-prefix? "x86_64" system)
132 (string-prefix? "i686" system))
133 (invoke "make" "compile-microcode")
134 (invoke "./etc/make-liarc.sh"
135 (string-append "--prefix=" out)))
137 (add-after 'configure 'configure-doc
138 (lambda* (#:key outputs inputs #:allow-other-keys)
139 (with-directory-excursion "../doc"
140 (let* ((out (assoc-ref outputs "out"))
141 (bash (assoc-ref inputs "bash"))
142 (bin/sh (string-append bash "/bin/sh")))
143 (invoke bin/sh "./configure"
144 (string-append "--prefix=" out)
145 (string-append "SHELL=" bin/sh))
147 (add-after 'build 'build-doc
149 (with-directory-excursion "../doc"
152 (add-after 'install 'install-doc
153 (lambda* (#:key outputs #:allow-other-keys)
154 (let* ((out (assoc-ref outputs "out"))
155 (doc (assoc-ref outputs "doc"))
156 (old-doc-dir (string-append out "/share/doc"))
157 (new-doc/mit-scheme-dir
158 (string-append doc "/share/doc/" ,name "-" ,version)))
159 (with-directory-excursion "../doc"
160 (for-each (lambda (target)
161 (invoke "make" target))
162 '("install-info-gz" "install-man"
163 "install-html" "install-pdf")))
164 (mkdir-p new-doc/mit-scheme-dir)
166 (string-append old-doc-dir "/" ,name)
167 new-doc/mit-scheme-dir)
168 (delete-file-recursively old-doc-dir)
171 `(;; Autoconf, Automake, and Libtool are necessary for the FFI tests.
172 ("autoconf" ,autoconf)
173 ("automake" ,automake)
175 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
183 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
184 ;; compile from the architecture-specific tarballs, which contain
185 ;; pre-built binaries. It leads to more efficient code than when
186 ;; building the tarball that contains generated C code instead of
190 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
191 version "/mit-scheme-"
192 (match (%current-system)
194 (string-append version "-x86-64"))
196 (string-append version "-i386"))
198 (string-append "c-" version)))
201 (match (%current-system)
204 "03m7cc035w3avs91j2pcz9f15ssgvgp3rm045d1vbydqrkzfyw8k"))
207 "05sjyz90xxfnmi87qv8x0yx0fcallnzl1dciygdafp317pn489is"))
210 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))))))))
212 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
213 ;; Also, the portable C version of MIT/GNU Scheme did not work in time for
214 ;; release in version 10.1.
215 (supported-systems '("x86_64-linux" "i686-linux"))
217 (home-page "https://www.gnu.org/software/mit-scheme/")
218 (synopsis "A Scheme implementation with integrated editor and debugger")
220 "GNU/MIT Scheme is an implementation of the Scheme programming
221 language. It provides an interpreter, a compiler and a debugger. It also
222 features an integrated Emacs-like editor and a large runtime library.")
224 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
226 (define-public bigloo
227 ;; Upstream modifies source tarballs in place, making significant changes
228 ;; long after the initial publication: <https://bugs.gnu.org/33525>.
229 (let ((upstream-version "4.3f"))
235 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
236 upstream-version ".tar.gz"))
239 "09whj8z91qbihk59dw2yb2ccbx9nk1c4l65j62pfs1pz822cpyh9"))
240 ;; Remove bundled libraries.
241 (modules '((guix build utils)))
244 (for-each delete-file-recursively
245 '("gc" "gmp" "libuv"))
247 (build-system gnu-build-system)
249 `(#:test-target "test"
251 (modify-phases %standard-phases
253 (lambda* (#:key inputs outputs #:allow-other-keys)
255 (substitute* "configure"
257 (string-append "shell=" (which "bash") "\n"))
259 (substitute* "autoconf/runtest.in"
261 (substitute* "autoconf/osversion"
262 (("^version.*$") "version=\"\"\n"))
263 (substitute* "comptime/Makefile"
264 (("\\$\\(LDCOMPLIBS\\)")
265 "$(LDCOMPLIBS) $(LDFLAGS)"))
267 ;; The `configure' script doesn't understand options
268 ;; of those of Autoconf.
269 (let ((out (assoc-ref outputs "out")))
270 (invoke "./configure"
271 (string-append "--prefix=" out)
272 ; use system libraries
274 "--customunistring=no"
276 (string-append"--mv=" (which "mv"))
277 (string-append "--rm=" (which "rm"))
279 (string-append "--ldflags=-Wl,-rpath="
280 (assoc-ref outputs "out")
281 "/lib/bigloo/" ,upstream-version)
282 (string-append "--lispdir=" out
283 "/share/emacs/site-lisp")
285 "--sharedcompiler=yes"
286 "--disable-patch"))))
287 (add-after 'install 'install-emacs-modes
288 (lambda* (#:key outputs #:allow-other-keys)
289 (let* ((out (assoc-ref outputs "out"))
290 (dir (string-append out "/share/emacs/site-lisp")))
291 (invoke "make" "-C" "bmacs" "all" "install"
292 (string-append "EMACSBRAND=emacs25")
293 (string-append "EMACSDIR=" dir))))))))
295 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
297 ("libunistring" ,libunistring)
302 ;; Optional APIs for which Bigloo has bindings.
304 ("libphidget" ,libphidget)
307 `(("pkg-config" ,pkg-config)))
309 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
310 (home-page "https://www-sop.inria.fr/indes/fp/Bigloo/")
311 (synopsis "Efficient Scheme compiler")
313 "Bigloo is a Scheme implementation devoted to one goal: enabling Scheme
314 based programming style where C(++) is usually required. Bigloo attempts to
315 make Scheme practical by offering features usually presented by traditional
316 programming languages but not offered by Scheme and functional programming.
317 Bigloo compiles Scheme modules. It delivers small and fast stand alone binary
318 executables. Bigloo enables full connections between Scheme and C programs
319 and between Scheme and Java programs.")
325 (version "3.2.0-pre1")
328 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
332 "0jf418d0s9imv98s6qrpjxr1mdaxr37knh5qyfl5y4a9cc41mlg5"))))
333 (build-system gnu-build-system)
335 `(#:test-target "test"
336 #:make-flags '("BIGLOO=bigloo")
339 (modify-phases %standard-phases
341 (lambda* (#:key inputs outputs #:allow-other-keys)
342 (let ((out (assoc-ref outputs "out")))
343 (substitute* '("tools/Makefile"
344 "test/hopjs/TEST.in")
345 (("/bin/rm") (which "rm")))
346 (invoke "./configure"
347 (string-append "--prefix=" out)
349 (string-append "--blflags="
350 ;; user flags completely override useful
351 ;; default flags, so repeat them here.
352 "-copt \\$(CPICFLAGS) "
353 "-L \\$(BUILDLIBDIR) "
354 "-ldopt -Wl,-rpath," out "/lib"))))))))
355 (inputs `(("avahi" ,avahi)
358 ("libunistring" ,libunistring)
363 (home-page "http://hop.inria.fr/")
364 (synopsis "Multi-tier programming language for the Web 2.0")
366 "HOP is a multi-tier programming language for the Web 2.0 and the
367 so-called diffuse Web. It is designed for programming interactive web
368 applications in many fields such as multimedia (web galleries, music players,
369 ...), ubiquitous and house automation (SmartPhones, personal appliance),
370 mashups, office (web agendas, mail clients, ...), etc.")
373 (define-public scheme48
379 (uri (string-append "http://s48.org/" version
380 "/scheme48-" version ".tgz"))
383 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
384 (patches (search-patches "scheme48-tests.patch"))))
385 (build-system gnu-build-system)
386 (home-page "http://s48.org/")
387 (synopsis "Scheme implementation using a bytecode interpreter")
389 "Scheme 48 is an implementation of Scheme based on a byte-code
390 interpreter and is designed to be used as a testbed for experiments in
391 implementation techniques and as an expository tool.")
393 ;; Most files are BSD-3; see COPYING for the few exceptions.
396 (define-public racket
402 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
403 version "/racket-" version "-src.tgz")
405 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
406 version "/racket-" version "-src.tgz")))
409 "0cx5h3k0n58cb442qzp3jlc7n1b9dbaxv9blg2rjil2rn119yrb2"))
410 (patches (search-patches
411 "racket-store-checksum-override.patch"))))
412 (build-system gnu-build-system)
415 (modify-phases %standard-phases
416 (add-before 'configure 'pre-configure-minimal
417 (lambda* (#:key inputs #:allow-other-keys)
418 ;; Patch dynamically loaded libraries with their absolute paths.
419 (let* ((library-path (search-path-as-string->list
420 (getenv "LIBRARY_PATH")))
421 (find-so (lambda (soname)
424 (format #f "~a.so" soname)))))
425 (substitute* "collects/db/private/sqlite3/ffi.rkt"
426 (("ffi-lib sqlite-so")
427 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
428 (substitute* "collects/openssl/libssl.rkt"
429 (("ffi-lib libssl-so")
430 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
431 (substitute* "collects/openssl/libcrypto.rkt"
432 (("ffi-lib libcrypto-so")
433 (format #f "ffi-lib \"~a\"" (find-so "libcrypto")))))
436 (add-before 'pre-configure-minimal 'pre-configure
437 (lambda* (#:key inputs #:allow-other-keys)
438 ;; Patch dynamically loaded libraries with their absolute paths.
439 (let* ((library-path (search-path-as-string->list
440 (getenv "LIBRARY_PATH")))
441 (find-so (lambda (soname)
444 (format #f "~a.so" soname))))
445 (patch-ffi-libs (lambda (file libs)
449 (((format #f "\"~a\"" lib))
450 (format #f "\"~a\"" (find-so lib)))))
452 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
453 (("ffi-lib libgmp-so")
454 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
455 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
456 (("ffi-lib libmpfr-so")
457 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
458 (substitute* "share/pkgs/readline-lib/readline/rktrl.rkt"
459 (("\\(getenv \"PLT_READLINE_LIB\"\\)")
460 (format #f "\"~a\"" (find-so "libedit"))))
462 (lambda (x) (apply patch-ffi-libs x))
463 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
464 ("libfontconfig" "libcairo"))
465 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
466 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
467 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
469 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
470 ("libpango-1.0" "libpangocairo-1.0"))
471 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
473 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
475 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
477 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
479 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
480 ("libgdk-3" "libgtk-3"))
481 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
483 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
484 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
485 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
487 ("share/pkgs/sgl/gl.rkt"
488 ("libGL" "libGLU")))))
490 (add-after 'unpack 'patch-/bin/sh
492 (substitute* "collects/racket/system.rkt"
493 (("/bin/sh") (which "sh")))
495 ;; XXX: how to run them?
499 ;; Hardcode dynamically loaded libraries for better functionality.
500 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
502 ("fontconfig" ,fontconfig)
506 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
507 ("libjpeg" ,libjpeg-turbo)
515 ("unixodbc" ,unixodbc)
516 ("libedit" ,libedit)))
517 (home-page "https://racket-lang.org")
518 (synopsis "Implementation of Scheme and related languages")
520 "Racket is an implementation of the Scheme programming language (R5RS and
521 R6RS) and related languages, such as Typed Racket. It features a compiler and
522 a virtual machine with just-in-time native compilation, as well as a large set
524 ;; https://download.racket-lang.org/license.html
525 (license (list lgpl3+ asl2.0 expat))))
527 (define-public racket-minimal
530 (name "racket-minimal")
531 (version (package-version racket))
534 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
535 version "/racket-minimal-" version "-src.tgz")
537 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
538 version "/racket-minimal-" version "-src.tgz")))
541 "1lxcd4ix8q3089xql48hwccxvcpkinfxwxnc6fhcjdgzqcyxh3ln"))
542 (patches (search-patches
543 "racket-store-checksum-override.patch"))))
544 (synopsis "Racket without bundled packages such as Dr. Racket")
546 (substitute-keyword-arguments (package-arguments racket)
548 `(modify-phases ,phases
549 ;; Delete fix that applies to files not included in the minimal package.
550 (delete 'pre-configure)))))
556 "Racket is an implementation of the Scheme programming language (R5RS and
557 R6RS) and related languages, such as Typed Racket. It features a compiler and
558 a virtual machine with just-in-time native compilation, as well as a large set
561 In this minimal package, the essential package racket-libs is included, as
562 well as libraries that live in collections. In particular, @command{raco} and
563 the @code{pkg} library are still bundled.")))
565 (define-public gambit-c
573 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
574 (version-major+minor version) "/source/gambit-v"
575 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
578 (base32 "1p6172vhcrlpjgia6hsks1w4fl8rdyjf9xjh14wxfkv7dnx8a5hk"))))
579 (build-system gnu-build-system)
582 ;; According to the ./configure script, this makes the build slower and
583 ;; use >= 1 GB memory, but makes Gambit much faster.
584 '("--enable-single-host")))
585 (home-page "http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page")
586 (synopsis "Efficient Scheme interpreter and compiler")
588 "Gambit consists of two main programs: gsi, the Gambit Scheme
589 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
590 the complete execution and debugging environment. The compiler is the
591 interpreter extended with the capability of generating executable files. The
592 compiler can produce standalone executables or compiled modules which can be
593 loaded at run time. Interpreted code and compiled code can be freely
596 (license (list lgpl2.1+ asl2.0))))
598 (define-public chibi-scheme
600 (name "chibi-scheme")
602 (home-page "https://github.com/ashinn/chibi-scheme")
606 (uri (git-reference (url home-page) (commit version)))
607 (file-name (git-file-name name version))
610 "1lnap41gl9vg82h557f4rlr69jgmd2gh0iqs6cxm77d39kv1scb8"))))
611 (build-system gnu-build-system)
613 `(#:phases (modify-phases %standard-phases
615 (add-before 'build 'set-cc
617 (setenv "CC" "gcc"))))
618 #:make-flags (let ((out (assoc-ref %outputs "out")))
619 (list (string-append "PREFIX=" out)
620 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
621 #:test-target "test"))
622 (synopsis "Small embeddable Scheme implementation")
624 "Chibi-Scheme is a very small library with no external dependencies
625 intended for use as an extension and scripting language in C programs. In
626 addition to support for lightweight VM-based threads, each VM itself runs in
627 an isolated heap allowing multiple VMs to run simultaneously in different OS
632 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
635 (version (string-append "20170703-1." (string-take commit 7)))
639 (url "https://github.com/sarabander/sicp")
643 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
644 (file-name (string-append name "-" version "-checkout"))))
645 (build-system trivial-build-system)
646 (native-inputs `(("gzip" ,gzip)
648 ("texinfo" ,texinfo)))
650 `(#:modules ((guix build utils))
653 (use-modules (guix build utils)
655 (let ((gzip (assoc-ref %build-inputs "gzip"))
656 (source (assoc-ref %build-inputs "source"))
657 (texinfo (assoc-ref %build-inputs "texinfo"))
658 (html-dir (string-append %output "/share/doc/" ,name "/html"))
659 (info-dir (string-append %output "/share/info")))
660 (copy-recursively (string-append source "/html") html-dir)
661 (setenv "PATH" (string-append gzip "/bin"
664 (invoke "makeinfo" "--output"
665 (string-append info-dir "/sicp.info")
666 (string-append source "/sicp-pocket.texi"))
667 (for-each (cut invoke "gzip" "-9n" <>)
668 (find-files info-dir))
670 (home-page "https://sarabander.github.io/sicp")
671 (synopsis "Structure and Interpretation of Computer Programs")
672 (description "Structure and Interpretation of Computer Programs (SICP) is
673 a textbook aiming to teach the principles of computer programming.
675 Using Scheme, a dialect of the Lisp programming language, the book explains
676 core computer science concepts such as abstraction in programming,
677 metalinguistic abstraction, recursion, interpreters, and modular programming.")
678 (license cc-by-sa4.0))))
680 (define-public scheme48-rx
681 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
685 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
690 (url "https://github.com/scheme/rx")
694 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
695 (file-name (string-append name "-" version "-checkout"))))
696 (build-system trivial-build-system)
698 `(#:modules ((guix build utils))
701 (use-modules (guix build utils))
702 (let ((share (string-append %output
704 ,(package-version scheme48)
706 (chdir (assoc-ref %build-inputs "source"))
708 (copy-recursively "." share)
712 ("scheme48" ,scheme48)))
713 (home-page "https://github.com/scheme/rx/")
714 (synopsis "SRE String pattern-matching library for scheme48")
716 "String pattern-matching library for scheme48 based on the SRE
717 regular-expression notation.")
726 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
730 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
731 (build-system gnu-build-system)
733 `(#:tests? #f ; There is no check target.
735 (modify-phases %standard-phases
736 (add-after 'install 'remove-bin-share
737 (lambda* (#:key inputs outputs #:allow-other-keys)
738 (delete-file-recursively
739 (string-append (assoc-ref outputs "out") "/bin"))
742 (lambda* (#:key inputs outputs #:allow-other-keys)
743 (invoke "./configure"
744 (string-append "--prefix="
745 (assoc-ref outputs "out"))))))))
746 (native-inputs `(("unzip" ,unzip)
747 ("texinfo" ,texinfo)))
748 (home-page "https://people.csail.mit.edu/jaffer/SLIB.html")
749 (synopsis "Compatibility and utility library for Scheme")
750 (description "SLIB is a portable Scheme library providing compatibility and
751 utility functions for all standard Scheme implementations.")
752 (license (non-copyleft
753 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
754 "Or see COPYING in the distribution."))))
763 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
767 "1jxxlhmgal26mpcl97kz37djkn97rfy9h5pvw0hah6f3f6w49j97"))))
768 (build-system gnu-build-system)
771 (modify-phases %standard-phases
773 (lambda* (#:key inputs outputs #:allow-other-keys)
774 (invoke "./configure"
775 (string-append "--prefix="
776 (assoc-ref outputs "out")))))
777 (add-before 'build 'pre-build
778 (lambda* (#:key inputs #:allow-other-keys)
779 (substitute* "Makefile"
780 (("ginstall-info") "install-info"))
783 (lambda* (#:key inputs outputs #:allow-other-keys)
784 (setenv "SCHEME_LIBRARY_PATH"
785 (string-append (assoc-ref inputs "slib")
787 (invoke "make" "scmlit" "CC=gcc")
788 (invoke "make" "all")))
789 (add-after 'install 'post-install
790 (lambda* (#:key inputs outputs #:allow-other-keys)
791 (let* ((out (assoc-ref outputs "out"))
792 (req (string-append out "/lib/scm/require.scm")))
794 (format (open req (logior O_WRONLY O_CREAT))
795 "(define (library-vicinity) ~s)\n"
796 (string-append (assoc-ref inputs "slib")
799 ;; We must generate the slibcat file.
800 (invoke (string-append out "/bin/scm")
801 "-br" "new-catalog")))))))
802 (inputs `(("slib" ,slib)))
803 (native-inputs `(("unzip" ,unzip)
804 ("texinfo" ,texinfo)))
805 (home-page "https://people.csail.mit.edu/jaffer/SCM")
806 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
807 (description "GNU SCM is an implementation of Scheme. This
808 implementation includes Hobbit, a Scheme-to-C compiler, which can
809 generate C files whose binaries can be dynamically or statically
810 linked with a SCM executable.")
813 (define-public tinyscheme
819 (uri (string-append "mirror://sourceforge/" name "/" name "/"
820 name "-" version "/" name "-" version ".zip"))
823 "0yqma4jrjgj95f3hf30h542x97n8ah234n19yklbqq0phfsa08wf"))))
824 (build-system gnu-build-system)
829 (modify-phases %standard-phases
831 (lambda* (#:key source #:allow-other-keys)
832 (invoke "unzip" source)
833 (chdir (string-append ,name "-" ,version))
835 (add-after 'unpack 'set-scm-directory
836 ;; Hard-code ‘our’ init.scm instead of looking in the current
837 ;; working directory, so invoking ‘scheme’ just works.
838 (lambda* (#:key outputs #:allow-other-keys)
839 (let* ((out (assoc-ref outputs "out"))
840 (scm (string-append out "/share/" ,name)))
841 (substitute* "scheme.c"
843 (string-append scm "/" all)))
845 (delete 'configure) ; no configure script
847 ;; There's no ‘install’ target. Install files manually.
848 (lambda* (#:key outputs #:allow-other-keys)
849 (let* ((out (assoc-ref outputs "out"))
850 (bin (string-append out "/bin"))
851 (doc (string-append out "/share/doc/"
853 (include (string-append out "/include"))
854 (lib (string-append out "/lib"))
855 (scm (string-append out "/share/" ,name)))
856 (install-file "scheme" bin)
857 (install-file "Manual.txt" doc)
858 (install-file "scheme.h" include)
859 (install-file "libtinyscheme.so" lib)
860 (install-file "init.scm" scm)
862 #:tests? #f)) ; no tests
863 (home-page "http://tinyscheme.sourceforge.net/")
864 (synopsis "Light-weight interpreter for the Scheme programming language")
866 "TinyScheme is a light-weight Scheme interpreter that implements as large a
867 subset of R5RS as was possible without getting very large and complicated.
869 It's meant to be used as an embedded scripting interpreter for other programs.
870 As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
871 extensive toolkits, although it does sport a small (and optional) top-level
874 As an embedded interpreter, it allows multiple interpreter states to coexist in
875 the same program, without any interference between them. Foreign functions in C
876 can be added and values can be defined in the Scheme environment. Being quite a
877 small program, it is easy to comprehend, get to grips with, and use.")
878 (license bsd-3))) ; there are no licence headers
880 (define-public stalin
881 (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be"))
882 ;; FIXME: The Stalin "source" contains C code generated by itself:
883 ;; 'stalin-AMD64.c', etc.
888 ;; Use Pearlmutter's upstream branch with AMD64 patches
889 ;; applied. Saves us from including those 20M! patches
890 ;; in Guix. For more info, see:
891 ;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz>
894 (url "https://github.com/barak/stalin")
896 (file-name (string-append name "-" version "-checkout"))
899 "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn"))
900 (modules '((guix build utils)))
902 ;; remove gc libs from build, we have them as input
904 (delete-file "gc6.8.tar.gz")
905 (delete-file-recursively "benchmarks")
909 ((".*B include/libgc.a") "")
912 (build-system gnu-build-system)
914 `(#:make-flags (list "ARCH_OPTS=-freg-struct-return")
916 (modify-phases %standard-phases
918 (lambda* (#:key outputs #:allow-other-keys)
919 (let* ((out (assoc-ref outputs "out"))
920 (include-out (string-append out "/include")))
922 (for-each (lambda (fname)
923 (install-file fname include-out))
924 (find-files "include"))
925 (substitute* "makefile"
926 (("\\./include") include-out))
927 (substitute* "post-make"
932 (lambda* (#:key outputs #:allow-other-keys)
933 (let ((out (assoc-ref outputs "out")))
934 (install-file "stalin.1"
935 (string-append out "/share/man/man1"))
936 (install-file "stalin"
937 (string-append out "/bin"))
940 `(("libx11" ,libx11)))
943 (supported-systems '("x86_64-linux"))
944 (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf")
945 (synopsis "Brutally efficient Scheme compiler")
947 "Stalin is an aggressively optimizing whole-program compiler
948 for Scheme that does polyvariant interprocedural flow analysis,
949 flow-directed interprocedural escape analysis, flow-directed
950 lightweight CPS conversion, flow-directed lightweight closure
951 conversion, flow-directed interprocedural lifetime analysis, automatic
952 in-lining, unboxing, and flow-directed program-specific and
953 program-point-specific low-level representation selection and code
957 (define-public femtolisp
958 (let ((commit "ec7601076a976f845bc05ad6bd3ed5b8cde58a97")
962 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
966 (url "https://github.com/JeffBezanson/femtolisp")
968 (file-name (string-append name "-" version "-checkout"))
971 "1fcyiqlqn27nd4wxi27km8mhmlzpzzsxzpwsl1bxbmhraq468njw"))))
972 ;; See "utils.h" for supported systems. Upstream bug:
973 ;; https://github.com/JeffBezanson/femtolisp/issues/25
975 (fold delete %supported-systems
976 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
977 (build-system gnu-build-system)
979 `(#:make-flags '("CC=gcc" "release")
982 (modify-phases %standard-phases
984 (delete 'configure) ; No configure script
985 (replace 'install ; Makefile has no 'install phase
986 (lambda* (#:key outputs #:allow-other-keys)
987 (let* ((out (assoc-ref outputs "out"))
988 (bin (string-append out "/bin")))
989 (install-file "flisp" bin)
991 ;; The flisp binary is now available, run bootstrap to
992 ;; generate flisp.boot and afterwards runs make test.
993 (add-after 'install 'bootstrap-gen-and-test
994 (lambda* (#:key outputs #:allow-other-keys)
995 (let* ((out (assoc-ref outputs "out"))
996 (bin (string-append out "/bin")))
997 (invoke "./bootstrap.sh")
998 (install-file "flisp.boot" bin)
1000 (synopsis "Scheme-like lisp implementation")
1002 "@code{femtolisp} is a scheme-like lisp implementation with a
1003 simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
1004 The core is 12 builtin special forms and 33 builtin functions.")
1005 (home-page "https://github.com/JeffBezanson/femtolisp")
1008 (define-public gauche
1012 (home-page "https://practical-scheme.net/gauche/index.html")
1017 "mirror://sourceforge/gauche/Gauche/Gauche-"
1020 (base32 "1yzpszhw52vkpr65r5d4khf3489mnnvnw58dd2wsvvx7499k5aac"))
1021 (modules '((guix build utils)))
1023 ;; Remove libatomic-ops.
1024 (delete-file-recursively "gc/libatomic_ops")
1026 (build-system gnu-build-system)
1028 `(("libatomic-ops" ,libatomic-ops)
1031 `(("texinfo" ,texinfo)
1032 ("openssl" ,openssl) ; needed for tests
1033 ("pkg-config" ,pkg-config))) ; needed to find external libatomic-ops
1036 (modify-phases %standard-phases
1037 (add-after 'unpack 'patch-/bin/sh
1038 ;; Needed only for tests.
1040 (substitute* '("configure"
1044 "lib/gauche/configure.scm"
1045 "lib/gauche/package/util.scm"
1046 "lib/gauche/process.scm")
1047 (("/bin/sh") (which "sh")))
1049 (add-after 'build 'build-doc
1051 (with-directory-excursion "doc"
1052 (invoke "make" "info"))
1054 (add-before 'check 'patch-normalize-test
1055 ;; Neutralize sys-normalize-pathname test as it relies on
1056 ;; the home directory; (setenv "HOME" xx) isn't enough).
1058 (substitute* "test/system.scm"
1059 (("~/abc") "//abc"))
1061 (add-before 'check 'patch-network-tests
1062 ;; Remove net checks.
1064 (substitute* "ext/Makefile"
1065 (("binary net termios") "binary termios"))
1067 (add-after 'install 'install-docs
1069 (with-directory-excursion "doc"
1070 (invoke "make" "install"))
1072 (synopsis "Scheme scripting engine")
1073 (description "Gauche is a R7RS Scheme scripting engine aiming at being a
1074 handy tool that helps programmers and system administrators to write small to
1075 large scripts quickly. Quick startup, built-in system interface, native
1076 multilingual support are some of the goals. Gauche comes with a package
1077 manager/installer @code{gauche-package} which can download, compile, install
1078 and list gauche extension packages.")