Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / guile.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Cyril Roelandt <tipecaml@gmail.com>
4 ;;; Copyright © 2014, 2016, 2018 David Thompson <davet@gnu.org>
5 ;;; Copyright © 2014, 2017, 2018 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
7 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
8 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
9 ;;; Copyright © 2016, 2019 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
11 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
12 ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
13 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2017, 2018 Amirouche <amirouche@hypermove.net>
15 ;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
16 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
17 ;;; Copyright © 2019 Taylan Kammer <taylan.kammer@gmail.com>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages guile)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages bash)
40 #:use-module (gnu packages bdw-gc)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages dbm)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages gawk)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages hurd)
47 #:use-module (gnu packages libffi)
48 #:use-module (gnu packages libunistring)
49 #:use-module (gnu packages linux)
50 #:use-module (gnu packages m4)
51 #:use-module (gnu packages multiprecision)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages readline)
54 #:use-module (gnu packages sqlite)
55 #:use-module (gnu packages texinfo)
56 #:use-module (gnu packages version-control)
57 #:use-module (guix packages)
58 #:use-module (guix download)
59 #:use-module (guix git-download)
60 #:use-module (guix build-system gnu)
61 #:use-module (guix build-system guile)
62 #:use-module (guix deprecation)
63 #:use-module (guix utils)
64 #:use-module (ice-9 match)
65 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
66
67 ;;; Commentary:
68 ;;;
69 ;;; GNU Guile, and modules and extensions.
70 ;;;
71 ;;; Code:
72
73 (define-public guile-1.8
74 (package
75 (name "guile")
76 (version "1.8.8")
77 (source (origin
78 (method url-fetch)
79 (uri (string-append "mirror://gnu/guile/guile-" version
80 ".tar.gz"))
81 (sha256
82 (base32
83 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
84 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
85 (build-system gnu-build-system)
86 (arguments '(#:configure-flags '("--disable-error-on-warning")
87
88 ;; Insert a phase before `configure' to patch things up.
89 #:phases
90 (modify-phases %standard-phases
91 (add-before 'configure 'patch-stuff
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"
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")))
106 #t)))))
107
108 ;; When cross-compiling, a native version of Guile itself is needed.
109 (native-inputs (if (%current-target-system)
110 `(("self" ,this-package))
111 '()))
112
113 (inputs `(("gawk" ,gawk)
114 ("readline" ,readline)))
115
116 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
117 ;; propagated.
118 (propagated-inputs `(("gmp" ,gmp)
119 ("libltdl" ,libltdl)))
120
121 (native-search-paths
122 (list (search-path-specification
123 (variable "GUILE_LOAD_PATH")
124 (files '("share/guile/site")))))
125
126 (synopsis "Scheme implementation intended especially for extensions")
127 (description
128 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
129 official extension language of the GNU system. It is an implementation of
130 the Scheme language which can be easily embedded in other applications to
131 provide a convenient means of extending the functionality of the application
132 without requiring the source code to be rewritten.")
133 (home-page "https://www.gnu.org/software/guile/")
134 (license license:lgpl2.0+)))
135
136 (define-public guile-2.0
137 (package
138 (name "guile")
139 (version "2.0.14")
140 (source (origin
141 (method url-fetch)
142 (uri (string-append "mirror://gnu/guile/guile-" version
143 ".tar.xz"))
144 (sha256
145 (base32
146 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
147 (build-system gnu-build-system)
148
149 ;; When cross-compiling, a native version of Guile itself is needed.
150 (native-inputs `(,@(if (%current-target-system)
151 `(("self" ,this-package))
152 '())
153 ("pkgconfig" ,pkg-config)))
154 (inputs `(("libffi" ,libffi)
155 ,@(libiconv-if-needed)
156
157 ;; We need Bash when cross-compiling because some of the scripts
158 ;; in bin/ refer to it. Use 'bash-minimal' because we don't need
159 ;; an interactive Bash with Readline and all.
160 ,@(if (target-mingw?) '() `(("bash" ,bash-minimal)))))
161 (propagated-inputs
162 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
163 ;; reads `-lltdl -lunistring', adding them here will add the needed
164 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
165 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
166 ("libunistring" ,libunistring)
167
168 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
169 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
170 ("libltdl" ,libltdl)
171
172 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
173 ;; must be propagated.
174 ("bdw-gc" ,libgc)
175 ("gmp" ,gmp)))
176
177 (outputs '("out" "debug"))
178
179 (arguments
180 `(#:configure-flags '("--disable-static") ; saves 3 MiB
181 #:phases
182 (modify-phases %standard-phases
183 (add-before 'configure 'pre-configure
184 (lambda* (#:key inputs #:allow-other-keys)
185 ;; Tell (ice-9 popen) the file name of Bash.
186 (let ((bash (assoc-ref inputs "bash")))
187 (substitute* "module/ice-9/popen.scm"
188 ;; If bash is #f allow fallback for user to provide
189 ;; "bash" in PATH. This happens when cross-building to
190 ;; MinGW for which we do not have Bash yet.
191 (("/bin/sh")
192 ,@(if (target-mingw?)
193 '((if bash
194 (string-append bash "/bin/bash")
195 "bash"))
196 '((string-append bash "/bin/bash")))))
197 #t))))))
198
199 (native-search-paths
200 (list (search-path-specification
201 (variable "GUILE_LOAD_PATH")
202 (files '("share/guile/site/2.0")))
203 (search-path-specification
204 (variable "GUILE_LOAD_COMPILED_PATH")
205 (files '("lib/guile/2.0/site-ccache")))))
206
207 (synopsis "Scheme implementation intended especially for extensions")
208 (description
209 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
210 official extension language of the GNU system. It is an implementation of
211 the Scheme language which can be easily embedded in other applications to
212 provide a convenient means of extending the functionality of the application
213 without requiring the source code to be rewritten.")
214 (home-page "https://www.gnu.org/software/guile/")
215 (license license:lgpl3+)))
216
217 (define-public guile-2.2
218 (package (inherit guile-2.0)
219 (name "guile")
220 (version "2.2.6")
221 (source (origin
222 (method url-fetch)
223
224 ;; Note: we are limited to one of the compression formats
225 ;; supported by the bootstrap binaries, so no lzip here.
226 (uri (string-append "mirror://gnu/guile/guile-" version
227 ".tar.xz"))
228 (sha256
229 (base32
230 "1269ymxm56j1z1lvq1y42rm961f2n7rinm3k6l00p9k52hrpcddk"))
231 (modules '((guix build utils)))
232 (patches (search-patches
233 "guile-finalization-crash.patch"
234 "guile-2.2-skip-oom-test.patch"))
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 '(begin
240 (for-each delete-file
241 (find-files "prebuilt" "\\.go$"))
242 #t))))
243 (properties '((timeout . 72000) ;20 hours
244 (max-silent-time . 36000))) ;10 hours (needed on ARM
245 ; when heavily loaded)
246 (native-search-paths
247 (list (search-path-specification
248 (variable "GUILE_LOAD_PATH")
249 (files '("share/guile/site/2.2")))
250 (search-path-specification
251 (variable "GUILE_LOAD_COMPILED_PATH")
252 (files '("lib/guile/2.2/site-ccache")))))))
253
254 (define-public guile-2.2.7
255 ;; This version contains a bug fix for a relatively rare crash that could
256 ;; affect shepherd as PID 1: <https://bugs.gnu.org/37757>.
257 (package
258 (inherit guile-2.2)
259 (version "2.2.7")
260 (source (origin
261 (inherit (package-source guile-2.2))
262 (uri (string-append "mirror://gnu/guile/guile-" version
263 ".tar.xz"))
264 (sha256
265 (base32
266 "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd"))))))
267
268 (define-deprecated guile-2.2/bug-fix guile-2.2.7)
269
270 (define-public guile-2.2/fixed
271 ;; A package of Guile 2.2 that's rarely changed. It is the one used
272 ;; in the `base' module, and thus changing it entails a full rebuild.
273 (package
274 (inherit guile-2.2)
275 (properties '((hidden? . #t) ;people should install 'guile-2.2'
276 (timeout . 72000) ;20 hours
277 (max-silent-time . 36000))))) ;10 hours (needed on ARM
278 ; when heavily loaded)
279 (define-public guile-2.2.4
280 (package/inherit
281 guile-2.2
282 (version "2.2.4")
283 (source (origin
284 (inherit (package-source guile-2.2))
285 (uri (string-append "mirror://gnu/guile/guile-" version
286 ".tar.xz"))
287 (sha256
288 (base32
289 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))))))
290
291 (define-public guile-3.0
292 ;; This is the latest Guile stable version.
293 (package
294 (inherit guile-2.2)
295 (name "guile-next") ;to be renamed to "guile"
296 (version "3.0.1")
297 (source (origin
298 (inherit (package-source guile-2.2))
299 (uri (string-append "mirror://gnu/guile/guile-"
300 version ".tar.xz"))
301 (sha256
302 (base32
303 "1jakps3127h8g69ixgb4zwc8v2g29dmwql1vi3pwg30kzp8fm5nn"))
304 (patches
305 (append (search-patches "guile-3.0-crash.patch")
306 (origin-patches (package-source guile-2.2))))))
307
308 (arguments
309 (substitute-keyword-arguments (package-arguments guile-2.2)
310 ;; XXX: On ARMv7, work around <https://bugs.gnu.org/39208> by disabling
311 ;; JIT.
312 ((#:configure-flags flags '())
313 (if (target-arm32?)
314 `(cons "--disable-jit" ,flags)
315 flags))))
316 (native-search-paths
317 (list (search-path-specification
318 (variable "GUILE_LOAD_PATH")
319 (files '("share/guile/site/3.0")))
320 (search-path-specification
321 (variable "GUILE_LOAD_COMPILED_PATH")
322 (files '("lib/guile/3.0/site-ccache"
323 "share/guile/site/3.0")))))))
324
325 (define-public guile-next guile-3.0)
326
327 (define* (make-guile-readline guile #:optional (name "guile-readline"))
328 (package
329 (name name)
330 (version (package-version guile))
331 (source (package-source guile))
332 (build-system gnu-build-system)
333 (arguments
334 '(#:configure-flags '("--disable-silent-rules")
335 #:phases (modify-phases %standard-phases
336 (add-before 'build 'chdir
337 (lambda* (#:key outputs #:allow-other-keys)
338 (invoke "make" "-C" "libguile" "scmconfig.h")
339 (invoke "make" "-C" "lib")
340 (chdir "guile-readline")
341
342 (substitute* "Makefile"
343 (("../libguile/libguile-[[:graph:]]+\\.la")
344 ;; Remove dependency on libguile-X.Y.la.
345 "")
346 (("^READLINE_LIBS = (.*)$" _ libs)
347 ;; Link against the provided libguile.
348 (string-append "READLINE_LIBS = "
349 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
350 libs "\n"))
351 (("\\$\\(top_builddir\\)/meta/build-env")
352 ;; Use the provided Guile, not the one from
353 ;; $(builddir).
354 "")
355
356 ;; Install modules to the 'site' directories.
357 (("^moddir = .*$")
358 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
359 (("^ccachedir = .*$")
360 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
361
362 ;; Load 'guile-readline.so' from the right place.
363 (substitute* "ice-9/readline.scm"
364 (("load-extension \"guile-readline\"")
365 (format #f "load-extension \
366 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
367 (assoc-ref outputs "out"))))
368 #t)))))
369 (home-page (package-home-page guile))
370 (native-inputs (package-native-inputs guile))
371 (inputs
372 `(,@(package-inputs guile) ;to placate 'configure'
373 ,@(package-propagated-inputs guile)
374 ("guile" ,guile)
375 ("readline" ,readline)))
376 (synopsis "Line editing support for GNU Guile")
377 (description
378 "This module provides line editing support via the Readline library for
379 GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
380 @code{activate-readline} procedure to enable it.")
381 (license license:gpl3+)))
382
383 (define-public guile-readline
384 (make-guile-readline guile-2.2))
385
386 (define-public guile3.0-readline
387 (make-guile-readline guile-next "guile3.0-readline"))
388
389 (define (guile-variant-package-name prefix)
390 (lambda (name)
391 "Return NAME with PREFIX instead of \"guile-\", when applicable."
392 (if (string-prefix? "guile-" name)
393 (string-append prefix "-"
394 (string-drop name
395 (string-length "guile-")))
396 name)))
397
398 (define package-for-guile-2.0
399 ;; A procedure that rewrites the dependency tree of the given package to use
400 ;; GUILE-2.0 instead of GUILE-2.2.
401 (package-input-rewriting `((,guile-2.2 . ,guile-2.0))
402 (guile-variant-package-name "guile2.0")))
403
404 (define package-for-guile-3.0
405 (package-input-rewriting `((,guile-2.2 . ,guile-next))
406 (guile-variant-package-name "guile3.0")))
407
408 (define-public guile-for-guile-emacs
409 (package (inherit guile-2.2)
410 (name "guile-for-guile-emacs")
411 (version "20150510.d8d9a8d")
412 (source (origin
413 (method git-fetch)
414 (uri (git-reference
415 (url "git://git.hcoop.net/git/bpt/guile.git")
416 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
417 (file-name (string-append name "-" version "-checkout"))
418 (sha256
419 (base32
420 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
421 (arguments
422 `(;; Tests aren't passing for now.
423 ;; Obviously we should re-enable this!
424 #:tests? #f
425 ,@(package-arguments guile-2.2)))
426 (native-inputs
427 `(("autoconf" ,autoconf)
428 ("automake" ,automake)
429 ("libtool" ,libtool)
430 ("flex" ,flex)
431 ("texinfo" ,texinfo)
432 ("gettext" ,gettext-minimal)
433 ,@(package-native-inputs guile-2.2)))
434 ;; Same as in guile-2.0
435 (native-search-paths
436 (list (search-path-specification
437 (variable "GUILE_LOAD_PATH")
438 (files '("share/guile/site/2.0")))
439 (search-path-specification
440 (variable "GUILE_LOAD_COMPILED_PATH")
441 (files '("lib/guile/2.0/site-ccache"
442 "share/guile/site/2.0")))))))
443
444 \f
445 ;;;
446 ;;; Extensions.
447 ;;;
448
449 (define-public guile-json-1
450 (package
451 (name "guile-json")
452 (version "1.2.0")
453 (home-page "https://github.com/aconchillo/guile-json")
454 (source (origin
455 (method url-fetch)
456 (uri (string-append "mirror://savannah/guile-json/guile-json-"
457 version ".tar.gz"))
458 (sha256
459 (base32
460 "15gnb84d7hpazqhskkf3g9z4r6knw54wfj4ch5270kakz1lp70c9"))))
461 (build-system gnu-build-system)
462 (native-inputs `(("pkg-config" ,pkg-config)
463 ("guile" ,guile-2.2)))
464 (inputs `(("guile" ,guile-2.2)))
465 (synopsis "JSON module for Guile")
466 (description
467 "Guile-JSON supports parsing and building JSON documents according to the
468 specification. These are the main features:
469
470 @itemize
471 @item Strictly complies to @uref{http://json.org, specification}.
472 @item Build JSON documents programmatically via macros.
473 @item Unicode support for strings.
474 @item Allows JSON pretty printing.
475 @end itemize\n")
476
477 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
478 (license license:gpl3+)))
479
480 ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
481 ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
482 ;; 'guile-json-3'.
483 (define-deprecated guile-json guile-json-1)
484 (export guile-json)
485
486 (define-public guile2.0-json
487 (package-for-guile-2.0 guile-json-1))
488
489 (define-public guile-json-3
490 ;; This version is incompatible with 1.x; see the 'NEWS' file.
491 (package
492 (inherit guile-json-1)
493 (name "guile-json")
494 (version "3.2.0")
495 (source (origin
496 (method url-fetch)
497 (uri (string-append "mirror://savannah/guile-json/guile-json-"
498 version ".tar.gz"))
499 (sha256
500 (base32
501 "14m6b6g2maw0mkvfm4x63rqb54vgbpn1gcqs715ijw4bikfzlqfz"))))))
502
503 (define-public guile3.0-json
504 (package-for-guile-3.0 guile-json-3))
505
506 ;; There are two guile-gdbm packages, one using the FFI and one with
507 ;; direct C bindings, hence the verbose name.
508
509 (define-public guile-gdbm-ffi
510 (package
511 (name "guile-gdbm-ffi")
512 (version "20120209.fa1d5b6")
513 (source (origin
514 (method git-fetch)
515 (uri (git-reference
516 (url "https://github.com/ijp/guile-gdbm.git")
517 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
518 (file-name (string-append name "-" version "-checkout"))
519 (patches (search-patches
520 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
521 (sha256
522 (base32
523 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
524 (build-system guile-build-system)
525 (arguments
526 '(#:phases (modify-phases %standard-phases
527 (add-after 'unpack 'move-examples
528 (lambda* (#:key outputs #:allow-other-keys)
529 ;; Move examples where they belong.
530 (let* ((out (assoc-ref outputs "out"))
531 (doc (string-append out "/share/doc/"
532 (strip-store-file-name out)
533 "/examples")))
534 (copy-recursively "examples" doc)
535 (delete-file-recursively "examples")
536 #t)))
537 (add-after 'unpack 'set-libgdbm-file-name
538 (lambda* (#:key inputs #:allow-other-keys)
539 (substitute* "gdbm.scm"
540 (("\\(dynamic-link \"libgdbm\"\\)")
541 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
542 (assoc-ref inputs "gdbm"))))
543 #t)))))
544 (native-inputs
545 `(("guile" ,guile-2.2)))
546 (inputs
547 `(("gdbm" ,gdbm)))
548 (home-page "https://github.com/ijp/guile-gdbm")
549 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
550 (description
551 "Guile bindings to the GDBM key-value storage system, using
552 Guile's foreign function interface.")
553 (license license:gpl3+)))
554
555 (define-public guile2.0-gdbm-ffi
556 (package-for-guile-2.0 guile-gdbm-ffi))
557
558 (define-public guile3.0-gdbm-ffi
559 (package-for-guile-3.0 guile-gdbm-ffi))
560
561 (define-public guile-sqlite3
562 (package
563 (name "guile-sqlite3")
564 (version "0.1.0")
565 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
566 (source (origin
567 (method git-fetch)
568 (uri (git-reference
569 (url home-page)
570 (commit (string-append "v" version))))
571 (sha256
572 (base32
573 "1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
574 (file-name (string-append name "-" version "-checkout"))
575 (patches
576 (search-patches "guile-sqlite3-fix-cross-compilation.patch"))
577 (modules '((guix build utils)))
578 (snippet
579 '(begin
580 ;; Allow builds with Guile 3.0.
581 (substitute* "configure.ac"
582 (("^GUILE_PKG.*")
583 "GUILE_PKG([3.0 2.2 2.0])\n"))
584 #t))))
585 (build-system gnu-build-system)
586 (native-inputs
587 `(("autoconf" ,autoconf)
588 ("automake" ,automake)
589 ("guile" ,guile-2.2)
590 ("pkg-config" ,pkg-config)))
591 (inputs
592 `(("guile" ,guile-2.2)
593 ("sqlite" ,sqlite)))
594 (synopsis "Access SQLite databases from Guile")
595 (description
596 "This package provides Guile bindings to the SQLite database system.")
597 (license license:gpl3+)))
598
599 (define-public guile2.0-sqlite3
600 (package-for-guile-2.0 guile-sqlite3))
601
602 (define-public guile3.0-sqlite3
603 (package-for-guile-3.0 guile-sqlite3))
604
605 (define-public guile-bytestructures
606 (package
607 (name "guile-bytestructures")
608 (version "1.0.7")
609 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
610 (source (origin
611 (method git-fetch)
612 (uri (git-reference
613 (url home-page)
614 (commit (string-append "v" version))))
615 (file-name (git-file-name name version))
616 (sha256
617 (base32
618 "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb"))))
619 (build-system gnu-build-system)
620 (arguments
621 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
622
623 #:phases (modify-phases %standard-phases
624 (add-after 'install 'install-doc
625 (lambda* (#:key outputs #:allow-other-keys)
626 (let* ((out (assoc-ref outputs "out"))
627 (package ,(package-full-name this-package "-"))
628 (doc (string-append out "/share/doc/" package)))
629 (install-file "README.md" doc)
630 #t))))))
631 (native-inputs
632 `(("autoconf" ,autoconf)
633 ("automake" ,automake)
634 ("pkg-config" ,pkg-config)
635 ("guile" ,guile-2.2)))
636 (inputs
637 `(("guile" ,guile-2.2)))
638 (synopsis "Structured access to bytevector contents for Guile")
639 (description
640 "Guile bytestructures offers a system imitating the type system
641 of the C programming language, to be used on bytevectors. C's type
642 system works on raw memory, and Guile works on bytevectors which are
643 an abstraction over raw memory. It's also more powerful than the C
644 type system, elevating types to first-class status.")
645 (license license:gpl3+)
646 (properties '((upstream-name . "bytestructures")))))
647
648 (define-public guile2.0-bytestructures
649 (package-for-guile-2.0 guile-bytestructures))
650
651 (define-public guile3.0-bytestructures
652 (package-for-guile-3.0 guile-bytestructures))
653
654 (define-public guile-git
655 (package
656 (name "guile-git")
657 (version "0.3.0")
658 (home-page "https://gitlab.com/guile-git/guile-git.git")
659 (source (origin
660 (method url-fetch)
661 (uri (string-append "https://gitlab.com/guile-git/guile-git/uploads/"
662 "4c563d8e7e1ff84396abe8ca7011bcaf/guile-git-"
663 version ".tar.gz"))
664 (sha256
665 (base32
666 "0c5i3d16hp7gp9rd78vk9zc45js8bphf92m4lbb5gyi4l1yl7kkm"))))
667 (build-system gnu-build-system)
668 (native-inputs
669 `(("pkg-config" ,pkg-config)
670 ("guile" ,guile-2.2)
671 ("guile-bytestructures" ,guile-bytestructures)))
672 (inputs
673 `(("guile" ,guile-2.2)
674 ("libgit2" ,libgit2)))
675 (propagated-inputs
676 `(("guile-bytestructures" ,guile-bytestructures)))
677 (synopsis "Guile bindings for libgit2")
678 (description
679 "This package provides Guile bindings to libgit2, a library to
680 manipulate repositories of the Git version control system.")
681 (license license:gpl3+)))
682
683 (define-public guile3.0-git
684 (package-for-guile-3.0 guile-git))
685
686 (define-public guile2.0-git
687 (let ((base (package-for-guile-2.0 guile-git)))
688 (package
689 (inherit base)
690 ;; Libgit2's Guile test driver requires (ice-9 textual-ports), which is
691 ;; not in Guile 2.0. Thus, keep LIBGIT2 as-is here (i.e., built against
692 ;; Guile 2.2).
693 (inputs `(("libgit2" ,libgit2)
694 ,@(srfi-1:alist-delete "libgit2"
695 (package-inputs base)))))))
696
697 ;;; guile.scm ends here
698