gnu: orfm: Update to 0.4.1.
[jackhill/guix/guix.git] / gnu / packages / scheme.scm
CommitLineData
e117772d 1;;; GNU Guix --- Functional package management for GNU
d3206af6 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
07f4aef0 3;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
e117772d
LC
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
1ffa7090 20(define-module (gnu packages scheme)
59a43334 21 #:use-module (gnu packages)
e117772d
LC
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
07f4aef0 25 #:use-module (guix utils)
e117772d 26 #:use-module (guix build-system gnu)
1ffa7090
LC
27 #:use-module (gnu packages m4)
28 #:use-module (gnu packages multiprecision)
d3206af6 29 #:use-module (gnu packages databases)
1ffa7090
LC
30 #:use-module (gnu packages emacs)
31 #:use-module (gnu packages texinfo)
ce0614dd 32 #:use-module (gnu packages base)
cf53ecf5
LC
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages avahi)
35 #:use-module (gnu packages libphidget)
30645251 36 #:use-module (gnu packages glib)
9d3c4dae 37 #:use-module (gnu packages gtk)
30645251 38 #:use-module (gnu packages libffi)
d3206af6 39 #:use-module (gnu packages fontutils)
e55354b8 40 #:use-module (gnu packages image)
bc11c72c 41 #:use-module (gnu packages xorg)
e117772d
LC
42 #:use-module (ice-9 match))
43
a0efb39a 44(define (mit-scheme-source-directory system version)
ecb26c10
AE
45 (string-append "mit-scheme-"
46 (if (or (string-prefix? "x86_64" system)
a0efb39a 47 (string-prefix? "i686" system))
ecb26c10
AE
48 ""
49 "c-")
50 version))
51
e117772d
LC
52(define-public mit-scheme
53 (package
54 (name "mit-scheme")
6c4a2884 55 (version "9.2")
e117772d
LC
56 (source #f) ; see below
57 (build-system gnu-build-system)
58 (arguments
59 `(#:tests? #f ; no "check" target
60 #:phases
61 (alist-replace
62 'unpack
63 (lambda* (#:key inputs #:allow-other-keys)
64 (and (zero? (system* "tar" "xzvf"
65 (assoc-ref inputs "source")))
a0efb39a
LC
66 (chdir ,(mit-scheme-source-directory (%current-system)
67 version))
e117772d
LC
68 (begin
69 ;; Delete these dangling symlinks since they break
70 ;; `patch-shebangs'.
71 (for-each delete-file
68dddcad
AE
72 (append '("src/lib/shim-config.scm")
73 (find-files "src/lib/lib" "\\.so$")
74 (find-files "src/lib" "^liarc-")
75 (find-files "src/compiler" "^make\\.")))
e117772d
LC
76 (chdir "src")
77 #t)))
78 (alist-replace
79 'build
80 (lambda* (#:key system outputs #:allow-other-keys)
81 (let ((out (assoc-ref outputs "out")))
82 (if (or (string-prefix? "x86_64" system)
83 (string-prefix? "i686" system))
84 (zero? (system* "make" "compile-microcode"))
85 (zero? (system* "./etc/make-liarc.sh"
86 (string-append "--prefix=" out))))))
87 %standard-phases))))
88 (inputs
89 `(;; TODO: Build doc when TeX Live is available.
90 ;; ("automake" ,automake)
91 ;; ("texlive-core" ,texlive-core)
92 ("texinfo" ,texinfo)
93 ("m4" ,m4)
bc11c72c 94 ("libx11" ,libx11)
e117772d
LC
95
96 ("source"
dd6b9a37
LC
97
98 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
99 ;; compile from the architecture-specific tarballs, which contain
100 ;; pre-built binaries. It leads to more efficient code than when
101 ;; building the tarball that contains generated C code instead of
102 ;; those binaries.
103 ,(origin
104 (method url-fetch)
105 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
106 version "/mit-scheme-"
dd6b9a37 107 (match (%current-system)
ecb26c10
AE
108 ("x86_64-linux"
109 (string-append version "-x86-64"))
110 ("i686-linux"
111 (string-append version "-i386"))
112 (_
113 (string-append "c-" version)))
dd6b9a37
LC
114 ".tar.gz"))
115 (sha256
116 (match (%current-system)
117 ("x86_64-linux"
118 (base32
6c4a2884 119 "1skzxxhr0iq96bf0j5m7mvf3i4sppfyfa6gpqn34mwgkw1fx8274"))
dd6b9a37
LC
120 ("i686-linux"
121 (base32
6c4a2884 122 "1fmlpnhf5a75db93phajh4ysbdgrgl72v45lk3kznriprl0a7jc6"))
dd6b9a37
LC
123 (_
124 (base32
6c4a2884 125 "0w5ib5vsidihb4hb6fma3sp596ykr8izagm57axvgd6lqzwicsjg"))))))))
75af27f7
LC
126
127 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
7491edaf 128 (supported-systems (delete "mips64el-linux" %supported-systems))
75af27f7 129
e117772d 130 (home-page "http://www.gnu.org/software/mit-scheme/")
a2b63d58 131 (synopsis "A Scheme implementation with integrated editor and debugger")
e117772d 132 (description
79c311b8 133 "GNU/MIT Scheme is an implementation of the Scheme programming
a22dc0c4
LC
134language. It provides an interpreter, a compiler and a debugger. It also
135features an integrated Emacs-like editor and a large runtime library.")
e117772d
LC
136 (license gpl2+)))
137
138(define-public bigloo
139 (package
140 (name "bigloo")
7fe492e8 141 (version "4.1a")
e117772d
LC
142 (source (origin
143 (method url-fetch)
144 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
145 version ".tar.gz"))
146 (sha256
147 (base32
7fe492e8 148 "170q7nh08n4v20xl81fxb0xcdxphqqacfa643hsa8i2ar6pki04c"))
01eafd38 149 (patches (list (search-patch "bigloo-gc-shebangs.patch")))))
e117772d
LC
150 (build-system gnu-build-system)
151 (arguments
01eafd38 152 `(#:test-target "test"
e117772d
LC
153 #:phases (alist-replace
154 'configure
155 (lambda* (#:key outputs #:allow-other-keys)
156
157 (substitute* "configure"
158 (("^shell=.*$")
159 (string-append "shell=" (which "bash") "\n")))
160
6e1c4093
LC
161 ;; Since libgc's pthread redirects are used, we end up
162 ;; using libgc symbols, so we must link against it.
163 ;; Reported on 2013-06-25.
164 (substitute* "api/pthread/src/Makefile"
165 (("^EXTRALIBS[[:blank:]]*=(.*)$" _ value)
166 (string-append "EXTRALIBS = "
167 (string-trim-right value)
168 " -l$(GCLIB)_fth-$(RELEASE)"
169 " -Wl,-rpath=" (assoc-ref outputs "out")
170 "/lib/bigloo/" ,version)))
171
e117772d 172 ;; Those variables are used by libgc's `configure'.
e858326a
LC
173 (setenv "SHELL" (which "sh"))
174 (setenv "CONFIG_SHELL" (which "sh"))
175
176 ;; ... but they turned out to be overridden later, so work
177 ;; around that.
178 (substitute* (find-files "gc" "^configure-gc")
179 (("sh=/bin/sh")
180 (string-append "sh=" (which "sh"))))
e117772d
LC
181
182 ;; The `configure' script doesn't understand options
183 ;; of those of Autoconf.
184 (let ((out (assoc-ref outputs "out")))
185 (zero?
186 (system* "./configure"
187 (string-append "--prefix=" out)
7fe492e8
LC
188 ;; FIXME: Currently fails, see
189 ;; <http://article.gmane.org/gmane.lisp.scheme.bigloo/6126>.
190 ;; "--customgc=no" ; use our libgc
e117772d 191 (string-append"--mv=" (which "mv"))
f0ad3c76
LC
192 (string-append "--rm=" (which "rm"))
193 (string-append "--ldflags=-Wl,-rpath="
194 (assoc-ref outputs "out")
195 "/lib/bigloo/" ,version)))))
e117772d 196 (alist-cons-after
e858326a
LC
197 'install 'install-emacs-modes
198 (lambda* (#:key outputs #:allow-other-keys)
199 (let* ((out (assoc-ref outputs "out"))
200 (dir (string-append out "/share/emacs/site-lisp")))
201 (zero? (system* "make" "-C" "bmacs" "all" "install"
202 (string-append "EMACSBRAND=emacs24")
203 (string-append "EMACSDIR=" dir)))))
204 %standard-phases))))
e117772d 205 (inputs
69383a47 206 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
cf53ecf5
LC
207
208 ;; Optional APIs for which Bigloo has bindings.
209 ("avahi" ,avahi)
210 ("libphidget" ,libphidget)))
211 (native-inputs
212 `(("pkg-config" ,pkg-config)))
10879c4e
LC
213 (propagated-inputs
214 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
e117772d 215 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
35b9e423 216 (synopsis "Efficient Scheme compiler")
e117772d
LC
217 (description
218 "Bigloo is a Scheme implementation devoted to one goal: enabling
219Scheme based programming style where C(++) is usually
220required. Bigloo attempts to make Scheme practical by offering
221features usually presented by traditional programming languages
222but not offered by Scheme and functional programming. Bigloo
223compiles Scheme modules. It delivers small and fast stand alone
224binary executables. Bigloo enables full connections between
14e72a18 225Scheme and C programs and between Scheme and Java programs.")
e117772d 226 (license gpl2+)))
e6e82f62
LC
227
228(define-public hop
229 (package
230 (name "hop")
231 (version "2.4.0")
232 (source (origin
233 (method url-fetch)
234 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
235 version ".tar.gz"))
236 (sha256
237 (base32
01eafd38 238 "1v2r4ga58kk1sx0frn8qa8ccmjpic9csqzpk499wc95y9c4b1wy3"))
76071c70
EB
239 (patches (list (search-patch "hop-bigloo-4.0b.patch")
240 (search-patch "hop-linker-flags.patch")))))
e6e82f62
LC
241 (build-system gnu-build-system)
242 (arguments
8a629613 243 `(#:phases
d8707db0
LC
244 (alist-replace
245 'configure
76071c70 246 (lambda* (#:key outputs #:allow-other-keys)
d8707db0
LC
247 (let ((out (assoc-ref outputs "out")))
248 (zero?
249 (system* "./configure"
76071c70
EB
250 (string-append "--prefix=" out)
251 (string-append "--blflags="
252 ;; user flags completely override useful
253 ;; default flags, so repeat them here.
254 "-copt \\$(CPICFLAGS) -L\\$(BUILDLIBDIR) "
255 "-ldopt -Wl,-rpath," out "/lib")))))
256 %standard-phases)
257 #:tests? #f)) ; no test suite
e6e82f62 258 (inputs `(("bigloo" ,bigloo)
8a629613 259 ("which" ,which)))
e6e82f62 260 (home-page "http://hop.inria.fr/")
9e771e3b 261 (synopsis "Multi-tier programming language for the Web 2.0")
e6e82f62
LC
262 (description
263 "HOP is a multi-tier programming language for the Web 2.0 and the
264so-called diffuse Web. It is designed for programming interactive web
265applications in many fields such as multimedia (web galleries, music players,
266...), ubiquitous and house automation (SmartPhones, personal appliance),
267mashups, office (web agendas, mail clients, ...), etc.")
268 (license gpl2+)))
8cc9e7f9
LC
269
270(define-public chicken
271 (package
272 (name "chicken")
c43065a8 273 (version "4.9.0.1")
8cc9e7f9
LC
274 (source (origin
275 (method url-fetch)
c43065a8 276 (uri (string-append "http://code.call-cc.org/releases/4.9.0/chicken-"
8cc9e7f9
LC
277 version ".tar.gz"))
278 (sha256
279 (base32
c43065a8 280 "0598mar1qswfd8hva9nqs88zjn02lzkqd8fzdd21dz1nki1prpq4"))))
8cc9e7f9
LC
281 (build-system gnu-build-system)
282 (arguments
283 `(#:modules ((guix build gnu-build-system)
284 (guix build utils)
285 (srfi srfi-1))
286
287 ;; No `configure' script; run "make check" after "make install" as
288 ;; prescribed by README.
289 #:phases (alist-cons-after
290 'install 'check
291 (assoc-ref %standard-phases 'check)
292 (fold alist-delete %standard-phases
293 '(configure check)))
294
295 #:make-flags (let ((out (assoc-ref %outputs "out")))
296 (list "PLATFORM=linux"
297 (string-append "PREFIX=" out)
298 (string-append "VARDIR=" out "/var/lib")))
299
300 ;; Parallel builds are not supported, as noted in README.
301 #:parallel-build? #f))
302 (home-page "http://www.call-cc.org/")
303 (synopsis "R5RS Scheme implementation that compiles native code via C")
304 (description
305 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
306produces portable and efficient C, supports almost all of the R5RS Scheme
2c4b49ed 307language standard, and includes many enhancements and extensions.")
8cc9e7f9 308 (license bsd-3)))
f7ce90e7
LC
309
310(define-public scheme48
311 (package
312 (name "scheme48")
313 (version "1.9")
314 (source (origin
315 (method url-fetch)
316 (uri (string-append "http://s48.org/" version
317 "/scheme48-" version ".tgz"))
318 (sha256
319 (base32
01eafd38
LC
320 "0rw2lz5xgld0klvld292ds6hvfk5l12vskzgf1hhwjdpa38r3fnw"))
321 (patches (list (search-patch "scheme48-tests.patch")))))
f7ce90e7 322 (build-system gnu-build-system)
f7ce90e7
LC
323 (home-page "http://s48.org/")
324 (synopsis "Scheme implementation using a bytecode interpreter")
325 (description
326 "Scheme 48 is an implementation of Scheme based on a byte-code
327interpreter and is designed to be used as a testbed for experiments in
328implementation techniques and as an expository tool.")
329
330 ;; Most files are BSD-3; see COPYING for the few exceptions.
331 (license bsd-3)))
30645251
LC
332
333(define-public racket
334 (package
335 (name "racket")
d3206af6 336 (version "6.1.1")
30645251
LC
337 (source (origin
338 (method url-fetch)
d3206af6
LC
339 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
340 version "/racket-" version "-src.tgz")
30645251
LC
341 (string-append
342 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
343 version "/racket/racket-" version "-src-unix.tgz")))
344 (sha256
d3206af6
LC
345 (base32
346 "0xfsfdqkngz0xw2lqmc7bsznwx25cw91l9fjhp7abrr05m96j0h9"))))
30645251
LC
347 (build-system gnu-build-system)
348 (arguments
349 '(#:phases
350 (let* ((gui-libs
351 (lambda (inputs)
9d3c4dae
LC
352 (define (lib input)
353 (string-append (assoc-ref inputs input) "/lib"))
354
355 (list (lib "glib")
356 (lib "cairo")
357 (lib "pango")
358 (lib "libjpeg")
359 (lib "gtk")
d3206af6
LC
360 (lib "gdk-pixbuf")
361 (lib "fontconfig")
362 (lib "sqlite"))))) ;to build the doc
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 396 ("libjpeg" ,libjpeg-8)
d3206af6 397 ("fontconfig" ,fontconfig)
9d3c4dae 398 ("gdk-pixbuf" ,gdk-pixbuf)
d3206af6
LC
399 ("gtk" ,gtk+-2)
400 ("sqlite" ,sqlite))) ;needed to build the doc
30645251
LC
401 (home-page "http://racket-lang.org")
402 (synopsis "Implementation of Scheme and related languages")
403 (description
404 "Racket is an implementation of the Scheme programming language (R5RS and
405R6RS) and related languages, such as Typed Racket. It features a compiler and
406a virtual machine with just-in-time native compilation, as well as a large set
407of libraries.")
39d0ce93 408 (license lgpl2.0+)))
07f4aef0
TUBK
409
410(define-public gambit-c
411 (package
412 (name "gambit-c")
413 (version "4.7.4")
414 (source
415 (origin
416 (method url-fetch)
417 (uri (string-append
418 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
419 (version-major+minor version) "/source/gambc-v"
420 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
421 ".tgz"))
422 (sha256
423 (base32 "0y2pklh4k65yrmxv63ass76xckrk9wqimbdad2gha35v2mi7blhs"))))
424 (build-system gnu-build-system)
425 (arguments
426 '(#:configure-flags
427 ;; According to the ./configure script, this makes the build slower and
428 ;; use >= 1 GB memory, but makes Gambit much faster.
429 '("--enable-single-host")
430 #:phases
431 (alist-cons-before
432 'check 'fix-tests
433 (lambda _
434 (substitute* '("tests/makefile")
435 ;; '-:' is how run-time options are set. 'tl' sets some terminal
436 ;; option, which makes it fail in our build environment. It
437 ;; recommends using 'd-' as a solution, which sets the REPL
438 ;; interaction channel to stdin/stdout.
439 (("gsi -:tl") "gsi -:d-,tl")))
440 %standard-phases)))
441 (home-page "http://www.iro.umontreal.ca/~gambit/")
442 (synopsis "Efficient Scheme interpreter and compiler")
443 (description
444 "Gambit consists of two main programs: gsi, the Gambit Scheme
445interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
446the complete execution and debugging environment. The compiler is the
447interpreter extended with the capability of generating executable files. The
448compiler can produce standalone executables or compiled modules which can be
449loaded at run time. Interpreted code and compiled code can be freely
450mixed.")
451 ;; Dual license.
452 (license (list lgpl2.1+ asl2.0))))
3e92f4f9
TUBK
453
454(define-public chibi-scheme
455 (package
456 (name "chibi-scheme")
51960939 457 (version "0.7.3")
3e92f4f9
TUBK
458 (source
459 (origin
460 (method url-fetch)
51960939
TUBK
461 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
462 version ".tar.gz"))
3e92f4f9 463 (sha256
51960939
TUBK
464 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
465 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
3e92f4f9
TUBK
466 (build-system gnu-build-system)
467 (arguments
468 `(#:phases
469 (alist-delete
470 'configure
471 (alist-cons-before
472 'build 'set-cc
473 (lambda _
474 (setenv "CC" "gcc"))
475 %standard-phases))
476 #:make-flags (let ((out (assoc-ref %outputs "out")))
477 (list (string-append "PREFIX=" out)
478 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
479 #:test-target "test"))
480 (home-page "https://code.google.com/p/chibi-scheme/")
481 (synopsis "Small embeddable Scheme implementation")
482 (description
483 "Chibi-Scheme is a very small library with no external dependencies
484intended for use as an extension and scripting language in C programs. In
485addition to support for lightweight VM-based threads, each VM itself runs in
486an isolated heap allowing multiple VMs to run simultaneously in different OS
487threads.")
488 (license bsd-3)))