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