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 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)))
215 '(for-each delete-file-recursively
216 '("gc" "gmp" "libuv")))))
217 (build-system gnu-build-system)
219 `(#:test-target "test"
221 (modify-phases %standard-phases
223 (lambda* (#:key inputs outputs #:allow-other-keys)
225 (substitute* "configure"
227 (string-append "shell=" (which "bash") "\n"))
229 (substitute* "autoconf/runtest.in"
231 (substitute* "autoconf/osversion"
232 (("^version.*$") "version=\"\"\n"))
233 (substitute* "comptime/Makefile"
234 (("\\$\\(LDCOMPLIBS\\)")
235 "$(LDCOMPLIBS) $(LDFLAGS)"))
237 ;; The `configure' script doesn't understand options
238 ;; of those of Autoconf.
239 (let ((out (assoc-ref outputs "out")))
240 (invoke "./configure"
241 (string-append "--prefix=" out)
242 ; use system libraries
244 "--customunistring=no"
246 (string-append"--mv=" (which "mv"))
247 (string-append "--rm=" (which "rm"))
249 (string-append "--ldflags=-Wl,-rpath="
250 (assoc-ref outputs "out")
251 "/lib/bigloo/" ,version)
252 (string-append "--lispdir=" out
253 "/share/emacs/site-lisp")
255 "--sharedcompiler=yes"
256 "--disable-patch"))))
257 (add-after 'install 'install-emacs-modes
258 (lambda* (#:key outputs #:allow-other-keys)
259 (let* ((out (assoc-ref outputs "out"))
260 (dir (string-append out "/share/emacs/site-lisp")))
261 (invoke "make" "-C" "bmacs" "all" "install"
262 (string-append "EMACSBRAND=emacs25")
263 (string-append "EMACSDIR=" dir))))))))
265 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
267 ("libunistring" ,libunistring)
272 ;; Optional APIs for which Bigloo has bindings.
274 ("libphidget" ,libphidget)
277 `(("pkg-config" ,pkg-config)))
279 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
280 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
281 (synopsis "Efficient Scheme compiler")
283 "Bigloo is a Scheme implementation devoted to one goal: enabling
284 Scheme based programming style where C(++) is usually
285 required. Bigloo attempts to make Scheme practical by offering
286 features usually presented by traditional programming languages
287 but not offered by Scheme and functional programming. Bigloo
288 compiles Scheme modules. It delivers small and fast stand alone
289 binary executables. Bigloo enables full connections between
290 Scheme and C programs and between Scheme and Java programs.")
296 (version "3.1.0-pre2")
299 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
303 "09m7pahjsp7wxzd20cdph9j3mgf2nq5dyckcjljcd40m25v85kks"))))
304 (build-system gnu-build-system)
306 `(#:test-target "test"
307 #:make-flags '("BIGLOO=bigloo")
310 (modify-phases %standard-phases
312 (lambda* (#:key inputs outputs #:allow-other-keys)
313 (let ((out (assoc-ref outputs "out")))
315 (system* "./configure"
316 (string-append "--prefix=" out)
317 (string-append "--blflags="
318 ;; user flags completely override useful
319 ;; default flags, so repeat them here.
320 "-copt \\$(CPICFLAGS) "
321 "-L \\$(BUILDLIBDIR) "
322 "-ldopt -Wl,-rpath," out "/lib")))))))))
323 (inputs `(("avahi" ,avahi)
326 ("libunistring" ,libunistring)
331 (home-page "http://hop.inria.fr/")
332 (synopsis "Multi-tier programming language for the Web 2.0")
334 "HOP is a multi-tier programming language for the Web 2.0 and the
335 so-called diffuse Web. It is designed for programming interactive web
336 applications in many fields such as multimedia (web galleries, music players,
337 ...), ubiquitous and house automation (SmartPhones, personal appliance),
338 mashups, office (web agendas, mail clients, ...), etc.")
341 (define-public chicken
347 (uri (string-append "https://code.call-cc.org/releases/"
348 version "/chicken-" version ".tar.gz"))
351 "0hvckhi5gfny3mlva6d7y9pmx7cbwvq0r7mk11k3sdiik9hlkmdd"))))
352 (build-system gnu-build-system)
354 `(#:modules ((guix build gnu-build-system)
358 ;; No `configure' script; run "make check" after "make install" as
359 ;; prescribed by README.
361 (modify-phases %standard-phases
364 (add-after 'install 'check
365 (assoc-ref %standard-phases 'check)))
367 #:make-flags (let ((out (assoc-ref %outputs "out")))
368 (list "PLATFORM=linux"
369 (string-append "PREFIX=" out)
370 (string-append "VARDIR=" out "/var/lib")))
372 ;; Parallel builds are not supported, as noted in README.
373 #:parallel-build? #f))
374 (home-page "http://www.call-cc.org/")
375 (synopsis "R5RS Scheme implementation that compiles native code via C")
377 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
378 produces portable and efficient C, supports almost all of the R5RS Scheme
379 language standard, and includes many enhancements and extensions.")
382 (define-public scheme48
388 (uri (string-append "http://s48.org/" version
389 "/scheme48-" version ".tgz"))
392 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
393 (patches (search-patches "scheme48-tests.patch"))))
394 (build-system gnu-build-system)
395 (home-page "http://s48.org/")
396 (synopsis "Scheme implementation using a bytecode interpreter")
398 "Scheme 48 is an implementation of Scheme based on a byte-code
399 interpreter and is designed to be used as a testbed for experiments in
400 implementation techniques and as an expository tool.")
402 ;; Most files are BSD-3; see COPYING for the few exceptions.
405 (define-public racket
411 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
412 version "/racket-" version "-src.tgz")
414 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
415 version "/racket-" version "-src.tgz")))
418 "1nk7705x24jjlbqqhj8yvbgqkfscxx3m81bry1g56kjxysjmf3sw"))))
419 (build-system gnu-build-system)
422 (modify-phases %standard-phases
423 (add-before 'configure 'pre-configure
424 (lambda* (#:key inputs #:allow-other-keys)
425 ;; Patch dynamically loaded libraries with their absolute paths.
426 (let* ((library-path (search-path-as-string->list
427 (getenv "LIBRARY_PATH")))
428 (find-so (lambda (soname)
431 (format #f "~a.so" soname))))
432 (patch-ffi-libs (lambda (file libs)
436 (((format #f "\"~a\"" lib))
437 (format #f "\"~a\"" (find-so lib)))))
439 (substitute* "collects/db/private/sqlite3/ffi.rkt"
440 (("ffi-lib sqlite-so")
441 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
442 (substitute* "collects/openssl/libssl.rkt"
443 (("ffi-lib libssl-so")
444 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
445 (substitute* "collects/openssl/libcrypto.rkt"
446 (("ffi-lib libcrypto-so")
447 (format #f "ffi-lib \"~a\"" (find-so "libcrypto"))))
448 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
449 (("ffi-lib libgmp-so")
450 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
451 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
452 (("ffi-lib libmpfr-so")
453 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
455 (lambda (x) (apply patch-ffi-libs x))
456 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
457 ("libfontconfig" "libcairo"))
458 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
459 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
460 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
462 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
463 ("libpango-1.0" "libpangocairo-1.0"))
464 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
466 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
468 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
470 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
472 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
473 ("libgdk-3" "libgtk-3"))
474 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
476 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
477 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
478 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
480 ("share/pkgs/sgl/gl.rkt"
481 ("libGL" "libGLU")))))
484 (add-after 'unpack 'patch-/bin/sh
486 (substitute* "collects/racket/system.rkt"
487 (("/bin/sh") (which "sh")))
489 #:tests? #f ; XXX: how to run them?
493 ;; Hardcode dynamically loaded libraries for better functionality.
494 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
496 ("fontconfig" ,fontconfig)
500 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
509 ("unixodbc" ,unixodbc)))
510 (home-page "http://racket-lang.org")
511 (synopsis "Implementation of Scheme and related languages")
513 "Racket is an implementation of the Scheme programming language (R5RS and
514 R6RS) and related languages, such as Typed Racket. It features a compiler and
515 a virtual machine with just-in-time native compilation, as well as a large set
519 (define-public gambit-c
527 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
528 (version-major+minor version) "/source/gambit-v"
529 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
532 (base32 "16sg1s8myzxqpimj5ry6lfza0qfs157zj28bvmxwwgy89jd9m5v7"))))
533 (build-system gnu-build-system)
536 ;; According to the ./configure script, this makes the build slower and
537 ;; use >= 1 GB memory, but makes Gambit much faster.
538 '("--enable-single-host")
540 (modify-phases %standard-phases
541 (add-before 'check 'fix-tests
543 (substitute* '("tests/makefile")
544 ;; '-:' is how run-time options are set. 'tl' sets some terminal
545 ;; option, which makes it fail in our build environment. It
546 ;; recommends using 'd-' as a solution, which sets the REPL
547 ;; interaction channel to stdin/stdout.
548 (("gsi -:tl") "gsi -:d-,tl"))
550 (home-page "http://www.iro.umontreal.ca/~gambit/")
551 (synopsis "Efficient Scheme interpreter and compiler")
553 "Gambit consists of two main programs: gsi, the Gambit Scheme
554 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
555 the complete execution and debugging environment. The compiler is the
556 interpreter extended with the capability of generating executable files. The
557 compiler can produce standalone executables or compiled modules which can be
558 loaded at run time. Interpreted code and compiled code can be freely
561 (license (list lgpl2.1+ asl2.0))))
563 (define-public chibi-scheme
565 (name "chibi-scheme")
570 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
573 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
574 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
575 (build-system gnu-build-system)
577 `(#:phases (modify-phases %standard-phases
579 (add-before 'build 'set-cc
581 (setenv "CC" "gcc"))))
582 #:make-flags (let ((out (assoc-ref %outputs "out")))
583 (list (string-append "PREFIX=" out)
584 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
585 #:test-target "test"))
586 (home-page "https://github.com/ashinn/chibi-scheme")
587 (synopsis "Small embeddable Scheme implementation")
589 "Chibi-Scheme is a very small library with no external dependencies
590 intended for use as an extension and scripting language in C programs. In
591 addition to support for lightweight VM-based threads, each VM itself runs in
592 an isolated heap allowing multiple VMs to run simultaneously in different OS
596 (define-public scmutils
598 (define (system-suffix)
600 ((string-prefix? "x86_64" (or (%current-target-system)
610 (method url-fetch/tarbomb)
611 (modules '((guix build utils)))
613 ;; Remove binary code
614 '(delete-file-recursively "scmutils/mit-scheme"))
615 (uri (string-append "http://groups.csail.mit.edu/mac/users/gjs/6946"
616 "/scmutils-tarballs/" name "-" version
617 "-x86-64-gnu-linux.tar.gz"))
619 (base32 "00ly5m0s4dy5kxravjaqlpii5zcnr6b9nqm0607lr7xcs52i4j8b"))))
620 (build-system gnu-build-system)
622 `(("mit-scheme" ,mit-scheme)
623 ("emacs" ,emacs-minimal)))
625 `(#:tests? #f ;; no tests-suite
626 #:modules ((guix build gnu-build-system)
628 (guix build emacs-utils))
629 #:imported-modules (,@%gnu-build-system-modules
630 (guix build emacs-utils))
632 (modify-phases %standard-phases
634 ;; No standard build procedure is used. We set the correct
635 ;; runtime path in the custom build system.
636 (lambda* (#:key outputs #:allow-other-keys)
637 (let ((out (assoc-ref outputs "out")))
638 ;; Required to find .bci files at runtime.
639 (with-directory-excursion "scmutils"
640 (rename-file "src" "scmutils"))
641 (substitute* "scmutils/scmutils/load.scm"
642 (("/usr/local/scmutils/")
643 (string-append out "/lib/mit-scheme-"
644 ,(system-suffix) "/")))
647 ;; Compile the code and build a band.
648 (lambda* (#:key outputs #:allow-other-keys)
649 (let* ((out (assoc-ref outputs "out"))
650 (make-img (string-append
651 "echo '(load \"load\") "
652 "(disk-save \"edwin-mechanics.com\")'"
654 (with-directory-excursion "scmutils/scmutils"
655 (and (zero? (system "mit-scheme < compile.scm"))
656 (zero? (system make-img)))))))
657 (add-before 'install 'fix-directory-names
658 ;; Correct directory names in the startup script.
659 (lambda* (#:key inputs outputs #:allow-other-keys)
660 (let* ((out (assoc-ref outputs "out"))
661 (scm-root (assoc-ref inputs "mit-scheme")))
662 (substitute* "bin/mechanics"
663 (("ROOT=\"\\$\\{SCMUTILS_ROOT:-/.*\\}\"")
665 "ROOT=\"${SCMUTILS_ROOT:-" scm-root "}\"\n"
666 "LIB=\"${ROOT}/lib/mit-scheme-"
668 out "/lib/mit-scheme-" ,(system-suffix) "\""))
669 (("EDWIN_INFO_DIRECTORY=.*\n") "")
671 (string-append "SCHEME=\"${ROOT}/bin/scheme "
672 "--library ${LIB}\"\n"))
673 (("export EDWIN_INFO_DIRECTORY") ""))
675 (add-before 'install 'emacs-tags
676 ;; Generate Emacs's tags for easy reference to source
678 (lambda* (#:key inputs outputs #:allow-other-keys)
679 (with-directory-excursion "scmutils/scmutils"
680 (zero? (apply system* "etags"
681 (find-files "." "\\.scm"))))))
683 ;; Copy files to the store.
684 (lambda* (#:key outputs #:allow-other-keys)
685 (define* (copy-files-to-directory files dir
686 #:optional (delete? #f))
687 (for-each (lambda (f)
688 (copy-file f (string-append dir "/" f))
689 (when delete? (delete-file f)))
692 (let* ((out (assoc-ref outputs "out"))
693 (bin (string-append out "/bin"))
694 (doc (string-append out "/share/doc/"
696 (lib (string-append out "/lib/mit-scheme-"
699 (for-each mkdir-p (list lib doc bin))
700 (with-directory-excursion "scmutils/scmutils"
701 (copy-files-to-directory '("COPYING" "LICENSE")
703 (for-each delete-file (find-files "." "\\.bin"))
704 (copy-files-to-directory '("edwin-mechanics.com")
705 (string-append lib "/..") #t)
706 (copy-recursively "." lib))
707 (with-directory-excursion "bin"
708 (copy-files-to-directory (find-files ".") bin))
709 (with-directory-excursion "scmutils/manual"
710 (copy-files-to-directory (find-files ".") doc))
712 (add-after 'install 'emacs-helpers
713 ;; Add convenience Emacs commands to easily load the
714 ;; Scmutils band in an MIT-Scheme buffer inside of Emacs
715 ;; and to easily load code tags.
716 (lambda* (#:key inputs outputs #:allow-other-keys)
717 (let* ((out (assoc-ref outputs "out"))
718 (mit-root (assoc-ref inputs "mit-scheme"))
720 (string-append out "/share/emacs/site-lisp"
721 "/guix.d/" ,name "-" ,version))
722 (el-file (string-append emacs-lisp-dir
725 (string-append "/lib/mit-scheme-"
727 (mkdir-p emacs-lisp-dir)
728 (call-with-output-file el-file
732 (defun scmutils-load ()
735 (let ((mit-root \"~a\")
738 (concat mit-root \"/bin/scheme --library \"
739 mit-root \"~a:\" scmutils \"~a\"
740 \" --band edwin-mechanics.com\"
744 (defun scmutils-load-tags ()
746 (let ((scmutils \"~a\"))
747 (visit-tags-table (concat scmutils \"/TAGS\"))))
752 (string-append out lib-relative-path
754 (emacs-generate-autoloads ,name emacs-lisp-dir)
755 (emacs-byte-compile-directory emacs-lisp-dir)
758 "http://groups.csail.mit.edu/mac/users/gjs/6946/linux-install.htm")
759 (synopsis "Scmutils library for MIT Scheme")
760 (description "The Scmutils system is an integrated library of
761 procedures, embedded in the programming language Scheme, and intended to
762 support teaching and research in mathematical physics and electrical
767 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
770 (version (string-append "20170703-1." (string-take commit 7)))
774 (url "https://github.com/sarabander/sicp")
778 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
779 (file-name (string-append name "-" version "-checkout"))))
780 (build-system trivial-build-system)
781 (native-inputs `(("gzip" ,gzip)
783 ("texinfo" ,texinfo)))
785 `(#:modules ((guix build utils)
790 (use-modules (guix build utils)
793 (let ((gzip (assoc-ref %build-inputs "gzip"))
794 (source (assoc-ref %build-inputs "source"))
795 (texinfo (assoc-ref %build-inputs "texinfo"))
796 (html-dir (string-append %output "/share/doc/" ,name "/html"))
797 (info-dir (string-append %output "/share/info")))
798 (copy-recursively (string-append source "/html") html-dir)
799 (setenv "PATH" (string-append gzip "/bin"
803 (system* "makeinfo" "--output"
804 (string-append info-dir "/sicp.info")
805 (string-append source "/sicp-pocket.texi")))
807 (map (cut system* "gzip" "-9n" <>)
808 (find-files info-dir))))))))
809 (home-page "https://sarabander.github.io/sicp")
810 (synopsis "Structure and Interpretation of Computer Programs")
811 (description "Structure and Interpretation of Computer Programs (SICP) is
812 a textbook aiming to teach the principles of computer programming.
814 Using Scheme, a dialect of the Lisp programming language, the book explains
815 core computer science concepts such as abstraction in programming,
816 metalinguistic abstraction, recursion, interpreters, and modular programming.")
817 (license cc-by-sa4.0))))
819 (define-public scheme48-rx
820 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
824 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
829 (url "https://github.com/scheme/rx")
833 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
834 (file-name (string-append name "-" version "-checkout"))))
835 (build-system trivial-build-system)
837 `(#:modules ((guix build utils))
840 (use-modules (guix build utils))
841 (let ((share (string-append %output
843 ,(package-version scheme48)
845 (chdir (assoc-ref %build-inputs "source"))
847 (copy-recursively "." share)))))
850 ("scheme48" ,scheme48)))
851 (home-page "https://github.com/scheme/rx/")
852 (synopsis "SRE String pattern-matching library for scheme48")
854 "String pattern-matching library for scheme48 based on the SRE
855 regular-expression notation.")
864 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
868 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
869 (build-system gnu-build-system)
871 `(#:tests? #f ; There is no check target.
873 (modify-phases %standard-phases
874 (add-after 'install 'remove-bin-share
875 (lambda* (#:key inputs outputs #:allow-other-keys)
876 (delete-file-recursively
877 (string-append (assoc-ref outputs "out") "/bin"))))
879 (lambda* (#:key inputs outputs #:allow-other-keys)
880 (zero? (system* "./configure"
881 (string-append "--prefix="
882 (assoc-ref outputs "out")))))))))
883 (native-inputs `(("unzip" ,unzip)
884 ("texinfo" ,texinfo)))
885 (home-page "http://people.csail.mit.edu/jaffer/SLIB.html")
886 (synopsis "Compatibility and utility library for Scheme")
887 (description "SLIB is a portable Scheme library providing compatibility and
888 utility functions for all standard Scheme implementations.")
889 (license (non-copyleft
890 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
891 "Or see COPYING in the distribution."))))
900 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
904 "050ijb51jm1cij9g3r89zl9rawsrikhbb5y8zb7lspb7bsxq5w99"))))
905 (build-system gnu-build-system)
908 (modify-phases %standard-phases
910 (lambda* (#:key inputs outputs #:allow-other-keys)
911 (zero? (system* "./configure"
912 (string-append "--prefix="
913 (assoc-ref outputs "out"))))))
914 (add-before 'build 'pre-build
915 (lambda* (#:key inputs #:allow-other-keys)
916 (substitute* "Makefile"
917 (("ginstall-info") "install-info"))))
919 (lambda* (#:key inputs outputs #:allow-other-keys)
920 (setenv "SCHEME_LIBRARY_PATH"
921 (string-append (assoc-ref inputs "slib")
924 (zero? (system* "make" "scmlit" "CC=gcc"))
925 (zero? (system* "make" "all")))))
926 (add-after 'install 'post-install
927 (lambda* (#:key inputs outputs #:allow-other-keys)
929 (string-append (assoc-ref outputs "out")
930 "/lib/scm/require.scm")))
933 (format (open req (logior O_WRONLY O_CREAT))
934 "(define (library-vicinity) ~s)\n"
935 (string-append (assoc-ref inputs "slib")
938 ;; We must generate the slibcat file
941 (assoc-ref outputs "out")
943 "-br" "new-catalog")))))))))
944 (inputs `(("slib" ,slib)))
945 (native-inputs `(("unzip" ,unzip)
946 ("texinfo" ,texinfo)))
947 (home-page "http://people.csail.mit.edu/jaffer/SCM")
948 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
949 (description "GNU SCM is an implementation of Scheme. This
950 implementation includes Hobbit, a Scheme-to-C compiler, which can
951 generate C files whose binaries can be dynamically or statically
952 linked with a SCM executable.")