1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2018 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 Nils Gillmann <ng0@n0.is>
9 ;;; Copyright © 2017 John Darrington <jmd@gnu.org>
10 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
11 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages scheme)
29 #:use-module (gnu packages)
30 #:use-module ((guix licenses)
31 #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
32 cc-by-sa4.0 non-copyleft))
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix utils)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system trivial)
39 #:use-module (gnu packages bdw-gc)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages libevent)
42 #:use-module (gnu packages libunistring)
43 #:use-module (gnu packages m4)
44 #:use-module (gnu packages multiprecision)
45 #:use-module (gnu packages ncurses)
46 #:use-module (gnu packages pcre)
47 #:use-module (gnu packages databases)
48 #:use-module (gnu packages emacs)
49 #:use-module (gnu packages ghostscript)
50 #:use-module (gnu packages netpbm)
51 #:use-module (gnu packages texinfo)
52 #:use-module (gnu packages tex)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages avahi)
57 #:use-module (gnu packages libphidget)
58 #:use-module (gnu packages gcc)
59 #:use-module (gnu packages glib)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages libffi)
62 #:use-module (gnu packages fontutils)
63 #:use-module (gnu packages image)
64 #:use-module (gnu packages xorg)
65 #:use-module (gnu packages tls)
66 #:use-module (gnu packages gl)
67 #:use-module (ice-9 match))
69 (define (mit-scheme-source-directory system version)
70 (string-append "mit-scheme-"
71 (if (or (string-prefix? "x86_64" system)
72 (string-prefix? "i686" system))
77 (define-public mit-scheme
81 (source #f) ; see below
82 (outputs '("out" "doc"))
83 (build-system gnu-build-system)
85 `(#:tests? #f ; no "check" target
86 #:modules ((guix build gnu-build-system)
90 (modify-phases %standard-phases
92 (lambda* (#:key inputs #:allow-other-keys)
94 (assoc-ref inputs "source"))
95 (chdir ,(mit-scheme-source-directory (%current-system)
97 ;; Delete these dangling symlinks since they break
100 (append '("src/lib/shim-config.scm")
101 (find-files "src/lib/lib" "\\.so$")
102 (find-files "src/lib" "^liarc-")
103 (find-files "src/compiler" "^make\\.")))
107 (lambda* (#:key system outputs #:allow-other-keys)
108 (let ((out (assoc-ref outputs "out")))
109 (if (or (string-prefix? "x86_64" system)
110 (string-prefix? "i686" system))
111 (invoke "make" "compile-microcode")
112 (invoke "./etc/make-liarc.sh"
113 (string-append "--prefix=" out)))
115 (add-after 'configure 'configure-doc
116 (lambda* (#:key outputs inputs #:allow-other-keys)
117 (with-directory-excursion "../doc"
118 (let* ((out (assoc-ref outputs "out"))
119 (bash (assoc-ref inputs "bash"))
120 (bin/sh (string-append bash "/bin/sh")))
121 (invoke bin/sh "./configure"
122 (string-append "--prefix=" out)
123 (string-append "SHELL=" bin/sh))
124 (substitute* '("Makefile" "make-common")
125 (("/lib/mit-scheme/doc")
126 (string-append "/share/doc/" ,name "-" ,version)))
128 (add-after 'build 'build-doc
130 (with-directory-excursion "../doc"
133 (add-after 'install 'install-doc
134 (lambda* (#:key outputs #:allow-other-keys)
135 (let* ((out (assoc-ref outputs "out"))
136 (doc (assoc-ref outputs "doc"))
137 (old-doc-dir (string-append out "/share/doc"))
138 (new-doc/mit-scheme-dir
139 (string-append doc "/share/doc/" ,name "-" ,version)))
140 (with-directory-excursion "../doc"
141 (for-each (lambda (target)
142 (invoke "make" target))
143 '("install-config" "install-info-gz" "install-man"
144 "install-html" "install-pdf")))
145 (mkdir-p new-doc/mit-scheme-dir)
147 (string-append old-doc-dir "/" ,name "-" ,version)
148 new-doc/mit-scheme-dir)
149 (delete-file-recursively old-doc-dir)
152 `(("texlive" ,texlive)
160 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
161 ;; compile from the architecture-specific tarballs, which contain
162 ;; pre-built binaries. It leads to more efficient code than when
163 ;; building the tarball that contains generated C code instead of
167 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
168 version "/mit-scheme-"
169 (match (%current-system)
171 (string-append version "-x86-64"))
173 (string-append version "-i386"))
175 (string-append "c-" version)))
178 (match (%current-system)
181 "1skzxxhr0iq96bf0j5m7mvf3i4sppfyfa6gpqn34mwgkw1fx8274"))
184 "1fmlpnhf5a75db93phajh4ysbdgrgl72v45lk3kznriprl0a7jc6"))
187 "0w5ib5vsidihb4hb6fma3sp596ykr8izagm57axvgd6lqzwicsjg"))))))))
189 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
190 (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
192 (home-page "https://www.gnu.org/software/mit-scheme/")
193 (synopsis "A Scheme implementation with integrated editor and debugger")
195 "GNU/MIT Scheme is an implementation of the Scheme programming
196 language. It provides an interpreter, a compiler and a debugger. It also
197 features an integrated Emacs-like editor and a large runtime library.")
199 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
201 (define-public bigloo
207 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
211 "1x7xdgsls277zlf6gcaxs2cj62xj6yvb0qxh0ddmxfamvxba0cf4"))
212 ;; Remove bundled libraries.
213 (modules '((guix build utils)))
216 (for-each delete-file-recursively
217 '("gc" "gmp" "libuv"))
219 (build-system gnu-build-system)
221 `(#:test-target "test"
223 (modify-phases %standard-phases
225 (lambda* (#:key inputs outputs #:allow-other-keys)
227 (substitute* "configure"
229 (string-append "shell=" (which "bash") "\n"))
231 (substitute* "autoconf/runtest.in"
233 (substitute* "autoconf/osversion"
234 (("^version.*$") "version=\"\"\n"))
235 (substitute* "comptime/Makefile"
236 (("\\$\\(LDCOMPLIBS\\)")
237 "$(LDCOMPLIBS) $(LDFLAGS)"))
239 ;; The `configure' script doesn't understand options
240 ;; of those of Autoconf.
241 (let ((out (assoc-ref outputs "out")))
242 (invoke "./configure"
243 (string-append "--prefix=" out)
244 ; use system libraries
246 "--customunistring=no"
248 (string-append"--mv=" (which "mv"))
249 (string-append "--rm=" (which "rm"))
251 (string-append "--ldflags=-Wl,-rpath="
252 (assoc-ref outputs "out")
253 "/lib/bigloo/" ,version)
254 (string-append "--lispdir=" out
255 "/share/emacs/site-lisp")
257 "--sharedcompiler=yes"
258 "--disable-patch"))))
259 (add-after 'install 'install-emacs-modes
260 (lambda* (#:key outputs #:allow-other-keys)
261 (let* ((out (assoc-ref outputs "out"))
262 (dir (string-append out "/share/emacs/site-lisp")))
263 (invoke "make" "-C" "bmacs" "all" "install"
264 (string-append "EMACSBRAND=emacs25")
265 (string-append "EMACSDIR=" dir))))))))
267 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
269 ("libunistring" ,libunistring)
274 ;; Optional APIs for which Bigloo has bindings.
276 ("libphidget" ,libphidget)
279 `(("pkg-config" ,pkg-config)))
281 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
282 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
283 (synopsis "Efficient Scheme compiler")
285 "Bigloo is a Scheme implementation devoted to one goal: enabling
286 Scheme based programming style where C(++) is usually
287 required. Bigloo attempts to make Scheme practical by offering
288 features usually presented by traditional programming languages
289 but not offered by Scheme and functional programming. Bigloo
290 compiles Scheme modules. It delivers small and fast stand alone
291 binary executables. Bigloo enables full connections between
292 Scheme and C programs and between Scheme and Java programs.")
298 (version "3.1.0-pre2")
301 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
305 "0bvq79vxcpgwydwi923cxb5w9isx2x8r3d0xndbdhacmmsw1m811"))))
306 (build-system gnu-build-system)
308 `(#:test-target "test"
309 #:make-flags '("BIGLOO=bigloo")
312 (modify-phases %standard-phases
314 (lambda* (#:key inputs outputs #:allow-other-keys)
315 (let ((out (assoc-ref outputs "out")))
317 (system* "./configure"
318 (string-append "--prefix=" out)
319 (string-append "--blflags="
320 ;; user flags completely override useful
321 ;; default flags, so repeat them here.
322 "-copt \\$(CPICFLAGS) "
323 "-L \\$(BUILDLIBDIR) "
324 "-ldopt -Wl,-rpath," out "/lib")))))))))
325 (inputs `(("avahi" ,avahi)
328 ("libunistring" ,libunistring)
333 (home-page "http://hop.inria.fr/")
334 (synopsis "Multi-tier programming language for the Web 2.0")
336 "HOP is a multi-tier programming language for the Web 2.0 and the
337 so-called diffuse Web. It is designed for programming interactive web
338 applications in many fields such as multimedia (web galleries, music players,
339 ...), ubiquitous and house automation (SmartPhones, personal appliance),
340 mashups, office (web agendas, mail clients, ...), etc.")
343 (define-public chicken
349 (uri (string-append "https://code.call-cc.org/releases/"
350 version "/chicken-" version ".tar.gz"))
353 "0hvckhi5gfny3mlva6d7y9pmx7cbwvq0r7mk11k3sdiik9hlkmdd"))))
354 (build-system gnu-build-system)
356 `(#:modules ((guix build gnu-build-system)
360 ;; No `configure' script; run "make check" after "make install" as
361 ;; prescribed by README.
363 (modify-phases %standard-phases
366 (add-after 'install 'check
367 (assoc-ref %standard-phases 'check)))
369 #:make-flags (let ((out (assoc-ref %outputs "out")))
370 (list "PLATFORM=linux"
371 (string-append "PREFIX=" out)
372 (string-append "VARDIR=" out "/var/lib")))
374 ;; Parallel builds are not supported, as noted in README.
375 #:parallel-build? #f))
376 (home-page "http://www.call-cc.org/")
377 (synopsis "R5RS Scheme implementation that compiles native code via C")
379 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
380 produces portable and efficient C, supports almost all of the R5RS Scheme
381 language standard, and includes many enhancements and extensions.")
384 (define-public scheme48
390 (uri (string-append "http://s48.org/" version
391 "/scheme48-" version ".tgz"))
394 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
395 (patches (search-patches "scheme48-tests.patch"))))
396 (build-system gnu-build-system)
397 (home-page "http://s48.org/")
398 (synopsis "Scheme implementation using a bytecode interpreter")
400 "Scheme 48 is an implementation of Scheme based on a byte-code
401 interpreter and is designed to be used as a testbed for experiments in
402 implementation techniques and as an expository tool.")
404 ;; Most files are BSD-3; see COPYING for the few exceptions.
407 (define-public racket
413 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
414 version "/racket-" version "-src.tgz")
416 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
417 version "/racket-" version "-src.tgz")))
420 "0cwcypzjfl9py1s695mhqkiapff7c1w29llsmdj7qgn58wl0apk5"))
421 (patches (search-patches
422 ;; See: https://github.com/racket/racket/issues/1962
423 ;; This can be removed in whatever Racket release comes after 6.12
424 "racket-fix-xform-issue.patch"))))
425 (build-system gnu-build-system)
428 (modify-phases %standard-phases
429 (add-before 'configure 'pre-configure
430 (lambda* (#:key inputs #:allow-other-keys)
431 ;; Patch dynamically loaded libraries with their absolute paths.
432 (let* ((library-path (search-path-as-string->list
433 (getenv "LIBRARY_PATH")))
434 (find-so (lambda (soname)
437 (format #f "~a.so" soname))))
438 (patch-ffi-libs (lambda (file libs)
442 (((format #f "\"~a\"" lib))
443 (format #f "\"~a\"" (find-so lib)))))
445 (substitute* "collects/db/private/sqlite3/ffi.rkt"
446 (("ffi-lib sqlite-so")
447 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
448 (substitute* "collects/openssl/libssl.rkt"
449 (("ffi-lib libssl-so")
450 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
451 (substitute* "collects/openssl/libcrypto.rkt"
452 (("ffi-lib libcrypto-so")
453 (format #f "ffi-lib \"~a\"" (find-so "libcrypto"))))
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"))))
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")))))
490 (add-after 'unpack 'patch-/bin/sh
492 (substitute* "collects/racket/system.rkt"
493 (("/bin/sh") (which "sh")))
495 #:tests? #f ; XXX: how to run them?
499 ;; Hardcode dynamically loaded libraries for better functionality.
500 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
502 ("fontconfig" ,fontconfig)
506 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
515 ("unixodbc" ,unixodbc)))
516 (home-page "http://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
525 (define-public gambit-c
533 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
534 (version-major+minor version) "/source/gambit-v"
535 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
538 (base32 "16sg1s8myzxqpimj5ry6lfza0qfs157zj28bvmxwwgy89jd9m5v7"))))
539 (build-system gnu-build-system)
542 ;; According to the ./configure script, this makes the build slower and
543 ;; use >= 1 GB memory, but makes Gambit much faster.
544 '("--enable-single-host")
546 (modify-phases %standard-phases
547 (add-before 'check 'fix-tests
549 (substitute* '("tests/makefile")
550 ;; '-:' is how run-time options are set. 'tl' sets some terminal
551 ;; option, which makes it fail in our build environment. It
552 ;; recommends using 'd-' as a solution, which sets the REPL
553 ;; interaction channel to stdin/stdout.
554 (("gsi -:tl") "gsi -:d-,tl"))
556 (home-page "http://www.iro.umontreal.ca/~gambit/")
557 (synopsis "Efficient Scheme interpreter and compiler")
559 "Gambit consists of two main programs: gsi, the Gambit Scheme
560 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
561 the complete execution and debugging environment. The compiler is the
562 interpreter extended with the capability of generating executable files. The
563 compiler can produce standalone executables or compiled modules which can be
564 loaded at run time. Interpreted code and compiled code can be freely
567 (license (list lgpl2.1+ asl2.0))))
569 (define-public chibi-scheme
571 (name "chibi-scheme")
576 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
579 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
580 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
581 (build-system gnu-build-system)
583 `(#:phases (modify-phases %standard-phases
585 (add-before 'build 'set-cc
587 (setenv "CC" "gcc"))))
588 #:make-flags (let ((out (assoc-ref %outputs "out")))
589 (list (string-append "PREFIX=" out)
590 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
591 #:test-target "test"))
592 (home-page "https://github.com/ashinn/chibi-scheme")
593 (synopsis "Small embeddable Scheme implementation")
595 "Chibi-Scheme is a very small library with no external dependencies
596 intended for use as an extension and scripting language in C programs. In
597 addition to support for lightweight VM-based threads, each VM itself runs in
598 an isolated heap allowing multiple VMs to run simultaneously in different OS
602 (define-public scmutils
604 (define (system-suffix)
606 ((string-prefix? "x86_64" (or (%current-target-system)
616 (method url-fetch/tarbomb)
617 (modules '((guix build utils)))
619 ;; Remove binary code
620 (delete-file-recursively "scmutils/mit-scheme")
622 (uri (string-append "http://groups.csail.mit.edu/mac/users/gjs/6946"
623 "/scmutils-tarballs/" name "-" version
624 "-x86-64-gnu-linux.tar.gz"))
626 (base32 "00ly5m0s4dy5kxravjaqlpii5zcnr6b9nqm0607lr7xcs52i4j8b"))))
627 (build-system gnu-build-system)
629 `(("mit-scheme" ,mit-scheme)
630 ("emacs" ,emacs-minimal)))
632 `(#:tests? #f ;; no tests-suite
633 #:modules ((guix build gnu-build-system)
635 (guix build emacs-utils))
636 #:imported-modules (,@%gnu-build-system-modules
637 (guix build emacs-utils))
639 (modify-phases %standard-phases
641 ;; No standard build procedure is used. We set the correct
642 ;; runtime path in the custom build system.
643 (lambda* (#:key outputs #:allow-other-keys)
644 (let ((out (assoc-ref outputs "out")))
645 ;; Required to find .bci files at runtime.
646 (with-directory-excursion "scmutils"
647 (rename-file "src" "scmutils"))
648 (substitute* "scmutils/scmutils/load.scm"
649 (("/usr/local/scmutils/")
650 (string-append out "/lib/mit-scheme-"
651 ,(system-suffix) "/")))
654 ;; Compile the code and build a band.
655 (lambda* (#:key outputs #:allow-other-keys)
656 (let* ((out (assoc-ref outputs "out"))
657 (make-img (string-append
658 "echo '(load \"load\") "
659 "(disk-save \"edwin-mechanics.com\")'"
661 (with-directory-excursion "scmutils/scmutils"
662 (and (zero? (system "mit-scheme < compile.scm"))
663 (zero? (system make-img)))))))
664 (add-before 'install 'fix-directory-names
665 ;; Correct directory names in the startup script.
666 (lambda* (#:key inputs outputs #:allow-other-keys)
667 (let* ((out (assoc-ref outputs "out"))
668 (scm-root (assoc-ref inputs "mit-scheme")))
669 (substitute* "bin/mechanics"
670 (("ROOT=\"\\$\\{SCMUTILS_ROOT:-/.*\\}\"")
672 "ROOT=\"${SCMUTILS_ROOT:-" scm-root "}\"\n"
673 "LIB=\"${ROOT}/lib/mit-scheme-"
675 out "/lib/mit-scheme-" ,(system-suffix) "\""))
676 (("EDWIN_INFO_DIRECTORY=.*\n") "")
678 (string-append "SCHEME=\"${ROOT}/bin/scheme "
679 "--library ${LIB}\"\n"))
680 (("export EDWIN_INFO_DIRECTORY") ""))
682 (add-before 'install 'emacs-tags
683 ;; Generate Emacs's tags for easy reference to source
685 (lambda* (#:key inputs outputs #:allow-other-keys)
686 (with-directory-excursion "scmutils/scmutils"
687 (zero? (apply system* "etags"
688 (find-files "." "\\.scm"))))))
690 ;; Copy files to the store.
691 (lambda* (#:key outputs #:allow-other-keys)
692 (define* (copy-files-to-directory files dir
693 #:optional (delete? #f))
694 (for-each (lambda (f)
695 (copy-file f (string-append dir "/" f))
696 (when delete? (delete-file f)))
699 (let* ((out (assoc-ref outputs "out"))
700 (bin (string-append out "/bin"))
701 (doc (string-append out "/share/doc/"
703 (lib (string-append out "/lib/mit-scheme-"
706 (for-each mkdir-p (list lib doc bin))
707 (with-directory-excursion "scmutils/scmutils"
708 (copy-files-to-directory '("COPYING" "LICENSE")
710 (for-each delete-file (find-files "." "\\.bin"))
711 (copy-files-to-directory '("edwin-mechanics.com")
712 (string-append lib "/..") #t)
713 (copy-recursively "." lib))
714 (with-directory-excursion "bin"
715 (copy-files-to-directory (find-files ".") bin))
716 (with-directory-excursion "scmutils/manual"
717 (copy-files-to-directory (find-files ".") doc))
719 (add-after 'install 'emacs-helpers
720 ;; Add convenience Emacs commands to easily load the
721 ;; Scmutils band in an MIT-Scheme buffer inside of Emacs
722 ;; and to easily load code tags.
723 (lambda* (#:key inputs outputs #:allow-other-keys)
724 (let* ((out (assoc-ref outputs "out"))
725 (mit-root (assoc-ref inputs "mit-scheme"))
727 (string-append out "/share/emacs/site-lisp"
728 "/guix.d/" ,name "-" ,version))
729 (el-file (string-append emacs-lisp-dir
732 (string-append "/lib/mit-scheme-"
734 (mkdir-p emacs-lisp-dir)
735 (call-with-output-file el-file
739 (defun scmutils-load ()
742 (let ((mit-root \"~a\")
745 (concat mit-root \"/bin/scheme --library \"
746 mit-root \"~a:\" scmutils \"~a\"
747 \" --band edwin-mechanics.com\"
751 (defun scmutils-load-tags ()
753 (let ((scmutils \"~a\"))
754 (visit-tags-table (concat scmutils \"/TAGS\"))))
759 (string-append out lib-relative-path
761 (emacs-generate-autoloads ,name emacs-lisp-dir)
762 (emacs-byte-compile-directory emacs-lisp-dir)
765 "http://groups.csail.mit.edu/mac/users/gjs/6946/linux-install.htm")
766 (synopsis "Scmutils library for MIT Scheme")
767 (description "The Scmutils system is an integrated library of
768 procedures, embedded in the programming language Scheme, and intended to
769 support teaching and research in mathematical physics and electrical
774 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
777 (version (string-append "20170703-1." (string-take commit 7)))
781 (url "https://github.com/sarabander/sicp")
785 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
786 (file-name (string-append name "-" version "-checkout"))))
787 (build-system trivial-build-system)
788 (native-inputs `(("gzip" ,gzip)
790 ("texinfo" ,texinfo)))
792 `(#:modules ((guix build utils)
797 (use-modules (guix build utils)
800 (let ((gzip (assoc-ref %build-inputs "gzip"))
801 (source (assoc-ref %build-inputs "source"))
802 (texinfo (assoc-ref %build-inputs "texinfo"))
803 (html-dir (string-append %output "/share/doc/" ,name "/html"))
804 (info-dir (string-append %output "/share/info")))
805 (copy-recursively (string-append source "/html") html-dir)
806 (setenv "PATH" (string-append gzip "/bin"
809 (invoke "makeinfo" "--output"
810 (string-append info-dir "/sicp.info")
811 (string-append source "/sicp-pocket.texi"))
812 (for-each (cut invoke "gzip" "-9n" <>)
813 (find-files info-dir))
815 (home-page "https://sarabander.github.io/sicp")
816 (synopsis "Structure and Interpretation of Computer Programs")
817 (description "Structure and Interpretation of Computer Programs (SICP) is
818 a textbook aiming to teach the principles of computer programming.
820 Using Scheme, a dialect of the Lisp programming language, the book explains
821 core computer science concepts such as abstraction in programming,
822 metalinguistic abstraction, recursion, interpreters, and modular programming.")
823 (license cc-by-sa4.0))))
825 (define-public scheme48-rx
826 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
830 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
835 (url "https://github.com/scheme/rx")
839 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
840 (file-name (string-append name "-" version "-checkout"))))
841 (build-system trivial-build-system)
843 `(#:modules ((guix build utils))
846 (use-modules (guix build utils))
847 (let ((share (string-append %output
849 ,(package-version scheme48)
851 (chdir (assoc-ref %build-inputs "source"))
853 (copy-recursively "." share)
857 ("scheme48" ,scheme48)))
858 (home-page "https://github.com/scheme/rx/")
859 (synopsis "SRE String pattern-matching library for scheme48")
861 "String pattern-matching library for scheme48 based on the SRE
862 regular-expression notation.")
871 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
875 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
876 (build-system gnu-build-system)
878 `(#:tests? #f ; There is no check target.
880 (modify-phases %standard-phases
881 (add-after 'install 'remove-bin-share
882 (lambda* (#:key inputs outputs #:allow-other-keys)
883 (delete-file-recursively
884 (string-append (assoc-ref outputs "out") "/bin"))))
886 (lambda* (#:key inputs outputs #:allow-other-keys)
887 (zero? (system* "./configure"
888 (string-append "--prefix="
889 (assoc-ref outputs "out")))))))))
890 (native-inputs `(("unzip" ,unzip)
891 ("texinfo" ,texinfo)))
892 (home-page "http://people.csail.mit.edu/jaffer/SLIB.html")
893 (synopsis "Compatibility and utility library for Scheme")
894 (description "SLIB is a portable Scheme library providing compatibility and
895 utility functions for all standard Scheme implementations.")
896 (license (non-copyleft
897 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
898 "Or see COPYING in the distribution."))))
907 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
911 "050ijb51jm1cij9g3r89zl9rawsrikhbb5y8zb7lspb7bsxq5w99"))))
912 (build-system gnu-build-system)
915 (modify-phases %standard-phases
917 (lambda* (#:key inputs outputs #:allow-other-keys)
918 (zero? (system* "./configure"
919 (string-append "--prefix="
920 (assoc-ref outputs "out"))))))
921 (add-before 'build 'pre-build
922 (lambda* (#:key inputs #:allow-other-keys)
923 (substitute* "Makefile"
924 (("ginstall-info") "install-info"))))
926 (lambda* (#:key inputs outputs #:allow-other-keys)
927 (setenv "SCHEME_LIBRARY_PATH"
928 (string-append (assoc-ref inputs "slib")
931 (zero? (system* "make" "scmlit" "CC=gcc"))
932 (zero? (system* "make" "all")))))
933 (add-after 'install 'post-install
934 (lambda* (#:key inputs outputs #:allow-other-keys)
936 (string-append (assoc-ref outputs "out")
937 "/lib/scm/require.scm")))
940 (format (open req (logior O_WRONLY O_CREAT))
941 "(define (library-vicinity) ~s)\n"
942 (string-append (assoc-ref inputs "slib")
945 ;; We must generate the slibcat file
948 (assoc-ref outputs "out")
950 "-br" "new-catalog")))))))))
951 (inputs `(("slib" ,slib)))
952 (native-inputs `(("unzip" ,unzip)
953 ("texinfo" ,texinfo)))
954 (home-page "http://people.csail.mit.edu/jaffer/SCM")
955 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
956 (description "GNU SCM is an implementation of Scheme. This
957 implementation includes Hobbit, a Scheme-to-C compiler, which can
958 generate C files whose binaries can be dynamically or statically
959 linked with a SCM executable.")
962 (define-public tinyscheme
968 (uri (string-append "mirror://sourceforge/" name "/" name "/"
969 name "-" version "/" name "-" version ".zip"))
972 "0yqma4jrjgj95f3hf30h542x97n8ah234n19yklbqq0phfsa08wf"))))
973 (build-system gnu-build-system)
978 (modify-phases %standard-phases
980 (lambda* (#:key source #:allow-other-keys)
981 (invoke "unzip" source)
982 (chdir (string-append ,name "-" ,version))
984 (add-after 'unpack 'set-scm-directory
985 ;; Hard-code ‘our’ init.scm instead of looking in the current
986 ;; working directory, so invoking ‘scheme’ just works.
987 (lambda* (#:key outputs #:allow-other-keys)
988 (let* ((out (assoc-ref outputs "out"))
989 (scm (string-append out "/share/" ,name)))
990 (substitute* "scheme.c"
992 (string-append scm "/" all)))
994 (delete 'configure) ; no configure script
996 ;; There's no ‘install’ target. Install files manually.
997 (lambda* (#:key outputs #:allow-other-keys)
998 (let* ((out (assoc-ref outputs "out"))
999 (bin (string-append out "/bin"))
1000 (doc (string-append out "/share/doc/"
1001 ,name "-" ,version))
1002 (include (string-append out "/include"))
1003 (lib (string-append out "/lib"))
1004 (scm (string-append out "/share/" ,name)))
1005 (install-file "scheme" bin)
1006 (install-file "Manual.txt" doc)
1007 (install-file "scheme.h" include)
1008 (install-file "libtinyscheme.so" lib)
1009 (install-file "init.scm" scm)
1011 #:tests? #f)) ; no tests
1012 (home-page "http://tinyscheme.sourceforge.net/")
1013 (synopsis "Light-weight interpreter for the Scheme programming language")
1015 "TinyScheme is a light-weight Scheme interpreter that implements as large a
1016 subset of R5RS as was possible without getting very large and complicated.
1018 It's meant to be used as an embedded scripting interpreter for other programs.
1019 As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
1020 extensive toolkits, although it does sport a small (and optional) top-level
1023 As an embedded interpreter, it allows multiple interpreter states to coexist in
1024 the same program, without any interference between them. Foreign functions in C
1025 can be added and values can be defined in the Scheme environment. Being quite a
1026 small program, it is easy to comprehend, get to grips with, and use.")
1027 (license bsd-3))) ; there are no licence headers