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