gnu: scheme48-rx: Update to 0.0.0-2.dd9037f.
[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>
7c028db5 6;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
b9b447be 7;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
8a0c2552 8;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
07ef08a7 9;;; Copyright © 2017 John Darrington <jmd@gnu.org>
01d71f62 10;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
2705a97e 11;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
e117772d
LC
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
1ffa7090 28(define-module (gnu packages scheme)
59a43334 29 #:use-module (gnu packages)
bc73a843 30 #:use-module ((guix licenses)
07ef08a7
JD
31 #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
32 cc-by-sa4.0 non-copyleft))
e117772d
LC
33 #:use-module (guix packages)
34 #:use-module (guix download)
b9b447be 35 #:use-module (guix git-download)
07f4aef0 36 #:use-module (guix utils)
e117772d 37 #:use-module (guix build-system gnu)
b9b447be 38 #:use-module (guix build-system trivial)
5e3ea571 39 #:use-module (gnu packages bdw-gc)
549f9512 40 #:use-module (gnu packages compression)
5e3ea571
KK
41 #:use-module (gnu packages libevent)
42 #:use-module (gnu packages libunistring)
1ffa7090
LC
43 #:use-module (gnu packages m4)
44 #:use-module (gnu packages multiprecision)
549f9512 45 #:use-module (gnu packages ncurses)
5e3ea571 46 #:use-module (gnu packages pcre)
d3206af6 47 #:use-module (gnu packages databases)
1ffa7090 48 #:use-module (gnu packages emacs)
549f9512
FB
49 #:use-module (gnu packages ghostscript)
50 #:use-module (gnu packages netpbm)
1ffa7090 51 #:use-module (gnu packages texinfo)
8f9ac901 52 #:use-module (gnu packages tex)
ce0614dd 53 #:use-module (gnu packages base)
b9b447be 54 #:use-module (gnu packages compression)
cf53ecf5
LC
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages avahi)
57 #:use-module (gnu packages libphidget)
ffc13e75 58 #:use-module (gnu packages gcc)
30645251 59 #:use-module (gnu packages glib)
9d3c4dae 60 #:use-module (gnu packages gtk)
30645251 61 #:use-module (gnu packages libffi)
d3206af6 62 #:use-module (gnu packages fontutils)
e55354b8 63 #:use-module (gnu packages image)
bc11c72c 64 #:use-module (gnu packages xorg)
782170c4
SB
65 #:use-module (gnu packages tls)
66 #:use-module (gnu packages gl)
e117772d
LC
67 #:use-module (ice-9 match))
68
a0efb39a 69(define (mit-scheme-source-directory system version)
ecb26c10
AE
70 (string-append "mit-scheme-"
71 (if (or (string-prefix? "x86_64" system)
a0efb39a 72 (string-prefix? "i686" system))
ecb26c10
AE
73 ""
74 "c-")
75 version))
76
e117772d
LC
77(define-public mit-scheme
78 (package
79 (name "mit-scheme")
6c4a2884 80 (version "9.2")
e117772d 81 (source #f) ; see below
f163c290 82 (outputs '("out" "doc"))
e117772d
LC
83 (build-system gnu-build-system)
84 (arguments
85 `(#:tests? #f ; no "check" target
f163c290
FB
86 #:modules ((guix build gnu-build-system)
87 (guix build utils)
88 (srfi srfi-1))
e117772d 89 #:phases
af00e633
FB
90 (modify-phases %standard-phases
91 (replace 'unpack
92 (lambda* (#:key inputs #:allow-other-keys)
93 (and (zero? (system* "tar" "xzvf"
94 (assoc-ref inputs "source")))
95 (chdir ,(mit-scheme-source-directory (%current-system)
96 version))
97 (begin
98 ;; Delete these dangling symlinks since they break
99 ;; `patch-shebangs'.
100 (for-each delete-file
101 (append '("src/lib/shim-config.scm")
102 (find-files "src/lib/lib" "\\.so$")
103 (find-files "src/lib" "^liarc-")
104 (find-files "src/compiler" "^make\\.")))
105 (chdir "src")
106 #t))))
107 (replace 'build
108 (lambda* (#:key system outputs #:allow-other-keys)
109 (let ((out (assoc-ref outputs "out")))
110 (if (or (string-prefix? "x86_64" system)
111 (string-prefix? "i686" system))
112 (zero? (system* "make" "compile-microcode"))
113 (zero? (system* "./etc/make-liarc.sh"
f163c290
FB
114 (string-append "--prefix=" out)))))))
115 (add-after 'configure 'configure-doc
116 (lambda* (#:key outputs inputs #:allow-other-keys)
117 (with-directory-excursion "../doc"
118 (let* ((out (assoc-ref outputs "out"))
119 (bash (assoc-ref inputs "bash"))
120 (bin/sh (string-append bash "/bin/sh")))
121 (system* bin/sh "./configure"
122 (string-append "--prefix=" out)
123 (string-append "SHELL=" bin/sh))
124 (substitute* '("Makefile" "make-common")
125 (("/lib/mit-scheme/doc")
126 (string-append "/share/doc/" ,name "-" ,version)))
127 #t))))
128 (add-after 'build 'build-doc
129 (lambda* _
130 (with-directory-excursion "../doc"
131 (zero? (system* "make")))))
132 (add-after 'install 'install-doc
133 (lambda* (#:key outputs #:allow-other-keys)
134 (let* ((out (assoc-ref outputs "out"))
135 (doc (assoc-ref outputs "doc"))
136 (old-doc-dir (string-append out "/share/doc"))
137 (new-doc/mit-scheme-dir
138 (string-append doc "/share/doc/" ,name "-" ,version)))
139 (with-directory-excursion "../doc"
140 (for-each (lambda (target)
141 (system* "make" target))
142 '("install-config" "install-info-gz" "install-man"
143 "install-html" "install-pdf")))
144 (mkdir-p new-doc/mit-scheme-dir)
145 (copy-recursively
146 (string-append old-doc-dir "/" ,name "-" ,version)
147 new-doc/mit-scheme-dir)
148 (delete-file-recursively old-doc-dir)
149 #t))))))
150 (native-inputs
151 `(("texlive" ,texlive)
152 ("texinfo" ,texinfo)
153 ("m4" ,m4)))
e117772d 154 (inputs
f163c290 155 `(("libx11" ,libx11)
e117772d
LC
156
157 ("source"
dd6b9a37
LC
158
159 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
160 ;; compile from the architecture-specific tarballs, which contain
161 ;; pre-built binaries. It leads to more efficient code than when
162 ;; building the tarball that contains generated C code instead of
163 ;; those binaries.
164 ,(origin
165 (method url-fetch)
166 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
167 version "/mit-scheme-"
dd6b9a37 168 (match (%current-system)
ecb26c10
AE
169 ("x86_64-linux"
170 (string-append version "-x86-64"))
171 ("i686-linux"
172 (string-append version "-i386"))
173 (_
174 (string-append "c-" version)))
dd6b9a37
LC
175 ".tar.gz"))
176 (sha256
177 (match (%current-system)
178 ("x86_64-linux"
179 (base32
6c4a2884 180 "1skzxxhr0iq96bf0j5m7mvf3i4sppfyfa6gpqn34mwgkw1fx8274"))
dd6b9a37
LC
181 ("i686-linux"
182 (base32
6c4a2884 183 "1fmlpnhf5a75db93phajh4ysbdgrgl72v45lk3kznriprl0a7jc6"))
dd6b9a37
LC
184 (_
185 (base32
6c4a2884 186 "0w5ib5vsidihb4hb6fma3sp596ykr8izagm57axvgd6lqzwicsjg"))))))))
75af27f7
LC
187
188 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
7c028db5 189 (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
75af27f7 190
6fd52309 191 (home-page "https://www.gnu.org/software/mit-scheme/")
a2b63d58 192 (synopsis "A Scheme implementation with integrated editor and debugger")
e117772d 193 (description
79c311b8 194 "GNU/MIT Scheme is an implementation of the Scheme programming
a22dc0c4
LC
195language. It provides an interpreter, a compiler and a debugger. It also
196features an integrated Emacs-like editor and a large runtime library.")
63e8bb12
LC
197 (license gpl2+)
198 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
e117772d
LC
199
200(define-public bigloo
201 (package
202 (name "bigloo")
5e3ea571 203 (version "4.3a")
e117772d
LC
204 (source (origin
205 (method url-fetch)
206 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
207 version ".tar.gz"))
208 (sha256
209 (base32
5e3ea571
KK
210 "03rcqs6kvy2j5lqk4fidqay5qfyp474qqspbh6wk4qdbds6w599w"))
211 ;; Remove bundled libraries.
212 (modules '((guix build utils)))
213 (snippet
214 '(for-each delete-file-recursively
215 '("gc" "gmp" "libuv")))))
e117772d
LC
216 (build-system gnu-build-system)
217 (arguments
01eafd38 218 `(#:test-target "test"
fb685df8
EF
219 #:phases
220 (modify-phases %standard-phases
221 (replace 'configure
5e3ea571 222 (lambda* (#:key inputs outputs #:allow-other-keys)
e117772d 223
fb685df8
EF
224 (substitute* "configure"
225 (("^shell=.*$")
5e3ea571
KK
226 (string-append "shell=" (which "bash") "\n"))
227 (("`date`") "0"))
228 (substitute* "autoconf/runtest.in"
229 ((", @DATE@") ""))
230 (substitute* "autoconf/osversion"
231 (("^version.*$") "version=\"\"\n"))
e117772d 232
fb685df8
EF
233 ;; The `configure' script doesn't understand options
234 ;; of those of Autoconf.
235 (let ((out (assoc-ref outputs "out")))
236 (zero?
237 (system* "./configure"
238 (string-append "--prefix=" out)
5e3ea571
KK
239 ; use system libraries
240 "--customgc=no"
241 "--customunistring=no"
242 "--customlibuv=no"
fb685df8
EF
243 (string-append"--mv=" (which "mv"))
244 (string-append "--rm=" (which "rm"))
23bd8f55 245 "--cflags=-fPIC"
fb685df8
EF
246 (string-append "--ldflags=-Wl,-rpath="
247 (assoc-ref outputs "out")
5e3ea571
KK
248 "/lib/bigloo/" ,version)
249 (string-append "--lispdir=" out
250 "/share/emacs/site-lisp")
251 "--sharedbde=yes"
252 "--sharedcompiler=yes")))))
fb685df8
EF
253 (add-after 'install 'install-emacs-modes
254 (lambda* (#:key outputs #:allow-other-keys)
255 (let* ((out (assoc-ref outputs "out"))
256 (dir (string-append out "/share/emacs/site-lisp")))
257 (zero? (system* "make" "-C" "bmacs" "all" "install"
5e3ea571 258 (string-append "EMACSBRAND=emacs25")
fb685df8 259 (string-append "EMACSDIR=" dir)))))))))
e117772d 260 (inputs
69383a47 261 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
5e3ea571
KK
262 ("libgc" ,libgc)
263 ("libunistring" ,libunistring)
264 ("libuv" ,libuv)
265 ("openssl" ,openssl)
266 ("sqlite" ,sqlite)
cf53ecf5
LC
267
268 ;; Optional APIs for which Bigloo has bindings.
269 ("avahi" ,avahi)
5e3ea571
KK
270 ("libphidget" ,libphidget)
271 ("pcre" ,pcre)))
cf53ecf5
LC
272 (native-inputs
273 `(("pkg-config" ,pkg-config)))
10879c4e
LC
274 (propagated-inputs
275 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
e117772d 276 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
35b9e423 277 (synopsis "Efficient Scheme compiler")
e117772d
LC
278 (description
279 "Bigloo is a Scheme implementation devoted to one goal: enabling
280Scheme based programming style where C(++) is usually
281required. Bigloo attempts to make Scheme practical by offering
282features usually presented by traditional programming languages
283but not offered by Scheme and functional programming. Bigloo
284compiles Scheme modules. It delivers small and fast stand alone
285binary executables. Bigloo enables full connections between
14e72a18 286Scheme and C programs and between Scheme and Java programs.")
e117772d 287 (license gpl2+)))
e6e82f62
LC
288
289(define-public hop
290 (package
291 (name "hop")
082725b5 292 (version "3.1.0-pre2")
e6e82f62
LC
293 (source (origin
294 (method url-fetch)
295 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
296 version ".tar.gz"))
297 (sha256
298 (base32
082725b5 299 "09m7pahjsp7wxzd20cdph9j3mgf2nq5dyckcjljcd40m25v85kks"))))
e6e82f62
LC
300 (build-system gnu-build-system)
301 (arguments
082725b5
KK
302 `(#:test-target "test"
303 #:make-flags '("BIGLOO=bigloo")
304 #:parallel-build? #f
305 #:phases
04014de6
EF
306 (modify-phases %standard-phases
307 (replace 'configure
082725b5 308 (lambda* (#:key inputs outputs #:allow-other-keys)
04014de6
EF
309 (let ((out (assoc-ref outputs "out")))
310 (zero?
311 (system* "./configure"
312 (string-append "--prefix=" out)
313 (string-append "--blflags="
314 ;; user flags completely override useful
315 ;; default flags, so repeat them here.
082725b5
KK
316 "-copt \\$(CPICFLAGS) "
317 "-L \\$(BUILDLIBDIR) "
318 "-ldopt -Wl,-rpath," out "/lib")))))))))
a394c60a
AE
319 (inputs `(("avahi" ,avahi)
320 ("bigloo" ,bigloo)
082725b5
KK
321 ("libgc" ,libgc)
322 ("libunistring" ,libunistring)
323 ("libuv" ,libuv)
324 ("pcre" ,pcre)
325 ("sqlite" ,sqlite)
8a629613 326 ("which" ,which)))
e6e82f62 327 (home-page "http://hop.inria.fr/")
9e771e3b 328 (synopsis "Multi-tier programming language for the Web 2.0")
e6e82f62
LC
329 (description
330 "HOP is a multi-tier programming language for the Web 2.0 and the
331so-called diffuse Web. It is designed for programming interactive web
332applications in many fields such as multimedia (web galleries, music players,
333...), ubiquitous and house automation (SmartPhones, personal appliance),
334mashups, office (web agendas, mail clients, ...), etc.")
335 (license gpl2+)))
8cc9e7f9
LC
336
337(define-public chicken
338 (package
339 (name "chicken")
79bffa3e 340 (version "4.13.0")
8cc9e7f9 341 (source (origin
b9b6db45 342 (method url-fetch)
359e9c42 343 (uri (string-append "https://code.call-cc.org/releases/"
b9b6db45 344 version "/chicken-" version ".tar.gz"))
b9b6db45
KK
345 (sha256
346 (base32
79bffa3e 347 "0hvckhi5gfny3mlva6d7y9pmx7cbwvq0r7mk11k3sdiik9hlkmdd"))))
8cc9e7f9
LC
348 (build-system gnu-build-system)
349 (arguments
350 `(#:modules ((guix build gnu-build-system)
351 (guix build utils)
352 (srfi srfi-1))
b9b6db45 353
8cc9e7f9
LC
354 ;; No `configure' script; run "make check" after "make install" as
355 ;; prescribed by README.
acb38070
RW
356 #:phases
357 (modify-phases %standard-phases
358 (delete 'configure)
359 (delete 'check)
360 (add-after 'install 'check
b9b6db45 361 (assoc-ref %standard-phases 'check)))
8cc9e7f9
LC
362
363 #:make-flags (let ((out (assoc-ref %outputs "out")))
364 (list "PLATFORM=linux"
365 (string-append "PREFIX=" out)
366 (string-append "VARDIR=" out "/var/lib")))
367
368 ;; Parallel builds are not supported, as noted in README.
369 #:parallel-build? #f))
370 (home-page "http://www.call-cc.org/")
371 (synopsis "R5RS Scheme implementation that compiles native code via C")
372 (description
373 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
374produces portable and efficient C, supports almost all of the R5RS Scheme
2c4b49ed 375language standard, and includes many enhancements and extensions.")
8cc9e7f9 376 (license bsd-3)))
f7ce90e7
LC
377
378(define-public scheme48
379 (package
380 (name "scheme48")
5c4d98ab 381 (version "1.9.2")
f7ce90e7
LC
382 (source (origin
383 (method url-fetch)
384 (uri (string-append "http://s48.org/" version
385 "/scheme48-" version ".tgz"))
386 (sha256
387 (base32
5c4d98ab 388 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
fc1adab1 389 (patches (search-patches "scheme48-tests.patch"))))
f7ce90e7 390 (build-system gnu-build-system)
f7ce90e7
LC
391 (home-page "http://s48.org/")
392 (synopsis "Scheme implementation using a bytecode interpreter")
393 (description
394 "Scheme 48 is an implementation of Scheme based on a byte-code
395interpreter and is designed to be used as a testbed for experiments in
396implementation techniques and as an expository tool.")
397
398 ;; Most files are BSD-3; see COPYING for the few exceptions.
399 (license bsd-3)))
30645251
LC
400
401(define-public racket
402 (package
403 (name "racket")
7815d09f 404 (version "6.11")
30645251
LC
405 (source (origin
406 (method url-fetch)
d3206af6
LC
407 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
408 version "/racket-" version "-src.tgz")
30645251
LC
409 (string-append
410 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
7815d09f 411 version "/racket-" version "-src.tgz")))
30645251 412 (sha256
d3206af6 413 (base32
7815d09f 414 "1nk7705x24jjlbqqhj8yvbgqkfscxx3m81bry1g56kjxysjmf3sw"))))
30645251
LC
415 (build-system gnu-build-system)
416 (arguments
417 '(#:phases
dc1d3cde
KK
418 (modify-phases %standard-phases
419 (add-before 'configure 'pre-configure
420 (lambda* (#:key inputs #:allow-other-keys)
421 ;; Patch dynamically loaded libraries with their absolute paths.
422 (let* ((library-path (search-path-as-string->list
423 (getenv "LIBRARY_PATH")))
424 (find-so (lambda (soname)
425 (search-path
426 library-path
427 (format #f "~a.so" soname))))
428 (patch-ffi-libs (lambda (file libs)
429 (for-each
430 (lambda (lib)
431 (substitute* file
432 (((format #f "\"~a\"" lib))
433 (format #f "\"~a\"" (find-so lib)))))
434 libs))))
435 (substitute* "collects/db/private/sqlite3/ffi.rkt"
436 (("ffi-lib sqlite-so")
437 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
438 (substitute* "collects/openssl/libssl.rkt"
439 (("ffi-lib libssl-so")
440 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
441 (substitute* "collects/openssl/libcrypto.rkt"
442 (("ffi-lib libcrypto-so")
443 (format #f "ffi-lib \"~a\"" (find-so "libcrypto"))))
444 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
445 (("ffi-lib libgmp-so")
446 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
447 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
448 (("ffi-lib libmpfr-so")
449 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
450 (for-each
451 (lambda (x) (apply patch-ffi-libs x))
452 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
453 ("libfontconfig" "libcairo"))
454 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
455 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
456 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
457 ("libjpeg"))
458 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
459 ("libpango-1.0" "libpangocairo-1.0"))
460 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
461 ("libpng"))
462 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
463 ("libodbc"))
464 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
465 ("libX11"))
466 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
467 ("libgio-2.0"))
468 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
469 ("libgdk-3" "libgtk-3"))
470 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
471 ("libunique-1.0"))
472 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
473 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
474 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
475 ("libGL"))
476 ("share/pkgs/sgl/gl.rkt"
477 ("libGL" "libGLU")))))
478 (chdir "src")
479 #t))
480 (add-after 'unpack 'patch-/bin/sh
481 (lambda _
482 (substitute* "collects/racket/system.rkt"
483 (("/bin/sh") (which "sh")))
484 #t)))
30645251
LC
485 #:tests? #f ; XXX: how to run them?
486 ))
782170c4
SB
487 (inputs
488 `(("libffi" ,libffi)
489 ;; Hardcode dynamically loaded libraries for better functionality.
490 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
491 ("cairo" ,cairo)
492 ("fontconfig" ,fontconfig)
493 ("glib" ,glib)
494 ("glu" ,glu)
495 ("gmp" ,gmp)
496 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
497 ("libjpeg" ,libjpeg)
498 ("libpng" ,libpng)
499 ("libx11" ,libx11)
500 ("mesa" ,mesa)
501 ("mpfr" ,mpfr)
502 ("openssl" ,openssl)
503 ("pango" ,pango)
504 ("sqlite" ,sqlite)
505 ("unixodbc" ,unixodbc)))
30645251
LC
506 (home-page "http://racket-lang.org")
507 (synopsis "Implementation of Scheme and related languages")
508 (description
509 "Racket is an implementation of the Scheme programming language (R5RS and
510R6RS) and related languages, such as Typed Racket. It features a compiler and
511a virtual machine with just-in-time native compilation, as well as a large set
512of libraries.")
39d0ce93 513 (license lgpl2.0+)))
07f4aef0
TUBK
514
515(define-public gambit-c
516 (package
517 (name "gambit-c")
c154c97f 518 (version "4.8.8")
07f4aef0
TUBK
519 (source
520 (origin
521 (method url-fetch)
522 (uri (string-append
523 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
9ba88890 524 (version-major+minor version) "/source/gambit-v"
07f4aef0
TUBK
525 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
526 ".tgz"))
527 (sha256
c154c97f 528 (base32 "1plw1id94mpg2c4y6q9z39ndcz1hbxfnp3i08szsg6794rasmgkk"))))
07f4aef0
TUBK
529 (build-system gnu-build-system)
530 (arguments
531 '(#:configure-flags
532 ;; According to the ./configure script, this makes the build slower and
533 ;; use >= 1 GB memory, but makes Gambit much faster.
534 '("--enable-single-host")
535 #:phases
27668c79
EF
536 (modify-phases %standard-phases
537 (add-before 'check 'fix-tests
538 (lambda _
539 (substitute* '("tests/makefile")
540 ;; '-:' is how run-time options are set. 'tl' sets some terminal
541 ;; option, which makes it fail in our build environment. It
542 ;; recommends using 'd-' as a solution, which sets the REPL
543 ;; interaction channel to stdin/stdout.
544 (("gsi -:tl") "gsi -:d-,tl"))
545 #t)))))
07f4aef0
TUBK
546 (home-page "http://www.iro.umontreal.ca/~gambit/")
547 (synopsis "Efficient Scheme interpreter and compiler")
548 (description
549 "Gambit consists of two main programs: gsi, the Gambit Scheme
550interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
551the complete execution and debugging environment. The compiler is the
552interpreter extended with the capability of generating executable files. The
553compiler can produce standalone executables or compiled modules which can be
554loaded at run time. Interpreted code and compiled code can be freely
555mixed.")
556 ;; Dual license.
557 (license (list lgpl2.1+ asl2.0))))
3e92f4f9
TUBK
558
559(define-public chibi-scheme
560 (package
561 (name "chibi-scheme")
51960939 562 (version "0.7.3")
3e92f4f9
TUBK
563 (source
564 (origin
565 (method url-fetch)
51960939
TUBK
566 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
567 version ".tar.gz"))
3e92f4f9 568 (sha256
51960939
TUBK
569 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
570 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
3e92f4f9
TUBK
571 (build-system gnu-build-system)
572 (arguments
4a187c55
LC
573 `(#:phases (modify-phases %standard-phases
574 (delete 'configure)
575 (add-before 'build 'set-cc
576 (lambda _
577 (setenv "CC" "gcc"))))
3e92f4f9
TUBK
578 #:make-flags (let ((out (assoc-ref %outputs "out")))
579 (list (string-append "PREFIX=" out)
580 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
581 #:test-target "test"))
50995554 582 (home-page "https://github.com/ashinn/chibi-scheme")
3e92f4f9
TUBK
583 (synopsis "Small embeddable Scheme implementation")
584 (description
585 "Chibi-Scheme is a very small library with no external dependencies
586intended for use as an extension and scripting language in C programs. In
587addition to support for lightweight VM-based threads, each VM itself runs in
588an isolated heap allowing multiple VMs to run simultaneously in different OS
589threads.")
590 (license bsd-3)))
c093f9f6 591
c093f9f6
FB
592(define-public scmutils
593 (let ()
594 (define (system-suffix)
595 (cond
596 ((string-prefix? "x86_64" (or (%current-target-system)
597 (%current-system)))
598 "x86-64")
599 (else "i386")))
600
601 (package
602 (name "scmutils")
595b1751 603 (version "20160827")
c093f9f6
FB
604 (source
605 (origin
95001d4b 606 (method url-fetch/tarbomb)
c093f9f6
FB
607 (modules '((guix build utils)))
608 (snippet
609 ;; Remove binary code
610 '(delete-file-recursively "scmutils/mit-scheme"))
c093f9f6
FB
611 (uri (string-append "http://groups.csail.mit.edu/mac/users/gjs/6946"
612 "/scmutils-tarballs/" name "-" version
613 "-x86-64-gnu-linux.tar.gz"))
614 (sha256
595b1751 615 (base32 "00ly5m0s4dy5kxravjaqlpii5zcnr6b9nqm0607lr7xcs52i4j8b"))))
c093f9f6
FB
616 (build-system gnu-build-system)
617 (inputs
618 `(("mit-scheme" ,mit-scheme)
b8fc3622 619 ("emacs" ,emacs-minimal)))
c093f9f6
FB
620 (arguments
621 `(#:tests? #f ;; no tests-suite
622 #:modules ((guix build gnu-build-system)
623 (guix build utils)
624 (guix build emacs-utils))
625 #:imported-modules (,@%gnu-build-system-modules
626 (guix build emacs-utils))
627 #:phases
628 (modify-phases %standard-phases
629 (replace 'configure
595b1751
KK
630 ;; No standard build procedure is used. We set the correct
631 ;; runtime path in the custom build system.
632 (lambda* (#:key outputs #:allow-other-keys)
633 (let ((out (assoc-ref outputs "out")))
634 ;; Required to find .bci files at runtime.
635 (with-directory-excursion "scmutils"
636 (rename-file "src" "scmutils"))
637 (substitute* "scmutils/scmutils/load.scm"
638 (("/usr/local/scmutils/")
639 (string-append out "/lib/mit-scheme-"
640 ,(system-suffix) "/")))
641 #t)))
c093f9f6 642 (replace 'build
595b1751
KK
643 ;; Compile the code and build a band.
644 (lambda* (#:key outputs #:allow-other-keys)
645 (let* ((out (assoc-ref outputs "out"))
646 (make-img (string-append
647 "echo '(load \"load\") "
648 "(disk-save \"edwin-mechanics.com\")'"
649 "| mit-scheme")))
650 (with-directory-excursion "scmutils/scmutils"
651 (and (zero? (system "mit-scheme < compile.scm"))
652 (zero? (system make-img)))))))
c093f9f6 653 (add-before 'install 'fix-directory-names
595b1751
KK
654 ;; Correct directory names in the startup script.
655 (lambda* (#:key inputs outputs #:allow-other-keys)
656 (let* ((out (assoc-ref outputs "out"))
657 (scm-root (assoc-ref inputs "mit-scheme")))
658 (substitute* "bin/mechanics"
659 (("ROOT=\"\\$\\{SCMUTILS_ROOT:-/.*\\}\"")
660 (string-append
661 "ROOT=\"${SCMUTILS_ROOT:-" scm-root "}\"\n"
662 "LIB=\"${ROOT}/lib/mit-scheme-"
663 ,(system-suffix) ":"
664 out "/lib/mit-scheme-" ,(system-suffix) "\""))
665 (("EDWIN_INFO_DIRECTORY=.*\n") "")
666 (("SCHEME=.*\n")
667 (string-append "SCHEME=\"${ROOT}/bin/scheme "
668 "--library ${LIB}\"\n"))
669 (("export EDWIN_INFO_DIRECTORY") ""))
670 #t)))
c093f9f6 671 (add-before 'install 'emacs-tags
595b1751
KK
672 ;; Generate Emacs's tags for easy reference to source
673 ;; code.
674 (lambda* (#:key inputs outputs #:allow-other-keys)
675 (with-directory-excursion "scmutils/scmutils"
676 (zero? (apply system* "etags"
677 (find-files "." "\\.scm"))))))
c093f9f6 678 (replace 'install
595b1751
KK
679 ;; Copy files to the store.
680 (lambda* (#:key outputs #:allow-other-keys)
681 (define* (copy-files-to-directory files dir
682 #:optional (delete? #f))
683 (for-each (lambda (f)
684 (copy-file f (string-append dir "/" f))
685 (when delete? (delete-file f)))
686 files))
c093f9f6 687
595b1751
KK
688 (let* ((out (assoc-ref outputs "out"))
689 (bin (string-append out "/bin"))
690 (doc (string-append out "/share/doc/"
691 ,name "-" ,version))
692 (lib (string-append out "/lib/mit-scheme-"
693 ,(system-suffix)
694 "/scmutils")))
695 (for-each mkdir-p (list lib doc bin))
696 (with-directory-excursion "scmutils/scmutils"
697 (copy-files-to-directory '("COPYING" "LICENSE")
698 doc #t)
699 (for-each delete-file (find-files "." "\\.bin"))
700 (copy-files-to-directory '("edwin-mechanics.com")
701 (string-append lib "/..") #t)
702 (copy-recursively "." lib))
703 (with-directory-excursion "bin"
704 (copy-files-to-directory (find-files ".") bin))
705 (with-directory-excursion "scmutils/manual"
706 (copy-files-to-directory (find-files ".") doc))
707 #t)))
c093f9f6 708 (add-after 'install 'emacs-helpers
595b1751
KK
709 ;; Add convenience Emacs commands to easily load the
710 ;; Scmutils band in an MIT-Scheme buffer inside of Emacs
711 ;; and to easily load code tags.
712 (lambda* (#:key inputs outputs #:allow-other-keys)
713 (let* ((out (assoc-ref outputs "out"))
714 (mit-root (assoc-ref inputs "mit-scheme"))
715 (emacs-lisp-dir
716 (string-append out "/share/emacs/site-lisp"
717 "/guix.d/" ,name "-" ,version))
718 (el-file (string-append emacs-lisp-dir
719 "/scmutils.el"))
720 (lib-relative-path
721 (string-append "/lib/mit-scheme-"
722 ,(system-suffix))))
723 (mkdir-p emacs-lisp-dir)
724 (call-with-output-file el-file
725 (lambda (p)
726 (format p
727 ";;;###autoload
c093f9f6
FB
728(defun scmutils-load ()
729 (interactive)
730 (require 'xscheme)
731 (let ((mit-root \"~a\")
732 (scmutils \"~a\"))
733 (run-scheme
734 (concat mit-root \"/bin/scheme --library \"
735 mit-root \"~a:\" scmutils \"~a\"
736 \" --band edwin-mechanics.com\"
737 \" --emacs\"))))
738
739;;;###autoload
740(defun scmutils-load-tags ()
741 (interactive)
742 (let ((scmutils \"~a\"))
743 (visit-tags-table (concat scmutils \"/TAGS\"))))
744"
745 mit-root out
746 lib-relative-path
747 lib-relative-path
748 (string-append out lib-relative-path
749 "/scmutils"))))
aad4a48a
FB
750 (emacs-generate-autoloads ,name emacs-lisp-dir)
751 (emacs-byte-compile-directory emacs-lisp-dir)
c093f9f6
FB
752 #t))))))
753 (home-page
754 "http://groups.csail.mit.edu/mac/users/gjs/6946/linux-install.htm")
755 (synopsis "Scmutils library for MIT Scheme")
756 (description "The Scmutils system is an integrated library of
757procedures, embedded in the programming language Scheme, and intended to
758support teaching and research in mathematical physics and electrical
759engineering.")
760 (license gpl2+))))
b9b447be
JN
761
762(define-public sicp
2705a97e 763 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
b9b447be
JN
764 (package
765 (name "sicp")
2705a97e 766 (version (string-append "20170703-1." (string-take commit 7)))
b9b447be
JN
767 (source (origin
768 (method git-fetch)
769 (uri (git-reference
770 (url "https://github.com/sarabander/sicp")
771 (commit commit)))
772 (sha256
773 (base32
2705a97e 774 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
b9b447be
JN
775 (file-name (string-append name "-" version "-checkout"))))
776 (build-system trivial-build-system)
777 (native-inputs `(("gzip" ,gzip)
778 ("source" ,source)
779 ("texinfo" ,texinfo)))
780 (arguments
781 `(#:modules ((guix build utils)
782 (srfi srfi-1)
783 (srfi srfi-26))
784 #:builder
785 (begin
786 (use-modules (guix build utils)
787 (srfi srfi-1)
788 (srfi srfi-26))
789 (let ((gzip (assoc-ref %build-inputs "gzip"))
790 (source (assoc-ref %build-inputs "source"))
791 (texinfo (assoc-ref %build-inputs "texinfo"))
01d71f62 792 (html-dir (string-append %output "/share/doc/" ,name "/html"))
b9b447be 793 (info-dir (string-append %output "/share/info")))
01d71f62 794 (copy-recursively (string-append source "/html") html-dir)
b9b447be
JN
795 (setenv "PATH" (string-append gzip "/bin"
796 ":" texinfo "/bin"))
797 (mkdir-p info-dir)
798 (and (zero?
799 (system* "makeinfo" "--output"
800 (string-append info-dir "/sicp.info")
801 (string-append source "/sicp-pocket.texi")))
802 (every zero?
803 (map (cut system* "gzip" "-9n" <>)
804 (find-files info-dir))))))))
805 (home-page "http://sarabander.github.io/sicp")
806 (synopsis "Structure and Interpretation of Computer Programs")
807 (description "Structure and Interpretation of Computer Programs (SICP) is
808a textbook aiming to teach the principles of computer programming.
809
810Using Scheme, a dialect of the Lisp programming language, the book explains
811core computer science concepts such as abstraction in programming,
812metalinguistic abstraction, recursion, interpreters, and modular programming.")
813 (license cc-by-sa4.0))))
8a0c2552 814
815(define-public scheme48-rx
7108ad5b
TGR
816 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
817 (revision "2"))
8a0c2552 818 (package
819 (name "scheme48-rx")
820 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
821 (source
822 (origin
823 (method git-fetch)
824 (uri (git-reference
825 (url "https://github.com/scheme/rx")
826 (commit commit)))
827 (sha256
828 (base32
7108ad5b 829 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
8a0c2552 830 (file-name (string-append name "-" version "-checkout"))))
831 (build-system trivial-build-system)
832 (arguments
833 `(#:modules ((guix build utils))
834 #:builder
835 (begin
836 (use-modules (guix build utils))
837 (let ((share (string-append %output
838 "/share/scheme48-"
839 ,(package-version scheme48)
840 "/rx")))
841 (chdir (assoc-ref %build-inputs "source"))
842 (mkdir-p share)
843 (copy-recursively "." share)))))
844 (native-inputs
845 `(("source" ,source)
846 ("scheme48" ,scheme48)))
847 (home-page "https://github.com/scheme/rx/")
848 (synopsis "SRE String pattern-matching library for scheme48")
849 (description
850 "String pattern-matching library for scheme48 based on the SRE
851regular-expression notation.")
852 (license bsd-3))))
07ef08a7
JD
853
854(define-public slib
855 (package
856 (name "slib")
857 (version "3b5")
858 (source (origin
859 (method url-fetch)
860 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
861 version ".zip"))
862 (sha256
863 (base32
864 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
865 (build-system gnu-build-system)
866 (arguments
867 `(#:tests? #f ; There is no check target.
868 #:phases
869 (modify-phases %standard-phases
870 (add-after 'install 'remove-bin-share
871 (lambda* (#:key inputs outputs #:allow-other-keys)
872 (delete-file-recursively
873 (string-append (assoc-ref outputs "out") "/bin"))))
874 (replace 'configure
875 (lambda* (#:key inputs outputs #:allow-other-keys)
876 (zero? (system* "./configure"
877 (string-append "--prefix="
878 (assoc-ref outputs "out")))))))))
879 (native-inputs `(("unzip" ,unzip)
880 ("texinfo" ,texinfo)))
30fd958e 881 (home-page "http://people.csail.mit.edu/jaffer/SLIB.html")
07ef08a7
JD
882 (synopsis "Compatibility and utility library for Scheme")
883 (description "SLIB is a portable Scheme library providing compatibility and
884utility functions for all standard Scheme implementations.")
885 (license (non-copyleft
886 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
887 "Or see COPYING in the distribution."))))
888
8c48d0eb
JD
889(define-public scm
890 (package
891 (name "scm")
892 (version "5f2")
893 (source (origin
894 (method url-fetch)
895 (uri (string-append
896 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
897 version ".zip"))
898 (sha256
899 (base32
900 "050ijb51jm1cij9g3r89zl9rawsrikhbb5y8zb7lspb7bsxq5w99"))))
901 (build-system gnu-build-system)
902 (arguments
903 `(#:phases
904 (modify-phases %standard-phases
905 (replace 'configure
906 (lambda* (#:key inputs outputs #:allow-other-keys)
907 (zero? (system* "./configure"
908 (string-append "--prefix="
909 (assoc-ref outputs "out"))))))
910 (add-before 'build 'pre-build
911 (lambda* (#:key inputs #:allow-other-keys)
912 (substitute* "Makefile"
913 (("ginstall-info") "install-info"))))
914 (replace 'build
915 (lambda* (#:key inputs outputs #:allow-other-keys)
916 (setenv "SCHEME_LIBRARY_PATH"
917 (string-append (assoc-ref inputs "slib")
918 "/lib/slib/"))
919 (and
920 (zero? (system* "make" "scmlit" "CC=gcc"))
921 (zero? (system* "make" "all")))))
922 (add-after 'install 'post-install
923 (lambda* (#:key inputs outputs #:allow-other-keys)
924 (let ((req
925 (string-append (assoc-ref outputs "out")
926 "/lib/scm/require.scm")))
927 (and
928 (delete-file req)
929 (format (open req (logior O_WRONLY O_CREAT))
930 "(define (library-vicinity) ~s)\n"
931 (string-append (assoc-ref inputs "slib")
932 "/lib/slib/"))
933
934 ;; We must generate the slibcat file
935 (zero? (system*
936 (string-append
937 (assoc-ref outputs "out")
938 "/bin/scm")
939 "-br" "new-catalog")))))))))
940 (inputs `(("slib" ,slib)))
941 (native-inputs `(("unzip" ,unzip)
942 ("texinfo" ,texinfo)))
943 (home-page "http://people.csail.mit.edu/jaffer/SCM")
944 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
945 (description "GNU SCM is an implementation of Scheme. This
946implementation includes Hobbit, a Scheme-to-C compiler, which can
947generate C files whose binaries can be dynamically or statically
948linked with a SCM executable.")
949 (license lgpl3+)))