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>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages scheme)
28 #:use-module (gnu packages)
29 #:use-module ((guix licenses)
30 #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
31 cc-by-sa4.0 non-copyleft))
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix git-download)
35 #:use-module (guix utils)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system trivial)
38 #:use-module (gnu packages bdw-gc)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages libevent)
41 #:use-module (gnu packages libunistring)
42 #:use-module (gnu packages m4)
43 #:use-module (gnu packages multiprecision)
44 #:use-module (gnu packages ncurses)
45 #:use-module (gnu packages pcre)
46 #:use-module (gnu packages databases)
47 #:use-module (gnu packages emacs)
48 #:use-module (gnu packages ghostscript)
49 #:use-module (gnu packages netpbm)
50 #:use-module (gnu packages texinfo)
51 #:use-module (gnu packages tex)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages avahi)
56 #:use-module (gnu packages libphidget)
57 #:use-module (gnu packages gcc)
58 #:use-module (gnu packages glib)
59 #:use-module (gnu packages gtk)
60 #:use-module (gnu packages libffi)
61 #:use-module (gnu packages fontutils)
62 #:use-module (gnu packages image)
63 #:use-module (gnu packages xorg)
64 #:use-module (gnu packages tls)
65 #:use-module (gnu packages gl)
66 #:use-module (ice-9 match))
68 (define (mit-scheme-source-directory system version)
69 (string-append "mit-scheme-"
70 (if (or (string-prefix? "x86_64" system)
71 (string-prefix? "i686" system))
76 (define-public mit-scheme
80 (source #f) ; see below
81 (outputs '("out" "doc"))
82 (build-system gnu-build-system)
84 `(#:tests? #f ; no "check" target
85 #:modules ((guix build gnu-build-system)
89 (modify-phases %standard-phases
91 (lambda* (#:key inputs #:allow-other-keys)
92 (and (zero? (system* "tar" "xzvf"
93 (assoc-ref inputs "source")))
94 (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 (zero? (system* "make" "compile-microcode"))
112 (zero? (system* "./etc/make-liarc.sh"
113 (string-append "--prefix=" out)))))))
114 (add-after 'configure 'configure-doc
115 (lambda* (#:key outputs inputs #:allow-other-keys)
116 (with-directory-excursion "../doc"
117 (let* ((out (assoc-ref outputs "out"))
118 (bash (assoc-ref inputs "bash"))
119 (bin/sh (string-append bash "/bin/sh")))
120 (system* bin/sh "./configure"
121 (string-append "--prefix=" out)
122 (string-append "SHELL=" bin/sh))
123 (substitute* '("Makefile" "make-common")
124 (("/lib/mit-scheme/doc")
125 (string-append "/share/doc/" ,name "-" ,version)))
127 (add-after 'build 'build-doc
129 (with-directory-excursion "../doc"
130 (zero? (system* "make")))))
131 (add-after 'install 'install-doc
132 (lambda* (#:key outputs #:allow-other-keys)
133 (let* ((out (assoc-ref outputs "out"))
134 (doc (assoc-ref outputs "doc"))
135 (old-doc-dir (string-append out "/share/doc"))
136 (new-doc/mit-scheme-dir
137 (string-append doc "/share/doc/" ,name "-" ,version)))
138 (with-directory-excursion "../doc"
139 (for-each (lambda (target)
140 (system* "make" target))
141 '("install-config" "install-info-gz" "install-man"
142 "install-html" "install-pdf")))
143 (mkdir-p new-doc/mit-scheme-dir)
145 (string-append old-doc-dir "/" ,name "-" ,version)
146 new-doc/mit-scheme-dir)
147 (delete-file-recursively old-doc-dir)
150 `(("texlive" ,texlive)
158 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
159 ;; compile from the architecture-specific tarballs, which contain
160 ;; pre-built binaries. It leads to more efficient code than when
161 ;; building the tarball that contains generated C code instead of
165 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
166 version "/mit-scheme-"
167 (match (%current-system)
169 (string-append version "-x86-64"))
171 (string-append version "-i386"))
173 (string-append "c-" version)))
176 (match (%current-system)
179 "1skzxxhr0iq96bf0j5m7mvf3i4sppfyfa6gpqn34mwgkw1fx8274"))
182 "1fmlpnhf5a75db93phajh4ysbdgrgl72v45lk3kznriprl0a7jc6"))
185 "0w5ib5vsidihb4hb6fma3sp596ykr8izagm57axvgd6lqzwicsjg"))))))))
187 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
188 (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
190 (home-page "https://www.gnu.org/software/mit-scheme/")
191 (synopsis "A Scheme implementation with integrated editor and debugger")
193 "GNU/MIT Scheme is an implementation of the Scheme programming
194 language. It provides an interpreter, a compiler and a debugger. It also
195 features an integrated Emacs-like editor and a large runtime library.")
197 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
199 (define-public bigloo
205 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
209 "03rcqs6kvy2j5lqk4fidqay5qfyp474qqspbh6wk4qdbds6w599w"))
210 ;; Remove bundled libraries.
211 (modules '((guix build utils)))
213 '(for-each delete-file-recursively
214 '("gc" "gmp" "libuv")))))
215 (build-system gnu-build-system)
217 `(#:test-target "test"
219 (modify-phases %standard-phases
221 (lambda* (#:key inputs outputs #:allow-other-keys)
223 (substitute* "configure"
225 (string-append "shell=" (which "bash") "\n"))
227 (substitute* "autoconf/runtest.in"
229 (substitute* "autoconf/osversion"
230 (("^version.*$") "version=\"\"\n"))
232 ;; The `configure' script doesn't understand options
233 ;; of those of Autoconf.
234 (let ((out (assoc-ref outputs "out")))
236 (system* "./configure"
237 (string-append "--prefix=" out)
238 ; use system libraries
240 "--customunistring=no"
242 (string-append"--mv=" (which "mv"))
243 (string-append "--rm=" (which "rm"))
245 (string-append "--ldflags=-Wl,-rpath="
246 (assoc-ref outputs "out")
247 "/lib/bigloo/" ,version)
248 (string-append "--lispdir=" out
249 "/share/emacs/site-lisp")
251 "--sharedcompiler=yes")))))
252 (add-after 'install 'install-emacs-modes
253 (lambda* (#:key outputs #:allow-other-keys)
254 (let* ((out (assoc-ref outputs "out"))
255 (dir (string-append out "/share/emacs/site-lisp")))
256 (zero? (system* "make" "-C" "bmacs" "all" "install"
257 (string-append "EMACSBRAND=emacs25")
258 (string-append "EMACSDIR=" dir)))))))))
260 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
262 ("libunistring" ,libunistring)
267 ;; Optional APIs for which Bigloo has bindings.
269 ("libphidget" ,libphidget)
272 `(("pkg-config" ,pkg-config)))
274 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
275 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
276 (synopsis "Efficient Scheme compiler")
278 "Bigloo is a Scheme implementation devoted to one goal: enabling
279 Scheme based programming style where C(++) is usually
280 required. Bigloo attempts to make Scheme practical by offering
281 features usually presented by traditional programming languages
282 but not offered by Scheme and functional programming. Bigloo
283 compiles Scheme modules. It delivers small and fast stand alone
284 binary executables. Bigloo enables full connections between
285 Scheme and C programs and between Scheme and Java programs.")
291 (version "3.1.0-pre2")
294 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
298 "09m7pahjsp7wxzd20cdph9j3mgf2nq5dyckcjljcd40m25v85kks"))))
299 (build-system gnu-build-system)
301 `(#:test-target "test"
302 #:make-flags '("BIGLOO=bigloo")
305 (modify-phases %standard-phases
307 (lambda* (#:key inputs outputs #:allow-other-keys)
308 (let ((out (assoc-ref outputs "out")))
310 (system* "./configure"
311 (string-append "--prefix=" out)
312 (string-append "--blflags="
313 ;; user flags completely override useful
314 ;; default flags, so repeat them here.
315 "-copt \\$(CPICFLAGS) "
316 "-L \\$(BUILDLIBDIR) "
317 "-ldopt -Wl,-rpath," out "/lib")))))))))
318 (inputs `(("avahi" ,avahi)
321 ("libunistring" ,libunistring)
326 (home-page "http://hop.inria.fr/")
327 (synopsis "Multi-tier programming language for the Web 2.0")
329 "HOP is a multi-tier programming language for the Web 2.0 and the
330 so-called diffuse Web. It is designed for programming interactive web
331 applications in many fields such as multimedia (web galleries, music players,
332 ...), ubiquitous and house automation (SmartPhones, personal appliance),
333 mashups, office (web agendas, mail clients, ...), etc.")
336 (define-public chicken
342 (uri (string-append "https://code.call-cc.org/releases/"
343 version "/chicken-" version ".tar.gz"))
346 "12b9gaa9lqh39lj1v4wm48f6z8ww3jdkvc5bh9gqqvn6kd2wwnk0"))
348 (search-patches "chicken-CVE-2017-6949.patch"
349 "chicken-CVE-2017-11343.patch"))))
350 (build-system gnu-build-system)
352 `(#:modules ((guix build gnu-build-system)
356 ;; No `configure' script; run "make check" after "make install" as
357 ;; prescribed by README.
359 (modify-phases %standard-phases
362 (add-after 'install 'check
363 (assoc-ref %standard-phases 'check)))
365 #:make-flags (let ((out (assoc-ref %outputs "out")))
366 (list "PLATFORM=linux"
367 (string-append "PREFIX=" out)
368 (string-append "VARDIR=" out "/var/lib")))
370 ;; Parallel builds are not supported, as noted in README.
371 #:parallel-build? #f))
372 (home-page "http://www.call-cc.org/")
373 (synopsis "R5RS Scheme implementation that compiles native code via C")
375 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
376 produces portable and efficient C, supports almost all of the R5RS Scheme
377 language standard, and includes many enhancements and extensions.")
380 (define-public scheme48
386 (uri (string-append "http://s48.org/" version
387 "/scheme48-" version ".tgz"))
390 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
391 (patches (search-patches "scheme48-tests.patch"))))
392 (build-system gnu-build-system)
393 (home-page "http://s48.org/")
394 (synopsis "Scheme implementation using a bytecode interpreter")
396 "Scheme 48 is an implementation of Scheme based on a byte-code
397 interpreter and is designed to be used as a testbed for experiments in
398 implementation techniques and as an expository tool.")
400 ;; Most files are BSD-3; see COPYING for the few exceptions.
403 (define-public racket
409 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
410 version "/racket-" version "-src.tgz")
412 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
413 version "/racket/racket-" version "-src-unix.tgz")))
416 "1l9z1a0r5zydr50cklx9xjw3l0pwnf64i10xq7112fl1r89q3qgv"))))
417 (build-system gnu-build-system)
420 (modify-phases %standard-phases
421 (add-before 'configure 'pre-configure
422 (lambda* (#:key inputs #:allow-other-keys)
423 ;; Patch dynamically loaded libraries with their absolute paths.
424 (let* ((library-path (search-path-as-string->list
425 (getenv "LIBRARY_PATH")))
426 (find-so (lambda (soname)
429 (format #f "~a.so" soname))))
430 (patch-ffi-libs (lambda (file libs)
434 (((format #f "\"~a\"" lib))
435 (format #f "\"~a\"" (find-so lib)))))
437 (substitute* "collects/db/private/sqlite3/ffi.rkt"
438 (("ffi-lib sqlite-so")
439 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
440 (substitute* "collects/openssl/libssl.rkt"
441 (("ffi-lib libssl-so")
442 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
443 (substitute* "collects/openssl/libcrypto.rkt"
444 (("ffi-lib libcrypto-so")
445 (format #f "ffi-lib \"~a\"" (find-so "libcrypto"))))
446 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
447 (("ffi-lib libgmp-so")
448 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
449 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
450 (("ffi-lib libmpfr-so")
451 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
453 (lambda (x) (apply patch-ffi-libs x))
454 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
455 ("libfontconfig" "libcairo"))
456 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
457 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
458 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
460 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
461 ("libpango-1.0" "libpangocairo-1.0"))
462 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
464 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
466 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
468 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
470 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
471 ("libgdk-3" "libgtk-3"))
472 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
474 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
475 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
476 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
478 ("share/pkgs/sgl/gl.rkt"
479 ("libGL" "libGLU")))))
482 (add-after 'unpack 'patch-/bin/sh
484 (substitute* "collects/racket/system.rkt"
485 (("/bin/sh") (which "sh")))
487 #:tests? #f ; XXX: how to run them?
491 ;; Hardcode dynamically loaded libraries for better functionality.
492 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
494 ("fontconfig" ,fontconfig)
498 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
507 ("unixodbc" ,unixodbc)))
508 (home-page "http://racket-lang.org")
509 (synopsis "Implementation of Scheme and related languages")
511 "Racket is an implementation of the Scheme programming language (R5RS and
512 R6RS) and related languages, such as Typed Racket. It features a compiler and
513 a virtual machine with just-in-time native compilation, as well as a large set
517 (define-public gambit-c
525 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
526 (version-major+minor version) "/source/gambit-v"
527 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
530 (base32 "0xwmqzqvk83xyjz48vp36p5vj1415rl3pi3xq7y8i3p8s409a98b"))))
531 (build-system gnu-build-system)
534 ;; According to the ./configure script, this makes the build slower and
535 ;; use >= 1 GB memory, but makes Gambit much faster.
536 '("--enable-single-host")
538 (modify-phases %standard-phases
539 (add-before 'check 'fix-tests
541 (substitute* '("tests/makefile")
542 ;; '-:' is how run-time options are set. 'tl' sets some terminal
543 ;; option, which makes it fail in our build environment. It
544 ;; recommends using 'd-' as a solution, which sets the REPL
545 ;; interaction channel to stdin/stdout.
546 (("gsi -:tl") "gsi -:d-,tl"))
548 (home-page "http://www.iro.umontreal.ca/~gambit/")
549 (synopsis "Efficient Scheme interpreter and compiler")
551 "Gambit consists of two main programs: gsi, the Gambit Scheme
552 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
553 the complete execution and debugging environment. The compiler is the
554 interpreter extended with the capability of generating executable files. The
555 compiler can produce standalone executables or compiled modules which can be
556 loaded at run time. Interpreted code and compiled code can be freely
559 (license (list lgpl2.1+ asl2.0))))
561 (define-public chibi-scheme
563 (name "chibi-scheme")
568 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
571 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
572 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
573 (build-system gnu-build-system)
575 `(#:phases (modify-phases %standard-phases
577 (add-before 'build 'set-cc
579 (setenv "CC" "gcc"))))
580 #:make-flags (let ((out (assoc-ref %outputs "out")))
581 (list (string-append "PREFIX=" out)
582 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
583 #:test-target "test"))
584 (home-page "https://github.com/ashinn/chibi-scheme")
585 (synopsis "Small embeddable Scheme implementation")
587 "Chibi-Scheme is a very small library with no external dependencies
588 intended for use as an extension and scripting language in C programs. In
589 addition to support for lightweight VM-based threads, each VM itself runs in
590 an isolated heap allowing multiple VMs to run simultaneously in different OS
594 (define-public scmutils
596 (define (system-suffix)
598 ((string-prefix? "x86_64" (or (%current-target-system)
608 (method url-fetch/tarbomb)
609 (modules '((guix build utils)))
611 ;; Remove binary code
612 '(delete-file-recursively "scmutils/mit-scheme"))
613 (uri (string-append "http://groups.csail.mit.edu/mac/users/gjs/6946"
614 "/scmutils-tarballs/" name "-" version
615 "-x86-64-gnu-linux.tar.gz"))
617 (base32 "10cnbm7nh78m5mrl1di85s29gny81jb1am9zd9f9yx725xb6dnfg"))))
618 (build-system gnu-build-system)
620 `(("mit-scheme" ,mit-scheme)
621 ("emacs" ,emacs-minimal)))
623 `(#:tests? #f ;; no tests-suite
624 #:modules ((guix build gnu-build-system)
626 (guix build emacs-utils))
627 #:imported-modules (,@%gnu-build-system-modules
628 (guix build emacs-utils))
630 (modify-phases %standard-phases
632 ;; No standard build procedure is used. We set the correct
633 ;; runtime path in the custom build system.
634 (lambda* (#:key outputs #:allow-other-keys)
635 (let ((out (assoc-ref outputs "out")))
636 ;; Required to find .bci files at runtime.
637 (with-directory-excursion "scmutils"
638 (rename-file "src" "scmutils"))
639 (substitute* "scmutils/scmutils/load.scm"
640 (("/usr/local/scmutils/")
641 (string-append out "/lib/mit-scheme-"
642 ,(system-suffix) "/")))
645 ;; Compile the code and build a band.
646 (lambda* (#:key outputs #:allow-other-keys)
647 (let* ((out (assoc-ref outputs "out"))
648 (make-img (string-append
649 "echo '(load \"load\") "
650 "(disk-save \"edwin-mechanics.com\")'"
652 (with-directory-excursion "scmutils/scmutils"
653 (and (zero? (system "mit-scheme < compile.scm"))
654 (zero? (system make-img)))))))
655 (add-before 'install 'fix-directory-names
656 ;; Correct directory names in the startup script.
657 (lambda* (#:key inputs outputs #:allow-other-keys)
658 (let* ((out (assoc-ref outputs "out"))
659 (scm-root (assoc-ref inputs "mit-scheme")))
660 (substitute* "bin/mechanics"
661 (("ROOT=\"\\$\\{SCMUTILS_ROOT:-/.*\\}\"")
663 "ROOT=\"${SCMUTILS_ROOT:-" scm-root "}\"\n"
664 "LIB=\"${ROOT}/lib/mit-scheme-"
666 out "/lib/mit-scheme-" ,(system-suffix) "\""))
667 (("EDWIN_INFO_DIRECTORY=.*\n") "")
669 (string-append "SCHEME=\"${ROOT}/bin/scheme "
670 "--library ${LIB}\"\n"))
671 (("export EDWIN_INFO_DIRECTORY") ""))
673 (add-before 'install 'emacs-tags
674 ;; Generate Emacs's tags for easy reference to source
676 (lambda* (#:key inputs outputs #:allow-other-keys)
677 (with-directory-excursion "scmutils/scmutils"
678 (zero? (apply system* "etags"
679 (find-files "." "\\.scm"))))))
681 ;; Copy files to the store.
682 (lambda* (#:key outputs #:allow-other-keys)
683 (define* (copy-files-to-directory files dir
684 #:optional (delete? #f))
685 (for-each (lambda (f)
686 (copy-file f (string-append dir "/" f))
687 (when delete? (delete-file f)))
690 (let* ((out (assoc-ref outputs "out"))
691 (bin (string-append out "/bin"))
692 (doc (string-append out "/share/doc/"
694 (lib (string-append out "/lib/mit-scheme-"
697 (for-each mkdir-p (list lib doc bin))
698 (with-directory-excursion "scmutils/scmutils"
699 (copy-files-to-directory '("COPYING" "LICENSE")
701 (for-each delete-file (find-files "." "\\.bin"))
702 (copy-files-to-directory '("edwin-mechanics.com")
703 (string-append lib "/..") #t)
704 (copy-recursively "." lib))
705 (with-directory-excursion "bin"
706 (copy-files-to-directory (find-files ".") bin))
707 (with-directory-excursion "scmutils/manual"
708 (copy-files-to-directory (find-files ".") doc))
710 (add-after 'install 'emacs-helpers
711 ;; Add convenience Emacs commands to easily load the
712 ;; Scmutils band in an MIT-Scheme buffer inside of Emacs
713 ;; and to easily load code tags.
714 (lambda* (#:key inputs outputs #:allow-other-keys)
715 (let* ((out (assoc-ref outputs "out"))
716 (mit-root (assoc-ref inputs "mit-scheme"))
718 (string-append out "/share/emacs/site-lisp"
719 "/guix.d/" ,name "-" ,version))
720 (el-file (string-append emacs-lisp-dir
723 (string-append "/lib/mit-scheme-"
725 (mkdir-p emacs-lisp-dir)
726 (call-with-output-file el-file
730 (defun scmutils-load ()
733 (let ((mit-root \"~a\")
736 (concat mit-root \"/bin/scheme --library \"
737 mit-root \"~a:\" scmutils \"~a\"
738 \" --band edwin-mechanics.com\"
742 (defun scmutils-load-tags ()
744 (let ((scmutils \"~a\"))
745 (visit-tags-table (concat scmutils \"/TAGS\"))))
750 (string-append out lib-relative-path
752 (emacs-generate-autoloads ,name emacs-lisp-dir)
753 (emacs-byte-compile-directory emacs-lisp-dir)
756 "http://groups.csail.mit.edu/mac/users/gjs/6946/linux-install.htm")
757 (synopsis "Scmutils library for MIT Scheme")
758 (description "The Scmutils system is an integrated library of
759 procedures, embedded in the programming language Scheme, and intended to
760 support teaching and research in mathematical physics and electrical
765 (let ((commit "5b52db566968d28a89fbbaf338d207f01cc81cac"))
768 (version (string-append "20160220-1." (string-take commit 7)))
772 (url "https://github.com/sarabander/sicp")
776 "10h6h7szwlfbshwh18bnl2hvyddj5i7106l79s145l0sjjv15cxb"))
777 (file-name (string-append name "-" version "-checkout"))))
778 (build-system trivial-build-system)
779 (native-inputs `(("gzip" ,gzip)
781 ("texinfo" ,texinfo)))
783 `(#:modules ((guix build utils)
788 (use-modules (guix build utils)
791 (let ((gzip (assoc-ref %build-inputs "gzip"))
792 (source (assoc-ref %build-inputs "source"))
793 (texinfo (assoc-ref %build-inputs "texinfo"))
794 (html-dir (string-append %output "/share/doc/" ,name "/html"))
795 (info-dir (string-append %output "/share/info")))
796 (copy-recursively (string-append source "/html") html-dir)
797 (setenv "PATH" (string-append gzip "/bin"
801 (system* "makeinfo" "--output"
802 (string-append info-dir "/sicp.info")
803 (string-append source "/sicp-pocket.texi")))
805 (map (cut system* "gzip" "-9n" <>)
806 (find-files info-dir))))))))
807 (home-page "http://sarabander.github.io/sicp")
808 (synopsis "Structure and Interpretation of Computer Programs")
809 (description "Structure and Interpretation of Computer Programs (SICP) is
810 a textbook aiming to teach the principles of computer programming.
812 Using Scheme, a dialect of the Lisp programming language, the book explains
813 core computer science concepts such as abstraction in programming,
814 metalinguistic abstraction, recursion, interpreters, and modular programming.")
815 (license cc-by-sa4.0))))
817 (define-public scheme48-rx
818 (let* ((commit "d3231ad13de2b44e3ee173b1c9d09ff165e8b6d5")
822 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
827 (url "https://github.com/scheme/rx")
831 "1nmziaibgmfi346kzidj6xyad0vm7724qymbzgxvdzyrqji6v6yz"))
832 (file-name (string-append name "-" version "-checkout"))))
833 (build-system trivial-build-system)
835 `(#:modules ((guix build utils))
838 (use-modules (guix build utils))
839 (let ((share (string-append %output
841 ,(package-version scheme48)
843 (chdir (assoc-ref %build-inputs "source"))
845 (copy-recursively "." share)))))
848 ("scheme48" ,scheme48)))
849 (home-page "https://github.com/scheme/rx/")
850 (synopsis "SRE String pattern-matching library for scheme48")
852 "String pattern-matching library for scheme48 based on the SRE
853 regular-expression notation.")
862 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
866 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
867 (build-system gnu-build-system)
869 `(#:tests? #f ; There is no check target.
871 (modify-phases %standard-phases
872 (add-after 'install 'remove-bin-share
873 (lambda* (#:key inputs outputs #:allow-other-keys)
874 (delete-file-recursively
875 (string-append (assoc-ref outputs "out") "/bin"))))
877 (lambda* (#:key inputs outputs #:allow-other-keys)
878 (zero? (system* "./configure"
879 (string-append "--prefix="
880 (assoc-ref outputs "out")))))))))
881 (native-inputs `(("unzip" ,unzip)
882 ("texinfo" ,texinfo)))
883 (home-page "http://people.csail.mit.edu/jaffer/SLIB/")
884 (synopsis "Compatibility and utility library for Scheme")
885 (description "SLIB is a portable Scheme library providing compatibility and
886 utility functions for all standard Scheme implementations.")
887 (license (non-copyleft
888 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
889 "Or see COPYING in the distribution."))))
898 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
902 "050ijb51jm1cij9g3r89zl9rawsrikhbb5y8zb7lspb7bsxq5w99"))))
903 (build-system gnu-build-system)
906 (modify-phases %standard-phases
908 (lambda* (#:key inputs outputs #:allow-other-keys)
909 (zero? (system* "./configure"
910 (string-append "--prefix="
911 (assoc-ref outputs "out"))))))
912 (add-before 'build 'pre-build
913 (lambda* (#:key inputs #:allow-other-keys)
914 (substitute* "Makefile"
915 (("ginstall-info") "install-info"))))
917 (lambda* (#:key inputs outputs #:allow-other-keys)
918 (setenv "SCHEME_LIBRARY_PATH"
919 (string-append (assoc-ref inputs "slib")
922 (zero? (system* "make" "scmlit" "CC=gcc"))
923 (zero? (system* "make" "all")))))
924 (add-after 'install 'post-install
925 (lambda* (#:key inputs outputs #:allow-other-keys)
927 (string-append (assoc-ref outputs "out")
928 "/lib/scm/require.scm")))
931 (format (open req (logior O_WRONLY O_CREAT))
932 "(define (library-vicinity) ~s)\n"
933 (string-append (assoc-ref inputs "slib")
936 ;; We must generate the slibcat file
939 (assoc-ref outputs "out")
941 "-br" "new-catalog")))))))))
942 (inputs `(("slib" ,slib)))
943 (native-inputs `(("unzip" ,unzip)
944 ("texinfo" ,texinfo)))
945 (home-page "http://people.csail.mit.edu/jaffer/SCM")
946 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
947 (description "GNU SCM is an implementation of Scheme. This
948 implementation includes Hobbit, a Scheme-to-C compiler, which can
949 generate C files whose binaries can be dynamically or statically
950 linked with a SCM executable.")