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