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