1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages scheme)
20 #:use-module (gnu packages)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages m4)
26 #:use-module (gnu packages multiprecision)
27 #:use-module (gnu packages emacs)
28 #:use-module (gnu packages texinfo)
29 #:use-module (gnu packages patchelf)
30 #:use-module (gnu packages which)
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages avahi)
33 #:use-module (gnu packages libphidget)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages gtk)
36 #:use-module (gnu packages libffi)
37 #:use-module (gnu packages libjpeg)
38 #:use-module (ice-9 match))
40 (define-public mit-scheme
44 (source #f) ; see below
45 (build-system gnu-build-system)
47 `(#:tests? #f ; no "check" target
51 (lambda* (#:key inputs #:allow-other-keys)
52 (and (zero? (system* "tar" "xzvf"
53 (assoc-ref inputs "source")))
54 (chdir ,(string-append name "-" version))
56 ;; Delete these dangling symlinks since they break
59 (append (find-files "src/lib/lib" "\\.so$")
60 (find-files "src/lib" "^ffi-test")))
65 (lambda* (#:key system outputs #:allow-other-keys)
66 (let ((out (assoc-ref outputs "out")))
67 (if (or (string-prefix? "x86_64" system)
68 (string-prefix? "i686" system))
69 (zero? (system* "make" "compile-microcode"))
70 (zero? (system* "./etc/make-liarc.sh"
71 (string-append "--prefix=" out))))))
74 `(;; TODO: Build doc when TeX Live is available.
75 ;; ("automake" ,automake)
76 ;; ("texlive-core" ,texlive-core)
82 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
83 ;; compile from the architecture-specific tarballs, which contain
84 ;; pre-built binaries. It leads to more efficient code than when
85 ;; building the tarball that contains generated C code instead of
89 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
90 version "/mit-scheme-"
92 (match (%current-system)
93 ("x86_64-linux" "x86-64")
98 (match (%current-system)
101 "1wcxm9hyfc53myvlcn93fyqrnnn4scwkknl9hkbp1cphc6mp291x"))
104 "0vi760fy550d9db538m0vzbq1mpdncvw9g8bk4lswk0kcdira55z"))
107 "0pclakzwxbqgy6wqwvs6ml62wgby8ba8xzmwzdwhx1v8wv05yw1j"))))))))
108 (home-page "http://www.gnu.org/software/mit-scheme/")
109 (synopsis "Scheme implementation with integrated editor and debugger")
111 "MIT/GNU Scheme is an implementation of the Scheme programming
112 language, providing an interpreter, compiler, source-code debugger,
113 integrated Emacs-like editor, and a large runtime library. MIT/GNU
114 Scheme is best suited to programming large applications with a rapid
118 (define-public bigloo
124 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
128 "1fck2h48f0bvh8fl437cagmp0syfxy9lqacy1zwsis20fc76jvzi"))))
129 (build-system gnu-build-system)
131 `(#:patches (list (assoc-ref %build-inputs "patch/shebangs"))
133 #:phases (alist-replace
135 (lambda* (#:key outputs #:allow-other-keys)
137 (substitute* "configure"
139 (string-append "shell=" (which "bash") "\n")))
141 ;; Since libgc's pthread redirects are used, we end up
142 ;; using libgc symbols, so we must link against it.
143 ;; Reported on 2013-06-25.
144 (substitute* "api/pthread/src/Makefile"
145 (("^EXTRALIBS[[:blank:]]*=(.*)$" _ value)
146 (string-append "EXTRALIBS = "
147 (string-trim-right value)
148 " -l$(GCLIB)_fth-$(RELEASE)"
149 " -Wl,-rpath=" (assoc-ref outputs "out")
150 "/lib/bigloo/" ,version)))
152 ;; Those variables are used by libgc's `configure'.
153 (setenv "SHELL" (which "sh"))
154 (setenv "CONFIG_SHELL" (which "sh"))
156 ;; ... but they turned out to be overridden later, so work
158 (substitute* (find-files "gc" "^configure-gc")
160 (string-append "sh=" (which "sh"))))
162 ;; The `configure' script doesn't understand options
163 ;; of those of Autoconf.
164 (let ((out (assoc-ref outputs "out")))
166 (system* "./configure"
167 (string-append "--prefix=" out)
168 (string-append"--mv=" (which "mv"))
169 (string-append "--rm=" (which "rm"))))))
171 'install 'install-emacs-modes
172 (lambda* (#:key outputs #:allow-other-keys)
173 (let* ((out (assoc-ref outputs "out"))
174 (dir (string-append out "/share/emacs/site-lisp")))
175 (zero? (system* "make" "-C" "bmacs" "all" "install"
176 (string-append "EMACSBRAND=emacs24")
177 (string-append "EMACSDIR=" dir)))))
181 ("patch/shebangs" ,(search-patch "bigloo-gc-shebangs.patch"))
183 ;; Optional APIs for which Bigloo has bindings.
185 ("libphidget" ,libphidget)))
187 `(("pkg-config" ,pkg-config)))
189 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
190 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
191 (synopsis "Bigloo, an efficient Scheme compiler")
193 "Bigloo is a Scheme implementation devoted to one goal: enabling
194 Scheme based programming style where C(++) is usually
195 required. Bigloo attempts to make Scheme practical by offering
196 features usually presented by traditional programming languages
197 but not offered by Scheme and functional programming. Bigloo
198 compiles Scheme modules. It delivers small and fast stand alone
199 binary executables. Bigloo enables full connections between
200 Scheme and C programs, between Scheme and Java programs, and
201 between Scheme and C# programs.")
210 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
214 "1v2r4ga58kk1sx0frn8qa8ccmjpic9csqzpk499wc95y9c4b1wy3"))))
215 (build-system gnu-build-system)
220 (lambda* (#:key inputs outputs #:allow-other-keys)
221 (let ((out (assoc-ref outputs "out")))
223 (system* "./configure"
224 (string-append"--prefix=" out)))))
227 (lambda* (#:key outputs #:allow-other-keys)
228 ;; Patch the RPATH of every installed library to point to $out/lib
229 ;; instead of $TMPDIR. Note that "patchelf --set-rpath" produces
230 ;; invalid binaries when used before stripping.
231 (let ((out (assoc-ref outputs "out"))
234 (let* ((in (open-pipe* OPEN_READ "patchelf"
235 "--print-rpath" lib))
236 (rpath (read-line in)))
237 (and (zero? (close-pipe in))
238 (let ((rpath* (regexp-substitute/global
239 #f (regexp-quote tmpdir) rpath
241 (or (equal? rpath rpath*)
243 (format #t "~a: changing RPATH from `~a' to `~a'~%"
246 (system* "patchelf" "--set-rpath"
248 (append (find-files (string-append out "/bin")
250 (find-files (string-append out "/lib")
253 #:tests? #f ; no test suite
254 #:patches (list (assoc-ref %build-inputs "patch/bigloo-4.0b"))
255 #:modules ((guix build gnu-build-system)
261 (inputs `(("bigloo" ,bigloo)
263 ("patchelf" ,patchelf)
266 ,(search-patch "hop-bigloo-4.0b.patch"))))
267 (home-page "http://hop.inria.fr/")
268 (synopsis "A multi-tier programming language for the Web 2.0")
270 "HOP is a multi-tier programming language for the Web 2.0 and the
271 so-called diffuse Web. It is designed for programming interactive web
272 applications in many fields such as multimedia (web galleries, music players,
273 ...), ubiquitous and house automation (SmartPhones, personal appliance),
274 mashups, office (web agendas, mail clients, ...), etc.")
277 (define-public chicken
283 (uri (string-append "http://code.call-cc.org/releases/4.8.0/chicken-"
287 "1hwrnc2dhgbnz3mlpcb4qvg76kwsfzqylw24gxyy91jmygk1853a"))))
288 (build-system gnu-build-system)
290 `(#:modules ((guix build gnu-build-system)
294 ;; No `configure' script; run "make check" after "make install" as
295 ;; prescribed by README.
296 #:phases (alist-cons-after
298 (assoc-ref %standard-phases 'check)
299 (fold alist-delete %standard-phases
302 #:make-flags (let ((out (assoc-ref %outputs "out")))
303 (list "PLATFORM=linux"
304 (string-append "PREFIX=" out)
305 (string-append "VARDIR=" out "/var/lib")))
307 ;; Parallel builds are not supported, as noted in README.
308 #:parallel-build? #f))
309 (home-page "http://www.call-cc.org/")
310 (synopsis "R5RS Scheme implementation that compiles native code via C")
312 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
313 produces portable and efficient C, supports almost all of the R5RS Scheme
314 language standard, and includes many enhancements and extensions.")
317 (define-public scheme48
323 (uri (string-append "http://s48.org/" version
324 "/scheme48-" version ".tgz"))
327 "0rw2lz5xgld0klvld292ds6hvfk5l12vskzgf1hhwjdpa38r3fnw"))))
328 (build-system gnu-build-system)
329 (arguments `(#:patches (list (assoc-ref %build-inputs "patch/tests"))))
330 (inputs `(("patch/tests" ,(search-patch "scheme48-tests.patch"))))
331 (home-page "http://s48.org/")
332 (synopsis "Scheme implementation using a bytecode interpreter")
334 "Scheme 48 is an implementation of Scheme based on a byte-code
335 interpreter and is designed to be used as a testbed for experiments in
336 implementation techniques and as an expository tool.")
338 ;; Most files are BSD-3; see COPYING for the few exceptions.
341 (define-public racket
347 (uri (list (string-append "http://download.racket-lang.org/installers/"
348 version "/racket/racket-" version
351 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
352 version "/racket/racket-" version "-src-unix.tgz")))
354 ;; XXX: Used to be 1xhnx3yd74zrvn6sfcqmk57kxj51cwvm660dwiaxr1qxnm5lq0v7.
355 (base32 "0yrdmpdvzf092869y6zjjjxl6j2kypgiv7qrfkv7lj8w01pbh7sd"))))
356 (build-system gnu-build-system)
362 (string-append (assoc-ref inputs input) "/lib"))
369 (lib "gdk-pixbuf")))))
371 'configure 'pre-configure
372 (lambda* (#:key inputs #:allow-other-keys)
375 ;; The GUI libs are dynamically opened through the FFI, so they
376 ;; must be in the loader's search path.
377 (setenv "LD_LIBRARY_PATH" (string-join (gui-libs inputs) ":")))
379 'unpack 'patch-/bin/sh
381 (substitute* "collects/racket/system.rkt"
382 (("/bin/sh") (which "sh"))))
384 'install 'wrap-programs
385 (lambda* (#:key inputs outputs #:allow-other-keys)
386 (let ((out (assoc-ref outputs "out")))
389 `("LD_LIBRARY_PATH" ":" prefix
390 ,(gui-libs inputs))))
392 (with-directory-excursion (string-append out "/bin")
394 (list "gracket" "drracket" "slideshow" "mred"))
397 #:tests? #f ; XXX: how to run them?
399 (inputs `(("libffi" ,libffi)
400 ("glib" ,glib) ; for DrRacket
403 ("libjpeg" ,libjpeg-8)
404 ("gdk-pixbuf" ,gdk-pixbuf)
406 (home-page "http://racket-lang.org")
407 (synopsis "Implementation of Scheme and related languages")
409 "Racket is an implementation of the Scheme programming language (R5RS and
410 R6RS) and related languages, such as Typed Racket. It features a compiler and
411 a virtual machine with just-in-time native compilation, as well as a large set