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