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