1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
20 (define-module (gnu packages scheme)
21 #:use-module (gnu packages)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix utils)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages m4)
28 #:use-module (gnu packages multiprecision)
29 #:use-module (gnu packages databases)
30 #:use-module (gnu packages emacs)
31 #:use-module (gnu packages texinfo)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages avahi)
35 #:use-module (gnu packages libphidget)
36 #:use-module (gnu packages glib)
37 #:use-module (gnu packages gtk)
38 #:use-module (gnu packages libffi)
39 #:use-module (gnu packages fontutils)
40 #:use-module (gnu packages image)
41 #:use-module (gnu packages xorg)
42 #:use-module (ice-9 match))
44 (define (mit-scheme-source-directory system version)
45 (string-append "mit-scheme-"
46 (if (or (string-prefix? "x86_64" system)
47 (string-prefix? "i686" system))
52 (define-public mit-scheme
56 (source #f) ; see below
57 (build-system gnu-build-system)
59 `(#:tests? #f ; no "check" target
63 (lambda* (#:key inputs #:allow-other-keys)
64 (and (zero? (system* "tar" "xzvf"
65 (assoc-ref inputs "source")))
66 (chdir ,(mit-scheme-source-directory (%current-system)
69 ;; Delete these dangling symlinks since they break
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\\.")))
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))))))
89 `(;; TODO: Build doc when TeX Live is available.
90 ;; ("automake" ,automake)
91 ;; ("texlive-core" ,texlive-core)
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
105 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
106 version "/mit-scheme-"
107 (match (%current-system)
109 (string-append version "-x86-64"))
111 (string-append version "-i386"))
113 (string-append "c-" version)))
116 (match (%current-system)
119 "1skzxxhr0iq96bf0j5m7mvf3i4sppfyfa6gpqn34mwgkw1fx8274"))
122 "1fmlpnhf5a75db93phajh4ysbdgrgl72v45lk3kznriprl0a7jc6"))
125 "0w5ib5vsidihb4hb6fma3sp596ykr8izagm57axvgd6lqzwicsjg"))))))))
127 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
128 (supported-systems (delete "mips64el-linux" %supported-systems))
130 (home-page "http://www.gnu.org/software/mit-scheme/")
131 (synopsis "A Scheme implementation with integrated editor and debugger")
133 "GNU/MIT Scheme is an implementation of the Scheme programming
134 language. It provides an interpreter, a compiler and a debugger. It also
135 features an integrated Emacs-like editor and a large runtime library.")
138 (define-public bigloo
144 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
148 "170q7nh08n4v20xl81fxb0xcdxphqqacfa643hsa8i2ar6pki04c"))
149 (patches (list (search-patch "bigloo-gc-shebangs.patch")))))
150 (build-system gnu-build-system)
152 `(#:test-target "test"
153 #:phases (alist-replace
155 (lambda* (#:key outputs #:allow-other-keys)
157 (substitute* "configure"
159 (string-append "shell=" (which "bash") "\n")))
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)))
172 ;; Those variables are used by libgc's `configure'.
173 (setenv "SHELL" (which "sh"))
174 (setenv "CONFIG_SHELL" (which "sh"))
176 ;; ... but they turned out to be overridden later, so work
178 (substitute* (find-files "gc" "^configure-gc")
180 (string-append "sh=" (which "sh"))))
182 ;; The `configure' script doesn't understand options
183 ;; of those of Autoconf.
184 (let ((out (assoc-ref outputs "out")))
186 (system* "./configure"
187 (string-append "--prefix=" out)
188 ;; FIXME: Currently fails, see
189 ;; <http://article.gmane.org/gmane.lisp.scheme.bigloo/6126>.
190 ;; "--customgc=no" ; use our libgc
191 (string-append"--mv=" (which "mv"))
192 (string-append "--rm=" (which "rm"))
193 (string-append "--ldflags=-Wl,-rpath="
194 (assoc-ref outputs "out")
195 "/lib/bigloo/" ,version)))))
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)))))
206 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
208 ;; Optional APIs for which Bigloo has bindings.
210 ("libphidget" ,libphidget)))
212 `(("pkg-config" ,pkg-config)))
214 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
215 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
216 (synopsis "Efficient Scheme compiler")
218 "Bigloo is a Scheme implementation devoted to one goal: enabling
219 Scheme based programming style where C(++) is usually
220 required. Bigloo attempts to make Scheme practical by offering
221 features usually presented by traditional programming languages
222 but not offered by Scheme and functional programming. Bigloo
223 compiles Scheme modules. It delivers small and fast stand alone
224 binary executables. Bigloo enables full connections between
225 Scheme and C programs and between Scheme and Java programs.")
234 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
238 "1v2r4ga58kk1sx0frn8qa8ccmjpic9csqzpk499wc95y9c4b1wy3"))
239 (patches (list (search-patch "hop-bigloo-4.0b.patch")
240 (search-patch "hop-linker-flags.patch")))))
241 (build-system gnu-build-system)
246 (lambda* (#:key outputs #:allow-other-keys)
247 (let ((out (assoc-ref outputs "out")))
249 (system* "./configure"
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")))))
257 #:tests? #f)) ; no test suite
258 (inputs `(("bigloo" ,bigloo)
260 (home-page "http://hop.inria.fr/")
261 (synopsis "Multi-tier programming language for the Web 2.0")
263 "HOP is a multi-tier programming language for the Web 2.0 and the
264 so-called diffuse Web. It is designed for programming interactive web
265 applications in many fields such as multimedia (web galleries, music players,
266 ...), ubiquitous and house automation (SmartPhones, personal appliance),
267 mashups, office (web agendas, mail clients, ...), etc.")
270 (define-public chicken
276 (uri (string-append "http://code.call-cc.org/releases/4.9.0/chicken-"
280 "0598mar1qswfd8hva9nqs88zjn02lzkqd8fzdd21dz1nki1prpq4"))))
281 (build-system gnu-build-system)
283 `(#:modules ((guix build gnu-build-system)
287 ;; No `configure' script; run "make check" after "make install" as
288 ;; prescribed by README.
289 #:phases (alist-cons-after
291 (assoc-ref %standard-phases 'check)
292 (fold alist-delete %standard-phases
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")))
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")
305 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
306 produces portable and efficient C, supports almost all of the R5RS Scheme
307 language standard, and includes many enhancements and extensions.")
310 (define-public scheme48
316 (uri (string-append "http://s48.org/" version
317 "/scheme48-" version ".tgz"))
320 "0rw2lz5xgld0klvld292ds6hvfk5l12vskzgf1hhwjdpa38r3fnw"))
321 (patches (list (search-patch "scheme48-tests.patch")))))
322 (build-system gnu-build-system)
323 (home-page "http://s48.org/")
324 (synopsis "Scheme implementation using a bytecode interpreter")
326 "Scheme 48 is an implementation of Scheme based on a byte-code
327 interpreter and is designed to be used as a testbed for experiments in
328 implementation techniques and as an expository tool.")
330 ;; Most files are BSD-3; see COPYING for the few exceptions.
333 (define-public racket
339 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
340 version "/racket-" version "-src.tgz")
342 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
343 version "/racket/racket-" version "-src-unix.tgz")))
346 "0xfsfdqkngz0xw2lqmc7bsznwx25cw91l9fjhp7abrr05m96j0h9"))))
347 (build-system gnu-build-system)
353 (string-append (assoc-ref inputs input) "/lib"))
362 (lib "sqlite"))))) ;to build the doc
364 'configure 'pre-configure
365 (lambda* (#:key inputs #:allow-other-keys)
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) ":")))
372 'unpack 'patch-/bin/sh
374 (substitute* "collects/racket/system.rkt"
375 (("/bin/sh") (which "sh"))))
377 'install 'wrap-programs
378 (lambda* (#:key inputs outputs #:allow-other-keys)
379 (let ((out (assoc-ref outputs "out")))
382 `("LD_LIBRARY_PATH" ":" prefix
383 ,(gui-libs inputs))))
385 (with-directory-excursion (string-append out "/bin")
387 (list "gracket" "drracket" "slideshow" "mred"))
390 #:tests? #f ; XXX: how to run them?
392 (inputs `(("libffi" ,libffi)
393 ("glib" ,glib) ; for DrRacket
396 ("libjpeg" ,libjpeg-8)
397 ("fontconfig" ,fontconfig)
398 ("gdk-pixbuf" ,gdk-pixbuf)
400 ("sqlite" ,sqlite))) ;needed to build the doc
401 (home-page "http://racket-lang.org")
402 (synopsis "Implementation of Scheme and related languages")
404 "Racket is an implementation of the Scheme programming language (R5RS and
405 R6RS) and related languages, such as Typed Racket. It features a compiler and
406 a virtual machine with just-in-time native compilation, as well as a large set
410 (define-public gambit-c
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)
423 (base32 "0y2pklh4k65yrmxv63ass76xckrk9wqimbdad2gha35v2mi7blhs"))))
424 (build-system gnu-build-system)
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")
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")))
441 (home-page "http://www.iro.umontreal.ca/~gambit/")
442 (synopsis "Efficient Scheme interpreter and compiler")
444 "Gambit consists of two main programs: gsi, the Gambit Scheme
445 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
446 the complete execution and debugging environment. The compiler is the
447 interpreter extended with the capability of generating executable files. The
448 compiler can produce standalone executables or compiled modules which can be
449 loaded at run time. Interpreted code and compiled code can be freely
452 (license (list lgpl2.1+ asl2.0))))
454 (define-public chibi-scheme
456 (name "chibi-scheme")
461 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
464 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
465 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
466 (build-system gnu-build-system)
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")
483 "Chibi-Scheme is a very small library with no external dependencies
484 intended for use as an extension and scripting language in C programs. In
485 addition to support for lightweight VM-based threads, each VM itself runs in
486 an isolated heap allowing multiple VMs to run simultaneously in different OS