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 ng0 <ng0@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>
15 ;;; This file is part of GNU Guix.
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30 (define-module (gnu packages scheme)
31 #:use-module (gnu packages)
32 #:use-module ((guix licenses)
33 #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
34 cc-by-sa4.0 non-copyleft))
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix utils)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system trivial)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages bdw-gc)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages databases)
45 #:use-module (gnu packages libevent)
46 #:use-module (gnu packages libunistring)
47 #:use-module (gnu packages m4)
48 #:use-module (gnu packages multiprecision)
49 #:use-module (gnu packages ncurses)
50 #:use-module (gnu packages pcre)
51 #:use-module (gnu packages emacs)
52 #:use-module (gnu packages ghostscript)
53 #:use-module (gnu packages netpbm)
54 #:use-module (gnu packages texinfo)
55 #:use-module (gnu packages tex)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages compression)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages avahi)
60 #:use-module (gnu packages libphidget)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages libffi)
65 #:use-module (gnu packages fontutils)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages xorg)
68 #:use-module (gnu packages sqlite)
69 #:use-module (gnu packages tls)
70 #:use-module (gnu packages gl)
71 #:use-module (gnu packages libedit)
72 #:use-module (srfi srfi-1)
73 #:use-module (ice-9 match))
75 (define (mit-scheme-source-directory system version)
76 (string-append "mit-scheme-"
77 (if (or (string-prefix? "x86_64" system)
78 (string-prefix? "i686" system))
83 (define-public mit-scheme
87 (source #f) ; see below
88 (outputs '("out" "doc"))
89 (build-system gnu-build-system)
91 `(#:modules ((guix build gnu-build-system)
95 (modify-phases %standard-phases
97 (lambda* (#:key inputs #:allow-other-keys)
99 (assoc-ref inputs "source"))
100 (chdir ,(mit-scheme-source-directory (%current-system)
102 ;; Delete these dangling symlinks since they break
104 (for-each delete-file
105 (find-files "src/compiler" "^make\\."))
108 (add-after 'unpack 'patch-/bin/sh
110 (setenv "CONFIG_SHELL" (which "sh"))
111 (substitute* '("../tests/ffi/autogen.sh"
112 "../tests/ffi/autobuild.sh"
113 "../tests/ffi/test-ffi.sh"
114 "../tests/runtime/test-process.scm"
115 "runtime/unxprm.scm")
116 (("/bin/sh") (which "sh"))
117 (("\\./autogen\\.sh")
118 (string-append (which "sh") " autogen.sh"))
120 (string-append (which "sh") " configure")))
122 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
123 ;; them in HOME, so it needs to be writeable.
124 (add-before 'build 'set-HOME
125 (lambda _ (setenv "HOME" "/tmp") #t))
127 (lambda* (#:key system outputs #:allow-other-keys)
128 (let ((out (assoc-ref outputs "out")))
129 (if (or (string-prefix? "x86_64" system)
130 (string-prefix? "i686" system))
131 (invoke "make" "compile-microcode")
132 (invoke "./etc/make-liarc.sh"
133 (string-append "--prefix=" out)))
135 (add-after 'configure 'configure-doc
136 (lambda* (#:key outputs inputs #:allow-other-keys)
137 (with-directory-excursion "../doc"
138 (let* ((out (assoc-ref outputs "out"))
139 (bash (assoc-ref inputs "bash"))
140 (bin/sh (string-append bash "/bin/sh")))
141 (invoke bin/sh "./configure"
142 (string-append "--prefix=" out)
143 (string-append "SHELL=" bin/sh))
145 (add-after 'build 'build-doc
147 (with-directory-excursion "../doc"
150 (add-after 'install 'install-doc
151 (lambda* (#:key outputs #:allow-other-keys)
152 (let* ((out (assoc-ref outputs "out"))
153 (doc (assoc-ref outputs "doc"))
154 (old-doc-dir (string-append out "/share/doc"))
155 (new-doc/mit-scheme-dir
156 (string-append doc "/share/doc/" ,name "-" ,version)))
157 (with-directory-excursion "../doc"
158 (for-each (lambda (target)
159 (invoke "make" target))
160 '("install-info-gz" "install-man"
161 "install-html" "install-pdf")))
162 (mkdir-p new-doc/mit-scheme-dir)
164 (string-append old-doc-dir "/" ,name)
165 new-doc/mit-scheme-dir)
166 (delete-file-recursively old-doc-dir)
169 `(;; Autoconf, Automake, and Libtool are necessary for the FFI tests.
170 ("autoconf" ,autoconf)
171 ("automake" ,automake)
173 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
181 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
182 ;; compile from the architecture-specific tarballs, which contain
183 ;; pre-built binaries. It leads to more efficient code than when
184 ;; building the tarball that contains generated C code instead of
188 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
189 version "/mit-scheme-"
190 (match (%current-system)
192 (string-append version "-x86-64"))
194 (string-append version "-i386"))
196 (string-append "c-" version)))
199 (match (%current-system)
202 "03m7cc035w3avs91j2pcz9f15ssgvgp3rm045d1vbydqrkzfyw8k"))
205 "05sjyz90xxfnmi87qv8x0yx0fcallnzl1dciygdafp317pn489is"))
208 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))))))))
210 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
211 ;; Also, the portable C version of MIT/GNU Scheme did not work in time for
212 ;; release in version 10.1.
213 (supported-systems '("x86_64-linux" "i686-linux"))
215 (home-page "https://www.gnu.org/software/mit-scheme/")
216 (synopsis "A Scheme implementation with integrated editor and debugger")
218 "GNU/MIT Scheme is an implementation of the Scheme programming
219 language. It provides an interpreter, a compiler and a debugger. It also
220 features an integrated Emacs-like editor and a large runtime library.")
222 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
224 (define-public bigloo
225 ;; Upstream modifies source tarballs in place, making significant changes
226 ;; long after the initial publication: <https://bugs.gnu.org/33525>.
227 (let ((upstream-version "4.3f"))
233 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
234 upstream-version ".tar.gz"))
237 "09whj8z91qbihk59dw2yb2ccbx9nk1c4l65j62pfs1pz822cpyh9"))
238 ;; Remove bundled libraries.
239 (modules '((guix build utils)))
242 (for-each delete-file-recursively
243 '("gc" "gmp" "libuv"))
245 (build-system gnu-build-system)
247 `(#:test-target "test"
249 (modify-phases %standard-phases
251 (lambda* (#:key inputs outputs #:allow-other-keys)
253 (substitute* "configure"
255 (string-append "shell=" (which "bash") "\n"))
257 (substitute* "autoconf/runtest.in"
259 (substitute* "autoconf/osversion"
260 (("^version.*$") "version=\"\"\n"))
261 (substitute* "comptime/Makefile"
262 (("\\$\\(LDCOMPLIBS\\)")
263 "$(LDCOMPLIBS) $(LDFLAGS)"))
265 ;; The `configure' script doesn't understand options
266 ;; of those of Autoconf.
267 (let ((out (assoc-ref outputs "out")))
268 (invoke "./configure"
269 (string-append "--prefix=" out)
270 ; use system libraries
272 "--customunistring=no"
274 (string-append"--mv=" (which "mv"))
275 (string-append "--rm=" (which "rm"))
277 (string-append "--ldflags=-Wl,-rpath="
278 (assoc-ref outputs "out")
279 "/lib/bigloo/" ,upstream-version)
280 (string-append "--lispdir=" out
281 "/share/emacs/site-lisp")
283 "--sharedcompiler=yes"
284 "--disable-patch"))))
285 (add-after 'install 'install-emacs-modes
286 (lambda* (#:key outputs #:allow-other-keys)
287 (let* ((out (assoc-ref outputs "out"))
288 (dir (string-append out "/share/emacs/site-lisp")))
289 (invoke "make" "-C" "bmacs" "all" "install"
290 (string-append "EMACSBRAND=emacs25")
291 (string-append "EMACSDIR=" dir))))))))
293 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
295 ("libunistring" ,libunistring)
300 ;; Optional APIs for which Bigloo has bindings.
302 ("libphidget" ,libphidget)
305 `(("pkg-config" ,pkg-config)))
307 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
308 (home-page "https://www-sop.inria.fr/indes/fp/Bigloo/")
309 (synopsis "Efficient Scheme compiler")
311 "Bigloo is a Scheme implementation devoted to one goal: enabling Scheme
312 based programming style where C(++) is usually required. Bigloo attempts to
313 make Scheme practical by offering features usually presented by traditional
314 programming languages but not offered by Scheme and functional programming.
315 Bigloo compiles Scheme modules. It delivers small and fast stand alone binary
316 executables. Bigloo enables full connections between Scheme and C programs
317 and between Scheme and Java programs.")
323 (version "3.2.0-pre1")
326 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
330 "0jf418d0s9imv98s6qrpjxr1mdaxr37knh5qyfl5y4a9cc41mlg5"))))
331 (build-system gnu-build-system)
333 `(#:test-target "test"
334 #:make-flags '("BIGLOO=bigloo")
337 (modify-phases %standard-phases
339 (lambda* (#:key inputs outputs #:allow-other-keys)
340 (let ((out (assoc-ref outputs "out")))
341 (substitute* '("tools/Makefile"
342 "test/hopjs/TEST.in")
343 (("/bin/rm") (which "rm")))
344 (invoke "./configure"
345 (string-append "--prefix=" out)
347 (string-append "--blflags="
348 ;; user flags completely override useful
349 ;; default flags, so repeat them here.
350 "-copt \\$(CPICFLAGS) "
351 "-L \\$(BUILDLIBDIR) "
352 "-ldopt -Wl,-rpath," out "/lib"))))))))
353 (inputs `(("avahi" ,avahi)
356 ("libunistring" ,libunistring)
361 (home-page "http://hop.inria.fr/")
362 (synopsis "Multi-tier programming language for the Web 2.0")
364 "HOP is a multi-tier programming language for the Web 2.0 and the
365 so-called diffuse Web. It is designed for programming interactive web
366 applications in many fields such as multimedia (web galleries, music players,
367 ...), ubiquitous and house automation (SmartPhones, personal appliance),
368 mashups, office (web agendas, mail clients, ...), etc.")
371 (define-public scheme48
377 (uri (string-append "http://s48.org/" version
378 "/scheme48-" version ".tgz"))
381 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
382 (patches (search-patches "scheme48-tests.patch"))))
383 (build-system gnu-build-system)
384 (home-page "http://s48.org/")
385 (synopsis "Scheme implementation using a bytecode interpreter")
387 "Scheme 48 is an implementation of Scheme based on a byte-code
388 interpreter and is designed to be used as a testbed for experiments in
389 implementation techniques and as an expository tool.")
391 ;; Most files are BSD-3; see COPYING for the few exceptions.
394 (define-public racket
400 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
401 version "/racket-" version "-src.tgz")
403 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
404 version "/racket-" version "-src.tgz")))
407 "0h6072njhb87rkz4arijvahxgjzn8r14s4wns0ijvxm89bg136yl"))
408 (patches (search-patches
409 "racket-store-checksum-override.patch"))))
410 (build-system gnu-build-system)
413 (modify-phases %standard-phases
414 (add-before 'configure 'pre-configure
415 (lambda* (#:key inputs #:allow-other-keys)
416 ;; Patch dynamically loaded libraries with their absolute paths.
417 (let* ((library-path (search-path-as-string->list
418 (getenv "LIBRARY_PATH")))
419 (find-so (lambda (soname)
422 (format #f "~a.so" soname))))
423 (patch-ffi-libs (lambda (file libs)
427 (((format #f "\"~a\"" lib))
428 (format #f "\"~a\"" (find-so lib)))))
430 (substitute* "collects/db/private/sqlite3/ffi.rkt"
431 (("ffi-lib sqlite-so")
432 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
433 (substitute* "collects/openssl/libssl.rkt"
434 (("ffi-lib libssl-so")
435 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
436 (substitute* "collects/openssl/libcrypto.rkt"
437 (("ffi-lib libcrypto-so")
438 (format #f "ffi-lib \"~a\"" (find-so "libcrypto"))))
439 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
440 (("ffi-lib libgmp-so")
441 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
442 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
443 (("ffi-lib libmpfr-so")
444 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
445 (substitute* "share/pkgs/readline-lib/readline/rktrl.rkt"
446 (("\\(getenv \"PLT_READLINE_LIB\"\\)")
447 (format #f "\"~a\"" (find-so "libedit"))))
449 (lambda (x) (apply patch-ffi-libs x))
450 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
451 ("libfontconfig" "libcairo"))
452 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
453 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
454 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
456 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
457 ("libpango-1.0" "libpangocairo-1.0"))
458 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
460 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
462 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
464 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
466 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
467 ("libgdk-3" "libgtk-3"))
468 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
470 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
471 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
472 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
474 ("share/pkgs/sgl/gl.rkt"
475 ("libGL" "libGLU")))))
478 (add-after 'unpack 'patch-/bin/sh
480 (substitute* "collects/racket/system.rkt"
481 (("/bin/sh") (which "sh")))
483 #:tests? #f ; XXX: how to run them?
487 ;; Hardcode dynamically loaded libraries for better functionality.
488 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
490 ("fontconfig" ,fontconfig)
494 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
503 ("unixodbc" ,unixodbc)
504 ("libedit" ,libedit)))
505 (home-page "http://racket-lang.org")
506 (synopsis "Implementation of Scheme and related languages")
508 "Racket is an implementation of the Scheme programming language (R5RS and
509 R6RS) and related languages, such as Typed Racket. It features a compiler and
510 a virtual machine with just-in-time native compilation, as well as a large set
514 (define-public gambit-c
522 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
523 (version-major+minor version) "/source/gambit-v"
524 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
527 (base32 "1p6172vhcrlpjgia6hsks1w4fl8rdyjf9xjh14wxfkv7dnx8a5hk"))))
528 (build-system gnu-build-system)
531 ;; According to the ./configure script, this makes the build slower and
532 ;; use >= 1 GB memory, but makes Gambit much faster.
533 '("--enable-single-host")))
534 (home-page "http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page")
535 (synopsis "Efficient Scheme interpreter and compiler")
537 "Gambit consists of two main programs: gsi, the Gambit Scheme
538 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
539 the complete execution and debugging environment. The compiler is the
540 interpreter extended with the capability of generating executable files. The
541 compiler can produce standalone executables or compiled modules which can be
542 loaded at run time. Interpreted code and compiled code can be freely
545 (license (list lgpl2.1+ asl2.0))))
547 (define-public chibi-scheme
549 (name "chibi-scheme")
551 (home-page "https://github.com/ashinn/chibi-scheme")
555 (uri (git-reference (url home-page) (commit version)))
556 (file-name (git-file-name name version))
559 "0269d5fhaz7nqjb41vh7yz63mp5s4z08fn4sspwc06z32xksigw9"))))
560 (build-system gnu-build-system)
562 `(#:phases (modify-phases %standard-phases
564 (add-before 'build 'set-cc
566 (setenv "CC" "gcc"))))
567 #:make-flags (let ((out (assoc-ref %outputs "out")))
568 (list (string-append "PREFIX=" out)
569 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
570 #:test-target "test"))
571 (synopsis "Small embeddable Scheme implementation")
573 "Chibi-Scheme is a very small library with no external dependencies
574 intended for use as an extension and scripting language in C programs. In
575 addition to support for lightweight VM-based threads, each VM itself runs in
576 an isolated heap allowing multiple VMs to run simultaneously in different OS
581 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
584 (version (string-append "20170703-1." (string-take commit 7)))
588 (url "https://github.com/sarabander/sicp")
592 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
593 (file-name (string-append name "-" version "-checkout"))))
594 (build-system trivial-build-system)
595 (native-inputs `(("gzip" ,gzip)
597 ("texinfo" ,texinfo)))
599 `(#:modules ((guix build utils))
602 (use-modules (guix build utils)
604 (let ((gzip (assoc-ref %build-inputs "gzip"))
605 (source (assoc-ref %build-inputs "source"))
606 (texinfo (assoc-ref %build-inputs "texinfo"))
607 (html-dir (string-append %output "/share/doc/" ,name "/html"))
608 (info-dir (string-append %output "/share/info")))
609 (copy-recursively (string-append source "/html") html-dir)
610 (setenv "PATH" (string-append gzip "/bin"
613 (invoke "makeinfo" "--output"
614 (string-append info-dir "/sicp.info")
615 (string-append source "/sicp-pocket.texi"))
616 (for-each (cut invoke "gzip" "-9n" <>)
617 (find-files info-dir))
619 (home-page "https://sarabander.github.io/sicp")
620 (synopsis "Structure and Interpretation of Computer Programs")
621 (description "Structure and Interpretation of Computer Programs (SICP) is
622 a textbook aiming to teach the principles of computer programming.
624 Using Scheme, a dialect of the Lisp programming language, the book explains
625 core computer science concepts such as abstraction in programming,
626 metalinguistic abstraction, recursion, interpreters, and modular programming.")
627 (license cc-by-sa4.0))))
629 (define-public scheme48-rx
630 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
634 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
639 (url "https://github.com/scheme/rx")
643 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
644 (file-name (string-append name "-" version "-checkout"))))
645 (build-system trivial-build-system)
647 `(#:modules ((guix build utils))
650 (use-modules (guix build utils))
651 (let ((share (string-append %output
653 ,(package-version scheme48)
655 (chdir (assoc-ref %build-inputs "source"))
657 (copy-recursively "." share)
661 ("scheme48" ,scheme48)))
662 (home-page "https://github.com/scheme/rx/")
663 (synopsis "SRE String pattern-matching library for scheme48")
665 "String pattern-matching library for scheme48 based on the SRE
666 regular-expression notation.")
675 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
679 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
680 (build-system gnu-build-system)
682 `(#:tests? #f ; There is no check target.
684 (modify-phases %standard-phases
685 (add-after 'install 'remove-bin-share
686 (lambda* (#:key inputs outputs #:allow-other-keys)
687 (delete-file-recursively
688 (string-append (assoc-ref outputs "out") "/bin"))
691 (lambda* (#:key inputs outputs #:allow-other-keys)
692 (invoke "./configure"
693 (string-append "--prefix="
694 (assoc-ref outputs "out"))))))))
695 (native-inputs `(("unzip" ,unzip)
696 ("texinfo" ,texinfo)))
697 (home-page "http://people.csail.mit.edu/jaffer/SLIB.html")
698 (synopsis "Compatibility and utility library for Scheme")
699 (description "SLIB is a portable Scheme library providing compatibility and
700 utility functions for all standard Scheme implementations.")
701 (license (non-copyleft
702 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
703 "Or see COPYING in the distribution."))))
712 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
716 "050ijb51jm1cij9g3r89zl9rawsrikhbb5y8zb7lspb7bsxq5w99"))))
717 (build-system gnu-build-system)
720 (modify-phases %standard-phases
722 (lambda* (#:key inputs outputs #:allow-other-keys)
723 (invoke "./configure"
724 (string-append "--prefix="
725 (assoc-ref outputs "out")))))
726 (add-before 'build 'pre-build
727 (lambda* (#:key inputs #:allow-other-keys)
728 (substitute* "Makefile"
729 (("ginstall-info") "install-info"))
732 (lambda* (#:key inputs outputs #:allow-other-keys)
733 (setenv "SCHEME_LIBRARY_PATH"
734 (string-append (assoc-ref inputs "slib")
736 (invoke "make" "scmlit" "CC=gcc")
737 (invoke "make" "all")))
738 (add-after 'install 'post-install
739 (lambda* (#:key inputs outputs #:allow-other-keys)
740 (let* ((out (assoc-ref outputs "out"))
741 (req (string-append out "/lib/scm/require.scm")))
743 (format (open req (logior O_WRONLY O_CREAT))
744 "(define (library-vicinity) ~s)\n"
745 (string-append (assoc-ref inputs "slib")
748 ;; We must generate the slibcat file.
749 (invoke (string-append out "/bin/scm")
750 "-br" "new-catalog")))))))
751 (inputs `(("slib" ,slib)))
752 (native-inputs `(("unzip" ,unzip)
753 ("texinfo" ,texinfo)))
754 (home-page "http://people.csail.mit.edu/jaffer/SCM")
755 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
756 (description "GNU SCM is an implementation of Scheme. This
757 implementation includes Hobbit, a Scheme-to-C compiler, which can
758 generate C files whose binaries can be dynamically or statically
759 linked with a SCM executable.")
762 (define-public tinyscheme
768 (uri (string-append "mirror://sourceforge/" name "/" name "/"
769 name "-" version "/" name "-" version ".zip"))
772 "0yqma4jrjgj95f3hf30h542x97n8ah234n19yklbqq0phfsa08wf"))))
773 (build-system gnu-build-system)
778 (modify-phases %standard-phases
780 (lambda* (#:key source #:allow-other-keys)
781 (invoke "unzip" source)
782 (chdir (string-append ,name "-" ,version))
784 (add-after 'unpack 'set-scm-directory
785 ;; Hard-code ‘our’ init.scm instead of looking in the current
786 ;; working directory, so invoking ‘scheme’ just works.
787 (lambda* (#:key outputs #:allow-other-keys)
788 (let* ((out (assoc-ref outputs "out"))
789 (scm (string-append out "/share/" ,name)))
790 (substitute* "scheme.c"
792 (string-append scm "/" all)))
794 (delete 'configure) ; no configure script
796 ;; There's no ‘install’ target. Install files manually.
797 (lambda* (#:key outputs #:allow-other-keys)
798 (let* ((out (assoc-ref outputs "out"))
799 (bin (string-append out "/bin"))
800 (doc (string-append out "/share/doc/"
802 (include (string-append out "/include"))
803 (lib (string-append out "/lib"))
804 (scm (string-append out "/share/" ,name)))
805 (install-file "scheme" bin)
806 (install-file "Manual.txt" doc)
807 (install-file "scheme.h" include)
808 (install-file "libtinyscheme.so" lib)
809 (install-file "init.scm" scm)
811 #:tests? #f)) ; no tests
812 (home-page "http://tinyscheme.sourceforge.net/")
813 (synopsis "Light-weight interpreter for the Scheme programming language")
815 "TinyScheme is a light-weight Scheme interpreter that implements as large a
816 subset of R5RS as was possible without getting very large and complicated.
818 It's meant to be used as an embedded scripting interpreter for other programs.
819 As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
820 extensive toolkits, although it does sport a small (and optional) top-level
823 As an embedded interpreter, it allows multiple interpreter states to coexist in
824 the same program, without any interference between them. Foreign functions in C
825 can be added and values can be defined in the Scheme environment. Being quite a
826 small program, it is easy to comprehend, get to grips with, and use.")
827 (license bsd-3))) ; there are no licence headers
829 (define-public stalin
830 (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be"))
831 ;; FIXME: The Stalin "source" contains C code generated by itself:
832 ;; 'stalin-AMD64.c', etc.
837 ;; Use Pearlmutter's upstream branch with AMD64 patches
838 ;; applied. Saves us from including those 20M! patches
839 ;; in Guix. For more info, see:
840 ;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz>
843 (url "https://github.com/barak/stalin.git")
845 (file-name (string-append name "-" version "-checkout"))
848 "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn"))
849 (modules '((guix build utils)))
851 ;; remove gc libs from build, we have them as input
853 (delete-file "gc6.8.tar.gz")
854 (delete-file-recursively "benchmarks")
858 ((".*B include/libgc.a") "")
861 (build-system gnu-build-system)
863 `(#:make-flags (list "ARCH_OPTS=-freg-struct-return")
865 (modify-phases %standard-phases
867 (lambda* (#:key outputs #:allow-other-keys)
868 (let* ((out (assoc-ref outputs "out"))
869 (include-out (string-append out "/include")))
871 (for-each (lambda (fname)
872 (install-file fname include-out))
873 (find-files "include"))
874 (substitute* "makefile"
875 (("\\./include") include-out))
876 (substitute* "post-make"
881 (lambda* (#:key outputs #:allow-other-keys)
882 (let ((out (assoc-ref outputs "out")))
883 (install-file "stalin.1"
884 (string-append out "/share/man/man1"))
885 (install-file "stalin"
886 (string-append out "/bin"))
889 `(("libx11" ,libx11)))
892 (supported-systems '("x86_64-linux"))
893 (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf")
894 (synopsis "Brutally efficient Scheme compiler")
896 "Stalin is an aggressively optimizing whole-program compiler
897 for Scheme that does polyvariant interprocedural flow analysis,
898 flow-directed interprocedural escape analysis, flow-directed
899 lightweight CPS conversion, flow-directed lightweight closure
900 conversion, flow-directed interprocedural lifetime analysis, automatic
901 in-lining, unboxing, and flow-directed program-specific and
902 program-point-specific low-level representation selection and code
906 (define-public femtolisp
907 (let ((commit "ec7601076a976f845bc05ad6bd3ed5b8cde58a97")
911 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
915 (url "https://github.com/JeffBezanson/femtolisp.git")
917 (file-name (string-append name "-" version "-checkout"))
920 "1fcyiqlqn27nd4wxi27km8mhmlzpzzsxzpwsl1bxbmhraq468njw"))))
921 ;; See "utils.h" for supported systems. Upstream bug:
922 ;; https://github.com/JeffBezanson/femtolisp/issues/25
924 (fold delete %supported-systems
925 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
926 (build-system gnu-build-system)
928 `(#:make-flags '("CC=gcc" "release")
931 (modify-phases %standard-phases
933 (delete 'configure) ; No configure script
934 (replace 'install ; Makefile has no 'install phase
935 (lambda* (#:key outputs #:allow-other-keys)
936 (let* ((out (assoc-ref outputs "out"))
937 (bin (string-append out "/bin")))
938 (install-file "flisp" bin)
940 ;; The flisp binary is now available, run bootstrap to
941 ;; generate flisp.boot and afterwards runs make test.
942 (add-after 'install 'bootstrap-gen-and-test
943 (lambda* (#:key outputs #:allow-other-keys)
944 (let* ((out (assoc-ref outputs "out"))
945 (bin (string-append out "/bin")))
946 (invoke "./bootstrap.sh")
947 (install-file "flisp.boot" bin)
949 (synopsis "Scheme-like lisp implementation")
951 "@code{femtolisp} is a scheme-like lisp implementation with a
952 simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
953 The core is 12 builtin special forms and 33 builtin functions.")
954 (home-page "https://github.com/JeffBezanson/femtolisp")
957 (define-public gauche
961 (home-page "http://practical-scheme.net/gauche/index.html")
966 "mirror://sourceforge/gauche/Gauche/Gauche-"
969 (base32 "1yzpszhw52vkpr65r5d4khf3489mnnvnw58dd2wsvvx7499k5aac"))
970 (modules '((guix build utils)))
972 ;; Remove libatomic-ops.
973 (delete-file-recursively "gc/libatomic_ops")
975 (build-system gnu-build-system)
977 `(("libatomic-ops" ,libatomic-ops)
980 `(("texinfo" ,texinfo)
981 ("openssl" ,openssl) ; needed for tests
982 ("pkg-config" ,pkg-config))) ; needed to find external libatomic-ops
985 (modify-phases %standard-phases
986 (add-after 'unpack 'patch-/bin/sh
987 ;; Needed only for tests.
989 (substitute* '("configure"
993 "lib/gauche/configure.scm"
994 "lib/gauche/package/util.scm"
995 "lib/gauche/process.scm")
996 (("/bin/sh") (which "sh")))
998 (add-after 'build 'build-doc
1000 (with-directory-excursion "doc"
1001 (invoke "make" "info"))
1003 (add-before 'check 'patch-normalize-test
1004 ;; Neutralize sys-normalize-pathname test as it relies on
1005 ;; the home directory; (setenv "HOME" xx) isn't enough).
1007 (substitute* "test/system.scm"
1008 (("~/abc") "//abc"))
1010 (add-before 'check 'patch-network-tests
1011 ;; Remove net checks.
1013 (substitute* "ext/Makefile"
1014 (("binary net termios") "binary termios"))
1016 (add-after 'install 'install-docs
1018 (with-directory-excursion "doc"
1019 (invoke "make" "install"))
1021 (synopsis "Scheme scripting engine")
1022 (description "Gauche is a R7RS Scheme scripting engine aiming at being a
1023 handy tool that helps programmers and system administrators to write small to
1024 large scripts quickly. Quick startup, built-in system interface, native
1025 multilingual support are some of the goals. Gauche comes with a package
1026 manager/installer @code{gauche-package} which can download, compile, install
1027 and list gauche extension packages.")