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>
16 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages scheme)
34 #:use-module (gnu packages)
35 #:use-module ((guix licenses)
36 #:select (gpl2+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ asl2.0 bsd-3
37 cc-by-sa4.0 non-copyleft expat))
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix utils)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system trivial)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages bdw-gc)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages databases)
48 #:use-module (gnu packages libevent)
49 #:use-module (gnu packages libunistring)
50 #:use-module (gnu packages m4)
51 #:use-module (gnu packages multiprecision)
52 #:use-module (gnu packages ncurses)
53 #:use-module (gnu packages pcre)
54 #:use-module (gnu packages emacs)
55 #:use-module (gnu packages ghostscript)
56 #:use-module (gnu packages netpbm)
57 #:use-module (gnu packages texinfo)
58 #:use-module (gnu packages tex)
59 #:use-module (gnu packages base)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages avahi)
63 #:use-module (gnu packages libphidget)
64 #:use-module (gnu packages gcc)
65 #:use-module (gnu packages glib)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages libffi)
68 #:use-module (gnu packages fontutils)
69 #:use-module (gnu packages image)
70 #:use-module (gnu packages xorg)
71 #:use-module (gnu packages sqlite)
72 #:use-module (gnu packages tls)
73 #:use-module (gnu packages gl)
74 #:use-module (gnu packages libedit)
75 #:use-module (gnu packages linux)
76 #:use-module (srfi srfi-1)
77 #:use-module (ice-9 match))
79 (define (mit-scheme-source-directory system version)
80 (string-append "mit-scheme-"
81 (if (or (string-prefix? "x86_64" system)
82 (string-prefix? "i686" system))
87 (define-public mit-scheme
91 (source #f) ; see below
92 (outputs '("out" "doc"))
93 (build-system gnu-build-system)
95 `(#:modules ((guix build gnu-build-system)
99 (modify-phases %standard-phases
101 (lambda* (#:key inputs #:allow-other-keys)
103 (assoc-ref inputs "source"))
104 (chdir ,(mit-scheme-source-directory (%current-system)
106 ;; Delete these dangling symlinks since they break
108 (for-each delete-file
109 (find-files "src/compiler" "^make\\."))
112 (add-after 'unpack 'patch-/bin/sh
114 (setenv "CONFIG_SHELL" (which "sh"))
115 (substitute* '("../tests/ffi/autogen.sh"
116 "../tests/ffi/autobuild.sh"
117 "../tests/ffi/test-ffi.sh"
118 "../tests/runtime/test-process.scm"
119 "runtime/unxprm.scm")
120 (("/bin/sh") (which "sh"))
121 (("\\./autogen\\.sh")
122 (string-append (which "sh") " autogen.sh"))
124 (string-append (which "sh") " configure")))
126 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
127 ;; them in HOME, so it needs to be writeable.
128 (add-before 'build 'set-HOME
129 (lambda _ (setenv "HOME" "/tmp") #t))
131 (lambda* (#:key system outputs #:allow-other-keys)
132 (let ((out (assoc-ref outputs "out")))
133 (if (or (string-prefix? "x86_64" system)
134 (string-prefix? "i686" system))
135 (invoke "make" "compile-microcode")
136 (invoke "./etc/make-liarc.sh"
137 (string-append "--prefix=" out)))
139 (add-after 'configure 'configure-doc
140 (lambda* (#:key outputs inputs #:allow-other-keys)
141 (with-directory-excursion "../doc"
142 (let* ((out (assoc-ref outputs "out"))
143 (bash (assoc-ref inputs "bash"))
144 (bin/sh (string-append bash "/bin/sh")))
145 (invoke bin/sh "./configure"
146 (string-append "--prefix=" out)
147 (string-append "SHELL=" bin/sh))
149 (add-after 'build 'build-doc
151 (with-directory-excursion "../doc"
154 (add-after 'install 'install-doc
155 (lambda* (#:key outputs #:allow-other-keys)
156 (let* ((out (assoc-ref outputs "out"))
157 (doc (assoc-ref outputs "doc"))
158 (old-doc-dir (string-append out "/share/doc"))
159 (new-doc/mit-scheme-dir
160 (string-append doc "/share/doc/" ,name "-" ,version)))
161 (with-directory-excursion "../doc"
162 (for-each (lambda (target)
163 (invoke "make" target))
164 '("install-info-gz" "install-man"
165 "install-html" "install-pdf")))
166 (mkdir-p new-doc/mit-scheme-dir)
168 (string-append old-doc-dir "/" ,name)
169 new-doc/mit-scheme-dir)
170 (delete-file-recursively old-doc-dir)
173 `(;; Autoconf, Automake, and Libtool are necessary for the FFI tests.
174 ("autoconf" ,autoconf)
175 ("automake" ,automake)
177 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
185 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
186 ;; compile from the architecture-specific tarballs, which contain
187 ;; pre-built binaries. It leads to more efficient code than when
188 ;; building the tarball that contains generated C code instead of
192 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
193 version "/mit-scheme-"
194 (match (%current-system)
196 (string-append version "-x86-64"))
198 (string-append version "-i386"))
200 (string-append "c-" version)))
203 (match (%current-system)
206 "03m7cc035w3avs91j2pcz9f15ssgvgp3rm045d1vbydqrkzfyw8k"))
209 "05sjyz90xxfnmi87qv8x0yx0fcallnzl1dciygdafp317pn489is"))
212 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))))))))
214 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
215 ;; Also, the portable C version of MIT/GNU Scheme did not work in time for
216 ;; release in version 10.1.
217 (supported-systems '("x86_64-linux" "i686-linux"))
219 (home-page "https://www.gnu.org/software/mit-scheme/")
220 (synopsis "A Scheme implementation with integrated editor and debugger")
222 "GNU/MIT Scheme is an implementation of the Scheme programming
223 language. It provides an interpreter, a compiler and a debugger. It also
224 features an integrated Emacs-like editor and a large runtime library.")
226 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
228 (define-public bigloo
229 ;; Upstream modifies source tarballs in place, making significant changes
230 ;; long after the initial publication: <https://bugs.gnu.org/33525>.
231 (let ((upstream-version "4.3f"))
237 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
238 upstream-version ".tar.gz"))
241 "09whj8z91qbihk59dw2yb2ccbx9nk1c4l65j62pfs1pz822cpyh9"))
242 ;; Remove bundled libraries.
243 (modules '((guix build utils)))
246 (for-each delete-file-recursively
247 '("gc" "gmp" "libuv"))
249 (build-system gnu-build-system)
251 `(#:test-target "test"
253 (modify-phases %standard-phases
255 (lambda* (#:key inputs outputs #:allow-other-keys)
257 (substitute* "configure"
259 (string-append "shell=" (which "bash") "\n"))
261 (substitute* "autoconf/runtest.in"
263 (substitute* "autoconf/osversion"
264 (("^version.*$") "version=\"\"\n"))
265 (substitute* "comptime/Makefile"
266 (("\\$\\(LDCOMPLIBS\\)")
267 "$(LDCOMPLIBS) $(LDFLAGS)"))
269 ;; The `configure' script doesn't understand options
270 ;; of those of Autoconf.
271 (let ((out (assoc-ref outputs "out")))
272 (invoke "./configure"
273 (string-append "--prefix=" out)
274 ; use system libraries
276 "--customunistring=no"
278 (string-append"--mv=" (which "mv"))
279 (string-append "--rm=" (which "rm"))
281 (string-append "--ldflags=-Wl,-rpath="
282 (assoc-ref outputs "out")
283 "/lib/bigloo/" ,upstream-version)
284 (string-append "--lispdir=" out
285 "/share/emacs/site-lisp")
287 "--sharedcompiler=yes"
288 "--disable-patch"))))
289 (add-after 'install 'install-emacs-modes
290 (lambda* (#:key outputs #:allow-other-keys)
291 (let* ((out (assoc-ref outputs "out"))
292 (dir (string-append out "/share/emacs/site-lisp")))
293 (invoke "make" "-C" "bmacs" "all" "install"
294 (string-append "EMACSBRAND=emacs25")
295 (string-append "EMACSDIR=" dir))))))))
297 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
299 ("libunistring" ,libunistring)
304 ;; Optional APIs for which Bigloo has bindings.
306 ("libphidget" ,libphidget)
309 `(("pkg-config" ,pkg-config)))
311 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
312 (home-page "https://www-sop.inria.fr/indes/fp/Bigloo/")
313 (synopsis "Efficient Scheme compiler")
315 "Bigloo is a Scheme implementation devoted to one goal: enabling Scheme
316 based programming style where C(++) is usually required. Bigloo attempts to
317 make Scheme practical by offering features usually presented by traditional
318 programming languages but not offered by Scheme and functional programming.
319 Bigloo compiles Scheme modules. It delivers small and fast stand alone binary
320 executables. Bigloo enables full connections between Scheme and C programs
321 and between Scheme and Java programs.")
327 (version "3.2.0-pre1")
330 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
334 "0jf418d0s9imv98s6qrpjxr1mdaxr37knh5qyfl5y4a9cc41mlg5"))))
335 (build-system gnu-build-system)
337 `(#:test-target "test"
338 #:make-flags '("BIGLOO=bigloo")
341 (modify-phases %standard-phases
343 (lambda* (#:key inputs outputs #:allow-other-keys)
344 (let ((out (assoc-ref outputs "out")))
345 (substitute* '("tools/Makefile"
346 "test/hopjs/TEST.in")
347 (("/bin/rm") (which "rm")))
348 (invoke "./configure"
349 (string-append "--prefix=" out)
351 (string-append "--blflags="
352 ;; user flags completely override useful
353 ;; default flags, so repeat them here.
354 "-copt \\$(CPICFLAGS) "
355 "-L \\$(BUILDLIBDIR) "
356 "-ldopt -Wl,-rpath," out "/lib"))))))))
357 (inputs `(("avahi" ,avahi)
360 ("libunistring" ,libunistring)
365 (home-page "http://hop.inria.fr/")
366 (synopsis "Multi-tier programming language for the Web 2.0")
368 "HOP is a multi-tier programming language for the Web 2.0 and the
369 so-called diffuse Web. It is designed for programming interactive web
370 applications in many fields such as multimedia (web galleries, music players,
371 ...), ubiquitous and house automation (SmartPhones, personal appliance),
372 mashups, office (web agendas, mail clients, ...), etc.")
375 (define-public scheme48
381 (uri (string-append "http://s48.org/" version
382 "/scheme48-" version ".tgz"))
385 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
386 (patches (search-patches "scheme48-tests.patch"))))
387 (build-system gnu-build-system)
388 (home-page "http://s48.org/")
389 (synopsis "Scheme implementation using a bytecode interpreter")
391 "Scheme 48 is an implementation of Scheme based on a byte-code
392 interpreter and is designed to be used as a testbed for experiments in
393 implementation techniques and as an expository tool.")
395 ;; Most files are BSD-3; see COPYING for the few exceptions.
398 (define-public racket
401 (version "7.9") ; note: remember to also update racket-minimal!
404 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
405 version "/racket-" version "-src.tgz")
407 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
408 version "/racket-" version "-src.tgz")))
411 "0gmp2ahmfd97nn9bwpfx9lznjmjkd042slnrrbdmyh59cqh98y2m"))
412 (patches (search-patches
413 "racket-store-checksum-override.patch"))))
414 (build-system gnu-build-system)
417 (modify-phases %standard-phases
418 (add-before 'configure 'pre-configure-minimal
419 (lambda* (#:key inputs #:allow-other-keys)
420 ;; Patch dynamically loaded libraries with their absolute paths.
421 (let* ((library-path (search-path-as-string->list
422 (getenv "LIBRARY_PATH")))
423 (find-so (lambda (soname)
426 (format #f "~a.so" soname)))))
427 (substitute* "collects/db/private/sqlite3/ffi.rkt"
428 (("ffi-lib sqlite-so")
429 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
430 (substitute* "collects/openssl/libssl.rkt"
431 (("ffi-lib libssl-so")
432 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
433 (substitute* "collects/openssl/libcrypto.rkt"
434 (("ffi-lib libcrypto-so")
435 (format #f "ffi-lib \"~a\"" (find-so "libcrypto")))))
438 (add-before 'pre-configure-minimal 'pre-configure
439 (lambda* (#:key inputs #:allow-other-keys)
440 ;; Patch dynamically loaded libraries with their absolute paths.
441 (let* ((library-path (search-path-as-string->list
442 (getenv "LIBRARY_PATH")))
443 (find-so (lambda (soname)
446 (format #f "~a.so" soname))))
447 (patch-ffi-libs (lambda (file libs)
451 (((format #f "\"~a\"" lib))
452 (format #f "\"~a\"" (find-so lib)))))
454 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
455 (("ffi-lib libgmp-so")
456 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
457 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
458 (("ffi-lib libmpfr-so")
459 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
460 (substitute* "share/pkgs/readline-lib/readline/rktrl.rkt"
461 (("\\(getenv \"PLT_READLINE_LIB\"\\)")
462 (format #f "\"~a\"" (find-so "libedit"))))
464 (lambda (x) (apply patch-ffi-libs x))
465 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
466 ("libfontconfig" "libcairo"))
467 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
468 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
469 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
471 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
472 ("libpango-1.0" "libpangocairo-1.0"))
473 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
475 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
477 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
479 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
481 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
482 ("libgdk-3" "libgtk-3"))
483 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
485 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
486 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
487 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
489 ("share/pkgs/sgl/gl.rkt"
490 ("libGL" "libGLU")))))
492 (add-after 'unpack 'patch-/bin/sh
494 (substitute* "collects/racket/system.rkt"
495 (("/bin/sh") (which "sh")))
497 ;; XXX: how to run them?
501 ;; Hardcode dynamically loaded libraries for better functionality.
502 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
504 ("fontconfig" ,fontconfig)
508 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
509 ("libjpeg" ,libjpeg-turbo)
517 ("unixodbc" ,unixodbc)
518 ("libedit" ,libedit)))
519 (home-page "https://racket-lang.org")
520 (synopsis "Implementation of Scheme and related languages")
522 "Racket is an implementation of the Scheme programming language (R5RS and
523 R6RS) and related languages, such as Typed Racket. It features a compiler and
524 a virtual machine with just-in-time native compilation, as well as a large set
526 ;; https://download.racket-lang.org/license.html
527 (license (list lgpl3+ asl2.0 expat))))
529 (define-public racket-minimal
532 (name "racket-minimal")
533 (version (package-version racket))
536 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
537 version "/racket-minimal-" version "-src.tgz")
539 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
540 version "/racket-minimal-" version "-src.tgz")))
543 "0yc5zkpq1bavj64h67pllw6mfjhmdp65fgdpyqcaan3syy6b5cia"))
544 (patches (search-patches
545 "racket-store-checksum-override.patch"))))
546 (synopsis "Racket without bundled packages such as Dr. Racket")
548 (substitute-keyword-arguments (package-arguments racket)
550 `(modify-phases ,phases
551 ;; Delete fix that applies to files not included in the minimal package.
552 (delete 'pre-configure)))))
558 "Racket is an implementation of the Scheme programming language (R5RS and
559 R6RS) and related languages, such as Typed Racket. It features a compiler and
560 a virtual machine with just-in-time native compilation, as well as a large set
563 In this minimal package, the essential package racket-libs is included, as
564 well as libraries that live in collections. In particular, @command{raco} and
565 the @code{pkg} library are still bundled.")))
567 (define-public gambit-c
575 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
576 (version-major+minor version) "/source/gambit-v"
577 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
580 (base32 "1p6172vhcrlpjgia6hsks1w4fl8rdyjf9xjh14wxfkv7dnx8a5hk"))))
581 (build-system gnu-build-system)
584 ;; According to the ./configure script, this makes the build slower and
585 ;; use >= 1 GB memory, but makes Gambit much faster.
586 '("--enable-single-host")))
587 (home-page "http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page")
588 (synopsis "Efficient Scheme interpreter and compiler")
590 "Gambit consists of two main programs: gsi, the Gambit Scheme
591 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
592 the complete execution and debugging environment. The compiler is the
593 interpreter extended with the capability of generating executable files. The
594 compiler can produce standalone executables or compiled modules which can be
595 loaded at run time. Interpreted code and compiled code can be freely
598 (license (list lgpl2.1+ asl2.0))))
600 (define-public chibi-scheme
602 (name "chibi-scheme")
604 (home-page "https://github.com/ashinn/chibi-scheme")
608 (uri (git-reference (url home-page) (commit version)))
609 (file-name (git-file-name name version))
612 "1lnap41gl9vg82h557f4rlr69jgmd2gh0iqs6cxm77d39kv1scb8"))))
613 (build-system gnu-build-system)
615 `(#:phases (modify-phases %standard-phases
617 (add-before 'build 'set-cc
619 (setenv "CC" "gcc"))))
620 #:make-flags (let ((out (assoc-ref %outputs "out")))
621 (list (string-append "PREFIX=" out)
622 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
623 #:test-target "test"))
624 (synopsis "Small embeddable Scheme implementation")
626 "Chibi-Scheme is a very small library with no external dependencies
627 intended for use as an extension and scripting language in C programs. In
628 addition to support for lightweight VM-based threads, each VM itself runs in
629 an isolated heap allowing multiple VMs to run simultaneously in different OS
634 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
637 (version (string-append "20170703-1." (string-take commit 7)))
641 (url "https://github.com/sarabander/sicp")
645 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
646 (file-name (string-append name "-" version "-checkout"))))
647 (build-system trivial-build-system)
648 (native-inputs `(("gzip" ,gzip)
650 ("texinfo" ,texinfo)))
652 `(#:modules ((guix build utils))
655 (use-modules (guix build utils)
657 (let ((gzip (assoc-ref %build-inputs "gzip"))
658 (source (assoc-ref %build-inputs "source"))
659 (texinfo (assoc-ref %build-inputs "texinfo"))
660 (html-dir (string-append %output "/share/doc/" ,name "/html"))
661 (info-dir (string-append %output "/share/info")))
662 (copy-recursively (string-append source "/html") html-dir)
663 (setenv "PATH" (string-append gzip "/bin"
666 (invoke "makeinfo" "--output"
667 (string-append info-dir "/sicp.info")
668 (string-append source "/sicp-pocket.texi"))
669 (for-each (cut invoke "gzip" "-9n" <>)
670 (find-files info-dir))
672 (home-page "https://sarabander.github.io/sicp")
673 (synopsis "Structure and Interpretation of Computer Programs")
674 (description "Structure and Interpretation of Computer Programs (SICP) is
675 a textbook aiming to teach the principles of computer programming.
677 Using Scheme, a dialect of the Lisp programming language, the book explains
678 core computer science concepts such as abstraction in programming,
679 metalinguistic abstraction, recursion, interpreters, and modular programming.")
680 (license cc-by-sa4.0))))
682 (define-public scheme48-rx
683 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
687 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
692 (url "https://github.com/scheme/rx")
696 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
697 (file-name (string-append name "-" version "-checkout"))))
698 (build-system trivial-build-system)
700 `(#:modules ((guix build utils))
703 (use-modules (guix build utils))
704 (let ((share (string-append %output
706 ,(package-version scheme48)
708 (chdir (assoc-ref %build-inputs "source"))
710 (copy-recursively "." share)
714 ("scheme48" ,scheme48)))
715 (home-page "https://github.com/scheme/rx/")
716 (synopsis "SRE String pattern-matching library for scheme48")
718 "String pattern-matching library for scheme48 based on the SRE
719 regular-expression notation.")
728 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
732 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
733 (build-system gnu-build-system)
735 `(#:tests? #f ; There is no check target.
737 (modify-phases %standard-phases
738 (add-after 'install 'remove-bin-share
739 (lambda* (#:key inputs outputs #:allow-other-keys)
740 (delete-file-recursively
741 (string-append (assoc-ref outputs "out") "/bin"))
744 (lambda* (#:key inputs outputs #:allow-other-keys)
745 (invoke "./configure"
746 (string-append "--prefix="
747 (assoc-ref outputs "out"))))))))
748 (native-inputs `(("unzip" ,unzip)
749 ("texinfo" ,texinfo)))
750 (home-page "https://people.csail.mit.edu/jaffer/SLIB.html")
751 (synopsis "Compatibility and utility library for Scheme")
752 (description "SLIB is a portable Scheme library providing compatibility and
753 utility functions for all standard Scheme implementations.")
754 (license (non-copyleft
755 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
756 "Or see COPYING in the distribution."))))
765 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
769 "1jxxlhmgal26mpcl97kz37djkn97rfy9h5pvw0hah6f3f6w49j97"))))
770 (build-system gnu-build-system)
773 (modify-phases %standard-phases
775 (lambda* (#:key inputs outputs #:allow-other-keys)
776 (invoke "./configure"
777 (string-append "--prefix="
778 (assoc-ref outputs "out")))))
779 (add-before 'build 'pre-build
780 (lambda* (#:key inputs #:allow-other-keys)
781 (substitute* "Makefile"
782 (("ginstall-info") "install-info"))
785 (lambda* (#:key inputs outputs #:allow-other-keys)
786 (setenv "SCHEME_LIBRARY_PATH"
787 (string-append (assoc-ref inputs "slib")
789 (invoke "make" "scmlit" "CC=gcc")
790 (invoke "make" "all")))
791 (add-after 'install 'post-install
792 (lambda* (#:key inputs outputs #:allow-other-keys)
793 (let* ((out (assoc-ref outputs "out"))
794 (req (string-append out "/lib/scm/require.scm")))
796 (format (open req (logior O_WRONLY O_CREAT))
797 "(define (library-vicinity) ~s)\n"
798 (string-append (assoc-ref inputs "slib")
801 ;; We must generate the slibcat file.
802 (invoke (string-append out "/bin/scm")
803 "-br" "new-catalog")))))))
804 (inputs `(("slib" ,slib)))
805 (native-inputs `(("unzip" ,unzip)
806 ("texinfo" ,texinfo)))
807 (home-page "https://people.csail.mit.edu/jaffer/SCM")
808 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
809 (description "GNU SCM is an implementation of Scheme. This
810 implementation includes Hobbit, a Scheme-to-C compiler, which can
811 generate C files whose binaries can be dynamically or statically
812 linked with a SCM executable.")
815 (define-public tinyscheme
821 (uri (string-append "mirror://sourceforge/" name "/" name "/"
822 name "-" version "/" name "-" version ".zip"))
825 "0rik3qnxqd8wjlazx8rw996pfzkjjg60v6hcbpcqzi7rgml8q4n8"))))
826 (build-system gnu-build-system)
831 (modify-phases %standard-phases
833 (lambda* (#:key source #:allow-other-keys)
834 (invoke "unzip" source)
835 (chdir (string-append ,name "-" ,version))
837 (add-after 'unpack 'set-scm-directory
838 ;; Hard-code ‘our’ init.scm instead of looking in the current
839 ;; working directory, so invoking ‘scheme’ just works.
840 (lambda* (#:key outputs #:allow-other-keys)
841 (let* ((out (assoc-ref outputs "out"))
842 (scm (string-append out "/share/" ,name)))
843 (substitute* "scheme.c"
845 (string-append scm "/" all)))
847 (delete 'configure) ; no configure script
849 ;; There's no ‘install’ target. Install files manually.
850 (lambda* (#:key outputs #:allow-other-keys)
851 (let* ((out (assoc-ref outputs "out"))
852 (bin (string-append out "/bin"))
853 (doc (string-append out "/share/doc/"
855 (include (string-append out "/include"))
856 (lib (string-append out "/lib"))
857 (scm (string-append out "/share/" ,name)))
858 (install-file "scheme" bin)
859 (install-file "Manual.txt" doc)
860 (install-file "scheme.h" include)
861 (install-file "libtinyscheme.so" lib)
862 (install-file "init.scm" scm)
864 #:tests? #f)) ; no tests
865 (home-page "http://tinyscheme.sourceforge.net/")
866 (synopsis "Light-weight interpreter for the Scheme programming language")
868 "TinyScheme is a light-weight Scheme interpreter that implements as large a
869 subset of R5RS as was possible without getting very large and complicated.
871 It's meant to be used as an embedded scripting interpreter for other programs.
872 As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
873 extensive toolkits, although it does sport a small (and optional) top-level
876 As an embedded interpreter, it allows multiple interpreter states to coexist in
877 the same program, without any interference between them. Foreign functions in C
878 can be added and values can be defined in the Scheme environment. Being quite a
879 small program, it is easy to comprehend, get to grips with, and use.")
880 (license bsd-3))) ; there are no licence headers
882 (define-public stalin
883 (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be"))
884 ;; FIXME: The Stalin "source" contains C code generated by itself:
885 ;; 'stalin-AMD64.c', etc.
890 ;; Use Pearlmutter's upstream branch with AMD64 patches
891 ;; applied. Saves us from including those 20M! patches
892 ;; in Guix. For more info, see:
893 ;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz>
896 (url "https://github.com/barak/stalin")
898 (file-name (string-append name "-" version "-checkout"))
901 "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn"))
902 (modules '((guix build utils)))
904 ;; remove gc libs from build, we have them as input
906 (delete-file "gc6.8.tar.gz")
907 (delete-file-recursively "benchmarks")
911 ((".*B include/libgc.a") "")
914 (build-system gnu-build-system)
916 `(#:make-flags (list "ARCH_OPTS=-freg-struct-return")
918 (modify-phases %standard-phases
920 (lambda* (#:key outputs #:allow-other-keys)
921 (let* ((out (assoc-ref outputs "out"))
922 (include-out (string-append out "/include")))
924 (for-each (lambda (fname)
925 (install-file fname include-out))
926 (find-files "include"))
927 (substitute* "makefile"
928 (("\\./include") include-out))
929 (substitute* "post-make"
934 (lambda* (#:key outputs #:allow-other-keys)
935 (let ((out (assoc-ref outputs "out")))
936 (install-file "stalin.1"
937 (string-append out "/share/man/man1"))
938 (install-file "stalin"
939 (string-append out "/bin"))
942 `(("libx11" ,libx11)))
945 (supported-systems '("x86_64-linux"))
946 (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf")
947 (synopsis "Brutally efficient Scheme compiler")
949 "Stalin is an aggressively optimizing whole-program compiler
950 for Scheme that does polyvariant interprocedural flow analysis,
951 flow-directed interprocedural escape analysis, flow-directed
952 lightweight CPS conversion, flow-directed lightweight closure
953 conversion, flow-directed interprocedural lifetime analysis, automatic
954 in-lining, unboxing, and flow-directed program-specific and
955 program-point-specific low-level representation selection and code
959 (define-public femtolisp
960 (let ((commit "ec7601076a976f845bc05ad6bd3ed5b8cde58a97")
964 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
968 (url "https://github.com/JeffBezanson/femtolisp")
970 (file-name (string-append name "-" version "-checkout"))
973 "1fcyiqlqn27nd4wxi27km8mhmlzpzzsxzpwsl1bxbmhraq468njw"))))
974 ;; See "utils.h" for supported systems. Upstream bug:
975 ;; https://github.com/JeffBezanson/femtolisp/issues/25
977 (fold delete %supported-systems
978 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
979 (build-system gnu-build-system)
981 `(#:make-flags '("CC=gcc" "release")
984 (modify-phases %standard-phases
986 (delete 'configure) ; No configure script
987 (replace 'install ; Makefile has no 'install phase
988 (lambda* (#:key outputs #:allow-other-keys)
989 (let* ((out (assoc-ref outputs "out"))
990 (bin (string-append out "/bin")))
991 (install-file "flisp" bin)
993 ;; The flisp binary is now available, run bootstrap to
994 ;; generate flisp.boot and afterwards runs make test.
995 (add-after 'install 'bootstrap-gen-and-test
996 (lambda* (#:key outputs #:allow-other-keys)
997 (let* ((out (assoc-ref outputs "out"))
998 (bin (string-append out "/bin")))
999 (invoke "./bootstrap.sh")
1000 (install-file "flisp.boot" bin)
1002 (synopsis "Scheme-like lisp implementation")
1004 "@code{femtolisp} is a scheme-like lisp implementation with a
1005 simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
1006 The core is 12 builtin special forms and 33 builtin functions.")
1007 (home-page "https://github.com/JeffBezanson/femtolisp")
1010 (define-public gauche
1014 (home-page "https://practical-scheme.net/gauche/index.html")
1019 "mirror://sourceforge/gauche/Gauche/Gauche-"
1022 (base32 "1yzpszhw52vkpr65r5d4khf3489mnnvnw58dd2wsvvx7499k5aac"))
1023 (modules '((guix build utils)))
1025 ;; Remove libatomic-ops.
1026 (delete-file-recursively "gc/libatomic_ops")
1028 (build-system gnu-build-system)
1030 `(("libatomic-ops" ,libatomic-ops)
1033 `(("texinfo" ,texinfo)
1034 ("openssl" ,openssl) ; needed for tests
1035 ("pkg-config" ,pkg-config))) ; needed to find external libatomic-ops
1038 (modify-phases %standard-phases
1039 (add-after 'unpack 'patch-/bin/sh
1040 ;; Needed only for tests.
1042 (substitute* '("configure"
1046 "lib/gauche/configure.scm"
1047 "lib/gauche/package/util.scm"
1048 "lib/gauche/process.scm")
1049 (("/bin/sh") (which "sh")))
1051 (add-after 'build 'build-doc
1053 (with-directory-excursion "doc"
1054 (invoke "make" "info"))
1056 (add-before 'check 'patch-normalize-test
1057 ;; Neutralize sys-normalize-pathname test as it relies on
1058 ;; the home directory; (setenv "HOME" xx) isn't enough).
1060 (substitute* "test/system.scm"
1061 (("~/abc") "//abc"))
1063 (add-before 'check 'patch-network-tests
1064 ;; Remove net checks.
1066 (substitute* "ext/Makefile"
1067 (("binary net termios") "binary termios"))
1069 (add-after 'install 'install-docs
1071 (with-directory-excursion "doc"
1072 (invoke "make" "install"))
1074 (synopsis "Scheme scripting engine")
1075 (description "Gauche is a R7RS Scheme scripting engine aiming at being a
1076 handy tool that helps programmers and system administrators to write small to
1077 large scripts quickly. Quick startup, built-in system interface, native
1078 multilingual support are some of the goals. Gauche comes with a package
1079 manager/installer @code{gauche-package} which can download, compile, install
1080 and list gauche extension packages.")
1083 (define-public gerbil
1091 (url "https://github.com/vyzo/gerbil")
1092 (commit (string-append "v" version))))
1093 (file-name (git-file-name name version))
1095 (base32 "0vng0kxpnwsg8jbjdpyn4sdww36jz7zfpfbzayg9sdpz6bjxjy0f"))))
1098 (modify-phases %standard-phases
1100 (add-before 'configure 'chdir
1105 (lambda* (#:key outputs inputs #:allow-other-keys)
1106 (invoke "chmod" "755" "-R" ".")
1107 ;; Otherwise fails when editing an r--r--r-- file.
1108 (invoke "gsi-script" "configure"
1109 "--prefix" (assoc-ref outputs "out")
1110 "--with-gambit" (assoc-ref inputs "gambit-c"))))
1111 (add-before 'patch-generated-file-shebangs 'fix-gxi-shebangs
1113 ;; Some .ss files refer to gxi using /usr/bin/env gxi
1114 ;; and 'patch-generated-file-shebangs can't fix that
1115 ;; because gxi has not been compiled yet.
1116 ;; We know where gxi is going to end up so we
1117 ;; Doctor Who our fix here before the problem
1118 ;; happens towards the end of the build.sh script.
1119 (let ((abs-srcdir (getcwd)))
1123 (("#!/usr/bin/env gxi")
1124 (string-append "#!" abs-srcdir "/../bin/gxi"))))
1127 "./misc/http-perf/build.ss"
1128 "./misc/rpc-perf/build.ss"
1129 "./misc/scripts/docsnarf.ss"
1130 "./misc/scripts/docstub.ss"
1131 "./misc/scripts/docsyms.ss"
1132 "./r7rs-large/build.ss"
1135 "./std/run-tests.ss"
1136 "./std/web/fastcgi-test.ss"
1137 "./std/web/rack-test.ss"
1139 "./tutorial/httpd/build.ss"
1140 "./tutorial/kvstore/build.ss"
1141 "./tutorial/lang/build.ss"
1142 "./tutorial/proxy/build-static.ss"
1143 "./tutorial/proxy/build.ss")))
1148 (#:key inputs #:allow-other-keys)
1149 (setenv "HOME" (getcwd))
1151 ;; The build script needs a tty or it'll crash on an ioctl
1152 ;; trying to find the width of the terminal it's running on.
1153 ;; Calling in script prevents that.
1159 (lambda* (#:key outputs #:allow-other-keys)
1160 (let* ((out (assoc-ref outputs "out"))
1161 (bin (string-append out "/bin"))
1162 (lib (string-append out "/lib")))
1165 (copy-recursively "../bin" bin)
1166 (copy-recursively "../lib" lib)))))))
1168 `(("coreutils" ,coreutils)
1169 ("util-linux" ,util-linux)))
1171 `(("gambit-c" ,gambit-c)
1173 ("openssl" ,openssl)
1174 ("sqlite" ,sqlite)))
1175 (build-system gnu-build-system)
1176 (synopsis "Meta-dialect of Scheme with post-modern features")
1177 (description "Gerbil is an opinionated dialect of Scheme designed for Systems
1178 Programming, with a state of the art macro and module system on top of the Gambit
1179 runtime. The macro system is based on quote-syntax, and provides the full meta-syntactic
1180 tower with a native implementation of syntax-case. It also provides a full-blown module
1181 system, similar to PLT Scheme's (sorry, Racket) modules. The main difference from Racket
1182 is that Gerbil modules are single instantiation, supporting high performance ahead of
1183 time compilation and compiled macros.")
1184 (home-page "https://cons.io")
1185 (license `(,lgpl2.1 ,asl2.0))))