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