gnu: chez-scheme: Move to new module.
[jackhill/guix/guix.git] / gnu / packages / scheme.scm
CommitLineData
e117772d 1;;; GNU Guix --- Functional package management for GNU
63e8bb12 2;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
07f4aef0 3;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
549f9512 4;;; Copyright © 2015, 2016 Federico Beffa <beffa@fbengineering.ch>
d0d94110 5;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
5c4d98ab 6;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
b9b447be 7;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
c2c84add 8;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
e117772d
LC
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
1ffa7090 25(define-module (gnu packages scheme)
59a43334 26 #:use-module (gnu packages)
bc73a843
LC
27 #:use-module ((guix licenses)
28 #:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3
29 cc-by-sa4.0))
e117772d
LC
30 #:use-module (guix packages)
31 #:use-module (guix download)
b9b447be 32 #:use-module (guix git-download)
07f4aef0 33 #:use-module (guix utils)
e117772d 34 #:use-module (guix build-system gnu)
b9b447be 35 #:use-module (guix build-system trivial)
549f9512 36 #:use-module (gnu packages compression)
1ffa7090
LC
37 #:use-module (gnu packages m4)
38 #:use-module (gnu packages multiprecision)
549f9512 39 #:use-module (gnu packages ncurses)
d3206af6 40 #:use-module (gnu packages databases)
1ffa7090 41 #:use-module (gnu packages emacs)
549f9512
FB
42 #:use-module (gnu packages ghostscript)
43 #:use-module (gnu packages netpbm)
1ffa7090 44 #:use-module (gnu packages texinfo)
8f9ac901 45 #:use-module (gnu packages tex)
ce0614dd 46 #:use-module (gnu packages base)
b9b447be 47 #:use-module (gnu packages compression)
cf53ecf5
LC
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages avahi)
50 #:use-module (gnu packages libphidget)
ffc13e75 51 #:use-module (gnu packages gcc)
30645251 52 #:use-module (gnu packages glib)
9d3c4dae 53 #:use-module (gnu packages gtk)
30645251 54 #:use-module (gnu packages libffi)
d3206af6 55 #:use-module (gnu packages fontutils)
e55354b8 56 #:use-module (gnu packages image)
bc11c72c 57 #:use-module (gnu packages xorg)
782170c4
SB
58 #:use-module (gnu packages tls)
59 #:use-module (gnu packages gl)
e117772d
LC
60 #:use-module (ice-9 match))
61
a0efb39a 62(define (mit-scheme-source-directory system version)
ecb26c10
AE
63 (string-append "mit-scheme-"
64 (if (or (string-prefix? "x86_64" system)
a0efb39a 65 (string-prefix? "i686" system))
ecb26c10
AE
66 ""
67 "c-")
68 version))
69
e117772d
LC
70(define-public mit-scheme
71 (package
72 (name "mit-scheme")
6c4a2884 73 (version "9.2")
e117772d 74 (source #f) ; see below
f163c290 75 (outputs '("out" "doc"))
e117772d
LC
76 (build-system gnu-build-system)
77 (arguments
78 `(#:tests? #f ; no "check" target
f163c290
FB
79 #:modules ((guix build gnu-build-system)
80 (guix build utils)
81 (srfi srfi-1))
e117772d 82 #:phases
af00e633
FB
83 (modify-phases %standard-phases
84 (replace 'unpack
85 (lambda* (#:key inputs #:allow-other-keys)
86 (and (zero? (system* "tar" "xzvf"
87 (assoc-ref inputs "source")))
88 (chdir ,(mit-scheme-source-directory (%current-system)
89 version))
90 (begin
91 ;; Delete these dangling symlinks since they break
92 ;; `patch-shebangs'.
93 (for-each delete-file
94 (append '("src/lib/shim-config.scm")
95 (find-files "src/lib/lib" "\\.so$")
96 (find-files "src/lib" "^liarc-")
97 (find-files "src/compiler" "^make\\.")))
98 (chdir "src")
99 #t))))
100 (replace 'build
101 (lambda* (#:key system outputs #:allow-other-keys)
102 (let ((out (assoc-ref outputs "out")))
103 (if (or (string-prefix? "x86_64" system)
104 (string-prefix? "i686" system))
105 (zero? (system* "make" "compile-microcode"))
106 (zero? (system* "./etc/make-liarc.sh"
f163c290
FB
107 (string-append "--prefix=" out)))))))
108 (add-after 'configure 'configure-doc
109 (lambda* (#:key outputs inputs #:allow-other-keys)
110 (with-directory-excursion "../doc"
111 (let* ((out (assoc-ref outputs "out"))
112 (bash (assoc-ref inputs "bash"))
113 (bin/sh (string-append bash "/bin/sh")))
114 (system* bin/sh "./configure"
115 (string-append "--prefix=" out)
116 (string-append "SHELL=" bin/sh))
117 (substitute* '("Makefile" "make-common")
118 (("/lib/mit-scheme/doc")
119 (string-append "/share/doc/" ,name "-" ,version)))
120 #t))))
121 (add-after 'build 'build-doc
122 (lambda* _
123 (with-directory-excursion "../doc"
124 (zero? (system* "make")))))
125 (add-after 'install 'install-doc
126 (lambda* (#:key outputs #:allow-other-keys)
127 (let* ((out (assoc-ref outputs "out"))
128 (doc (assoc-ref outputs "doc"))
129 (old-doc-dir (string-append out "/share/doc"))
130 (new-doc/mit-scheme-dir
131 (string-append doc "/share/doc/" ,name "-" ,version)))
132 (with-directory-excursion "../doc"
133 (for-each (lambda (target)
134 (system* "make" target))
135 '("install-config" "install-info-gz" "install-man"
136 "install-html" "install-pdf")))
137 (mkdir-p new-doc/mit-scheme-dir)
138 (copy-recursively
139 (string-append old-doc-dir "/" ,name "-" ,version)
140 new-doc/mit-scheme-dir)
141 (delete-file-recursively old-doc-dir)
142 #t))))))
143 (native-inputs
144 `(("texlive" ,texlive)
145 ("texinfo" ,texinfo)
146 ("m4" ,m4)))
e117772d 147 (inputs
f163c290 148 `(("libx11" ,libx11)
e117772d
LC
149
150 ("source"
dd6b9a37
LC
151
152 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
153 ;; compile from the architecture-specific tarballs, which contain
154 ;; pre-built binaries. It leads to more efficient code than when
155 ;; building the tarball that contains generated C code instead of
156 ;; those binaries.
157 ,(origin
158 (method url-fetch)
159 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
160 version "/mit-scheme-"
dd6b9a37 161 (match (%current-system)
ecb26c10
AE
162 ("x86_64-linux"
163 (string-append version "-x86-64"))
164 ("i686-linux"
165 (string-append version "-i386"))
166 (_
167 (string-append "c-" version)))
dd6b9a37
LC
168 ".tar.gz"))
169 (sha256
170 (match (%current-system)
171 ("x86_64-linux"
172 (base32
6c4a2884 173 "1skzxxhr0iq96bf0j5m7mvf3i4sppfyfa6gpqn34mwgkw1fx8274"))
dd6b9a37
LC
174 ("i686-linux"
175 (base32
6c4a2884 176 "1fmlpnhf5a75db93phajh4ysbdgrgl72v45lk3kznriprl0a7jc6"))
dd6b9a37
LC
177 (_
178 (base32
6c4a2884 179 "0w5ib5vsidihb4hb6fma3sp596ykr8izagm57axvgd6lqzwicsjg"))))))))
75af27f7
LC
180
181 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
7491edaf 182 (supported-systems (delete "mips64el-linux" %supported-systems))
75af27f7 183
e117772d 184 (home-page "http://www.gnu.org/software/mit-scheme/")
a2b63d58 185 (synopsis "A Scheme implementation with integrated editor and debugger")
e117772d 186 (description
79c311b8 187 "GNU/MIT Scheme is an implementation of the Scheme programming
a22dc0c4
LC
188language. It provides an interpreter, a compiler and a debugger. It also
189features an integrated Emacs-like editor and a large runtime library.")
63e8bb12
LC
190 (license gpl2+)
191 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
e117772d
LC
192
193(define-public bigloo
194 (package
195 (name "bigloo")
7fe492e8 196 (version "4.1a")
e117772d
LC
197 (source (origin
198 (method url-fetch)
199 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
200 version ".tar.gz"))
201 (sha256
202 (base32
7fe492e8 203 "170q7nh08n4v20xl81fxb0xcdxphqqacfa643hsa8i2ar6pki04c"))
fc1adab1 204 (patches (search-patches "bigloo-gc-shebangs.patch"))))
e117772d
LC
205 (build-system gnu-build-system)
206 (arguments
01eafd38 207 `(#:test-target "test"
e117772d
LC
208 #:phases (alist-replace
209 'configure
210 (lambda* (#:key outputs #:allow-other-keys)
211
212 (substitute* "configure"
213 (("^shell=.*$")
214 (string-append "shell=" (which "bash") "\n")))
215
6e1c4093
LC
216 ;; Since libgc's pthread redirects are used, we end up
217 ;; using libgc symbols, so we must link against it.
218 ;; Reported on 2013-06-25.
219 (substitute* "api/pthread/src/Makefile"
220 (("^EXTRALIBS[[:blank:]]*=(.*)$" _ value)
221 (string-append "EXTRALIBS = "
222 (string-trim-right value)
223 " -l$(GCLIB)_fth-$(RELEASE)"
224 " -Wl,-rpath=" (assoc-ref outputs "out")
225 "/lib/bigloo/" ,version)))
226
e117772d 227 ;; Those variables are used by libgc's `configure'.
e858326a
LC
228 (setenv "SHELL" (which "sh"))
229 (setenv "CONFIG_SHELL" (which "sh"))
230
231 ;; ... but they turned out to be overridden later, so work
232 ;; around that.
233 (substitute* (find-files "gc" "^configure-gc")
234 (("sh=/bin/sh")
235 (string-append "sh=" (which "sh"))))
e117772d
LC
236
237 ;; The `configure' script doesn't understand options
238 ;; of those of Autoconf.
239 (let ((out (assoc-ref outputs "out")))
240 (zero?
241 (system* "./configure"
242 (string-append "--prefix=" out)
7fe492e8
LC
243 ;; FIXME: Currently fails, see
244 ;; <http://article.gmane.org/gmane.lisp.scheme.bigloo/6126>.
245 ;; "--customgc=no" ; use our libgc
e117772d 246 (string-append"--mv=" (which "mv"))
f0ad3c76
LC
247 (string-append "--rm=" (which "rm"))
248 (string-append "--ldflags=-Wl,-rpath="
249 (assoc-ref outputs "out")
250 "/lib/bigloo/" ,version)))))
e117772d 251 (alist-cons-after
e858326a
LC
252 'install 'install-emacs-modes
253 (lambda* (#:key outputs #:allow-other-keys)
254 (let* ((out (assoc-ref outputs "out"))
255 (dir (string-append out "/share/emacs/site-lisp")))
256 (zero? (system* "make" "-C" "bmacs" "all" "install"
257 (string-append "EMACSBRAND=emacs24")
258 (string-append "EMACSDIR=" dir)))))
259 %standard-phases))))
e117772d 260 (inputs
69383a47 261 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
cf53ecf5
LC
262
263 ;; Optional APIs for which Bigloo has bindings.
264 ("avahi" ,avahi)
265 ("libphidget" ,libphidget)))
266 (native-inputs
267 `(("pkg-config" ,pkg-config)))
10879c4e
LC
268 (propagated-inputs
269 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
e117772d 270 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
35b9e423 271 (synopsis "Efficient Scheme compiler")
e117772d
LC
272 (description
273 "Bigloo is a Scheme implementation devoted to one goal: enabling
274Scheme based programming style where C(++) is usually
275required. Bigloo attempts to make Scheme practical by offering
276features usually presented by traditional programming languages
277but not offered by Scheme and functional programming. Bigloo
278compiles Scheme modules. It delivers small and fast stand alone
279binary executables. Bigloo enables full connections between
14e72a18 280Scheme and C programs and between Scheme and Java programs.")
e117772d 281 (license gpl2+)))
e6e82f62
LC
282
283(define-public hop
284 (package
285 (name "hop")
286 (version "2.4.0")
287 (source (origin
288 (method url-fetch)
289 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
290 version ".tar.gz"))
291 (sha256
292 (base32
01eafd38 293 "1v2r4ga58kk1sx0frn8qa8ccmjpic9csqzpk499wc95y9c4b1wy3"))
fc1adab1
AK
294 (patches (search-patches "hop-bigloo-4.0b.patch"
295 "hop-linker-flags.patch"))))
e6e82f62
LC
296 (build-system gnu-build-system)
297 (arguments
8a629613 298 `(#:phases
d8707db0
LC
299 (alist-replace
300 'configure
76071c70 301 (lambda* (#:key outputs #:allow-other-keys)
d8707db0
LC
302 (let ((out (assoc-ref outputs "out")))
303 (zero?
304 (system* "./configure"
76071c70
EB
305 (string-append "--prefix=" out)
306 (string-append "--blflags="
307 ;; user flags completely override useful
308 ;; default flags, so repeat them here.
309 "-copt \\$(CPICFLAGS) -L\\$(BUILDLIBDIR) "
310 "-ldopt -Wl,-rpath," out "/lib")))))
311 %standard-phases)
312 #:tests? #f)) ; no test suite
a394c60a
AE
313 (inputs `(("avahi" ,avahi)
314 ("bigloo" ,bigloo)
8a629613 315 ("which" ,which)))
e6e82f62 316 (home-page "http://hop.inria.fr/")
9e771e3b 317 (synopsis "Multi-tier programming language for the Web 2.0")
e6e82f62
LC
318 (description
319 "HOP is a multi-tier programming language for the Web 2.0 and the
320so-called diffuse Web. It is designed for programming interactive web
321applications in many fields such as multimedia (web galleries, music players,
322...), ubiquitous and house automation (SmartPhones, personal appliance),
323mashups, office (web agendas, mail clients, ...), etc.")
324 (license gpl2+)))
8cc9e7f9
LC
325
326(define-public chicken
327 (package
328 (name "chicken")
01497dfe 329 (version "4.11.0")
8cc9e7f9
LC
330 (source (origin
331 (method url-fetch)
d0d94110
RW
332 (uri (string-append "http://code.call-cc.org/releases/"
333 version "/chicken-" version ".tar.gz"))
8cc9e7f9
LC
334 (sha256
335 (base32
01497dfe 336 "12ddyiikqknpr8h6llsxbg2fz75xnayvcnsvr1cwv8xnjn7jpp73"))))
8cc9e7f9
LC
337 (build-system gnu-build-system)
338 (arguments
339 `(#:modules ((guix build gnu-build-system)
340 (guix build utils)
341 (srfi srfi-1))
342
343 ;; No `configure' script; run "make check" after "make install" as
344 ;; prescribed by README.
acb38070
RW
345 #:phases
346 (modify-phases %standard-phases
347 (delete 'configure)
348 (delete 'check)
349 (add-after 'install 'check
416a5a9a
RW
350 (assoc-ref %standard-phases 'check))
351 (add-after 'unpack 'disable-broken-tests
352 (lambda _
353 ;; The port tests fail with this error:
354 ;; Error: (line 294) invalid escape-sequence '\x o'
355 (substitute* "tests/runtests.sh"
356 (("\\$interpret -s port-tests\\.scm") ""))
357 #t)))
8cc9e7f9
LC
358
359 #:make-flags (let ((out (assoc-ref %outputs "out")))
360 (list "PLATFORM=linux"
361 (string-append "PREFIX=" out)
362 (string-append "VARDIR=" out "/var/lib")))
363
364 ;; Parallel builds are not supported, as noted in README.
365 #:parallel-build? #f))
ffc13e75
RW
366 ;; One of the tests ("testing direct invocation can detect calls of too
367 ;; many arguments...") times out when building with a more recent GCC.
368 ;; The problem was reported here:
369 ;; https://lists.gnu.org/archive/html/chicken-hackers/2015-04/msg00059.html
370 (native-inputs
371 `(("gcc" ,gcc-4.8)))
8cc9e7f9
LC
372 (home-page "http://www.call-cc.org/")
373 (synopsis "R5RS Scheme implementation that compiles native code via C")
374 (description
375 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
376produces portable and efficient C, supports almost all of the R5RS Scheme
2c4b49ed 377language standard, and includes many enhancements and extensions.")
8cc9e7f9 378 (license bsd-3)))
f7ce90e7
LC
379
380(define-public scheme48
381 (package
382 (name "scheme48")
5c4d98ab 383 (version "1.9.2")
f7ce90e7
LC
384 (source (origin
385 (method url-fetch)
386 (uri (string-append "http://s48.org/" version
387 "/scheme48-" version ".tgz"))
388 (sha256
389 (base32
5c4d98ab 390 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
fc1adab1 391 (patches (search-patches "scheme48-tests.patch"))))
f7ce90e7 392 (build-system gnu-build-system)
f7ce90e7
LC
393 (home-page "http://s48.org/")
394 (synopsis "Scheme implementation using a bytecode interpreter")
395 (description
396 "Scheme 48 is an implementation of Scheme based on a byte-code
397interpreter and is designed to be used as a testbed for experiments in
398implementation techniques and as an expository tool.")
399
400 ;; Most files are BSD-3; see COPYING for the few exceptions.
401 (license bsd-3)))
30645251
LC
402
403(define-public racket
404 (package
405 (name "racket")
c2c84add 406 (version "6.6")
30645251
LC
407 (source (origin
408 (method url-fetch)
d3206af6
LC
409 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
410 version "/racket-" version "-src.tgz")
30645251
LC
411 (string-append
412 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
413 version "/racket/racket-" version "-src-unix.tgz")))
414 (sha256
d3206af6 415 (base32
c2c84add 416 "1kzdi1n6h6hmz8zd9k8r5a5yp2ryi4w3c2fjm1k6cqicn18cwaxz"))))
30645251
LC
417 (build-system gnu-build-system)
418 (arguments
419 '(#:phases
e8c6811b
SB
420 (alist-cons-before
421 'configure 'pre-configure
422 (lambda* (#:key inputs #:allow-other-keys)
423 ;; Patch dynamically loaded libraries with their absolute paths.
424 (let* ((library-path (search-path-as-string->list
425 (getenv "LIBRARY_PATH")))
426 (find-so (lambda (soname)
427 (search-path
428 library-path
429 (format #f "~a.so" soname))))
430 (patch-ffi-libs (lambda (file libs)
431 (for-each
432 (lambda (lib)
433 (substitute* file
434 (((format #f "\"~a\"" lib))
435 (format #f "\"~a\"" (find-so lib)))))
436 libs))))
437 (substitute* "collects/db/private/sqlite3/ffi.rkt"
438 (("ffi-lib sqlite-so")
439 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
440 (substitute* "collects/openssl/libssl.rkt"
441 (("ffi-lib libssl-so")
442 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
443 (substitute* "collects/openssl/libcrypto.rkt"
444 (("ffi-lib libcrypto-so")
445 (format #f "ffi-lib \"~a\"" (find-so "libcrypto"))))
446 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
447 (("ffi-lib libgmp-so")
448 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
449 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
450 (("ffi-lib libmpfr-so")
451 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
452 (for-each
453 (lambda (x) (apply patch-ffi-libs x))
454 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
455 ("libfontconfig" "libcairo"))
456 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
457 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
458 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
459 ("libjpeg"))
460 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
461 ("libpango-1.0" "libpangocairo-1.0"))
462 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
463 ("libpng"))
464 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
465 ("libodbc"))
466 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
467 ("libX11"))
468 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
469 ("libgio-2.0"))
470 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
471 ("libgdk-3" "libgtk-3"))
472 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
473 ("libunique-1.0"))
474 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
475 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
476 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
477 ("libGL"))
478 ("share/pkgs/sgl/gl.rkt"
479 ("libGL" "libGLU")))))
480 (chdir "src"))
481 (alist-cons-after
482 'unpack 'patch-/bin/sh
483 (lambda _
484 (substitute* "collects/racket/system.rkt"
485 (("/bin/sh") (which "sh"))))
486 %standard-phases))
30645251
LC
487 #:tests? #f ; XXX: how to run them?
488 ))
782170c4
SB
489 (inputs
490 `(("libffi" ,libffi)
491 ;; Hardcode dynamically loaded libraries for better functionality.
492 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
493 ("cairo" ,cairo)
494 ("fontconfig" ,fontconfig)
495 ("glib" ,glib)
496 ("glu" ,glu)
497 ("gmp" ,gmp)
498 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
499 ("libjpeg" ,libjpeg)
500 ("libpng" ,libpng)
501 ("libx11" ,libx11)
502 ("mesa" ,mesa)
503 ("mpfr" ,mpfr)
504 ("openssl" ,openssl)
505 ("pango" ,pango)
506 ("sqlite" ,sqlite)
507 ("unixodbc" ,unixodbc)))
30645251
LC
508 (home-page "http://racket-lang.org")
509 (synopsis "Implementation of Scheme and related languages")
510 (description
511 "Racket is an implementation of the Scheme programming language (R5RS and
512R6RS) and related languages, such as Typed Racket. It features a compiler and
513a virtual machine with just-in-time native compilation, as well as a large set
514of libraries.")
39d0ce93 515 (license lgpl2.0+)))
07f4aef0
TUBK
516
517(define-public gambit-c
518 (package
519 (name "gambit-c")
520 (version "4.7.4")
521 (source
522 (origin
523 (method url-fetch)
524 (uri (string-append
525 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
526 (version-major+minor version) "/source/gambc-v"
527 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
528 ".tgz"))
529 (sha256
530 (base32 "0y2pklh4k65yrmxv63ass76xckrk9wqimbdad2gha35v2mi7blhs"))))
531 (build-system gnu-build-system)
532 (arguments
533 '(#:configure-flags
534 ;; According to the ./configure script, this makes the build slower and
535 ;; use >= 1 GB memory, but makes Gambit much faster.
536 '("--enable-single-host")
537 #:phases
538 (alist-cons-before
539 'check 'fix-tests
540 (lambda _
541 (substitute* '("tests/makefile")
542 ;; '-:' is how run-time options are set. 'tl' sets some terminal
543 ;; option, which makes it fail in our build environment. It
544 ;; recommends using 'd-' as a solution, which sets the REPL
545 ;; interaction channel to stdin/stdout.
546 (("gsi -:tl") "gsi -:d-,tl")))
547 %standard-phases)))
548 (home-page "http://www.iro.umontreal.ca/~gambit/")
549 (synopsis "Efficient Scheme interpreter and compiler")
550 (description
551 "Gambit consists of two main programs: gsi, the Gambit Scheme
552interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
553the complete execution and debugging environment. The compiler is the
554interpreter extended with the capability of generating executable files. The
555compiler can produce standalone executables or compiled modules which can be
556loaded at run time. Interpreted code and compiled code can be freely
557mixed.")
558 ;; Dual license.
559 (license (list lgpl2.1+ asl2.0))))
3e92f4f9
TUBK
560
561(define-public chibi-scheme
562 (package
563 (name "chibi-scheme")
51960939 564 (version "0.7.3")
3e92f4f9
TUBK
565 (source
566 (origin
567 (method url-fetch)
51960939
TUBK
568 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
569 version ".tar.gz"))
3e92f4f9 570 (sha256
51960939
TUBK
571 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
572 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
3e92f4f9
TUBK
573 (build-system gnu-build-system)
574 (arguments
4a187c55
LC
575 `(#:phases (modify-phases %standard-phases
576 (delete 'configure)
577 (add-before 'build 'set-cc
578 (lambda _
579 (setenv "CC" "gcc"))))
3e92f4f9
TUBK
580 #:make-flags (let ((out (assoc-ref %outputs "out")))
581 (list (string-append "PREFIX=" out)
582 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
583 #:test-target "test"))
584 (home-page "https://code.google.com/p/chibi-scheme/")
585 (synopsis "Small embeddable Scheme implementation")
586 (description
587 "Chibi-Scheme is a very small library with no external dependencies
588intended for use as an extension and scripting language in C programs. In
589addition to support for lightweight VM-based threads, each VM itself runs in
590an isolated heap allowing multiple VMs to run simultaneously in different OS
591threads.")
592 (license bsd-3)))
c093f9f6 593
c093f9f6
FB
594(define-public scmutils
595 (let ()
596 (define (system-suffix)
597 (cond
598 ((string-prefix? "x86_64" (or (%current-target-system)
599 (%current-system)))
600 "x86-64")
601 (else "i386")))
602
603 (package
604 (name "scmutils")
605 (version "20140302")
606 (source
607 (origin
95001d4b 608 (method url-fetch/tarbomb)
c093f9f6
FB
609 (modules '((guix build utils)))
610 (snippet
611 ;; Remove binary code
612 '(delete-file-recursively "scmutils/mit-scheme"))
613 (file-name (string-append name "-" version ".tar.gz"))
614 (uri (string-append "http://groups.csail.mit.edu/mac/users/gjs/6946"
615 "/scmutils-tarballs/" name "-" version
616 "-x86-64-gnu-linux.tar.gz"))
617 (sha256
618 (base32 "10cnbm7nh78m5mrl1di85s29gny81jb1am9zd9f9yx725xb6dnfg"))))
619 (build-system gnu-build-system)
620 (inputs
621 `(("mit-scheme" ,mit-scheme)
b8fc3622 622 ("emacs" ,emacs-minimal)))
c093f9f6
FB
623 (arguments
624 `(#:tests? #f ;; no tests-suite
625 #:modules ((guix build gnu-build-system)
626 (guix build utils)
627 (guix build emacs-utils))
628 #:imported-modules (,@%gnu-build-system-modules
629 (guix build emacs-utils))
630 #:phases
631 (modify-phases %standard-phases
632 (replace 'configure
633 ;; No standard build procedure is used. We set the correct
634 ;; runtime path in the custom build system.
635 (lambda* (#:key outputs #:allow-other-keys)
636 (let ((out (assoc-ref outputs "out")))
637 ;; Required to find .bci files at runtime.
638 (with-directory-excursion "scmutils"
639 (rename-file "src" "scmutils"))
640 (substitute* "scmutils/scmutils/load.scm"
641 (("/usr/local/scmutils/")
642 (string-append out "/lib/mit-scheme-"
643 ,(system-suffix) "/")))
644 #t)))
645 (replace 'build
646 ;; Compile the code and build a band.
647 (lambda* (#:key outputs #:allow-other-keys)
648 (let* ((out (assoc-ref outputs "out"))
649 (make-img (string-append
650 "echo '(load \"load\") "
651 "(disk-save \"edwin-mechanics.com\")'"
652 "| mit-scheme")))
653 (with-directory-excursion "scmutils/scmutils"
654 (and (zero? (system "mit-scheme < compile.scm"))
655 (zero? (system make-img)))))))
656 (add-before 'install 'fix-directory-names
657 ;; Correct directory names in the startup script.
658 (lambda* (#:key inputs outputs #:allow-other-keys)
659 (let* ((out (assoc-ref outputs "out"))
660 (scm-root (assoc-ref inputs "mit-scheme")))
661 (substitute* "bin/mechanics"
662 (("ROOT=\"\\$\\{SCMUTILS_ROOT:-/.*\\}\"")
663 (string-append
664 "ROOT=\"${SCMUTILS_ROOT:-" scm-root "}\"\n"
665 "LIB=\"${ROOT}/lib/mit-scheme-"
666 ,(system-suffix) ":"
667 out "/lib/mit-scheme-" ,(system-suffix) "\""))
668 (("EDWIN_INFO_DIRECTORY=.*\n") "")
669 (("SCHEME=.*\n")
670 (string-append "SCHEME=\"${ROOT}/bin/scheme "
671 "--library ${LIB}\"\n"))
672 (("export EDWIN_INFO_DIRECTORY") ""))
673 #t)))
674 (add-before 'install 'emacs-tags
675 ;; Generate Emacs's tags for easy reference to source
676 ;; code.
677 (lambda* (#:key inputs outputs #:allow-other-keys)
678 (with-directory-excursion "scmutils/scmutils"
679 (zero? (apply system* "etags"
680 (find-files "." "\\.scm"))))))
681 (replace 'install
682 ;; Copy files to the store.
683 (lambda* (#:key outputs #:allow-other-keys)
684 (define* (copy-files-to-directory files dir
685 #:optional (delete? #f))
686 (for-each (lambda (f)
687 (copy-file f (string-append dir "/" f))
688 (when delete? (delete-file f)))
689 files))
690
691 (let* ((out (assoc-ref outputs "out"))
692 (bin (string-append out "/bin"))
693 (doc (string-append out "/share/doc/"
694 ,name "-" ,version))
695 (lib (string-append out "/lib/mit-scheme-"
696 ,(system-suffix)
697 "/scmutils")))
698 (for-each mkdir-p (list lib doc bin))
699 (with-directory-excursion "scmutils/scmutils"
700 (copy-files-to-directory '("COPYING" "LICENSE")
701 doc #t)
702 (for-each delete-file (find-files "." "\\.bin"))
703 (copy-files-to-directory '("edwin-mechanics.com")
704 (string-append lib "/..") #t)
705 (copy-recursively "." lib))
706 (with-directory-excursion "bin"
707 (copy-files-to-directory (find-files ".") bin))
708 (with-directory-excursion "scmutils/manual"
709 (copy-files-to-directory (find-files ".") doc))
710 #t)))
711 (add-after 'install 'emacs-helpers
712 ;; Add convenience Emacs commands to easily load the
713 ;; Scmutils band in an MIT-Scheme buffer inside of Emacs
714 ;; and to easily load code tags.
715 (lambda* (#:key inputs outputs #:allow-other-keys)
716 (let* ((out (assoc-ref outputs "out"))
717 (mit-root (assoc-ref inputs "mit-scheme"))
718 (emacs-lisp-dir
719 (string-append out "/share/emacs/site-lisp"
720 "/guix.d/" ,name "-" ,version))
721 (el-file (string-append emacs-lisp-dir
722 "/scmutils.el"))
723 (lib-relative-path
724 (string-append "/lib/mit-scheme-"
725 ,(system-suffix))))
726 (mkdir-p emacs-lisp-dir)
727 (call-with-output-file el-file
728 (lambda (p)
729 (format p
730 ";;;###autoload
731(defun scmutils-load ()
732 (interactive)
733 (require 'xscheme)
734 (let ((mit-root \"~a\")
735 (scmutils \"~a\"))
736 (run-scheme
737 (concat mit-root \"/bin/scheme --library \"
738 mit-root \"~a:\" scmutils \"~a\"
739 \" --band edwin-mechanics.com\"
740 \" --emacs\"))))
741
742;;;###autoload
743(defun scmutils-load-tags ()
744 (interactive)
745 (let ((scmutils \"~a\"))
746 (visit-tags-table (concat scmutils \"/TAGS\"))))
747"
748 mit-root out
749 lib-relative-path
750 lib-relative-path
751 (string-append out lib-relative-path
752 "/scmutils"))))
aad4a48a
FB
753 (emacs-generate-autoloads ,name emacs-lisp-dir)
754 (emacs-byte-compile-directory emacs-lisp-dir)
c093f9f6
FB
755 #t))))))
756 (home-page
757 "http://groups.csail.mit.edu/mac/users/gjs/6946/linux-install.htm")
758 (synopsis "Scmutils library for MIT Scheme")
759 (description "The Scmutils system is an integrated library of
760procedures, embedded in the programming language Scheme, and intended to
761support teaching and research in mathematical physics and electrical
762engineering.")
763 (license gpl2+))))
b9b447be
JN
764
765(define-public sicp
766 (let ((commit "5b52db566968d28a89fbbaf338d207f01cc81cac"))
767 (package
768 (name "sicp")
769 (version (string-append "20160220-1." (string-take commit 7)))
770 (source (origin
771 (method git-fetch)
772 (uri (git-reference
773 (url "https://github.com/sarabander/sicp")
774 (commit commit)))
775 (sha256
776 (base32
777 "10h6h7szwlfbshwh18bnl2hvyddj5i7106l79s145l0sjjv15cxb"))
778 (file-name (string-append name "-" version "-checkout"))))
779 (build-system trivial-build-system)
780 (native-inputs `(("gzip" ,gzip)
781 ("source" ,source)
782 ("texinfo" ,texinfo)))
783 (arguments
784 `(#:modules ((guix build utils)
785 (srfi srfi-1)
786 (srfi srfi-26))
787 #:builder
788 (begin
789 (use-modules (guix build utils)
790 (srfi srfi-1)
791 (srfi srfi-26))
792 (let ((gzip (assoc-ref %build-inputs "gzip"))
793 (source (assoc-ref %build-inputs "source"))
794 (texinfo (assoc-ref %build-inputs "texinfo"))
795 (info-dir (string-append %output "/share/info")))
796 (setenv "PATH" (string-append gzip "/bin"
797 ":" texinfo "/bin"))
798 (mkdir-p info-dir)
799 (and (zero?
800 (system* "makeinfo" "--output"
801 (string-append info-dir "/sicp.info")
802 (string-append source "/sicp-pocket.texi")))
803 (every zero?
804 (map (cut system* "gzip" "-9n" <>)
805 (find-files info-dir))))))))
806 (home-page "http://sarabander.github.io/sicp")
807 (synopsis "Structure and Interpretation of Computer Programs")
808 (description "Structure and Interpretation of Computer Programs (SICP) is
809a textbook aiming to teach the principles of computer programming.
810
811Using Scheme, a dialect of the Lisp programming language, the book explains
812core computer science concepts such as abstraction in programming,
813metalinguistic abstraction, recursion, interpreters, and modular programming.")
814 (license cc-by-sa4.0))))