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