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