Synchronize package descriptions with the Womb.
[jackhill/guix/guix.git] / gnu / packages / scheme.scm
CommitLineData
e117772d
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of GNU Guix.
5;;;
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.
10;;;
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.
15;;;
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/>.
18
1ffa7090 19(define-module (gnu packages scheme)
59a43334 20 #:use-module (gnu packages)
e117772d
LC
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
1ffa7090
LC
25 #:use-module (gnu packages m4)
26 #:use-module (gnu packages multiprecision)
27 #:use-module (gnu packages emacs)
28 #:use-module (gnu packages texinfo)
d8707db0 29 #:use-module (gnu packages patchelf)
e6e82f62 30 #:use-module (gnu packages which)
cf53ecf5
LC
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages avahi)
33 #:use-module (gnu packages libphidget)
30645251 34 #:use-module (gnu packages glib)
9d3c4dae 35 #:use-module (gnu packages gtk)
30645251
LC
36 #:use-module (gnu packages libffi)
37 #:use-module (gnu packages libjpeg)
e117772d
LC
38 #:use-module (ice-9 match))
39
40(define-public mit-scheme
41 (package
42 (name "mit-scheme")
43 (version "9.1.1")
44 (source #f) ; see below
45 (build-system gnu-build-system)
46 (arguments
47 `(#:tests? #f ; no "check" target
48 #:phases
49 (alist-replace
50 'unpack
51 (lambda* (#:key inputs #:allow-other-keys)
52 (and (zero? (system* "tar" "xzvf"
53 (assoc-ref inputs "source")))
54 (chdir ,(string-append name "-" version))
55 (begin
56 ;; Delete these dangling symlinks since they break
57 ;; `patch-shebangs'.
58 (for-each delete-file
59 (append (find-files "src/lib/lib" "\\.so$")
60 (find-files "src/lib" "^ffi-test")))
61 (chdir "src")
62 #t)))
63 (alist-replace
64 'build
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))))))
72 %standard-phases))))
73 (inputs
74 `(;; TODO: Build doc when TeX Live is available.
75 ;; ("automake" ,automake)
76 ;; ("texlive-core" ,texlive-core)
77 ("texinfo" ,texinfo)
78 ("m4" ,m4)
79
80 ("source"
dd6b9a37
LC
81
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
86 ;; those binaries.
87 ,(origin
88 (method url-fetch)
89 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
90 version "/mit-scheme-"
91 version "-"
92 (match (%current-system)
93 ("x86_64-linux" "x86-64")
94 ("i686-linux" "i386")
95 (_ "c"))
96 ".tar.gz"))
97 (sha256
98 (match (%current-system)
99 ("x86_64-linux"
100 (base32
101 "1wcxm9hyfc53myvlcn93fyqrnnn4scwkknl9hkbp1cphc6mp291x"))
102 ("i686-linux"
103 (base32
104 "0vi760fy550d9db538m0vzbq1mpdncvw9g8bk4lswk0kcdira55z"))
105 (_
106 (base32
107 "0pclakzwxbqgy6wqwvs6ml62wgby8ba8xzmwzdwhx1v8wv05yw1j"))))))))
e117772d 108 (home-page "http://www.gnu.org/software/mit-scheme/")
f50d2669 109 (synopsis "Scheme implementation with integrated editor and debugger")
e117772d
LC
110 (description
111 "MIT/GNU Scheme is an implementation of the Scheme programming
a22dc0c4
LC
112language. It provides an interpreter, a compiler and a debugger. It also
113features an integrated Emacs-like editor and a large runtime library.")
e117772d
LC
114 (license gpl2+)))
115
116(define-public bigloo
117 (package
118 (name "bigloo")
e858326a 119 (version "4.0b")
e117772d
LC
120 (source (origin
121 (method url-fetch)
122 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
123 version ".tar.gz"))
124 (sha256
125 (base32
01eafd38
LC
126 "1fck2h48f0bvh8fl437cagmp0syfxy9lqacy1zwsis20fc76jvzi"))
127 (patches (list (search-patch "bigloo-gc-shebangs.patch")))))
e117772d
LC
128 (build-system gnu-build-system)
129 (arguments
01eafd38 130 `(#:test-target "test"
e117772d
LC
131 #:phases (alist-replace
132 'configure
133 (lambda* (#:key outputs #:allow-other-keys)
134
135 (substitute* "configure"
136 (("^shell=.*$")
137 (string-append "shell=" (which "bash") "\n")))
138
6e1c4093
LC
139 ;; Since libgc's pthread redirects are used, we end up
140 ;; using libgc symbols, so we must link against it.
141 ;; Reported on 2013-06-25.
142 (substitute* "api/pthread/src/Makefile"
143 (("^EXTRALIBS[[:blank:]]*=(.*)$" _ value)
144 (string-append "EXTRALIBS = "
145 (string-trim-right value)
146 " -l$(GCLIB)_fth-$(RELEASE)"
147 " -Wl,-rpath=" (assoc-ref outputs "out")
148 "/lib/bigloo/" ,version)))
149
e117772d 150 ;; Those variables are used by libgc's `configure'.
e858326a
LC
151 (setenv "SHELL" (which "sh"))
152 (setenv "CONFIG_SHELL" (which "sh"))
153
154 ;; ... but they turned out to be overridden later, so work
155 ;; around that.
156 (substitute* (find-files "gc" "^configure-gc")
157 (("sh=/bin/sh")
158 (string-append "sh=" (which "sh"))))
e117772d
LC
159
160 ;; The `configure' script doesn't understand options
161 ;; of those of Autoconf.
162 (let ((out (assoc-ref outputs "out")))
163 (zero?
164 (system* "./configure"
165 (string-append "--prefix=" out)
166 (string-append"--mv=" (which "mv"))
167 (string-append "--rm=" (which "rm"))))))
168 (alist-cons-after
e858326a
LC
169 'install 'install-emacs-modes
170 (lambda* (#:key outputs #:allow-other-keys)
171 (let* ((out (assoc-ref outputs "out"))
172 (dir (string-append out "/share/emacs/site-lisp")))
173 (zero? (system* "make" "-C" "bmacs" "all" "install"
174 (string-append "EMACSBRAND=emacs24")
175 (string-append "EMACSDIR=" dir)))))
176 %standard-phases))))
e117772d 177 (inputs
10879c4e 178 `(("emacs" ,emacs)
cf53ecf5
LC
179
180 ;; Optional APIs for which Bigloo has bindings.
181 ("avahi" ,avahi)
182 ("libphidget" ,libphidget)))
183 (native-inputs
184 `(("pkg-config" ,pkg-config)))
10879c4e
LC
185 (propagated-inputs
186 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
e117772d
LC
187 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
188 (synopsis "Bigloo, an efficient Scheme compiler")
189 (description
190 "Bigloo is a Scheme implementation devoted to one goal: enabling
191Scheme based programming style where C(++) is usually
192required. Bigloo attempts to make Scheme practical by offering
193features usually presented by traditional programming languages
194but not offered by Scheme and functional programming. Bigloo
195compiles Scheme modules. It delivers small and fast stand alone
196binary executables. Bigloo enables full connections between
197Scheme and C programs, between Scheme and Java programs, and
198between Scheme and C# programs.")
199 (license gpl2+)))
e6e82f62
LC
200
201(define-public hop
202 (package
203 (name "hop")
204 (version "2.4.0")
205 (source (origin
206 (method url-fetch)
207 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
208 version ".tar.gz"))
209 (sha256
210 (base32
01eafd38
LC
211 "1v2r4ga58kk1sx0frn8qa8ccmjpic9csqzpk499wc95y9c4b1wy3"))
212 (patches (list (search-patch "hop-bigloo-4.0b.patch")))))
e6e82f62
LC
213 (build-system gnu-build-system)
214 (arguments
d8707db0
LC
215 '(#:phases
216 (alist-replace
217 'configure
218 (lambda* (#:key inputs outputs #:allow-other-keys)
219 (let ((out (assoc-ref outputs "out")))
220 (zero?
221 (system* "./configure"
222 (string-append"--prefix=" out)))))
223 (alist-cons-after
224 'strip 'patch-rpath
225 (lambda* (#:key outputs #:allow-other-keys)
226 ;; Patch the RPATH of every installed library to point to $out/lib
227 ;; instead of $TMPDIR. Note that "patchelf --set-rpath" produces
228 ;; invalid binaries when used before stripping.
229 (let ((out (assoc-ref outputs "out"))
230 (tmpdir (getcwd)))
231 (every (lambda (lib)
232 (let* ((in (open-pipe* OPEN_READ "patchelf"
233 "--print-rpath" lib))
234 (rpath (read-line in)))
235 (and (zero? (close-pipe in))
236 (let ((rpath* (regexp-substitute/global
237 #f (regexp-quote tmpdir) rpath
238 'pre out 'post)))
239 (or (equal? rpath rpath*)
240 (begin
241 (format #t "~a: changing RPATH from `~a' to `~a'~%"
242 lib rpath rpath*)
243 (zero?
244 (system* "patchelf" "--set-rpath"
245 rpath* lib))))))))
246 (append (find-files (string-append out "/bin")
247 ".*")
248 (find-files (string-append out "/lib")
249 "\\.so$")))))
250 %standard-phases))
251 #:tests? #f ; no test suite
252 #:modules ((guix build gnu-build-system)
253 (guix build utils)
254 (ice-9 popen)
255 (ice-9 regex)
256 (ice-9 rdelim)
257 (srfi srfi-1))))
e6e82f62 258 (inputs `(("bigloo" ,bigloo)
d8707db0 259 ("which" ,which)
01eafd38 260 ("patchelf" ,patchelf)))
e6e82f62
LC
261 (home-page "http://hop.inria.fr/")
262 (synopsis "A multi-tier programming language for the Web 2.0")
263 (description
264 "HOP is a multi-tier programming language for the Web 2.0 and the
265so-called diffuse Web. It is designed for programming interactive web
266applications in many fields such as multimedia (web galleries, music players,
267...), ubiquitous and house automation (SmartPhones, personal appliance),
268mashups, office (web agendas, mail clients, ...), etc.")
269 (license gpl2+)))
8cc9e7f9
LC
270
271(define-public chicken
272 (package
273 (name "chicken")
274 (version "4.8.0.3")
275 (source (origin
276 (method url-fetch)
277 (uri (string-append "http://code.call-cc.org/releases/4.8.0/chicken-"
278 version ".tar.gz"))
279 (sha256
280 (base32
281 "1hwrnc2dhgbnz3mlpcb4qvg76kwsfzqylw24gxyy91jmygk1853a"))))
282 (build-system gnu-build-system)
283 (arguments
284 `(#:modules ((guix build gnu-build-system)
285 (guix build utils)
286 (srfi srfi-1))
287
288 ;; No `configure' script; run "make check" after "make install" as
289 ;; prescribed by README.
290 #:phases (alist-cons-after
291 'install 'check
292 (assoc-ref %standard-phases 'check)
293 (fold alist-delete %standard-phases
294 '(configure check)))
295
296 #:make-flags (let ((out (assoc-ref %outputs "out")))
297 (list "PLATFORM=linux"
298 (string-append "PREFIX=" out)
299 (string-append "VARDIR=" out "/var/lib")))
300
301 ;; Parallel builds are not supported, as noted in README.
302 #:parallel-build? #f))
303 (home-page "http://www.call-cc.org/")
304 (synopsis "R5RS Scheme implementation that compiles native code via C")
305 (description
306 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
307produces portable and efficient C, supports almost all of the R5RS Scheme
2c4b49ed 308language standard, and includes many enhancements and extensions.")
8cc9e7f9 309 (license bsd-3)))
f7ce90e7
LC
310
311(define-public scheme48
312 (package
313 (name "scheme48")
314 (version "1.9")
315 (source (origin
316 (method url-fetch)
317 (uri (string-append "http://s48.org/" version
318 "/scheme48-" version ".tgz"))
319 (sha256
320 (base32
01eafd38
LC
321 "0rw2lz5xgld0klvld292ds6hvfk5l12vskzgf1hhwjdpa38r3fnw"))
322 (patches (list (search-patch "scheme48-tests.patch")))))
f7ce90e7 323 (build-system gnu-build-system)
f7ce90e7
LC
324 (home-page "http://s48.org/")
325 (synopsis "Scheme implementation using a bytecode interpreter")
326 (description
327 "Scheme 48 is an implementation of Scheme based on a byte-code
328interpreter and is designed to be used as a testbed for experiments in
329implementation techniques and as an expository tool.")
330
331 ;; Most files are BSD-3; see COPYING for the few exceptions.
332 (license bsd-3)))
30645251
LC
333
334(define-public racket
335 (package
336 (name "racket")
337 (version "5.3.4")
338 (source (origin
339 (method url-fetch)
340 (uri (list (string-append "http://download.racket-lang.org/installers/"
341 version "/racket/racket-" version
342 "-src-unix.tgz")
343 (string-append
344 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
345 version "/racket/racket-" version "-src-unix.tgz")))
346 (sha256
347 ;; XXX: Used to be 1xhnx3yd74zrvn6sfcqmk57kxj51cwvm660dwiaxr1qxnm5lq0v7.
348 (base32 "0yrdmpdvzf092869y6zjjjxl6j2kypgiv7qrfkv7lj8w01pbh7sd"))))
349 (build-system gnu-build-system)
350 (arguments
351 '(#:phases
352 (let* ((gui-libs
353 (lambda (inputs)
9d3c4dae
LC
354 (define (lib input)
355 (string-append (assoc-ref inputs input) "/lib"))
356
357 (list (lib "glib")
358 (lib "cairo")
359 (lib "pango")
360 (lib "libjpeg")
361 (lib "gtk")
362 (lib "gdk-pixbuf")))))
30645251
LC
363 (alist-cons-before
364 'configure 'pre-configure
365 (lambda* (#:key inputs #:allow-other-keys)
366 (chdir "src")
367
368 ;; The GUI libs are dynamically opened through the FFI, so they
369 ;; must be in the loader's search path.
370 (setenv "LD_LIBRARY_PATH" (string-join (gui-libs inputs) ":")))
371 (alist-cons-after
372 'unpack 'patch-/bin/sh
373 (lambda _
374 (substitute* "collects/racket/system.rkt"
375 (("/bin/sh") (which "sh"))))
376 (alist-cons-after
377 'install 'wrap-programs
378 (lambda* (#:key inputs outputs #:allow-other-keys)
379 (let ((out (assoc-ref outputs "out")))
380 (define (wrap prog)
381 (wrap-program prog
382 `("LD_LIBRARY_PATH" ":" prefix
383 ,(gui-libs inputs))))
384
385 (with-directory-excursion (string-append out "/bin")
386 (for-each wrap
387 (list "gracket" "drracket" "slideshow" "mred"))
388 #t)))
389 %standard-phases))))
390 #:tests? #f ; XXX: how to run them?
391 ))
392 (inputs `(("libffi" ,libffi)
393 ("glib" ,glib) ; for DrRacket
394 ("cairo" ,cairo)
395 ("pango" ,pango)
9d3c4dae
LC
396 ("libjpeg" ,libjpeg-8)
397 ("gdk-pixbuf" ,gdk-pixbuf)
afc75310 398 ("gtk" ,gtk+-2)))
30645251
LC
399 (home-page "http://racket-lang.org")
400 (synopsis "Implementation of Scheme and related languages")
401 (description
402 "Racket is an implementation of the Scheme programming language (R5RS and
403R6RS) and related languages, such as Typed Racket. It features a compiler and
404a virtual machine with just-in-time native compilation, as well as a large set
405of libraries.")
406 (license lgpl2.0+)))