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, 2020 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 ,@(if (hurd-system?)
184 '((add-after 'unpack 'disable-tests
185 (lambda _
186 ;; Hangs at: "Running 00-repl-server.test"
187 (rename-file "test-suite/tests/00-repl-server.test" "00-repl-server.test")
188 ;; Sometimes Hangs at: "Running 00-socket.test"
189 (rename-file "test-suite/tests/00-socket.test" "00-socket.test")
190 ;; FAIL: srfi-18.test: thread-sleep!: thread sleeps fractions of a second
191 (rename-file "test-suite/tests/srfi-18.test" "srfi-18.test")
192 ;; failed to remove 't-guild-compile-7215.go.tdL7yC
193 (substitute* "test-suite/standalone/Makefile.in"
194 (("test-guild-compile ") ""))
195 #t)))
196 '())
197 (add-before 'configure 'pre-configure
198 (lambda* (#:key inputs #:allow-other-keys)
199 ;; Tell (ice-9 popen) the file name of Bash.
200 (let ((bash (assoc-ref inputs "bash")))
201 (substitute* "module/ice-9/popen.scm"
202 ;; If bash is #f allow fallback for user to provide
203 ;; "bash" in PATH. This happens when cross-building to
204 ;; MinGW for which we do not have Bash yet.
205 (("/bin/sh")
206 ,@(if (target-mingw?)
207 '((if bash
208 (string-append bash "/bin/bash")
209 "bash"))
210 '((string-append bash "/bin/bash")))))
211 #t))))))
212
213 (native-search-paths
214 (list (search-path-specification
215 (variable "GUILE_LOAD_PATH")
216 (files '("share/guile/site/2.0")))
217 (search-path-specification
218 (variable "GUILE_LOAD_COMPILED_PATH")
219 (files '("lib/guile/2.0/site-ccache")))))
220
221 (synopsis "Scheme implementation intended especially for extensions")
222 (description
223 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
224 official extension language of the GNU system. It is an implementation of
225 the Scheme language which can be easily embedded in other applications to
226 provide a convenient means of extending the functionality of the application
227 without requiring the source code to be rewritten.")
228 (home-page "https://www.gnu.org/software/guile/")
229 (license license:lgpl3+)))
230
231 (define-public guile-2.2
232 (package (inherit guile-2.0)
233 (name "guile")
234 (version "2.2.7")
235 (source (origin
236 (method url-fetch)
237
238 ;; Note: we are limited to one of the compression formats
239 ;; supported by the bootstrap binaries, so no lzip here.
240 (uri (string-append "mirror://gnu/guile/guile-" version
241 ".tar.xz"))
242 (sha256
243 (base32
244 "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd"))
245 (modules '((guix build utils)))
246 (patches (search-patches
247 "guile-2.2-skip-oom-test.patch"))
248
249 ;; Remove the pre-built object files. Instead, build everything
250 ;; from source, at the expense of significantly longer build
251 ;; times (almost 3 hours on a 4-core Intel i5).
252 (snippet '(begin
253 (for-each delete-file
254 (find-files "prebuilt" "\\.go$"))
255 #t))))
256 (properties '((timeout . 72000) ;20 hours
257 (max-silent-time . 36000))) ;10 hours (needed on ARM
258 ; when heavily loaded)
259 (native-search-paths
260 (list (search-path-specification
261 (variable "GUILE_LOAD_PATH")
262 (files '("share/guile/site/2.2")))
263 (search-path-specification
264 (variable "GUILE_LOAD_COMPILED_PATH")
265 (files '("lib/guile/2.2/site-ccache")))))))
266
267 (define-deprecated guile-2.2/bug-fix guile-2.2)
268
269 (define-public guile-2.2.4
270 (package/inherit
271 guile-2.2
272 (version "2.2.4")
273 (source (origin
274 (inherit (package-source guile-2.2))
275 (uri (string-append "mirror://gnu/guile/guile-" version
276 ".tar.xz"))
277 (sha256
278 (base32
279 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))))))
280
281 (define-public guile-3.0
282 ;; This is the latest Guile stable version.
283 (package
284 (inherit guile-2.2)
285 (name "guile")
286 (version "3.0.2")
287 (source (origin
288 (inherit (package-source guile-2.2))
289 (uri (string-append "mirror://gnu/guile/guile-"
290 version ".tar.xz"))
291 (sha256
292 (base32
293 "12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k"))))
294 (native-search-paths
295 (list (search-path-specification
296 (variable "GUILE_LOAD_PATH")
297 (files '("share/guile/site/3.0")))
298 (search-path-specification
299 (variable "GUILE_LOAD_COMPILED_PATH")
300 (files '("lib/guile/3.0/site-ccache"
301 "share/guile/site/3.0")))))))
302
303 (define-public guile-next guile-3.0)
304
305 (define-public guile-3.0/fixed
306 ;; A package of Guile that's rarely changed. It is the one used in the
307 ;; `base' module, and thus changing it entails a full rebuild.
308 (package
309 (inherit guile-3.0)
310 (properties '((hidden? . #t) ;people should install 'guile-2.2'
311 (timeout . 72000) ;20 hours
312 (max-silent-time . 36000))))) ;10 hours (needed on ARM
313 ; when heavily loaded)
314
315 (define* (make-guile-readline guile #:optional (name "guile-readline"))
316 (package
317 (name name)
318 (version (package-version guile))
319 (source (package-source guile))
320 (build-system gnu-build-system)
321 (arguments
322 '(#:configure-flags '("--disable-silent-rules")
323 #:phases (modify-phases %standard-phases
324 (add-before 'build 'chdir
325 (lambda* (#:key outputs #:allow-other-keys)
326 (invoke "make" "-C" "libguile" "scmconfig.h")
327 (invoke "make" "-C" "lib")
328 (chdir "guile-readline")
329
330 (substitute* "Makefile"
331 (("../libguile/libguile-[[:graph:]]+\\.la")
332 ;; Remove dependency on libguile-X.Y.la.
333 "")
334 (("^READLINE_LIBS = (.*)$" _ libs)
335 ;; Link against the provided libguile.
336 (string-append "READLINE_LIBS = "
337 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
338 libs "\n"))
339 (("\\$\\(top_builddir\\)/meta/build-env")
340 ;; Use the provided Guile, not the one from
341 ;; $(builddir).
342 "")
343
344 ;; Install modules to the 'site' directories.
345 (("^moddir = .*$")
346 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
347 (("^ccachedir = .*$")
348 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
349
350 ;; Load 'guile-readline.so' from the right place.
351 (substitute* "ice-9/readline.scm"
352 (("load-extension \"guile-readline\"")
353 (format #f "load-extension \
354 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
355 (assoc-ref outputs "out"))))
356 #t)))))
357 (home-page (package-home-page guile))
358 (native-inputs (package-native-inputs guile))
359 (inputs
360 `(,@(package-inputs guile) ;to placate 'configure'
361 ,@(package-propagated-inputs guile)
362 ("guile" ,guile)
363 ("readline" ,readline)))
364 (synopsis "Line editing support for GNU Guile")
365 (description
366 "This module provides line editing support via the Readline library for
367 GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
368 @code{activate-readline} procedure to enable it.")
369 (license license:gpl3+)))
370
371 (define-public guile-readline
372 (make-guile-readline guile-3.0))
373
374 (define-public guile2.2-readline
375 (make-guile-readline guile-2.2 "guile2.2-readline"))
376
377 (define (guile-variant-package-name prefix)
378 (lambda (name)
379 "Return NAME with PREFIX instead of \"guile-\", when applicable."
380 (if (string-prefix? "guile-" name)
381 (string-append prefix "-"
382 (string-drop name
383 (string-length "guile-")))
384 name)))
385
386 (define package-for-guile-2.0
387 ;; A procedure that rewrites the dependency tree of the given package to use
388 ;; GUILE-2.0 instead of GUILE-3.0.
389 (package-input-rewriting `((,guile-3.0 . ,guile-2.0))
390 (guile-variant-package-name "guile2.0")))
391
392 (define package-for-guile-2.2
393 (package-input-rewriting `((,guile-3.0 . ,guile-2.2))
394 (guile-variant-package-name "guile2.2")))
395
396 (define-syntax define-deprecated-guile3.0-package
397 (lambda (s)
398 "Define a deprecated package alias for \"guile3.0-something\"."
399 (syntax-case s ()
400 ((_ name)
401 (and (identifier? #'name)
402 (string-prefix? "guile3.0-" (symbol->string (syntax->datum
403 #'name))))
404 (let ((->guile (lambda (str)
405 (let ((base (string-drop str
406 (string-length "guile3.0-"))))
407 (string-append "guile-" base)))))
408 (with-syntax ((package-name (symbol->string (syntax->datum #'name)))
409 (package
410 (datum->syntax
411 #'name
412 (string->symbol
413 (->guile (symbol->string (syntax->datum #'name)))))))
414 #'(begin
415 (define-deprecated name package
416 (deprecated-package package-name package))
417 (export name))))))))
418
419 (define-deprecated-guile3.0-package guile3.0-readline)
420
421 (define-public guile-for-guile-emacs
422 (let ((commit "15ca78482ac0dd2e3eb36dcb31765d8652d7106d")
423 (revision "1"))
424 (package (inherit guile-2.2)
425 (name "guile-for-guile-emacs")
426 (version (git-version "2.1.2" revision commit))
427 (source (origin
428 (method git-fetch)
429 (uri (git-reference
430 (url "git://git.savannah.gnu.org/guile.git")
431 (commit commit)))
432 (file-name (git-file-name name version))
433 (sha256
434 (base32
435 "1l7ik4q4zk7vq4m3gnwizc0b64b1mdr31hxqlzxs94xaf2lvi7s2"))))
436 (arguments
437 (substitute-keyword-arguments (package-arguments guile-2.2)
438 ((#:phases phases '%standard-phases)
439 `(modify-phases ,phases
440 (replace 'bootstrap
441 (lambda _
442 ;; Disable broken tests.
443 ;; TODO: Fix them!
444 (substitute* "test-suite/tests/gc.test"
445 (("\\(pass-if \"after-gc-hook gets called\"" m)
446 (string-append "#;" m)))
447 (substitute* "test-suite/tests/version.test"
448 (("\\(pass-if \"version reporting works\"" m)
449 (string-append "#;" m)))
450 ;; Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler.
451 ;; FAIL: test-out-of-memory
452 (substitute* "test-suite/standalone/Makefile.am"
453 (("(check_SCRIPTS|TESTS) \\+= test-out-of-memory") ""))
454
455 (patch-shebang "build-aux/git-version-gen")
456 (invoke "sh" "autogen.sh")
457 #t))))))
458 (native-inputs
459 `(("autoconf" ,autoconf)
460 ("automake" ,automake)
461 ("libtool" ,libtool)
462 ("flex" ,flex)
463 ("texinfo" ,texinfo)
464 ("gettext" ,gettext-minimal)
465 ,@(package-native-inputs guile-2.2))))))
466
467 \f
468 ;;;
469 ;;; Extensions.
470 ;;;
471
472 (define-public guile-json-1
473 (package
474 (name "guile-json")
475 (version "1.2.0")
476 (home-page "https://github.com/aconchillo/guile-json")
477 (source (origin
478 (method url-fetch)
479 (uri (string-append "mirror://savannah/guile-json/guile-json-"
480 version ".tar.gz"))
481 (sha256
482 (base32
483 "15gnb84d7hpazqhskkf3g9z4r6knw54wfj4ch5270kakz1lp70c9"))))
484 (build-system gnu-build-system)
485 (native-inputs `(("pkg-config" ,pkg-config)
486 ("guile" ,guile-2.2)))
487 (inputs `(("guile" ,guile-2.2)))
488 (synopsis "JSON module for Guile")
489 (description
490 "Guile-JSON supports parsing and building JSON documents according to the
491 specification. These are the main features:
492
493 @itemize
494 @item Strictly complies to @uref{http://json.org, specification}.
495 @item Build JSON documents programmatically via macros.
496 @item Unicode support for strings.
497 @item Allows JSON pretty printing.
498 @end itemize\n")
499
500 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
501 (license license:gpl3+)))
502
503 ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
504 ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
505 ;; 'guile-json-3'.
506 (define-deprecated guile-json guile-json-1)
507 (export guile-json)
508
509 (define-public guile2.0-json
510 (package-for-guile-2.0 guile-json-1))
511
512 (define-public guile-json-3
513 ;; This version is incompatible with 1.x; see the 'NEWS' file.
514 (package
515 (inherit guile-json-1)
516 (name "guile-json")
517 (version "3.2.0")
518 (source (origin
519 (method url-fetch)
520 (uri (string-append "mirror://savannah/guile-json/guile-json-"
521 version ".tar.gz"))
522 (sha256
523 (base32
524 "14m6b6g2maw0mkvfm4x63rqb54vgbpn1gcqs715ijw4bikfzlqfz"))))
525 (native-inputs `(("pkg-config" ,pkg-config)
526 ("guile" ,guile-3.0)))
527 (inputs `(("guile" ,guile-3.0)))))
528
529 (define-public guile2.2-json
530 (package-for-guile-2.2 guile-json-3))
531
532 (define-public guile3.0-json
533 (deprecated-package "guile3.0-json" guile-json-3))
534
535 ;; There are two guile-gdbm packages, one using the FFI and one with
536 ;; direct C bindings, hence the verbose name.
537
538 (define-public guile-gdbm-ffi
539 (package
540 (name "guile-gdbm-ffi")
541 (version "20120209.fa1d5b6")
542 (source (origin
543 (method git-fetch)
544 (uri (git-reference
545 (url "https://github.com/ijp/guile-gdbm.git")
546 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
547 (file-name (string-append name "-" version "-checkout"))
548 (patches (search-patches
549 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
550 (sha256
551 (base32
552 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
553 (build-system guile-build-system)
554 (arguments
555 '(#:phases (modify-phases %standard-phases
556 (add-after 'unpack 'move-examples
557 (lambda* (#:key outputs #:allow-other-keys)
558 ;; Move examples where they belong.
559 (let* ((out (assoc-ref outputs "out"))
560 (doc (string-append out "/share/doc/"
561 (strip-store-file-name out)
562 "/examples")))
563 (copy-recursively "examples" doc)
564 (delete-file-recursively "examples")
565 #t)))
566 (add-after 'unpack 'set-libgdbm-file-name
567 (lambda* (#:key inputs #:allow-other-keys)
568 (substitute* "gdbm.scm"
569 (("\\(dynamic-link \"libgdbm\"\\)")
570 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
571 (assoc-ref inputs "gdbm"))))
572 #t)))))
573 (native-inputs
574 `(("guile" ,guile-3.0)))
575 (inputs
576 `(("gdbm" ,gdbm)))
577 (home-page "https://github.com/ijp/guile-gdbm")
578 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
579 (description
580 "Guile bindings to the GDBM key-value storage system, using
581 Guile's foreign function interface.")
582 (license license:gpl3+)))
583
584 (define-public guile2.0-gdbm-ffi
585 (package-for-guile-2.0 guile-gdbm-ffi))
586
587 (define-public guile2.2-gdbm-ffi
588 (package-for-guile-2.2 guile-gdbm-ffi))
589
590 (define-deprecated-guile3.0-package guile3.0-gdbm-ffi)
591
592 (define-public guile-sqlite3
593 (package
594 (name "guile-sqlite3")
595 (version "0.1.0")
596 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
597 (source (origin
598 (method git-fetch)
599 (uri (git-reference
600 (url home-page)
601 (commit (string-append "v" version))))
602 (sha256
603 (base32
604 "1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
605 (file-name (string-append name "-" version "-checkout"))
606 (patches
607 (search-patches "guile-sqlite3-fix-cross-compilation.patch"))
608 (modules '((guix build utils)))
609 (snippet
610 '(begin
611 ;; Allow builds with Guile 3.0.
612 (substitute* "configure.ac"
613 (("^GUILE_PKG.*")
614 "GUILE_PKG([3.0 2.2 2.0])\n"))
615 #t))))
616 (build-system gnu-build-system)
617 (native-inputs
618 `(("autoconf" ,autoconf)
619 ("automake" ,automake)
620 ("guile" ,guile-3.0)
621 ("pkg-config" ,pkg-config)))
622 (inputs
623 `(("guile" ,guile-3.0)
624 ("sqlite" ,sqlite)))
625 (synopsis "Access SQLite databases from Guile")
626 (description
627 "This package provides Guile bindings to the SQLite database system.")
628 (license license:gpl3+)))
629
630 (define-public guile2.0-sqlite3
631 (package-for-guile-2.0 guile-sqlite3))
632
633 (define-public guile2.2-sqlite3
634 (package-for-guile-2.2 guile-sqlite3))
635
636 (define-deprecated-guile3.0-package guile3.0-sqlite3)
637
638 (define-public guile-bytestructures
639 (package
640 (name "guile-bytestructures")
641 (version "1.0.7")
642 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
643 (source (origin
644 (method git-fetch)
645 (uri (git-reference
646 (url home-page)
647 (commit (string-append "v" version))))
648 (file-name (git-file-name name version))
649 (sha256
650 (base32
651 "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb"))))
652 (build-system gnu-build-system)
653 (arguments
654 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
655
656 #:phases (modify-phases %standard-phases
657 (add-after 'install 'install-doc
658 (lambda* (#:key outputs #:allow-other-keys)
659 (let* ((out (assoc-ref outputs "out"))
660 (package ,(package-full-name this-package "-"))
661 (doc (string-append out "/share/doc/" package)))
662 (install-file "README.md" doc)
663 #t))))))
664 (native-inputs
665 `(("autoconf" ,autoconf)
666 ("automake" ,automake)
667 ("pkg-config" ,pkg-config)
668 ("guile" ,guile-3.0)))
669 (inputs
670 `(("guile" ,guile-3.0)))
671 (synopsis "Structured access to bytevector contents for Guile")
672 (description
673 "Guile bytestructures offers a system imitating the type system
674 of the C programming language, to be used on bytevectors. C's type
675 system works on raw memory, and Guile works on bytevectors which are
676 an abstraction over raw memory. It's also more powerful than the C
677 type system, elevating types to first-class status.")
678 (license license:gpl3+)
679 (properties '((upstream-name . "bytestructures")))))
680
681 (define-public guile2.0-bytestructures
682 (package-for-guile-2.0 guile-bytestructures))
683
684 (define-public guile2.2-bytestructures
685 (package-for-guile-2.2 guile-bytestructures))
686
687 (define-deprecated-guile3.0-package guile3.0-bytestructures)
688
689 (define-public guile-git
690 (package
691 (name "guile-git")
692 (version "0.3.0")
693 (home-page "https://gitlab.com/guile-git/guile-git.git")
694 (source (origin
695 (method url-fetch)
696 (uri (string-append "https://gitlab.com/guile-git/guile-git/uploads/"
697 "4c563d8e7e1ff84396abe8ca7011bcaf/guile-git-"
698 version ".tar.gz"))
699 (sha256
700 (base32
701 "0c5i3d16hp7gp9rd78vk9zc45js8bphf92m4lbb5gyi4l1yl7kkm"))))
702 (build-system gnu-build-system)
703 (native-inputs
704 `(("pkg-config" ,pkg-config)
705 ("guile" ,guile-3.0)
706 ("guile-bytestructures" ,guile-bytestructures)))
707 (inputs
708 `(("guile" ,guile-3.0)
709 ("libgit2" ,libgit2)))
710 (propagated-inputs
711 `(("guile-bytestructures" ,guile-bytestructures)))
712 (synopsis "Guile bindings for libgit2")
713 (description
714 "This package provides Guile bindings to libgit2, a library to
715 manipulate repositories of the Git version control system.")
716 (license license:gpl3+)))
717
718 (define-public guile2.2-git
719 (package-for-guile-2.2 guile-git))
720
721 (define-public guile2.0-git
722 (let ((base (package-for-guile-2.0 guile-git)))
723 (package
724 (inherit base)
725 ;; Libgit2's Guile test driver requires (ice-9 textual-ports), which is
726 ;; not in Guile 2.0. Thus, keep LIBGIT2 as-is here (i.e., built against
727 ;; Guile 2.2).
728 (inputs `(("libgit2" ,libgit2)
729 ,@(srfi-1:alist-delete "libgit2"
730 (package-inputs base)))))))
731
732 (define-deprecated-guile3.0-package guile3.0-git)
733
734 ;;; guile.scm ends here
735