gnu: readline: support mingw.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
d9f0788a 2;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
b515822d 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
6bc24063 4;;; Copyright © 2015 Christopher Allan Webber <cwebber@dustycloud.org>
44a2bdf8 5;;; Copyright © 2016 Alex Sassmannshausen <alex@pompo.co>
daeb61f7 6;;; Copyright © 2016 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>
bd9af610 9;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
8a666bc5 10;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
3b5783fc 11;;; Copyright © 2016 Amirouche <amirouche@hypermove.net>
1722d680 12;;;
233e7676 13;;; This file is part of GNU Guix.
1722d680 14;;;
233e7676 15;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
233e7676 20;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
233e7676 26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 27
1ffa7090 28(define-module (gnu packages guile)
4a44e743 29 #:use-module (guix licenses)
59a43334 30 #:use-module (gnu packages)
472fc855 31 #:use-module (gnu packages aspell)
9c782445 32 #:use-module (gnu packages bash)
1ffa7090
LC
33 #:use-module (gnu packages bdw-gc)
34 #:use-module (gnu packages gawk)
35 #:use-module (gnu packages gperf)
36 #:use-module (gnu packages libffi)
37 #:use-module (gnu packages autotools)
f906d30c 38 #:use-module (gnu packages flex)
1ffa7090 39 #:use-module (gnu packages libunistring)
7119cca8 40 #:use-module (gnu packages linux)
1ffa7090
LC
41 #:use-module (gnu packages m4)
42 #:use-module (gnu packages multiprecision)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages readline)
ef02e1e9 45 #:use-module (gnu packages ncurses)
87d836b2 46 #:use-module (gnu packages ed)
ce0614dd 47 #:use-module (gnu packages base)
f906d30c 48 #:use-module (gnu packages texinfo)
01497dfe 49 #:use-module (gnu packages man)
f906d30c 50 #:use-module (gnu packages gettext)
b416aadf 51 #:use-module (gnu packages databases)
9d373377 52 #:use-module (gnu packages python)
5649c8cd
DT
53 #:use-module (gnu packages gl)
54 #:use-module (gnu packages sdl)
55 #:use-module (gnu packages maths)
56 #:use-module (gnu packages image)
bd9af610
AK
57 #:use-module (gnu packages xdisorg)
58 #:use-module (gnu packages xorg)
1722d680 59 #:use-module (guix packages)
87f5d366 60 #:use-module (guix download)
6bc24063 61 #:use-module (guix git-download)
32795fcf 62 #:use-module (guix build-system gnu)
6bc24063 63 #:use-module (guix build-system trivial)
32795fcf
LC
64 #:use-module (guix utils)
65 #:use-module (ice-9 match))
1722d680
LC
66
67;;; Commentary:
68;;;
c44899a2 69;;; GNU Guile, and modules and extensions.
1722d680
LC
70;;;
71;;; Code:
72
c44899a2
LC
73(define-public guile-1.8
74 (package
75 (name "guile")
76 (version "1.8.8")
77 (source (origin
87f5d366 78 (method url-fetch)
0db342a5 79 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
80 ".tar.gz"))
81 (sha256
82 (base32
01eafd38 83 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
fc1adab1 84 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
c44899a2
LC
85 (build-system gnu-build-system)
86 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
87
88 ;; Insert a phase before `configure' to patch things up.
89 #:phases (alist-cons-before
90 'configure
2f4fbe1c 91 'patch-stuff
c44899a2
LC
92 (lambda* (#:key outputs #:allow-other-keys)
93 ;; Add a call to `lt_dladdsearchdir' so that
94 ;; `libguile-readline.so' & co. are in the
95 ;; loader's search path.
96 (substitute* "libguile/dynl.c"
2f4fbe1c
LC
97 (("lt_dlinit.*$" match)
98 (format #f
99 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
100 match
101 (assoc-ref outputs "out"))))
102
103 ;; The usual /bin/sh...
104 (substitute* "ice-9/popen.scm"
105 (("/bin/sh") (which "sh"))))
c44899a2 106 %standard-phases)))
01eafd38 107 (inputs `(("gawk" ,gawk)
c44899a2
LC
108 ("readline" ,readline)))
109
110 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
111 ;; propagated.
112 (propagated-inputs `(("gmp" ,gmp)
be11b102 113 ("libltdl" ,libltdl)))
c44899a2
LC
114
115 ;; When cross-compiling, a native version of Guile itself is needed.
116 (self-native-input? #t)
117
9be8d7c8
LC
118 (native-search-paths
119 (list (search-path-specification
120 (variable "GUILE_LOAD_PATH")
af070955 121 (files '("share/guile/site")))))
9be8d7c8 122
f50d2669 123 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 124 (description
a22dc0c4
LC
125 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
126official extension language of the GNU system. It is an implementation of
127the Scheme language which can be easily embedded in other applications to
128provide a convenient means of extending the functionality of the application
129without requiring the source code to be rewritten.")
c44899a2 130 (home-page "http://www.gnu.org/software/guile/")
4a44e743 131 (license lgpl2.0+)))
c44899a2
LC
132
133(define-public guile-2.0
134 (package
135 (name "guile")
7f9c8970 136 (version "2.0.12")
c62a31ca 137 (replacement guile-2.0.13) ;CVE-2016-8606 and CVE-2016-8605
c44899a2 138 (source (origin
87f5d366 139 (method url-fetch)
0db342a5 140 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
141 ".tar.xz"))
142 (sha256
143 (base32
923d9caa 144 "1sdpjq0jf1h65w29q0zprj4x6kdp5jskkvbnlwphy9lvdxrqg0fy"))))
c44899a2
LC
145 (build-system gnu-build-system)
146 (native-inputs `(("pkgconfig" ,pkg-config)))
147 (inputs `(("libffi" ,libffi)
9c782445 148 ("readline" ,readline)
cba95006 149 ("bash" ,bash)))
c44899a2
LC
150
151 (propagated-inputs
152 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
153 ;; reads `-lltdl -lunistring', adding them here will add the needed
154 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
155 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
156 ("libunistring" ,libunistring)
be11b102
LC
157
158 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
159 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
160 ("libltdl" ,libltdl)
c44899a2
LC
161
162 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
163 ;; must be propagated.
bda1bc6c 164 ("bdw-gc" ,libgc)
c44899a2
LC
165 ("gmp" ,gmp)))
166
167 (self-native-input? #t)
168
9bf62d9b
LC
169 (outputs '("out" "debug"))
170
8ffaa93b 171 (arguments
b5e0c870
LC
172 `(#:configure-flags '("--disable-static") ;saves 3MiB
173 #:phases (alist-cons-before
8ffaa93b
LC
174 'configure 'pre-configure
175 (lambda* (#:key inputs #:allow-other-keys)
58b4e8e8 176 ;; Tell (ice-9 popen) the file name of Bash.
8ffaa93b
LC
177 (let ((bash (assoc-ref inputs "bash")))
178 (substitute* "module/ice-9/popen.scm"
179 (("/bin/sh")
180 (string-append bash "/bin/bash")))))
db619089 181 %standard-phases)))
8ffaa93b 182
9be8d7c8
LC
183 (native-search-paths
184 (list (search-path-specification
185 (variable "GUILE_LOAD_PATH")
af070955 186 (files '("share/guile/site/2.0")))
9be8d7c8
LC
187 (search-path-specification
188 (variable "GUILE_LOAD_COMPILED_PATH")
ca408580 189 (files '("lib/guile/2.0/site-ccache"
05f1e956 190 "share/guile/site/2.0")))))
9be8d7c8 191
f50d2669 192 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 193 (description
a22dc0c4
LC
194 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
195official extension language of the GNU system. It is an implementation of
196the Scheme language which can be easily embedded in other applications to
197provide a convenient means of extending the functionality of the application
198without requiring the source code to be rewritten.")
c44899a2 199 (home-page "http://www.gnu.org/software/guile/")
4a44e743 200 (license lgpl3+)))
c44899a2 201
fa29b199
LC
202(define-public guile-2.0/fixed
203 ;; A package of Guile 2.0 that's rarely changed. It is the one used
204 ;; in the `base' module, and thus changing it entails a full rebuild.
c62a31ca
LC
205 (package
206 (inherit guile-2.0)
207 (properties '((hidden? . #t))) ;people should install 'guile-2.0'
208 (replacement #f)))
209
210(define guile-2.0.13
211 (package
212 (inherit guile-2.0)
213 (version "2.0.13")
214 (source (origin
215 (method url-fetch)
216 (uri (string-append "mirror://gnu/guile/guile-" version
217 ".tar.xz"))
218 (sha256
219 (base32
8134dc1f
LC
220 "12yqkr974y91ylgw6jnmci2v90i90s7h9vxa4zk0sai8vjnz4i1p"))
221 (patches (search-patches "guile-repl-server-test.patch"))))))
fa29b199 222
be3feafe 223(define-public guile-next
f906d30c 224 (package (inherit guile-2.0)
be3feafe 225 (name "guile-next")
ddda5338 226 (version "2.1.4")
c62a31ca 227 (replacement #f)
4eae7980
LC
228 (source (origin
229 (method url-fetch)
230 (uri (string-append "ftp://alpha.gnu.org/gnu/guile/guile-"
231 version ".tar.xz"))
232 (sha256
233 (base32
ddda5338 234 "1w8kyy8nz6489d092fix6lvgjrk0bww7i0c2k67ym4hq0kjl0r1j"))
d9f0788a
LC
235 (modules '((guix build utils)))
236
237 ;; Remove the pre-built object files. Instead, build everything
238 ;; from source, at the expense of significantly longer build
239 ;; times (almost 3 hours on a 4-core Intel i5).
240 (snippet '(for-each delete-file
241 (find-files "prebuilt" "\\.go$")))))
dd90ed89 242 (synopsis "Snapshot of what will become version 2.2 of GNU Guile")
7f43ff96 243 (properties '((timeout . 72000))) ; 20 hours
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
947a5d47
LC
253(define (guile-2.2-package-name name)
254 "Return NAME with a \"guile2.2-\" prefix instead of \"guile-\", when
255applicable."
256 (if (string-prefix? "guile-" name)
257 (string-append "guile2.2-"
258 (string-drop name
259 (string-length "guile-")))
260 name))
261
262(define package-for-guile-2.2
263 ;; A procedure that rewrites the dependency tree of the given package to use
264 ;; GUILE-NEXT instead of GUILE-2.0.
265 (package-input-rewriting `((,guile-2.0 . ,guile-next))
266 guile-2.2-package-name))
267
4eae7980
LC
268(define-public guile-for-guile-emacs
269 (package (inherit guile-next)
270 (name "guile-for-guile-emacs")
271 (version "20150510.d8d9a8d")
f906d30c
CAW
272 (source (origin
273 (method git-fetch)
274 (uri (git-reference
4eae7980
LC
275 (url "git://git.hcoop.net/git/bpt/guile.git")
276 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
f906d30c
CAW
277 (sha256
278 (base32
4eae7980 279 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
f906d30c
CAW
280 (arguments
281 (substitute-keyword-arguments `(;; Tests aren't passing for now.
282 ;; Obviously we should re-enable this!
283 #:tests? #f
4eae7980 284 ,@(package-arguments guile-next))
f906d30c
CAW
285 ((#:phases phases)
286 `(modify-phases ,phases
287 (add-after 'unpack 'autogen
288 (lambda _
289 (zero? (system* "sh" "autogen.sh"))))
290 (add-before 'autogen 'patch-/bin/sh
291 (lambda _
292 (substitute* "build-aux/git-version-gen"
293 (("#!/bin/sh") (string-append "#!" (which "sh"))))
294 #t))))))
295 (native-inputs
296 `(("autoconf" ,autoconf)
297 ("automake" ,automake)
298 ("libtool" ,libtool)
299 ("flex" ,flex)
300 ("texinfo" ,texinfo)
b94a6ca0 301 ("gettext" ,gettext-minimal)
daeb61f7
RW
302 ,@(package-native-inputs guile-next)))
303 ;; Same as in guile-2.0
304 (native-search-paths
305 (list (search-path-specification
306 (variable "GUILE_LOAD_PATH")
307 (files '("share/guile/site/2.0")))
308 (search-path-specification
309 (variable "GUILE_LOAD_COMPILED_PATH")
31769b9f 310 (files '("lib/guile/2.0/site-ccache"
daeb61f7 311 "share/guile/site/2.0")))))))
be3feafe 312
c44899a2
LC
313\f
314;;;
315;;; Extensions.
316;;;
317
7119cca8
ML
318(define-public artanis
319 (package
320 (name "artanis")
c84ceace 321 (version "0.1.2")
7119cca8
ML
322 (source (origin
323 (method url-fetch)
324 (uri (string-append "ftp://alpha.gnu.org/gnu/artanis/artanis-"
325 version ".tar.gz"))
326 (sha256
327 (base32
8a666bc5
AFN
328 "19m3ak12cqk8js9d2mdg11kh4fjsq8frfpd10qw75h0zpr5cywpp"))
329 (patches (search-patches "artanis-fix-Makefile.in.patch"))))
7119cca8
ML
330 (build-system gnu-build-system)
331 ;; TODO: Add guile-dbi and guile-dbd optional dependencies.
332 (inputs `(("guile" ,guile-2.0)))
333 (native-inputs `(("bash" ,bash) ;for the `source' builtin
334 ("pkgconfig" ,pkg-config)
335 ("util-linux" ,util-linux))) ;for the `script' command
336 (arguments
337 '(#:make-flags
338 ;; TODO: The documentation must be built with the `docs' target.
339 (let* ((out (assoc-ref %outputs "out"))
340 (dir (string-append out "/share/guile/site/2.0")))
341 ;; Don't use (%site-dir) for site paths.
342 (list (string-append "MOD_PATH=" dir)
8a666bc5 343 (string-append "MOD_COMPILED_PATH=" dir)))
7119cca8
ML
344 #:test-target "test"
345 #:phases
346 (modify-phases %standard-phases
347 (add-before
348 'install 'substitute-root-dir
349 (lambda* (#:key outputs #:allow-other-keys)
350 (let ((out (assoc-ref outputs "out")))
351 (substitute* "Makefile" ;ignore the execution of bash.bashrc
352 ((" /etc/bash.bashrc") " /dev/null"))
353 (substitute* "Makefile" ;set the root of config files to OUT
354 ((" /etc") (string-append " " out "/etc")))
355 (mkdir-p (string-append out "/bin")) ;for the `art' executable
356 #t))))))
357 (synopsis "Web application framework written in Guile")
358 (description "GNU Artanis is a web application framework written in Guile
359Scheme. A web application framework (WAF) is a software framework that is
360designed to support the development of dynamic websites, web applications, web
361services and web resources. The framework aims to alleviate the overhead
362associated with common activities performed in web development. Artanis
363provides several tools for web development: database access, templating
364frameworks, session management, URL-remapping for RESTful, page caching, and
365more.")
366 (home-page "https://www.gnu.org/software/artanis/")
367 (license (list gpl3+ lgpl3+)))) ;dual license
368
d6d9f1f7 369(define-public guile-reader
1722d680 370 (package
d6d9f1f7 371 (name "guile-reader")
ad29c6f2 372 (version "0.6.1")
d6d9f1f7
LC
373 (source (origin
374 (method url-fetch)
375 (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
376 version ".tar.gz"))
377 (sha256
378 (base32
ad29c6f2 379 "020wz5w8z6g79nbqifg2n496wxwkcjzh8xizpv6mz0hczpl155ma"))))
d6d9f1f7
LC
380 (build-system gnu-build-system)
381 (native-inputs `(("pkgconfig" ,pkg-config)
382 ("gperf" ,gperf)))
383 (inputs `(("guile" ,guile-2.0)))
ad29c6f2 384 (arguments `(#:configure-flags
d6d9f1f7
LC
385 (let ((out (assoc-ref %outputs "out")))
386 (list (string-append "--with-guilemoduledir="
387 out "/share/guile/site/2.0")))))
388 (synopsis "Framework for building readers for GNU Guile")
389 (description
390 "Guile-Reader is a simple framework for building readers for GNU Guile.
1722d680
LC
391
392The idea is to make it easy to build procedures that extend Guile’s read
35b9e423 393procedure. Readers supporting various syntax variants can easily be written,
1722d680 394possibly by re-using existing “token readers” of a standard Scheme
35b9e423 395readers. For example, it is used to implement Skribilo’s R5RS-derived
1722d680
LC
396document syntax.
397
398Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
399hopefully more powerful and flexible (for instance, one may instantiate as
400many readers as needed).")
d6d9f1f7
LC
401 (home-page "http://www.nongnu.org/guile-reader/")
402 (license gpl3+)))
1722d680 403
ef02e1e9
LC
404(define-public guile-ncurses
405 (package
406 (name "guile-ncurses")
d81850d4 407 (version "2.1")
ef02e1e9
LC
408 (source (origin
409 (method url-fetch)
410 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
411 version ".tar.gz"))
412 (sha256
413 (base32
d81850d4 414 "1h7rnq4g7xlxxybcb3vjq6nscm9zhlmfaxb7258c8ax7him4azg6"))))
ef02e1e9
LC
415 (build-system gnu-build-system)
416 (inputs `(("ncurses" ,ncurses)
417 ("guile" ,guile-2.0)))
0881b616 418 (native-inputs `(("pkg-config" ,pkg-config)))
ef02e1e9 419 (arguments
2c6b7c7d 420 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
0881b616 421 "--with-gnu-filesystem-hierarchy")
fa37f21b
EF
422 #:phases
423 (modify-phases %standard-phases
424 (add-after 'install 'post-install
425 (lambda* (#:key outputs #:allow-other-keys)
426 (let* ((out (assoc-ref outputs "out"))
427 (dir (string-append out "/share/guile/site/"))
428 (files (find-files dir ".scm")))
429 (substitute* files
430 (("\"libguile-ncurses\"")
0881b616 431 (format #f "\"~a/lib/guile/2.0/libguile-ncurses\""
d81850d4
EF
432 out)))
433 #t))))))
434 (home-page "https://www.gnu.org/software/guile-ncurses/")
f50d2669 435 (synopsis "Guile bindings to ncurses")
ef02e1e9 436 (description
12bcf94a 437 "guile-ncurses provides Guile language bindings for the ncurses
79c311b8 438library.")
ef02e1e9
LC
439 (license lgpl3+)))
440
87d836b2
LC
441(define-public mcron
442 (package
443 (name "mcron")
d12c626c 444 (version "1.0.8")
87d836b2
LC
445 (source (origin
446 (method url-fetch)
447 (uri (string-append "mirror://gnu/mcron/mcron-"
448 version ".tar.gz"))
449 (sha256
450 (base32
d12c626c 451 "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b"))
fc1adab1 452 (patches (search-patches "mcron-install.patch"))))
87d836b2 453 (build-system gnu-build-system)
b6c18d6a
LC
454 (native-inputs `(("pkg-config" ,pkg-config)))
455 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0)))
87d836b2 456 (home-page "http://www.gnu.org/software/mcron/")
f50d2669 457 (synopsis "Run jobs at scheduled times")
87d836b2 458 (description
79c311b8 459 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
a22dc0c4 460tasks on a schedule, such as every hour or every Monday. Mcron is written in
79c311b8
LC
461Guile, so its configuration can be written in Scheme; the original cron
462format is also supported.")
87d836b2
LC
463 (license gpl3+)))
464
01497dfe
LC
465(define-public mcron2
466 ;; This is mthl's mcron development branch, not yet merged in mcron.
467 (let ((commit "31baff1a5187d8ddc89324cbe42dbeffc309c962"))
468 (package
469 (inherit mcron)
470 (name "mcron2")
471 (version (string-append (package-version mcron) "-0."
472 (string-take commit 7)))
473 (source (origin
474 (method git-fetch)
475 (uri (git-reference
476 (url "https://notabug.org/mthl/mcron/")
477 (commit commit)))
478 (sha256
479 (base32
480 "1h5wxy997hxi718hpx419c23q09939kbxrjbbq54lv0cgw1bb63z"))
481 (file-name (string-append name "-" version "-checkout"))))
482 (native-inputs
483 `(("autoconf" ,autoconf)
484 ("automake" ,automake)
485 ("pkg-config" ,pkg-config)
486 ("texinfo" ,texinfo)
487 ("help2man" ,help2man)))
488 (arguments
489 `(#:modules ((ice-9 match) (ice-9 ftw)
490 ,@%gnu-build-system-modules)
491
492 #:phases (modify-phases %standard-phases
493 (add-after 'unpack 'bootstrap
494 (lambda _
495 (zero? (system* "autoreconf" "-vfi"))))
496 (add-after 'install 'wrap-mcron
497 (lambda* (#:key outputs #:allow-other-keys)
498 ;; Wrap the 'mcron' command to refer to the right
499 ;; modules.
500 (let* ((out (assoc-ref outputs "out"))
501 (bin (string-append out "/bin"))
502 (site (string-append
503 out "/share/guile/site")))
504 (match (scandir site)
505 (("." ".." version)
506 (let ((modules (string-append site "/" version)))
507 (wrap-program (string-append bin "/mcron")
508 `("GUILE_LOAD_PATH" ":" prefix
509 (,modules))
510 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
511 (,modules)))
512 #t))))))))))))
513
3e9066fc
LC
514(define-public guile-lib
515 (package
516 (name "guile-lib")
bf62b8ff 517 (version "0.2.3")
3e9066fc
LC
518 (source (origin
519 (method url-fetch)
520 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
521 version ".tar.gz"))
522 (sha256
523 (base32
bf62b8ff 524 "0pwdd52vakni1fabaiav8v0ad7xp3bx8x3brijbr1mpgamm9dxqc"))))
3e9066fc
LC
525 (build-system gnu-build-system)
526 (arguments
9d356c9c
LC
527 '(#:phases (modify-phases %standard-phases
528 (add-before 'configure 'patch-module-dir
529 (lambda _
530 (substitute* "src/Makefile.in"
bf62b8ff
LC
531 (("^moddir = ([[:graph:]]+)")
532 "moddir = $(datadir)/guile/site/@GUILE_EFFECTIVE_VERSION@\n")
533 (("^godir = ([[:graph:]]+)")
534 "godir = \
535$(libdir)/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n"))
536 #t))
537 (replace 'check
538 (lambda _
539 ;; Work around a harmless test failure involving
540 ;; two-spaces-after-period rendering.
541 (zero? (system* "make" "check" ;"-C" "unit-tests"
542 "XFAIL_TESTS=texinfo.serialize.scm")))))))
543 (native-inputs `(("pkg-config" ,pkg-config)))
3e9066fc
LC
544 (inputs `(("guile" ,guile-2.0)))
545 (home-page "http://www.nongnu.org/guile-lib/")
546 (synopsis "Collection of useful Guile Scheme modules")
547 (description
35b9e423 548 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
3e9066fc
LC
549modules, allowing for people to cooperate integrating their generic Guile
550modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
551for Guile\".")
552
553 ;; The whole is under GPLv3+, but some modules are under laxer
554 ;; distribution terms such as LGPL and public domain. See `COPYING' for
555 ;; details.
556 (license gpl3+)))
557
6050a1fb
CR
558(define-public guile-json
559 (package
560 (name "guile-json")
1644f0cd 561 (version "0.5.0")
6050a1fb 562 (source (origin
ffc72ec6
LC
563 (method url-fetch)
564 (uri (string-append "mirror://savannah/guile-json/guile-json-"
565 version ".tar.gz"))
566 (sha256
567 (base32
568 "0l8a34l92nrdszy7ykycfvr8y0n0yi5qb3ccliycvpvf9mzk5n8d"))
569 (modules '((guix build utils)))
570 (snippet
571 ;; Make sure everything goes under .../site/X.Y, like Guile's
572 ;; search paths expects.
573 '(begin
574 (substitute* "configure"
575 (("ac_subst_vars='")
576 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
577 (substitute* '("Makefile.in" "json/Makefile.in")
578 (("moddir =.*/share/guile/site" all)
579 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))))))
6050a1fb 580 (build-system gnu-build-system)
db5584dd 581 (native-inputs `(("guile" ,guile-2.0)))
6050a1fb
CR
582 (home-page "http://savannah.nongnu.org/projects/guile-json/")
583 (synopsis "JSON module for Guile")
584 (description
585 "Guile-json supports parsing and building JSON documents according to the
35b9e423 586http:://json.org specification. These are the main features:
6050a1fb
CR
587- Strictly complies to http://json.org specification.
588- Build JSON documents programmatically via macros.
589- Unicode support for strings.
590- Allows JSON pretty printing.")
591 (license lgpl3+)))
592
947a5d47
LC
593(define-public guile2.2-json
594 (package-for-guile-2.2 guile-json))
595
6bc24063
CAW
596(define-public guile-minikanren
597 (package
598 (name "guile-minikanren")
599 (version "20150424.e844d85")
600 (source (origin
601 (method git-fetch)
602 (uri (git-reference
603 (url "https://github.com/ijp/minikanren.git")
604 (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
821f4dc2 605 (file-name (string-append name "-" version "-checkout"))
6bc24063
CAW
606 (sha256
607 (base32
608 "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
609 (build-system trivial-build-system)
610 (arguments
4b74a29d 611 `(#:modules ((guix build utils))
6bc24063
CAW
612 #:builder
613 (begin
614 (use-modules (guix build utils)
4b74a29d
LC
615 (ice-9 match)
616 (ice-9 popen)
617 (ice-9 rdelim))
618
6bc24063 619 (let* ((out (assoc-ref %outputs "out"))
4b74a29d
LC
620 (guile (assoc-ref %build-inputs "guile"))
621 (effective (read-line
622 (open-pipe* OPEN_READ
623 (string-append guile "/bin/guile")
624 "-c" "(display (effective-version))")))
625 (module-dir (string-append out "/share/guile/site/"
626 effective))
6bc24063 627 (source (assoc-ref %build-inputs "source"))
f3d8cd79 628 (doc (string-append out "/share/doc/guile-minikanren"))
6bc24063
CAW
629 (scm-files '("minikanren.scm"
630 "minikanren/mkextraforms.scm"
631 "minikanren/mkprelude.scm"
632 "minikanren/mk.scm"))
633 (guild (string-append (assoc-ref %build-inputs "guile")
634 "/bin/guild")))
635 ;; Make installation directories.
636 (mkdir-p (string-append module-dir "/minikanren"))
637 (mkdir-p doc)
638
639 ;; Compile .scm files and install.
640 (chdir source)
641 (setenv "GUILE_AUTO_COMPILE" "0")
642 (for-each (lambda (file)
643 (let* ((dest-file (string-append module-dir "/"
76e6e663 644 file))
6bc24063
CAW
645 (go-file (match (string-split file #\.)
646 ((base _)
647 (string-append module-dir "/"
648 base ".go")))))
649 ;; Install source module.
650 (copy-file file dest-file)
651 ;; Install compiled module.
652 (unless (zero? (system* guild "compile"
653 "-L" source
654 "-o" go-file
655 file))
656 (error (format #f "Failed to compile ~s to ~s!"
657 file go-file)))))
658 scm-files)
659
660 ;; Also copy over the README.
96c46210 661 (install-file "README.org" doc)
6bc24063
CAW
662 #t))))
663 (inputs
664 `(("guile" ,guile-2.0)))
665 (home-page "https://github.com/ijp/minikanren")
e881752c 666 (synopsis "MiniKanren declarative logic system, packaged for Guile")
6bc24063
CAW
667 (description
668 "MiniKanren is a relational programming extension to the Scheme
669programming Language, written as a smaller version of Kanren suitable for
670pedagogical purposes. It is featured in the book, The Reasoned Schemer,
671written by Dan Friedman, William Byrd, and Oleg Kiselyov.
672
e881752c 673This is Ian Price's r6rs packaged version of miniKanren, which deviates
6bc24063
CAW
674slightly from miniKanren mainline.
675
676See http://minikanren.org/ for more on miniKanren generally.")
677 (license expat)))
678
947a5d47
LC
679(define-public guile2.2-minikanren
680 (package-for-guile-2.2 guile-minikanren))
681
32e14fc1
CAW
682(define-public guile-irregex
683 (package
684 (name "guile-irregex")
d03f9446 685 (version "0.9.4")
32e14fc1
CAW
686 (source (origin
687 (method url-fetch)
688 (uri (string-append
689 "http://synthcode.com/scheme/irregex/irregex-"
d03f9446 690 version ".tar.gz"))
32e14fc1
CAW
691 (sha256
692 (base32
d03f9446 693 "0cmaqvqvyarcnnsyrl2p6vwyv1r3k1q7qw8p9zrlnz1vpbj7vb90"))))
32e14fc1
CAW
694 (build-system gnu-build-system)
695 (arguments
696 `(#:modules ((guix build utils)
697 (ice-9 match)
fe447664
LC
698 (ice-9 rdelim)
699 (ice-9 popen)
32e14fc1
CAW
700 (guix build gnu-build-system))
701 #:phases
702 (modify-phases %standard-phases
32e14fc1
CAW
703 (delete 'configure)
704 (delete 'build)
705 (delete 'check)
706 (replace 'install
707 (lambda* (#:key inputs outputs #:allow-other-keys)
fe447664
LC
708 (let* ((out (assoc-ref outputs "out"))
709 (effective (read-line
710 (open-pipe* OPEN_READ
711 "guile" "-c"
712 "(display (effective-version))")))
713 (module-dir (string-append out "/share/guile/site/"
714 effective))
715 (source (assoc-ref inputs "source"))
716 (doc (string-append out "/share/doc/guile-irregex/"))
717 (guild (string-append (assoc-ref %build-inputs "guile")
718 "/bin/guild")))
719 ;; Make installation directories.
720 (mkdir-p (string-append module-dir "/rx/source"))
721 (mkdir-p doc)
722
723 ;; Compile .scm files and install.
724 (setenv "GUILE_AUTO_COMPILE" "0")
725
726 (for-each (lambda (copy-info)
727 (match copy-info
728 ((src-file dest-file-basis)
729 (let* ((dest-file (string-append
32e14fc1 730 module-dir dest-file-basis
fe447664
LC
731 ".scm"))
732 (go-file (string-append
733 module-dir dest-file-basis
734 ".go")))
735 ;; Install source module.
736 (copy-file src-file
737 dest-file)
738 ;; Install compiled module.
739 (unless (zero? (system* guild "compile"
740 "-L" (getcwd)
741 "-o" go-file
742 src-file))
743 (error (format #f "Failed to compile ~s to ~s!"
744 src-file dest-file)))))))
745 '(("irregex-guile.scm" "/rx/irregex")
746 ("irregex.scm" "/rx/source/irregex")
747 ;; Not really reachable via guile's packaging system,
748 ;; but nice to have around
749 ("irregex-utils.scm" "/rx/source/irregex-utils")))
750
751 ;; Also copy over the README.
752 (install-file "irregex.html" doc)
753 #t))))))
32e14fc1
CAW
754 (inputs
755 `(("guile" ,guile-2.0)))
756 (home-page "http://synthcode.com/scheme/irregex")
757 (synopsis "S-expression based regular expressions")
758 (description
759 "Irregex is an s-expression based alternative to your classic
760string-based regular expressions. It implements SRFI 115 and is deeply
761inspired by the SCSH regular expression system.")
762 (license bsd-3)))
93e7199b 763
947a5d47
LC
764(define-public guile2.2-irregex
765 (package-for-guile-2.2 guile-irregex))
766
93e7199b
CAW
767;; There are two guile-gdbm packages, one using the FFI and one with
768;; direct C bindings, hence the verbose name.
769
770(define-public guile-gdbm-ffi
771 (package
772 (name "guile-gdbm-ffi")
773 (version "20120209.fa1d5b6")
774 (source (origin
775 (method git-fetch)
776 (uri (git-reference
777 (url "https://github.com/ijp/guile-gdbm.git")
778 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
821f4dc2 779 (file-name (string-append name "-" version "-checkout"))
93e7199b
CAW
780 (sha256
781 (base32
782 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
783 (build-system trivial-build-system)
784 (arguments
785 `(#:modules
786 ((guix build utils))
787 #:builder
788 (begin
789 (use-modules (guix build utils)
790 (system base compile))
791
792 (let* ((out (assoc-ref %outputs "out"))
793 (module-dir (string-append out "/share/guile/site/2.0"))
794 (source (assoc-ref %build-inputs "source"))
795 (doc (string-append out "/share/doc"))
796 (guild (string-append (assoc-ref %build-inputs "guile")
797 "/bin/guild"))
798 (gdbm.scm-dest
799 (string-append module-dir "/gdbm.scm"))
800 (gdbm.go-dest
801 (string-append module-dir "/gdbm.go")))
802 ;; Make installation directories.
803 (mkdir-p module-dir)
804 (mkdir-p doc)
805
806 ;; Switch directory for compiling and installing
807 (chdir source)
808
809 ;; copy the source
810 (copy-file "gdbm.scm" gdbm.scm-dest)
811
812 ;; Patch the FFI
813 (substitute* gdbm.scm-dest
814 (("\\(dynamic-link \"libgdbm\"\\)")
815 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
816 (assoc-ref %build-inputs "gdbm"))))
817
818 ;; compile to the destination
819 (compile-file gdbm.scm-dest
820 #:output-file gdbm.go-dest)))))
821 (inputs
822 `(("guile" ,guile-2.0)))
823 (propagated-inputs
824 `(("gdbm" ,gdbm)))
825 (home-page "https://github.com/ijp/guile-gdbm")
826 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
827 (description
828 "Guile bindings to the GDBM key-value storage system, using
829Guile's foreign function interface.")
830 (license gpl3+)))
831
e8ac1f8f
LC
832(define-public guile-sqlite3
833 (let ((commit "607721fe1174a299e45d457acacf94eefb964071"))
834 (package
835 (name "guile-sqlite3")
836 (version (string-append "0.0-0." (string-take commit 7)))
837
838 ;; XXX: Gitorious being dead, this is not a reliable home page.
839 (home-page "https://www.gitorious.org/guile-sqlite3/guile-sqlite3.git/")
840 (source (origin
841 (method git-fetch)
842 (uri (git-reference
843 (url home-page)
844 (commit commit)))
845 (sha256
846 (base32
847 "09gaffhh5rawz5kdmqx2ahvj1ngvxddp469r18bmjz3sz8p0slj2"))
848 (file-name (string-append name "-" version "-checkout"))
849 (modules '((guix build utils)))
850 (snippet
851 ;; Upgrade 'Makefile.am' to the current way of doing things.
852 '(substitute* "Makefile.am"
853 (("TESTS_ENVIRONMENT")
854 "TEST_LOG_COMPILER")))))
855
856 (build-system gnu-build-system)
857 (native-inputs
858 `(("autoconf" ,autoconf)
859 ("automake" ,automake)
860 ("pkg-config" ,pkg-config)))
861 (inputs
862 `(("guile" ,guile-2.0)
863 ("sqlite" ,sqlite)))
864 (arguments
865 '(#:phases (modify-phases %standard-phases
866 (add-before 'configure 'autoreconf
867 (lambda _
868 (zero? (system* "autoreconf" "-vfi"))))
869 (add-before 'build 'set-sqlite3-file-name
870 (lambda* (#:key inputs #:allow-other-keys)
871 (substitute* "sqlite3.scm"
872 (("\"libsqlite3\"")
873 (string-append "\"" (assoc-ref inputs "sqlite")
874 "/lib/libsqlite3\"")))
875 #t)))))
876 (synopsis "Access SQLite databases from Guile")
877 (description
878 "This package provides Guile bindings to the SQLite database system.")
879 (license gpl3+))))
880
27f5e13e
DT
881(define-public haunt
882 (package
883 (name "haunt")
4960beaa 884 (version "0.2")
27f5e13e
DT
885 (source (origin
886 (method url-fetch)
4960beaa 887 (uri (string-append "https://files.dthompson.us/haunt/haunt-"
27f5e13e
DT
888 version ".tar.gz"))
889 (sha256
890 (base32
4960beaa 891 "1id83n8fs7jxys1d8jy70vylg8gzcvlw1y7hb41y3qxv5zi4671m"))))
27f5e13e 892 (build-system gnu-build-system)
4ecbf6d2
LC
893 (arguments
894 `(#:modules ((ice-9 match) (ice-9 ftw)
895 ,@%gnu-build-system-modules)
896
897 #:phases (modify-phases %standard-phases
898 (add-after 'install 'wrap-haunt
899 (lambda* (#:key outputs #:allow-other-keys)
900 ;; Wrap the 'haunt' command to refer to the right
901 ;; modules.
902 (let* ((out (assoc-ref outputs "out"))
903 (bin (string-append out "/bin"))
904 (site (string-append
905 out "/share/guile/site")))
906 (match (scandir site)
907 (("." ".." version)
908 (let ((modules (string-append site "/" version)))
909 (wrap-program (string-append bin "/haunt")
910 `("GUILE_LOAD_PATH" ":" prefix
911 (,modules))
912 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
913 (,modules)))
914 #t)))))))))
4960beaa
DT
915 (native-inputs
916 `(("pkg-config" ,pkg-config)
917 ("texinfo" ,texinfo)))
27f5e13e
DT
918 (inputs
919 `(("guile" ,guile-2.0)))
4960beaa
DT
920 (propagated-inputs
921 `(("guile-reader" ,guile-reader)))
27f5e13e
DT
922 (synopsis "Functional static site generator")
923 (description "Haunt is a static site generator written in Guile
924Scheme. Haunt features a functional build system and an extensible
925interface for reading articles in any format.")
926 (home-page "http://haunt.dthompson.us")
927 (license gpl3+)))
928
44a2bdf8
AS
929(define-public guile-config
930 (package
931 (name "guile-config")
3c98acb7 932 (version "0.1.1")
44a2bdf8
AS
933 (source (origin
934 (method url-fetch)
935 (uri (string-append
936 "http://alex.pompo.co/software/" name "-" version
937 ".tar.gz"))
938 (sha256
939 (base32
3c98acb7 940 "1b719bn192f9wg24rr0zx8jpmygsvyhfi35iy778pb5p392snrn8"))))
44a2bdf8
AS
941 (build-system gnu-build-system)
942 (inputs
943 `(("guile" ,guile-2.0)))
944 (synopsis "Guile application configuration parsing library")
945 (description
946 "Guile Config is a library providing a declarative approach to
947application configuration specification. The library provides clean
948configuration declaration forms, and processors that take care of:
949configuration file creation; configuration file parsing; command-line
950parameter parsing using getopt-long; basic GNU command-line parameter
951generation (--help, --usage, --version); automatic output generation for the
952above command-line parameters.")
953 (home-page "https://github.com/a-sassmannshausen/guile-config")
954 (license agpl3+)))
955
36548111
DT
956(define-public guile-redis
957 (package
958 (name "guile-redis")
959 (version "0.1.0")
960 (source (origin
961 (method url-fetch)
962 (uri (string-append "mirror://savannah/guile-redis/guile-redis-"
963 version ".tar.gz"))
964 (sha256
965 (base32
966 "0vx6if6b4r3kwx64vzbs6vpc0cpcr85x11w9vkzq27gw8n7isv56"))
967 (modules '((guix build utils)))
968 (snippet
ea833d30 969 ;; Make sure everything goes under .../site/X.Y, like Guile's
36548111 970 ;; search paths expects.
ea833d30
RW
971 '(begin
972 (substitute* "configure"
973 (("ac_subst_vars='")
974 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
975 (substitute* '("Makefile.in"
976 "redis/Makefile.in"
977 "redis/commands/Makefile.in")
978 (("moddir =.*/share/guile/site" all)
979 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))))))
36548111
DT
980 (build-system gnu-build-system)
981 (native-inputs
982 `(("guile" ,guile-2.0)))
983 (home-page "http://savannah.nongnu.org/projects/guile-redis/")
984 (synopsis "Redis client library for Guile")
985 (description "Guile-redis provides a Scheme interface to the Redis
986key-value cache and store.")
987 (license lgpl3+)))
988
85313be8
RW
989(define-public guile2.2-redis
990 (package-for-guile-2.2 guile-redis))
991
9d373377
CAW
992(define-public guile-wisp
993 (package
994 (name "guile-wisp")
995 (version "0.9.0")
996 (source (origin
997 (method url-fetch)
998 (uri (string-append "https://bitbucket.org/ArneBab/"
999 "wisp/downloads/wisp-"
1000 version ".tar.gz"))
1001 (sha256
1002 (base32
1003 "0y5fxacalkgbv9s71h58vdvm2h2ln3rk024dd0vszwcf953as5fq"))))
1004 (build-system gnu-build-system)
1005 (arguments
1006 `(#:modules ((system base compile)
1007 ,@%gnu-build-system-modules)
1008 #:phases
1009 (modify-phases %standard-phases
1010 (add-before
1011 'configure 'substitute-before-config
1012
1013 (lambda* (#:key inputs #:allow-other-keys)
1014 (let ((bash (assoc-ref inputs "bash")))
1015 ;; configure checks for guile-2.0, but ours is just named "guile" :)
1016 (substitute* "configure"
1017 (("guile-2.0") "guile"))
1018 ;; Puts together some test files with /bin/bash hardcoded
1019 (substitute* "Makefile.in"
1020 (("/bin/bash")
1021 (string-append bash "/bin/bash") ))
1022 #t)))
1023
1024 ;; auto compilation breaks, but if we set HOME to /tmp,
1025 ;; that works ok
1026 (add-before
1027 'check 'auto-compile-hacky-workaround
1028 (lambda _
1029 (setenv "HOME" "/tmp")
1030 #t))
1031 (replace
1032 'install
1033 (lambda* (#:key outputs inputs #:allow-other-keys)
1034 (let* ((out (assoc-ref outputs "out"))
1035 (module-dir (string-append out "/share/guile/site/2.0"))
1036 (language-dir
1037 (string-append module-dir "/language/wisp"))
1038 (guild (string-append (assoc-ref inputs "guile")
1039 "/bin/guild")))
1040 ;; Make installation directories.
1041 (mkdir-p module-dir)
1042 (mkdir-p language-dir)
1043
1044 ;; copy the source
1045 (copy-file "wisp-scheme.scm"
1046 (string-append module-dir "/wisp-scheme.scm"))
1047 (copy-file "language/wisp/spec.scm"
1048 (string-append language-dir "/spec.scm"))
1049
1050 ;; compile to the destination
1051 (compile-file "wisp-scheme.scm"
1052 #:output-file (string-append
1053 module-dir "/wisp-scheme.go"))
1054 (compile-file "language/wisp/spec.scm"
1055 #:output-file (string-append
1056 language-dir "/spec.go"))
1057 #t))))))
1058 (home-page "http://draketo.de/english/wisp")
1059 (inputs
1060 `(("guile" ,guile-2.0)
1061 ("python" ,python)))
a124bbd2
SB
1062 (synopsis "Whitespace to lisp syntax for Guile")
1063 (description "Wisp is a syntax for Guile which provides a Python-like
9d373377
CAW
1064whitespace-significant language. It may be easier on the eyes for some
1065users and in some situations.")
1066 (license gpl3+)))
1067
5649c8cd
DT
1068(define-public guile-sly
1069 (package
1070 (name "guile-sly")
1071 (version "0.1")
1072 (source (origin
1073 (method url-fetch)
8d5e7ad2 1074 (uri (string-append "https://files.dthompson.us/sly/sly-"
5649c8cd
DT
1075 version ".tar.gz"))
1076 (sha256
1077 (base32
1078 "1svzlbz2vripmyq2kjh0rig16bsrnbkwbsm558pjln9l65mcl4qq"))))
1079 (build-system gnu-build-system)
1080 (arguments
1081 '(#:configure-flags
1082 (list (string-append "--with-libfreeimage-prefix="
1083 (assoc-ref %build-inputs "freeimage"))
1084 (string-append "--with-libgslcblas-prefix="
1085 (assoc-ref %build-inputs "gsl")))))
1086 (native-inputs
1087 `(("pkg-config" ,pkg-config)))
1088 (propagated-inputs
1089 `(("guile" ,guile-2.0)
1090 ("guile-sdl" ,guile-sdl)
1091 ("guile-opengl" ,guile-opengl)))
1092 (inputs
1093 `(("gsl" ,gsl)
1094 ("freeimage" ,freeimage)
1095 ("mesa" ,mesa)))
1096 (synopsis "2D/3D game engine for GNU Guile")
1097 (description "Sly is a 2D/3D game engine written in Guile Scheme. Sly
1098features a functional reactive programming interface and live coding
1099capabilities.")
1100 (home-page "http://dthompson.us/pages/software/sly.html")
1101 (license gpl3+)))
1102
dec1e2b3
AB
1103(define-public g-wrap
1104 (package
1105 (name "g-wrap")
1106 (version "1.9.15")
1107 (source (origin
1108 (method url-fetch)
1109 (uri (string-append "mirror://savannah/g-wrap/g-wrap-"
1110 version ".tar.gz"))
1111 (sha256
1112 (base32
1113 "0ak0bha37dfpj9kmyw1r8fj8nva639aw5xr66wr5gd3l1rqf5xhg"))))
1114 (build-system gnu-build-system)
1115 (native-inputs
1116 `(("pkg-config" ,pkg-config)))
1117 (propagated-inputs
1118 `(("guile" ,guile-2.0)
1119 ("guile-lib" ,guile-lib)))
1120 (inputs
1121 `(("libffi" ,libffi)))
9e8599a3
PH
1122 (arguments
1123 `(#:phases
1124 (modify-phases %standard-phases
1125 (add-before 'configure 'pre-configure
1126 (lambda* (#:key outputs #:allow-other-keys)
1127 (let ((out (assoc-ref outputs "out")))
1128 (substitute* (find-files "." "^Makefile.in$")
1129 (("guilemoduledir =.*guile/site" all)
1130 (string-append all "/2.0")))
1131 #t))))))
dec1e2b3
AB
1132 (synopsis "Generate C bindings for Guile")
1133 (description "G-Wrap is a tool and Guile library for generating function
1134wrappers for inter-language calls. It currently only supports generating Guile
1135wrappers for C functions. Given a definition of the types and prototypes for
1136a given C interface, G-Wrap will automatically generate the C code that
1137provides access to that interface and its types from the Scheme level.")
1138 (home-page "http://www.nongnu.org/g-wrap/index.html")
1139 (license lgpl2.1+)))
1140
01497dfe
LC
1141(define-public guile-dbi
1142 (package
1143 (name "guile-dbi")
1144 (version "2.1.6")
1145 (source (origin
1146 (method url-fetch)
1147 (uri (string-append
1148 "http://download.gna.org/guile-dbi/guile-dbi-"
1149 version ".tar.gz"))
1150 (sha256
1151 (base32
1152 "116njrprhgrsv1qm904sp3b02rq01fx639r433d657gyhw3x159n"))))
1153 (build-system gnu-build-system)
1154 (arguments
1155 '(#:configure-flags
1156 (list (string-append
1157 "--with-guile-site-dir=" %output "/share/guile/site/2.0"))
1158 #:phases
1159 (modify-phases %standard-phases
1160 (add-after 'install 'patch-extension-path
1161 (lambda* (#:key outputs #:allow-other-keys)
1162 (let* ((out (assoc-ref outputs "out"))
1163 (dbi.scm (string-append
1164 out "/share/guile/site/2.0/dbi/dbi.scm"))
1165 (ext (string-append out "/lib/libguile-dbi")))
1166 (substitute* dbi.scm (("libguile-dbi") ext))
1167 #t))))))
1168 (propagated-inputs
1169 `(("guile" ,guile-2.0)))
1170 (synopsis "Guile database abstraction layer")
1171 (home-page "http://home.gna.org/guile-dbi/guile-dbi.html")
1172 (description
1173 "guile-dbi is a library for Guile that provides a convenient interface to
1174SQL databases. Database programming with guile-dbi is generic in that the same
1175programming interface is presented regardless of which database system is used.
1176It currently supports MySQL, Postgres and SQLite3.")
1177 (license gpl2+)))
1178
1179(define-public guile-dbd-sqlite3
1180 (package
1181 (name "guile-dbd-sqlite3")
1182 (version "2.1.6")
1183 (source (origin
1184 (method url-fetch)
1185 (uri (string-append
1186 "http://download.gna.org/guile-dbi/guile-dbd-sqlite3-"
1187 version ".tar.gz"))
1188 (sha256
1189 (base32
1190 "0rg71jchxd2y8x496s8zmfmikr5g8zxi8zv2ar3f7a23pph92iw2"))))
1191 (build-system gnu-build-system)
1192 (native-inputs
1193 `(("pkg-config" ,pkg-config)))
1194 (inputs
1195 `(("sqlite" ,sqlite)
1196 ("zlib" ,(@ (gnu packages compression) zlib))))
1197 (propagated-inputs
1198 `(("guile-dbi" ,guile-dbi)))
1199 (synopsis "Guile DBI driver for SQLite")
1200 (home-page "https://github.com/jkalbhenn/guile-dbd-sqlite3")
1201 (description
1202 "guile-dbi is a library for Guile that provides a convenient interface to
1203SQL databases. This package implements the interface for SQLite.")
1204 (license gpl2+)))
1205
bd9af610
AK
1206(define-public guile-xosd
1207 (package
1208 (name "guile-xosd")
4b2b7135 1209 (version "0.2.1")
bd9af610
AK
1210 (source (origin
1211 (method url-fetch)
1212 (uri (string-append "https://github.com/alezost/" name
1213 "/releases/download/v" version
1214 "/" name "-" version ".tar.gz"))
1215 (sha256
1216 (base32
4b2b7135 1217 "1ri5065c16kmgrf2pysn2ymxjqi5302lhpb07wkl1jr75ym8fn8p"))))
bd9af610
AK
1218 (build-system gnu-build-system)
1219 (native-inputs
1220 `(("pkg-config" ,pkg-config)))
1221 (inputs
1222 `(("guile" ,guile-2.0)
1223 ("libx11" ,libx11)
1224 ("libxext" ,libxext)
1225 ("libxinerama" ,libxinerama)
1226 ("xosd" ,xosd)))
1227 (home-page "https://github.com/alezost/guile-xosd")
1228 (synopsis "XOSD bindings for Guile")
1229 (description
1230 "Guile-XOSD provides Guile bindings for @code{libxosd},
1231@uref{http://sourceforge.net/projects/libxosd/, the X On Screen Display
1232library}.")
1233 (license gpl3+)))
1234
07f7cc03
AK
1235(define-public guile-daemon
1236 (package
1237 (name "guile-daemon")
876d8f29 1238 (version "0.1.1")
07f7cc03
AK
1239 (source (origin
1240 (method url-fetch)
1241 (uri (string-append "https://github.com/alezost/" name
1242 "/releases/download/v" version
1243 "/" name "-" version ".tar.gz"))
1244 (sha256
1245 (base32
876d8f29 1246 "0wsq9l6a4sijq4i1r3kcddfaznsak2jc5k59gzkhs5il5d2kn5yi"))))
07f7cc03
AK
1247 (build-system gnu-build-system)
1248 (native-inputs
1249 `(("pkg-config" ,pkg-config)))
1250 (inputs
1251 `(("guile" ,guile-2.0)))
1252 (home-page "https://github.com/alezost/guile-daemon")
1253 (synopsis "Evaluate code in a running Guile process")
1254 (description
1255 "Guile-Daemon is a small Guile program that loads your initial
1256configuration file, and then reads and evaluates Guile expressions that
1257you send to a FIFO file.")
1258 (license gpl3+)))
1259
e28e74a5
EE
1260(define-public guile-commonmark
1261 (package
1262 (name "guile-commonmark")
1263 (version "0.1")
1264 (source (origin
1265 (method url-fetch)
1266 (uri (string-append "https://github.com/OrangeShark/" name
1267 "/releases/download/v" version
1268 "/" name "-" version ".tar.gz"))
1269 (sha256
1270 (base32
757ce0f9
LC
1271 "12cb5fqvvgc87f5xp0ih5az305wnjia89l5jba83d0r2p8bfy0b0"))
1272 (modules '((guix build utils)))
1273 (snippet
1274 ;; Use the real effective version of Guile in directory names
1275 ;; instead of a hard-coded "/2.0".
1276 '(begin
1277 (substitute* "configure"
1278 (("ac_subst_vars='")
1279 "ac_subst_vars='GUILE_EFFECTIVE_VERSION\n"))
1280 (substitute* "Makefile.in"
1281 (("/site/2.0")
1282 "/site/@GUILE_EFFECTIVE_VERSION@"))))))
e28e74a5
EE
1283 (build-system gnu-build-system)
1284 (inputs
1285 `(("guile" ,guile-2.0)))
1286 (synopsis "CommonMark parser for Guile")
1287 (description
1288 "guile-commonmark is a library for parsing CommonMark, a fully specified
1289variant of Markdown. The library is written in Guile Scheme and is designed
1290to transform a CommonMark document to SXML. guile-commonmark tries to closely
1291follow the @uref{http://commonmark.org/, CommonMark spec}, the main difference
1292is no support for parsing block and inline level HTML.")
1293 (home-page "https://github.com/OrangeShark/guile-commonmark")
1294 (license lgpl3+)))
1295
947a5d47
LC
1296(define-public guile2.2-commonmark
1297 (package-for-guile-2.2 guile-commonmark))
1298
3b5783fc
AB
1299(define-public guile-bytestructures
1300 (package
1301 (name "guile-bytestructures")
1302 (version "20160726.53127f6")
1303 (source (origin
1304 (method git-fetch)
1305 (uri (git-reference
1306 (url "https://github.com/TaylanUB/scheme-bytestructures")
1307 (commit "53127f608caf64b34fa41c389b2743b546fbe9da")))
1308 (file-name (string-append name "-" version "-checkout"))
1309 (sha256
1310 (base32
1311 "0l4nx1vp9fkrgrgwjiycj7nx6wfjfd39rqamv4pmq7issi8mrywq"))))
1312 (build-system trivial-build-system)
1313 (arguments
1314 `(#:modules ((guix build utils))
1315 #:builder
1316 (begin
1317 (use-modules (guix build utils)
1318 (ice-9 match)
1319 (ice-9 popen)
1320 (ice-9 rdelim))
1321 (let* ((out (assoc-ref %outputs "out"))
1322 (guile (assoc-ref %build-inputs "guile"))
1323 (effective (read-line
1324 (open-pipe* OPEN_READ
1325 (string-append guile "/bin/guile")
1326 "-c" "(display (effective-version))")))
1327 (module-dir (string-append out "/share/guile/site/"
1328 effective))
1329 (source (assoc-ref %build-inputs "source"))
1330 (doc (string-append out "/share/doc/scheme-bytestructures"))
1331 (scm-files (filter (lambda (path)
1332 (not (string-prefix? "bytestructures/r7" path)))
1333 (with-directory-excursion source
1334 (find-files "bytestructures" "\\.scm$"))))
1335 (guild (string-append (assoc-ref %build-inputs "guile")
1336 "/bin/guild")))
1337 ;; Make installation directories.
1338 (mkdir-p doc)
1339
1340 ;; Compile .scm files and install.
1341 (chdir source)
1342 (setenv "GUILE_AUTO_COMPILE" "0")
1343 (for-each (lambda (file)
1344 (let* ((dest-file (string-append module-dir "/"
1345 file))
1346 (go-file (string-append module-dir "/"
1347 (substring file 0
1348 (string-rindex file #\.))
1349 ".go")))
1350 ;; Install source module.
1351 (mkdir-p (dirname dest-file))
1352 (copy-file file dest-file)
1353
1354 ;; Install compiled module.
1355 (mkdir-p (dirname go-file))
1356 (unless (zero? (system* guild "compile"
1357 "-L" source
1358 "-o" go-file
1359 file))
1360 (error (format #f "Failed to compile ~s to ~s!"
1361 file go-file)))))
1362 scm-files)
1363
1364 ;; Also copy over the README.
1365 (install-file "README.md" doc)
1366 #t))))
1367 (inputs
1368 `(("guile" ,guile-2.0)))
1369 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
1370 (synopsis "Structured access to bytevector contents for Guile")
1371 (description
1372 "Guile bytestructures offers a system imitating the type system
1373of the C programming language, to be used on bytevectors. C's type
1374system works on raw memory, and Guile works on bytevectors which are
1375an abstraction over raw memory. It's also more powerful than the C
1376type system, elevating types to first-class status.")
1377 (license gpl3+)))
1378
472fc855
LC
1379(define-public guile-aspell
1380 (package
1381 (name "guile-aspell")
1382 (version "0.3")
1383 (source (origin
1384 (method url-fetch)
1385 (uri (string-append
1386 "http://lonelycactus.com/tarball/guile_aspell-"
1387 version ".tar.gz"))
1388 (sha256
1389 (base32
1390 "1wknn57x2qcsbn7zw6sbn1ma6fjsg8cvpnf78ak47s8jw6k6j75n"))))
1391 (build-system gnu-build-system)
1392 (arguments
1393 '(#:configure-flags (list (string-append "--with-guilesitedir="
1394 (assoc-ref %outputs "out")
1395 "/share/guile/site/2.0"))
1396 #:phases (modify-phases %standard-phases
1397 (add-before 'build 'set-libaspell-file-name
1398 (lambda* (#:key inputs #:allow-other-keys)
1399 (let ((aspell (assoc-ref inputs "aspell")))
1400 (substitute* "aspell/aspell.scm"
1401 (("\"libaspell\\.so\"")
1402 (string-append "\"" aspell
1403 "/lib/libaspell\"")))
1404 #t))))))
1405 (native-inputs `(("pkg-config" ,pkg-config)))
1406 (inputs `(("guile" ,guile-2.0)
1407 ("aspell" ,aspell)))
1408 (home-page "https://github.com/spk121/guile-aspell")
1409 (synopsis "Spell-checking from Guile")
1410 (description
1411 "guile-aspell is a Guile Scheme library for comparing a string against a
1412dictionary and suggesting spelling corrections.")
1413 (license gpl3+)))
1414
1722d680 1415;;; guile.scm ends here