gnu: Move sqlite to separate module.
[jackhill/guix/guix.git] / gnu / packages / scheme.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
4 ;;; Copyright © 2015, 2016 Federico Beffa <beffa@fbengineering.ch>
5 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
8 ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
9 ;;; Copyright © 2017 John Darrington <jmd@gnu.org>
10 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
11 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
13 ;;; Copyright © 2018 Gabriel Hondet <gabrielhondet@gmail.com>
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
30 (define-module (gnu packages scheme)
31 #:use-module (gnu packages)
32 #:use-module ((guix licenses)
33 #:select (gpl2+ lgpl2.0+ lgpl2.1+ lgpl3+ asl2.0 bsd-3
34 cc-by-sa4.0 non-copyleft))
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix utils)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system trivial)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages bdw-gc)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages databases)
45 #:use-module (gnu packages libevent)
46 #:use-module (gnu packages libunistring)
47 #:use-module (gnu packages m4)
48 #:use-module (gnu packages multiprecision)
49 #:use-module (gnu packages ncurses)
50 #:use-module (gnu packages pcre)
51 #:use-module (gnu packages emacs)
52 #:use-module (gnu packages ghostscript)
53 #:use-module (gnu packages netpbm)
54 #:use-module (gnu packages texinfo)
55 #:use-module (gnu packages tex)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages compression)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages avahi)
60 #:use-module (gnu packages libphidget)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages libffi)
65 #:use-module (gnu packages fontutils)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages xorg)
68 #:use-module (gnu packages sqlite)
69 #:use-module (gnu packages tls)
70 #:use-module (gnu packages gl)
71 #:use-module (gnu packages libedit)
72 #:use-module (srfi srfi-1)
73 #:use-module (ice-9 match))
74
75 (define (mit-scheme-source-directory system version)
76 (string-append "mit-scheme-"
77 (if (or (string-prefix? "x86_64" system)
78 (string-prefix? "i686" system))
79 ""
80 "c-")
81 version))
82
83 (define-public mit-scheme
84 (package
85 (name "mit-scheme")
86 (version "10.1.3")
87 (source #f) ; see below
88 (outputs '("out" "doc"))
89 (build-system gnu-build-system)
90 (arguments
91 `(#:modules ((guix build gnu-build-system)
92 (guix build utils)
93 (srfi srfi-1))
94 #:phases
95 (modify-phases %standard-phases
96 (replace 'unpack
97 (lambda* (#:key inputs #:allow-other-keys)
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
105 (find-files "src/compiler" "^make\\."))
106 (chdir "src")
107 #t))
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))
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))
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))
131 (invoke "make" "compile-microcode")
132 (invoke "./etc/make-liarc.sh"
133 (string-append "--prefix=" out)))
134 #t)))
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")))
141 (invoke bin/sh "./configure"
142 (string-append "--prefix=" out)
143 (string-append "SHELL=" bin/sh))
144 #t))))
145 (add-after 'build 'build-doc
146 (lambda* _
147 (with-directory-excursion "../doc"
148 (invoke "make"))
149 #t))
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)
159 (invoke "make" target))
160 '("install-info-gz" "install-man"
161 "install-html" "install-pdf")))
162 (mkdir-p new-doc/mit-scheme-dir)
163 (copy-recursively
164 (string-append old-doc-dir "/" ,name)
165 new-doc/mit-scheme-dir)
166 (delete-file-recursively old-doc-dir)
167 #t))))))
168 (native-inputs
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)))
174 ("texinfo" ,texinfo)
175 ("m4" ,m4)))
176 (inputs
177 `(("libx11" ,libx11)
178
179 ("source"
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-"
190 (match (%current-system)
191 ("x86_64-linux"
192 (string-append version "-x86-64"))
193 ("i686-linux"
194 (string-append version "-i386"))
195 (_
196 (string-append "c-" version)))
197 ".tar.gz"))
198 (sha256
199 (match (%current-system)
200 ("x86_64-linux"
201 (base32
202 "03m7cc035w3avs91j2pcz9f15ssgvgp3rm045d1vbydqrkzfyw8k"))
203 ("i686-linux"
204 (base32
205 "05sjyz90xxfnmi87qv8x0yx0fcallnzl1dciygdafp317pn489is"))
206 (_
207 (base32
208 ""))))))))
209
210 ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
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"))
214
215 (home-page "https://www.gnu.org/software/mit-scheme/")
216 (synopsis "A Scheme implementation with integrated editor and debugger")
217 (description
218 "GNU/MIT Scheme is an implementation of the Scheme programming
219 language. It provides an interpreter, a compiler and a debugger. It also
220 features an integrated Emacs-like editor and a large runtime library.")
221 (license gpl2+)
222 (properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
223
224 (define-public bigloo
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.
229 (let ((upstream-version "4.3e"))
230 (package
231 (name "bigloo")
232 (version "4.3e1")
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
239 "12k1kxyn3yilba0508xh8wkrw6279gnghzqi0bs2ayf5d2wkqdj3"))
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)
254
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)"))
266
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)
301
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
314 based programming style where C(++) is usually required. Bigloo attempts to
315 make Scheme practical by offering features usually presented by traditional
316 programming languages but not offered by Scheme and functional programming.
317 Bigloo compiles Scheme modules. It delivers small and fast stand alone binary
318 executables. Bigloo enables full connections between Scheme and C programs
319 and between Scheme and Java programs.")
320 (license gpl2+))))
321
322 (define-public hop
323 (package
324 (name "hop")
325 (version "3.2.0-pre1")
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
332 "0jf418d0s9imv98s6qrpjxr1mdaxr37knh5qyfl5y4a9cc41mlg5"))))
333 (build-system gnu-build-system)
334 (arguments
335 `(#:test-target "test"
336 #:make-flags '("BIGLOO=bigloo")
337 #:parallel-build? #f
338 #:phases
339 (modify-phases %standard-phases
340 (replace 'configure
341 (lambda* (#:key inputs outputs #:allow-other-keys)
342 (let ((out (assoc-ref outputs "out")))
343 (substitute* '("tools/Makefile"
344 "test/hopjs/TEST.in")
345 (("/bin/rm") (which "rm")))
346 (invoke "./configure"
347 (string-append "--prefix=" out)
348 "--hostcc=gcc"
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"))))))))
355 (inputs `(("avahi" ,avahi)
356 ("bigloo" ,bigloo)
357 ("libgc" ,libgc)
358 ("libunistring" ,libunistring)
359 ("libuv" ,libuv)
360 ("pcre" ,pcre)
361 ("sqlite" ,sqlite)
362 ("which" ,which)))
363 (home-page "http://hop.inria.fr/")
364 (synopsis "Multi-tier programming language for the Web 2.0")
365 (description
366 "HOP is a multi-tier programming language for the Web 2.0 and the
367 so-called diffuse Web. It is designed for programming interactive web
368 applications in many fields such as multimedia (web galleries, music players,
369 ...), ubiquitous and house automation (SmartPhones, personal appliance),
370 mashups, office (web agendas, mail clients, ...), etc.")
371 (license gpl2+)))
372
373 (define-public chicken
374 (package
375 (name "chicken")
376 (version "5.0.0")
377 (source (origin
378 (method url-fetch)
379 (uri (string-append "https://code.call-cc.org/releases/"
380 version "/chicken-" version ".tar.gz"))
381 (sha256
382 (base32
383 "15b5yrzfa8aimzba79x7v6y282f898rxqxfxrr446sjx9jwlpfd8"))))
384 (build-system gnu-build-system)
385 (arguments
386 `(#:modules ((guix build gnu-build-system)
387 (guix build utils)
388 (srfi srfi-1))
389
390 ;; No `configure' script; run "make check" after "make install" as
391 ;; prescribed by README.
392 #:phases
393 (modify-phases %standard-phases
394 (delete 'configure)
395 (delete 'check)
396 (add-after 'install 'check
397 (assoc-ref %standard-phases 'check)))
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
410 produces portable and efficient C, supports almost all of the R5RS Scheme
411 language standard, and includes many enhancements and extensions.")
412 (license bsd-3)))
413
414 (define-public scheme48
415 (package
416 (name "scheme48")
417 (version "1.9.2")
418 (source (origin
419 (method url-fetch)
420 (uri (string-append "http://s48.org/" version
421 "/scheme48-" version ".tgz"))
422 (sha256
423 (base32
424 "1x4xfm3lyz2piqcw1h01vbs1iq89zq7wrsfjgh3fxnlm1slj2jcw"))
425 (patches (search-patches "scheme48-tests.patch"))))
426 (build-system gnu-build-system)
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
431 interpreter and is designed to be used as a testbed for experiments in
432 implementation techniques and as an expository tool.")
433
434 ;; Most files are BSD-3; see COPYING for the few exceptions.
435 (license bsd-3)))
436
437 (define-public racket
438 (package
439 (name "racket")
440 (version "7.0")
441 (source (origin
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"))))
453 (build-system gnu-build-system)
454 (arguments
455 '(#:phases
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"))))
488 (substitute* "share/pkgs/readline-lib/readline/rktrl.rkt"
489 (("\\(getenv \"PLT_READLINE_LIB\"\\)")
490 (format #f "\"~a\"" (find-so "libedit"))))
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"
518 ("libGL" "libGLU")))))
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)))
526 #:tests? #f ; XXX: how to run them?
527 ))
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)
537 ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg
538 ("libjpeg" ,libjpeg)
539 ("libpng" ,libpng)
540 ("libx11" ,libx11)
541 ("mesa" ,mesa)
542 ("mpfr" ,mpfr)
543 ("openssl" ,openssl)
544 ("pango" ,pango)
545 ("sqlite" ,sqlite)
546 ("unixodbc" ,unixodbc)
547 ("libedit" ,libedit)))
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
552 R6RS) and related languages, such as Typed Racket. It features a compiler and
553 a virtual machine with just-in-time native compilation, as well as a large set
554 of libraries.")
555 (license lgpl2.0+)))
556
557 (define-public gambit-c
558 (package
559 (name "gambit-c")
560 (version "4.9.1")
561 (source
562 (origin
563 (method url-fetch)
564 (uri (string-append
565 "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
566 (version-major+minor version) "/source/gambit-v"
567 (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
568 ".tgz"))
569 (sha256
570 (base32 "14x9xa0yh7187alzw2m937jnh4csj0dyywi3va8bhi7aaw4p5qai"))))
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.
576 '("--enable-single-host")))
577 (home-page "http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page")
578 (synopsis "Efficient Scheme interpreter and compiler")
579 (description
580 "Gambit consists of two main programs: gsi, the Gambit Scheme
581 interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains
582 the complete execution and debugging environment. The compiler is the
583 interpreter extended with the capability of generating executable files. The
584 compiler can produce standalone executables or compiled modules which can be
585 loaded at run time. Interpreted code and compiled code can be freely
586 mixed.")
587 ;; Dual license.
588 (license (list lgpl2.1+ asl2.0))))
589
590 (define-public chibi-scheme
591 (package
592 (name "chibi-scheme")
593 (version "0.7.3")
594 (source
595 (origin
596 (method url-fetch)
597 (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
598 version ".tar.gz"))
599 (sha256
600 (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
601 (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
602 (build-system gnu-build-system)
603 (arguments
604 `(#:phases (modify-phases %standard-phases
605 (delete 'configure)
606 (add-before 'build 'set-cc
607 (lambda _
608 (setenv "CC" "gcc"))))
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"))
613 (home-page "https://github.com/ashinn/chibi-scheme")
614 (synopsis "Small embeddable Scheme implementation")
615 (description
616 "Chibi-Scheme is a very small library with no external dependencies
617 intended for use as an extension and scripting language in C programs. In
618 addition to support for lightweight VM-based threads, each VM itself runs in
619 an isolated heap allowing multiple VMs to run simultaneously in different OS
620 threads.")
621 (license bsd-3)))
622
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")
634 (version "20160827")
635 (source
636 (origin
637 (method url-fetch/tarbomb)
638 (modules '((guix build utils)))
639 (snippet '(begin
640 ;; Remove binary code
641 (delete-file-recursively "scmutils/mit-scheme")
642 #t))
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
647 (base32 "00ly5m0s4dy5kxravjaqlpii5zcnr6b9nqm0607lr7xcs52i4j8b"))))
648 (build-system gnu-build-system)
649 (inputs
650 `(("mit-scheme" ,mit-scheme)
651 ("emacs" ,emacs-minimal)))
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
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)))
674 (replace 'build
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"))
684 (zero? (system make-img))))
685 #t)))
686 (add-before 'install 'fix-directory-names
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)))
704 (add-before 'install 'emacs-tags
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"
709 (apply invoke "etags" (find-files "." "\\.scm")))
710 #t))
711 (replace 'install
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))
720
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)))
741 (add-after 'install 'emacs-helpers
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
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"))))
783 (emacs-generate-autoloads ,name emacs-lisp-dir)
784 (emacs-byte-compile-directory emacs-lisp-dir)
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
790 procedures, embedded in the programming language Scheme, and intended to
791 support teaching and research in mathematical physics and electrical
792 engineering.")
793 (license gpl2+))))
794
795 (define-public sicp
796 (let ((commit "225c172f9b859902a64a3c5dd5e1f9ac1a7382de"))
797 (package
798 (name "sicp")
799 (version (string-append "20170703-1." (string-take commit 7)))
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
807 "0bhdrdc1mgdjdsg4jksq9z6x129f3346jbf3zir2a0dfmsj6m10n"))
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"))
825 (html-dir (string-append %output "/share/doc/" ,name "/html"))
826 (info-dir (string-append %output "/share/info")))
827 (copy-recursively (string-append source "/html") html-dir)
828 (setenv "PATH" (string-append gzip "/bin"
829 ":" texinfo "/bin"))
830 (mkdir-p info-dir)
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))))
837 (home-page "https://sarabander.github.io/sicp")
838 (synopsis "Structure and Interpretation of Computer Programs")
839 (description "Structure and Interpretation of Computer Programs (SICP) is
840 a textbook aiming to teach the principles of computer programming.
841
842 Using Scheme, a dialect of the Lisp programming language, the book explains
843 core computer science concepts such as abstraction in programming,
844 metalinguistic abstraction, recursion, interpreters, and modular programming.")
845 (license cc-by-sa4.0))))
846
847 (define-public scheme48-rx
848 (let* ((commit "dd9037f6f9ea01019390614f6b126b7dd293798d")
849 (revision "2"))
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
861 "1bvriavxw5kf2izjbil3999vr983vkk2xplfpinafr86m40b2cci"))
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)
875 (copy-recursively "." share)
876 #t))))
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
884 regular-expression notation.")
885 (license bsd-3))))
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
906 (string-append (assoc-ref outputs "out") "/bin"))
907 #t))
908 (replace 'configure
909 (lambda* (#:key inputs outputs #:allow-other-keys)
910 (invoke "./configure"
911 (string-append "--prefix="
912 (assoc-ref outputs "out"))))))))
913 (native-inputs `(("unzip" ,unzip)
914 ("texinfo" ,texinfo)))
915 (home-page "http://people.csail.mit.edu/jaffer/SLIB.html")
916 (synopsis "Compatibility and utility library for Scheme")
917 (description "SLIB is a portable Scheme library providing compatibility and
918 utility 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
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)
941 (invoke "./configure"
942 (string-append "--prefix="
943 (assoc-ref outputs "out")))))
944 (add-before 'build 'pre-build
945 (lambda* (#:key inputs #:allow-other-keys)
946 (substitute* "Makefile"
947 (("ginstall-info") "install-info"))
948 #t))
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/"))
954 (invoke "make" "scmlit" "CC=gcc")
955 (invoke "make" "all")))
956 (add-after 'install 'post-install
957 (lambda* (#:key inputs outputs #:allow-other-keys)
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")))))))
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
975 implementation includes Hobbit, a Scheme-to-C compiler, which can
976 generate C files whose binaries can be dynamically or statically
977 linked with a SCM executable.")
978 (license lgpl3+)))
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
1034 subset of R5RS as was possible without getting very large and complicated.
1035
1036 It's meant to be used as an embedded scripting interpreter for other programs.
1037 As such, it does not offer an Integrated Development Environment (@dfn{IDE}) or
1038 extensive toolkits, although it does sport a small (and optional) top-level
1039 loop.
1040
1041 As an embedded interpreter, it allows multiple interpreter states to coexist in
1042 the same program, without any interference between them. Foreign functions in C
1043 can be added and values can be defined in the Scheme environment. Being quite a
1044 small program, it is easy to comprehend, get to grips with, and use.")
1045 (license bsd-3))) ; there are no licence headers
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
1115 for Scheme that does polyvariant interprocedural flow analysis,
1116 flow-directed interprocedural escape analysis, flow-directed
1117 lightweight CPS conversion, flow-directed lightweight closure
1118 conversion, flow-directed interprocedural lifetime analysis, automatic
1119 in-lining, unboxing, and flow-directed program-specific and
1120 program-point-specific low-level representation selection and code
1121 generation.")
1122 (license gpl2+))))
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
1169 simple, elegant Scheme dialect. It is a lisp-1 with lexical scope.
1170 The core is 12 builtin special forms and 33 builtin functions.")
1171 (home-page "https://github.com/JeffBezanson/femtolisp")
1172 (license bsd-3))))
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
1217 (lambda* (#:key outputs #:allow-other-keys)
1218 (let* ((out (assoc-ref outputs "out")))
1219 (with-directory-excursion "doc"
1220 (for-each
1221 (lambda (target)
1222 (invoke "make" target))
1223 '("info" "html" "htmls"))))
1224 #t))
1225 (add-before 'check 'patch-normalize-test
1226 ;; neutralize sys-normalize-pathname test as it relies on
1227 ;; the home directory; (setenv "HOME" xx) isn't enough)
1228 (lambda _
1229 (substitute* "test/system.scm"
1230 (("~/abc") "//abc"))
1231 #t))
1232 (add-before 'check 'patch-network-tests
1233 ;; remove net checks
1234 (lambda _
1235 (substitute* "ext/Makefile"
1236 (("binary net termios") "binary termios"))
1237 #t))
1238 (add-after 'install 'install-docs
1239 (lambda* (#:key outputs #:allow-other-keys)
1240 (let* ((out (assoc-ref outputs "out")))
1241 (with-directory-excursion "doc"
1242 (invoke "make" "install")))
1243 #t)))))
1244 (synopsis "Scheme scripting engine")
1245 (description "Gauche is a R7RS Scheme scripting engine aiming at being a
1246 handy tool that helps programmers and system administrators to write small to
1247 large scripts quickly. Quick startup, built-in system interface, native
1248 multilingual support are some of the goals. Gauche comes with a package
1249 manager/installer @code{gauche-package} which can download, compile, install
1250 and list gauche extension packages. There are currently 58 packages
1251 available.")
1252 (license bsd-3)))