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