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