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