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