Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
189be331 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
6cbee49d 3;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
c5793e7e 4;;; Copyright © 2015, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
44a2bdf8 5;;; Copyright © 2016 Alex Sassmannshausen <alex@pompo.co>
71311e4e 6;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
76e6e663 7;;; Copyright © 2016 Erik Edrosa <erik.edrosa@gmail.com>
4176eb19 8;;; Copyright © 2016 Eraim Flashner <efraim@flashner.co.il>
5245399f 9;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12235a12 10;;; Copyright © 2016, 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
3b5783fc 11;;; Copyright © 2016 Amirouche <amirouche@hypermove.net>
c5793e7e 12;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
aaf1bdc3 13;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
f252d6df 14;;; Copyright © 2017 David Thompson <davet@gnu.org>
b3542d77 15;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
d109b1e8 16;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
4a78fd46 17;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
20897536 18;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
d4660a54 19;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
34e00c7b 20;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
f858e58f 21;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
1722d680 22;;;
233e7676 23;;; This file is part of GNU Guix.
1722d680 24;;;
233e7676 25;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
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;;;
233e7676 30;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
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
233e7676 36;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 37
1ffa7090 38(define-module (gnu packages guile)
71e0f217 39 #:use-module ((guix licenses) #:prefix license:)
59a43334 40 #:use-module (gnu packages)
472fc855 41 #:use-module (gnu packages aspell)
9c782445 42 #:use-module (gnu packages bash)
1ffa7090 43 #:use-module (gnu packages bdw-gc)
148585c2 44 #:use-module (gnu packages compression)
1ffa7090
LC
45 #:use-module (gnu packages gawk)
46 #:use-module (gnu packages gperf)
47 #:use-module (gnu packages libffi)
48 #:use-module (gnu packages autotools)
f906d30c 49 #:use-module (gnu packages flex)
1ffa7090 50 #:use-module (gnu packages libunistring)
7119cca8 51 #:use-module (gnu packages linux)
1ffa7090
LC
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)
ef02e1e9 56 #:use-module (gnu packages ncurses)
87d836b2 57 #:use-module (gnu packages ed)
ce0614dd 58 #:use-module (gnu packages base)
f906d30c 59 #:use-module (gnu packages texinfo)
01497dfe 60 #:use-module (gnu packages man)
f906d30c 61 #:use-module (gnu packages gettext)
b416aadf 62 #:use-module (gnu packages databases)
9d373377 63 #:use-module (gnu packages python)
fa6a3bb7 64 #:use-module (gnu packages tls)
5649c8cd
DT
65 #:use-module (gnu packages gl)
66 #:use-module (gnu packages sdl)
67 #:use-module (gnu packages maths)
68 #:use-module (gnu packages image)
bd233722 69 #:use-module (gnu packages version-control)
bd9af610
AK
70 #:use-module (gnu packages xdisorg)
71 #:use-module (gnu packages xorg)
f858e58f 72 #:use-module (gnu packages networking)
1722d680 73 #:use-module (guix packages)
87f5d366 74 #:use-module (guix download)
6bc24063 75 #:use-module (guix git-download)
32795fcf 76 #:use-module (guix build-system gnu)
6bc24063 77 #:use-module (guix build-system trivial)
32795fcf 78 #:use-module (guix utils)
d4660a54
MC
79 #:use-module (ice-9 match)
80 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
1722d680
LC
81
82;;; Commentary:
83;;;
c44899a2 84;;; GNU Guile, and modules and extensions.
1722d680
LC
85;;;
86;;; Code:
87
c44899a2
LC
88(define-public guile-1.8
89 (package
90 (name "guile")
91 (version "1.8.8")
92 (source (origin
87f5d366 93 (method url-fetch)
0db342a5 94 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
95 ".tar.gz"))
96 (sha256
97 (base32
01eafd38 98 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
fc1adab1 99 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
c44899a2
LC
100 (build-system gnu-build-system)
101 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
102
103 ;; Insert a phase before `configure' to patch things up.
dc1d3cde
KK
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"))))
2f4fbe1c 117
dc1d3cde
KK
118 ;; The usual /bin/sh...
119 (substitute* "ice-9/popen.scm"
120 (("/bin/sh") (which "sh")))
121 #t)))))
01eafd38 122 (inputs `(("gawk" ,gawk)
c44899a2
LC
123 ("readline" ,readline)))
124
125 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
126 ;; propagated.
127 (propagated-inputs `(("gmp" ,gmp)
be11b102 128 ("libltdl" ,libltdl)))
c44899a2
LC
129
130 ;; When cross-compiling, a native version of Guile itself is needed.
131 (self-native-input? #t)
132
9be8d7c8
LC
133 (native-search-paths
134 (list (search-path-specification
135 (variable "GUILE_LOAD_PATH")
af070955 136 (files '("share/guile/site")))))
9be8d7c8 137
f50d2669 138 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 139 (description
a22dc0c4
LC
140 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
141official extension language of the GNU system. It is an implementation of
142the Scheme language which can be easily embedded in other applications to
143provide a convenient means of extending the functionality of the application
144without requiring the source code to be rewritten.")
6fd52309 145 (home-page "https://www.gnu.org/software/guile/")
71e0f217 146 (license license:lgpl2.0+)))
c44899a2
LC
147
148(define-public guile-2.0
149 (package
150 (name "guile")
b5efd14a 151 (version "2.0.14")
c44899a2 152 (source (origin
87f5d366 153 (method url-fetch)
0db342a5 154 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
155 ".tar.xz"))
156 (sha256
157 (base32
b5efd14a 158 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
c44899a2
LC
159 (build-system gnu-build-system)
160 (native-inputs `(("pkgconfig" ,pkg-config)))
161 (inputs `(("libffi" ,libffi)
88da729f 162 ,@(libiconv-if-needed)
baf549df
LC
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)))))
c44899a2
LC
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)
be11b102
LC
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)
c44899a2
LC
178
179 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
180 ;; must be propagated.
bda1bc6c 181 ("bdw-gc" ,libgc)
c44899a2
LC
182 ("gmp" ,gmp)))
183
184 (self-native-input? #t)
185
9bf62d9b
LC
186 (outputs '("out" "debug"))
187
8ffaa93b 188 (arguments
20897536
TGR
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))))))
8ffaa93b 207
9be8d7c8
LC
208 (native-search-paths
209 (list (search-path-specification
210 (variable "GUILE_LOAD_PATH")
af070955 211 (files '("share/guile/site/2.0")))
9be8d7c8
LC
212 (search-path-specification
213 (variable "GUILE_LOAD_COMPILED_PATH")
ca408580 214 (files '("lib/guile/2.0/site-ccache"
05f1e956 215 "share/guile/site/2.0")))))
9be8d7c8 216
f50d2669 217 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 218 (description
a22dc0c4
LC
219 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
220official extension language of the GNU system. It is an implementation of
221the Scheme language which can be easily embedded in other applications to
222provide a convenient means of extending the functionality of the application
223without requiring the source code to be rewritten.")
6fd52309 224 (home-page "https://www.gnu.org/software/guile/")
71e0f217 225 (license license:lgpl3+)))
c44899a2 226
f6396d86 227(define-public guile-2.2
f906d30c 228 (package (inherit guile-2.0)
f6396d86 229 (name "guile")
2664e0f6 230 (version "2.2.3")
4eae7980
LC
231 (source (origin
232 (method url-fetch)
34d624ce
LC
233
234 ;; Note: we are limited to one of the compression formats
235 ;; supported by the bootstrap binaries, so no lzip here.
80a72572 236 (uri (string-append "mirror://gnu/guile/guile-" version
34d624ce 237 ".tar.xz"))
4eae7980
LC
238 (sha256
239 (base32
2664e0f6 240 "11j01agvnci2cx32wwpqs9078856yxmvs15gcsz7ganpkj2ahlw3"))
d9f0788a
LC
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).
6cbee49d
MW
246 (snippet '(begin
247 (for-each delete-file
248 (find-files "prebuilt" "\\.go$"))
249 #t))))
4fbd0f4f 250 (properties '((timeout . 72000) ;20 hours
16b0f205 251 (max-silent-time . 36000))) ;10 hours (needed on ARM
1577a658 252 ; when heavily loaded)
dd90ed89
DT
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")
31769b9f 259 (files '("lib/guile/2.2/site-ccache"
33c3a214
LC
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)))))
4eae7980 278
34d624ce
LC
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)
a9308efe 284 (properties '((hidden? . #t) ;people should install 'guile-2.2'
5a5b3632
MW
285 (timeout . 72000) ;20 hours
286 (max-silent-time . 36000))))) ;10 hours (needed on ARM
287 ; when heavily loaded)
34d624ce 288
3aab8851
LC
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
5cd074ea
LC
304(define-public guile-next
305 (deprecated-package "guile-next" guile-2.2))
306
2ba2c98d
LC
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
359GNU@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
8f4acad7
LC
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)))
947a5d47
LC
374
375(define package-for-guile-2.2
376 ;; A procedure that rewrites the dependency tree of the given package to use
f6396d86
LC
377 ;; GUILE-2.2 instead of GUILE-2.0.
378 (package-input-rewriting `((,guile-2.0 . ,guile-2.2))
8f4acad7
LC
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")))
947a5d47 385
4eae7980 386(define-public guile-for-guile-emacs
f6396d86 387 (package (inherit guile-2.2)
4eae7980
LC
388 (name "guile-for-guile-emacs")
389 (version "20150510.d8d9a8d")
f906d30c
CAW
390 (source (origin
391 (method git-fetch)
392 (uri (git-reference
4eae7980
LC
393 (url "git://git.hcoop.net/git/bpt/guile.git")
394 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
51988e3a 395 (file-name (string-append name "-" version "-checkout"))
f906d30c
CAW
396 (sha256
397 (base32
4eae7980 398 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
f906d30c
CAW
399 (arguments
400 (substitute-keyword-arguments `(;; Tests aren't passing for now.
401 ;; Obviously we should re-enable this!
402 #:tests? #f
f6396d86 403 ,@(package-arguments guile-2.2))
f906d30c
CAW
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)
b94a6ca0 420 ("gettext" ,gettext-minimal)
f6396d86 421 ,@(package-native-inputs guile-2.2)))
daeb61f7
RW
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")
31769b9f 429 (files '("lib/guile/2.0/site-ccache"
daeb61f7 430 "share/guile/site/2.0")))))))
be3feafe 431
71311e4e
RW
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/
460TEST_EXTENSIONS = .scm
461SCM_LOG_COMPILER= $(top_builddir)/env $(GUILE)
462AM_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))
d10092b8 467 (add-after 'fix-bug-22 'autogen
71311e4e
RW
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
480an association of independent craftspeople. A guildhall is where they meet.
481This Guildhall aims to make a virtual space for Guile wizards and journeyfolk
482to share code.
483
484On a practical level, Guildhall lets you share Scheme modules and programs
485over the internet, and install code that has been shared by others. Guildhall
486can handle dependencies, so when a program requires several libraries, and
487each of those has further dependencies, all of the prerequisites for the
488program can be installed in one go.")
489 (home-page "https://github.com/ijp/guildhall")
490 (license license:gpl3+))))
491
c44899a2
LC
492\f
493;;;
494;;; Extensions.
495;;;
496
7119cca8 497(define-public artanis
12235a12
AFN
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:]]+")
6cbee49d
MW
532 ""))
533 #t))))
12235a12
AFN
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
7119cca8
ML
574Scheme. A web application framework (WAF) is a software framework that is
575designed to support the development of dynamic websites, web applications, web
576services and web resources. The framework aims to alleviate the overhead
577associated with common activities performed in web development. Artanis
578provides several tools for web development: database access, templating
579frameworks, session management, URL-remapping for RESTful, page caching, and
580more.")
12235a12
AFN
581 (home-page "https://www.gnu.org/software/artanis/")
582 (license (list license:gpl3+ license:lgpl3+))))) ;dual license
7119cca8 583
d6d9f1f7 584(define-public guile-reader
1722d680 585 (package
d6d9f1f7 586 (name "guile-reader")
77aa0887 587 (version "0.6.2")
d6d9f1f7
LC
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
77aa0887 594 "0592s2s8ampqmqwilc4fvcild6rb9gy79di6vxv5kcdmv23abkgx"))))
d6d9f1f7
LC
595 (build-system gnu-build-system)
596 (native-inputs `(("pkgconfig" ,pkg-config)
2fa077f3 597 ("gperf" ,gperf-3.0)))
bdf1022d 598 (inputs `(("guile" ,guile-2.2)))
d6d9f1f7
LC
599 (synopsis "Framework for building readers for GNU Guile")
600 (description
601 "Guile-Reader is a simple framework for building readers for GNU Guile.
1722d680
LC
602
603The idea is to make it easy to build procedures that extend Guile’s read
35b9e423 604procedure. Readers supporting various syntax variants can easily be written,
1722d680 605possibly by re-using existing “token readers” of a standard Scheme
35b9e423 606readers. For example, it is used to implement Skribilo’s R5RS-derived
1722d680
LC
607document syntax.
608
609Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
610hopefully more powerful and flexible (for instance, one may instantiate as
611many readers as needed).")
340978d7 612 (home-page "https://www.nongnu.org/guile-reader/")
71e0f217 613 (license license:gpl3+)))
1722d680 614
bdf1022d
LC
615(define-public guile2.0-reader
616 (package-for-guile-2.0 guile-reader))
517fce63 617(define-public guile2.2-reader
bdf1022d 618 (deprecated-package "guile2.2-reader" guile-reader))
517fce63 619
ef02e1e9
LC
620(define-public guile-ncurses
621 (package
622 (name "guile-ncurses")
958d357a 623 (version "2.2")
ef02e1e9
LC
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
958d357a 630 "1wvggbr4xv8idh1hzd8caj4xfp4pln78a7w1wqzd4zgzwmnzxr2f"))))
ef02e1e9
LC
631 (build-system gnu-build-system)
632 (inputs `(("ncurses" ,ncurses)
81eaa3f8 633 ("guile" ,guile-2.2)))
0881b616 634 (native-inputs `(("pkg-config" ,pkg-config)))
ef02e1e9 635 (arguments
2c6b7c7d 636 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
0881b616 637 "--with-gnu-filesystem-hierarchy")
fa37f21b
EF
638 #:phases
639 (modify-phases %standard-phases
8c4e99cc 640 (add-before 'build 'fix-libguile-ncurses-file-name
fa37f21b 641 (lambda* (#:key outputs #:allow-other-keys)
8c4e99cc
JD
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\"")
81eaa3f8 651 (format #f "\"~a/lib/guile/2.2/libguile-ncurses\""
8c4e99cc
JD
652 out)))
653 #t)))))))
d81850d4 654 (home-page "https://www.gnu.org/software/guile-ncurses/")
f50d2669 655 (synopsis "Guile bindings to ncurses")
ef02e1e9 656 (description
12bcf94a 657 "guile-ncurses provides Guile language bindings for the ncurses
79c311b8 658library.")
71e0f217 659 (license license:lgpl3+)))
ef02e1e9 660
4d02e9ff
DM
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
87d836b2
LC
668(define-public mcron
669 (package
670 (name "mcron")
67a51b67 671 (version "1.1.1")
87d836b2 672 (source (origin
cfbf6de1
LC
673 (method url-fetch)
674 (uri (string-append "mirror://gnu/mcron/mcron-"
675 version ".tar.gz"))
676 (sha256
677 (base32
67a51b67 678 "1i9mcp6r6my61zfiydsm3n6my41mwvl7dfala4q29qx0zn1ynlm4"))))
87d836b2 679 (build-system gnu-build-system)
cfbf6de1
LC
680 (arguments
681 '(#:phases (modify-phases %standard-phases
682 (add-before 'check 'set-timezone
683 (lambda* (#:key inputs #:allow-other-keys)
67a51b67
LC
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>.
cfbf6de1
LC
689 (let ((tzdata (assoc-ref inputs "tzdata")))
690 (setenv "TZDIR"
691 (string-append tzdata
692 "/share/zoneinfo"))
67a51b67 693 (setenv "TZ" "UTC-2")
cfbf6de1 694 #t)))
67a51b67 695 (add-before 'check 'adjust-tests
cfbf6de1 696 (lambda _
67a51b67
LC
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)))))
cfbf6de1
LC
711 (native-inputs `(("pkg-config" ,pkg-config)
712 ("tzdata" ,tzdata-for-tests)))
713 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.2)))
6fd52309 714 (home-page "https://www.gnu.org/software/mcron/")
f50d2669 715 (synopsis "Run jobs at scheduled times")
87d836b2 716 (description
79c311b8 717 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
a22dc0c4 718tasks on a schedule, such as every hour or every Monday. Mcron is written in
79c311b8
LC
719Guile, so its configuration can be written in Scheme; the original cron
720format is also supported.")
71e0f217 721 (license license:gpl3+)))
87d836b2 722
01497dfe 723(define-public mcron2
cfbf6de1
LC
724 ;; This was mthl's mcron development branch, and it became mcron 1.1.
725 (deprecated-package "mcron2" mcron))
01497dfe 726
814b18e5
AS
727(define-public guile-ics
728 (package
729 (name "guile-ics")
291c2d57 730 (version "0.2.0")
814b18e5
AS
731 (source (origin
732 (method git-fetch)
733 (uri (git-reference
734 (url "https://github.com/artyom-poptsov/guile-ics")
291c2d57 735 (commit (string-append "v" version))))
814b18e5
AS
736 (file-name (string-append name "-" version "-checkout"))
737 (sha256
738 (base32
291c2d57 739 "0qjjvadr7gibdq9jvwkmlkb4afsw9n2shfj9phpiadinxk3p4m2g"))))
814b18e5
AS
740 (build-system gnu-build-system)
741 (arguments
742 '(#:phases (modify-phases %standard-phases
d10092b8
KK
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")))))))
814b18e5 749 (native-inputs
464f5447 750 `(("autoconf" ,autoconf-wrapper)
814b18e5
AS
751 ("automake" ,automake)
752 ("texinfo" ,texinfo)
753 ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS'.
754 ("gettext" ,gettext-minimal)
755 ("pkg-config" ,pkg-config)))
d573d892
LC
756 (inputs `(("guile" ,guile-2.2) ("which" ,which)))
757 (propagated-inputs `(("guile-lib" ,guile-lib)))
814b18e5
AS
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
762pure Scheme. The library can be used to read and write iCalendar data.
763
764The library is shipped with documentation in Info format and usage examples.")
71e0f217 765 (license license:gpl3+)))
814b18e5 766
3e9066fc
LC
767(define-public guile-lib
768 (package
769 (name "guile-lib")
30f17d73 770 (version "0.2.5.1")
3e9066fc 771 (source (origin
af126875
MC
772 (method url-fetch)
773 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
774 version ".tar.gz"))
775 (sha256
776 (base32
30f17d73 777 "19q420i3is3d4jmkdqs5y7ir7ipp4s795saflqgwf6617cx2zpj4"))))
3e9066fc
LC
778 (build-system gnu-build-system)
779 (arguments
af126875
MC
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 = \
bf62b8ff 791$(libdir)/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n"))
af126875 792 #t)))))
bf62b8ff 793 (native-inputs `(("pkg-config" ,pkg-config)))
1b0f266e 794 (inputs `(("guile" ,guile-2.2)))
340978d7 795 (home-page "https://www.nongnu.org/guile-lib/")
3e9066fc
LC
796 (synopsis "Collection of useful Guile Scheme modules")
797 (description
35b9e423 798 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
3e9066fc
LC
799modules, allowing for people to cooperate integrating their generic Guile
800modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
801for 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.
71e0f217 806 (license license:gpl3+)))
3e9066fc 807
1b0f266e
LC
808(define-public guile2.0-lib
809 (package-for-guile-2.0 guile-lib))
810
12773de3 811(define-public guile2.2-lib
1b0f266e 812 (deprecated-package "guile2.2-lib" guile-lib))
12773de3 813
6050a1fb
CR
814(define-public guile-json
815 (package
816 (name "guile-json")
1f4f2360 817 (version "0.6.0")
6050a1fb 818 (source (origin
ffc72ec6
LC
819 (method url-fetch)
820 (uri (string-append "mirror://savannah/guile-json/guile-json-"
821 version ".tar.gz"))
822 (sha256
823 (base32
1f4f2360 824 "1qmjg7lbgciw95fkdzvlp9f68vv17kdjky42ywfzd4ffzwww0lgc"))
ffc72ec6
LC
825 (modules '((guix build utils)))
826 (snippet
827 ;; Make sure everything goes under .../site/X.Y, like Guile's
828 ;; search paths expects.
829 '(begin
830 (substitute* "configure"
831 (("ac_subst_vars='")
832 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
833 (substitute* '("Makefile.in" "json/Makefile.in")
834 (("moddir =.*/share/guile/site" all)
6cbee49d
MW
835 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))
836 #t))))
6050a1fb 837 (build-system gnu-build-system)
2252f087 838 (native-inputs `(("guile" ,guile-2.2)))
340978d7 839 (home-page "https://savannah.nongnu.org/projects/guile-json/")
6050a1fb
CR
840 (synopsis "JSON module for Guile")
841 (description
0f31d4f0
LC
842 "Guile-JSON supports parsing and building JSON documents according to the
843specification. These are the main features:
844
845@itemize
846@item Strictly complies to @uref{http://json.org, specification}.
847@item Build JSON documents programmatically via macros.
848@item Unicode support for strings.
849@item Allows JSON pretty printing.
850@end itemize\n")
71e0f217 851 (license license:lgpl3+)))
6050a1fb 852
947a5d47 853(define-public guile2.2-json
2252f087
LC
854 (deprecated-package "guile2.2-json" guile-json))
855
856(define-public guile2.0-json
857 (package-for-guile-2.0 guile-json))
947a5d47 858
6bc24063
CAW
859(define-public guile-minikanren
860 (package
861 (name "guile-minikanren")
862 (version "20150424.e844d85")
863 (source (origin
864 (method git-fetch)
865 (uri (git-reference
866 (url "https://github.com/ijp/minikanren.git")
867 (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
821f4dc2 868 (file-name (string-append name "-" version "-checkout"))
6bc24063
CAW
869 (sha256
870 (base32
871 "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
872 (build-system trivial-build-system)
873 (arguments
4b74a29d 874 `(#:modules ((guix build utils))
6bc24063
CAW
875 #:builder
876 (begin
877 (use-modules (guix build utils)
4b74a29d
LC
878 (ice-9 match)
879 (ice-9 popen)
880 (ice-9 rdelim))
881
6bc24063 882 (let* ((out (assoc-ref %outputs "out"))
4b74a29d
LC
883 (guile (assoc-ref %build-inputs "guile"))
884 (effective (read-line
885 (open-pipe* OPEN_READ
886 (string-append guile "/bin/guile")
887 "-c" "(display (effective-version))")))
888 (module-dir (string-append out "/share/guile/site/"
889 effective))
6bc24063 890 (source (assoc-ref %build-inputs "source"))
f3d8cd79 891 (doc (string-append out "/share/doc/guile-minikanren"))
6bc24063
CAW
892 (scm-files '("minikanren.scm"
893 "minikanren/mkextraforms.scm"
894 "minikanren/mkprelude.scm"
895 "minikanren/mk.scm"))
896 (guild (string-append (assoc-ref %build-inputs "guile")
897 "/bin/guild")))
898 ;; Make installation directories.
899 (mkdir-p (string-append module-dir "/minikanren"))
900 (mkdir-p doc)
901
902 ;; Compile .scm files and install.
903 (chdir source)
904 (setenv "GUILE_AUTO_COMPILE" "0")
905 (for-each (lambda (file)
906 (let* ((dest-file (string-append module-dir "/"
76e6e663 907 file))
6bc24063
CAW
908 (go-file (match (string-split file #\.)
909 ((base _)
910 (string-append module-dir "/"
911 base ".go")))))
912 ;; Install source module.
913 (copy-file file dest-file)
914 ;; Install compiled module.
e3cfef22
MW
915 (invoke guild "compile"
916 "-L" source
917 "-o" go-file
918 file)))
6bc24063
CAW
919 scm-files)
920
921 ;; Also copy over the README.
96c46210 922 (install-file "README.org" doc)
e3cfef22 923
6bc24063
CAW
924 #t))))
925 (inputs
d58ee08d 926 `(("guile" ,guile-2.2)))
6bc24063 927 (home-page "https://github.com/ijp/minikanren")
e881752c 928 (synopsis "MiniKanren declarative logic system, packaged for Guile")
6bc24063
CAW
929 (description
930 "MiniKanren is a relational programming extension to the Scheme
931programming Language, written as a smaller version of Kanren suitable for
932pedagogical purposes. It is featured in the book, The Reasoned Schemer,
933written by Dan Friedman, William Byrd, and Oleg Kiselyov.
934
e881752c 935This is Ian Price's r6rs packaged version of miniKanren, which deviates
6bc24063
CAW
936slightly from miniKanren mainline.
937
938See http://minikanren.org/ for more on miniKanren generally.")
71e0f217 939 (license license:expat)))
6bc24063 940
d58ee08d
LC
941(define-public guile2.0-minikanren
942 (package-for-guile-2.0 guile-minikanren))
943
947a5d47 944(define-public guile2.2-minikanren
d58ee08d 945 (deprecated-package "guile2.2-minikanren" guile-minikanren))
947a5d47 946
28a1041f
AP
947(define-public guile-miniadapton
948 (let ((commit "1b5749422304567c96ac5367f2221dda9eff5880")
949 (revision "1"))
950 (package
951 (name "guile-miniadapton")
952 (version (string-append "0-" revision "." (string-take commit 9)))
953 (source (origin
954 (method git-fetch)
955 (uri (git-reference
956 (url "https://github.com/fisherdj/miniAdapton.git")
957 (commit commit)))
958 (file-name (string-append name "-" version "-checkout"))
959 (sha256
960 (base32
961 "09q51zkw2fypad5xixskfzw2cjhjgs5cswdp3i7cpp651rb3zndh"))))
962 (build-system gnu-build-system)
963 (arguments
964 `(#:modules ((guix build utils)
965 (ice-9 popen)
966 (ice-9 rdelim)
967 (srfi srfi-1)
968 (guix build gnu-build-system))
969 #:tests? #f ; there is no test target
970 #:phases
971 (modify-phases %standard-phases
972 (delete 'configure)
973 (delete 'build)
974 (replace 'install
975 (lambda* (#:key outputs #:allow-other-keys)
976 (let* ((cwd (getcwd))
977 (scm-files (find-files "." "\\.scm$"))
978 (effective (read-line
979 (open-pipe* OPEN_READ
980 "guile" "-c"
981 "(display (effective-version))")))
982 (module-dir (string-append (assoc-ref outputs "out")
983 "/share/guile/site/"
984 effective)))
985
986 ;; Make installation directories.
987 (mkdir-p module-dir)
988
989 (setenv "GUILE_AUTO_COMPILE" "0")
990
991 ;; Compile .scm files and install.
992 (every (lambda (file)
993 (let ((go-file (string-append module-dir "/"
994 (basename file ".scm") ".go")))
995 ;; Install source module.
996 (install-file file module-dir)
997 ;; Compile and install module.
998 (zero? (system* "guild" "compile" "-L" cwd
999 "-o" go-file file))))
1000 scm-files)))))))
1001 (inputs
1002 `(("guile" ,guile-2.2)))
1003 (home-page "https://github.com/fisherdj/miniAdapton")
1004 (synopsis "Minimal implementation of incremental computation in Guile
1005Scheme")
1006 (description "This package provides a complete Scheme implementation of
1007miniAdapton, which implements the core functionality of the Adapton system for
1008incremental computation (also known as self-adjusting computation). Like
1009Adapton, miniAdapton allows programmers to safely combine mutation and
1010memoization. miniAdapton is built on top of an even simpler system,
1011microAdapton. Both miniAdapton and microAdapton are designed to be easy to
1012understand, extend, and port to host languages other than Scheme.")
1013 (license license:expat))))
1014
32e14fc1
CAW
1015(define-public guile-irregex
1016 (package
1017 (name "guile-irregex")
fb73f07a 1018 (version "0.9.6")
32e14fc1
CAW
1019 (source (origin
1020 (method url-fetch)
1021 (uri (string-append
1022 "http://synthcode.com/scheme/irregex/irregex-"
d03f9446 1023 version ".tar.gz"))
32e14fc1
CAW
1024 (sha256
1025 (base32
fb73f07a 1026 "1ia3m7dp3lcxa048q0gqbiwwsyvn99baw6xkhb4bhhzn4k7bwyqq"))))
32e14fc1
CAW
1027 (build-system gnu-build-system)
1028 (arguments
1029 `(#:modules ((guix build utils)
1030 (ice-9 match)
fe447664
LC
1031 (ice-9 rdelim)
1032 (ice-9 popen)
32e14fc1
CAW
1033 (guix build gnu-build-system))
1034 #:phases
1035 (modify-phases %standard-phases
32e14fc1
CAW
1036 (delete 'configure)
1037 (delete 'build)
1038 (delete 'check)
1039 (replace 'install
1040 (lambda* (#:key inputs outputs #:allow-other-keys)
fe447664
LC
1041 (let* ((out (assoc-ref outputs "out"))
1042 (effective (read-line
1043 (open-pipe* OPEN_READ
1044 "guile" "-c"
1045 "(display (effective-version))")))
1046 (module-dir (string-append out "/share/guile/site/"
1047 effective))
1048 (source (assoc-ref inputs "source"))
1049 (doc (string-append out "/share/doc/guile-irregex/"))
1050 (guild (string-append (assoc-ref %build-inputs "guile")
1051 "/bin/guild")))
1052 ;; Make installation directories.
1053 (mkdir-p (string-append module-dir "/rx/source"))
1054 (mkdir-p doc)
1055
1056 ;; Compile .scm files and install.
1057 (setenv "GUILE_AUTO_COMPILE" "0")
1058
1059 (for-each (lambda (copy-info)
1060 (match copy-info
1061 ((src-file dest-file-basis)
1062 (let* ((dest-file (string-append
32e14fc1 1063 module-dir dest-file-basis
fe447664
LC
1064 ".scm"))
1065 (go-file (string-append
1066 module-dir dest-file-basis
1067 ".go")))
1068 ;; Install source module.
1069 (copy-file src-file
1070 dest-file)
1071 ;; Install compiled module.
67eb6f50
MW
1072 (invoke guild "compile"
1073 "-L" (getcwd)
1074 "-o" go-file
1075 src-file)))))
fe447664
LC
1076 '(("irregex-guile.scm" "/rx/irregex")
1077 ("irregex.scm" "/rx/source/irregex")
1078 ;; Not really reachable via guile's packaging system,
1079 ;; but nice to have around
1080 ("irregex-utils.scm" "/rx/source/irregex-utils")))
1081
1082 ;; Also copy over the README.
1083 (install-file "irregex.html" doc)
1084 #t))))))
32e14fc1 1085 (inputs
2863860b 1086 `(("guile" ,guile-2.2)))
32e14fc1
CAW
1087 (home-page "http://synthcode.com/scheme/irregex")
1088 (synopsis "S-expression based regular expressions")
1089 (description
1090 "Irregex is an s-expression based alternative to your classic
1091string-based regular expressions. It implements SRFI 115 and is deeply
1092inspired by the SCSH regular expression system.")
71e0f217 1093 (license license:bsd-3)))
93e7199b 1094
2863860b
LC
1095(define-public guile2.0-irregex
1096 (package-for-guile-2.0 guile-irregex))
1097
947a5d47 1098(define-public guile2.2-irregex
2863860b 1099 (deprecated-package "guile2.2-irregex" guile-irregex))
947a5d47 1100
93e7199b
CAW
1101;; There are two guile-gdbm packages, one using the FFI and one with
1102;; direct C bindings, hence the verbose name.
1103
1104(define-public guile-gdbm-ffi
1105 (package
1106 (name "guile-gdbm-ffi")
1107 (version "20120209.fa1d5b6")
1108 (source (origin
1109 (method git-fetch)
1110 (uri (git-reference
1111 (url "https://github.com/ijp/guile-gdbm.git")
1112 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
821f4dc2 1113 (file-name (string-append name "-" version "-checkout"))
93e7199b
CAW
1114 (sha256
1115 (base32
1116 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
1117 (build-system trivial-build-system)
56f31a9f
MW
1118 (inputs
1119 `(("guile" ,guile-2.2)
1120 ;; patch-and-repack doesn't work for git checkouts,
1121 ;; so we must apply the patch manually.
1122 ("patch" ,patch)
1123 ("patch-file" ,(search-patch
1124 "guile-gdbm-ffi-support-gdbm-1.14.patch"))))
1125 (propagated-inputs
1126 `(("gdbm" ,gdbm)))
93e7199b
CAW
1127 (arguments
1128 `(#:modules
1129 ((guix build utils))
1130 #:builder
1131 (begin
1132 (use-modules (guix build utils)
a5bd6a5e
CAW
1133 (ice-9 rdelim)
1134 (ice-9 popen))
1135
1136 ;; Avoid warnings we can safely ignore
1137 (setenv "GUILE_AUTO_COMPILE" "0")
93e7199b
CAW
1138
1139 (let* ((out (assoc-ref %outputs "out"))
a5bd6a5e
CAW
1140 (effective-version
1141 (read-line
1142 (open-pipe* OPEN_READ
1143 (string-append
1144 (assoc-ref %build-inputs "guile")
1145 "/bin/guile")
1146 "-c" "(display (effective-version))")))
1147 (module-dir (string-append out "/share/guile/site/"
1148 effective-version))
93e7199b
CAW
1149 (source (assoc-ref %build-inputs "source"))
1150 (doc (string-append out "/share/doc"))
1151 (guild (string-append (assoc-ref %build-inputs "guile")
1152 "/bin/guild"))
1153 (gdbm.scm-dest
1154 (string-append module-dir "/gdbm.scm"))
1155 (gdbm.go-dest
a5bd6a5e
CAW
1156 (string-append module-dir "/gdbm.go"))
1157 (compile-file
1158 (lambda (in-file out-file)
07e36357 1159 (invoke guild "compile" "-o" out-file in-file))))
93e7199b
CAW
1160 ;; Switch directory for compiling and installing
1161 (chdir source)
1162
4168ddf6
TGR
1163 ;; Install the documentation.
1164 (install-file "README.md" doc)
1165 (copy-recursively "examples" (string-append doc "/examples"))
1166
1167 ;; Make installation directories.
1168 (mkdir-p module-dir)
1169
93e7199b
CAW
1170 ;; copy the source
1171 (copy-file "gdbm.scm" gdbm.scm-dest)
1172
1173 ;; Patch the FFI
1174 (substitute* gdbm.scm-dest
1175 (("\\(dynamic-link \"libgdbm\"\\)")
1176 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
1177 (assoc-ref %build-inputs "gdbm"))))
1178
56f31a9f
MW
1179 ;; Apply the patch to add support for gdbm-1.14.
1180 (let ((patch-command (string-append (assoc-ref %build-inputs "patch")
1181 "/bin/patch"))
1182 (patch-file (assoc-ref %build-inputs "patch-file")))
1183 (with-directory-excursion (dirname gdbm.scm-dest)
1184 (format #t "applying '~a'...~%" patch-file)
1185 (invoke patch-command "--force" "--input" patch-file)))
1186
93e7199b 1187 ;; compile to the destination
e3cfef22
MW
1188 (compile-file gdbm.scm-dest gdbm.go-dest)
1189
1190 #t))))
93e7199b
CAW
1191 (home-page "https://github.com/ijp/guile-gdbm")
1192 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
1193 (description
1194 "Guile bindings to the GDBM key-value storage system, using
1195Guile's foreign function interface.")
71e0f217 1196 (license license:gpl3+)))
93e7199b 1197
5bd3a841
LC
1198(define-public guile2.0-gdbm-ffi
1199 (package-for-guile-2.0 guile-gdbm-ffi))
1200
2737bcff 1201(define-public guile2.2-gdbm-ffi
5bd3a841 1202 (deprecated-package "guile2.2-gdbm-ffi" guile-gdbm-ffi))
93e7199b 1203
e8ac1f8f 1204(define-public guile-sqlite3
499e499b
LC
1205 (let ((commit "10c13a7e02ab1655c8a758e560cafc9d6eff26f4")
1206 (revision "4"))
e8ac1f8f
LC
1207 (package
1208 (name "guile-sqlite3")
18adb1f0 1209 (version (git-version "0.0" revision commit))
e8ac1f8f 1210
ae21519f
LC
1211 ;; XXX: This used to be available read-only at
1212 ;; <https://www.gitorious.org/guile-sqlite3/guile-sqlite3.git/> but it
1213 ;; eventually disappeared, so we have our own copy here.
1214 (home-page "https://notabug.org/civodul/guile-sqlite3.git")
e8ac1f8f
LC
1215 (source (origin
1216 (method git-fetch)
1217 (uri (git-reference
1218 (url home-page)
1219 (commit commit)))
1220 (sha256
1221 (base32
499e499b 1222 "0nhhswpd7nb2f0gfr55fzcc2xm3l2xx4rbljsd1clrm8fj2d7q9d"))
e8ac1f8f
LC
1223 (file-name (string-append name "-" version "-checkout"))
1224 (modules '((guix build utils)))
1225 (snippet
1226 ;; Upgrade 'Makefile.am' to the current way of doing things.
6cbee49d
MW
1227 '(begin
1228 (substitute* "Makefile.am"
1229 (("TESTS_ENVIRONMENT")
1230 "TEST_LOG_COMPILER"))
1231 #t))))
e8ac1f8f
LC
1232
1233 (build-system gnu-build-system)
1234 (native-inputs
1235 `(("autoconf" ,autoconf)
1236 ("automake" ,automake)
1237 ("pkg-config" ,pkg-config)))
1238 (inputs
99bde93b 1239 `(("guile" ,guile-2.2)
e8ac1f8f
LC
1240 ("sqlite" ,sqlite)))
1241 (arguments
1242 '(#:phases (modify-phases %standard-phases
d10092b8 1243 (add-after 'unpack 'autoreconf
e8ac1f8f
LC
1244 (lambda _
1245 (zero? (system* "autoreconf" "-vfi"))))
1246 (add-before 'build 'set-sqlite3-file-name
1247 (lambda* (#:key inputs #:allow-other-keys)
1248 (substitute* "sqlite3.scm"
1249 (("\"libsqlite3\"")
1250 (string-append "\"" (assoc-ref inputs "sqlite")
1251 "/lib/libsqlite3\"")))
1252 #t)))))
1253 (synopsis "Access SQLite databases from Guile")
1254 (description
1255 "This package provides Guile bindings to the SQLite database system.")
71e0f217 1256 (license license:gpl3+))))
e8ac1f8f 1257
27f5e13e
DT
1258(define-public haunt
1259 (package
1260 (name "haunt")
907254e5 1261 (version "0.2.2")
27f5e13e
DT
1262 (source (origin
1263 (method url-fetch)
4960beaa 1264 (uri (string-append "https://files.dthompson.us/haunt/haunt-"
27f5e13e
DT
1265 version ".tar.gz"))
1266 (sha256
1267 (base32
907254e5 1268 "0nm00krmqq4zmqi2irh35dbf2cn6al58s620hijmhfvhgvdqznlp"))))
27f5e13e 1269 (build-system gnu-build-system)
4ecbf6d2
LC
1270 (arguments
1271 `(#:modules ((ice-9 match) (ice-9 ftw)
1272 ,@%gnu-build-system-modules)
1e406301 1273 #:tests? #f ; test suite is non-deterministic :(
4ecbf6d2
LC
1274 #:phases (modify-phases %standard-phases
1275 (add-after 'install 'wrap-haunt
1276 (lambda* (#:key outputs #:allow-other-keys)
1277 ;; Wrap the 'haunt' command to refer to the right
1278 ;; modules.
1279 (let* ((out (assoc-ref outputs "out"))
1280 (bin (string-append out "/bin"))
1281 (site (string-append
1282 out "/share/guile/site")))
1283 (match (scandir site)
1284 (("." ".." version)
907254e5
DT
1285 (let ((modules (string-append site "/" version))
1286 (compiled-modules (string-append
1287 out "/lib/guile/" version
1288 "/site-ccache")))
4ecbf6d2
LC
1289 (wrap-program (string-append bin "/haunt")
1290 `("GUILE_LOAD_PATH" ":" prefix
1291 (,modules))
1292 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
907254e5 1293 (,compiled-modules)))
4ecbf6d2 1294 #t)))))))))
4960beaa
DT
1295 (native-inputs
1296 `(("pkg-config" ,pkg-config)
1297 ("texinfo" ,texinfo)))
27f5e13e 1298 (inputs
bd19f65a 1299 `(("guile" ,guile-2.2)))
4960beaa 1300 (propagated-inputs
9b1a497e
AP
1301 `(("guile-reader" ,guile-reader)
1302 ("guile-commonmark" ,guile-commonmark)))
27f5e13e
DT
1303 (synopsis "Functional static site generator")
1304 (description "Haunt is a static site generator written in Guile
1305Scheme. Haunt features a functional build system and an extensible
1306interface for reading articles in any format.")
1307 (home-page "http://haunt.dthompson.us")
71e0f217 1308 (license license:gpl3+)))
27f5e13e 1309
bd19f65a
LC
1310(define-public guile2.0-haunt
1311 (package-for-guile-2.0
1312 (package (inherit haunt) (name "guile2.0-haunt"))))
64f34aef 1313(define-public guile2.2-haunt
bd19f65a 1314 (deprecated-package "guile2.2-haunt" haunt))
64f34aef 1315
44a2bdf8
AS
1316(define-public guile-config
1317 (package
1318 (name "guile-config")
43d5df98 1319 (version "0.2")
44a2bdf8 1320 (source (origin
43d5df98
AS
1321 (method git-fetch)
1322 (uri (git-reference
1323 (url "https://github.com/a-sassmannshausen/guile-config")
1324 (commit "guile-config-0.2")))
1325 (file-name (string-append name "-" version "-checkout"))
44a2bdf8
AS
1326 (sha256
1327 (base32
43d5df98 1328 "07q86vqdwmm81wwxz1d1ah27hbhs6qbn8kiizrfpj0s4bf95w3r9"))))
44a2bdf8 1329 (build-system gnu-build-system)
43d5df98
AS
1330 (arguments
1331 '(#:phases (modify-phases %standard-phases
1332 (add-after 'unpack 'autoreconf
1333 (lambda _
1334 (zero? (system* "autoreconf" "-fi")))))))
1335 (native-inputs
1336 `(("autoconf" ,autoconf)
1337 ("automake" ,automake)
1338 ("pkg-config" ,pkg-config)
1339 ("texinfo" ,texinfo)))
44a2bdf8 1340 (inputs
43d5df98 1341 `(("guile" ,guile-2.2)))
44a2bdf8
AS
1342 (synopsis "Guile application configuration parsing library")
1343 (description
1344 "Guile Config is a library providing a declarative approach to
1345application configuration specification. The library provides clean
1346configuration declaration forms, and processors that take care of:
1347configuration file creation; configuration file parsing; command-line
1348parameter parsing using getopt-long; basic GNU command-line parameter
1349generation (--help, --usage, --version); automatic output generation for the
1350above command-line parameters.")
1351 (home-page "https://github.com/a-sassmannshausen/guile-config")
43d5df98 1352 (license license:gpl3+)))
44a2bdf8 1353
36548111
DT
1354(define-public guile-redis
1355 (package
1356 (name "guile-redis")
1357 (version "0.1.0")
1358 (source (origin
1359 (method url-fetch)
1360 (uri (string-append "mirror://savannah/guile-redis/guile-redis-"
1361 version ".tar.gz"))
1362 (sha256
1363 (base32
1364 "0vx6if6b4r3kwx64vzbs6vpc0cpcr85x11w9vkzq27gw8n7isv56"))
1365 (modules '((guix build utils)))
1366 (snippet
ea833d30 1367 ;; Make sure everything goes under .../site/X.Y, like Guile's
36548111 1368 ;; search paths expects.
ea833d30
RW
1369 '(begin
1370 (substitute* "configure"
1371 (("ac_subst_vars='")
1372 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
1373 (substitute* '("Makefile.in"
1374 "redis/Makefile.in"
1375 "redis/commands/Makefile.in")
1376 (("moddir =.*/share/guile/site" all)
6cbee49d
MW
1377 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))
1378 #t))))
36548111
DT
1379 (build-system gnu-build-system)
1380 (native-inputs
d5eacecc 1381 `(("guile" ,guile-2.2)))
340978d7 1382 (home-page "https://savannah.nongnu.org/projects/guile-redis/")
36548111
DT
1383 (synopsis "Redis client library for Guile")
1384 (description "Guile-redis provides a Scheme interface to the Redis
1385key-value cache and store.")
71e0f217 1386 (license license:lgpl3+)))
36548111 1387
d5eacecc
LC
1388(define-public guile2.0-redis
1389 (package-for-guile-2.0 guile-redis))
1390
85313be8 1391(define-public guile2.2-redis
d5eacecc 1392 (deprecated-package "guile2.2-redis" guile-redis))
85313be8 1393
9d373377
CAW
1394(define-public guile-wisp
1395 (package
1396 (name "guile-wisp")
e0840905 1397 (version "0.9.8")
9d373377
CAW
1398 (source (origin
1399 (method url-fetch)
1400 (uri (string-append "https://bitbucket.org/ArneBab/"
1401 "wisp/downloads/wisp-"
1402 version ".tar.gz"))
1403 (sha256
1404 (base32
e0840905 1405 "1f2bbicq1rxnwmiplrm4r75wj06w385mjkyvi7g4k740bgwcrzxr"))))
9d373377
CAW
1406 (build-system gnu-build-system)
1407 (arguments
e8374e69
LC
1408 `(#:modules ((guix build gnu-build-system)
1409 (guix build utils)
1410 (ice-9 rdelim)
1411 (ice-9 popen))
1412
9d373377
CAW
1413 #:phases
1414 (modify-phases %standard-phases
e0840905 1415 (add-before 'configure 'substitute-before-config
9d373377
CAW
1416
1417 (lambda* (#:key inputs #:allow-other-keys)
1418 (let ((bash (assoc-ref inputs "bash")))
9d373377
CAW
1419 ;; Puts together some test files with /bin/bash hardcoded
1420 (substitute* "Makefile.in"
e0840905
LC
1421 (("/usr/bin/env bash")
1422 (string-append bash "/bin/bash"))
1423 (("\\$\\(GUILE_EFFECTIVE_VERSION\\)/site")
1424 "site/$(GUILE_EFFECTIVE_VERSION)")) ;use the right order
9d373377
CAW
1425 #t)))
1426
1427 ;; auto compilation breaks, but if we set HOME to /tmp,
1428 ;; that works ok
1429 (add-before
1430 'check 'auto-compile-hacky-workaround
1431 (lambda _
1432 (setenv "HOME" "/tmp")
1433 #t))
e0840905 1434 (add-after 'install 'install-go-files
9d373377
CAW
1435 (lambda* (#:key outputs inputs #:allow-other-keys)
1436 (let* ((out (assoc-ref outputs "out"))
e8374e69
LC
1437 (effective (read-line
1438 (open-pipe* OPEN_READ
1439 "guile" "-c"
1440 "(display (effective-version))")))
1441 (module-dir (string-append out "/share/guile/site/"
1442 effective))
1443 (object-dir (string-append out "/lib/guile/" effective
1444 "/site-ccache"))
1445 (prefix (string-length module-dir)))
9d373377 1446 ;; compile to the destination
e0840905 1447 (for-each (lambda (file)
e8374e69
LC
1448 (let* ((base (string-drop (string-drop-right file 4)
1449 prefix))
1450 (go (string-append object-dir base ".go")))
1451 (invoke "guild" "compile" "-L" module-dir
1452 file "-o" go)))
e0840905 1453 (find-files module-dir "\\.scm$"))
9d373377
CAW
1454 #t))))))
1455 (home-page "http://draketo.de/english/wisp")
1456 (inputs
89c4bfe7 1457 `(("guile" ,guile-2.2)))
e0840905
LC
1458 (native-inputs
1459 `(("python" ,python)
1460 ("pkg-config" ,pkg-config)))
a124bbd2
SB
1461 (synopsis "Whitespace to lisp syntax for Guile")
1462 (description "Wisp is a syntax for Guile which provides a Python-like
9d373377
CAW
1463whitespace-significant language. It may be easier on the eyes for some
1464users and in some situations.")
71e0f217 1465 (license license:gpl3+)))
9d373377 1466
5649c8cd
DT
1467(define-public guile-sly
1468 (package
1469 (name "guile-sly")
1470 (version "0.1")
1471 (source (origin
1472 (method url-fetch)
8d5e7ad2 1473 (uri (string-append "https://files.dthompson.us/sly/sly-"
5649c8cd
DT
1474 version ".tar.gz"))
1475 (sha256
1476 (base32
44394ef9
LC
1477 "1svzlbz2vripmyq2kjh0rig16bsrnbkwbsm558pjln9l65mcl4qq"))
1478 (modules '((guix build utils)))
1479 (snippet
1480 '(begin
1481 (substitute* "configure"
1482 (("_guile_required_version=\"2.0.11\"")
1483 "_guile_required_version=\"2\"")
1484 (("ac_subst_vars='")
1485 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
1486 (substitute* (find-files "." "Makefile.in")
1487 (("moddir = .*$")
1488 (string-append
1489 "moddir = "
1490 "$(prefix)/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n"))
1491 (("godir = .*$")
1492 (string-append
1493 "godir = "
6cbee49d
MW
1494 "$(prefix)/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n")))
1495 #t))))
5649c8cd
DT
1496 (build-system gnu-build-system)
1497 (arguments
1498 '(#:configure-flags
1499 (list (string-append "--with-libfreeimage-prefix="
1500 (assoc-ref %build-inputs "freeimage"))
1501 (string-append "--with-libgslcblas-prefix="
1502 (assoc-ref %build-inputs "gsl")))))
1503 (native-inputs
1504 `(("pkg-config" ,pkg-config)))
1505 (propagated-inputs
2e7825bc 1506 `(("guile-sdl" ,guile-sdl)
5649c8cd
DT
1507 ("guile-opengl" ,guile-opengl)))
1508 (inputs
2e7825bc
LC
1509 `(("guile" ,guile-2.2)
1510 ("gsl" ,gsl)
5649c8cd
DT
1511 ("freeimage" ,freeimage)
1512 ("mesa" ,mesa)))
1513 (synopsis "2D/3D game engine for GNU Guile")
1514 (description "Sly is a 2D/3D game engine written in Guile Scheme. Sly
1515features a functional reactive programming interface and live coding
1516capabilities.")
0eb3b8c0 1517 (home-page "https://dthompson.us/projects/sly.html")
71e0f217 1518 (license license:gpl3+)))
5649c8cd 1519
dec1e2b3
AB
1520(define-public g-wrap
1521 (package
1522 (name "g-wrap")
1523 (version "1.9.15")
1524 (source (origin
1525 (method url-fetch)
1526 (uri (string-append "mirror://savannah/g-wrap/g-wrap-"
1527 version ".tar.gz"))
1528 (sha256
1529 (base32
1530 "0ak0bha37dfpj9kmyw1r8fj8nva639aw5xr66wr5gd3l1rqf5xhg"))))
1531 (build-system gnu-build-system)
1532 (native-inputs
1533 `(("pkg-config" ,pkg-config)))
1534 (propagated-inputs
61583094 1535 `(("guile" ,guile-2.2)
dec1e2b3
AB
1536 ("guile-lib" ,guile-lib)))
1537 (inputs
1538 `(("libffi" ,libffi)))
9e8599a3 1539 (arguments
61583094
TF
1540 `(#:configure-flags '("--disable-Werror")
1541 #:phases
1542 (modify-phases %standard-phases
1543 (add-before 'configure 'pre-configure
1544 (lambda* (#:key outputs #:allow-other-keys)
1545 (let ((out (assoc-ref outputs "out")))
1546 (substitute* (find-files "." "^Makefile.in$")
1547 (("guilemoduledir =.*guile/site" all)
1548 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))
1549 #t))))))
dec1e2b3
AB
1550 (synopsis "Generate C bindings for Guile")
1551 (description "G-Wrap is a tool and Guile library for generating function
1552wrappers for inter-language calls. It currently only supports generating Guile
1553wrappers for C functions. Given a definition of the types and prototypes for
1554a given C interface, G-Wrap will automatically generate the C code that
1555provides access to that interface and its types from the Scheme level.")
340978d7 1556 (home-page "https://www.nongnu.org/g-wrap/index.html")
71e0f217 1557 (license license:lgpl2.1+)))
dec1e2b3 1558
01497dfe
LC
1559(define-public guile-dbi
1560 (package
1561 (name "guile-dbi")
1562 (version "2.1.6")
1563 (source (origin
1564 (method url-fetch)
1565 (uri (string-append
1566 "http://download.gna.org/guile-dbi/guile-dbi-"
1567 version ".tar.gz"))
1568 (sha256
1569 (base32
1570 "116njrprhgrsv1qm904sp3b02rq01fx639r433d657gyhw3x159n"))))
1571 (build-system gnu-build-system)
1572 (arguments
1573 '(#:configure-flags
1574 (list (string-append
b989c3e3 1575 "--with-guile-site-dir=" %output "/share/guile/site/2.2"))
34e00c7b
AI
1576 #:make-flags
1577 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib:"
1578 (assoc-ref %build-inputs "guile-dbd-sqlite3") "/lib"))
01497dfe
LC
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
b989c3e3 1585 out "/share/guile/site/2.2/dbi/dbi.scm"))
01497dfe
LC
1586 (ext (string-append out "/lib/libguile-dbi")))
1587 (substitute* dbi.scm (("libguile-dbi") ext))
1588 #t))))))
34e00c7b
AI
1589 (inputs
1590 `(("guile-dbd-sqlite3" ,guile-dbd-sqlite3))) ; only shared library, no scheme files
01497dfe 1591 (propagated-inputs
b989c3e3 1592 `(("guile" ,guile-2.2)))
01497dfe
LC
1593 (synopsis "Guile database abstraction layer")
1594 (home-page "http://home.gna.org/guile-dbi/guile-dbi.html")
1595 (description
1596 "guile-dbi is a library for Guile that provides a convenient interface to
1597SQL databases. Database programming with guile-dbi is generic in that the same
1598programming interface is presented regardless of which database system is used.
1599It currently supports MySQL, Postgres and SQLite3.")
71e0f217 1600 (license license:gpl2+)))
01497dfe 1601
34e00c7b
AI
1602(define guile-dbi-bootstrap
1603 (package
1604 (inherit guile-dbi)
1605 (name "guile-dbi-bootstrap")
1606 (inputs '())
1607 (arguments
1608 (substitute-keyword-arguments (package-arguments guile-dbi)
1609 ((#:make-flags _) '(list))))))
1610
01497dfe
LC
1611(define-public guile-dbd-sqlite3
1612 (package
1613 (name "guile-dbd-sqlite3")
1614 (version "2.1.6")
1615 (source (origin
1616 (method url-fetch)
1617 (uri (string-append
1618 "http://download.gna.org/guile-dbi/guile-dbd-sqlite3-"
1619 version ".tar.gz"))
1620 (sha256
1621 (base32
1622 "0rg71jchxd2y8x496s8zmfmikr5g8zxi8zv2ar3f7a23pph92iw2"))))
1623 (build-system gnu-build-system)
1624 (native-inputs
34e00c7b
AI
1625 `(("pkg-config" ,pkg-config)
1626 ("guile-dbi-bootstrap" ,guile-dbi-bootstrap))) ; only required for headers
01497dfe
LC
1627 (inputs
1628 `(("sqlite" ,sqlite)
1629 ("zlib" ,(@ (gnu packages compression) zlib))))
01497dfe
LC
1630 (synopsis "Guile DBI driver for SQLite")
1631 (home-page "https://github.com/jkalbhenn/guile-dbd-sqlite3")
1632 (description
1633 "guile-dbi is a library for Guile that provides a convenient interface to
1634SQL databases. This package implements the interface for SQLite.")
71e0f217 1635 (license license:gpl2+)))
01497dfe 1636
e9291eaa
AS
1637(define-public guile-dsv
1638 (package
1639 (name "guile-dsv")
8c80f8ef 1640 (version "0.2.1")
e9291eaa
AS
1641 (source (origin
1642 (method git-fetch)
1643 (uri (git-reference
1644 (url "https://github.com/artyom-poptsov/guile-dsv")
8c80f8ef 1645 (commit "bdc5267d007478abc20ea96d7c459b7dd9560b3d")))
e9291eaa
AS
1646 (file-name (string-append name "-" version "-checkout"))
1647 (sha256
1648 (base32
8c80f8ef 1649 "1irw6mz8998nwyhzrw9g94jcz60b9zljgqfmipaz1ybn8579qjx0"))))
e9291eaa
AS
1650 (build-system gnu-build-system)
1651 (native-inputs
1652 `(("autoconf" ,autoconf)
1653 ("automake" ,automake)
1654 ("pkg-config" ,pkg-config)
1655 ("texinfo" ,texinfo)))
1656 (inputs `(("guile" ,guile-2.2)))
1657 (propagated-inputs `(("guile-lib" ,guile-lib)))
1658 (arguments
1659 '(#:phases (modify-phases %standard-phases
1660 (add-before 'configure 'set-guilesitedir
1661 (lambda _
1662 (substitute* "Makefile.in"
1663 (("^guilesitedir =.*$")
1664 "guilesitedir = \
1665$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
1666 (substitute* "modules/Makefile.in"
1667 (("^guilesitedir =.*$")
1668 "guilesitedir = \
1669$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
1670 (substitute* "modules/dsv/Makefile.in"
1671 (("^guilesitedir =.*$")
1672 "guilesitedir = \
1673$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
1674 #t))
1675 (add-after 'unpack 'autoreconf
1676 (lambda _
1677 (zero? (system* "autoreconf" "-vfi")))))))
1678 (home-page "https://github.com/artyom-poptsov/guile-dsv")
1679 (synopsis "DSV module for Guile")
1680 (description
1681 "Guile-DSV is a GNU Guile module for working with the
1682delimiter-separated values (DSV) data format. Guile-DSV supports the
1683Unix-style DSV format and RFC 4180 format.")
1684 (license license:gpl3+)))
1685
bd9af610
AK
1686(define-public guile-xosd
1687 (package
1688 (name "guile-xosd")
4b2b7135 1689 (version "0.2.1")
bd9af610
AK
1690 (source (origin
1691 (method url-fetch)
1692 (uri (string-append "https://github.com/alezost/" name
1693 "/releases/download/v" version
1694 "/" name "-" version ".tar.gz"))
1695 (sha256
1696 (base32
4b2b7135 1697 "1ri5065c16kmgrf2pysn2ymxjqi5302lhpb07wkl1jr75ym8fn8p"))))
bd9af610
AK
1698 (build-system gnu-build-system)
1699 (native-inputs
1700 `(("pkg-config" ,pkg-config)))
1701 (inputs
c6726a5f 1702 `(("guile" ,guile-2.2)
bd9af610
AK
1703 ("libx11" ,libx11)
1704 ("libxext" ,libxext)
1705 ("libxinerama" ,libxinerama)
1706 ("xosd" ,xosd)))
1707 (home-page "https://github.com/alezost/guile-xosd")
1708 (synopsis "XOSD bindings for Guile")
1709 (description
1710 "Guile-XOSD provides Guile bindings for @code{libxosd},
1711@uref{http://sourceforge.net/projects/libxosd/, the X On Screen Display
1712library}.")
71e0f217 1713 (license license:gpl3+)))
bd9af610 1714
07f7cc03
AK
1715(define-public guile-daemon
1716 (package
1717 (name "guile-daemon")
5245399f 1718 (version "0.1.2")
07f7cc03
AK
1719 (source (origin
1720 (method url-fetch)
1721 (uri (string-append "https://github.com/alezost/" name
1722 "/releases/download/v" version
1723 "/" name "-" version ".tar.gz"))
1724 (sha256
1725 (base32
5245399f 1726 "0hh6gq6b6phpxm0b1dkxyzj3f4sxdf7dji63609lzypa5v1ad2gv"))))
07f7cc03
AK
1727 (build-system gnu-build-system)
1728 (native-inputs
1729 `(("pkg-config" ,pkg-config)))
1730 (inputs
c6726a5f 1731 `(("guile" ,guile-2.2)))
07f7cc03
AK
1732 (home-page "https://github.com/alezost/guile-daemon")
1733 (synopsis "Evaluate code in a running Guile process")
1734 (description
1735 "Guile-Daemon is a small Guile program that loads your initial
1736configuration file, and then reads and evaluates Guile expressions that
1737you send to a FIFO file.")
71e0f217 1738 (license license:gpl3+)))
07f7cc03 1739
e28e74a5
EE
1740(define-public guile-commonmark
1741 (package
1742 (name "guile-commonmark")
1743 (version "0.1")
1744 (source (origin
1745 (method url-fetch)
1746 (uri (string-append "https://github.com/OrangeShark/" name
1747 "/releases/download/v" version
1748 "/" name "-" version ".tar.gz"))
1749 (sha256
1750 (base32
757ce0f9
LC
1751 "12cb5fqvvgc87f5xp0ih5az305wnjia89l5jba83d0r2p8bfy0b0"))
1752 (modules '((guix build utils)))
1753 (snippet
1754 ;; Use the real effective version of Guile in directory names
1755 ;; instead of a hard-coded "/2.0".
1756 '(begin
1757 (substitute* "configure"
1758 (("ac_subst_vars='")
1759 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
1760 (substitute* "Makefile.in"
1761 (("/site/2.0")
6cbee49d
MW
1762 "/site/@GUILE_EFFECTIVE_VERSION@"))
1763 #t))))
e28e74a5
EE
1764 (build-system gnu-build-system)
1765 (inputs
7c86c031 1766 `(("guile" ,guile-2.2)))
e28e74a5
EE
1767 (synopsis "CommonMark parser for Guile")
1768 (description
1769 "guile-commonmark is a library for parsing CommonMark, a fully specified
1770variant of Markdown. The library is written in Guile Scheme and is designed
1771to transform a CommonMark document to SXML. guile-commonmark tries to closely
1772follow the @uref{http://commonmark.org/, CommonMark spec}, the main difference
1773is no support for parsing block and inline level HTML.")
1774 (home-page "https://github.com/OrangeShark/guile-commonmark")
71e0f217 1775 (license license:lgpl3+)))
e28e74a5 1776
7c86c031
LC
1777(define-public guile2.0-commonmark
1778 (package-for-guile-2.0 guile-commonmark))
947a5d47 1779(define-public guile2.2-commonmark
7c86c031 1780 (deprecated-package "guile2.2-commonmark" guile-commonmark))
947a5d47 1781
3b5783fc
AB
1782(define-public guile-bytestructures
1783 (package
1784 (name "guile-bytestructures")
4f85f7f7 1785 (version "1.0.1")
3b5783fc 1786 (source (origin
4f85f7f7 1787 (method url-fetch)
1788 (uri (string-append "https://github.com/TaylanUB/scheme-bytestructures"
1789 "/releases/download/v" version
1790 "/bytestructures-" version ".tar.gz"))
3b5783fc
AB
1791 (sha256
1792 (base32
4f85f7f7 1793 "1lnfcy65mqj823lamy2n2vaghdz0g7mj011bgnhmd6hwpnaidnh2"))))
1794 (build-system gnu-build-system)
726ecfeb 1795 (native-inputs
4f85f7f7 1796 `(("pkg-config" ,pkg-config)))
3b5783fc 1797 (inputs
aabece2e 1798 `(("guile" ,guile-2.2)))
3b5783fc
AB
1799 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
1800 (synopsis "Structured access to bytevector contents for Guile")
1801 (description
1802 "Guile bytestructures offers a system imitating the type system
1803of the C programming language, to be used on bytevectors. C's type
1804system works on raw memory, and Guile works on bytevectors which are
1805an abstraction over raw memory. It's also more powerful than the C
1806type system, elevating types to first-class status.")
71e0f217 1807 (license license:gpl3+)))
3b5783fc 1808
726ecfeb
LC
1809(define-public guile2.0-bytestructures
1810 (package-for-guile-2.0 guile-bytestructures))
1811
472fc855
LC
1812(define-public guile-aspell
1813 (package
1814 (name "guile-aspell")
234ea3d6 1815 (version "0.4")
472fc855
LC
1816 (source (origin
1817 (method url-fetch)
1818 (uri (string-append
1819 "http://lonelycactus.com/tarball/guile_aspell-"
1820 version ".tar.gz"))
1821 (sha256
1822 (base32
234ea3d6 1823 "0vpk5xj9m9qc702z3khmkwhgpb949qbsyz8kw2qycda6qnxk0077"))))
472fc855
LC
1824 (build-system gnu-build-system)
1825 (arguments
7295087e
LC
1826 '(#:phases (modify-phases %standard-phases
1827 (add-before 'configure 'set-guilesitedir
1828 (lambda _
1829 (substitute* "Makefile.in"
1830 (("^guilesitedir =.*$")
1831 "guilesitedir = \
1832$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
1833 #t))
472fc855
LC
1834 (add-before 'build 'set-libaspell-file-name
1835 (lambda* (#:key inputs #:allow-other-keys)
1836 (let ((aspell (assoc-ref inputs "aspell")))
234ea3d6 1837 (substitute* "aspell.scm"
472fc855
LC
1838 (("\"libaspell\\.so\"")
1839 (string-append "\"" aspell
1840 "/lib/libaspell\"")))
1841 #t))))))
1842 (native-inputs `(("pkg-config" ,pkg-config)))
cb5be6df 1843 (inputs `(("guile" ,guile-2.2)
472fc855
LC
1844 ("aspell" ,aspell)))
1845 (home-page "https://github.com/spk121/guile-aspell")
1846 (synopsis "Spell-checking from Guile")
1847 (description
1848 "guile-aspell is a Guile Scheme library for comparing a string against a
1849dictionary and suggesting spelling corrections.")
71e0f217 1850 (license license:gpl3+)))
472fc855 1851
a614ce38
LC
1852(define-public guile-bash
1853 ;; This project is currently retired. It was initially announced here:
1854 ;; <https://lists.gnu.org/archive/html/guile-user/2015-02/msg00003.html>.
1855 (let ((commit "1eabc563ca5692b3e08d84f1f0e6fd2283284469")
1856 (revision "0"))
1857 (package
1858 (name "guile-bash")
1859 (version (string-append "0.1.6-" revision "." (string-take commit 7)))
1860 (home-page
1861 "https://anonscm.debian.org/cgit/users/kaction-guest/retired/dev.guile-bash.git")
1862 (source (origin
1863 (method git-fetch)
1864 (uri (git-reference
1865 (commit commit)
1866 (url home-page)))
1867 (sha256
1868 (base32
1869 "097vny990wp2qpjij6a5a5gwc6fxzg5wk56inhy18iki5v6pif1p"))
1870 (file-name (string-append name "-" version "-checkout"))))
1871 (build-system gnu-build-system)
1872 (arguments
189be331 1873 '(#:configure-flags
a614ce38
LC
1874 ;; Add -I to match 'bash.pc' of Bash 4.4.
1875 (list (string-append "CPPFLAGS=-I"
1876 (assoc-ref %build-inputs "bash:include")
1877 "/include/bash/include")
1878
1879 ;; The '.a' file is useless.
1880 "--disable-static"
1881
1882 ;; Install 'lib/bash' as Bash 4.4 expects.
1883 (string-append "--libdir=" (assoc-ref %outputs "out")
1884 "/lib/bash"))))
1885 (native-inputs `(("pkg-config" ,pkg-config)
464f5447 1886 ("autoconf" ,autoconf-wrapper)
a614ce38
LC
1887 ("automake" ,automake)
1888 ("libtool" ,libtool)
1889 ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS'.
b7158b76
LC
1890 ("gettext" ,gettext-minimal)
1891
1892 ;; Bash with loadable module support, for the test
1893 ;; suite.
1894 ("bash-full" ,bash)))
a614ce38
LC
1895 (inputs `(("guile" ,guile-2.0)
1896 ("bash:include" ,bash "include")))
1897 (synopsis "Extend Bash using Guile")
1898 (description
1899 "Guile-Bash provides a shared library and set of Guile modules,
1900allowing you to extend Bash in Scheme. Scheme interfaces allow you to access
1901the following aspects of Bash:
1902
1903@itemize
1904@item aliases;
1905@item setting and getting Bash variables;
1906@item creating dynamic variables;
1907@item creating Bash functions with a Scheme implementation;
1908@item reader macro for output capturing;
1909@item reader macro for evaluating raw Bash commands.
1910@end itemize
1911
1912To enable it, run:
1913
1914@example
1915enable -f ~/.guix-profile/lib/bash/libguile-bash.so scm
1916@end example
1917
1918and then run @command{scm example.scm}.")
71e0f217 1919 (license license:gpl3+))))
a614ce38 1920
c5793e7e
CAW
1921(define-public guile-8sync
1922 (package
1923 (name "guile-8sync")
525acb6e 1924 (version "0.4.2")
c5793e7e
CAW
1925 (source (origin
1926 (method url-fetch)
1927 (uri (string-append "mirror://gnu/8sync/8sync-" version
1928 ".tar.gz"))
1929 (sha256
1930 (base32
525acb6e 1931 "031wm13srak3wsnll7j2mbbi29g1pcm4swdb71ds9yn567pn20qw"))))
c5793e7e
CAW
1932 (build-system gnu-build-system)
1933 (native-inputs `(("autoconf" ,autoconf)
1934 ("automake" ,automake)
f6396d86 1935 ("guile" ,guile-2.2)
c5793e7e
CAW
1936 ("pkg-config" ,pkg-config)
1937 ("texinfo" ,texinfo)))
1938 (arguments
1939 `(#:phases (modify-phases %standard-phases
1940 (add-before 'configure 'setenv
1941 (lambda _
1942 ;; quiet warnings
ab4a1731
CAW
1943 (setenv "GUILE_AUTO_COMPILE" "0")
1944 #t)))))
c5793e7e
CAW
1945 (home-page "https://gnu.org/s/8sync/")
1946 (synopsis "Asynchronous actor model library for Guile")
1947 (description
1948 "GNU 8sync (pronounced \"eight-sync\") is an asynchronous programming
1949library for GNU Guile based on the actor model.
1950
f6396d86 1951Note that 8sync is only available for Guile 2.2.")
71e0f217 1952 (license license:lgpl3+)))
c5793e7e 1953
aaf1bdc3
CAW
1954(define-public guile-fibers
1955 (package
1956 (name "guile-fibers")
1957 (version "1.0.0")
1958 (source (origin
1959 (method url-fetch)
1960 (uri (string-append "https://wingolog.org/pub/fibers/fibers-"
1961 version ".tar.gz"))
1962 (sha256
1963 (base32
1964 "0vjkg72ghgdgphzbjz9ig8al8271rq8974viknb2r1rg4lz92ld0"))))
1965 (build-system gnu-build-system)
1966 (native-inputs
1967 `(("texinfo" ,texinfo)
1968 ("pkg-config" ,pkg-config)))
1969 (inputs
f6396d86 1970 `(("guile" ,guile-2.2)))
aaf1bdc3
CAW
1971 (synopsis "Lightweight concurrency facility for Guile")
1972 (description
1973 "Fibers is a Guile library that implements a a lightweight concurrency
1974facility, inspired by systems like Concurrent ML, Go, and Erlang. A fiber is
1975like a \"goroutine\" from the Go language: a lightweight thread-like
1976abstraction. Systems built with Fibers can scale up to millions of concurrent
1977fibers, tens of thousands of concurrent socket connections, and many parallel
1978cores. The Fibers library also provides Concurrent ML-like channels for
1979communication between fibers.
1980
1981Note that Fibers makes use of some Guile 2.1/2.2-specific features and
1982is not available for Guile 2.0.")
1983 (home-page "https://github.com/wingo/fibers")
1984 (license license:lgpl3+)))
1985
bd233722 1986(define-public guile-git
576f245c
LC
1987 (let ((revision "6")
1988 (commit "36f93c174adc396c90ec3a6923487f0444fe5d69"))
bd233722
LC
1989 (package
1990 (name "guile-git")
1991 (version (string-append "0.0-" revision "." (string-take commit 7)))
dc03f32d 1992 (home-page "https://gitlab.com/guile-git/guile-git.git")
bd233722
LC
1993 (source (origin
1994 (method git-fetch)
1995 (uri (git-reference (url home-page) (commit commit)))
1996 (sha256
1997 (base32
576f245c 1998 "0z1dvn0scx59pbgjkpacam7p5n7630z4qm8fazim7ixq9xv3s8wx"))
bd233722
LC
1999 (file-name (git-file-name name version))))
2000 (build-system gnu-build-system)
2001 (arguments
44b0faee 2002 `(#:phases (modify-phases %standard-phases
44b0faee
LC
2003 ;; FIXME: On i686, bytestructures miscalculates the offset
2004 ;; of the 'old-file' and 'new-file' fields within the
576f245c
LC
2005 ;; '%diff-delta' structure. See
2006 ;; <https://github.com/TaylanUB/scheme-bytestructures/issues/30>.
44b0faee
LC
2007 ,@(if (string=? (%current-system) "x86_64-linux")
2008 '()
2009 '((add-before 'check 'skip-tests
2010 (lambda _
2011 (substitute* "Makefile"
2012 (("tests/status\\.scm")
2013 ""))
2014 #t)))))))
bd233722
LC
2015 (native-inputs
2016 `(("autoconf" ,autoconf)
2017 ("automake" ,automake)
3a537598 2018 ("texinfo" ,texinfo)
bd233722
LC
2019 ("pkg-config" ,pkg-config)))
2020 (inputs
aabece2e 2021 `(("guile" ,guile-2.2)
bd233722
LC
2022 ("libgit2" ,libgit2)))
2023 (propagated-inputs
2024 `(("guile-bytestructures" ,guile-bytestructures)))
2025 (synopsis "Guile bindings for libgit2")
2026 (description
2027 "This package provides Guile bindings to libgit2, a library to
2028manipulate repositories of the Git version control system.")
2029 (license license:gpl3+))))
c5793e7e 2030
70bc6085
LC
2031(define-public guile2.0-git
2032 (package-for-guile-2.0 guile-git))
2033
f252d6df 2034(define-public guile-syntax-highlight
3c90c7ae
DT
2035 (package
2036 (name "guile-syntax-highlight")
2037 (version "0.1")
2038 (source (origin
2039 (method url-fetch)
2040 (uri (string-append "https://files.dthompson.us/"
2041 "guile-syntax-highlight/"
2042 "guile-syntax-highlight-"
2043 version ".tar.gz"))
2044 (sha256
2045 (base32
2046 "1p771kq15x83483m23bhah1sz6vkalg3drm7x279f4j1cxligkzi"))))
2047 (build-system gnu-build-system)
2048 (native-inputs
2049 `(("pkg-config" ,pkg-config)))
2050 (inputs
2051 `(("guile" ,guile-2.2)))
8c72ed92
RW
2052 (synopsis "General-purpose syntax highlighter for GNU Guile")
2053 (description "Guile-syntax-highlight is a general-purpose syntax
f252d6df
DT
2054highlighting library for GNU Guile. It can parse code written in various
2055programming languages into a simple s-expression that can be converted to
2056HTML (via SXML) or any other format for rendering.")
3c90c7ae
DT
2057 (home-page "http://dthompson.us/projects/guile-syntax-highlight.html")
2058 (license license:lgpl3+)))
f252d6df 2059
d26ae96c
CAW
2060(define-public guile-sjson
2061 (package
2062 (name "guile-sjson")
a62a16a4 2063 (version "0.2.1")
d26ae96c
CAW
2064 (source (origin
2065 (method url-fetch)
2066 (uri (string-append "https://dustycloud.org/misc/sjson-" version
2067 ".tar.gz"))
2068 (sha256
2069 (base32
a62a16a4 2070 "1mzmapln79vv10qxaggz9qwcdbag3jnrj19xx8bgkmxss8h03sv3"))))
d26ae96c 2071 (build-system gnu-build-system)
d26ae96c
CAW
2072 (native-inputs
2073 `(("autoconf" ,autoconf)
2074 ("automake" ,automake)
2075 ("pkg-config" ,pkg-config)))
2076 (inputs
2077 `(("guile" ,guile-2.2)))
2078 (home-page "https://gitlab.com/dustyweb/guile-sjson")
2079 (synopsis "S-expression based json reader/writer for Guile")
2080 (description "guile-sjson is a json reader/writer for Guile.
2081It has a nice, simple s-expression based syntax.")
2082 (license license:lgpl3+)))
2083
e076d56a 2084(define-public guile-colorized
2085 (package
2086 (name "guile-colorized")
2087 (version "0.1")
2088 (source (origin
2089 (method url-fetch)
2090 (uri (string-append "https://github.com/NalaGinrut/guile-colorized/"
2091 "archive/v" version ".tar.gz"))
2092 (file-name (string-append name "-" version ".tar.gz"))
2093 (sha256
2094 (base32
2095 "16xhc3an6aglnca8xl3mvgi8hsqzqn68vsl5ga4bz8bvbap5fn4p"))))
2096 (build-system gnu-build-system)
2097 (arguments
2098 `(#:modules ((system base compile)
2099 ,@%gnu-build-system-modules)
2100 #:tests? #f ;No tests included
2101 #:phases
2102 (modify-phases %standard-phases
2103 (delete 'configure) ;No configure script
2104 (replace 'install
2105 (lambda* (#:key outputs inputs #:allow-other-keys)
2106 (let* ((out (assoc-ref outputs "out"))
2107 (module-dir (string-append out "/share/guile/site/2.2"))
2108 (language-dir (string-append module-dir "/ice-9"))
2109 (guild (string-append (assoc-ref inputs "guile")
2110 "/bin/guild")))
2111 ;; The original 'make install' is too primitive.
2112
2113 ;; copy the source
2114 (install-file "ice-9/colorized.scm" language-dir)
2115
2116 ;; compile to the destination
2117 (compile-file "ice-9/colorized.scm"
2118 #:output-file (string-append
2119 language-dir "/colorized.go"))
2120 #t))))))
2121 (inputs
2122 `(("guile" ,guile-2.2)))
2123 (home-page "https://github.com/NalaGinrut/guile-colorized")
2124 (synopsis "Colorized REPL for Guile")
2125 (description
2126 "Guile-colorized provides you with a colorized REPL for GNU Guile.")
2127 (license license:gpl3+)))
2128
f858e58f
PAR
2129(define-public guile-simple-zmq
2130 (let ((commit "d76657aeb1cd10ef8136edc06bb90999914c7c3c")
2131 (revision "0"))
2132 (package
2133 (name "guile-simple-zmq")
2134 (version (git-version "0.0.0" revision commit))
2135 (source
2136 (origin
2137 (method git-fetch)
2138 (uri (git-reference
2139 (url "https://github.com/jerry40/guile-simple-zmq")
2140 (commit commit)))
2141 (sha256
2142 (base32
2143 "1w73dy5gpyv33jn34dqlkqpwh9w4y8wm6hgvbpb3wbp6xsa2mk4z"))
2144 (file-name (git-file-name name version))))
2145 (build-system trivial-build-system)
2146 (arguments
2147 `(#:modules ((guix build utils))
2148 #:builder
2149 (begin
2150 (use-modules (guix build utils)
2151 (srfi srfi-26)
2152 (ice-9 match)
2153 (ice-9 popen)
2154 (ice-9 rdelim))
2155
2156 (let* ((out (assoc-ref %outputs "out"))
2157 (guile (assoc-ref %build-inputs "guile"))
2158 (effective (read-line
2159 (open-pipe* OPEN_READ
2160 (string-append guile "/bin/guile")
2161 "-c" "(display (effective-version))")))
2162 (module-dir (string-append out "/share/guile/site/"
2163 effective))
2164 (go-dir (string-append out "/lib/guile/"
2165 effective "/site-ccache/"))
2166 (source (string-append (assoc-ref %build-inputs "source")
2167 "/src"))
2168 (scm-file "simple-zmq.scm")
2169 (guild (string-append (assoc-ref %build-inputs "guile")
2170 "/bin/guild"))
2171 (zmq (assoc-ref %build-inputs "zeromq"))
2172 (deps (list zmq))
2173 (path (string-join
2174 (map (cut string-append <>
2175 "/lib/")
2176 deps)
2177 ":")))
2178 ;; Make installation directories.
2179 (mkdir-p module-dir)
2180 (mkdir-p go-dir)
2181
2182 ;; Compile .scm files and install.
2183 (chdir source)
2184 (setenv "GUILE_AUTO_COMPILE" "0")
2185 (for-each (lambda (file)
2186 (let* ((dest-file (string-append module-dir "/"
2187 file))
2188 (go-file (match (string-split file #\.)
2189 ((base _)
2190 (string-append go-dir "/"
2191 base ".go")))))
2192 ;; Install source module.
2193 (copy-file file dest-file)
2194 (substitute* dest-file
2195 (("\\(dynamic-link \"libzmq\"\\)")
2196 (format #f "(dynamic-link \"~a/lib/libzmq.so\")"
2197 (assoc-ref %build-inputs "zeromq"))))
2198
2199 ;; Install and compile module.
2200 (unless (zero? (system* guild "compile"
2201 "-L" source
2202 "-o" go-file
2203 dest-file))
2204 (error (format #f "Failed to compile ~s to ~s!"
2205 file go-file)))))
2206 (list scm-file))
2207 #t))))
2208 (propagated-inputs
2209 `(("guile" ,guile-2.2)
2210 ("zeromq" ,zeromq)))
2211 (home-page "https://github.com/jerry40/guile-simple-zmq")
2212 (synopsis "Guile wrapper over ZeroMQ library")
2213 (description
2214 "This package provides a Guile programming interface to the ZeroMQ
2215messaging library.")
2216 (license license:gpl3+))))
2217
fa6a3bb7
PAR
2218(define-public jupyter-guile-kernel
2219 (let ((commit "a5c5f3ea3215b65e770bcb62f71117b0ec4575ed")
2220 (revision "0"))
2221 (package
2222 (name "jupyter-guile-kernel")
2223 (version (git-version "0.0.0" revision commit))
2224 (source
2225 (origin
2226 (method git-fetch)
2227 (uri (git-reference
2228 (url "https://github.com/jerry40/guile-kernel")
2229 (commit commit)))
2230 (sha256
2231 (base32
2232 "0y5jr0f0dyskvsawqbf6n0bpg8jirw4mhqbarf2a6p9lxhqha9s9"))))
2233 (build-system trivial-build-system)
2234 (arguments
2235 `(#:modules ((guix build utils))
2236 #:builder
2237 (begin
2238 (use-modules (guix build utils)
2239 (srfi srfi-26)
2240 (ice-9 match)
2241 (ice-9 popen)
2242 (ice-9 rdelim))
2243
2244 (let* ((out (assoc-ref %outputs "out"))
2245 (guile (assoc-ref %build-inputs "guile"))
2246 (effective (read-line
2247 (open-pipe* OPEN_READ
2248 (string-append guile "/bin/guile")
2249 "-c" "(display (effective-version))")))
2250 (module-dir (string-append out "/share/guile/site/"
2251 effective))
2252 (kernel-dir (string-append out "/share/jupyter/kernels/guile"))
2253 (go-dir (string-append out "/lib/guile/"
2254 effective
2255 "/site-ccache"))
2256 (source (string-append (assoc-ref %build-inputs "source")
2257 "/src"))
2258 (scm-files '("hmac.scm"
2259 "tools.scm"
2260 "guile-jupyter-kernel.scm"))
2261 (kernel-file "kernel.json")
2262 (guild (string-append (assoc-ref %build-inputs "guile")
2263 "/bin/guild"))
2264 (g-szmq (assoc-ref %build-inputs "guile-simple-zmq"))
2265 (json (assoc-ref %build-inputs "guile-json"))
2266 (deps (list g-szmq json))
2267 (path (string-join
2268 (map (cut string-append <>
2269 "/share/guile/site/"
2270 effective)
2271 deps)
2272 ":"))
2273 (gopath (string-join
2274 (map (cut string-append <>
2275 "/lib/guile/" effective
2276 "/site-ccache/")
2277 deps)
2278 ":")))
2279
2280 ;; Make installation directories.
2281 (mkdir-p module-dir)
2282 (mkdir-p kernel-dir)
2283 (mkdir-p go-dir)
2284
2285 ;; Make a writable copy of SOURCE.
2286 (copy-recursively source ".")
2287
2288 ;; Record the absolute file name of the 'openssl' command.
2289 (substitute* "hmac.scm"
2290 (("openssl")
2291 (string-append (assoc-ref %build-inputs "openssl")
2292 "/bin/openssl")))
2293
2294 ;; Compile .scm files and install.
2295 (setenv "GUILE_AUTO_COMPILE" "0")
2296 (setenv "GUILE_LOAD_PATH" path)
2297 (setenv "GUILE_LOAD_COMPILED_PATH" gopath)
2298
2299 (for-each (lambda (file)
2300 (let* ((dest-file (string-append module-dir "/"
2301 file))
2302 (go-file (match (string-split file #\.)
2303 ((base _)
2304 (string-append go-dir "/"
2305 base ".go")))))
2306 ;; Install source module.
2307 (copy-file file dest-file)
2308
2309 ;; Install compiled module.
2310 (unless (zero? (system* guild "compile"
2311 "-L" source
2312 "-o" go-file
2313 file))
2314 (error (format #f "Failed to compile ~s to ~s!"
2315 file go-file)))))
2316 scm-files)
2317
2318 ;; Install kernel
2319 (copy-file kernel-file (string-append kernel-dir "/"
2320 kernel-file))
2321 ;; Fix hard-coded file name in the kernel
2322 (substitute* (string-append kernel-dir "/"
2323 kernel-file)
2324 (("/home/jerry/.local/share/jupyter/kernels/guile/guile-jupyter-kernel.scm")
2325 (string-append module-dir "/guile-jupyter-kernel.scm"))
2326 (("\"guile\"")
2327 (string-append "\"" (assoc-ref %build-inputs "guile")
2328 "/bin/guile\""))
2329 (("-s")
2330 (string-append "--no-auto-compile\", \"-s")))
2331
2332 #t))))
2333 (inputs
2334 `(("openssl" ,openssl)
2335 ("guile" ,guile-2.2)))
2336 (propagated-inputs
2337 `(("guile-json" ,guile-json)
2338 ("guile-simple-zmq" ,guile-simple-zmq)))
2339 (synopsis "Guile kernel for the Jupyter Notebook")
2340 (description
2341 "This package provides a Guile 2.x kernel for the Jupyter Notebook. It
2342allows users to interact with the Guile REPL through Jupyter.")
2343 (home-page "https://github.com/jerry40/guile-kernel")
2344 (license license:gpl3+))))
2345
89f8c2ac
RJ
2346(define-public guile-sparql
2347 (package
2348 (name "guile-sparql")
2349 (version "0.0.7")
2350 (source (origin
2351 (method url-fetch)
2352 (uri (string-append
2353 "https://github.com/roelj/guile-sparql/releases/download/"
2354 version "/guile-sparql-" version ".tar.gz"))
2355 (sha256
2356 (base32 "1drnvhsgl0gc5crmb16yyw1j98nkhwwcgssv9vgm36ng43nnzffd"))))
2357 (build-system gnu-build-system)
2358 (arguments `(#:tests? #f)) ; There are no tests.
2359 (native-inputs
2360 `(("pkg-config" ,pkg-config)))
2361 (inputs
2362 `(("guile" ,guile-2.2)))
2363 (home-page "https://github.com/roelj/guile-sparql")
2364 (synopsis "SPARQL module for Guile")
2365 (description "This package provides the functionality to query a SPARQL
2366endpoint. Additionally, it provides an interface to write SPARQL queries
2367using S-expressions.")
2368 (license license:gpl3+)))
2369
1722d680 2370;;; guile.scm ends here