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>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages scheme)
32 #:use-module (gnu packages)
33 #:use-module ((guix licenses)
34 #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
35 cc-by-sa4.0 non-copyleft expat))
36 #:use-module (guix packages)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module (guix utils)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system trivial)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages bdw-gc)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages databases)
46 #:use-module (gnu packages libevent)
47 #:use-module (gnu packages libunistring)
48 #:use-module (gnu packages m4)
49 #:use-module (gnu packages multiprecision)
50 #:use-module (gnu packages ncurses)
51 #:use-module (gnu packages pcre)
52 #:use-module (gnu packages emacs)
53 #:use-module (gnu packages ghostscript)
54 #:use-module (gnu packages netpbm)
55 #:use-module (gnu packages texinfo)
56 #:use-module (gnu packages tex)
57 #:use-module (gnu packages base)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages pkg-config)
60 #:use-module (gnu packages avahi)
61 #:use-module (gnu packages libphidget)
62 #:use-module (gnu packages gcc)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages libffi)
66 #:use-module (gnu packages fontutils)
67 #:use-module (gnu packages image)
68 #:use-module (gnu packages xorg)
69 #:use-module (gnu packages sqlite)
70 #:use-module (gnu packages tls)
71 #:use-module (gnu packages gl)
72 #:use-module (gnu packages libedit)
73 #:use-module (srfi srfi-1)
74 #:use-module (ice-9 match))
76 (define (mit-scheme-source-directory system version)
77 (string-append "mit-scheme-"
78 (if (or (string-prefix? "x86_64" system)
79 (string-prefix? "i686" system))
84 (define-public mit-scheme
88 (source #f) ; see below
89 (outputs '("out" "doc"))
90 (build-system gnu-build-system)
92 `(#:modules ((guix build gnu-build-system)
96 (modify-phases %standard-phases
98 (lambda* (#:key inputs #:allow-other-keys)
100 (assoc-ref inputs "source"))
101 (chdir ,(mit-scheme-source-directory (%current-system)
103 ;; Delete these dangling symlinks since they break
105 (for-each delete-file
106 (find-files "src/compiler" "^make\\."))
109 (add-after 'unpack 'patch-/bin/sh
111 (setenv "CONFIG_SHELL" (which "sh"))
112 (substitute* '("../tests/ffi/autogen.sh"
113 "../tests/ffi/autobuild.sh"
114 "../tests/ffi/test-ffi.sh"
115 "../tests/runtime/test-process.scm"
116 "runtime/unxprm.scm")
117 (("/bin/sh") (which "sh"))
118 (("\\./autogen\\.sh")
119 (string-append (which "sh") " autogen.sh"))
121 (string-append (which "sh") " configure")))
123 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
124 ;; them in HOME, so it needs to be writeable.
125 (add-before 'build 'set-HOME
126 (lambda _ (setenv "HOME" "/tmp") #t))
128 (lambda* (#:key system outputs #:allow-other-keys)
129 (let ((out (assoc-ref outputs "out")))
130 (if (or (string-prefix? "x86_64" system)
131 (string-prefix? "i686" system))
132 (invoke "make" "compile-microcode")
133 (invoke "./etc/make-liarc.sh"
134 (string-append "--prefix=" out)))
136 (add-after 'configure 'configure-doc
137 (lambda* (#:key outputs inputs #:allow-other-keys)
138 (with-directory-excursion "../doc"
139 (let* ((out (assoc-ref outputs "out"))
140 (bash (assoc-ref inputs "bash"))
141 (bin/sh (string-append bash "/bin/sh")))
142 (invoke bin/sh "./configure"
143 (string-append "--prefix=" out)
144 (string-append "SHELL=" bin/sh))
146 (add-after 'build 'build-doc
148 (with-directory-excursion "../doc"
151 (add-after 'install 'install-doc
152 (lambda* (#:key outputs #:allow-other-keys)
153 (let* ((out (assoc-ref outputs "out"))
154 (doc (assoc-ref outputs "doc"))
155 (old-doc-dir (string-append out "/share/doc"))
156 (new-doc/mit-scheme-dir
157 (string-append doc "/share/doc/" ,name "-" ,version)))
158 (with-directory-excursion "../doc"
159 (for-each (lambda (target)
160 (invoke "make" target))
161 '("install-info-gz" "install-man"
162 "install-html" "install-pdf")))
163 (mkdir-p new-doc/mit-scheme-dir)
165 (string-append old-doc-dir "/" ,name)
166 new-doc/mit-scheme-dir)
167 (delete-file-recursively old-doc-dir)
170 `(;; Autoconf, Automake, and Libtool are necessary for the FFI tests.
171 ("autoconf" ,autoconf)
172 ("automake" ,automake)
174 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
182 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
183 ;; compile from the architecture-specific tarballs, which contain
184 ;; pre-built binaries. It leads to more efficient code than when
185 ;; building the tarball that contains generated C code instead of
189 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
190 version "/mit-scheme-"
191 (match (%current-system)
193 (string-append version "-x86-64"))
195 (string-append version "-i386"))
197 (string-append "c-" version)))
200 (match (%current-system)
203 "03m7cc035w3avs91j2pcz9f15ssgvgp3rm045d1vbydqrkzfyw8k"))
206 "05sjyz90xxfnmi87qv8x0yx0fcallnzl1dciygdafp317pn489is"))
209 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))))))))
211 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
212 ;; Also, the portable C version of MIT/GNU Scheme did not work in time for
213 ;; release in version 10.1.
214 (supported-systems '("x86_64-linux" "i686-linux"))
216 (home-page "https://www.gnu.org/software/mit-scheme/")
217 (synopsis "A Scheme implementation with integrated editor and debugger")
219 "GNU/MIT Scheme is an implementation of the Scheme programming
220 language. It provides an interpreter, a compiler and a debugger. It also
221 features an integrated Emacs-like editor and a large runtime library.")
223 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
225 (define-public bigloo
226 ;; Upstream modifies source tarballs in place, making significant changes
227 ;; long after the initial publication: <https://bugs.gnu.org/33525>.
228 (let ((upstream-version "4.3f"))
234 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
235 upstream-version ".tar.gz"))
238 "09whj8z91qbihk59dw2yb2ccbx9nk1c4l65j62pfs1pz822cpyh9"))
239 ;; Remove bundled libraries.
240 (modules '((guix build utils)))
243 (for-each delete-file-recursively
244 '("gc" "gmp" "libuv"))
246 (build-system gnu-build-system)
248 `(#:test-target "test"
250 (modify-phases %standard-phases
252 (lambda* (#:key inputs outputs #:allow-other-keys)
254 (substitute* "configure"
256 (string-append "shell=" (which "bash") "\n"))
258 (substitute* "autoconf/runtest.in"
260 (substitute* "autoconf/osversion"
261 (("^version.*$") "version=\"\"\n"))
262 (substitute* "comptime/Makefile"
263 (("\\$\\(LDCOMPLIBS\\)")
264 "$(LDCOMPLIBS) $(LDFLAGS)"))
266 ;; The `configure' script doesn't understand options
267 ;; of those of Autoconf.
268 (let ((out (assoc-ref outputs "out")))
269 (invoke "./configure"
270 (string-append "--prefix=" out)
271 ; use system libraries
273 "--customunistring=no"
275 (string-append"--mv=" (which "mv"))
276 (string-append "--rm=" (which "rm"))
278 (string-append "--ldflags=-Wl,-rpath="
279 (assoc-ref outputs "out")
280 "/lib/bigloo/" ,upstream-version)
281 (string-append "--lispdir=" out
282 "/share/emacs/site-lisp")
284 "--sharedcompiler=yes"
285 "--disable-patch"))))
286 (add-after 'install 'install-emacs-modes
287 (lambda* (#:key outputs #:allow-other-keys)
288 (let* ((out (assoc-ref outputs "out"))
289 (dir (string-append out "/share/emacs/site-lisp")))
290 (invoke "make" "-C" "bmacs" "all" "install"
291 (string-append "EMACSBRAND=emacs25")
292 (string-append "EMACSDIR=" dir))))))))
294 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
296 ("libunistring" ,libunistring)
301 ;; Optional APIs for which Bigloo has bindings.
303 ("libphidget" ,libphidget)
306 `(("pkg-config" ,pkg-config)))
308 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
309 (home-page "https://www-sop.inria.fr/indes/fp/Bigloo/")
310 (synopsis "Efficient Scheme compiler")
312 "Bigloo is a Scheme implementation devoted to one goal: enabling Scheme
313 based programming style where C(++) is usually required. Bigloo attempts to
314 make Scheme practical by offering features usually presented by traditional
315 programming languages but not offered by Scheme and functional programming.
316 Bigloo compiles Scheme modules. It delivers small and fast stand alone binary
317 executables. Bigloo enables full connections between Scheme and C programs
318 and between Scheme and Java programs.")
324 (version "3.2.0-pre1")
327 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
331 "0jf418d0s9imv98s6qrpjxr1mdaxr37knh5qyfl5y4a9cc41mlg5"))))
332 (build-system gnu-build-system)
334 `(#:test-target "test"
335 #:make-flags '("BIGLOO=bigloo")
338 (modify-phases %standard-phases
340 (lambda* (#:key inputs outputs #:allow-other-keys)
341 (let ((out (assoc-ref outputs "out")))
342 (substitute* '("tools/Makefile"
343 "test/hopjs/TEST.in")
344 (("/bin/rm") (which "rm")))
345 (invoke "./configure"
346 (string-append "--prefix=" out)
348 (string-append "--blflags="
349 ;; user flags completely override useful
350 ;; default flags, so repeat them here.
351 "-copt \\$(CPICFLAGS) "
352 "-L \\$(BUILDLIBDIR) "
353 "-ldopt -Wl,-rpath," out "/lib"))))))))
354 (inputs `(("avahi" ,avahi)
357 ("libunistring" ,libunistring)
362 (home-page "http://hop.inria.fr/")
363 (synopsis "Multi-tier programming language for the Web 2.0")
365 "HOP is a multi-tier programming language for the Web 2.0 and the
366 so-called diffuse Web. It is designed for programming interactive web
367 applications in many fields such as multimedia (web galleries, music players,
368 ...), ubiquitous and house automation (SmartPhones, personal appliance),
369 mashups, office (web agendas, mail clients, ...), etc.")
372 (define-public scheme48
378 (uri (string-append "http://s48.org/" version
379 "/scheme48-" version ".tgz"))
382 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
383 (patches (search-patches "scheme48-tests.patch"))))
384 (build-system gnu-build-system)
385 (home-page "http://s48.org/")
386 (synopsis "Scheme implementation using a bytecode interpreter")
388 "Scheme 48 is an implementation of Scheme based on a byte-code
389 interpreter and is designed to be used as a testbed for experiments in
390 implementation techniques and as an expository tool.")
392 ;; Most files are BSD-3; see COPYING for the few exceptions.
395 (define-public racket
401 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
402 version "/racket-" version "-src.tgz")
404 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
405 version "/racket-" version "-src.tgz")))
408 "0cx5h3k0n58cb442qzp3jlc7n1b9dbaxv9blg2rjil2rn119yrb2"))
409 (patches (search-patches
410 "racket-store-checksum-override.patch"))))
411 (build-system gnu-build-system)
414 (modify-phases %standard-phases
415 (add-before 'configure 'pre-configure-minimal
416 (lambda* (#:key inputs #:allow-other-keys)
417 ;; Patch dynamically loaded libraries with their absolute paths.
418 (let* ((library-path (search-path-as-string->list
419 (getenv "LIBRARY_PATH")))
420 (find-so (lambda (soname)
423 (format #f "~a.so" soname)))))
424 (substitute* "collects/db/private/sqlite3/ffi.rkt"
425 (("ffi-lib sqlite-so")
426 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
427 (substitute* "collects/openssl/libssl.rkt"
428 (("ffi-lib libssl-so")
429 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
430 (substitute* "collects/openssl/libcrypto.rkt"
431 (("ffi-lib libcrypto-so")
432 (format #f "ffi-lib \"~a\"" (find-so "libcrypto")))))
435 (add-before 'pre-configure-minimal 'pre-configure
436 (lambda* (#:key inputs #:allow-other-keys)
437 ;; Patch dynamically loaded libraries with their absolute paths.
438 (let* ((library-path (search-path-as-string->list
439 (getenv "LIBRARY_PATH")))
440 (find-so (lambda (soname)
443 (format #f "~a.so" soname))))
444 (patch-ffi-libs (lambda (file libs)
448 (((format #f "\"~a\"" lib))
449 (format #f "\"~a\"" (find-so lib)))))
451 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
452 (("ffi-lib libgmp-so")
453 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
454 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
455 (("ffi-lib libmpfr-so")
456 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
457 (substitute* "share/pkgs/readline-lib/readline/rktrl.rkt"
458 (("\\(getenv \"PLT_READLINE_LIB\"\\)")
459 (format #f "\"~a\"" (find-so "libedit"))))
461 (lambda (x) (apply patch-ffi-libs x))
462 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
463 ("libfontconfig" "libcairo"))
464 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
465 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
466 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
468 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
469 ("libpango-1.0" "libpangocairo-1.0"))
470 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
472 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
474 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
476 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
478 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
479 ("libgdk-3" "libgtk-3"))
480 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
482 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
483 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
484 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
486 ("share/pkgs/sgl/gl.rkt"
487 ("libGL" "libGLU")))))
489 (add-after 'unpack 'patch-/bin/sh
491 (substitute* "collects/racket/system.rkt"
492 (("/bin/sh") (which "sh")))
494 ;; XXX: how to run them?
498 ;; Hardcode dynamically loaded libraries for better functionality.
499 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
501 ("fontconfig" ,fontconfig)
505 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
506 ("libjpeg" ,libjpeg-turbo)
514 ("unixodbc" ,unixodbc)
515 ("libedit" ,libedit)))
516 (home-page "https://racket-lang.org")
517 (synopsis "Implementation of Scheme and related languages")
519 "Racket is an implementation of the Scheme programming language (R5RS and
520 R6RS) and related languages, such as Typed Racket. It features a compiler and
521 a virtual machine with just-in-time native compilation, as well as a large set
523 ;; https://download.racket-lang.org/license.html
524 (license (list lgpl3+ asl2.0 expat))))
526 (define-public racket-minimal
529 (name "racket-minimal")
530 (version (package-version racket))
533 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
534 version "/racket-minimal-" version "-src.tgz")
536 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
537 version "/racket-minimal-" version "-src.tgz")))
540 "0id094q9024hj2n3907l7dblp3iix1v5289xzskmh5c26xfygp9y"))
541 (patches (search-patches
542 "racket-store-checksum-override.patch"))))
543 (synopsis "Racket without bundled packages such as Dr. Racket")
545 (substitute-keyword-arguments (package-arguments racket)
547 `(modify-phases ,phases
548 ;; Delete fix that applies to files not included in the minimal package.
549 (delete 'pre-configure)))))
555 "Racket is an implementation of the Scheme programming language (R5RS and
556 R6RS) and related languages, such as Typed Racket. It features a compiler and
557 a virtual machine with just-in-time native compilation, as well as a large set
560 In this minimal package, the essential package racket-libs is included, as
561 well as libraries that live in collections. In particular, @command{raco} and
562 the @code{pkg} library are still bundled.")))
564 (define-public gambit-c
572 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
573 (version-major+minor version) "/source/gambit-v"
574 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
577 (base32 "1p6172vhcrlpjgia6hsks1w4fl8rdyjf9xjh14wxfkv7dnx8a5hk"))))
578 (build-system gnu-build-system)
581 ;; According to the ./configure script, this makes the build slower and
582 ;; use >= 1 GB memory, but makes Gambit much faster.
583 '("--enable-single-host")))
584 (home-page "http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page")
585 (synopsis "Efficient Scheme interpreter and compiler")
587 "Gambit consists of two main programs: gsi, the Gambit Scheme
588 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
589 the complete execution and debugging environment. The compiler is the
590 interpreter extended with the capability of generating executable files. The
591 compiler can produce standalone executables or compiled modules which can be
592 loaded at run time. Interpreted code and compiled code can be freely
595 (license (list lgpl2.1+ asl2.0))))
597 (define-public chibi-scheme
599 (name "chibi-scheme")
601 (home-page "https://github.com/ashinn/chibi-scheme")
605 (uri (git-reference (url home-page) (commit version)))
606 (file-name (git-file-name name version))
609 "0269d5fhaz7nqjb41vh7yz63mp5s4z08fn4sspwc06z32xksigw9"))))
610 (build-system gnu-build-system)
612 `(#:phases (modify-phases %standard-phases
614 (add-before 'build 'set-cc
616 (setenv "CC" "gcc"))))
617 #:make-flags (let ((out (assoc-ref %outputs "out")))
618 (list (string-append "PREFIX=" out)
619 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
620 #:test-target "test"))
621 (synopsis "Small embeddable Scheme implementation")
623 "Chibi-Scheme is a very small library with no external dependencies
624 intended for use as an extension and scripting language in C programs. In
625 addition to support for lightweight VM-based threads, each VM itself runs in
626 an isolated heap allowing multiple VMs to run simultaneously in different OS
631 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
634 (version (string-append "20170703-1." (string-take commit 7)))
638 (url "https://github.com/sarabander/sicp")
642 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
643 (file-name (string-append name "-" version "-checkout"))))
644 (build-system trivial-build-system)
645 (native-inputs `(("gzip" ,gzip)
647 ("texinfo" ,texinfo)))
649 `(#:modules ((guix build utils))
652 (use-modules (guix build utils)
654 (let ((gzip (assoc-ref %build-inputs "gzip"))
655 (source (assoc-ref %build-inputs "source"))
656 (texinfo (assoc-ref %build-inputs "texinfo"))
657 (html-dir (string-append %output "/share/doc/" ,name "/html"))
658 (info-dir (string-append %output "/share/info")))
659 (copy-recursively (string-append source "/html") html-dir)
660 (setenv "PATH" (string-append gzip "/bin"
663 (invoke "makeinfo" "--output"
664 (string-append info-dir "/sicp.info")
665 (string-append source "/sicp-pocket.texi"))
666 (for-each (cut invoke "gzip" "-9n" <>)
667 (find-files info-dir))
669 (home-page "https://sarabander.github.io/sicp")
670 (synopsis "Structure and Interpretation of Computer Programs")
671 (description "Structure and Interpretation of Computer Programs (SICP) is
672 a textbook aiming to teach the principles of computer programming.
674 Using Scheme, a dialect of the Lisp programming language, the book explains
675 core computer science concepts such as abstraction in programming,
676 metalinguistic abstraction, recursion, interpreters, and modular programming.")
677 (license cc-by-sa4.0))))
679 (define-public scheme48-rx
680 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
684 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
689 (url "https://github.com/scheme/rx")
693 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
694 (file-name (string-append name "-" version "-checkout"))))
695 (build-system trivial-build-system)
697 `(#:modules ((guix build utils))
700 (use-modules (guix build utils))
701 (let ((share (string-append %output
703 ,(package-version scheme48)
705 (chdir (assoc-ref %build-inputs "source"))
707 (copy-recursively "." share)
711 ("scheme48" ,scheme48)))
712 (home-page "https://github.com/scheme/rx/")
713 (synopsis "SRE String pattern-matching library for scheme48")
715 "String pattern-matching library for scheme48 based on the SRE
716 regular-expression notation.")
725 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
729 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
730 (build-system gnu-build-system)
732 `(#:tests? #f ; There is no check target.
734 (modify-phases %standard-phases
735 (add-after 'install 'remove-bin-share
736 (lambda* (#:key inputs outputs #:allow-other-keys)
737 (delete-file-recursively
738 (string-append (assoc-ref outputs "out") "/bin"))
741 (lambda* (#:key inputs outputs #:allow-other-keys)
742 (invoke "./configure"
743 (string-append "--prefix="
744 (assoc-ref outputs "out"))))))))
745 (native-inputs `(("unzip" ,unzip)
746 ("texinfo" ,texinfo)))
747 (home-page "https://people.csail.mit.edu/jaffer/SLIB.html")
748 (synopsis "Compatibility and utility library for Scheme")
749 (description "SLIB is a portable Scheme library providing compatibility and
750 utility functions for all standard Scheme implementations.")
751 (license (non-copyleft
752 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
753 "Or see COPYING in the distribution."))))
762 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
766 "1jxxlhmgal26mpcl97kz37djkn97rfy9h5pvw0hah6f3f6w49j97"))))
767 (build-system gnu-build-system)
770 (modify-phases %standard-phases
772 (lambda* (#:key inputs outputs #:allow-other-keys)
773 (invoke "./configure"
774 (string-append "--prefix="
775 (assoc-ref outputs "out")))))
776 (add-before 'build 'pre-build
777 (lambda* (#:key inputs #:allow-other-keys)
778 (substitute* "Makefile"
779 (("ginstall-info") "install-info"))
782 (lambda* (#:key inputs outputs #:allow-other-keys)
783 (setenv "SCHEME_LIBRARY_PATH"
784 (string-append (assoc-ref inputs "slib")
786 (invoke "make" "scmlit" "CC=gcc")
787 (invoke "make" "all")))
788 (add-after 'install 'post-install
789 (lambda* (#:key inputs outputs #:allow-other-keys)
790 (let* ((out (assoc-ref outputs "out"))
791 (req (string-append out "/lib/scm/require.scm")))
793 (format (open req (logior O_WRONLY O_CREAT))
794 "(define (library-vicinity) ~s)\n"
795 (string-append (assoc-ref inputs "slib")
798 ;; We must generate the slibcat file.
799 (invoke (string-append out "/bin/scm")
800 "-br" "new-catalog")))))))
801 (inputs `(("slib" ,slib)))
802 (native-inputs `(("unzip" ,unzip)
803 ("texinfo" ,texinfo)))
804 (home-page "https://people.csail.mit.edu/jaffer/SCM")
805 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
806 (description "GNU SCM is an implementation of Scheme. This
807 implementation includes Hobbit, a Scheme-to-C compiler, which can
808 generate C files whose binaries can be dynamically or statically
809 linked with a SCM executable.")
812 (define-public tinyscheme
818 (uri (string-append "mirror://sourceforge/" name "/" name "/"
819 name "-" version "/" name "-" version ".zip"))
822 "0yqma4jrjgj95f3hf30h542x97n8ah234n19yklbqq0phfsa08wf"))))
823 (build-system gnu-build-system)
828 (modify-phases %standard-phases
830 (lambda* (#:key source #:allow-other-keys)
831 (invoke "unzip" source)
832 (chdir (string-append ,name "-" ,version))
834 (add-after 'unpack 'set-scm-directory
835 ;; Hard-code ‘our’ init.scm instead of looking in the current
836 ;; working directory, so invoking ‘scheme’ just works.
837 (lambda* (#:key outputs #:allow-other-keys)
838 (let* ((out (assoc-ref outputs "out"))
839 (scm (string-append out "/share/" ,name)))
840 (substitute* "scheme.c"
842 (string-append scm "/" all)))
844 (delete 'configure) ; no configure script
846 ;; There's no ‘install’ target. Install files manually.
847 (lambda* (#:key outputs #:allow-other-keys)
848 (let* ((out (assoc-ref outputs "out"))
849 (bin (string-append out "/bin"))
850 (doc (string-append out "/share/doc/"
852 (include (string-append out "/include"))
853 (lib (string-append out "/lib"))
854 (scm (string-append out "/share/" ,name)))
855 (install-file "scheme" bin)
856 (install-file "Manual.txt" doc)
857 (install-file "scheme.h" include)
858 (install-file "libtinyscheme.so" lib)
859 (install-file "init.scm" scm)
861 #:tests? #f)) ; no tests
862 (home-page "http://tinyscheme.sourceforge.net/")
863 (synopsis "Light-weight interpreter for the Scheme programming language")
865 "TinyScheme is a light-weight Scheme interpreter that implements as large a
866 subset of R5RS as was possible without getting very large and complicated.
868 It's meant to be used as an embedded scripting interpreter for other programs.
869 As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
870 extensive toolkits, although it does sport a small (and optional) top-level
873 As an embedded interpreter, it allows multiple interpreter states to coexist in
874 the same program, without any interference between them. Foreign functions in C
875 can be added and values can be defined in the Scheme environment. Being quite a
876 small program, it is easy to comprehend, get to grips with, and use.")
877 (license bsd-3))) ; there are no licence headers
879 (define-public stalin
880 (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be"))
881 ;; FIXME: The Stalin "source" contains C code generated by itself:
882 ;; 'stalin-AMD64.c', etc.
887 ;; Use Pearlmutter's upstream branch with AMD64 patches
888 ;; applied. Saves us from including those 20M! patches
889 ;; in Guix. For more info, see:
890 ;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz>
893 (url "https://github.com/barak/stalin.git")
895 (file-name (string-append name "-" version "-checkout"))
898 "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn"))
899 (modules '((guix build utils)))
901 ;; remove gc libs from build, we have them as input
903 (delete-file "gc6.8.tar.gz")
904 (delete-file-recursively "benchmarks")
908 ((".*B include/libgc.a") "")
911 (build-system gnu-build-system)
913 `(#:make-flags (list "ARCH_OPTS=-freg-struct-return")
915 (modify-phases %standard-phases
917 (lambda* (#:key outputs #:allow-other-keys)
918 (let* ((out (assoc-ref outputs "out"))
919 (include-out (string-append out "/include")))
921 (for-each (lambda (fname)
922 (install-file fname include-out))
923 (find-files "include"))
924 (substitute* "makefile"
925 (("\\./include") include-out))
926 (substitute* "post-make"
931 (lambda* (#:key outputs #:allow-other-keys)
932 (let ((out (assoc-ref outputs "out")))
933 (install-file "stalin.1"
934 (string-append out "/share/man/man1"))
935 (install-file "stalin"
936 (string-append out "/bin"))
939 `(("libx11" ,libx11)))
942 (supported-systems '("x86_64-linux"))
943 (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf")
944 (synopsis "Brutally efficient Scheme compiler")
946 "Stalin is an aggressively optimizing whole-program compiler
947 for Scheme that does polyvariant interprocedural flow analysis,
948 flow-directed interprocedural escape analysis, flow-directed
949 lightweight CPS conversion, flow-directed lightweight closure
950 conversion, flow-directed interprocedural lifetime analysis, automatic
951 in-lining, unboxing, and flow-directed program-specific and
952 program-point-specific low-level representation selection and code
956 (define-public femtolisp
957 (let ((commit "ec7601076a976f845bc05ad6bd3ed5b8cde58a97")
961 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
965 (url "https://github.com/JeffBezanson/femtolisp.git")
967 (file-name (string-append name "-" version "-checkout"))
970 "1fcyiqlqn27nd4wxi27km8mhmlzpzzsxzpwsl1bxbmhraq468njw"))))
971 ;; See "utils.h" for supported systems. Upstream bug:
972 ;; https://github.com/JeffBezanson/femtolisp/issues/25
974 (fold delete %supported-systems
975 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
976 (build-system gnu-build-system)
978 `(#:make-flags '("CC=gcc" "release")
981 (modify-phases %standard-phases
983 (delete 'configure) ; No configure script
984 (replace 'install ; Makefile has no 'install phase
985 (lambda* (#:key outputs #:allow-other-keys)
986 (let* ((out (assoc-ref outputs "out"))
987 (bin (string-append out "/bin")))
988 (install-file "flisp" bin)
990 ;; The flisp binary is now available, run bootstrap to
991 ;; generate flisp.boot and afterwards runs make test.
992 (add-after 'install 'bootstrap-gen-and-test
993 (lambda* (#:key outputs #:allow-other-keys)
994 (let* ((out (assoc-ref outputs "out"))
995 (bin (string-append out "/bin")))
996 (invoke "./bootstrap.sh")
997 (install-file "flisp.boot" bin)
999 (synopsis "Scheme-like lisp implementation")
1001 "@code{femtolisp} is a scheme-like lisp implementation with a
1002 simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
1003 The core is 12 builtin special forms and 33 builtin functions.")
1004 (home-page "https://github.com/JeffBezanson/femtolisp")
1007 (define-public gauche
1011 (home-page "https://practical-scheme.net/gauche/index.html")
1016 "mirror://sourceforge/gauche/Gauche/Gauche-"
1019 (base32 "1yzpszhw52vkpr65r5d4khf3489mnnvnw58dd2wsvvx7499k5aac"))
1020 (modules '((guix build utils)))
1022 ;; Remove libatomic-ops.
1023 (delete-file-recursively "gc/libatomic_ops")
1025 (build-system gnu-build-system)
1027 `(("libatomic-ops" ,libatomic-ops)
1030 `(("texinfo" ,texinfo)
1031 ("openssl" ,openssl) ; needed for tests
1032 ("pkg-config" ,pkg-config))) ; needed to find external libatomic-ops
1035 (modify-phases %standard-phases
1036 (add-after 'unpack 'patch-/bin/sh
1037 ;; Needed only for tests.
1039 (substitute* '("configure"
1043 "lib/gauche/configure.scm"
1044 "lib/gauche/package/util.scm"
1045 "lib/gauche/process.scm")
1046 (("/bin/sh") (which "sh")))
1048 (add-after 'build 'build-doc
1050 (with-directory-excursion "doc"
1051 (invoke "make" "info"))
1053 (add-before 'check 'patch-normalize-test
1054 ;; Neutralize sys-normalize-pathname test as it relies on
1055 ;; the home directory; (setenv "HOME" xx) isn't enough).
1057 (substitute* "test/system.scm"
1058 (("~/abc") "//abc"))
1060 (add-before 'check 'patch-network-tests
1061 ;; Remove net checks.
1063 (substitute* "ext/Makefile"
1064 (("binary net termios") "binary termios"))
1066 (add-after 'install 'install-docs
1068 (with-directory-excursion "doc"
1069 (invoke "make" "install"))
1071 (synopsis "Scheme scripting engine")
1072 (description "Gauche is a R7RS Scheme scripting engine aiming at being a
1073 handy tool that helps programmers and system administrators to write small to
1074 large scripts quickly. Quick startup, built-in system interface, native
1075 multilingual support are some of the goals. Gauche comes with a package
1076 manager/installer @code{gauche-package} which can download, compile, install
1077 and list gauche extension packages.")