Commit | Line | Data |
---|---|---|
13bbc0cc FB |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch> | |
1e16648f | 3 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
f88c1c5d | 4 | ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> |
13bbc0cc FB |
5 | ;;; |
6 | ;;; This file is part of GNU Guix. | |
7 | ;;; | |
8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
9 | ;;; under the terms of the GNU General Public License as published by | |
10 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
11 | ;;; your option) any later version. | |
12 | ;;; | |
13 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ;;; GNU General Public License for more details. | |
17 | ;;; | |
18 | ;;; You should have received a copy of the GNU General Public License | |
19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
20 | ||
21 | (define-module (gnu packages chez) | |
22 | #:use-module (gnu packages) | |
23 | #:use-module ((guix licenses) | |
53b9684e | 24 | #:select (gpl2+ gpl3+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat |
4dfe4eee | 25 | public-domain)) |
13bbc0cc FB |
26 | #:use-module (guix packages) |
27 | #:use-module (guix download) | |
4dfe4eee | 28 | #:use-module (guix git-download) |
13bbc0cc FB |
29 | #:use-module (guix utils) |
30 | #:use-module (guix build-system gnu) | |
31 | #:use-module (gnu packages compression) | |
32 | #:use-module (gnu packages ncurses) | |
33 | #:use-module (gnu packages ghostscript) | |
34 | #:use-module (gnu packages netpbm) | |
35 | #:use-module (gnu packages tex) | |
36 | #:use-module (gnu packages compression) | |
37 | #:use-module (gnu packages image) | |
38 | #:use-module (gnu packages xorg) | |
bc05caee EF |
39 | #:use-module (ice-9 match) |
40 | #:use-module (srfi srfi-1)) | |
13bbc0cc FB |
41 | |
42 | (define nanopass | |
43 | (let ((version "1.9")) | |
44 | (origin | |
45 | (method url-fetch) | |
46 | (uri (string-append | |
47 | "https://github.com/nanopass/nanopass-framework-scheme/archive" | |
48 | "/v" version ".tar.gz")) | |
49 | (sha256 (base32 "11pwyy4jiwhcl2am3a4ciczacjbjkyvdizqzdglb3l1hj2gj6nv2")) | |
50 | (file-name (string-append "nanopass-" version ".tar.gz"))))) | |
51 | ||
52 | (define stex | |
53 | (let ((version "1.2.1")) | |
54 | (origin | |
55 | (method url-fetch) | |
56 | (uri (string-append | |
57 | "https://github.com/dybvig/stex/archive" | |
58 | "/v" version ".tar.gz")) | |
59 | (sha256 (base32 "03pl3f668h24dn51vccr1sj5lsba9zq3j37bnxjvdadcdaj4qy5z")) | |
60 | (file-name (string-append "stex-" version ".tar.gz"))))) | |
61 | ||
62 | (define-public chez-scheme | |
63 | (package | |
64 | (name "chez-scheme") | |
f88c1c5d | 65 | (version "9.5") |
13bbc0cc FB |
66 | (source |
67 | (origin | |
68 | (method url-fetch) | |
69 | (uri (string-append "https://github.com/cisco/ChezScheme/archive/" | |
70 | "v" version ".tar.gz")) | |
71 | (sha256 | |
f88c1c5d | 72 | (base32 "135991hspq0grf26pvl2lkwhp92yz204h6rgiwyym0x6v0xzknd1")) |
9e9a207b LC |
73 | (file-name (string-append "chez-scheme-" version ".tar.gz")) |
74 | (modules '((guix build utils))) | |
75 | (snippet | |
76 | ;; Fix compilation with glibc >= 2.26, which removed xlocale.h. | |
6cbee49d MW |
77 | '(begin |
78 | (substitute* "c/expeditor.c" | |
79 | (("xlocale\\.h") "locale.h")) | |
80 | #t)))) | |
13bbc0cc FB |
81 | (build-system gnu-build-system) |
82 | (inputs | |
83 | `(("ncurses" ,ncurses) | |
84 | ("libx11" ,libx11) | |
85 | ("xorg-rgb" ,xorg-rgb) | |
86 | ("nanopass" ,nanopass) | |
87 | ("zlib" ,zlib) | |
88 | ("stex" ,stex))) | |
89 | (native-inputs | |
90 | `(("texlive" ,texlive) | |
b09e0cd1 | 91 | ("ghostscript" ,ghostscript) |
13bbc0cc FB |
92 | ("netpbm" ,netpbm))) |
93 | (native-search-paths | |
94 | (list (search-path-specification | |
95 | (variable "CHEZSCHEMELIBDIRS") | |
96 | (files (list (string-append "lib/csv" version "-site")))))) | |
97 | (outputs '("out" "doc")) | |
98 | (arguments | |
99 | `(#:modules ((guix build gnu-build-system) | |
100 | (guix build utils) | |
101 | (ice-9 match)) | |
102 | #:test-target "test" | |
103 | #:configure-flags | |
104 | (list ,(match (or (%current-target-system) (%current-system)) | |
105 | ("x86_64-linux" '(list "--machine=ta6le")) | |
106 | ("i686-linux" '(list "--machine=ti3le")) | |
1e16648f | 107 | ;; Let autodetection have its attempt on other architectures. |
13bbc0cc FB |
108 | (_ |
109 | '()))) | |
110 | #:phases | |
111 | (modify-phases %standard-phases | |
7ceee88c EF |
112 | (add-after 'unpack 'patch-processor-detection |
113 | (lambda _ (substitute* "configure" | |
114 | (("uname -a") "uname -m")) | |
f88c1c5d TGR |
115 | #t)) |
116 | (add-after 'unpack 'patch-broken-documentation | |
117 | (lambda _ | |
118 | ;; Work around an oversight in the 9.5 release tarball that causes | |
119 | ;; building the documentation to fail. This should be fixed in the | |
120 | ;; next one; see <https://github.com/cisco/ChezScheme/issues/209>. | |
121 | (substitute* "csug/copyright.stex" | |
122 | (("\\\\INSERTREVISIONMONTHSPACEYEAR" ) | |
123 | "October 2017")))) ; tarball release date | |
13bbc0cc FB |
124 | ;; Adapt the custom 'configure' script. |
125 | (replace 'configure | |
126 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
127 | (let ((out (assoc-ref outputs "out")) | |
128 | (nanopass (assoc-ref inputs "nanopass")) | |
129 | (stex (assoc-ref inputs "stex")) | |
130 | (zlib (assoc-ref inputs "zlib")) | |
131 | (unpack (assoc-ref %standard-phases 'unpack)) | |
132 | (patch-source-shebangs | |
133 | (assoc-ref %standard-phases 'patch-source-shebangs))) | |
134 | (map (match-lambda | |
135 | ((src orig-name new-name) | |
136 | (with-directory-excursion "." | |
137 | (apply unpack (list #:source src)) | |
138 | (apply patch-source-shebangs (list #:source src))) | |
139 | (delete-file-recursively new-name) | |
140 | (system* "mv" orig-name new-name))) | |
141 | `((,nanopass "nanopass-framework-scheme-1.9" "nanopass") | |
142 | (,stex "stex-1.2.1" "stex"))) | |
143 | ;; The Makefile wants to download and compile "zlib". We patch | |
144 | ;; it to use the one from our 'zlib' package. | |
145 | (substitute* "configure" | |
146 | (("rmdir zlib .*$") "echo \"using system zlib\"\n")) | |
147 | (substitute* (find-files "./c" "Mf-[a-zA-Z0-9.]+") | |
148 | (("\\$\\{Kernel\\}: \\$\\{kernelobj\\} \\.\\./zlib/libz\\.a") | |
149 | "${Kernel}: ${kernelobj}") | |
150 | (("ld ([-a-zA-Z0-9_${} ]+) \\.\\./zlib/libz\\.a" all args) | |
151 | (string-append "ld " args " " zlib "/lib/libz.a")) | |
152 | (("\\(cd \\.\\./zlib; ([-a-zA-Z0-9=./ ]+))") | |
153 | (which "true"))) | |
154 | (substitute* (find-files "mats" "Mf-.*") | |
155 | (("^[[:space:]]+(cc ) *") "\tgcc ")) | |
156 | (substitute* | |
157 | (find-files "." (string-append | |
158 | "(" | |
159 | "Mf-[a-zA-Z0-9.]+" | |
160 | "|Makefile[a-zA-Z0-9.]*" | |
161 | "|checkin" | |
162 | "|stex\\.stex" | |
163 | "|newrelease" | |
164 | "|workarea" | |
165 | ;;"|[a-zA-Z0-9.]+\\.ms" ; guile can't read | |
166 | ")")) | |
167 | (("/bin/rm") (which "rm")) | |
168 | (("/bin/ln") (which "ln")) | |
169 | (("/bin/cp") (which "cp"))) | |
170 | (substitute* "makefiles/installsh" | |
171 | (("/bin/true") (which "true"))) | |
172 | (substitute* "stex/Makefile" | |
173 | (("PREFIX=/usr") (string-append "PREFIX=" out))) | |
174 | (zero? (system* "./configure" "--threads" | |
175 | (string-append "--installprefix=" out)))))) | |
176 | ;; Installation of the documentation requires a running "chez". | |
177 | (add-after 'install 'install-doc | |
178 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
179 | (let ((bin (string-append (assoc-ref outputs "out") "/bin")) | |
180 | (doc (string-append (assoc-ref outputs "doc") | |
181 | "/share/doc/" ,name "-" ,version))) | |
182 | (setenv "HOME" (getcwd)) | |
183 | (setenv "PATH" (string-append (getenv "PATH") ":" bin)) | |
184 | (with-directory-excursion "stex" | |
185 | (system* "make" (string-append "BIN=" bin))) | |
186 | (system* "make" "docs") | |
187 | (with-directory-excursion "csug" | |
188 | (substitute* "Makefile" | |
189 | (("/tmp/csug9") doc)) | |
190 | (system* "make" "install") | |
191 | (install-file "csug.pdf" doc)) | |
192 | (with-directory-excursion "release_notes" | |
193 | (install-file "release_notes.pdf" doc)) | |
194 | #t))) | |
195 | ;; The binary file name is called "scheme" as the one from MIT/GNU | |
196 | ;; Scheme. We add a symlink to use in case both are installed. | |
197 | (add-after 'install 'install-symlink | |
198 | (lambda* (#:key outputs #:allow-other-keys) | |
199 | (let* ((out (assoc-ref outputs "out")) | |
200 | (bin (string-append out "/bin")) | |
201 | (lib (string-append out "/lib")) | |
202 | (name "chez-scheme")) | |
203 | (symlink (string-append bin "/scheme") | |
204 | (string-append bin "/" name)) | |
205 | (map (lambda (file) | |
206 | (symlink file (string-append (dirname file) | |
207 | "/" name ".boot"))) | |
208 | (find-files lib "scheme.boot")) | |
fa63939a MB |
209 | #t))) |
210 | (add-before 'reset-gzip-timestamps 'make-manpages-writable | |
211 | (lambda* (#:key outputs #:allow-other-keys) | |
212 | (map (lambda (file) | |
213 | (make-file-writable file)) | |
214 | (find-files (string-append (assoc-ref outputs "out") | |
215 | "/share/man") | |
216 | ".*\\.gz$")) | |
217 | #t))))) | |
13bbc0cc | 218 | ;; According to the documentation MIPS is not supported. |
1e16648f EF |
219 | ;; Cross-compiling for the Raspberry Pi is supported, but not native ARM. |
220 | (supported-systems (fold delete %supported-systems | |
221 | '("mips64el-linux" "armhf-linux"))) | |
13bbc0cc FB |
222 | (home-page "http://www.scheme.com") |
223 | (synopsis "R6RS Scheme compiler and run-time") | |
224 | (description | |
225 | "Chez Scheme is a compiler and run-time system for the language of the | |
226 | Revised^6 Report on Scheme (R6RS), with numerous extensions. The compiler | |
227 | generates native code for each target processor, with support for x86, x86_64, | |
228 | and 32-bit PowerPC architectures.") | |
229 | (license asl2.0))) | |
c344b85d FB |
230 | |
231 | (define-public chez-srfi | |
232 | (package | |
233 | (name "chez-srfi") | |
234 | (version "1.0") | |
235 | (source | |
236 | (origin | |
237 | (method url-fetch) | |
238 | (uri (string-append | |
239 | "https://github.com/fedeinthemix/chez-srfi/archive" | |
240 | "/v" version ".tar.gz")) | |
241 | (sha256 | |
242 | (base32 "17i4wly7bcr5kb5hf04ljpbvv4r5hsr9xsmw650fj43z9jr303gs")) | |
243 | (file-name (string-append name "-" version ".tar.gz")))) | |
244 | (build-system gnu-build-system) | |
245 | (native-inputs | |
246 | `(("chez-scheme" ,chez-scheme))) | |
247 | (arguments | |
248 | `(#:make-flags (let ((out (assoc-ref %outputs "out"))) | |
249 | (list (string-append "PREFIX=" out))) | |
250 | #:test-target "test" | |
251 | #:phases (modify-phases %standard-phases | |
252 | (delete 'configure)))) | |
253 | (home-page "https://github.com/fedeinthemix/chez-srfi") | |
254 | (synopsis "SRFI libraries for Chez Scheme") | |
255 | (description | |
256 | "This package provides a collection of SRFI libraries for Chez Scheme.") | |
257 | (license expat))) | |
4dfe4eee FB |
258 | |
259 | (define-public chez-web | |
260 | (let ((commit "5fd177fe53f31f466bf88720d03c95a3711a8bea") | |
261 | (revision "1")) | |
262 | (package | |
263 | (name "chez-web") | |
264 | ;; release 2.0 is different and doesn't work. | |
265 | (version (string-append "2.0-" revision "." | |
266 | (string-take commit 7))) | |
267 | (source | |
268 | (origin | |
269 | (method git-fetch) | |
270 | (uri (git-reference | |
271 | (url "https://github.com/arcfide/ChezWEB.git") | |
272 | (commit commit))) | |
273 | (file-name (string-append name "-" version "-checkout")) | |
274 | (sha256 | |
275 | (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) | |
276 | (build-system gnu-build-system) | |
277 | (native-inputs | |
278 | `(("chez-scheme" ,chez-scheme) | |
279 | ("texlive" ,texlive))) | |
280 | (arguments | |
281 | `(#:make-flags (list (string-append "PREFIX=" %output) | |
282 | (string-append "DOCDIR=" %output "/share/doc/" | |
283 | ,name "-" ,version) | |
284 | (string-append "LIBDIR=" %output "/lib/chezweb") | |
285 | (string-append "TEXDIR=" %output "/share/texmf-local")) | |
286 | #:tests? #f ; no tests | |
287 | #:phases | |
288 | (modify-phases %standard-phases | |
289 | (replace 'configure | |
290 | (lambda* _ | |
291 | (copy-file "config.mk.template" "config.mk") | |
292 | (substitute* "tangleit" | |
293 | (("\\./cheztangle\\.ss" all) | |
294 | (string-append "chez-scheme --program " all))) | |
295 | (substitute* "weaveit" | |
296 | (("mpost chezweb\\.mp") | |
297 | "mpost --tex=tex chezweb.mp") | |
298 | (("\\./chezweave" all) | |
299 | (string-append "chez-scheme --program " all))) | |
300 | (substitute* "installit" | |
301 | (("-g \\$GROUP -o \\$OWNER") ""))))))) | |
302 | (home-page "https://github.com/arcfide/ChezWEB") | |
303 | (synopsis "Hygienic Literate Programming for Chez Scheme") | |
304 | (description "ChezWEB is a system for doing Knuthian style WEB | |
305 | programming in Scheme.") | |
306 | (license expat)))) | |
74f9c190 FB |
307 | |
308 | (define-public chez-sockets | |
309 | (let ((commit "bce96881c06bd69a6757a6bff139744153924140") | |
310 | (revision "1")) | |
311 | (package | |
312 | (name "chez-sockets") | |
313 | (version (string-append "0.0-" revision "." | |
314 | (string-take commit 7))) | |
315 | (source | |
316 | (origin | |
317 | (method git-fetch) | |
318 | (uri (git-reference | |
319 | (url "https://github.com/arcfide/chez-sockets.git") | |
320 | (commit commit))) | |
321 | (file-name (string-append name "-" version "-checkout")) | |
322 | (sha256 | |
323 | (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) | |
324 | (build-system gnu-build-system) | |
325 | (native-inputs | |
326 | `(("chez-scheme" ,chez-scheme) | |
327 | ("chez-web" ,chez-web) | |
328 | ("texlive" ,texlive))) | |
329 | (arguments | |
330 | `(#:tests? #f ; no tests | |
331 | #:phases | |
332 | (modify-phases %standard-phases | |
333 | (replace 'configure | |
334 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
335 | (let* ((out (assoc-ref outputs "out")) | |
336 | (chez-web (assoc-ref inputs "chez-web")) | |
337 | (chez (assoc-ref inputs "chez-scheme")) | |
338 | (chez-h (dirname (car (find-files chez "scheme\\.h"))))) | |
339 | (substitute* "Makefile" | |
340 | (("(SCHEMEH=).*$" all var) | |
341 | (string-append var chez-h))) | |
342 | #t))) | |
343 | (add-before 'build 'tangle | |
344 | (lambda _ | |
345 | ;; just using "make" tries to build the .c files before | |
346 | ;; they are created. | |
347 | (and (zero? (system* "make" "sockets")) | |
348 | (zero? (system* "make"))))) | |
349 | (replace 'build | |
350 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
351 | (let* ((out (assoc-ref outputs "out")) | |
352 | (chez-site (string-append out "/lib/csv" | |
353 | ,(package-version chez-scheme) | |
354 | "-site/arcfide"))) | |
355 | ;; make sure Chez Scheme can find the shared libraries. | |
356 | (substitute* "sockets.ss" | |
357 | (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\"" | |
358 | all cmd so) | |
359 | (string-append cmd " \"" chez-site "/" so "\"")) | |
360 | (("sockets-stub\\.[sd][oy].*" all) | |
361 | (string-append chez-site "/" all))) | |
362 | ;; to compile chez-sockets, the .so files must be | |
363 | ;; installed (because of the absolute path we | |
364 | ;; inserted above). | |
365 | (for-each (lambda (f d) (install-file f d)) | |
366 | '("socket-ffi-values.so" "sockets-stub.so") | |
367 | (list chez-site chez-site)) | |
368 | (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q"))))) | |
369 | (replace 'install | |
370 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
371 | (let* ((out (assoc-ref outputs "out")) | |
372 | (lib (string-append out "/lib/chez-sockets")) | |
373 | (doc (string-append out "/share/doc/" ,name "-" ,version)) | |
374 | (chez-site (string-append out "/lib/csv" | |
375 | ,(package-version chez-scheme) | |
376 | "-site/arcfide"))) | |
377 | (for-each (lambda (f d) (install-file f d)) | |
378 | '("sockets.pdf" "sockets.so") | |
379 | (list doc chez-site)) | |
380 | #t)))))) | |
381 | (home-page "https://github.com/arcfide/chez-sockets") | |
382 | (synopsis "Extensible sockets library for Chez Scheme") | |
383 | (description "Chez-sockets is an extensible sockets library for | |
384 | Chez Scheme.") | |
385 | (license expat)))) | |
38754190 FB |
386 | |
387 | ;; Help function for Chez Scheme to add the current path to | |
388 | ;; CHEZSCHEMELIBDIRS. | |
389 | (define chez-configure | |
390 | '(lambda _ | |
391 | (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) | |
392 | (setenv "CHEZSCHEMELIBDIRS" | |
393 | (if chez-env | |
394 | (string-append ".:" chez-env) | |
395 | ".")) | |
396 | #t))) | |
397 | ||
398 | ;; Help function to define make flags for some Chez Scheme custom make | |
399 | ;; files. | |
400 | (define (chez-make-flags name version) | |
401 | `(let ((out (assoc-ref %outputs "out"))) | |
402 | (list (string-append "PREFIX=" out) | |
403 | (string-append "DOCDIR=" out "/share/doc/" | |
404 | ,name "-" ,version)))) | |
405 | ||
406 | (define-public chez-matchable | |
407 | (package | |
408 | (name "chez-matchable") | |
409 | (version "20160306") | |
410 | (home-page "https://github.com/fedeinthemix/chez-matchable") | |
411 | (source | |
412 | (origin | |
413 | (method url-fetch) | |
414 | (uri (string-append home-page "/archive" "/v" version ".tar.gz")) | |
415 | (sha256 | |
416 | (base32 "0cl4vc6487pikjq159pj4n5ghyaax31nywb5n4yn1682h3ir1hs0")) | |
417 | (file-name (string-append name "-" version ".tar.gz")))) | |
418 | (build-system gnu-build-system) | |
419 | (inputs | |
420 | `(("chez-srfi" ,chez-srfi))) ; for tests | |
421 | (native-inputs | |
422 | `(("chez-scheme" ,chez-scheme))) | |
423 | (arguments | |
424 | `(#:make-flags ,(chez-make-flags name version) | |
425 | #:test-target "test" | |
426 | #:phases (modify-phases %standard-phases | |
427 | (replace 'configure ,chez-configure)))) | |
428 | (synopsis "Portable hygienic pattern matcher for Scheme") | |
429 | (description "This package provides a superset of the popular Scheme | |
430 | @code{match} package by Andrew Wright, written in fully portable | |
431 | @code{syntax-rules} and thus preserving hygiene.") | |
432 | (license public-domain))) | |
87d6c9ef FB |
433 | |
434 | (define-public chez-irregex | |
435 | (package | |
436 | (name "chez-irregex") | |
437 | (version "0.9.4") | |
438 | (source | |
439 | (origin | |
440 | (method url-fetch) | |
441 | (uri (string-append | |
442 | "https://github.com/fedeinthemix/chez-irregex/archive" | |
443 | "/v" version ".tar.gz")) | |
444 | (sha256 | |
445 | (base32 "0ywy5syaw549a58viz68dmgnv756ic705rcnlqxgjq27lnaim53b")) | |
446 | (file-name (string-append name "-" version ".tar.gz")))) | |
447 | (build-system gnu-build-system) | |
448 | (inputs | |
449 | `(("chez-matchable" ,chez-matchable))) ; for tests | |
450 | (propagated-inputs | |
451 | `(("chez-srfi" ,chez-srfi))) ; for irregex-utils | |
452 | (native-inputs | |
453 | `(("chez-scheme" ,chez-scheme))) | |
454 | (arguments | |
455 | `(#:make-flags ,(chez-make-flags name version) | |
456 | #:test-target "test" | |
457 | #:phases (modify-phases %standard-phases | |
458 | (replace 'configure ,chez-configure)))) | |
459 | (home-page "https://github.com/fedeinthemix/chez-irregex") | |
460 | (synopsis "Portable regular expression library for Scheme") | |
461 | (description "This package provides a portable and efficient | |
462 | R[4567]RS implementation of regular expressions, supporting both POSIX | |
463 | syntax with various (irregular) PCRE extensions, as well as SCSH's SRE | |
464 | syntax, with various aliases for commonly used patterns.") | |
465 | (license bsd-3))) | |
fb6d2d75 FB |
466 | |
467 | (define-public chez-fmt | |
468 | (package | |
469 | (name "chez-fmt") | |
470 | (version "0.8.11") | |
471 | (source | |
472 | (origin | |
473 | (method url-fetch) | |
474 | (uri (string-append | |
475 | "http://synthcode.com/scheme/fmt/fmt-" version ".tar.gz")) | |
476 | (sha256 | |
477 | (base32 "1zxqlw1jyg85yzclylh8bp2b3fwcy3l3xal68jw837n5illvsjcl")) | |
478 | (file-name (string-append name "-" version ".tar.gz")))) | |
479 | (build-system gnu-build-system) | |
480 | (propagated-inputs | |
481 | `(("chez-srfi" ,chez-srfi))) ; for irregex-utils | |
482 | (native-inputs | |
483 | `(("chez-scheme" ,chez-scheme))) | |
484 | (arguments | |
485 | `(#:make-flags ,(chez-make-flags name version) | |
486 | #:test-target "chez-check" | |
487 | #:phases | |
488 | (modify-phases %standard-phases | |
489 | (replace 'configure ,chez-configure) | |
490 | (replace 'build | |
491 | (lambda* (#:key (make-flags '()) #:allow-other-keys) | |
492 | (zero? (apply system* "make" "chez-build" make-flags)))) | |
493 | (replace 'install | |
494 | (lambda* (#:key (make-flags '()) #:allow-other-keys) | |
495 | (zero? (apply system* "make" "chez-install" make-flags))))))) | |
496 | (home-page "http://synthcode.com/scheme/fmt") | |
497 | (synopsis "Combinator formatting library for Chez Scheme") | |
498 | (description "This package provides a library of procedures for | |
499 | formatting Scheme objects to text in various ways, and for easily | |
500 | concatenating, composing and extending these formatters efficiently | |
501 | without resorting to capturing and manipulating intermediate | |
502 | strings.") | |
503 | (license bsd-3))) | |
53b9684e FB |
504 | |
505 | (define-public chez-mit | |
506 | (package | |
507 | (name "chez-mit") | |
508 | (version "0.1") | |
509 | (home-page "https://github.com/fedeinthemix/chez-mit") | |
510 | (source | |
511 | (origin | |
512 | (method url-fetch) | |
513 | (uri (string-append home-page "/archive/v" version ".tar.gz")) | |
514 | (sha256 | |
515 | (base32 "1p11q061znwxzxrxg3vw4dbsnpv1dav12hjhnkrjnzyyjvvdm2kn")) | |
516 | (file-name (string-append name "-" version ".tar.gz")))) | |
517 | (build-system gnu-build-system) | |
518 | (inputs | |
519 | `(("chez-srfi" ,chez-srfi))) ; for tests | |
520 | (native-inputs | |
521 | `(("chez-scheme" ,chez-scheme))) | |
522 | (arguments | |
523 | `(#:make-flags ,(chez-make-flags name version) | |
524 | #:test-target "test" | |
525 | #:phases (modify-phases %standard-phases | |
526 | (replace 'configure ,chez-configure)))) | |
527 | (synopsis "MIT/GNU Scheme compatibility library for Chez Scheme") | |
528 | (description "This package provides a set of MIT/GNU Scheme compatibility | |
529 | libraries for Chez Scheme. The main goal was to provide the functionality | |
530 | required to port the program 'Scmutils' to Chez Scheme.") | |
531 | (license gpl3+))) | |
149c6523 FB |
532 | |
533 | (define-public chez-scmutils | |
534 | (package | |
535 | (name "chez-scmutils") | |
536 | (version "0.1") | |
537 | (home-page "https://github.com/fedeinthemix/chez-scmutils") | |
538 | (source | |
539 | (origin | |
540 | (method url-fetch) | |
541 | (uri (string-append home-page "/archive/v" version ".tar.gz")) | |
542 | (sha256 | |
543 | (base32 "1a5j61pggaiwl1gl6m038rcy5n8r2sj5nyjmz86jydx97mm5i8hj")) | |
544 | (file-name (string-append name "-" version ".tar.gz")))) | |
545 | (build-system gnu-build-system) | |
546 | (inputs | |
547 | `(("chez-srfi" ,chez-srfi))) ; for tests | |
548 | (native-inputs | |
549 | `(("chez-scheme" ,chez-scheme))) | |
550 | (propagated-inputs | |
551 | `(("chez-mit" ,chez-mit) | |
552 | ("chez-srfi" ,chez-srfi))) | |
553 | (arguments | |
554 | `(#:make-flags ,(chez-make-flags name version) | |
555 | #:tests? #f ; no test suite | |
556 | #:phases | |
557 | (modify-phases %standard-phases | |
558 | (replace 'configure ,chez-configure) | |
559 | ;; Since the documentation is lacking, we install the source | |
560 | ;; code. For things to work correctly we have to replace | |
561 | ;; relative paths by absolute ones in 'include' forms. This | |
562 | ;; in turn requires us to compile the files in the final | |
563 | ;; destination. | |
564 | (delete 'build) | |
565 | (add-after 'install 'install-src | |
566 | (lambda* (#:key (make-flags '()) #:allow-other-keys) | |
567 | (zero? (apply system* "make" "install-src" make-flags)))) | |
568 | (add-after 'install-src 'absolute-path-in-scm-files | |
569 | (lambda* (#:key outputs #:allow-other-keys) | |
570 | (let ((out (assoc-ref outputs "out"))) | |
571 | (for-each (lambda (file) | |
572 | (substitute* file | |
573 | (("include +\"\\./scmutils") | |
574 | (string-append "include \"" (dirname file))))) | |
575 | (find-files out "\\.sls")) | |
576 | (for-each (lambda (file) | |
577 | (substitute* file | |
578 | (("include +\"\\./scmutils/simplify") | |
579 | (string-append "include \"" (dirname file))))) | |
580 | (find-files out "fbe-syntax\\.scm")) | |
581 | #t))) | |
582 | (add-after 'absolute-path-in-scm-files 'build | |
583 | (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) | |
584 | (let* ((out (assoc-ref outputs "out")) | |
585 | (mk-file (car (find-files out "Makefile")))) | |
586 | (with-directory-excursion (dirname mk-file) | |
587 | (zero? (apply system* "make" "build" make-flags)))))) | |
588 | (add-after 'build 'clean-up | |
589 | (lambda* (#:key outputs #:allow-other-keys) | |
590 | (let* ((out (assoc-ref outputs "out"))) | |
591 | (for-each delete-file | |
592 | (find-files out "Makefile|compile-all\\.ss")))))))) | |
593 | (synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme") | |
594 | (description "This package provides a port of the MIT/GNU Scheme | |
595 | Scmutils program to Chez Scheme. The port consists of a set of | |
596 | libraries providing most of the functionality of the original.") | |
597 | (license gpl3+))) |