gnu: commencement: Update phase style.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
a614ce38 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
b515822d 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
c5793e7e 4;;; Copyright © 2015, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
44a2bdf8 5;;; Copyright © 2016 Alex Sassmannshausen <alex@pompo.co>
71311e4e 6;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
76e6e663 7;;; Copyright © 2016 Erik Edrosa <erik.edrosa@gmail.com>
4176eb19 8;;; Copyright © 2016 Eraim Flashner <efraim@flashner.co.il>
5245399f 9;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12235a12 10;;; Copyright © 2016, 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
3b5783fc 11;;; Copyright © 2016 Amirouche <amirouche@hypermove.net>
c5793e7e 12;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
aaf1bdc3 13;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
f252d6df 14;;; Copyright © 2017 David Thompson <davet@gnu.org>
b3542d77 15;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
d109b1e8 16;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
e076d56a 17;;; Copyright © 2017 ng0 <ng0@infotropique.org>
4168ddf6 18;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
d4660a54 19;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
1722d680 20;;;
233e7676 21;;; This file is part of GNU Guix.
1722d680 22;;;
233e7676 23;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
24;;; under the terms of the GNU General Public License as published by
25;;; the Free Software Foundation; either version 3 of the License, or (at
26;;; your option) any later version.
27;;;
233e7676 28;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
29;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31;;; GNU General Public License for more details.
32;;;
33;;; You should have received a copy of the GNU General Public License
233e7676 34;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 35
1ffa7090 36(define-module (gnu packages guile)
71e0f217 37 #:use-module ((guix licenses) #:prefix license:)
59a43334 38 #:use-module (gnu packages)
28a1041f 39 #:use-module (gnu packages admin) ;;for tree
472fc855 40 #:use-module (gnu packages aspell)
9c782445 41 #:use-module (gnu packages bash)
1ffa7090 42 #:use-module (gnu packages bdw-gc)
148585c2 43 #:use-module (gnu packages compression)
1ffa7090
LC
44 #:use-module (gnu packages gawk)
45 #:use-module (gnu packages gperf)
46 #:use-module (gnu packages libffi)
47 #:use-module (gnu packages autotools)
f906d30c 48 #:use-module (gnu packages flex)
1ffa7090 49 #:use-module (gnu packages libunistring)
7119cca8 50 #:use-module (gnu packages linux)
1ffa7090
LC
51 #:use-module (gnu packages m4)
52 #:use-module (gnu packages multiprecision)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages readline)
ef02e1e9 55 #:use-module (gnu packages ncurses)
87d836b2 56 #:use-module (gnu packages ed)
ce0614dd 57 #:use-module (gnu packages base)
f906d30c 58 #:use-module (gnu packages texinfo)
01497dfe 59 #:use-module (gnu packages man)
f906d30c 60 #:use-module (gnu packages gettext)
b416aadf 61 #:use-module (gnu packages databases)
9d373377 62 #:use-module (gnu packages python)
5649c8cd
DT
63 #:use-module (gnu packages gl)
64 #:use-module (gnu packages sdl)
65 #:use-module (gnu packages maths)
66 #:use-module (gnu packages image)
bd233722 67 #:use-module (gnu packages version-control)
bd9af610
AK
68 #:use-module (gnu packages xdisorg)
69 #:use-module (gnu packages xorg)
1722d680 70 #:use-module (guix packages)
87f5d366 71 #:use-module (guix download)
6bc24063 72 #:use-module (guix git-download)
32795fcf 73 #:use-module (guix build-system gnu)
6bc24063 74 #:use-module (guix build-system trivial)
32795fcf 75 #:use-module (guix utils)
d4660a54
MC
76 #:use-module (ice-9 match)
77 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
1722d680
LC
78
79;;; Commentary:
80;;;
c44899a2 81;;; GNU Guile, and modules and extensions.
1722d680
LC
82;;;
83;;; Code:
84
c44899a2
LC
85(define-public guile-1.8
86 (package
87 (name "guile")
88 (version "1.8.8")
89 (source (origin
87f5d366 90 (method url-fetch)
0db342a5 91 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
92 ".tar.gz"))
93 (sha256
94 (base32
01eafd38 95 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
fc1adab1 96 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
c44899a2
LC
97 (build-system gnu-build-system)
98 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
99
100 ;; Insert a phase before `configure' to patch things up.
dc1d3cde
KK
101 #:phases
102 (modify-phases %standard-phases
103 (add-before 'configure 'patch-stuff
104 (lambda* (#:key outputs #:allow-other-keys)
105 ;; Add a call to `lt_dladdsearchdir' so that
106 ;; `libguile-readline.so' & co. are in the
107 ;; loader's search path.
108 (substitute* "libguile/dynl.c"
109 (("lt_dlinit.*$" match)
110 (format #f
111 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
112 match
113 (assoc-ref outputs "out"))))
2f4fbe1c 114
dc1d3cde
KK
115 ;; The usual /bin/sh...
116 (substitute* "ice-9/popen.scm"
117 (("/bin/sh") (which "sh")))
118 #t)))))
01eafd38 119 (inputs `(("gawk" ,gawk)
c44899a2
LC
120 ("readline" ,readline)))
121
122 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
123 ;; propagated.
124 (propagated-inputs `(("gmp" ,gmp)
be11b102 125 ("libltdl" ,libltdl)))
c44899a2
LC
126
127 ;; When cross-compiling, a native version of Guile itself is needed.
128 (self-native-input? #t)
129
9be8d7c8
LC
130 (native-search-paths
131 (list (search-path-specification
132 (variable "GUILE_LOAD_PATH")
af070955 133 (files '("share/guile/site")))))
9be8d7c8 134
f50d2669 135 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 136 (description
a22dc0c4
LC
137 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
138official extension language of the GNU system. It is an implementation of
139the Scheme language which can be easily embedded in other applications to
140provide a convenient means of extending the functionality of the application
141without requiring the source code to be rewritten.")
6fd52309 142 (home-page "https://www.gnu.org/software/guile/")
71e0f217 143 (license license:lgpl2.0+)))
c44899a2
LC
144
145(define-public guile-2.0
146 (package
147 (name "guile")
b5efd14a 148 (version "2.0.14")
c44899a2 149 (source (origin
87f5d366 150 (method url-fetch)
0db342a5 151 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
152 ".tar.xz"))
153 (sha256
154 (base32
b5efd14a 155 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
c44899a2
LC
156 (build-system gnu-build-system)
157 (native-inputs `(("pkgconfig" ,pkg-config)))
158 (inputs `(("libffi" ,libffi)
88da729f 159 ,@(libiconv-if-needed)
baf549df
LC
160
161 ;; We need Bash when cross-compiling because some of the scripts
162 ;; in bin/ refer to it. Use 'bash-minimal' because we don't need
163 ;; an interactive Bash with Readline and all.
164 ,@(if (target-mingw?) '() `(("bash" ,bash-minimal)))))
c44899a2
LC
165 (propagated-inputs
166 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
167 ;; reads `-lltdl -lunistring', adding them here will add the needed
168 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
169 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
170 ("libunistring" ,libunistring)
be11b102
LC
171
172 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
173 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
174 ("libltdl" ,libltdl)
c44899a2
LC
175
176 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
177 ;; must be propagated.
bda1bc6c 178 ("bdw-gc" ,libgc)
c44899a2
LC
179 ("gmp" ,gmp)))
180
181 (self-native-input? #t)
182
9bf62d9b
LC
183 (outputs '("out" "debug"))
184
8ffaa93b 185 (arguments
b5e0c870
LC
186 `(#:configure-flags '("--disable-static") ;saves 3MiB
187 #:phases (alist-cons-before
8ffaa93b
LC
188 'configure 'pre-configure
189 (lambda* (#:key inputs #:allow-other-keys)
58b4e8e8 190 ;; Tell (ice-9 popen) the file name of Bash.
8ffaa93b
LC
191 (let ((bash (assoc-ref inputs "bash")))
192 (substitute* "module/ice-9/popen.scm"
88da729f
JN
193 ;; If bash is #f allow fallback for user to provide
194 ;; "bash" in PATH. This happens when cross-building to
195 ;; MinGW for which we do not have Bash yet.
8ffaa93b 196 (("/bin/sh")
88da729f
JN
197 ,@(if (target-mingw?)
198 '((if bash
199 (string-append bash "/bin/bash")
200 "bash"))
201 '((string-append bash "/bin/bash")))))))
db619089 202 %standard-phases)))
8ffaa93b 203
9be8d7c8
LC
204 (native-search-paths
205 (list (search-path-specification
206 (variable "GUILE_LOAD_PATH")
af070955 207 (files '("share/guile/site/2.0")))
9be8d7c8
LC
208 (search-path-specification
209 (variable "GUILE_LOAD_COMPILED_PATH")
ca408580 210 (files '("lib/guile/2.0/site-ccache"
05f1e956 211 "share/guile/site/2.0")))))
9be8d7c8 212
f50d2669 213 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 214 (description
a22dc0c4
LC
215 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
216official extension language of the GNU system. It is an implementation of
217the Scheme language which can be easily embedded in other applications to
218provide a convenient means of extending the functionality of the application
219without requiring the source code to be rewritten.")
6fd52309 220 (home-page "https://www.gnu.org/software/guile/")
71e0f217 221 (license license:lgpl3+)))
c44899a2 222
f6396d86 223(define-public guile-2.2
f906d30c 224 (package (inherit guile-2.0)
f6396d86 225 (name "guile")
2664e0f6 226 (version "2.2.3")
4eae7980
LC
227 (source (origin
228 (method url-fetch)
34d624ce
LC
229
230 ;; Note: we are limited to one of the compression formats
231 ;; supported by the bootstrap binaries, so no lzip here.
80a72572 232 (uri (string-append "mirror://gnu/guile/guile-" version
34d624ce 233 ".tar.xz"))
4eae7980
LC
234 (sha256
235 (base32
2664e0f6 236 "11j01agvnci2cx32wwpqs9078856yxmvs15gcsz7ganpkj2ahlw3"))
d9f0788a
LC
237 (modules '((guix build utils)))
238
239 ;; Remove the pre-built object files. Instead, build everything
240 ;; from source, at the expense of significantly longer build
241 ;; times (almost 3 hours on a 4-core Intel i5).
242 (snippet '(for-each delete-file
243 (find-files "prebuilt" "\\.go$")))))
4fbd0f4f 244 (properties '((timeout . 72000) ;20 hours
16b0f205 245 (max-silent-time . 36000))) ;10 hours (needed on ARM
1577a658 246 ; when heavily loaded)
dd90ed89
DT
247 (native-search-paths
248 (list (search-path-specification
249 (variable "GUILE_LOAD_PATH")
250 (files '("share/guile/site/2.2")))
251 (search-path-specification
252 (variable "GUILE_LOAD_COMPILED_PATH")
31769b9f 253 (files '("lib/guile/2.2/site-ccache"
33c3a214
LC
254 "share/guile/site/2.2")))))
255
256 (arguments
257 (if (%current-target-system)
258 (substitute-keyword-arguments (package-arguments guile-2.0)
259 ((#:phases phases '%standard-phases)
260 `(modify-phases ,phases
261 (add-after 'unpack 'sacrifice-elisp-support
262 (lambda _
263 ;; Cross-compiling language/elisp/boot.el fails, so
264 ;; sacrifice it. See
265 ;; <https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=988aa29238fca862c7e2cb55f15762a69b4c16ce>
266 ;; for the upstream fix.
267 (substitute* "module/Makefile.in"
268 (("language/elisp/boot\\.el")
269 "\n"))
270 #t)))))
271 (package-arguments guile-2.0)))))
4eae7980 272
34d624ce
LC
273(define-public guile-2.2/fixed
274 ;; A package of Guile 2.2 that's rarely changed. It is the one used
275 ;; in the `base' module, and thus changing it entails a full rebuild.
276 (package
277 (inherit guile-2.2)
a9308efe
MW
278 (properties '((hidden? . #t) ;people should install 'guile-2.2'
279 (timeout . 72000) ;20 hours
280 (max-silent-time . 36000))) ;10 hours (needed on ARM
281 ; when heavily loaded)
34d624ce
LC
282 (replacement #f)))
283
5cd074ea
LC
284(define-public guile-next
285 (deprecated-package "guile-next" guile-2.2))
286
2ba2c98d
LC
287(define (make-guile-readline guile)
288 (package
289 (name "guile-readline")
290 (version (package-version guile))
291 (source (package-source guile))
292 (build-system gnu-build-system)
293 (arguments
294 '(#:configure-flags '("--disable-silent-rules")
295 #:phases (modify-phases %standard-phases
296 (add-before 'build 'chdir
297 (lambda* (#:key outputs #:allow-other-keys)
298 (invoke "make" "-C" "libguile" "scmconfig.h")
299 (invoke "make" "-C" "lib")
300 (chdir "guile-readline")
301
302 (substitute* "Makefile"
303 (("../libguile/libguile-[[:graph:]]+\\.la")
304 ;; Remove dependency on libguile-X.Y.la.
305 "")
306 (("^READLINE_LIBS = (.*)$" _ libs)
307 ;; Link against the provided libguile.
308 (string-append "READLINE_LIBS = "
309 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
310 libs "\n"))
311 (("\\$\\(top_builddir\\)/meta/build-env")
312 ;; Use the provided Guile, not the one from
313 ;; $(builddir).
314 "")
315
316 ;; Install modules to the 'site' directories.
317 (("^moddir = .*$")
318 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
319 (("^ccachedir = .*$")
320 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
321
322 ;; Load 'guile-readline.so' from the right place.
323 (substitute* "ice-9/readline.scm"
324 (("load-extension \"guile-readline\"")
325 (format #f "load-extension \
326 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
327 (assoc-ref outputs "out"))))
328 #t)))))
329 (home-page (package-home-page guile))
330 (native-inputs (package-native-inputs guile))
331 (inputs
332 `(,@(package-inputs guile) ;to placate 'configure'
333 ,@(package-propagated-inputs guile)
334 ("guile" ,guile)
335 ("readline" ,readline)))
336 (synopsis "Line editing support for GNU Guile")
337 (description
338 "This module provides line editing support via the Readline library for
339GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
340@code{activate-readline} procedure to enable it.")
341 (license license:gpl3+)))
342
343(define-public guile-readline
344 (make-guile-readline guile-2.2))
345
8f4acad7
LC
346(define (guile-variant-package-name prefix)
347 (lambda (name)
348 "Return NAME with PREFIX instead of \"guile-\", when applicable."
349 (if (string-prefix? "guile-" name)
350 (string-append prefix "-"
351 (string-drop name
352 (string-length "guile-")))
353 name)))
947a5d47
LC
354
355(define package-for-guile-2.2
356 ;; A procedure that rewrites the dependency tree of the given package to use
f6396d86
LC
357 ;; GUILE-2.2 instead of GUILE-2.0.
358 (package-input-rewriting `((,guile-2.0 . ,guile-2.2))
8f4acad7
LC
359 (guile-variant-package-name "guile2.2")))
360
361(define package-for-guile-2.0
362 ;; Likewise, but the other way around. :-)
363 (package-input-rewriting `((,guile-2.2 . ,guile-2.0))
364 (guile-variant-package-name "guile2.0")))
947a5d47 365
4eae7980 366(define-public guile-for-guile-emacs
f6396d86 367 (package (inherit guile-2.2)
4eae7980
LC
368 (name "guile-for-guile-emacs")
369 (version "20150510.d8d9a8d")
f906d30c
CAW
370 (source (origin
371 (method git-fetch)
372 (uri (git-reference
4eae7980
LC
373 (url "git://git.hcoop.net/git/bpt/guile.git")
374 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
51988e3a 375 (file-name (string-append name "-" version "-checkout"))
f906d30c
CAW
376 (sha256
377 (base32
4eae7980 378 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
f906d30c
CAW
379 (arguments
380 (substitute-keyword-arguments `(;; Tests aren't passing for now.
381 ;; Obviously we should re-enable this!
382 #:tests? #f
f6396d86 383 ,@(package-arguments guile-2.2))
f906d30c
CAW
384 ((#:phases phases)
385 `(modify-phases ,phases
386 (add-after 'unpack 'autogen
387 (lambda _
388 (zero? (system* "sh" "autogen.sh"))))
389 (add-before 'autogen 'patch-/bin/sh
390 (lambda _
391 (substitute* "build-aux/git-version-gen"
392 (("#!/bin/sh") (string-append "#!" (which "sh"))))
393 #t))))))
394 (native-inputs
395 `(("autoconf" ,autoconf)
396 ("automake" ,automake)
397 ("libtool" ,libtool)
398 ("flex" ,flex)
399 ("texinfo" ,texinfo)
b94a6ca0 400 ("gettext" ,gettext-minimal)
f6396d86 401 ,@(package-native-inputs guile-2.2)))
daeb61f7
RW
402 ;; Same as in guile-2.0
403 (native-search-paths
404 (list (search-path-specification
405 (variable "GUILE_LOAD_PATH")
406 (files '("share/guile/site/2.0")))
407 (search-path-specification
408 (variable "GUILE_LOAD_COMPILED_PATH")
31769b9f 409 (files '("lib/guile/2.0/site-ccache"
daeb61f7 410 "share/guile/site/2.0")))))))
be3feafe 411
71311e4e
RW
412;; There has not been any release yet.
413(define-public guildhall
414 (let ((commit "2fe2cc539f4b811bbcd69e58738db03eb5a2b778")
415 (revision "1"))
416 (package
417 (name "guildhall")
418 (version (string-append "0-" revision "." (string-take commit 9)))
419 (source (origin
420 (method git-fetch)
421 (uri (git-reference
422 (url "https://github.com/ijp/guildhall.git")
423 (commit commit)))
424 (file-name (string-append name "-" version "-checkout"))
425 (sha256
426 (base32
427 "115bym7bg66h3gs399yb2vkzc2ygriaqsn4zbrg8f054mgy8wzn1"))))
428 (build-system gnu-build-system)
429 (arguments
430 `(#:phases
431 (modify-phases %standard-phases
432 ;; Tests fail without this fix because they try to load the bash
433 ;; executable as a Scheme file. See bug report at
434 ;; https://github.com/ijp/guildhall/issues/22
435 (add-after 'unpack 'fix-bug-22
436 (lambda _
437 (substitute* "Makefile.am"
438 (("TESTS_ENVIRONMENT=.*")
439 "AM_TESTS_ENVIRONMENT=srcdir=$(abs_top_srcdir)/tests/
440TEST_EXTENSIONS = .scm
441SCM_LOG_COMPILER= $(top_builddir)/env $(GUILE)
442AM_SCM_LOG_FLAGS = --no-auto-compile -s")
443 ;; FIXME: one of the database tests fails for unknown
444 ;; reasons. It does not fail when run outside of Guix.
445 (("tests/database.scm") ""))
446 #t))
d10092b8 447 (add-after 'fix-bug-22 'autogen
71311e4e
RW
448 (lambda _
449 (zero? (system* "sh" "autogen.sh")))))))
450 (inputs
451 `(("guile" ,guile-2.0)))
452 (native-inputs
453 `(("zip" ,zip) ; for tests
454 ("autoconf" ,autoconf)
455 ("automake" ,automake)
456 ("texinfo" ,texinfo)))
457 (synopsis "Package manager for Guile")
458 (description
459 "Guildhall is a package manager written for Guile Scheme. A guild is
460an association of independent craftspeople. A guildhall is where they meet.
461This Guildhall aims to make a virtual space for Guile wizards and journeyfolk
462to share code.
463
464On a practical level, Guildhall lets you share Scheme modules and programs
465over the internet, and install code that has been shared by others. Guildhall
466can handle dependencies, so when a program requires several libraries, and
467each of those has further dependencies, all of the prerequisites for the
468program can be installed in one go.")
469 (home-page "https://github.com/ijp/guildhall")
470 (license license:gpl3+))))
471
c44899a2
LC
472\f
473;;;
474;;; Extensions.
475;;;
476
7119cca8 477(define-public artanis
12235a12
AFN
478 (let ((release "0.2.1")
479 (revision 3))
480 (package
481 (name "artanis")
482 (version (if (zero? revision)
483 release
484 (string-append release "-"
485 (number->string revision))))
486 (source (origin
487 (method url-fetch)
488 (uri (string-append "mirror://gnu/artanis/artanis-"
489 release ".tar.gz"))
490 (file-name (string-append name "-" version ".tar.gz"))
491 (sha256
492 (base32
493 "041ajcg2pz918kd9iqcj4inpzddc3impvz3r2nhlpbv8zrz011hn"))
494 (modules '((guix build utils)))
495 (snippet
496 '(begin
497 (delete-file-recursively "artanis/third-party/json.scm")
498 (delete-file-recursively "artanis/third-party/json")
499 (substitute* '("artanis/artanis.scm"
500 "artanis/oht.scm")
501 (("(#:use-module \\()artanis third-party (json\\))" _
502 use-module json)
503 (string-append use-module json)))
504 (substitute* "artanis/oht.scm"
505 (("([[:punct:][:space:]]+)(->json-string)([[:punct:][:space:]]+)"
506 _ pre json-string post)
507 (string-append pre
508 "scm" json-string
509 post)))
510 (substitute* "artanis/artanis.scm"
511 (("[[:punct:][:space:]]+->json-string[[:punct:][:space:]]+")
512 ""))))))
513 (build-system gnu-build-system)
514 ;; TODO: Add guile-dbi and guile-dbd optional dependencies.
515 (inputs `(("guile" ,guile-2.2)
516 ("guile-json" ,guile-json)))
517 (native-inputs `(("bash" ,bash) ;for the `source' builtin
518 ("pkgconfig" ,pkg-config)
519 ("util-linux" ,util-linux))) ;for the `script' command
520 (arguments
521 '(#:make-flags
522 ;; TODO: The documentation must be built with the `docs' target.
523 (let* ((out (assoc-ref %outputs "out"))
524 (scm (string-append out "/share/guile/site/2.2"))
525 (go (string-append out "/lib/guile/2.2/site-ccache")))
526 ;; Don't use (%site-dir) for site paths.
527 (list (string-append "MOD_PATH=" scm)
528 (string-append "MOD_COMPILED_PATH=" go)))
529 #:test-target "test"
530 #:phases
531 (modify-phases %standard-phases
532 (add-before 'install 'substitute-root-dir
533 (lambda* (#:key outputs #:allow-other-keys)
534 (let ((out (assoc-ref outputs "out")))
535 (substitute* "Makefile" ;ignore the execution of bash.bashrc
536 ((" /etc/bash.bashrc") " /dev/null"))
537 (substitute* "Makefile" ;set the root of config files to OUT
538 ((" /etc") (string-append " " out "/etc")))
539 (mkdir-p (string-append out "/bin")) ;for the `art' executable
540 #t)))
541 (add-after 'install 'wrap-art
542 (lambda* (#:key outputs #:allow-other-keys)
543 (let* ((out (assoc-ref outputs "out"))
544 (bin (string-append out "/bin"))
545 (scm (string-append out "/share/guile/site/2.2"))
546 (go (string-append out "/lib/guile/2.2/site-ccache")))
547 (wrap-program (string-append bin "/art")
548 `("GUILE_LOAD_PATH" ":" prefix (,scm))
549 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,go)))
550 #t))))))
551 (synopsis "Web application framework written in Guile")
552 (description "GNU Artanis is a web application framework written in Guile
7119cca8
ML
553Scheme. A web application framework (WAF) is a software framework that is
554designed to support the development of dynamic websites, web applications, web
555services and web resources. The framework aims to alleviate the overhead
556associated with common activities performed in web development. Artanis
557provides several tools for web development: database access, templating
558frameworks, session management, URL-remapping for RESTful, page caching, and
559more.")
12235a12
AFN
560 (home-page "https://www.gnu.org/software/artanis/")
561 (license (list license:gpl3+ license:lgpl3+))))) ;dual license
7119cca8 562
d6d9f1f7 563(define-public guile-reader
1722d680 564 (package
d6d9f1f7 565 (name "guile-reader")
77aa0887 566 (version "0.6.2")
d6d9f1f7
LC
567 (source (origin
568 (method url-fetch)
569 (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
570 version ".tar.gz"))
571 (sha256
572 (base32
77aa0887 573 "0592s2s8ampqmqwilc4fvcild6rb9gy79di6vxv5kcdmv23abkgx"))))
d6d9f1f7
LC
574 (build-system gnu-build-system)
575 (native-inputs `(("pkgconfig" ,pkg-config)
2fa077f3 576 ("gperf" ,gperf-3.0)))
bdf1022d 577 (inputs `(("guile" ,guile-2.2)))
d6d9f1f7
LC
578 (synopsis "Framework for building readers for GNU Guile")
579 (description
580 "Guile-Reader is a simple framework for building readers for GNU Guile.
1722d680
LC
581
582The idea is to make it easy to build procedures that extend Guile’s read
35b9e423 583procedure. Readers supporting various syntax variants can easily be written,
1722d680 584possibly by re-using existing “token readers” of a standard Scheme
35b9e423 585readers. For example, it is used to implement Skribilo’s R5RS-derived
1722d680
LC
586document syntax.
587
588Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
589hopefully more powerful and flexible (for instance, one may instantiate as
590many readers as needed).")
340978d7 591 (home-page "https://www.nongnu.org/guile-reader/")
71e0f217 592 (license license:gpl3+)))
1722d680 593
bdf1022d
LC
594(define-public guile2.0-reader
595 (package-for-guile-2.0 guile-reader))
517fce63 596(define-public guile2.2-reader
bdf1022d 597 (deprecated-package "guile2.2-reader" guile-reader))
517fce63 598
ef02e1e9
LC
599(define-public guile-ncurses
600 (package
601 (name "guile-ncurses")
958d357a 602 (version "2.2")
ef02e1e9
LC
603 (source (origin
604 (method url-fetch)
605 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
606 version ".tar.gz"))
607 (sha256
608 (base32
958d357a 609 "1wvggbr4xv8idh1hzd8caj4xfp4pln78a7w1wqzd4zgzwmnzxr2f"))))
ef02e1e9
LC
610 (build-system gnu-build-system)
611 (inputs `(("ncurses" ,ncurses)
81eaa3f8 612 ("guile" ,guile-2.2)))
0881b616 613 (native-inputs `(("pkg-config" ,pkg-config)))
ef02e1e9 614 (arguments
2c6b7c7d 615 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
0881b616 616 "--with-gnu-filesystem-hierarchy")
fa37f21b
EF
617 #:phases
618 (modify-phases %standard-phases
8c4e99cc 619 (add-before 'build 'fix-libguile-ncurses-file-name
fa37f21b 620 (lambda* (#:key outputs #:allow-other-keys)
8c4e99cc
JD
621 (and (zero? (system* "make" "install"
622 "-C" "src/ncurses"
623 "-j" (number->string
624 (parallel-job-count))))
625 (let* ((out (assoc-ref outputs "out"))
626 (dir "src/ncurses")
627 (files (find-files dir ".scm")))
628 (substitute* files
629 (("\"libguile-ncurses\"")
81eaa3f8 630 (format #f "\"~a/lib/guile/2.2/libguile-ncurses\""
8c4e99cc
JD
631 out)))
632 #t)))))))
d81850d4 633 (home-page "https://www.gnu.org/software/guile-ncurses/")
f50d2669 634 (synopsis "Guile bindings to ncurses")
ef02e1e9 635 (description
12bcf94a 636 "guile-ncurses provides Guile language bindings for the ncurses
79c311b8 637library.")
71e0f217 638 (license license:lgpl3+)))
ef02e1e9 639
4d02e9ff
DM
640(define-public guile-ncurses/gpm
641 (package
642 (inherit guile-ncurses)
643 (name "guile-ncurses-with-gpm")
644 (inputs `(("ncurses" ,ncurses/gpm)
645 ("guile" ,guile-2.2)))))
646
87d836b2
LC
647(define-public mcron
648 (package
649 (name "mcron")
d12c626c 650 (version "1.0.8")
87d836b2
LC
651 (source (origin
652 (method url-fetch)
653 (uri (string-append "mirror://gnu/mcron/mcron-"
654 version ".tar.gz"))
655 (sha256
656 (base32
d12c626c 657 "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b"))
fc1adab1 658 (patches (search-patches "mcron-install.patch"))))
87d836b2 659 (build-system gnu-build-system)
b6c18d6a
LC
660 (native-inputs `(("pkg-config" ,pkg-config)))
661 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0)))
6fd52309 662 (home-page "https://www.gnu.org/software/mcron/")
f50d2669 663 (synopsis "Run jobs at scheduled times")
87d836b2 664 (description
79c311b8 665 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
a22dc0c4 666tasks on a schedule, such as every hour or every Monday. Mcron is written in
79c311b8
LC
667Guile, so its configuration can be written in Scheme; the original cron
668format is also supported.")
71e0f217 669 (license license:gpl3+)))
87d836b2 670
01497dfe
LC
671(define-public mcron2
672 ;; This is mthl's mcron development branch, not yet merged in mcron.
673 (let ((commit "31baff1a5187d8ddc89324cbe42dbeffc309c962"))
674 (package
675 (inherit mcron)
676 (name "mcron2")
677 (version (string-append (package-version mcron) "-0."
678 (string-take commit 7)))
679 (source (origin
680 (method git-fetch)
681 (uri (git-reference
682 (url "https://notabug.org/mthl/mcron/")
683 (commit commit)))
684 (sha256
685 (base32
686 "1h5wxy997hxi718hpx419c23q09939kbxrjbbq54lv0cgw1bb63z"))
687 (file-name (string-append name "-" version "-checkout"))))
688 (native-inputs
689 `(("autoconf" ,autoconf)
690 ("automake" ,automake)
691 ("pkg-config" ,pkg-config)
692 ("texinfo" ,texinfo)
693 ("help2man" ,help2man)))
d4660a54
MC
694 (inputs
695 `(("guile-2.2" ,guile-2.2)
696 ,@(srfi-1:alist-delete "guile" (package-inputs mcron))))
01497dfe
LC
697 (arguments
698 `(#:modules ((ice-9 match) (ice-9 ftw)
699 ,@%gnu-build-system-modules)
d4660a54
MC
700 ;; When building the targets in parallel, help2man tries to generate
701 ;; the manpage from ./cron --help before it is built, which fails.
702 #:parallel-build? #f
703 #:phases
704 (modify-phases %standard-phases
705 (add-after 'unpack 'use-guile-2.2
706 (lambda _
707 (substitute* "configure.ac"
708 (("PKG_CHECK_MODULES\\(\\[GUILE\\],.*$")
bc880f9d
LC
709 "PKG_CHECK_MODULES([GUILE], [guile-2.2])\n")
710 (("guile/site/2.0")
711 "guile/site/2.2"))
d4660a54
MC
712 #t))
713 (add-after 'use-guile-2.2 'bootstrap
714 (lambda _
715 (invoke "autoreconf" "-vfi")))
716 (add-after 'install 'wrap-mcron
717 (lambda* (#:key outputs #:allow-other-keys)
718 ;; Wrap the 'mcron' command to refer to the right
719 ;; modules.
720 (let* ((out (assoc-ref outputs "out"))
721 (bin (string-append out "/bin"))
722 (site (string-append
723 out "/share/guile/site")))
724 (match (scandir site)
725 (("." ".." version)
726 (let ((modules (string-append site "/" version)))
727 (wrap-program (string-append bin "/mcron")
728 `("GUILE_LOAD_PATH" ":" prefix
729 (,modules))
730 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
731 (,modules)))
732 #t))))))))))))
01497dfe 733
814b18e5
AS
734(define-public guile-ics
735 (package
736 (name "guile-ics")
737 (version "0.1.1")
738 (source (origin
739 (method git-fetch)
740 (uri (git-reference
741 (url "https://github.com/artyom-poptsov/guile-ics")
742 (commit "v0.1.1")))
743 (file-name (string-append name "-" version "-checkout"))
744 (sha256
745 (base32
746 "1pvg6j48inpbq47hq00yh5hhl2qd2srvrx5yjl7w7ky1jsjadp86"))))
747 (build-system gnu-build-system)
748 (arguments
749 '(#:phases (modify-phases %standard-phases
d10092b8
KK
750 (add-after 'unpack 'autoreconf
751 (lambda _
752 ;; Repository comes with a broken symlink
753 (delete-file "README")
754 (symlink "README.org" "README")
755 (zero? (system* "autoreconf" "-fi")))))))
814b18e5
AS
756 (native-inputs
757 `(("autoconf" ,(autoconf-wrapper))
758 ("automake" ,automake)
759 ("texinfo" ,texinfo)
760 ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS'.
761 ("gettext" ,gettext-minimal)
762 ("pkg-config" ,pkg-config)))
763 (inputs `(("guile" ,guile-2.0) ("which" ,which)))
1b0f266e 764 (propagated-inputs `(("guile-lib" ,guile2.0-lib)))
814b18e5
AS
765 (home-page "https://github.com/artyom-poptsov/guile-ics")
766 (synopsis "Guile parser library for the iCalendar format")
767 (description
768 "Guile-ICS is an iCalendar (RFC5545) format parser library written in
769pure Scheme. The library can be used to read and write iCalendar data.
770
771The library is shipped with documentation in Info format and usage examples.")
71e0f217 772 (license license:gpl3+)))
814b18e5 773
3e9066fc
LC
774(define-public guile-lib
775 (package
776 (name "guile-lib")
30f17d73 777 (version "0.2.5.1")
3e9066fc 778 (source (origin
af126875
MC
779 (method url-fetch)
780 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
781 version ".tar.gz"))
782 (sha256
783 (base32
30f17d73 784 "19q420i3is3d4jmkdqs5y7ir7ipp4s795saflqgwf6617cx2zpj4"))))
3e9066fc
LC
785 (build-system gnu-build-system)
786 (arguments
af126875
MC
787 '(#:make-flags
788 '("GUILE_AUTO_COMPILE=0") ;to prevent guild errors
789 #:phases
790 (modify-phases %standard-phases
791 (add-before 'configure 'patch-module-dir
792 (lambda _
793 (substitute* "src/Makefile.in"
794 (("^moddir = ([[:graph:]]+)")
795 "moddir = $(datadir)/guile/site/@GUILE_EFFECTIVE_VERSION@\n")
796 (("^godir = ([[:graph:]]+)")
797 "godir = \
bf62b8ff 798$(libdir)/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n"))
af126875 799 #t)))))
bf62b8ff 800 (native-inputs `(("pkg-config" ,pkg-config)))
1b0f266e 801 (inputs `(("guile" ,guile-2.2)))
340978d7 802 (home-page "https://www.nongnu.org/guile-lib/")
3e9066fc
LC
803 (synopsis "Collection of useful Guile Scheme modules")
804 (description
35b9e423 805 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
3e9066fc
LC
806modules, allowing for people to cooperate integrating their generic Guile
807modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
808for Guile\".")
809
810 ;; The whole is under GPLv3+, but some modules are under laxer
811 ;; distribution terms such as LGPL and public domain. See `COPYING' for
812 ;; details.
71e0f217 813 (license license:gpl3+)))
3e9066fc 814
1b0f266e
LC
815(define-public guile2.0-lib
816 (package-for-guile-2.0 guile-lib))
817
12773de3 818(define-public guile2.2-lib
1b0f266e 819 (deprecated-package "guile2.2-lib" guile-lib))
12773de3 820
6050a1fb
CR
821(define-public guile-json
822 (package
823 (name "guile-json")
1f4f2360 824 (version "0.6.0")
6050a1fb 825 (source (origin
ffc72ec6
LC
826 (method url-fetch)
827 (uri (string-append "mirror://savannah/guile-json/guile-json-"
828 version ".tar.gz"))
829 (sha256
830 (base32
1f4f2360 831 "1qmjg7lbgciw95fkdzvlp9f68vv17kdjky42ywfzd4ffzwww0lgc"))
ffc72ec6
LC
832 (modules '((guix build utils)))
833 (snippet
834 ;; Make sure everything goes under .../site/X.Y, like Guile's
835 ;; search paths expects.
836 '(begin
837 (substitute* "configure"
838 (("ac_subst_vars='")
839 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
840 (substitute* '("Makefile.in" "json/Makefile.in")
841 (("moddir =.*/share/guile/site" all)
842 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))))))
6050a1fb 843 (build-system gnu-build-system)
2252f087 844 (native-inputs `(("guile" ,guile-2.2)))
340978d7 845 (home-page "https://savannah.nongnu.org/projects/guile-json/")
6050a1fb
CR
846 (synopsis "JSON module for Guile")
847 (description
0f31d4f0
LC
848 "Guile-JSON supports parsing and building JSON documents according to the
849specification. These are the main features:
850
851@itemize
852@item Strictly complies to @uref{http://json.org, specification}.
853@item Build JSON documents programmatically via macros.
854@item Unicode support for strings.
855@item Allows JSON pretty printing.
856@end itemize\n")
71e0f217 857 (license license:lgpl3+)))
6050a1fb 858
947a5d47 859(define-public guile2.2-json
2252f087
LC
860 (deprecated-package "guile2.2-json" guile-json))
861
862(define-public guile2.0-json
863 (package-for-guile-2.0 guile-json))
947a5d47 864
6bc24063
CAW
865(define-public guile-minikanren
866 (package
867 (name "guile-minikanren")
868 (version "20150424.e844d85")
869 (source (origin
870 (method git-fetch)
871 (uri (git-reference
872 (url "https://github.com/ijp/minikanren.git")
873 (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
821f4dc2 874 (file-name (string-append name "-" version "-checkout"))
6bc24063
CAW
875 (sha256
876 (base32
877 "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
878 (build-system trivial-build-system)
879 (arguments
4b74a29d 880 `(#:modules ((guix build utils))
6bc24063
CAW
881 #:builder
882 (begin
883 (use-modules (guix build utils)
4b74a29d
LC
884 (ice-9 match)
885 (ice-9 popen)
886 (ice-9 rdelim))
887
6bc24063 888 (let* ((out (assoc-ref %outputs "out"))
4b74a29d
LC
889 (guile (assoc-ref %build-inputs "guile"))
890 (effective (read-line
891 (open-pipe* OPEN_READ
892 (string-append guile "/bin/guile")
893 "-c" "(display (effective-version))")))
894 (module-dir (string-append out "/share/guile/site/"
895 effective))
6bc24063 896 (source (assoc-ref %build-inputs "source"))
f3d8cd79 897 (doc (string-append out "/share/doc/guile-minikanren"))
6bc24063
CAW
898 (scm-files '("minikanren.scm"
899 "minikanren/mkextraforms.scm"
900 "minikanren/mkprelude.scm"
901 "minikanren/mk.scm"))
902 (guild (string-append (assoc-ref %build-inputs "guile")
903 "/bin/guild")))
904 ;; Make installation directories.
905 (mkdir-p (string-append module-dir "/minikanren"))
906 (mkdir-p doc)
907
908 ;; Compile .scm files and install.
909 (chdir source)
910 (setenv "GUILE_AUTO_COMPILE" "0")
911 (for-each (lambda (file)
912 (let* ((dest-file (string-append module-dir "/"
76e6e663 913 file))
6bc24063
CAW
914 (go-file (match (string-split file #\.)
915 ((base _)
916 (string-append module-dir "/"
917 base ".go")))))
918 ;; Install source module.
919 (copy-file file dest-file)
920 ;; Install compiled module.
921 (unless (zero? (system* guild "compile"
922 "-L" source
923 "-o" go-file
924 file))
925 (error (format #f "Failed to compile ~s to ~s!"
926 file go-file)))))
927 scm-files)
928
929 ;; Also copy over the README.
96c46210 930 (install-file "README.org" doc)
6bc24063
CAW
931 #t))))
932 (inputs
933 `(("guile" ,guile-2.0)))
934 (home-page "https://github.com/ijp/minikanren")
e881752c 935 (synopsis "MiniKanren declarative logic system, packaged for Guile")
6bc24063
CAW
936 (description
937 "MiniKanren is a relational programming extension to the Scheme
938programming Language, written as a smaller version of Kanren suitable for
939pedagogical purposes. It is featured in the book, The Reasoned Schemer,
940written by Dan Friedman, William Byrd, and Oleg Kiselyov.
941
e881752c 942This is Ian Price's r6rs packaged version of miniKanren, which deviates
6bc24063
CAW
943slightly from miniKanren mainline.
944
945See http://minikanren.org/ for more on miniKanren generally.")
71e0f217 946 (license license:expat)))
6bc24063 947
947a5d47
LC
948(define-public guile2.2-minikanren
949 (package-for-guile-2.2 guile-minikanren))
950
28a1041f
AP
951(define-public guile-miniadapton
952 (let ((commit "1b5749422304567c96ac5367f2221dda9eff5880")
953 (revision "1"))
954 (package
955 (name "guile-miniadapton")
956 (version (string-append "0-" revision "." (string-take commit 9)))
957 (source (origin
958 (method git-fetch)
959 (uri (git-reference
960 (url "https://github.com/fisherdj/miniAdapton.git")
961 (commit commit)))
962 (file-name (string-append name "-" version "-checkout"))
963 (sha256
964 (base32
965 "09q51zkw2fypad5xixskfzw2cjhjgs5cswdp3i7cpp651rb3zndh"))))
966 (build-system gnu-build-system)
967 (arguments
968 `(#:modules ((guix build utils)
969 (ice-9 popen)
970 (ice-9 rdelim)
971 (srfi srfi-1)
972 (guix build gnu-build-system))
973 #:tests? #f ; there is no test target
974 #:phases
975 (modify-phases %standard-phases
976 (delete 'configure)
977 (delete 'build)
978 (replace 'install
979 (lambda* (#:key outputs #:allow-other-keys)
980 (let* ((cwd (getcwd))
981 (scm-files (find-files "." "\\.scm$"))
982 (effective (read-line
983 (open-pipe* OPEN_READ
984 "guile" "-c"
985 "(display (effective-version))")))
986 (module-dir (string-append (assoc-ref outputs "out")
987 "/share/guile/site/"
988 effective)))
989
990 ;; Make installation directories.
991 (mkdir-p module-dir)
992
993 (setenv "GUILE_AUTO_COMPILE" "0")
994
995 ;; Compile .scm files and install.
996 (every (lambda (file)
997 (let ((go-file (string-append module-dir "/"
998 (basename file ".scm") ".go")))
999 ;; Install source module.
1000 (install-file file module-dir)
1001 ;; Compile and install module.
1002 (zero? (system* "guild" "compile" "-L" cwd
1003 "-o" go-file file))))
1004 scm-files)))))))
1005 (inputs
1006 `(("guile" ,guile-2.2)))
1007 (home-page "https://github.com/fisherdj/miniAdapton")
1008 (synopsis "Minimal implementation of incremental computation in Guile
1009Scheme")
1010 (description "This package provides a complete Scheme implementation of
1011miniAdapton, which implements the core functionality of the Adapton system for
1012incremental computation (also known as self-adjusting computation). Like
1013Adapton, miniAdapton allows programmers to safely combine mutation and
1014memoization. miniAdapton is built on top of an even simpler system,
1015microAdapton. Both miniAdapton and microAdapton are designed to be easy to
1016understand, extend, and port to host languages other than Scheme.")
1017 (license license:expat))))
1018
32e14fc1
CAW
1019(define-public guile-irregex
1020 (package
1021 (name "guile-irregex")
fb73f07a 1022 (version "0.9.6")
32e14fc1
CAW
1023 (source (origin
1024 (method url-fetch)
1025 (uri (string-append
1026 "http://synthcode.com/scheme/irregex/irregex-"
d03f9446 1027 version ".tar.gz"))
32e14fc1
CAW
1028 (sha256
1029 (base32
fb73f07a 1030 "1ia3m7dp3lcxa048q0gqbiwwsyvn99baw6xkhb4bhhzn4k7bwyqq"))))
32e14fc1
CAW
1031 (build-system gnu-build-system)
1032 (arguments
1033 `(#:modules ((guix build utils)
1034 (ice-9 match)
fe447664
LC
1035 (ice-9 rdelim)
1036 (ice-9 popen)
32e14fc1
CAW
1037 (guix build gnu-build-system))
1038 #:phases
1039 (modify-phases %standard-phases
32e14fc1
CAW
1040 (delete 'configure)
1041 (delete 'build)
1042 (delete 'check)
1043 (replace 'install
1044 (lambda* (#:key inputs outputs #:allow-other-keys)
fe447664
LC
1045 (let* ((out (assoc-ref outputs "out"))
1046 (effective (read-line
1047 (open-pipe* OPEN_READ
1048 "guile" "-c"
1049 "(display (effective-version))")))
1050 (module-dir (string-append out "/share/guile/site/"
1051 effective))
1052 (source (assoc-ref inputs "source"))
1053 (doc (string-append out "/share/doc/guile-irregex/"))
1054 (guild (string-append (assoc-ref %build-inputs "guile")
1055 "/bin/guild")))
1056 ;; Make installation directories.
1057 (mkdir-p (string-append module-dir "/rx/source"))
1058 (mkdir-p doc)
1059
1060 ;; Compile .scm files and install.
1061 (setenv "GUILE_AUTO_COMPILE" "0")
1062
1063 (for-each (lambda (copy-info)
1064 (match copy-info
1065 ((src-file dest-file-basis)
1066 (let* ((dest-file (string-append
32e14fc1 1067 module-dir dest-file-basis
fe447664
LC
1068 ".scm"))
1069 (go-file (string-append
1070 module-dir dest-file-basis
1071 ".go")))
1072 ;; Install source module.
1073 (copy-file src-file
1074 dest-file)
1075 ;; Install compiled module.
1076 (unless (zero? (system* guild "compile"
1077 "-L" (getcwd)
1078 "-o" go-file
1079 src-file))
1080 (error (format #f "Failed to compile ~s to ~s!"
1081 src-file dest-file)))))))
1082 '(("irregex-guile.scm" "/rx/irregex")
1083 ("irregex.scm" "/rx/source/irregex")
1084 ;; Not really reachable via guile's packaging system,
1085 ;; but nice to have around
1086 ("irregex-utils.scm" "/rx/source/irregex-utils")))
1087
1088 ;; Also copy over the README.
1089 (install-file "irregex.html" doc)
1090 #t))))))
32e14fc1
CAW
1091 (inputs
1092 `(("guile" ,guile-2.0)))
1093 (home-page "http://synthcode.com/scheme/irregex")
1094 (synopsis "S-expression based regular expressions")
1095 (description
1096 "Irregex is an s-expression based alternative to your classic
1097string-based regular expressions. It implements SRFI 115 and is deeply
1098inspired by the SCSH regular expression system.")
71e0f217 1099 (license license:bsd-3)))
93e7199b 1100
947a5d47
LC
1101(define-public guile2.2-irregex
1102 (package-for-guile-2.2 guile-irregex))
1103
93e7199b
CAW
1104;; There are two guile-gdbm packages, one using the FFI and one with
1105;; direct C bindings, hence the verbose name.
1106
1107(define-public guile-gdbm-ffi
1108 (package
1109 (name "guile-gdbm-ffi")
1110 (version "20120209.fa1d5b6")
1111 (source (origin
1112 (method git-fetch)
1113 (uri (git-reference
1114 (url "https://github.com/ijp/guile-gdbm.git")
1115 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
821f4dc2 1116 (file-name (string-append name "-" version "-checkout"))
93e7199b
CAW
1117 (sha256
1118 (base32
1119 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
1120 (build-system trivial-build-system)
1121 (arguments
1122 `(#:modules
1123 ((guix build utils))
1124 #:builder
1125 (begin
1126 (use-modules (guix build utils)
a5bd6a5e
CAW
1127 (ice-9 rdelim)
1128 (ice-9 popen))
1129
1130 ;; Avoid warnings we can safely ignore
1131 (setenv "GUILE_AUTO_COMPILE" "0")
93e7199b
CAW
1132
1133 (let* ((out (assoc-ref %outputs "out"))
a5bd6a5e
CAW
1134 (effective-version
1135 (read-line
1136 (open-pipe* OPEN_READ
1137 (string-append
1138 (assoc-ref %build-inputs "guile")
1139 "/bin/guile")
1140 "-c" "(display (effective-version))")))
1141 (module-dir (string-append out "/share/guile/site/"
1142 effective-version))
93e7199b
CAW
1143 (source (assoc-ref %build-inputs "source"))
1144 (doc (string-append out "/share/doc"))
1145 (guild (string-append (assoc-ref %build-inputs "guile")
1146 "/bin/guild"))
1147 (gdbm.scm-dest
1148 (string-append module-dir "/gdbm.scm"))
1149 (gdbm.go-dest
a5bd6a5e
CAW
1150 (string-append module-dir "/gdbm.go"))
1151 (compile-file
1152 (lambda (in-file out-file)
1153 (system* guild "compile" "-o" out-file in-file))))
93e7199b
CAW
1154 ;; Switch directory for compiling and installing
1155 (chdir source)
1156
4168ddf6
TGR
1157 ;; Install the documentation.
1158 (install-file "README.md" doc)
1159 (copy-recursively "examples" (string-append doc "/examples"))
1160
1161 ;; Make installation directories.
1162 (mkdir-p module-dir)
1163
93e7199b
CAW
1164 ;; copy the source
1165 (copy-file "gdbm.scm" gdbm.scm-dest)
1166
1167 ;; Patch the FFI
1168 (substitute* gdbm.scm-dest
1169 (("\\(dynamic-link \"libgdbm\"\\)")
1170 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
1171 (assoc-ref %build-inputs "gdbm"))))
1172
1173 ;; compile to the destination
a5bd6a5e 1174 (compile-file gdbm.scm-dest gdbm.go-dest)))))
93e7199b 1175 (inputs
5bd3a841 1176 `(("guile" ,guile-2.2)))
93e7199b
CAW
1177 (propagated-inputs
1178 `(("gdbm" ,gdbm)))
1179 (home-page "https://github.com/ijp/guile-gdbm")
1180 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
1181 (description
1182 "Guile bindings to the GDBM key-value storage system, using
1183Guile's foreign function interface.")
71e0f217 1184 (license license:gpl3+)))
93e7199b 1185
5bd3a841
LC
1186(define-public guile2.0-gdbm-ffi
1187 (package-for-guile-2.0 guile-gdbm-ffi))
1188
2737bcff 1189(define-public guile2.2-gdbm-ffi
5bd3a841 1190 (deprecated-package "guile2.2-gdbm-ffi" guile-gdbm-ffi))
93e7199b 1191
e8ac1f8f 1192(define-public guile-sqlite3
499e499b
LC
1193 (let ((commit "10c13a7e02ab1655c8a758e560cafc9d6eff26f4")
1194 (revision "4"))
e8ac1f8f
LC
1195 (package
1196 (name "guile-sqlite3")
18adb1f0 1197 (version (git-version "0.0" revision commit))
e8ac1f8f 1198
ae21519f
LC
1199 ;; XXX: This used to be available read-only at
1200 ;; <https://www.gitorious.org/guile-sqlite3/guile-sqlite3.git/> but it
1201 ;; eventually disappeared, so we have our own copy here.
1202 (home-page "https://notabug.org/civodul/guile-sqlite3.git")
e8ac1f8f
LC
1203 (source (origin
1204 (method git-fetch)
1205 (uri (git-reference
1206 (url home-page)
1207 (commit commit)))
1208 (sha256
1209 (base32
499e499b 1210 "0nhhswpd7nb2f0gfr55fzcc2xm3l2xx4rbljsd1clrm8fj2d7q9d"))
e8ac1f8f
LC
1211 (file-name (string-append name "-" version "-checkout"))
1212 (modules '((guix build utils)))
1213 (snippet
1214 ;; Upgrade 'Makefile.am' to the current way of doing things.
1215 '(substitute* "Makefile.am"
1216 (("TESTS_ENVIRONMENT")
1217 "TEST_LOG_COMPILER")))))
1218
1219 (build-system gnu-build-system)
1220 (native-inputs
1221 `(("autoconf" ,autoconf)
1222 ("automake" ,automake)
1223 ("pkg-config" ,pkg-config)))
1224 (inputs
99bde93b 1225 `(("guile" ,guile-2.2)
e8ac1f8f
LC
1226 ("sqlite" ,sqlite)))
1227 (arguments
1228 '(#:phases (modify-phases %standard-phases
d10092b8 1229 (add-after 'unpack 'autoreconf
e8ac1f8f
LC
1230 (lambda _
1231 (zero? (system* "autoreconf" "-vfi"))))
1232 (add-before 'build 'set-sqlite3-file-name
1233 (lambda* (#:key inputs #:allow-other-keys)
1234 (substitute* "sqlite3.scm"
1235 (("\"libsqlite3\"")
1236 (string-append "\"" (assoc-ref inputs "sqlite")
1237 "/lib/libsqlite3\"")))
1238 #t)))))
1239 (synopsis "Access SQLite databases from Guile")
1240 (description
1241 "This package provides Guile bindings to the SQLite database system.")
71e0f217 1242 (license license:gpl3+))))
e8ac1f8f 1243
27f5e13e
DT
1244(define-public haunt
1245 (package
1246 (name "haunt")
9b1a497e 1247 (version "0.2.1")
27f5e13e
DT
1248 (source (origin
1249 (method url-fetch)
4960beaa 1250 (uri (string-append "https://files.dthompson.us/haunt/haunt-"
27f5e13e
DT
1251 version ".tar.gz"))
1252 (sha256
1253 (base32
9b1a497e 1254 "1fpaf1vm6s7j13fs35barjh5yajcc2rc3pi8r7278wpgp4i2vs3w"))))
27f5e13e 1255 (build-system gnu-build-system)
4ecbf6d2
LC
1256 (arguments
1257 `(#:modules ((ice-9 match) (ice-9 ftw)
1258 ,@%gnu-build-system-modules)
1e406301 1259 #:tests? #f ; test suite is non-deterministic :(
4ecbf6d2
LC
1260 #:phases (modify-phases %standard-phases
1261 (add-after 'install 'wrap-haunt
1262 (lambda* (#:key outputs #:allow-other-keys)
1263 ;; Wrap the 'haunt' command to refer to the right
1264 ;; modules.
1265 (let* ((out (assoc-ref outputs "out"))
1266 (bin (string-append out "/bin"))
1267 (site (string-append
1268 out "/share/guile/site")))
1269 (match (scandir site)
1270 (("." ".." version)
1271 (let ((modules (string-append site "/" version)))
1272 (wrap-program (string-append bin "/haunt")
1273 `("GUILE_LOAD_PATH" ":" prefix
1274 (,modules))
1275 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
1276 (,modules)))
1277 #t)))))))))
4960beaa
DT
1278 (native-inputs
1279 `(("pkg-config" ,pkg-config)
1280 ("texinfo" ,texinfo)))
27f5e13e 1281 (inputs
bd19f65a 1282 `(("guile" ,guile-2.2)))
4960beaa 1283 (propagated-inputs
9b1a497e
AP
1284 `(("guile-reader" ,guile-reader)
1285 ("guile-commonmark" ,guile-commonmark)))
27f5e13e
DT
1286 (synopsis "Functional static site generator")
1287 (description "Haunt is a static site generator written in Guile
1288Scheme. Haunt features a functional build system and an extensible
1289interface for reading articles in any format.")
1290 (home-page "http://haunt.dthompson.us")
71e0f217 1291 (license license:gpl3+)))
27f5e13e 1292
bd19f65a
LC
1293(define-public guile2.0-haunt
1294 (package-for-guile-2.0
1295 (package (inherit haunt) (name "guile2.0-haunt"))))
64f34aef 1296(define-public guile2.2-haunt
bd19f65a 1297 (deprecated-package "guile2.2-haunt" haunt))
64f34aef 1298
44a2bdf8
AS
1299(define-public guile-config
1300 (package
1301 (name "guile-config")
3c98acb7 1302 (version "0.1.1")
44a2bdf8
AS
1303 (source (origin
1304 (method url-fetch)
1305 (uri (string-append
1306 "http://alex.pompo.co/software/" name "-" version
1307 ".tar.gz"))
1308 (sha256
1309 (base32
3c98acb7 1310 "1b719bn192f9wg24rr0zx8jpmygsvyhfi35iy778pb5p392snrn8"))))
44a2bdf8
AS
1311 (build-system gnu-build-system)
1312 (inputs
1313 `(("guile" ,guile-2.0)))
1314 (synopsis "Guile application configuration parsing library")
1315 (description
1316 "Guile Config is a library providing a declarative approach to
1317application configuration specification. The library provides clean
1318configuration declaration forms, and processors that take care of:
1319configuration file creation; configuration file parsing; command-line
1320parameter parsing using getopt-long; basic GNU command-line parameter
1321generation (--help, --usage, --version); automatic output generation for the
1322above command-line parameters.")
1323 (home-page "https://github.com/a-sassmannshausen/guile-config")
71e0f217 1324 (license license:agpl3+)))
44a2bdf8 1325
36548111
DT
1326(define-public guile-redis
1327 (package
1328 (name "guile-redis")
1329 (version "0.1.0")
1330 (source (origin
1331 (method url-fetch)
1332 (uri (string-append "mirror://savannah/guile-redis/guile-redis-"
1333 version ".tar.gz"))
1334 (sha256
1335 (base32
1336 "0vx6if6b4r3kwx64vzbs6vpc0cpcr85x11w9vkzq27gw8n7isv56"))
1337 (modules '((guix build utils)))
1338 (snippet
ea833d30 1339 ;; Make sure everything goes under .../site/X.Y, like Guile's
36548111 1340 ;; search paths expects.
ea833d30
RW
1341 '(begin
1342 (substitute* "configure"
1343 (("ac_subst_vars='")
1344 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
1345 (substitute* '("Makefile.in"
1346 "redis/Makefile.in"
1347 "redis/commands/Makefile.in")
1348 (("moddir =.*/share/guile/site" all)
1349 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))))))
36548111
DT
1350 (build-system gnu-build-system)
1351 (native-inputs
1352 `(("guile" ,guile-2.0)))
340978d7 1353 (home-page "https://savannah.nongnu.org/projects/guile-redis/")
36548111
DT
1354 (synopsis "Redis client library for Guile")
1355 (description "Guile-redis provides a Scheme interface to the Redis
1356key-value cache and store.")
71e0f217 1357 (license license:lgpl3+)))
36548111 1358
85313be8
RW
1359(define-public guile2.2-redis
1360 (package-for-guile-2.2 guile-redis))
1361
9d373377
CAW
1362(define-public guile-wisp
1363 (package
1364 (name "guile-wisp")
e0840905 1365 (version "0.9.8")
9d373377
CAW
1366 (source (origin
1367 (method url-fetch)
1368 (uri (string-append "https://bitbucket.org/ArneBab/"
1369 "wisp/downloads/wisp-"
1370 version ".tar.gz"))
1371 (sha256
1372 (base32
e0840905 1373 "1f2bbicq1rxnwmiplrm4r75wj06w385mjkyvi7g4k740bgwcrzxr"))))
9d373377
CAW
1374 (build-system gnu-build-system)
1375 (arguments
e8374e69
LC
1376 `(#:modules ((guix build gnu-build-system)
1377 (guix build utils)
1378 (ice-9 rdelim)
1379 (ice-9 popen))
1380
9d373377
CAW
1381 #:phases
1382 (modify-phases %standard-phases
e0840905 1383 (add-before 'configure 'substitute-before-config
9d373377
CAW
1384
1385 (lambda* (#:key inputs #:allow-other-keys)
1386 (let ((bash (assoc-ref inputs "bash")))
9d373377
CAW
1387 ;; Puts together some test files with /bin/bash hardcoded
1388 (substitute* "Makefile.in"
e0840905
LC
1389 (("/usr/bin/env bash")
1390 (string-append bash "/bin/bash"))
1391 (("\\$\\(GUILE_EFFECTIVE_VERSION\\)/site")
1392 "site/$(GUILE_EFFECTIVE_VERSION)")) ;use the right order
9d373377
CAW
1393 #t)))
1394
1395 ;; auto compilation breaks, but if we set HOME to /tmp,
1396 ;; that works ok
1397 (add-before
1398 'check 'auto-compile-hacky-workaround
1399 (lambda _
1400 (setenv "HOME" "/tmp")
1401 #t))
e0840905 1402 (add-after 'install 'install-go-files
9d373377
CAW
1403 (lambda* (#:key outputs inputs #:allow-other-keys)
1404 (let* ((out (assoc-ref outputs "out"))
e8374e69
LC
1405 (effective (read-line
1406 (open-pipe* OPEN_READ
1407 "guile" "-c"
1408 "(display (effective-version))")))
1409 (module-dir (string-append out "/share/guile/site/"
1410 effective))
1411 (object-dir (string-append out "/lib/guile/" effective
1412 "/site-ccache"))
1413 (prefix (string-length module-dir)))
9d373377 1414 ;; compile to the destination
e0840905 1415 (for-each (lambda (file)
e8374e69
LC
1416 (let* ((base (string-drop (string-drop-right file 4)
1417 prefix))
1418 (go (string-append object-dir base ".go")))
1419 (invoke "guild" "compile" "-L" module-dir
1420 file "-o" go)))
e0840905 1421 (find-files module-dir "\\.scm$"))
9d373377
CAW
1422 #t))))))
1423 (home-page "http://draketo.de/english/wisp")
1424 (inputs
89c4bfe7 1425 `(("guile" ,guile-2.2)))
e0840905
LC
1426 (native-inputs
1427 `(("python" ,python)
1428 ("pkg-config" ,pkg-config)))
a124bbd2
SB
1429 (synopsis "Whitespace to lisp syntax for Guile")
1430 (description "Wisp is a syntax for Guile which provides a Python-like
9d373377
CAW
1431whitespace-significant language. It may be easier on the eyes for some
1432users and in some situations.")
71e0f217 1433 (license license:gpl3+)))
9d373377 1434
5649c8cd
DT
1435(define-public guile-sly
1436 (package
1437 (name "guile-sly")
1438 (version "0.1")
1439 (source (origin
1440 (method url-fetch)
8d5e7ad2 1441 (uri (string-append "https://files.dthompson.us/sly/sly-"
5649c8cd
DT
1442 version ".tar.gz"))
1443 (sha256
1444 (base32
44394ef9
LC
1445 "1svzlbz2vripmyq2kjh0rig16bsrnbkwbsm558pjln9l65mcl4qq"))
1446 (modules '((guix build utils)))
1447 (snippet
1448 '(begin
1449 (substitute* "configure"
1450 (("_guile_required_version=\"2.0.11\"")
1451 "_guile_required_version=\"2\"")
1452 (("ac_subst_vars='")
1453 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
1454 (substitute* (find-files "." "Makefile.in")
1455 (("moddir = .*$")
1456 (string-append
1457 "moddir = "
1458 "$(prefix)/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n"))
1459 (("godir = .*$")
1460 (string-append
1461 "godir = "
1462 "$(prefix)/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n")))))))
5649c8cd
DT
1463 (build-system gnu-build-system)
1464 (arguments
1465 '(#:configure-flags
1466 (list (string-append "--with-libfreeimage-prefix="
1467 (assoc-ref %build-inputs "freeimage"))
1468 (string-append "--with-libgslcblas-prefix="
1469 (assoc-ref %build-inputs "gsl")))))
1470 (native-inputs
1471 `(("pkg-config" ,pkg-config)))
1472 (propagated-inputs
2e7825bc 1473 `(("guile-sdl" ,guile-sdl)
5649c8cd
DT
1474 ("guile-opengl" ,guile-opengl)))
1475 (inputs
2e7825bc
LC
1476 `(("guile" ,guile-2.2)
1477 ("gsl" ,gsl)
5649c8cd
DT
1478 ("freeimage" ,freeimage)
1479 ("mesa" ,mesa)))
1480 (synopsis "2D/3D game engine for GNU Guile")
1481 (description "Sly is a 2D/3D game engine written in Guile Scheme. Sly
1482features a functional reactive programming interface and live coding
1483capabilities.")
1484 (home-page "http://dthompson.us/pages/software/sly.html")
71e0f217 1485 (license license:gpl3+)))
5649c8cd 1486
dec1e2b3
AB
1487(define-public g-wrap
1488 (package
1489 (name "g-wrap")
1490 (version "1.9.15")
1491 (source (origin
1492 (method url-fetch)
1493 (uri (string-append "mirror://savannah/g-wrap/g-wrap-"
1494 version ".tar.gz"))
1495 (sha256
1496 (base32
1497 "0ak0bha37dfpj9kmyw1r8fj8nva639aw5xr66wr5gd3l1rqf5xhg"))))
1498 (build-system gnu-build-system)
1499 (native-inputs
1500 `(("pkg-config" ,pkg-config)))
1501 (propagated-inputs
61583094 1502 `(("guile" ,guile-2.2)
dec1e2b3
AB
1503 ("guile-lib" ,guile-lib)))
1504 (inputs
1505 `(("libffi" ,libffi)))
9e8599a3 1506 (arguments
61583094
TF
1507 `(#:configure-flags '("--disable-Werror")
1508 #:phases
1509 (modify-phases %standard-phases
1510 (add-before 'configure 'pre-configure
1511 (lambda* (#:key outputs #:allow-other-keys)
1512 (let ((out (assoc-ref outputs "out")))
1513 (substitute* (find-files "." "^Makefile.in$")
1514 (("guilemoduledir =.*guile/site" all)
1515 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))
1516 #t))))))
dec1e2b3
AB
1517 (synopsis "Generate C bindings for Guile")
1518 (description "G-Wrap is a tool and Guile library for generating function
1519wrappers for inter-language calls. It currently only supports generating Guile
1520wrappers for C functions. Given a definition of the types and prototypes for
1521a given C interface, G-Wrap will automatically generate the C code that
1522provides access to that interface and its types from the Scheme level.")
340978d7 1523 (home-page "https://www.nongnu.org/g-wrap/index.html")
71e0f217 1524 (license license:lgpl2.1+)))
dec1e2b3 1525
01497dfe
LC
1526(define-public guile-dbi
1527 (package
1528 (name "guile-dbi")
1529 (version "2.1.6")
1530 (source (origin
1531 (method url-fetch)
1532 (uri (string-append
1533 "http://download.gna.org/guile-dbi/guile-dbi-"
1534 version ".tar.gz"))
1535 (sha256
1536 (base32
1537 "116njrprhgrsv1qm904sp3b02rq01fx639r433d657gyhw3x159n"))))
1538 (build-system gnu-build-system)
1539 (arguments
1540 '(#:configure-flags
1541 (list (string-append
1542 "--with-guile-site-dir=" %output "/share/guile/site/2.0"))
1543 #:phases
1544 (modify-phases %standard-phases
1545 (add-after 'install 'patch-extension-path
1546 (lambda* (#:key outputs #:allow-other-keys)
1547 (let* ((out (assoc-ref outputs "out"))
1548 (dbi.scm (string-append
1549 out "/share/guile/site/2.0/dbi/dbi.scm"))
1550 (ext (string-append out "/lib/libguile-dbi")))
1551 (substitute* dbi.scm (("libguile-dbi") ext))
1552 #t))))))
1553 (propagated-inputs
1554 `(("guile" ,guile-2.0)))
1555 (synopsis "Guile database abstraction layer")
1556 (home-page "http://home.gna.org/guile-dbi/guile-dbi.html")
1557 (description
1558 "guile-dbi is a library for Guile that provides a convenient interface to
1559SQL databases. Database programming with guile-dbi is generic in that the same
1560programming interface is presented regardless of which database system is used.
1561It currently supports MySQL, Postgres and SQLite3.")
71e0f217 1562 (license license:gpl2+)))
01497dfe
LC
1563
1564(define-public guile-dbd-sqlite3
1565 (package
1566 (name "guile-dbd-sqlite3")
1567 (version "2.1.6")
1568 (source (origin
1569 (method url-fetch)
1570 (uri (string-append
1571 "http://download.gna.org/guile-dbi/guile-dbd-sqlite3-"
1572 version ".tar.gz"))
1573 (sha256
1574 (base32
1575 "0rg71jchxd2y8x496s8zmfmikr5g8zxi8zv2ar3f7a23pph92iw2"))))
1576 (build-system gnu-build-system)
1577 (native-inputs
1578 `(("pkg-config" ,pkg-config)))
1579 (inputs
1580 `(("sqlite" ,sqlite)
1581 ("zlib" ,(@ (gnu packages compression) zlib))))
1582 (propagated-inputs
1583 `(("guile-dbi" ,guile-dbi)))
1584 (synopsis "Guile DBI driver for SQLite")
1585 (home-page "https://github.com/jkalbhenn/guile-dbd-sqlite3")
1586 (description
1587 "guile-dbi is a library for Guile that provides a convenient interface to
1588SQL databases. This package implements the interface for SQLite.")
71e0f217 1589 (license license:gpl2+)))
01497dfe 1590
e9291eaa
AS
1591(define-public guile-dsv
1592 (package
1593 (name "guile-dsv")
8c80f8ef 1594 (version "0.2.1")
e9291eaa
AS
1595 (source (origin
1596 (method git-fetch)
1597 (uri (git-reference
1598 (url "https://github.com/artyom-poptsov/guile-dsv")
8c80f8ef 1599 (commit "bdc5267d007478abc20ea96d7c459b7dd9560b3d")))
e9291eaa
AS
1600 (file-name (string-append name "-" version "-checkout"))
1601 (sha256
1602 (base32
8c80f8ef 1603 "1irw6mz8998nwyhzrw9g94jcz60b9zljgqfmipaz1ybn8579qjx0"))))
e9291eaa
AS
1604 (build-system gnu-build-system)
1605 (native-inputs
1606 `(("autoconf" ,autoconf)
1607 ("automake" ,automake)
1608 ("pkg-config" ,pkg-config)
1609 ("texinfo" ,texinfo)))
1610 (inputs `(("guile" ,guile-2.2)))
1611 (propagated-inputs `(("guile-lib" ,guile-lib)))
1612 (arguments
1613 '(#:phases (modify-phases %standard-phases
1614 (add-before 'configure 'set-guilesitedir
1615 (lambda _
1616 (substitute* "Makefile.in"
1617 (("^guilesitedir =.*$")
1618 "guilesitedir = \
1619$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
1620 (substitute* "modules/Makefile.in"
1621 (("^guilesitedir =.*$")
1622 "guilesitedir = \
1623$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
1624 (substitute* "modules/dsv/Makefile.in"
1625 (("^guilesitedir =.*$")
1626 "guilesitedir = \
1627$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
1628 #t))
1629 (add-after 'unpack 'autoreconf
1630 (lambda _
1631 (zero? (system* "autoreconf" "-vfi")))))))
1632 (home-page "https://github.com/artyom-poptsov/guile-dsv")
1633 (synopsis "DSV module for Guile")
1634 (description
1635 "Guile-DSV is a GNU Guile module for working with the
1636delimiter-separated values (DSV) data format. Guile-DSV supports the
1637Unix-style DSV format and RFC 4180 format.")
1638 (license license:gpl3+)))
1639
bd9af610
AK
1640(define-public guile-xosd
1641 (package
1642 (name "guile-xosd")
4b2b7135 1643 (version "0.2.1")
bd9af610
AK
1644 (source (origin
1645 (method url-fetch)
1646 (uri (string-append "https://github.com/alezost/" name
1647 "/releases/download/v" version
1648 "/" name "-" version ".tar.gz"))
1649 (sha256
1650 (base32
4b2b7135 1651 "1ri5065c16kmgrf2pysn2ymxjqi5302lhpb07wkl1jr75ym8fn8p"))))
bd9af610
AK
1652 (build-system gnu-build-system)
1653 (native-inputs
1654 `(("pkg-config" ,pkg-config)))
1655 (inputs
c6726a5f 1656 `(("guile" ,guile-2.2)
bd9af610
AK
1657 ("libx11" ,libx11)
1658 ("libxext" ,libxext)
1659 ("libxinerama" ,libxinerama)
1660 ("xosd" ,xosd)))
1661 (home-page "https://github.com/alezost/guile-xosd")
1662 (synopsis "XOSD bindings for Guile")
1663 (description
1664 "Guile-XOSD provides Guile bindings for @code{libxosd},
1665@uref{http://sourceforge.net/projects/libxosd/, the X On Screen Display
1666library}.")
71e0f217 1667 (license license:gpl3+)))
bd9af610 1668
07f7cc03
AK
1669(define-public guile-daemon
1670 (package
1671 (name "guile-daemon")
5245399f 1672 (version "0.1.2")
07f7cc03
AK
1673 (source (origin
1674 (method url-fetch)
1675 (uri (string-append "https://github.com/alezost/" name
1676 "/releases/download/v" version
1677 "/" name "-" version ".tar.gz"))
1678 (sha256
1679 (base32
5245399f 1680 "0hh6gq6b6phpxm0b1dkxyzj3f4sxdf7dji63609lzypa5v1ad2gv"))))
07f7cc03
AK
1681 (build-system gnu-build-system)
1682 (native-inputs
1683 `(("pkg-config" ,pkg-config)))
1684 (inputs
c6726a5f 1685 `(("guile" ,guile-2.2)))
07f7cc03
AK
1686 (home-page "https://github.com/alezost/guile-daemon")
1687 (synopsis "Evaluate code in a running Guile process")
1688 (description
1689 "Guile-Daemon is a small Guile program that loads your initial
1690configuration file, and then reads and evaluates Guile expressions that
1691you send to a FIFO file.")
71e0f217 1692 (license license:gpl3+)))
07f7cc03 1693
e28e74a5
EE
1694(define-public guile-commonmark
1695 (package
1696 (name "guile-commonmark")
1697 (version "0.1")
1698 (source (origin
1699 (method url-fetch)
1700 (uri (string-append "https://github.com/OrangeShark/" name
1701 "/releases/download/v" version
1702 "/" name "-" version ".tar.gz"))
1703 (sha256
1704 (base32
757ce0f9
LC
1705 "12cb5fqvvgc87f5xp0ih5az305wnjia89l5jba83d0r2p8bfy0b0"))
1706 (modules '((guix build utils)))
1707 (snippet
1708 ;; Use the real effective version of Guile in directory names
1709 ;; instead of a hard-coded "/2.0".
1710 '(begin
1711 (substitute* "configure"
1712 (("ac_subst_vars='")
1713 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
1714 (substitute* "Makefile.in"
1715 (("/site/2.0")
1716 "/site/@GUILE_EFFECTIVE_VERSION@"))))))
e28e74a5
EE
1717 (build-system gnu-build-system)
1718 (inputs
7c86c031 1719 `(("guile" ,guile-2.2)))
e28e74a5
EE
1720 (synopsis "CommonMark parser for Guile")
1721 (description
1722 "guile-commonmark is a library for parsing CommonMark, a fully specified
1723variant of Markdown. The library is written in Guile Scheme and is designed
1724to transform a CommonMark document to SXML. guile-commonmark tries to closely
1725follow the @uref{http://commonmark.org/, CommonMark spec}, the main difference
1726is no support for parsing block and inline level HTML.")
1727 (home-page "https://github.com/OrangeShark/guile-commonmark")
71e0f217 1728 (license license:lgpl3+)))
e28e74a5 1729
7c86c031
LC
1730(define-public guile2.0-commonmark
1731 (package-for-guile-2.0 guile-commonmark))
947a5d47 1732(define-public guile2.2-commonmark
7c86c031 1733 (deprecated-package "guile2.2-commonmark" guile-commonmark))
947a5d47 1734
3b5783fc
AB
1735(define-public guile-bytestructures
1736 (package
1737 (name "guile-bytestructures")
4f85f7f7 1738 (version "1.0.1")
3b5783fc 1739 (source (origin
4f85f7f7 1740 (method url-fetch)
1741 (uri (string-append "https://github.com/TaylanUB/scheme-bytestructures"
1742 "/releases/download/v" version
1743 "/bytestructures-" version ".tar.gz"))
3b5783fc
AB
1744 (sha256
1745 (base32
4f85f7f7 1746 "1lnfcy65mqj823lamy2n2vaghdz0g7mj011bgnhmd6hwpnaidnh2"))))
1747 (build-system gnu-build-system)
726ecfeb 1748 (native-inputs
4f85f7f7 1749 `(("pkg-config" ,pkg-config)))
3b5783fc 1750 (inputs
aabece2e 1751 `(("guile" ,guile-2.2)))
3b5783fc
AB
1752 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
1753 (synopsis "Structured access to bytevector contents for Guile")
1754 (description
1755 "Guile bytestructures offers a system imitating the type system
1756of the C programming language, to be used on bytevectors. C's type
1757system works on raw memory, and Guile works on bytevectors which are
1758an abstraction over raw memory. It's also more powerful than the C
1759type system, elevating types to first-class status.")
71e0f217 1760 (license license:gpl3+)))
3b5783fc 1761
726ecfeb
LC
1762(define-public guile2.0-bytestructures
1763 (package-for-guile-2.0 guile-bytestructures))
1764
472fc855
LC
1765(define-public guile-aspell
1766 (package
1767 (name "guile-aspell")
234ea3d6 1768 (version "0.4")
472fc855
LC
1769 (source (origin
1770 (method url-fetch)
1771 (uri (string-append
1772 "http://lonelycactus.com/tarball/guile_aspell-"
1773 version ".tar.gz"))
1774 (sha256
1775 (base32
234ea3d6 1776 "0vpk5xj9m9qc702z3khmkwhgpb949qbsyz8kw2qycda6qnxk0077"))))
472fc855
LC
1777 (build-system gnu-build-system)
1778 (arguments
7295087e
LC
1779 '(#:phases (modify-phases %standard-phases
1780 (add-before 'configure 'set-guilesitedir
1781 (lambda _
1782 (substitute* "Makefile.in"
1783 (("^guilesitedir =.*$")
1784 "guilesitedir = \
1785$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
1786 #t))
472fc855
LC
1787 (add-before 'build 'set-libaspell-file-name
1788 (lambda* (#:key inputs #:allow-other-keys)
1789 (let ((aspell (assoc-ref inputs "aspell")))
234ea3d6 1790 (substitute* "aspell.scm"
472fc855
LC
1791 (("\"libaspell\\.so\"")
1792 (string-append "\"" aspell
1793 "/lib/libaspell\"")))
1794 #t))))))
1795 (native-inputs `(("pkg-config" ,pkg-config)))
cb5be6df 1796 (inputs `(("guile" ,guile-2.2)
472fc855
LC
1797 ("aspell" ,aspell)))
1798 (home-page "https://github.com/spk121/guile-aspell")
1799 (synopsis "Spell-checking from Guile")
1800 (description
1801 "guile-aspell is a Guile Scheme library for comparing a string against a
1802dictionary and suggesting spelling corrections.")
71e0f217 1803 (license license:gpl3+)))
472fc855 1804
a614ce38
LC
1805(define-public guile-bash
1806 ;; This project is currently retired. It was initially announced here:
1807 ;; <https://lists.gnu.org/archive/html/guile-user/2015-02/msg00003.html>.
1808 (let ((commit "1eabc563ca5692b3e08d84f1f0e6fd2283284469")
1809 (revision "0"))
1810 (package
1811 (name "guile-bash")
1812 (version (string-append "0.1.6-" revision "." (string-take commit 7)))
1813 (home-page
1814 "https://anonscm.debian.org/cgit/users/kaction-guest/retired/dev.guile-bash.git")
1815 (source (origin
1816 (method git-fetch)
1817 (uri (git-reference
1818 (commit commit)
1819 (url home-page)))
1820 (sha256
1821 (base32
1822 "097vny990wp2qpjij6a5a5gwc6fxzg5wk56inhy18iki5v6pif1p"))
1823 (file-name (string-append name "-" version "-checkout"))))
1824 (build-system gnu-build-system)
1825 (arguments
1826 '(#:phases (modify-phases %standard-phases
1827 (add-after 'unpack 'bootstrap
1828 (lambda _
1829 (zero? (system* "sh" "bootstrap")))))
1830
1831 #:configure-flags
1832 ;; Add -I to match 'bash.pc' of Bash 4.4.
1833 (list (string-append "CPPFLAGS=-I"
1834 (assoc-ref %build-inputs "bash:include")
1835 "/include/bash/include")
1836
1837 ;; The '.a' file is useless.
1838 "--disable-static"
1839
1840 ;; Install 'lib/bash' as Bash 4.4 expects.
1841 (string-append "--libdir=" (assoc-ref %outputs "out")
1842 "/lib/bash"))))
1843 (native-inputs `(("pkg-config" ,pkg-config)
1844 ("autoconf" ,(autoconf-wrapper))
1845 ("automake" ,automake)
1846 ("libtool" ,libtool)
1847 ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS'.
b7158b76
LC
1848 ("gettext" ,gettext-minimal)
1849
1850 ;; Bash with loadable module support, for the test
1851 ;; suite.
1852 ("bash-full" ,bash)))
a614ce38
LC
1853 (inputs `(("guile" ,guile-2.0)
1854 ("bash:include" ,bash "include")))
1855 (synopsis "Extend Bash using Guile")
1856 (description
1857 "Guile-Bash provides a shared library and set of Guile modules,
1858allowing you to extend Bash in Scheme. Scheme interfaces allow you to access
1859the following aspects of Bash:
1860
1861@itemize
1862@item aliases;
1863@item setting and getting Bash variables;
1864@item creating dynamic variables;
1865@item creating Bash functions with a Scheme implementation;
1866@item reader macro for output capturing;
1867@item reader macro for evaluating raw Bash commands.
1868@end itemize
1869
1870To enable it, run:
1871
1872@example
1873enable -f ~/.guix-profile/lib/bash/libguile-bash.so scm
1874@end example
1875
1876and then run @command{scm example.scm}.")
71e0f217 1877 (license license:gpl3+))))
a614ce38 1878
c5793e7e
CAW
1879(define-public guile-8sync
1880 (package
1881 (name "guile-8sync")
525acb6e 1882 (version "0.4.2")
c5793e7e
CAW
1883 (source (origin
1884 (method url-fetch)
1885 (uri (string-append "mirror://gnu/8sync/8sync-" version
1886 ".tar.gz"))
1887 (sha256
1888 (base32
525acb6e 1889 "031wm13srak3wsnll7j2mbbi29g1pcm4swdb71ds9yn567pn20qw"))))
c5793e7e
CAW
1890 (build-system gnu-build-system)
1891 (native-inputs `(("autoconf" ,autoconf)
1892 ("automake" ,automake)
f6396d86 1893 ("guile" ,guile-2.2)
c5793e7e
CAW
1894 ("pkg-config" ,pkg-config)
1895 ("texinfo" ,texinfo)))
1896 (arguments
1897 `(#:phases (modify-phases %standard-phases
1898 (add-before 'configure 'setenv
1899 (lambda _
1900 ;; quiet warnings
ab4a1731
CAW
1901 (setenv "GUILE_AUTO_COMPILE" "0")
1902 #t)))))
c5793e7e
CAW
1903 (home-page "https://gnu.org/s/8sync/")
1904 (synopsis "Asynchronous actor model library for Guile")
1905 (description
1906 "GNU 8sync (pronounced \"eight-sync\") is an asynchronous programming
1907library for GNU Guile based on the actor model.
1908
f6396d86 1909Note that 8sync is only available for Guile 2.2.")
71e0f217 1910 (license license:lgpl3+)))
c5793e7e 1911
aaf1bdc3
CAW
1912(define-public guile-fibers
1913 (package
1914 (name "guile-fibers")
1915 (version "1.0.0")
1916 (source (origin
1917 (method url-fetch)
1918 (uri (string-append "https://wingolog.org/pub/fibers/fibers-"
1919 version ".tar.gz"))
1920 (sha256
1921 (base32
1922 "0vjkg72ghgdgphzbjz9ig8al8271rq8974viknb2r1rg4lz92ld0"))))
1923 (build-system gnu-build-system)
1924 (native-inputs
1925 `(("texinfo" ,texinfo)
1926 ("pkg-config" ,pkg-config)))
1927 (inputs
f6396d86 1928 `(("guile" ,guile-2.2)))
aaf1bdc3
CAW
1929 (synopsis "Lightweight concurrency facility for Guile")
1930 (description
1931 "Fibers is a Guile library that implements a a lightweight concurrency
1932facility, inspired by systems like Concurrent ML, Go, and Erlang. A fiber is
1933like a \"goroutine\" from the Go language: a lightweight thread-like
1934abstraction. Systems built with Fibers can scale up to millions of concurrent
1935fibers, tens of thousands of concurrent socket connections, and many parallel
1936cores. The Fibers library also provides Concurrent ML-like channels for
1937communication between fibers.
1938
1939Note that Fibers makes use of some Guile 2.1/2.2-specific features and
1940is not available for Guile 2.0.")
1941 (home-page "https://github.com/wingo/fibers")
1942 (license license:lgpl3+)))
1943
bd233722 1944(define-public guile-git
a0e4b41b
LC
1945 (let ((revision "4")
1946 (commit "951a32c56cc4d80f8836e3c7394783e69c1fcbad"))
bd233722
LC
1947 (package
1948 (name "guile-git")
1949 (version (string-append "0.0-" revision "." (string-take commit 7)))
dc03f32d 1950 (home-page "https://gitlab.com/guile-git/guile-git.git")
bd233722
LC
1951 (source (origin
1952 (method git-fetch)
1953 (uri (git-reference (url home-page) (commit commit)))
1954 (sha256
1955 (base32
a0e4b41b 1956 "0qri9x73ij6g40ijs4hyhj8knxw39ydgghiafq74dp99bc8hh0qc"))
bd233722
LC
1957 (file-name (git-file-name name version))))
1958 (build-system gnu-build-system)
1959 (arguments
44b0faee 1960 `(#:phases (modify-phases %standard-phases
bd233722
LC
1961 (add-after 'unpack 'bootstrap
1962 (lambda _
44b0faee
LC
1963 (zero? (system* "autoreconf" "-vfi"))))
1964
1965 ;; FIXME: On i686, bytestructures miscalculates the offset
1966 ;; of the 'old-file' and 'new-file' fields within the
1967 ;; '%diff-delta' structure.
1968 ,@(if (string=? (%current-system) "x86_64-linux")
1969 '()
1970 '((add-before 'check 'skip-tests
1971 (lambda _
1972 (substitute* "Makefile"
1973 (("tests/status\\.scm")
1974 ""))
1975 #t)))))))
bd233722
LC
1976 (native-inputs
1977 `(("autoconf" ,autoconf)
1978 ("automake" ,automake)
3a537598 1979 ("texinfo" ,texinfo)
bd233722
LC
1980 ("pkg-config" ,pkg-config)))
1981 (inputs
aabece2e 1982 `(("guile" ,guile-2.2)
bd233722
LC
1983 ("libgit2" ,libgit2)))
1984 (propagated-inputs
1985 `(("guile-bytestructures" ,guile-bytestructures)))
1986 (synopsis "Guile bindings for libgit2")
1987 (description
1988 "This package provides Guile bindings to libgit2, a library to
1989manipulate repositories of the Git version control system.")
1990 (license license:gpl3+))))
c5793e7e 1991
70bc6085
LC
1992(define-public guile2.0-git
1993 (package-for-guile-2.0 guile-git))
1994
f252d6df
DT
1995(define-public guile-syntax-highlight
1996 (let ((commit "a047675e66861b647426372aa2ba7820f749616d")
1997 (revision "0"))
1998 (package
1999 (name "guile-syntax-highlight")
2000 (version (string-append "0.0." revision "."
2001 (string-take commit 7)))
2002 (source (origin
2003 (method git-fetch)
2004 (uri (git-reference
2005 (url "git://dthompson.us/guile-syntax-highlight.git")
2006 (commit commit)))
51988e3a 2007 (file-name (string-append name "-" version "-checkout"))
f252d6df
DT
2008 (sha256
2009 (base32
2010 "1zjr6sg3n7xbdsliy45i39dqanxvcms58ayx36wxrz72zpq58vq3"))))
2011 (build-system gnu-build-system)
2012 (arguments
2013 '(#:phases (modify-phases %standard-phases
2014 (add-after 'unpack 'bootstrap
2015 (lambda _
2016 (zero? (system* "sh" "bootstrap")))))))
2017 (native-inputs
2018 `(("autoconf" ,autoconf)
2019 ("automake" ,automake)
2020 ("pkg-config" ,pkg-config)))
2021 (inputs
2022 `(("guile" ,guile-2.2)))
2023 (synopsis "General-purpose syntax highlighter for GNU Guile")
2024 (description "Guile-syntax-highlight is a general-purpose syntax
2025highlighting library for GNU Guile. It can parse code written in various
2026programming languages into a simple s-expression that can be converted to
2027HTML (via SXML) or any other format for rendering.")
2028 (home-page "http://dthompson.us/software/guile-syntax-highlight")
2029 (license license:lgpl3+))))
2030
d26ae96c
CAW
2031(define-public guile-sjson
2032 (package
2033 (name "guile-sjson")
a62a16a4 2034 (version "0.2.1")
d26ae96c
CAW
2035 (source (origin
2036 (method url-fetch)
2037 (uri (string-append "https://dustycloud.org/misc/sjson-" version
2038 ".tar.gz"))
2039 (sha256
2040 (base32
a62a16a4 2041 "1mzmapln79vv10qxaggz9qwcdbag3jnrj19xx8bgkmxss8h03sv3"))))
d26ae96c
CAW
2042 (build-system gnu-build-system)
2043 (arguments
2044 '(#:phases
2045 (modify-phases %standard-phases
2046 (add-after 'unpack 'bootstrap
2047 (lambda _ (zero? (system* "sh" "bootstrap.sh")))))))
2048 (native-inputs
2049 `(("autoconf" ,autoconf)
2050 ("automake" ,automake)
2051 ("pkg-config" ,pkg-config)))
2052 (inputs
2053 `(("guile" ,guile-2.2)))
2054 (home-page "https://gitlab.com/dustyweb/guile-sjson")
2055 (synopsis "S-expression based json reader/writer for Guile")
2056 (description "guile-sjson is a json reader/writer for Guile.
2057It has a nice, simple s-expression based syntax.")
2058 (license license:lgpl3+)))
2059
e076d56a 2060(define-public guile-colorized
2061 (package
2062 (name "guile-colorized")
2063 (version "0.1")
2064 (source (origin
2065 (method url-fetch)
2066 (uri (string-append "https://github.com/NalaGinrut/guile-colorized/"
2067 "archive/v" version ".tar.gz"))
2068 (file-name (string-append name "-" version ".tar.gz"))
2069 (sha256
2070 (base32
2071 "16xhc3an6aglnca8xl3mvgi8hsqzqn68vsl5ga4bz8bvbap5fn4p"))))
2072 (build-system gnu-build-system)
2073 (arguments
2074 `(#:modules ((system base compile)
2075 ,@%gnu-build-system-modules)
2076 #:tests? #f ;No tests included
2077 #:phases
2078 (modify-phases %standard-phases
2079 (delete 'configure) ;No configure script
2080 (replace 'install
2081 (lambda* (#:key outputs inputs #:allow-other-keys)
2082 (let* ((out (assoc-ref outputs "out"))
2083 (module-dir (string-append out "/share/guile/site/2.2"))
2084 (language-dir (string-append module-dir "/ice-9"))
2085 (guild (string-append (assoc-ref inputs "guile")
2086 "/bin/guild")))
2087 ;; The original 'make install' is too primitive.
2088
2089 ;; copy the source
2090 (install-file "ice-9/colorized.scm" language-dir)
2091
2092 ;; compile to the destination
2093 (compile-file "ice-9/colorized.scm"
2094 #:output-file (string-append
2095 language-dir "/colorized.go"))
2096 #t))))))
2097 (inputs
2098 `(("guile" ,guile-2.2)))
2099 (home-page "https://github.com/NalaGinrut/guile-colorized")
2100 (synopsis "Colorized REPL for Guile")
2101 (description
2102 "Guile-colorized provides you with a colorized REPL for GNU Guile.")
2103 (license license:gpl3+)))
2104
1722d680 2105;;; guile.scm ends here