gnu: Add libplist.
[jackhill/guix/guix.git] / gnu / packages / scheme.scm
CommitLineData
e117772d 1;;; GNU Guix --- Functional package management for GNU
d4bd8762 2;;; Copyright © 2013, 2014, 2015, 2016, 2018 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>
4a78fd46 8;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
07ef08a7 9;;; Copyright © 2017 John Darrington <jmd@gnu.org>
01d71f62 10;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
e39631a9 11;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
44fa8431 12;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
eac7ed19 13;;; Copyright © 2018 Gabriel Hondet <gabrielhondet@gmail.com>
e117772d
LC
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
1ffa7090 30(define-module (gnu packages scheme)
59a43334 31 #:use-module (gnu packages)
bc73a843 32 #:use-module ((guix licenses)
07ef08a7
JD
33 #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
34 cc-by-sa4.0 non-copyleft))
e117772d
LC
35 #:use-module (guix packages)
36 #:use-module (guix download)
b9b447be 37 #:use-module (guix git-download)
07f4aef0 38 #:use-module (guix utils)
e117772d 39 #:use-module (guix build-system gnu)
b9b447be 40 #:use-module (guix build-system trivial)
fbf7b7e9 41 #:use-module (gnu packages autotools)
5e3ea571 42 #:use-module (gnu packages bdw-gc)
549f9512 43 #:use-module (gnu packages compression)
cd0322a3 44 #:use-module (gnu packages databases)
5e3ea571
KK
45 #:use-module (gnu packages libevent)
46 #:use-module (gnu packages libunistring)
1ffa7090
LC
47 #:use-module (gnu packages m4)
48 #:use-module (gnu packages multiprecision)
549f9512 49 #:use-module (gnu packages ncurses)
5e3ea571 50 #:use-module (gnu packages pcre)
1ffa7090 51 #:use-module (gnu packages emacs)
549f9512
FB
52 #:use-module (gnu packages ghostscript)
53 #:use-module (gnu packages netpbm)
1ffa7090 54 #:use-module (gnu packages texinfo)
8f9ac901 55 #:use-module (gnu packages tex)
ce0614dd 56 #:use-module (gnu packages base)
b9b447be 57 #:use-module (gnu packages compression)
cf53ecf5
LC
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages avahi)
60 #:use-module (gnu packages libphidget)
ffc13e75 61 #:use-module (gnu packages gcc)
30645251 62 #:use-module (gnu packages glib)
9d3c4dae 63 #:use-module (gnu packages gtk)
30645251 64 #:use-module (gnu packages libffi)
d3206af6 65 #:use-module (gnu packages fontutils)
e55354b8 66 #:use-module (gnu packages image)
bc11c72c 67 #:use-module (gnu packages xorg)
cd0322a3 68 #:use-module (gnu packages sqlite)
782170c4
SB
69 #:use-module (gnu packages tls)
70 #:use-module (gnu packages gl)
e0b49c78 71 #:use-module (gnu packages libedit)
e83c7d1a 72 #:use-module (srfi srfi-1)
e117772d
LC
73 #:use-module (ice-9 match))
74
a0efb39a 75(define (mit-scheme-source-directory system version)
ecb26c10
AE
76 (string-append "mit-scheme-"
77 (if (or (string-prefix? "x86_64" system)
a0efb39a 78 (string-prefix? "i686" system))
ecb26c10
AE
79 ""
80 "c-")
81 version))
82
e117772d
LC
83(define-public mit-scheme
84 (package
85 (name "mit-scheme")
d870cc5e 86 (version "10.1.3")
e117772d 87 (source #f) ; see below
f163c290 88 (outputs '("out" "doc"))
e117772d
LC
89 (build-system gnu-build-system)
90 (arguments
fbf7b7e9 91 `(#:modules ((guix build gnu-build-system)
f163c290
FB
92 (guix build utils)
93 (srfi srfi-1))
e117772d 94 #:phases
af00e633
FB
95 (modify-phases %standard-phases
96 (replace 'unpack
97 (lambda* (#:key inputs #:allow-other-keys)
e39631a9
TGR
98 (invoke "tar" "xzvf"
99 (assoc-ref inputs "source"))
100 (chdir ,(mit-scheme-source-directory (%current-system)
101 version))
102 ;; Delete these dangling symlinks since they break
103 ;; `patch-shebangs'.
104 (for-each delete-file
d870cc5e 105 (find-files "src/compiler" "^make\\."))
e39631a9
TGR
106 (chdir "src")
107 #t))
fbf7b7e9
KK
108 (add-after 'unpack 'patch-/bin/sh
109 (lambda _
110 (setenv "CONFIG_SHELL" (which "sh"))
111 (substitute* '("../tests/ffi/autogen.sh"
112 "../tests/ffi/autobuild.sh"
113 "../tests/ffi/test-ffi.sh"
114 "../tests/runtime/test-process.scm"
115 "runtime/unxprm.scm")
116 (("/bin/sh") (which "sh"))
117 (("\\./autogen\\.sh")
118 (string-append (which "sh") " autogen.sh"))
119 (("\\./configure")
120 (string-append (which "sh") " configure")))
121 #t))
9b02a79b
PN
122 ;; FIXME: the texlive-union insists on regenerating fonts. It stores
123 ;; them in HOME, so it needs to be writeable.
124 (add-before 'build 'set-HOME
125 (lambda _ (setenv "HOME" "/tmp") #t))
af00e633
FB
126 (replace 'build
127 (lambda* (#:key system outputs #:allow-other-keys)
128 (let ((out (assoc-ref outputs "out")))
129 (if (or (string-prefix? "x86_64" system)
130 (string-prefix? "i686" system))
e39631a9
TGR
131 (invoke "make" "compile-microcode")
132 (invoke "./etc/make-liarc.sh"
133 (string-append "--prefix=" out)))
134 #t)))
f163c290
FB
135 (add-after 'configure 'configure-doc
136 (lambda* (#:key outputs inputs #:allow-other-keys)
137 (with-directory-excursion "../doc"
138 (let* ((out (assoc-ref outputs "out"))
139 (bash (assoc-ref inputs "bash"))
140 (bin/sh (string-append bash "/bin/sh")))
e39631a9
TGR
141 (invoke bin/sh "./configure"
142 (string-append "--prefix=" out)
143 (string-append "SHELL=" bin/sh))
f163c290
FB
144 #t))))
145 (add-after 'build 'build-doc
146 (lambda* _
147 (with-directory-excursion "../doc"
e39631a9
TGR
148 (invoke "make"))
149 #t))
f163c290
FB
150 (add-after 'install 'install-doc
151 (lambda* (#:key outputs #:allow-other-keys)
152 (let* ((out (assoc-ref outputs "out"))
153 (doc (assoc-ref outputs "doc"))
154 (old-doc-dir (string-append out "/share/doc"))
155 (new-doc/mit-scheme-dir
156 (string-append doc "/share/doc/" ,name "-" ,version)))
157 (with-directory-excursion "../doc"
158 (for-each (lambda (target)
e39631a9 159 (invoke "make" target))
d870cc5e 160 '("install-info-gz" "install-man"
f163c290
FB
161 "install-html" "install-pdf")))
162 (mkdir-p new-doc/mit-scheme-dir)
163 (copy-recursively
d870cc5e 164 (string-append old-doc-dir "/" ,name)
f163c290
FB
165 new-doc/mit-scheme-dir)
166 (delete-file-recursively old-doc-dir)
167 #t))))))
168 (native-inputs
fbf7b7e9
KK
169 `(;; Autoconf, Automake, and Libtool are necessary for the FFI tests.
170 ("autoconf" ,autoconf)
171 ("automake" ,automake)
172 ("libtool" ,libtool)
173 ("texlive" ,(texlive-union (list texlive-tex-texinfo)))
f163c290
FB
174 ("texinfo" ,texinfo)
175 ("m4" ,m4)))
e117772d 176 (inputs
f163c290 177 `(("libx11" ,libx11)
e117772d
LC
178
179 ("source"
dd6b9a37
LC
180
181 ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
182 ;; compile from the architecture-specific tarballs, which contain
183 ;; pre-built binaries. It leads to more efficient code than when
184 ;; building the tarball that contains generated C code instead of
185 ;; those binaries.
186 ,(origin
187 (method url-fetch)
188 (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
189 version "/mit-scheme-"
dd6b9a37 190 (match (%current-system)
ecb26c10
AE
191 ("x86_64-linux"
192 (string-append version "-x86-64"))
193 ("i686-linux"
966629a1
LC
194 (string-append version "-i386"))
195 (_
196 (string-append "c-" version)))
dd6b9a37
LC
197 ".tar.gz"))
198 (sha256
199 (match (%current-system)
200 ("x86_64-linux"
201 (base32
d870cc5e 202 "03m7cc035w3avs91j2pcz9f15ssgvgp3rm045d1vbydqrkzfyw8k"))
dd6b9a37
LC
203 ("i686-linux"
204 (base32
7d6cfa44
EF
205 "05sjyz90xxfnmi87qv8x0yx0fcallnzl1dciygdafp317pn489is"))
206 (_
207 (base32
208 ""))))))))
75af27f7
LC
209
210 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
d870cc5e
KK
211 ;; Also, the portable C version of MIT/GNU Scheme did not work in time for
212 ;; release in version 10.1.
213 (supported-systems '("x86_64-linux" "i686-linux"))
75af27f7 214
6fd52309 215 (home-page "https://www.gnu.org/software/mit-scheme/")
a2b63d58 216 (synopsis "A Scheme implementation with integrated editor and debugger")
e117772d 217 (description
79c311b8 218 "GNU/MIT Scheme is an implementation of the Scheme programming
a22dc0c4
LC
219language. It provides an interpreter, a compiler and a debugger. It also
220features an integrated Emacs-like editor and a large runtime library.")
63e8bb12
LC
221 (license gpl2+)
222 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
e117772d
LC
223
224(define-public bigloo
1fe1bb96
LC
225 ;; Upstream modifies source tarballs in place, making significant changes
226 ;; long after the initial publication: <https://bugs.gnu.org/33525>. For
227 ;; transparency, we give this "second 4.3b" release a different version
228 ;; number.
deaf0e7b 229 (let ((upstream-version "4.3e"))
1fe1bb96
LC
230 (package
231 (name "bigloo")
deaf0e7b 232 (version "4.3e1")
1fe1bb96
LC
233 (source (origin
234 (method url-fetch)
235 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
236 upstream-version ".tar.gz"))
237 (sha256
238 (base32
deaf0e7b 239 "12k1kxyn3yilba0508xh8wkrw6279gnghzqi0bs2ayf5d2wkqdj3"))
1fe1bb96
LC
240 ;; Remove bundled libraries.
241 (modules '((guix build utils)))
242 (snippet
243 '(begin
244 (for-each delete-file-recursively
245 '("gc" "gmp" "libuv"))
246 #t))))
247 (build-system gnu-build-system)
248 (arguments
249 `(#:test-target "test"
250 #:phases
251 (modify-phases %standard-phases
252 (replace 'configure
253 (lambda* (#:key inputs outputs #:allow-other-keys)
e117772d 254
1fe1bb96
LC
255 (substitute* "configure"
256 (("^shell=.*$")
257 (string-append "shell=" (which "bash") "\n"))
258 (("`date`") "0"))
259 (substitute* "autoconf/runtest.in"
260 ((", @DATE@") ""))
261 (substitute* "autoconf/osversion"
262 (("^version.*$") "version=\"\"\n"))
263 (substitute* "comptime/Makefile"
264 (("\\$\\(LDCOMPLIBS\\)")
265 "$(LDCOMPLIBS) $(LDFLAGS)"))
e117772d 266
1fe1bb96
LC
267 ;; The `configure' script doesn't understand options
268 ;; of those of Autoconf.
269 (let ((out (assoc-ref outputs "out")))
270 (invoke "./configure"
271 (string-append "--prefix=" out)
272 ; use system libraries
273 "--customgc=no"
274 "--customunistring=no"
275 "--customlibuv=no"
276 (string-append"--mv=" (which "mv"))
277 (string-append "--rm=" (which "rm"))
278 "--cflags=-fPIC"
279 (string-append "--ldflags=-Wl,-rpath="
280 (assoc-ref outputs "out")
281 "/lib/bigloo/" ,upstream-version)
282 (string-append "--lispdir=" out
283 "/share/emacs/site-lisp")
284 "--sharedbde=yes"
285 "--sharedcompiler=yes"
286 "--disable-patch"))))
287 (add-after 'install 'install-emacs-modes
288 (lambda* (#:key outputs #:allow-other-keys)
289 (let* ((out (assoc-ref outputs "out"))
290 (dir (string-append out "/share/emacs/site-lisp")))
291 (invoke "make" "-C" "bmacs" "all" "install"
292 (string-append "EMACSBRAND=emacs25")
293 (string-append "EMACSDIR=" dir))))))))
294 (inputs
295 `(("emacs" ,emacs) ;UDE needs the X version of Emacs
296 ("libgc" ,libgc)
297 ("libunistring" ,libunistring)
298 ("libuv" ,libuv)
299 ("openssl" ,openssl)
300 ("sqlite" ,sqlite)
cf53ecf5 301
1fe1bb96
LC
302 ;; Optional APIs for which Bigloo has bindings.
303 ("avahi" ,avahi)
304 ("libphidget" ,libphidget)
305 ("pcre" ,pcre)))
306 (native-inputs
307 `(("pkg-config" ,pkg-config)))
308 (propagated-inputs
309 `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
310 (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
311 (synopsis "Efficient Scheme compiler")
312 (description
313 "Bigloo is a Scheme implementation devoted to one goal: enabling Scheme
314based programming style where C(++) is usually required. Bigloo attempts to
315make Scheme practical by offering features usually presented by traditional
316programming languages but not offered by Scheme and functional programming.
317Bigloo compiles Scheme modules. It delivers small and fast stand alone binary
318executables. Bigloo enables full connections between Scheme and C programs
319and between Scheme and Java programs.")
320 (license gpl2+))))
e6e82f62
LC
321
322(define-public hop
323 (package
324 (name "hop")
697b6ca3 325 (version "3.2.0-pre1")
e6e82f62
LC
326 (source (origin
327 (method url-fetch)
328 (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
329 version ".tar.gz"))
330 (sha256
331 (base32
697b6ca3 332 "0jf418d0s9imv98s6qrpjxr1mdaxr37knh5qyfl5y4a9cc41mlg5"))))
e6e82f62
LC
333 (build-system gnu-build-system)
334 (arguments
082725b5
KK
335 `(#:test-target "test"
336 #:make-flags '("BIGLOO=bigloo")
337 #:parallel-build? #f
338 #:phases
04014de6
EF
339 (modify-phases %standard-phases
340 (replace 'configure
082725b5 341 (lambda* (#:key inputs outputs #:allow-other-keys)
04014de6 342 (let ((out (assoc-ref outputs "out")))
697b6ca3
KK
343 (substitute* '("tools/Makefile"
344 "test/hopjs/TEST.in")
345 (("/bin/rm") (which "rm")))
24674e61
TGR
346 (invoke "./configure"
347 (string-append "--prefix=" out)
697b6ca3 348 "--hostcc=gcc"
24674e61
TGR
349 (string-append "--blflags="
350 ;; user flags completely override useful
351 ;; default flags, so repeat them here.
352 "-copt \\$(CPICFLAGS) "
353 "-L \\$(BUILDLIBDIR) "
354 "-ldopt -Wl,-rpath," out "/lib"))))))))
a394c60a
AE
355 (inputs `(("avahi" ,avahi)
356 ("bigloo" ,bigloo)
082725b5
KK
357 ("libgc" ,libgc)
358 ("libunistring" ,libunistring)
359 ("libuv" ,libuv)
360 ("pcre" ,pcre)
361 ("sqlite" ,sqlite)
8a629613 362 ("which" ,which)))
e6e82f62 363 (home-page "http://hop.inria.fr/")
9e771e3b 364 (synopsis "Multi-tier programming language for the Web 2.0")
e6e82f62
LC
365 (description
366 "HOP is a multi-tier programming language for the Web 2.0 and the
367so-called diffuse Web. It is designed for programming interactive web
368applications in many fields such as multimedia (web galleries, music players,
369...), ubiquitous and house automation (SmartPhones, personal appliance),
370mashups, office (web agendas, mail clients, ...), etc.")
371 (license gpl2+)))
8cc9e7f9
LC
372
373(define-public chicken
374 (package
375 (name "chicken")
402c36c1 376 (version "5.0.0")
8cc9e7f9 377 (source (origin
b9b6db45 378 (method url-fetch)
359e9c42 379 (uri (string-append "https://code.call-cc.org/releases/"
b9b6db45 380 version "/chicken-" version ".tar.gz"))
b9b6db45
KK
381 (sha256
382 (base32
402c36c1 383 "15b5yrzfa8aimzba79x7v6y282f898rxqxfxrr446sjx9jwlpfd8"))))
8cc9e7f9
LC
384 (build-system gnu-build-system)
385 (arguments
386 `(#:modules ((guix build gnu-build-system)
387 (guix build utils)
388 (srfi srfi-1))
44fa8431 389
8cc9e7f9
LC
390 ;; No `configure' script; run "make check" after "make install" as
391 ;; prescribed by README.
acb38070
RW
392 #:phases
393 (modify-phases %standard-phases
394 (delete 'configure)
395 (delete 'check)
396 (add-after 'install 'check
b9b6db45 397 (assoc-ref %standard-phases 'check)))
8cc9e7f9
LC
398
399 #:make-flags (let ((out (assoc-ref %outputs "out")))
400 (list "PLATFORM=linux"
401 (string-append "PREFIX=" out)
402 (string-append "VARDIR=" out "/var/lib")))
403
404 ;; Parallel builds are not supported, as noted in README.
405 #:parallel-build? #f))
406 (home-page "http://www.call-cc.org/")
407 (synopsis "R5RS Scheme implementation that compiles native code via C")
408 (description
409 "CHICKEN is a compiler for the Scheme programming language. CHICKEN
410produces portable and efficient C, supports almost all of the R5RS Scheme
2c4b49ed 411language standard, and includes many enhancements and extensions.")
8cc9e7f9 412 (license bsd-3)))
f7ce90e7
LC
413
414(define-public scheme48
415 (package
416 (name "scheme48")
5c4d98ab 417 (version "1.9.2")
f7ce90e7
LC
418 (source (origin
419 (method url-fetch)
420 (uri (string-append "http://s48.org/" version
421 "/scheme48-" version ".tgz"))
422 (sha256
423 (base32
5c4d98ab 424 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
fc1adab1 425 (patches (search-patches "scheme48-tests.patch"))))
f7ce90e7 426 (build-system gnu-build-system)
f7ce90e7
LC
427 (home-page "http://s48.org/")
428 (synopsis "Scheme implementation using a bytecode interpreter")
429 (description
430 "Scheme 48 is an implementation of Scheme based on a byte-code
431interpreter and is designed to be used as a testbed for experiments in
432implementation techniques and as an expository tool.")
433
434 ;; Most files are BSD-3; see COPYING for the few exceptions.
435 (license bsd-3)))
30645251
LC
436
437(define-public racket
438 (package
439 (name "racket")
e0b49c78 440 (version "7.0")
30645251 441 (source (origin
e0b49c78
KH
442 (method url-fetch)
443 (uri (list (string-append "http://mirror.racket-lang.org/installers/"
444 version "/racket-" version "-src.tgz")
445 (string-append
446 "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
447 version "/racket-" version "-src.tgz")))
448 (sha256
449 (base32
450 "1glv5amsp9xp480d4yr63hhm9kkyav06yl3a6p489nkr4cln0j9a"))
451 (patches (search-patches
452 "racket-store-checksum-override.patch"))))
30645251
LC
453 (build-system gnu-build-system)
454 (arguments
455 '(#:phases
dc1d3cde
KK
456 (modify-phases %standard-phases
457 (add-before 'configure 'pre-configure
458 (lambda* (#:key inputs #:allow-other-keys)
459 ;; Patch dynamically loaded libraries with their absolute paths.
460 (let* ((library-path (search-path-as-string->list
461 (getenv "LIBRARY_PATH")))
462 (find-so (lambda (soname)
463 (search-path
464 library-path
465 (format #f "~a.so" soname))))
466 (patch-ffi-libs (lambda (file libs)
467 (for-each
468 (lambda (lib)
469 (substitute* file
470 (((format #f "\"~a\"" lib))
471 (format #f "\"~a\"" (find-so lib)))))
472 libs))))
473 (substitute* "collects/db/private/sqlite3/ffi.rkt"
474 (("ffi-lib sqlite-so")
475 (format #f "ffi-lib \"~a\"" (find-so "libsqlite3"))))
476 (substitute* "collects/openssl/libssl.rkt"
477 (("ffi-lib libssl-so")
478 (format #f "ffi-lib \"~a\"" (find-so "libssl"))))
479 (substitute* "collects/openssl/libcrypto.rkt"
480 (("ffi-lib libcrypto-so")
481 (format #f "ffi-lib \"~a\"" (find-so "libcrypto"))))
482 (substitute* "share/pkgs/math-lib/math/private/bigfloat/gmp.rkt"
483 (("ffi-lib libgmp-so")
484 (format #f "ffi-lib \"~a\"" (find-so "libgmp"))))
485 (substitute* "share/pkgs/math-lib/math/private/bigfloat/mpfr.rkt"
486 (("ffi-lib libmpfr-so")
487 (format #f "ffi-lib \"~a\"" (find-so "libmpfr"))))
26700cae
SB
488 (substitute* "share/pkgs/readline-lib/readline/rktrl.rkt"
489 (("\\(getenv \"PLT_READLINE_LIB\"\\)")
490 (format #f "\"~a\"" (find-so "libedit"))))
dc1d3cde
KK
491 (for-each
492 (lambda (x) (apply patch-ffi-libs x))
493 '(("share/pkgs/draw-lib/racket/draw/unsafe/cairo-lib.rkt"
494 ("libfontconfig" "libcairo"))
495 ("share/pkgs/draw-lib/racket/draw/unsafe/glib.rkt"
496 ("libglib-2.0" "libgmodule-2.0" "libgobject-2.0"))
497 ("share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt"
498 ("libjpeg"))
499 ("share/pkgs/draw-lib/racket/draw/unsafe/pango.rkt"
500 ("libpango-1.0" "libpangocairo-1.0"))
501 ("share/pkgs/draw-lib/racket/draw/unsafe/png.rkt"
502 ("libpng"))
503 ("share/pkgs/db-lib/db/private/odbc/ffi.rkt"
504 ("libodbc"))
505 ("share/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt"
506 ("libX11"))
507 ("share/pkgs/gui-lib/mred/private/wx/gtk/gsettings.rkt"
508 ("libgio-2.0"))
509 ("share/pkgs/gui-lib/mred/private/wx/gtk/gtk3.rkt"
510 ("libgdk-3" "libgtk-3"))
511 ("share/pkgs/gui-lib/mred/private/wx/gtk/unique.rkt"
512 ("libunique-1.0"))
513 ("share/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
514 ("libgdk-x11-2.0" "libgdk_pixbuf-2.0" "libgtk-x11-2.0"))
515 ("share/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt"
516 ("libGL"))
517 ("share/pkgs/sgl/gl.rkt"
26700cae 518 ("libGL" "libGLU")))))
dc1d3cde
KK
519 (chdir "src")
520 #t))
521 (add-after 'unpack 'patch-/bin/sh
522 (lambda _
523 (substitute* "collects/racket/system.rkt"
524 (("/bin/sh") (which "sh")))
525 #t)))
e0b49c78 526 #:tests? #f ; XXX: how to run them?
30645251 527 ))
782170c4
SB
528 (inputs
529 `(("libffi" ,libffi)
530 ;; Hardcode dynamically loaded libraries for better functionality.
531 ;; sqlite and libraries for `racket/draw' are needed to build the doc.
532 ("cairo" ,cairo)
533 ("fontconfig" ,fontconfig)
534 ("glib" ,glib)
535 ("glu" ,glu)
536 ("gmp" ,gmp)
e0b49c78 537 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
782170c4
SB
538 ("libjpeg" ,libjpeg)
539 ("libpng" ,libpng)
540 ("libx11" ,libx11)
541 ("mesa" ,mesa)
542 ("mpfr" ,mpfr)
543 ("openssl" ,openssl)
544 ("pango" ,pango)
545 ("sqlite" ,sqlite)
e0b49c78
KH
546 ("unixodbc" ,unixodbc)
547 ("libedit" ,libedit)))
30645251
LC
548 (home-page "http://racket-lang.org")
549 (synopsis "Implementation of Scheme and related languages")
550 (description
551 "Racket is an implementation of the Scheme programming language (R5RS and
552R6RS) and related languages, such as Typed Racket. It features a compiler and
553a virtual machine with just-in-time native compilation, as well as a large set
554of libraries.")
39d0ce93 555 (license lgpl2.0+)))
07f4aef0
TUBK
556
557(define-public gambit-c
558 (package
559 (name "gambit-c")
cb3854cd 560 (version "4.9.1")
07f4aef0
TUBK
561 (source
562 (origin
563 (method url-fetch)
564 (uri (string-append
565 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
9ba88890 566 (version-major+minor version) "/source/gambit-v"
07f4aef0
TUBK
567 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
568 ".tgz"))
569 (sha256
cb3854cd 570 (base32 "14x9xa0yh7187alzw2m937jnh4csj0dyywi3va8bhi7aaw4p5qai"))))
07f4aef0
TUBK
571 (build-system gnu-build-system)
572 (arguments
573 '(#:configure-flags
574 ;; According to the ./configure script, this makes the build slower and
575 ;; use >= 1 GB memory, but makes Gambit much faster.
4be83af4 576 '("--enable-single-host")))
cb3854cd 577 (home-page "http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page")
07f4aef0
TUBK
578 (synopsis "Efficient Scheme interpreter and compiler")
579 (description
580 "Gambit consists of two main programs: gsi, the Gambit Scheme
581interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
582the complete execution and debugging environment. The compiler is the
583interpreter extended with the capability of generating executable files. The
584compiler can produce standalone executables or compiled modules which can be
585loaded at run time. Interpreted code and compiled code can be freely
586mixed.")
587 ;; Dual license.
588 (license (list lgpl2.1+ asl2.0))))
3e92f4f9
TUBK
589
590(define-public chibi-scheme
591 (package
592 (name "chibi-scheme")
51960939 593 (version "0.7.3")
3e92f4f9
TUBK
594 (source
595 (origin
596 (method url-fetch)
51960939
TUBK
597 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
598 version ".tar.gz"))
3e92f4f9 599 (sha256
51960939
TUBK
600 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
601 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
3e92f4f9
TUBK
602 (build-system gnu-build-system)
603 (arguments
4a187c55
LC
604 `(#:phases (modify-phases %standard-phases
605 (delete 'configure)
606 (add-before 'build 'set-cc
607 (lambda _
608 (setenv "CC" "gcc"))))
3e92f4f9
TUBK
609 #:make-flags (let ((out (assoc-ref %outputs "out")))
610 (list (string-append "PREFIX=" out)
611 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
612 #:test-target "test"))
50995554 613 (home-page "https://github.com/ashinn/chibi-scheme")
3e92f4f9
TUBK
614 (synopsis "Small embeddable Scheme implementation")
615 (description
616 "Chibi-Scheme is a very small library with no external dependencies
617intended for use as an extension and scripting language in C programs. In
618addition to support for lightweight VM-based threads, each VM itself runs in
619an isolated heap allowing multiple VMs to run simultaneously in different OS
620threads.")
621 (license bsd-3)))
c093f9f6 622
c093f9f6
FB
623(define-public scmutils
624 (let ()
625 (define (system-suffix)
626 (cond
627 ((string-prefix? "x86_64" (or (%current-target-system)
628 (%current-system)))
629 "x86-64")
630 (else "i386")))
631
632 (package
633 (name "scmutils")
595b1751 634 (version "20160827")
c093f9f6
FB
635 (source
636 (origin
95001d4b 637 (method url-fetch/tarbomb)
c093f9f6 638 (modules '((guix build utils)))
6cbee49d
MW
639 (snippet '(begin
640 ;; Remove binary code
641 (delete-file-recursively "scmutils/mit-scheme")
642 #t))
c093f9f6
FB
643 (uri (string-append "http://groups.csail.mit.edu/mac/users/gjs/6946"
644 "/scmutils-tarballs/" name "-" version
645 "-x86-64-gnu-linux.tar.gz"))
646 (sha256
595b1751 647 (base32 "00ly5m0s4dy5kxravjaqlpii5zcnr6b9nqm0607lr7xcs52i4j8b"))))
c093f9f6
FB
648 (build-system gnu-build-system)
649 (inputs
650 `(("mit-scheme" ,mit-scheme)
b8fc3622 651 ("emacs" ,emacs-minimal)))
c093f9f6
FB
652 (arguments
653 `(#:tests? #f ;; no tests-suite
654 #:modules ((guix build gnu-build-system)
655 (guix build utils)
656 (guix build emacs-utils))
657 #:imported-modules (,@%gnu-build-system-modules
658 (guix build emacs-utils))
659 #:phases
660 (modify-phases %standard-phases
661 (replace 'configure
595b1751
KK
662 ;; No standard build procedure is used. We set the correct
663 ;; runtime path in the custom build system.
664 (lambda* (#:key outputs #:allow-other-keys)
665 (let ((out (assoc-ref outputs "out")))
666 ;; Required to find .bci files at runtime.
667 (with-directory-excursion "scmutils"
668 (rename-file "src" "scmutils"))
669 (substitute* "scmutils/scmutils/load.scm"
670 (("/usr/local/scmutils/")
671 (string-append out "/lib/mit-scheme-"
672 ,(system-suffix) "/")))
673 #t)))
c093f9f6 674 (replace 'build
595b1751
KK
675 ;; Compile the code and build a band.
676 (lambda* (#:key outputs #:allow-other-keys)
677 (let* ((out (assoc-ref outputs "out"))
678 (make-img (string-append
679 "echo '(load \"load\") "
680 "(disk-save \"edwin-mechanics.com\")'"
681 "| mit-scheme")))
682 (with-directory-excursion "scmutils/scmutils"
683 (and (zero? (system "mit-scheme < compile.scm"))
b69819d8
TGR
684 (zero? (system make-img))))
685 #t)))
c093f9f6 686 (add-before 'install 'fix-directory-names
595b1751
KK
687 ;; Correct directory names in the startup script.
688 (lambda* (#:key inputs outputs #:allow-other-keys)
689 (let* ((out (assoc-ref outputs "out"))
690 (scm-root (assoc-ref inputs "mit-scheme")))
691 (substitute* "bin/mechanics"
692 (("ROOT=\"\\$\\{SCMUTILS_ROOT:-/.*\\}\"")
693 (string-append
694 "ROOT=\"${SCMUTILS_ROOT:-" scm-root "}\"\n"
695 "LIB=\"${ROOT}/lib/mit-scheme-"
696 ,(system-suffix) ":"
697 out "/lib/mit-scheme-" ,(system-suffix) "\""))
698 (("EDWIN_INFO_DIRECTORY=.*\n") "")
699 (("SCHEME=.*\n")
700 (string-append "SCHEME=\"${ROOT}/bin/scheme "
701 "--library ${LIB}\"\n"))
702 (("export EDWIN_INFO_DIRECTORY") ""))
703 #t)))
c093f9f6 704 (add-before 'install 'emacs-tags
595b1751
KK
705 ;; Generate Emacs's tags for easy reference to source
706 ;; code.
707 (lambda* (#:key inputs outputs #:allow-other-keys)
708 (with-directory-excursion "scmutils/scmutils"
b69819d8
TGR
709 (apply invoke "etags" (find-files "." "\\.scm")))
710 #t))
c093f9f6 711 (replace 'install
595b1751
KK
712 ;; Copy files to the store.
713 (lambda* (#:key outputs #:allow-other-keys)
714 (define* (copy-files-to-directory files dir
715 #:optional (delete? #f))
716 (for-each (lambda (f)
717 (copy-file f (string-append dir "/" f))
718 (when delete? (delete-file f)))
719 files))
c093f9f6 720
595b1751
KK
721 (let* ((out (assoc-ref outputs "out"))
722 (bin (string-append out "/bin"))
723 (doc (string-append out "/share/doc/"
724 ,name "-" ,version))
725 (lib (string-append out "/lib/mit-scheme-"
726 ,(system-suffix)
727 "/scmutils")))
728 (for-each mkdir-p (list lib doc bin))
729 (with-directory-excursion "scmutils/scmutils"
730 (copy-files-to-directory '("COPYING" "LICENSE")
731 doc #t)
732 (for-each delete-file (find-files "." "\\.bin"))
733 (copy-files-to-directory '("edwin-mechanics.com")
734 (string-append lib "/..") #t)
735 (copy-recursively "." lib))
736 (with-directory-excursion "bin"
737 (copy-files-to-directory (find-files ".") bin))
738 (with-directory-excursion "scmutils/manual"
739 (copy-files-to-directory (find-files ".") doc))
740 #t)))
c093f9f6 741 (add-after 'install 'emacs-helpers
595b1751
KK
742 ;; Add convenience Emacs commands to easily load the
743 ;; Scmutils band in an MIT-Scheme buffer inside of Emacs
744 ;; and to easily load code tags.
745 (lambda* (#:key inputs outputs #:allow-other-keys)
746 (let* ((out (assoc-ref outputs "out"))
747 (mit-root (assoc-ref inputs "mit-scheme"))
748 (emacs-lisp-dir
749 (string-append out "/share/emacs/site-lisp"
750 "/guix.d/" ,name "-" ,version))
751 (el-file (string-append emacs-lisp-dir
752 "/scmutils.el"))
753 (lib-relative-path
754 (string-append "/lib/mit-scheme-"
755 ,(system-suffix))))
756 (mkdir-p emacs-lisp-dir)
757 (call-with-output-file el-file
758 (lambda (p)
759 (format p
760 ";;;###autoload
c093f9f6
FB
761(defun scmutils-load ()
762 (interactive)
763 (require 'xscheme)
764 (let ((mit-root \"~a\")
765 (scmutils \"~a\"))
766 (run-scheme
767 (concat mit-root \"/bin/scheme --library \"
768 mit-root \"~a:\" scmutils \"~a\"
769 \" --band edwin-mechanics.com\"
770 \" --emacs\"))))
771
772;;;###autoload
773(defun scmutils-load-tags ()
774 (interactive)
775 (let ((scmutils \"~a\"))
776 (visit-tags-table (concat scmutils \"/TAGS\"))))
777"
778 mit-root out
779 lib-relative-path
780 lib-relative-path
781 (string-append out lib-relative-path
782 "/scmutils"))))
aad4a48a
FB
783 (emacs-generate-autoloads ,name emacs-lisp-dir)
784 (emacs-byte-compile-directory emacs-lisp-dir)
c093f9f6
FB
785 #t))))))
786 (home-page
787 "http://groups.csail.mit.edu/mac/users/gjs/6946/linux-install.htm")
788 (synopsis "Scmutils library for MIT Scheme")
789 (description "The Scmutils system is an integrated library of
790procedures, embedded in the programming language Scheme, and intended to
791support teaching and research in mathematical physics and electrical
792engineering.")
793 (license gpl2+))))
b9b447be
JN
794
795(define-public sicp
2705a97e 796 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
b9b447be
JN
797 (package
798 (name "sicp")
2705a97e 799 (version (string-append "20170703-1." (string-take commit 7)))
b9b447be
JN
800 (source (origin
801 (method git-fetch)
802 (uri (git-reference
803 (url "https://github.com/sarabander/sicp")
804 (commit commit)))
805 (sha256
806 (base32
2705a97e 807 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
b9b447be
JN
808 (file-name (string-append name "-" version "-checkout"))))
809 (build-system trivial-build-system)
810 (native-inputs `(("gzip" ,gzip)
811 ("source" ,source)
812 ("texinfo" ,texinfo)))
813 (arguments
814 `(#:modules ((guix build utils)
815 (srfi srfi-1)
816 (srfi srfi-26))
817 #:builder
818 (begin
819 (use-modules (guix build utils)
820 (srfi srfi-1)
821 (srfi srfi-26))
822 (let ((gzip (assoc-ref %build-inputs "gzip"))
823 (source (assoc-ref %build-inputs "source"))
824 (texinfo (assoc-ref %build-inputs "texinfo"))
01d71f62 825 (html-dir (string-append %output "/share/doc/" ,name "/html"))
b9b447be 826 (info-dir (string-append %output "/share/info")))
01d71f62 827 (copy-recursively (string-append source "/html") html-dir)
b9b447be
JN
828 (setenv "PATH" (string-append gzip "/bin"
829 ":" texinfo "/bin"))
830 (mkdir-p info-dir)
09b8c04e
MW
831 (invoke "makeinfo" "--output"
832 (string-append info-dir "/sicp.info")
833 (string-append source "/sicp-pocket.texi"))
834 (for-each (cut invoke "gzip" "-9n" <>)
835 (find-files info-dir))
836 #t))))
0e0015f2 837 (home-page "https://sarabander.github.io/sicp")
b9b447be
JN
838 (synopsis "Structure and Interpretation of Computer Programs")
839 (description "Structure and Interpretation of Computer Programs (SICP) is
840a textbook aiming to teach the principles of computer programming.
841
842Using Scheme, a dialect of the Lisp programming language, the book explains
843core computer science concepts such as abstraction in programming,
844metalinguistic abstraction, recursion, interpreters, and modular programming.")
845 (license cc-by-sa4.0))))
8a0c2552 846
847(define-public scheme48-rx
7108ad5b
TGR
848 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
849 (revision "2"))
8a0c2552 850 (package
851 (name "scheme48-rx")
852 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
853 (source
854 (origin
855 (method git-fetch)
856 (uri (git-reference
857 (url "https://github.com/scheme/rx")
858 (commit commit)))
859 (sha256
860 (base32
7108ad5b 861 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
8a0c2552 862 (file-name (string-append name "-" version "-checkout"))))
863 (build-system trivial-build-system)
864 (arguments
865 `(#:modules ((guix build utils))
866 #:builder
867 (begin
868 (use-modules (guix build utils))
869 (let ((share (string-append %output
870 "/share/scheme48-"
871 ,(package-version scheme48)
872 "/rx")))
873 (chdir (assoc-ref %build-inputs "source"))
874 (mkdir-p share)
e3cfef22
MW
875 (copy-recursively "." share)
876 #t))))
8a0c2552 877 (native-inputs
878 `(("source" ,source)
879 ("scheme48" ,scheme48)))
880 (home-page "https://github.com/scheme/rx/")
881 (synopsis "SRE String pattern-matching library for scheme48")
882 (description
883 "String pattern-matching library for scheme48 based on the SRE
884regular-expression notation.")
885 (license bsd-3))))
07ef08a7
JD
886
887(define-public slib
888 (package
889 (name "slib")
890 (version "3b5")
891 (source (origin
892 (method url-fetch)
893 (uri (string-append "http://groups.csail.mit.edu/mac/ftpdir/scm/slib-"
894 version ".zip"))
895 (sha256
896 (base32
897 "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq"))))
898 (build-system gnu-build-system)
899 (arguments
900 `(#:tests? #f ; There is no check target.
901 #:phases
902 (modify-phases %standard-phases
903 (add-after 'install 'remove-bin-share
904 (lambda* (#:key inputs outputs #:allow-other-keys)
905 (delete-file-recursively
2e14ca19
TGR
906 (string-append (assoc-ref outputs "out") "/bin"))
907 #t))
07ef08a7
JD
908 (replace 'configure
909 (lambda* (#:key inputs outputs #:allow-other-keys)
2e14ca19
TGR
910 (invoke "./configure"
911 (string-append "--prefix="
912 (assoc-ref outputs "out"))))))))
07ef08a7
JD
913 (native-inputs `(("unzip" ,unzip)
914 ("texinfo" ,texinfo)))
30fd958e 915 (home-page "http://people.csail.mit.edu/jaffer/SLIB.html")
07ef08a7
JD
916 (synopsis "Compatibility and utility library for Scheme")
917 (description "SLIB is a portable Scheme library providing compatibility and
918utility functions for all standard Scheme implementations.")
919 (license (non-copyleft
920 "http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt"
921 "Or see COPYING in the distribution."))))
922
8c48d0eb
JD
923(define-public scm
924 (package
925 (name "scm")
926 (version "5f2")
927 (source (origin
928 (method url-fetch)
929 (uri (string-append
930 "http://groups.csail.mit.edu/mac/ftpdir/scm/scm-"
931 version ".zip"))
932 (sha256
933 (base32
934 "050ijb51jm1cij9g3r89zl9rawsrikhbb5y8zb7lspb7bsxq5w99"))))
935 (build-system gnu-build-system)
936 (arguments
937 `(#:phases
938 (modify-phases %standard-phases
939 (replace 'configure
940 (lambda* (#:key inputs outputs #:allow-other-keys)
b44b14cd
TGR
941 (invoke "./configure"
942 (string-append "--prefix="
943 (assoc-ref outputs "out")))))
8c48d0eb
JD
944 (add-before 'build 'pre-build
945 (lambda* (#:key inputs #:allow-other-keys)
946 (substitute* "Makefile"
b44b14cd
TGR
947 (("ginstall-info") "install-info"))
948 #t))
8c48d0eb
JD
949 (replace 'build
950 (lambda* (#:key inputs outputs #:allow-other-keys)
951 (setenv "SCHEME_LIBRARY_PATH"
952 (string-append (assoc-ref inputs "slib")
953 "/lib/slib/"))
b44b14cd
TGR
954 (invoke "make" "scmlit" "CC=gcc")
955 (invoke "make" "all")))
8c48d0eb
JD
956 (add-after 'install 'post-install
957 (lambda* (#:key inputs outputs #:allow-other-keys)
b44b14cd
TGR
958 (let* ((out (assoc-ref outputs "out"))
959 (req (string-append out "/lib/scm/require.scm")))
960 (delete-file req)
961 (format (open req (logior O_WRONLY O_CREAT))
962 "(define (library-vicinity) ~s)\n"
963 (string-append (assoc-ref inputs "slib")
964 "/lib/slib/"))
965
966 ;; We must generate the slibcat file.
967 (invoke (string-append out "/bin/scm")
968 "-br" "new-catalog")))))))
8c48d0eb
JD
969 (inputs `(("slib" ,slib)))
970 (native-inputs `(("unzip" ,unzip)
971 ("texinfo" ,texinfo)))
972 (home-page "http://people.csail.mit.edu/jaffer/SCM")
973 (synopsis "Scheme implementation conforming to R5RS and IEEE P1178")
974 (description "GNU SCM is an implementation of Scheme. This
975implementation includes Hobbit, a Scheme-to-C compiler, which can
976generate C files whose binaries can be dynamically or statically
977linked with a SCM executable.")
978 (license lgpl3+)))
e2f9847b
TGR
979
980(define-public tinyscheme
981 (package
982 (name "tinyscheme")
983 (version "1.41")
984 (source (origin
985 (method url-fetch)
986 (uri (string-append "mirror://sourceforge/" name "/" name "/"
987 name "-" version "/" name "-" version ".zip"))
988 (sha256
989 (base32
990 "0yqma4jrjgj95f3hf30h542x97n8ah234n19yklbqq0phfsa08wf"))))
991 (build-system gnu-build-system)
992 (native-inputs
993 `(("unzip" ,unzip)))
994 (arguments
995 `(#:phases
996 (modify-phases %standard-phases
997 (replace 'unpack
998 (lambda* (#:key source #:allow-other-keys)
999 (invoke "unzip" source)
1000 (chdir (string-append ,name "-" ,version))
1001 #t))
1002 (add-after 'unpack 'set-scm-directory
1003 ;; Hard-code ‘our’ init.scm instead of looking in the current
1004 ;; working directory, so invoking ‘scheme’ just works.
1005 (lambda* (#:key outputs #:allow-other-keys)
1006 (let* ((out (assoc-ref outputs "out"))
1007 (scm (string-append out "/share/" ,name)))
1008 (substitute* "scheme.c"
1009 (("init.scm" all)
1010 (string-append scm "/" all)))
1011 #t)))
1012 (delete 'configure) ; no configure script
1013 (replace 'install
1014 ;; There's no ‘install’ target. Install files manually.
1015 (lambda* (#:key outputs #:allow-other-keys)
1016 (let* ((out (assoc-ref outputs "out"))
1017 (bin (string-append out "/bin"))
1018 (doc (string-append out "/share/doc/"
1019 ,name "-" ,version))
1020 (include (string-append out "/include"))
1021 (lib (string-append out "/lib"))
1022 (scm (string-append out "/share/" ,name)))
1023 (install-file "scheme" bin)
1024 (install-file "Manual.txt" doc)
1025 (install-file "scheme.h" include)
1026 (install-file "libtinyscheme.so" lib)
1027 (install-file "init.scm" scm)
1028 #t))))
1029 #:tests? #f)) ; no tests
1030 (home-page "http://tinyscheme.sourceforge.net/")
1031 (synopsis "Light-weight interpreter for the Scheme programming language")
1032 (description
1033 "TinyScheme is a light-weight Scheme interpreter that implements as large a
1034subset of R5RS as was possible without getting very large and complicated.
1035
1036It's meant to be used as an embedded scripting interpreter for other programs.
1037As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
1038extensive toolkits, although it does sport a small (and optional) top-level
1039loop.
1040
1041As an embedded interpreter, it allows multiple interpreter states to coexist in
1042the same program, without any interference between them. Foreign functions in C
1043can be added and values can be defined in the Scheme environment. Being quite a
1044small program, it is easy to comprehend, get to grips with, and use.")
1045 (license bsd-3))) ; there are no licence headers
44fa8431
AM
1046
1047(define-public stalin
1048 (let ((commit "ed1c9e339c352b7a6fee40bb2a47607c3466f0be"))
1049 ;; FIXME: The Stalin "source" contains C code generated by itself:
1050 ;; 'stalin-AMD64.c', etc.
1051 (package
1052 (name "stalin")
1053 (version "0.11")
1054 (source (origin
1055 ;; Use Pearlmutter's upstream branch with AMD64 patches
1056 ;; applied. Saves us from including those 20M! patches
1057 ;; in Guix. For more info, see:
1058 ;; <ftp.ecn.purdue.edu/qobi/stalin-0.11-amd64-patches.tgz>
1059 (method git-fetch)
1060 (uri (git-reference
1061 (url "https://github.com/barak/stalin.git")
1062 (commit commit)))
1063 (file-name (string-append name "-" version "-checkout"))
1064 (sha256
1065 (base32
1066 "15a5gxj9v7jqlgkg0543gdflw0rbrir7fj5zgifnb33m074wiyhn"))
1067 (modules '((guix build utils)))
1068 (snippet
1069 ;; remove gc libs from build, we have them as input
1070 '(begin
1071 (delete-file "gc6.8.tar.gz")
1072 (delete-file-recursively "benchmarks")
1073 (substitute* "build"
1074 ((".*gc6.8.*") "")
1075 ((" cd \\.\\.") "")
1076 ((".*B include/libgc.a") "")
1077 ((".*make.*") ""))
1078 #t))))
1079 (build-system gnu-build-system)
1080 (arguments
1081 `(#:make-flags (list "ARCH_OPTS=-freg-struct-return")
1082 #:phases
1083 (modify-phases %standard-phases
1084 (replace 'configure
1085 (lambda* (#:key outputs #:allow-other-keys)
1086 (let* ((out (assoc-ref outputs "out"))
1087 (include-out (string-append out "/include")))
1088 (invoke "./build")
1089 (for-each (lambda (fname)
1090 (install-file fname include-out))
1091 (find-files "include"))
1092 (substitute* "makefile"
1093 (("\\./include") include-out))
1094 (substitute* "post-make"
1095 (("`pwd`") out))
1096 #t)))
1097 (delete 'check)
1098 (replace 'install
1099 (lambda* (#:key outputs #:allow-other-keys)
1100 (let ((out (assoc-ref outputs "out")))
1101 (install-file "stalin.1"
1102 (string-append out "/share/man/man1"))
1103 (install-file "stalin"
1104 (string-append out "/bin"))
1105 #t))))))
1106 (inputs
1107 `(("libx11" ,libx11)))
1108 (propagated-inputs
1109 `(("libgc" ,libgc)))
1110 (supported-systems '("x86_64-linux"))
1111 (home-page "https://engineering.purdue.edu/~qobi/papers/fdlcc.pdf")
1112 (synopsis "Brutally efficient Scheme compiler")
1113 (description
1114 "Stalin is an aggressively optimizing whole-program compiler
1115for Scheme that does polyvariant interprocedural flow analysis,
1116flow-directed interprocedural escape analysis, flow-directed
1117lightweight CPS conversion, flow-directed lightweight closure
1118conversion, flow-directed interprocedural lifetime analysis, automatic
1119in-lining, unboxing, and flow-directed program-specific and
1120program-point-specific low-level representation selection and code
1121generation.")
1122 (license gpl2+))))
e83c7d1a
PN
1123
1124(define-public femtolisp
1125 (let ((commit "68c5b1225572ecf2c52baf62f928063e5a30511b")
1126 (revision "1"))
1127 (package
1128 (name "femtolisp")
1129 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
1130 (source (origin
1131 (method git-fetch)
1132 (uri (git-reference
1133 (url "https://github.com/JeffBezanson/femtolisp.git")
1134 (commit commit)))
1135 (file-name (string-append name "-" version "-checkout"))
1136 (sha256
1137 (base32
1138 "04rnwllxnl86zw8c6pwxznn49bvkvh0f1lfliy085vjzvlq3rgja"))))
1139 ;; See "utils.h" for supported systems. Upstream bug:
1140 ;; https://github.com/JeffBezanson/femtolisp/issues/25
1141 (supported-systems
1142 (fold delete %supported-systems
1143 '("armhf-linux" "mips64el-linux" "aarch64-linux")))
1144 (build-system gnu-build-system)
1145 (arguments
1146 `(#:make-flags '("CC=gcc" "release")
1147 #:test-target "test"
1148 #:phases
1149 (modify-phases %standard-phases
1150 (delete 'configure) ; No configure script
1151 (replace 'install ; Makefile has no 'install phase
1152 (lambda* (#:key outputs #:allow-other-keys)
1153 (let* ((out (assoc-ref outputs "out"))
1154 (bin (string-append out "/bin")))
1155 (install-file "flisp" bin)
1156 #t)))
1157 ;; The flisp binary is now available, run bootstrap to
1158 ;; generate flisp.boot and afterwards runs make test.
1159 (add-after 'install 'bootstrap-gen-and-test
1160 (lambda* (#:key outputs #:allow-other-keys)
1161 (let* ((out (assoc-ref outputs "out"))
1162 (bin (string-append out "/bin")))
1163 (and
1164 (zero? (system* "./bootstrap.sh"))
1165 (install-file "flisp.boot" bin))))))))
1166 (synopsis "Scheme-like lisp implementation")
1167 (description
1168 "@code{femtolisp} is a scheme-like lisp implementation with a
1169simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
1170The core is 12 builtin special forms and 33 builtin functions.")
1171 (home-page "https://github.com/JeffBezanson/femtolisp")
1172 (license bsd-3))))
eac7ed19
GH
1173
1174(define-public gauche
1175 (package
1176 (name "gauche")
1177 (version "0.9.7")
1178 (home-page "http://practical-scheme.net/gauche/index.html")
1179 (source
1180 (origin
1181 (method url-fetch)
1182 (uri (string-append
1183 "mirror://sourceforge/gauche/Gauche/Gauche-"
1184 version ".tgz"))
1185 (sha256
1186 (base32
1187 "181nycikma0rwrb1h6mi3kys11f8628pq8g5r3fg5hiz5sabscrd"))
1188 (modules '((guix build utils)))
1189 (snippet '(begin
1190 ;; Remove libatomic-ops
1191 (delete-file-recursively "gc/libatomic_ops")
1192 #t))))
1193 (build-system gnu-build-system)
1194 (inputs
1195 `(("libatomic-ops" ,libatomic-ops)
1196 ("zlib" ,zlib)))
1197 (native-inputs
1198 `(("texinfo" ,texinfo)
1199 ("openssl" ,openssl) ; needed for tests
1200 ("pkg-config" ,pkg-config))) ; needed to find external libatomic-ops
1201 (arguments
1202 `(#:phases
1203 (modify-phases %standard-phases
1204 (add-after 'unpack 'patch-/bin/sh
1205 ;; needed only for tests
1206 (lambda _
1207 (substitute* '("configure"
1208 "test/www.scm"
1209 "ext/tls/test.scm"
1210 "gc/configure"
1211 "lib/gauche/configure.scm"
1212 "lib/gauche/package/util.scm"
1213 "lib/gauche/process.scm")
1214 (("/bin/sh") (which "sh")))
1215 #t))
1216 (add-after 'build 'build-doc
6c4a951a
GH
1217 (lambda _
1218 (with-directory-excursion "doc"
1219 (invoke "make" "info"))
eac7ed19
GH
1220 #t))
1221 (add-before 'check 'patch-normalize-test
1222 ;; neutralize sys-normalize-pathname test as it relies on
1223 ;; the home directory; (setenv "HOME" xx) isn't enough)
1224 (lambda _
1225 (substitute* "test/system.scm"
1226 (("~/abc") "//abc"))
1227 #t))
1228 (add-before 'check 'patch-network-tests
1229 ;; remove net checks
1230 (lambda _
1231 (substitute* "ext/Makefile"
1232 (("binary net termios") "binary termios"))
1233 #t))
1234 (add-after 'install 'install-docs
6c4a951a
GH
1235 (lambda _
1236 (with-directory-excursion "doc"
1237 (invoke "make" "install"))
eac7ed19
GH
1238 #t)))))
1239 (synopsis "Scheme scripting engine")
1240 (description "Gauche is a R7RS Scheme scripting engine aiming at being a
1241handy tool that helps programmers and system administrators to write small to
1242large scripts quickly. Quick startup, built-in system interface, native
1243multilingual support are some of the goals. Gauche comes with a package
1244manager/installer @code{gauche-package} which can download, compile, install
6c4a951a 1245and list gauche extension packages.")
eac7ed19 1246 (license bsd-3)))