1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 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 <contact.ng0@cryptolab.net>
9 ;;; Copyright © 2017 John Darrington <jmd@gnu.org>
10 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
11 ;;; Copyright © 2017 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)
93 (and (zero? (system* "tar" "xzvf"
94 (assoc-ref inputs "source")))
95 (chdir ,(mit-scheme-source-directory (%current-system)
98 ;; Delete these dangling symlinks since they break
100 (for-each delete-file
101 (append '("src/lib/shim-config.scm")
102 (find-files "src/lib/lib" "\\.so$")
103 (find-files "src/lib" "^liarc-")
104 (find-files "src/compiler" "^make\\.")))
108 (lambda* (#:key system outputs #:allow-other-keys)
109 (let ((out (assoc-ref outputs "out")))
110 (if (or (string-prefix? "x86_64" system)
111 (string-prefix? "i686" system))
112 (zero? (system* "make" "compile-microcode"))
113 (zero? (system* "./etc/make-liarc.sh"
114 (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 (system* 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"
131 (zero? (system* "make")))))
132 (add-after 'install 'install-doc
133 (lambda* (#:key outputs #:allow-other-keys)
134 (let* ((out (assoc-ref outputs "out"))
135 (doc (assoc-ref outputs "doc"))
136 (old-doc-dir (string-append out "/share/doc"))
137 (new-doc/mit-scheme-dir
138 (string-append doc "/share/doc/" ,name "-" ,version)))
139 (with-directory-excursion "../doc"
140 (for-each (lambda (target)
141 (system* "make" target))
142 '("install-config" "install-info-gz" "install-man"
143 "install-html" "install-pdf")))
144 (mkdir-p new-doc/mit-scheme-dir)
146 (string-append old-doc-dir "/" ,name "-" ,version)
147 new-doc/mit-scheme-dir)
148 (delete-file-recursively old-doc-dir)
151 `(("texlive" ,texlive)
159 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
160 ;; compile from the architecture-specific tarballs, which contain
161 ;; pre-built binaries. It leads to more efficient code than when
162 ;; building the tarball that contains generated C code instead of
166 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
167 version "/mit-scheme-"
168 (match (%current-system)
170 (string-append version "-x86-64"))
172 (string-append version "-i386"))
174 (string-append "c-" version)))
177 (match (%current-system)
180 "1skzxxhr0iq96bf0j5m7mvf3i4sppfyfa6gpqn34mwgkw1fx8274"))
183 "1fmlpnhf5a75db93phajh4ysbdgrgl72v45lk3kznriprl0a7jc6"))
186 "0w5ib5vsidihb4hb6fma3sp596ykr8izagm57axvgd6lqzwicsjg"))))))))
188 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
189 (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
191 (home-page "https://www.gnu.org/software/mit-scheme/")
192 (synopsis "A Scheme implementation with integrated editor and debugger")
194 "GNU/MIT Scheme is an implementation of the Scheme programming
195 language. It provides an interpreter, a compiler and a debugger. It also
196 features an integrated Emacs-like editor and a large runtime library.")
198 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
200 (define-public bigloo
206 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
210 "03rcqs6kvy2j5lqk4fidqay5qfyp474qqspbh6wk4qdbds6w599w"))
211 ;; Remove bundled libraries.
212 (modules '((guix build utils)))
214 '(for-each delete-file-recursively
215 '("gc" "gmp" "libuv")))))
216 (build-system gnu-build-system)
218 `(#:test-target "test"
220 (modify-phases %standard-phases
222 (lambda* (#:key inputs outputs #:allow-other-keys)
224 (substitute* "configure"
226 (string-append "shell=" (which "bash") "\n"))
228 (substitute* "autoconf/runtest.in"
230 (substitute* "autoconf/osversion"
231 (("^version.*$") "version=\"\"\n"))
233 ;; The `configure' script doesn't understand options
234 ;; of those of Autoconf.
235 (let ((out (assoc-ref outputs "out")))
237 (system* "./configure"
238 (string-append "--prefix=" out)
239 ; use system libraries
241 "--customunistring=no"
243 (string-append"--mv=" (which "mv"))
244 (string-append "--rm=" (which "rm"))
246 (string-append "--ldflags=-Wl,-rpath="
247 (assoc-ref outputs "out")
248 "/lib/bigloo/" ,version)
249 (string-append "--lispdir=" out
250 "/share/emacs/site-lisp")
252 "--sharedcompiler=yes")))))
253 (add-after 'install 'install-emacs-modes
254 (lambda* (#:key outputs #:allow-other-keys)
255 (let* ((out (assoc-ref outputs "out"))
256 (dir (string-append out "/share/emacs/site-lisp")))
257 (zero? (system* "make" "-C" "bmacs" "all" "install"
258 (string-append "EMACSBRAND=emacs25")
259 (string-append "EMACSDIR=" dir)))))))))
261 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
263 ("libunistring" ,libunistring)
268 ;; Optional APIs for which Bigloo has bindings.
270 ("libphidget" ,libphidget)
273 `(("pkg-config" ,pkg-config)))
275 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
276 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
277 (synopsis "Efficient Scheme compiler")
279 "Bigloo is a Scheme implementation devoted to one goal: enabling
280 Scheme based programming style where C(++) is usually
281 required. Bigloo attempts to make Scheme practical by offering
282 features usually presented by traditional programming languages
283 but not offered by Scheme and functional programming. Bigloo
284 compiles Scheme modules. It delivers small and fast stand alone
285 binary executables. Bigloo enables full connections between
286 Scheme and C programs and between Scheme and Java programs.")
292 (version "3.1.0-pre2")
295 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
299 "09m7pahjsp7wxzd20cdph9j3mgf2nq5dyckcjljcd40m25v85kks"))))
300 (build-system gnu-build-system)
302 `(#:test-target "test"
303 #:make-flags '("BIGLOO=bigloo")
306 (modify-phases %standard-phases
308 (lambda* (#:key inputs outputs #:allow-other-keys)
309 (let ((out (assoc-ref outputs "out")))
311 (system* "./configure"
312 (string-append "--prefix=" out)
313 (string-append "--blflags="
314 ;; user flags completely override useful
315 ;; default flags, so repeat them here.
316 "-copt \\$(CPICFLAGS) "
317 "-L \\$(BUILDLIBDIR) "
318 "-ldopt -Wl,-rpath," out "/lib")))))))))
319 (inputs `(("avahi" ,avahi)
322 ("libunistring" ,libunistring)
327 (home-page "http://hop.inria.fr/")
328 (synopsis "Multi-tier programming language for the Web 2.0")
330 "HOP is a multi-tier programming language for the Web 2.0 and the
331 so-called diffuse Web. It is designed for programming interactive web
332 applications in many fields such as multimedia (web galleries, music players,
333 ...), ubiquitous and house automation (SmartPhones, personal appliance),
334 mashups, office (web agendas, mail clients, ...), etc.")
337 (define-public chicken
343 (uri (string-append "https://code.call-cc.org/releases/"
344 version "/chicken-" version ".tar.gz"))
347 "0hvckhi5gfny3mlva6d7y9pmx7cbwvq0r7mk11k3sdiik9hlkmdd"))))
348 (build-system gnu-build-system)
350 `(#:modules ((guix build gnu-build-system)
354 ;; No `configure' script; run "make check" after "make install" as
355 ;; prescribed by README.
357 (modify-phases %standard-phases
360 (add-after 'install 'check
361 (assoc-ref %standard-phases 'check)))
363 #:make-flags (let ((out (assoc-ref %outputs "out")))
364 (list "PLATFORM=linux"
365 (string-append "PREFIX=" out)
366 (string-append "VARDIR=" out "/var/lib")))
368 ;; Parallel builds are not supported, as noted in README.
369 #:parallel-build? #f))
370 (home-page "http://www.call-cc.org/")
371 (synopsis "R5RS Scheme implementation that compiles native code via C")
373 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
374 produces portable and efficient C, supports almost all of the R5RS Scheme
375 language standard, and includes many enhancements and extensions.")
378 (define-public scheme48
384 (uri (string-append "http://s48.org/" version
385 "/scheme48-" version ".tgz"))
388 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
389 (patches (search-patches "scheme48-tests.patch"))))
390 (build-system gnu-build-system)
391 (home-page "http://s48.org/")
392 (synopsis "Scheme implementation using a bytecode interpreter")
394 "Scheme 48 is an implementation of Scheme based on a byte-code
395 interpreter and is designed to be used as a testbed for experiments in
396 implementation techniques and as an expository tool.")
398 ;; Most files are BSD-3; see COPYING for the few exceptions.
401 (define-public racket
407 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
408 version "/racket-" version "-src.tgz")
410 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
411 version "/racket-" version "-src.tgz")))
414 "1nk7705x24jjlbqqhj8yvbgqkfscxx3m81bry1g56kjxysjmf3sw"))))
415 (build-system gnu-build-system)
418 (modify-phases %standard-phases
419 (add-before 'configure 'pre-configure
420 (lambda* (#:key inputs #:allow-other-keys)
421 ;; Patch dynamically loaded libraries with their absolute paths.
422 (let* ((library-path (search-path-as-string->list
423 (getenv "LIBRARY_PATH")))
424 (find-so (lambda (soname)
427 (format #f "~a.so" soname))))
428 (patch-ffi-libs (lambda (file libs)
432 (((format #f "\"~a\"" lib))
433 (format #f "\"~a\"" (find-so lib)))))
435 (substitute* "collects/db/private/sqlite3/ffi.rkt"
436 (("ffi-lib sqlite-so")
437 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
438 (substitute* "collects/openssl/libssl.rkt"
439 (("ffi-lib libssl-so")
440 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
441 (substitute* "collects/openssl/libcrypto.rkt"
442 (("ffi-lib libcrypto-so")
443 (format #f "ffi-lib \"~a\"" (find-so "libcrypto"))))
444 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
445 (("ffi-lib libgmp-so")
446 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
447 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
448 (("ffi-lib libmpfr-so")
449 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
451 (lambda (x) (apply patch-ffi-libs x))
452 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
453 ("libfontconfig" "libcairo"))
454 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
455 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
456 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
458 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
459 ("libpango-1.0" "libpangocairo-1.0"))
460 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
462 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
464 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
466 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
468 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
469 ("libgdk-3" "libgtk-3"))
470 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
472 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
473 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
474 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
476 ("share/pkgs/sgl/gl.rkt"
477 ("libGL" "libGLU")))))
480 (add-after 'unpack 'patch-/bin/sh
482 (substitute* "collects/racket/system.rkt"
483 (("/bin/sh") (which "sh")))
485 #:tests? #f ; XXX: how to run them?
489 ;; Hardcode dynamically loaded libraries for better functionality.
490 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
492 ("fontconfig" ,fontconfig)
496 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
505 ("unixodbc" ,unixodbc)))
506 (home-page "http://racket-lang.org")
507 (synopsis "Implementation of Scheme and related languages")
509 "Racket is an implementation of the Scheme programming language (R5RS and
510 R6RS) and related languages, such as Typed Racket. It features a compiler and
511 a virtual machine with just-in-time native compilation, as well as a large set
515 (define-public gambit-c
523 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
524 (version-major+minor version) "/source/gambit-v"
525 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
528 (base32 "1plw1id94mpg2c4y6q9z39ndcz1hbxfnp3i08szsg6794rasmgkk"))))
529 (build-system gnu-build-system)
532 ;; According to the ./configure script, this makes the build slower and
533 ;; use >= 1 GB memory, but makes Gambit much faster.
534 '("--enable-single-host")
536 (modify-phases %standard-phases
537 (add-before 'check 'fix-tests
539 (substitute* '("tests/makefile")
540 ;; '-:' is how run-time options are set. 'tl' sets some terminal
541 ;; option, which makes it fail in our build environment. It
542 ;; recommends using 'd-' as a solution, which sets the REPL
543 ;; interaction channel to stdin/stdout.
544 (("gsi -:tl") "gsi -:d-,tl"))
546 (home-page "http://www.iro.umontreal.ca/~gambit/")
547 (synopsis "Efficient Scheme interpreter and compiler")
549 "Gambit consists of two main programs: gsi, the Gambit Scheme
550 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
551 the complete execution and debugging environment. The compiler is the
552 interpreter extended with the capability of generating executable files. The
553 compiler can produce standalone executables or compiled modules which can be
554 loaded at run time. Interpreted code and compiled code can be freely
557 (license (list lgpl2.1+ asl2.0))))
559 (define-public chibi-scheme
561 (name "chibi-scheme")
566 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
569 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
570 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
571 (build-system gnu-build-system)
573 `(#:phases (modify-phases %standard-phases
575 (add-before 'build 'set-cc
577 (setenv "CC" "gcc"))))
578 #:make-flags (let ((out (assoc-ref %outputs "out")))
579 (list (string-append "PREFIX=" out)
580 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
581 #:test-target "test"))
582 (home-page "https://github.com/ashinn/chibi-scheme")
583 (synopsis "Small embeddable Scheme implementation")
585 "Chibi-Scheme is a very small library with no external dependencies
586 intended for use as an extension and scripting language in C programs. In
587 addition to support for lightweight VM-based threads, each VM itself runs in
588 an isolated heap allowing multiple VMs to run simultaneously in different OS
592 (define-public scmutils
594 (define (system-suffix)
596 ((string-prefix? "x86_64" (or (%current-target-system)
606 (method url-fetch/tarbomb)
607 (modules '((guix build utils)))
609 ;; Remove binary code
610 '(delete-file-recursively "scmutils/mit-scheme"))
611 (uri (string-append "http://groups.csail.mit.edu/mac/users/gjs/6946"
612 "/scmutils-tarballs/" name "-" version
613 "-x86-64-gnu-linux.tar.gz"))
615 (base32 "00ly5m0s4dy5kxravjaqlpii5zcnr6b9nqm0607lr7xcs52i4j8b"))))
616 (build-system gnu-build-system)
618 `(("mit-scheme" ,mit-scheme)
619 ("emacs" ,emacs-minimal)))
621 `(#:tests? #f ;; no tests-suite
622 #:modules ((guix build gnu-build-system)
624 (guix build emacs-utils))
625 #:imported-modules (,@%gnu-build-system-modules
626 (guix build emacs-utils))
628 (modify-phases %standard-phases
630 ;; No standard build procedure is used. We set the correct
631 ;; runtime path in the custom build system.
632 (lambda* (#:key outputs #:allow-other-keys)
633 (let ((out (assoc-ref outputs "out")))
634 ;; Required to find .bci files at runtime.
635 (with-directory-excursion "scmutils"
636 (rename-file "src" "scmutils"))
637 (substitute* "scmutils/scmutils/load.scm"
638 (("/usr/local/scmutils/")
639 (string-append out "/lib/mit-scheme-"
640 ,(system-suffix) "/")))
643 ;; Compile the code and build a band.
644 (lambda* (#:key outputs #:allow-other-keys)
645 (let* ((out (assoc-ref outputs "out"))
646 (make-img (string-append
647 "echo '(load \"load\") "
648 "(disk-save \"edwin-mechanics.com\")'"
650 (with-directory-excursion "scmutils/scmutils"
651 (and (zero? (system "mit-scheme < compile.scm"))
652 (zero? (system make-img)))))))
653 (add-before 'install 'fix-directory-names
654 ;; Correct directory names in the startup script.
655 (lambda* (#:key inputs outputs #:allow-other-keys)
656 (let* ((out (assoc-ref outputs "out"))
657 (scm-root (assoc-ref inputs "mit-scheme")))
658 (substitute* "bin/mechanics"
659 (("ROOT=\"\\$\\{SCMUTILS_ROOT:-/.*\\}\"")
661 "ROOT=\"${SCMUTILS_ROOT:-" scm-root "}\"\n"
662 "LIB=\"${ROOT}/lib/mit-scheme-"
664 out "/lib/mit-scheme-" ,(system-suffix) "\""))
665 (("EDWIN_INFO_DIRECTORY=.*\n") "")
667 (string-append "SCHEME=\"${ROOT}/bin/scheme "
668 "--library ${LIB}\"\n"))
669 (("export EDWIN_INFO_DIRECTORY") ""))
671 (add-before 'install 'emacs-tags
672 ;; Generate Emacs's tags for easy reference to source
674 (lambda* (#:key inputs outputs #:allow-other-keys)
675 (with-directory-excursion "scmutils/scmutils"
676 (zero? (apply system* "etags"
677 (find-files "." "\\.scm"))))))
679 ;; Copy files to the store.
680 (lambda* (#:key outputs #:allow-other-keys)
681 (define* (copy-files-to-directory files dir
682 #:optional (delete? #f))
683 (for-each (lambda (f)
684 (copy-file f (string-append dir "/" f))
685 (when delete? (delete-file f)))
688 (let* ((out (assoc-ref outputs "out"))
689 (bin (string-append out "/bin"))
690 (doc (string-append out "/share/doc/"
692 (lib (string-append out "/lib/mit-scheme-"
695 (for-each mkdir-p (list lib doc bin))
696 (with-directory-excursion "scmutils/scmutils"
697 (copy-files-to-directory '("COPYING" "LICENSE")
699 (for-each delete-file (find-files "." "\\.bin"))
700 (copy-files-to-directory '("edwin-mechanics.com")
701 (string-append lib "/..") #t)
702 (copy-recursively "." lib))
703 (with-directory-excursion "bin"
704 (copy-files-to-directory (find-files ".") bin))
705 (with-directory-excursion "scmutils/manual"
706 (copy-files-to-directory (find-files ".") doc))
708 (add-after 'install 'emacs-helpers
709 ;; Add convenience Emacs commands to easily load the
710 ;; Scmutils band in an MIT-Scheme buffer inside of Emacs
711 ;; and to easily load code tags.
712 (lambda* (#:key inputs outputs #:allow-other-keys)
713 (let* ((out (assoc-ref outputs "out"))
714 (mit-root (assoc-ref inputs "mit-scheme"))
716 (string-append out "/share/emacs/site-lisp"
717 "/guix.d/" ,name "-" ,version))
718 (el-file (string-append emacs-lisp-dir
721 (string-append "/lib/mit-scheme-"
723 (mkdir-p emacs-lisp-dir)
724 (call-with-output-file el-file
728 (defun scmutils-load ()
731 (let ((mit-root \"~a\")
734 (concat mit-root \"/bin/scheme --library \"
735 mit-root \"~a:\" scmutils \"~a\"
736 \" --band edwin-mechanics.com\"
740 (defun scmutils-load-tags ()
742 (let ((scmutils \"~a\"))
743 (visit-tags-table (concat scmutils \"/TAGS\"))))
748 (string-append out lib-relative-path
750 (emacs-generate-autoloads ,name emacs-lisp-dir)
751 (emacs-byte-compile-directory emacs-lisp-dir)
754 "http://groups.csail.mit.edu/mac/users/gjs/6946/linux-install.htm")
755 (synopsis "Scmutils library for MIT Scheme")
756 (description "The Scmutils system is an integrated library of
757 procedures, embedded in the programming language Scheme, and intended to
758 support teaching and research in mathematical physics and electrical
763 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
766 (version (string-append "20170703-1." (string-take commit 7)))
770 (url "https://github.com/sarabander/sicp")
774 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
775 (file-name (string-append name "-" version "-checkout"))))
776 (build-system trivial-build-system)
777 (native-inputs `(("gzip" ,gzip)
779 ("texinfo" ,texinfo)))
781 `(#:modules ((guix build utils)
786 (use-modules (guix build utils)
789 (let ((gzip (assoc-ref %build-inputs "gzip"))
790 (source (assoc-ref %build-inputs "source"))
791 (texinfo (assoc-ref %build-inputs "texinfo"))
792 (html-dir (string-append %output "/share/doc/" ,name "/html"))
793 (info-dir (string-append %output "/share/info")))
794 (copy-recursively (string-append source "/html") html-dir)
795 (setenv "PATH" (string-append gzip "/bin"
799 (system* "makeinfo" "--output"
800 (string-append info-dir "/sicp.info")
801 (string-append source "/sicp-pocket.texi")))
803 (map (cut system* "gzip" "-9n" <>)
804 (find-files info-dir))))))))
805 (home-page "http://sarabander.github.io/sicp")
806 (synopsis "Structure and Interpretation of Computer Programs")
807 (description "Structure and Interpretation of Computer Programs (SICP) is
808 a textbook aiming to teach the principles of computer programming.
810 Using Scheme, a dialect of the Lisp programming language, the book explains
811 core computer science concepts such as abstraction in programming,
812 metalinguistic abstraction, recursion, interpreters, and modular programming.")
813 (license cc-by-sa4.0))))
815 (define-public scheme48-rx
816 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
820 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
825 (url "https://github.com/scheme/rx")
829 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
830 (file-name (string-append name "-" version "-checkout"))))
831 (build-system trivial-build-system)
833 `(#:modules ((guix build utils))
836 (use-modules (guix build utils))
837 (let ((share (string-append %output
839 ,(package-version scheme48)
841 (chdir (assoc-ref %build-inputs "source"))
843 (copy-recursively "." share)))))
846 ("scheme48" ,scheme48)))
847 (home-page "https://github.com/scheme/rx/")
848 (synopsis "SRE String pattern-matching library for scheme48")
850 "String pattern-matching library for scheme48 based on the SRE
851 regular-expression notation.")
860 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
864 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
865 (build-system gnu-build-system)
867 `(#:tests? #f ; There is no check target.
869 (modify-phases %standard-phases
870 (add-after 'install 'remove-bin-share
871 (lambda* (#:key inputs outputs #:allow-other-keys)
872 (delete-file-recursively
873 (string-append (assoc-ref outputs "out") "/bin"))))
875 (lambda* (#:key inputs outputs #:allow-other-keys)
876 (zero? (system* "./configure"
877 (string-append "--prefix="
878 (assoc-ref outputs "out")))))))))
879 (native-inputs `(("unzip" ,unzip)
880 ("texinfo" ,texinfo)))
881 (home-page "http://people.csail.mit.edu/jaffer/SLIB.html")
882 (synopsis "Compatibility and utility library for Scheme")
883 (description "SLIB is a portable Scheme library providing compatibility and
884 utility functions for all standard Scheme implementations.")
885 (license (non-copyleft
886 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
887 "Or see COPYING in the distribution."))))
896 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
900 "050ijb51jm1cij9g3r89zl9rawsrikhbb5y8zb7lspb7bsxq5w99"))))
901 (build-system gnu-build-system)
904 (modify-phases %standard-phases
906 (lambda* (#:key inputs outputs #:allow-other-keys)
907 (zero? (system* "./configure"
908 (string-append "--prefix="
909 (assoc-ref outputs "out"))))))
910 (add-before 'build 'pre-build
911 (lambda* (#:key inputs #:allow-other-keys)
912 (substitute* "Makefile"
913 (("ginstall-info") "install-info"))))
915 (lambda* (#:key inputs outputs #:allow-other-keys)
916 (setenv "SCHEME_LIBRARY_PATH"
917 (string-append (assoc-ref inputs "slib")
920 (zero? (system* "make" "scmlit" "CC=gcc"))
921 (zero? (system* "make" "all")))))
922 (add-after 'install 'post-install
923 (lambda* (#:key inputs outputs #:allow-other-keys)
925 (string-append (assoc-ref outputs "out")
926 "/lib/scm/require.scm")))
929 (format (open req (logior O_WRONLY O_CREAT))
930 "(define (library-vicinity) ~s)\n"
931 (string-append (assoc-ref inputs "slib")
934 ;; We must generate the slibcat file
937 (assoc-ref outputs "out")
939 "-br" "new-catalog")))))))))
940 (inputs `(("slib" ,slib)))
941 (native-inputs `(("unzip" ,unzip)
942 ("texinfo" ,texinfo)))
943 (home-page "http://people.csail.mit.edu/jaffer/SCM")
944 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
945 (description "GNU SCM is an implementation of Scheme. This
946 implementation includes Hobbit, a Scheme-to-C compiler, which can
947 generate C files whose binaries can be dynamically or statically
948 linked with a SCM executable.")