gnu: guile-irregex: Remove duplicate 'check deletion in modify-phases
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
00ebe474 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
b515822d 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
6bc24063 4;;; Copyright © 2015 Christopher Allan Webber <cwebber@dustycloud.org>
1722d680 5;;;
233e7676 6;;; This file is part of GNU Guix.
1722d680 7;;;
233e7676 8;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
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;;;
233e7676 13;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
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
233e7676 19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 20
1ffa7090 21(define-module (gnu packages guile)
4a44e743 22 #:use-module (guix licenses)
59a43334 23 #:use-module (gnu packages)
9c782445 24 #:use-module (gnu packages bash)
1ffa7090
LC
25 #:use-module (gnu packages bdw-gc)
26 #:use-module (gnu packages gawk)
27 #:use-module (gnu packages gperf)
28 #:use-module (gnu packages libffi)
29 #:use-module (gnu packages autotools)
f906d30c 30 #:use-module (gnu packages flex)
1ffa7090
LC
31 #:use-module (gnu packages libunistring)
32 #:use-module (gnu packages m4)
33 #:use-module (gnu packages multiprecision)
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages readline)
ef02e1e9 36 #:use-module (gnu packages ncurses)
87d836b2 37 #:use-module (gnu packages ed)
ce0614dd 38 #:use-module (gnu packages base)
f906d30c
CAW
39 #:use-module (gnu packages texinfo)
40 #:use-module (gnu packages gettext)
b416aadf 41 #:use-module (gnu packages databases)
9d373377 42 #:use-module (gnu packages python)
1722d680 43 #:use-module (guix packages)
87f5d366 44 #:use-module (guix download)
6bc24063 45 #:use-module (guix git-download)
32795fcf 46 #:use-module (guix build-system gnu)
6bc24063 47 #:use-module (guix build-system trivial)
32795fcf
LC
48 #:use-module (guix utils)
49 #:use-module (ice-9 match))
1722d680
LC
50
51;;; Commentary:
52;;;
c44899a2 53;;; GNU Guile, and modules and extensions.
1722d680
LC
54;;;
55;;; Code:
56
c44899a2
LC
57(define-public guile-1.8
58 (package
59 (name "guile")
60 (version "1.8.8")
61 (source (origin
87f5d366 62 (method url-fetch)
0db342a5 63 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
64 ".tar.gz"))
65 (sha256
66 (base32
01eafd38
LC
67 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
68 (patches (list (search-patch "guile-1.8-cpp-4.5.patch")))))
c44899a2
LC
69 (build-system gnu-build-system)
70 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
71
72 ;; Insert a phase before `configure' to patch things up.
73 #:phases (alist-cons-before
74 'configure
2f4fbe1c 75 'patch-stuff
c44899a2
LC
76 (lambda* (#:key outputs #:allow-other-keys)
77 ;; Add a call to `lt_dladdsearchdir' so that
78 ;; `libguile-readline.so' & co. are in the
79 ;; loader's search path.
80 (substitute* "libguile/dynl.c"
2f4fbe1c
LC
81 (("lt_dlinit.*$" match)
82 (format #f
83 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
84 match
85 (assoc-ref outputs "out"))))
86
87 ;; The usual /bin/sh...
88 (substitute* "ice-9/popen.scm"
89 (("/bin/sh") (which "sh"))))
c44899a2 90 %standard-phases)))
01eafd38 91 (inputs `(("gawk" ,gawk)
c44899a2
LC
92 ("readline" ,readline)))
93
94 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
95 ;; propagated.
96 (propagated-inputs `(("gmp" ,gmp)
be11b102 97 ("libltdl" ,libltdl)))
c44899a2
LC
98
99 ;; When cross-compiling, a native version of Guile itself is needed.
100 (self-native-input? #t)
101
9be8d7c8
LC
102 (native-search-paths
103 (list (search-path-specification
104 (variable "GUILE_LOAD_PATH")
af070955 105 (files '("share/guile/site")))))
9be8d7c8 106
f50d2669 107 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 108 (description
a22dc0c4
LC
109 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
110official extension language of the GNU system. It is an implementation of
111the Scheme language which can be easily embedded in other applications to
112provide a convenient means of extending the functionality of the application
113without requiring the source code to be rewritten.")
c44899a2 114 (home-page "http://www.gnu.org/software/guile/")
4a44e743 115 (license lgpl2.0+)))
c44899a2
LC
116
117(define-public guile-2.0
118 (package
119 (name "guile")
b1a01474 120 (version "2.0.11")
c44899a2 121 (source (origin
87f5d366 122 (method url-fetch)
0db342a5 123 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
124 ".tar.xz"))
125 (sha256
126 (base32
b515822d
MW
127 "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"))
128 (patches (list (search-patch "guile-arm-fixes.patch")))))
c44899a2
LC
129 (build-system gnu-build-system)
130 (native-inputs `(("pkgconfig" ,pkg-config)))
131 (inputs `(("libffi" ,libffi)
9c782445 132 ("readline" ,readline)
cba95006 133 ("bash" ,bash)))
c44899a2
LC
134
135 (propagated-inputs
136 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
137 ;; reads `-lltdl -lunistring', adding them here will add the needed
138 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
139 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
140 ("libunistring" ,libunistring)
be11b102
LC
141
142 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
143 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
144 ("libltdl" ,libltdl)
c44899a2
LC
145
146 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
147 ;; must be propagated.
bda1bc6c 148 ("bdw-gc" ,libgc)
c44899a2
LC
149 ("gmp" ,gmp)))
150
151 (self-native-input? #t)
152
9bf62d9b
LC
153 (outputs '("out" "debug"))
154
8ffaa93b 155 (arguments
9c782445 156 `(#:phases (alist-cons-before
8ffaa93b
LC
157 'configure 'pre-configure
158 (lambda* (#:key inputs #:allow-other-keys)
58b4e8e8 159 ;; Tell (ice-9 popen) the file name of Bash.
8ffaa93b
LC
160 (let ((bash (assoc-ref inputs "bash")))
161 (substitute* "module/ice-9/popen.scm"
162 (("/bin/sh")
163 (string-append bash "/bin/bash")))))
db619089 164 %standard-phases)))
8ffaa93b 165
9be8d7c8
LC
166 (native-search-paths
167 (list (search-path-specification
168 (variable "GUILE_LOAD_PATH")
af070955 169 (files '("share/guile/site/2.0")))
9be8d7c8
LC
170 (search-path-specification
171 (variable "GUILE_LOAD_COMPILED_PATH")
af070955 172 (files '("share/guile/site/2.0")))))
9be8d7c8 173
f50d2669 174 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 175 (description
a22dc0c4
LC
176 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
177official extension language of the GNU system. It is an implementation of
178the Scheme language which can be easily embedded in other applications to
179provide a convenient means of extending the functionality of the application
180without requiring the source code to be rewritten.")
c44899a2 181 (home-page "http://www.gnu.org/software/guile/")
4a44e743 182 (license lgpl3+)))
c44899a2 183
fa29b199
LC
184(define-public guile-2.0/fixed
185 ;; A package of Guile 2.0 that's rarely changed. It is the one used
186 ;; in the `base' module, and thus changing it entails a full rebuild.
bda1bc6c 187 guile-2.0)
fa29b199 188
be3feafe 189(define-public guile-next
f906d30c 190 (package (inherit guile-2.0)
be3feafe 191 (name "guile-next")
9a9e143b 192 (version "20151025.e5bccb6")
f906d30c
CAW
193 (source (origin
194 (method git-fetch)
195 (uri (git-reference
be3feafe 196 (url "git://git.sv.gnu.org/guile.git")
9a9e143b 197 (commit "e5bccb6e5df3485152bc6501e1f36275e09c6352")))
f906d30c
CAW
198 (sha256
199 (base32
9a9e143b 200 "0z7ywryfcargrpz8hdrz6sfs06c2h2y9baqin3mbjvvg96a5bx47"))))
be3feafe 201
f906d30c
CAW
202 (arguments
203 (substitute-keyword-arguments `(;; Tests aren't passing for now.
204 ;; Obviously we should re-enable this!
205 #:tests? #f
206 ,@(package-arguments guile-2.0))
207 ((#:phases phases)
208 `(modify-phases ,phases
209 (add-after 'unpack 'autogen
210 (lambda _
211 (zero? (system* "sh" "autogen.sh"))))
212 (add-before 'autogen 'patch-/bin/sh
213 (lambda _
214 (substitute* "build-aux/git-version-gen"
215 (("#!/bin/sh") (string-append "#!" (which "sh"))))
216 #t))))))
be3feafe 217 (synopsis "Snapshot of what will become version 2.2 of GNU Guile")
f906d30c
CAW
218 (native-inputs
219 `(("autoconf" ,autoconf)
220 ("automake" ,automake)
221 ("libtool" ,libtool)
222 ("flex" ,flex)
223 ("texinfo" ,texinfo)
224 ("gettext" ,gnu-gettext)
225 ,@(package-native-inputs guile-2.0)))))
226
be3feafe
CAW
227(define-public guile-for-guile-emacs
228 (package (inherit guile-next)
229 (name "guile-for-guile-emacs")
230 (version "20150510.d8d9a8d")
231 (source (origin
232 (method git-fetch)
233 (uri (git-reference
234 (url "git://git.hcoop.net/git/bpt/guile.git")
235 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
236 (sha256
237 (base32
238 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))))
239
c44899a2
LC
240\f
241;;;
242;;; Extensions.
243;;;
244
d6d9f1f7 245(define-public guile-reader
1722d680 246 (package
d6d9f1f7 247 (name "guile-reader")
ad29c6f2 248 (version "0.6.1")
d6d9f1f7
LC
249 (source (origin
250 (method url-fetch)
251 (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
252 version ".tar.gz"))
253 (sha256
254 (base32
ad29c6f2 255 "020wz5w8z6g79nbqifg2n496wxwkcjzh8xizpv6mz0hczpl155ma"))))
d6d9f1f7
LC
256 (build-system gnu-build-system)
257 (native-inputs `(("pkgconfig" ,pkg-config)
258 ("gperf" ,gperf)))
259 (inputs `(("guile" ,guile-2.0)))
ad29c6f2 260 (arguments `(#:configure-flags
d6d9f1f7
LC
261 (let ((out (assoc-ref %outputs "out")))
262 (list (string-append "--with-guilemoduledir="
263 out "/share/guile/site/2.0")))))
264 (synopsis "Framework for building readers for GNU Guile")
265 (description
266 "Guile-Reader is a simple framework for building readers for GNU Guile.
1722d680
LC
267
268The idea is to make it easy to build procedures that extend Guile’s read
35b9e423 269procedure. Readers supporting various syntax variants can easily be written,
1722d680 270possibly by re-using existing “token readers” of a standard Scheme
35b9e423 271readers. For example, it is used to implement Skribilo’s R5RS-derived
1722d680
LC
272document syntax.
273
274Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
275hopefully more powerful and flexible (for instance, one may instantiate as
276many readers as needed).")
d6d9f1f7
LC
277 (home-page "http://www.nongnu.org/guile-reader/")
278 (license gpl3+)))
1722d680 279
ef02e1e9
LC
280(define-public guile-ncurses
281 (package
282 (name "guile-ncurses")
31a123fe 283 (version "1.6")
ef02e1e9
LC
284 (source (origin
285 (method url-fetch)
286 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
287 version ".tar.gz"))
288 (sha256
289 (base32
31a123fe 290 "0wmk681zzi1wxw543r2s2r84ndnzxp69kr7pc01aw4l55hg7jn73"))))
ef02e1e9
LC
291 (build-system gnu-build-system)
292 (inputs `(("ncurses" ,ncurses)
293 ("guile" ,guile-2.0)))
294 (arguments
2c6b7c7d
LC
295 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
296 (string-append "--with-guilesitedir="
ef02e1e9 297 (assoc-ref %outputs "out")
3f69e393 298 "/share/guile/site/2.0"))
3931607e
LC
299
300 ;; Work around <http://bugs.gnu.org/21677>.
301 #:make-flags '("XFAIL_TESTS=curses_034_util.test")
302
afd3d931
LC
303 #:phases (alist-cons-after
304 'install 'post-install
305 (lambda* (#:key outputs #:allow-other-keys)
306 (let* ((out (assoc-ref outputs "out"))
307 (dir (string-append out "/share/guile/site/"))
308 (files (find-files dir ".scm")))
309 (substitute* files
310 (("\"libguile-ncurses\"")
311 (format #f "\"~a/lib/libguile-ncurses\""
312 out)))))
313 %standard-phases)))
ef02e1e9 314 (home-page "http://www.gnu.org/software/guile-ncurses/")
f50d2669 315 (synopsis "Guile bindings to ncurses")
ef02e1e9 316 (description
12bcf94a 317 "guile-ncurses provides Guile language bindings for the ncurses
79c311b8 318library.")
ef02e1e9
LC
319 (license lgpl3+)))
320
87d836b2
LC
321(define-public mcron
322 (package
323 (name "mcron")
d12c626c 324 (version "1.0.8")
87d836b2
LC
325 (source (origin
326 (method url-fetch)
327 (uri (string-append "mirror://gnu/mcron/mcron-"
328 version ".tar.gz"))
329 (sha256
330 (base32
d12c626c 331 "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b"))
01eafd38 332 (patches (list (search-patch "mcron-install.patch")))))
87d836b2 333 (build-system gnu-build-system)
b6c18d6a
LC
334 (native-inputs `(("pkg-config" ,pkg-config)))
335 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0)))
87d836b2 336 (home-page "http://www.gnu.org/software/mcron/")
f50d2669 337 (synopsis "Run jobs at scheduled times")
87d836b2 338 (description
79c311b8 339 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
a22dc0c4 340tasks on a schedule, such as every hour or every Monday. Mcron is written in
79c311b8
LC
341Guile, so its configuration can be written in Scheme; the original cron
342format is also supported.")
87d836b2
LC
343 (license gpl3+)))
344
3e9066fc
LC
345(define-public guile-lib
346 (package
347 (name "guile-lib")
348 (version "0.2.2")
349 (source (origin
350 (method url-fetch)
351 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
352 version ".tar.gz"))
353 (sha256
354 (base32
355 "1f9n2b5b5r75lzjinyk6zp6g20g60msa0jpfrk5hhg4j8cy0ih4b"))))
356 (build-system gnu-build-system)
357 (arguments
358 '(#:phases (alist-cons-before
359 'configure 'patch-module-dir
360 (lambda _
361 (substitute* "src/Makefile.in"
362 (("^moddir[[:blank:]]*=[[:blank:]]*([[:graph:]]+)" _ rhs)
363 (string-append "moddir = " rhs "/2.0\n"))))
364 %standard-phases)))
365 (inputs `(("guile" ,guile-2.0)))
366 (home-page "http://www.nongnu.org/guile-lib/")
367 (synopsis "Collection of useful Guile Scheme modules")
368 (description
35b9e423 369 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
3e9066fc
LC
370modules, allowing for people to cooperate integrating their generic Guile
371modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
372for Guile\".")
373
374 ;; The whole is under GPLv3+, but some modules are under laxer
375 ;; distribution terms such as LGPL and public domain. See `COPYING' for
376 ;; details.
377 (license gpl3+)))
378
6050a1fb
CR
379(define-public guile-json
380 (package
381 (name "guile-json")
cdf2b286 382 (version "0.4.0")
6050a1fb
CR
383 (source (origin
384 (method url-fetch)
385 (uri (string-append "mirror://savannah/guile-json/guile-json-"
386 version ".tar.gz"))
387 (sha256
388 (base32
cdf2b286 389 "0v06272rw4ycwzssjf3fzpk2vhpslvl55hz94q80vc6f74j0d5h6"))
bf6fcf54
LC
390 (modules '((guix build utils)))
391 (snippet
392 ;; Make sure everything goes under .../site/2.0, like Guile's
393 ;; search paths expects.
394 '(substitute* '("Makefile.in" "json/Makefile.in")
395 (("moddir =.*/share/guile/site" all)
396 (string-append all "/2.0"))))))
6050a1fb 397 (build-system gnu-build-system)
db5584dd 398 (native-inputs `(("guile" ,guile-2.0)))
6050a1fb
CR
399 (home-page "http://savannah.nongnu.org/projects/guile-json/")
400 (synopsis "JSON module for Guile")
401 (description
402 "Guile-json supports parsing and building JSON documents according to the
35b9e423 403http:://json.org specification. These are the main features:
6050a1fb
CR
404- Strictly complies to http://json.org specification.
405- Build JSON documents programmatically via macros.
406- Unicode support for strings.
407- Allows JSON pretty printing.")
408 (license lgpl3+)))
409
6bc24063
CAW
410(define-public guile-minikanren
411 (package
412 (name "guile-minikanren")
413 (version "20150424.e844d85")
414 (source (origin
415 (method git-fetch)
416 (uri (git-reference
417 (url "https://github.com/ijp/minikanren.git")
418 (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
419 (sha256
420 (base32
421 "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
422 (build-system trivial-build-system)
423 (arguments
424 `(#:modules
425 ((guix build utils)
426 (ice-9 match))
427 #:builder
428 (begin
429 (use-modules (guix build utils)
430 (ice-9 match))
431 (let* ((out (assoc-ref %outputs "out"))
432 (module-dir (string-append out "/share/guile/site/2.0"))
433 (source (assoc-ref %build-inputs "source"))
f3d8cd79 434 (doc (string-append out "/share/doc/guile-minikanren"))
6bc24063
CAW
435 (scm-files '("minikanren.scm"
436 "minikanren/mkextraforms.scm"
437 "minikanren/mkprelude.scm"
438 "minikanren/mk.scm"))
439 (guild (string-append (assoc-ref %build-inputs "guile")
440 "/bin/guild")))
441 ;; Make installation directories.
442 (mkdir-p (string-append module-dir "/minikanren"))
443 (mkdir-p doc)
444
445 ;; Compile .scm files and install.
446 (chdir source)
447 (setenv "GUILE_AUTO_COMPILE" "0")
448 (for-each (lambda (file)
449 (let* ((dest-file (string-append module-dir "/"
450 file ".scm"))
451 (go-file (match (string-split file #\.)
452 ((base _)
453 (string-append module-dir "/"
454 base ".go")))))
455 ;; Install source module.
456 (copy-file file dest-file)
457 ;; Install compiled module.
458 (unless (zero? (system* guild "compile"
459 "-L" source
460 "-o" go-file
461 file))
462 (error (format #f "Failed to compile ~s to ~s!"
463 file go-file)))))
464 scm-files)
465
466 ;; Also copy over the README.
96c46210 467 (install-file "README.org" doc)
6bc24063
CAW
468 #t))))
469 (inputs
470 `(("guile" ,guile-2.0)))
471 (home-page "https://github.com/ijp/minikanren")
e881752c 472 (synopsis "MiniKanren declarative logic system, packaged for Guile")
6bc24063
CAW
473 (description
474 "MiniKanren is a relational programming extension to the Scheme
475programming Language, written as a smaller version of Kanren suitable for
476pedagogical purposes. It is featured in the book, The Reasoned Schemer,
477written by Dan Friedman, William Byrd, and Oleg Kiselyov.
478
e881752c 479This is Ian Price's r6rs packaged version of miniKanren, which deviates
6bc24063
CAW
480slightly from miniKanren mainline.
481
482See http://minikanren.org/ for more on miniKanren generally.")
483 (license expat)))
484
32e14fc1
CAW
485(define-public guile-irregex
486 (package
487 (name "guile-irregex")
488 (version "0.9.3")
489 (source (origin
490 (method url-fetch)
491 (uri (string-append
492 "http://synthcode.com/scheme/irregex/irregex-"
493 version
494 ".tar.gz"))
495 (sha256
496 (base32
497 "1b8jl7bycyl2ssp6sb1j24pp9hvqyxm85ki9bmwd50glyyjs5zay"))))
498 (build-system gnu-build-system)
499 (arguments
500 `(#:modules ((guix build utils)
501 (ice-9 match)
502 (guix build gnu-build-system))
503 #:phases
504 (modify-phases %standard-phases
32e14fc1
CAW
505 (delete 'configure)
506 (delete 'build)
507 (delete 'check)
508 (replace 'install
509 (lambda* (#:key inputs outputs #:allow-other-keys)
510 (begin
511 (use-modules (guix build utils)
512 (ice-9 match))
513 (let* ((out (assoc-ref outputs "out"))
514 (module-dir (string-append out "/share/guile/site/2.0"))
515 (source (assoc-ref inputs "source"))
516 (doc (string-append out "/share/doc/guile-irregex/"))
517 (guild (string-append (assoc-ref %build-inputs "guile")
518 "/bin/guild")))
519 ;; Make installation directories.
520 (mkdir-p (string-append module-dir "/rx/source"))
521 (mkdir-p doc)
522
523 ;; Compile .scm files and install.
524 (setenv "GUILE_AUTO_COMPILE" "0")
525
526 (for-each (lambda (copy-info)
527 (match copy-info
528 ((src-file dest-file-basis)
529 (let* ((dest-file (string-append
530 module-dir dest-file-basis
531 ".scm"))
532 (go-file (string-append
533 module-dir dest-file-basis
534 ".go")))
535 ;; Install source module.
536 (copy-file src-file
537 dest-file)
538 ;; Install compiled module.
539 (unless (zero? (system* guild "compile"
540 "-L" (getcwd)
541 "-o" go-file
542 src-file))
543 (error (format #f "Failed to compile ~s to ~s!"
544 src-file dest-file)))))))
545 '(("irregex-guile.scm" "/rx/irregex")
546 ("irregex.scm" "/rx/source/irregex")
547 ;; Not really reachable via guile's packaging system,
548 ;; but nice to have around
549 ("irregex-utils.scm" "/rx/source/irregex-utils")))
550
551 ;; Also copy over the README.
552 (install-file "irregex.html" doc)
553 #t)))))))
554 (inputs
555 `(("guile" ,guile-2.0)))
556 (home-page "http://synthcode.com/scheme/irregex")
557 (synopsis "S-expression based regular expressions")
558 (description
559 "Irregex is an s-expression based alternative to your classic
560string-based regular expressions. It implements SRFI 115 and is deeply
561inspired by the SCSH regular expression system.")
562 (license bsd-3)))
93e7199b
CAW
563
564;; There are two guile-gdbm packages, one using the FFI and one with
565;; direct C bindings, hence the verbose name.
566
567(define-public guile-gdbm-ffi
568 (package
569 (name "guile-gdbm-ffi")
570 (version "20120209.fa1d5b6")
571 (source (origin
572 (method git-fetch)
573 (uri (git-reference
574 (url "https://github.com/ijp/guile-gdbm.git")
575 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
576 (sha256
577 (base32
578 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
579 (build-system trivial-build-system)
580 (arguments
581 `(#:modules
582 ((guix build utils))
583 #:builder
584 (begin
585 (use-modules (guix build utils)
586 (system base compile))
587
588 (let* ((out (assoc-ref %outputs "out"))
589 (module-dir (string-append out "/share/guile/site/2.0"))
590 (source (assoc-ref %build-inputs "source"))
591 (doc (string-append out "/share/doc"))
592 (guild (string-append (assoc-ref %build-inputs "guile")
593 "/bin/guild"))
594 (gdbm.scm-dest
595 (string-append module-dir "/gdbm.scm"))
596 (gdbm.go-dest
597 (string-append module-dir "/gdbm.go")))
598 ;; Make installation directories.
599 (mkdir-p module-dir)
600 (mkdir-p doc)
601
602 ;; Switch directory for compiling and installing
603 (chdir source)
604
605 ;; copy the source
606 (copy-file "gdbm.scm" gdbm.scm-dest)
607
608 ;; Patch the FFI
609 (substitute* gdbm.scm-dest
610 (("\\(dynamic-link \"libgdbm\"\\)")
611 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
612 (assoc-ref %build-inputs "gdbm"))))
613
614 ;; compile to the destination
615 (compile-file gdbm.scm-dest
616 #:output-file gdbm.go-dest)))))
617 (inputs
618 `(("guile" ,guile-2.0)))
619 (propagated-inputs
620 `(("gdbm" ,gdbm)))
621 (home-page "https://github.com/ijp/guile-gdbm")
622 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
623 (description
624 "Guile bindings to the GDBM key-value storage system, using
625Guile's foreign function interface.")
626 (license gpl3+)))
627
27f5e13e
DT
628(define-public haunt
629 (package
630 (name "haunt")
631 (version "0.1")
632 (source (origin
633 (method url-fetch)
634 (uri (string-append "http://files.dthompson.us/haunt/haunt-"
635 version ".tar.gz"))
636 (sha256
637 (base32
638 "15q1qwjnay7k90ppqrzqsmikvwyj61mjvf1zahyd9gm4vi2fgb3x"))))
639 (build-system gnu-build-system)
640 (inputs
641 `(("guile" ,guile-2.0)))
642 (synopsis "Functional static site generator")
643 (description "Haunt is a static site generator written in Guile
644Scheme. Haunt features a functional build system and an extensible
645interface for reading articles in any format.")
646 (home-page "http://haunt.dthompson.us")
647 (license gpl3+)))
648
36548111
DT
649(define-public guile-redis
650 (package
651 (name "guile-redis")
652 (version "0.1.0")
653 (source (origin
654 (method url-fetch)
655 (uri (string-append "mirror://savannah/guile-redis/guile-redis-"
656 version ".tar.gz"))
657 (sha256
658 (base32
659 "0vx6if6b4r3kwx64vzbs6vpc0cpcr85x11w9vkzq27gw8n7isv56"))
660 (modules '((guix build utils)))
661 (snippet
662 ;; Make sure everything goes under .../site/2.0, like Guile's
663 ;; search paths expects.
664 '(substitute* '("Makefile.in"
665 "redis/Makefile.in"
666 "redis/commands/Makefile.in")
667 (("moddir =.*/share/guile/site" all)
668 (string-append all "/2.0"))))))
669 (build-system gnu-build-system)
670 (native-inputs
671 `(("guile" ,guile-2.0)))
672 (home-page "http://savannah.nongnu.org/projects/guile-redis/")
673 (synopsis "Redis client library for Guile")
674 (description "Guile-redis provides a Scheme interface to the Redis
675key-value cache and store.")
676 (license lgpl3+)))
677
9d373377
CAW
678(define-public guile-wisp
679 (package
680 (name "guile-wisp")
681 (version "0.9.0")
682 (source (origin
683 (method url-fetch)
684 (uri (string-append "https://bitbucket.org/ArneBab/"
685 "wisp/downloads/wisp-"
686 version ".tar.gz"))
687 (sha256
688 (base32
689 "0y5fxacalkgbv9s71h58vdvm2h2ln3rk024dd0vszwcf953as5fq"))))
690 (build-system gnu-build-system)
691 (arguments
692 `(#:modules ((system base compile)
693 ,@%gnu-build-system-modules)
694 #:phases
695 (modify-phases %standard-phases
696 (add-before
697 'configure 'substitute-before-config
698
699 (lambda* (#:key inputs #:allow-other-keys)
700 (let ((bash (assoc-ref inputs "bash")))
701 ;; configure checks for guile-2.0, but ours is just named "guile" :)
702 (substitute* "configure"
703 (("guile-2.0") "guile"))
704 ;; Puts together some test files with /bin/bash hardcoded
705 (substitute* "Makefile.in"
706 (("/bin/bash")
707 (string-append bash "/bin/bash") ))
708 #t)))
709
710 ;; auto compilation breaks, but if we set HOME to /tmp,
711 ;; that works ok
712 (add-before
713 'check 'auto-compile-hacky-workaround
714 (lambda _
715 (setenv "HOME" "/tmp")
716 #t))
717 (replace
718 'install
719 (lambda* (#:key outputs inputs #:allow-other-keys)
720 (let* ((out (assoc-ref outputs "out"))
721 (module-dir (string-append out "/share/guile/site/2.0"))
722 (language-dir
723 (string-append module-dir "/language/wisp"))
724 (guild (string-append (assoc-ref inputs "guile")
725 "/bin/guild")))
726 ;; Make installation directories.
727 (mkdir-p module-dir)
728 (mkdir-p language-dir)
729
730 ;; copy the source
731 (copy-file "wisp-scheme.scm"
732 (string-append module-dir "/wisp-scheme.scm"))
733 (copy-file "language/wisp/spec.scm"
734 (string-append language-dir "/spec.scm"))
735
736 ;; compile to the destination
737 (compile-file "wisp-scheme.scm"
738 #:output-file (string-append
739 module-dir "/wisp-scheme.go"))
740 (compile-file "language/wisp/spec.scm"
741 #:output-file (string-append
742 language-dir "/spec.go"))
743 #t))))))
744 (home-page "http://draketo.de/english/wisp")
745 (inputs
746 `(("guile" ,guile-2.0)
747 ("python" ,python)))
748 (synopsis "wisp is a whitespace to lisp syntax for Guile")
749 (description "wisp is a syntax for Guile which provides a Python-like
750whitespace-significant language. It may be easier on the eyes for some
751users and in some situations.")
752 (license gpl3+)))
753
1722d680 754;;; guile.scm ends here