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