gnu: guile-next: Update to 2.9.9.
[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-2.2-skip-oom-test.patch"))
234
235 ;; Remove the pre-built object files. Instead, build everything
236 ;; from source, at the expense of significantly longer build
237 ;; times (almost 3 hours on a 4-core Intel i5).
238 (snippet '(begin
239 (for-each delete-file
240 (find-files "prebuilt" "\\.go$"))
241 #t))))
242 (properties '((timeout . 72000) ;20 hours
243 (max-silent-time . 36000))) ;10 hours (needed on ARM
244 ; when heavily loaded)
245 (native-search-paths
246 (list (search-path-specification
247 (variable "GUILE_LOAD_PATH")
248 (files '("share/guile/site/2.2")))
249 (search-path-specification
250 (variable "GUILE_LOAD_COMPILED_PATH")
251 (files '("lib/guile/2.2/site-ccache")))))))
252
253 (define-public guile-2.2/bug-fix
254 ;; This variant contains a bug fix for a relatively rare crash that could
255 ;; affect shepherd as PID 1: <https://bugs.gnu.org/37757>.
256 (package
257 (inherit guile-2.2)
258 (version (string-append (package-version guile-2.2) "-1"))
259 (source (origin
260 (inherit (package-source guile-2.2))
261 (patches
262 (append (search-patches "guile-finalization-crash.patch")
263 (origin-patches (package-source guile-2.2))))))))
264
265 (define-public guile-2.2/fixed
266 ;; A package of Guile 2.2 that's rarely changed. It is the one used
267 ;; in the `base' module, and thus changing it entails a full rebuild.
268 (package
269 (inherit guile-2.2)
270 (properties '((hidden? . #t) ;people should install 'guile-2.2'
271 (timeout . 72000) ;20 hours
272 (max-silent-time . 36000))))) ;10 hours (needed on ARM
273 ; when heavily loaded)
274 (define-public guile-2.2.4
275 (package/inherit
276 guile-2.2
277 (version "2.2.4")
278 (source (origin
279 (inherit (package-source guile-2.2))
280 (uri (string-append "mirror://gnu/guile/guile-" version
281 ".tar.xz"))
282 (sha256
283 (base32
284 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))))))
285
286 (define-public guile-next
287 ;; This is the upcoming Guile 3.0, with JIT support.
288 (package
289 (inherit guile-2.2)
290 (name "guile-next")
291 (version "2.9.9")
292 (source (origin
293 (inherit (package-source guile-2.2))
294 (uri (string-append "ftp://alpha.gnu.org/gnu/guile/guile-"
295 version ".tar.xz"))
296 (sha256
297 (base32
298 "0s99zzdzj29fb42q5fwn7vqg9k7y9ppq9vkv4p39zr93z8694wdz"))))
299 (native-search-paths
300 (list (search-path-specification
301 (variable "GUILE_LOAD_PATH")
302 (files '("share/guile/site/3.0")))
303 (search-path-specification
304 (variable "GUILE_LOAD_COMPILED_PATH")
305 (files '("lib/guile/3.0/site-ccache"
306 "share/guile/site/3.0")))))
307 (properties '((ftp-server . "alpha.gnu.org")
308 (upstream-name . "guile")))))
309
310 (define (make-guile-readline guile)
311 (package
312 (name "guile-readline")
313 (version (package-version guile))
314 (source (package-source guile))
315 (build-system gnu-build-system)
316 (arguments
317 '(#:configure-flags '("--disable-silent-rules")
318 #:phases (modify-phases %standard-phases
319 (add-before 'build 'chdir
320 (lambda* (#:key outputs #:allow-other-keys)
321 (invoke "make" "-C" "libguile" "scmconfig.h")
322 (invoke "make" "-C" "lib")
323 (chdir "guile-readline")
324
325 (substitute* "Makefile"
326 (("../libguile/libguile-[[:graph:]]+\\.la")
327 ;; Remove dependency on libguile-X.Y.la.
328 "")
329 (("^READLINE_LIBS = (.*)$" _ libs)
330 ;; Link against the provided libguile.
331 (string-append "READLINE_LIBS = "
332 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
333 libs "\n"))
334 (("\\$\\(top_builddir\\)/meta/build-env")
335 ;; Use the provided Guile, not the one from
336 ;; $(builddir).
337 "")
338
339 ;; Install modules to the 'site' directories.
340 (("^moddir = .*$")
341 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
342 (("^ccachedir = .*$")
343 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
344
345 ;; Load 'guile-readline.so' from the right place.
346 (substitute* "ice-9/readline.scm"
347 (("load-extension \"guile-readline\"")
348 (format #f "load-extension \
349 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
350 (assoc-ref outputs "out"))))
351 #t)))))
352 (home-page (package-home-page guile))
353 (native-inputs (package-native-inputs guile))
354 (inputs
355 `(,@(package-inputs guile) ;to placate 'configure'
356 ,@(package-propagated-inputs guile)
357 ("guile" ,guile)
358 ("readline" ,readline)))
359 (synopsis "Line editing support for GNU Guile")
360 (description
361 "This module provides line editing support via the Readline library for
362 GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
363 @code{activate-readline} procedure to enable it.")
364 (license license:gpl3+)))
365
366 (define-public guile-readline
367 (make-guile-readline guile-2.2))
368
369 (define (guile-variant-package-name prefix)
370 (lambda (name)
371 "Return NAME with PREFIX instead of \"guile-\", when applicable."
372 (if (string-prefix? "guile-" name)
373 (string-append prefix "-"
374 (string-drop name
375 (string-length "guile-")))
376 name)))
377
378 (define package-for-guile-2.0
379 ;; A procedure that rewrites the dependency tree of the given package to use
380 ;; GUILE-2.0 instead of GUILE-2.2.
381 (package-input-rewriting `((,guile-2.2 . ,guile-2.0))
382 (guile-variant-package-name "guile2.0")))
383
384 (define package-for-guile-3.0
385 (package-input-rewriting `((,guile-2.2 . ,guile-next))
386 (guile-variant-package-name "guile3.0")))
387
388 (define-public guile-for-guile-emacs
389 (package (inherit guile-2.2)
390 (name "guile-for-guile-emacs")
391 (version "20150510.d8d9a8d")
392 (source (origin
393 (method git-fetch)
394 (uri (git-reference
395 (url "git://git.hcoop.net/git/bpt/guile.git")
396 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
397 (file-name (string-append name "-" version "-checkout"))
398 (sha256
399 (base32
400 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
401 (arguments
402 `(;; Tests aren't passing for now.
403 ;; Obviously we should re-enable this!
404 #:tests? #f
405 ,@(package-arguments guile-2.2)))
406 (native-inputs
407 `(("autoconf" ,autoconf)
408 ("automake" ,automake)
409 ("libtool" ,libtool)
410 ("flex" ,flex)
411 ("texinfo" ,texinfo)
412 ("gettext" ,gettext-minimal)
413 ,@(package-native-inputs guile-2.2)))
414 ;; Same as in guile-2.0
415 (native-search-paths
416 (list (search-path-specification
417 (variable "GUILE_LOAD_PATH")
418 (files '("share/guile/site/2.0")))
419 (search-path-specification
420 (variable "GUILE_LOAD_COMPILED_PATH")
421 (files '("lib/guile/2.0/site-ccache"
422 "share/guile/site/2.0")))))))
423
424 \f
425 ;;;
426 ;;; Extensions.
427 ;;;
428
429 (define-public guile-json-1
430 (package
431 (name "guile-json")
432 (version "1.2.0")
433 (home-page "https://github.com/aconchillo/guile-json")
434 (source (origin
435 (method url-fetch)
436 (uri (string-append "mirror://savannah/guile-json/guile-json-"
437 version ".tar.gz"))
438 (sha256
439 (base32
440 "15gnb84d7hpazqhskkf3g9z4r6knw54wfj4ch5270kakz1lp70c9"))))
441 (build-system gnu-build-system)
442 (native-inputs `(("pkg-config" ,pkg-config)
443 ("guile" ,guile-2.2)))
444 (inputs `(("guile" ,guile-2.2)))
445 (synopsis "JSON module for Guile")
446 (description
447 "Guile-JSON supports parsing and building JSON documents according to the
448 specification. These are the main features:
449
450 @itemize
451 @item Strictly complies to @uref{http://json.org, specification}.
452 @item Build JSON documents programmatically via macros.
453 @item Unicode support for strings.
454 @item Allows JSON pretty printing.
455 @end itemize\n")
456
457 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
458 (license license:gpl3+)))
459
460 ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
461 ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
462 ;; 'guile-json-3'.
463 (define-deprecated guile-json guile-json-1)
464 (export guile-json)
465
466 (define-public guile2.0-json
467 (package-for-guile-2.0 guile-json-1))
468
469 (define-public guile-json-3
470 ;; This version is incompatible with 1.x; see the 'NEWS' file.
471 (package
472 (inherit guile-json-1)
473 (name "guile-json")
474 (version "3.2.0")
475 (source (origin
476 (method url-fetch)
477 (uri (string-append "mirror://savannah/guile-json/guile-json-"
478 version ".tar.gz"))
479 (sha256
480 (base32
481 "14m6b6g2maw0mkvfm4x63rqb54vgbpn1gcqs715ijw4bikfzlqfz"))))))
482
483 (define-public guile3.0-json
484 (package-for-guile-3.0 guile-json-3))
485
486 ;; There are two guile-gdbm packages, one using the FFI and one with
487 ;; direct C bindings, hence the verbose name.
488
489 (define-public guile-gdbm-ffi
490 (package
491 (name "guile-gdbm-ffi")
492 (version "20120209.fa1d5b6")
493 (source (origin
494 (method git-fetch)
495 (uri (git-reference
496 (url "https://github.com/ijp/guile-gdbm.git")
497 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
498 (file-name (string-append name "-" version "-checkout"))
499 (patches (search-patches
500 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
501 (sha256
502 (base32
503 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
504 (build-system guile-build-system)
505 (arguments
506 '(#:phases (modify-phases %standard-phases
507 (add-after 'unpack 'move-examples
508 (lambda* (#:key outputs #:allow-other-keys)
509 ;; Move examples where they belong.
510 (let* ((out (assoc-ref outputs "out"))
511 (doc (string-append out "/share/doc/"
512 (strip-store-file-name out)
513 "/examples")))
514 (copy-recursively "examples" doc)
515 (delete-file-recursively "examples")
516 #t)))
517 (add-after 'unpack 'set-libgdbm-file-name
518 (lambda* (#:key inputs #:allow-other-keys)
519 (substitute* "gdbm.scm"
520 (("\\(dynamic-link \"libgdbm\"\\)")
521 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
522 (assoc-ref inputs "gdbm"))))
523 #t)))))
524 (native-inputs
525 `(("guile" ,guile-2.2)))
526 (inputs
527 `(("gdbm" ,gdbm)))
528 (home-page "https://github.com/ijp/guile-gdbm")
529 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
530 (description
531 "Guile bindings to the GDBM key-value storage system, using
532 Guile's foreign function interface.")
533 (license license:gpl3+)))
534
535 (define-public guile2.0-gdbm-ffi
536 (package-for-guile-2.0 guile-gdbm-ffi))
537
538 (define-public guile3.0-gdbm-ffi
539 (package-for-guile-3.0 guile-gdbm-ffi))
540
541 (define-public guile-sqlite3
542 (package
543 (name "guile-sqlite3")
544 (version "0.1.0")
545 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
546 (source (origin
547 (method git-fetch)
548 (uri (git-reference
549 (url home-page)
550 (commit (string-append "v" version))))
551 (sha256
552 (base32
553 "1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
554 (file-name (string-append name "-" version "-checkout"))
555 (modules '((guix build utils)))
556 (snippet
557 '(begin
558 ;; Allow builds with Guile 3.0.
559 (substitute* "configure.ac"
560 (("^GUILE_PKG.*")
561 "GUILE_PKG([3.0 2.2 2.0])\n"))
562 #t))))
563 (build-system gnu-build-system)
564 (native-inputs
565 `(("autoconf" ,autoconf)
566 ("automake" ,automake)
567 ("pkg-config" ,pkg-config)))
568 (inputs
569 `(("guile" ,guile-2.2)
570 ("sqlite" ,sqlite)))
571 (synopsis "Access SQLite databases from Guile")
572 (description
573 "This package provides Guile bindings to the SQLite database system.")
574 (license license:gpl3+)))
575
576 (define-public guile2.0-sqlite3
577 (package-for-guile-2.0 guile-sqlite3))
578
579 (define-public guile3.0-sqlite3
580 (package-for-guile-3.0 guile-sqlite3))
581
582 (define-public guile-bytestructures
583 (package
584 (name "guile-bytestructures")
585 (version "1.0.7")
586 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
587 (source (origin
588 (method git-fetch)
589 (uri (git-reference
590 (url home-page)
591 (commit (string-append "v" version))))
592 (file-name (git-file-name name version))
593 (sha256
594 (base32
595 "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb"))))
596 (build-system gnu-build-system)
597 (arguments
598 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
599
600 #:phases (modify-phases %standard-phases
601 (add-after 'install 'install-doc
602 (lambda* (#:key outputs #:allow-other-keys)
603 (let* ((out (assoc-ref outputs "out"))
604 (package ,(package-full-name this-package "-"))
605 (doc (string-append out "/share/doc/" package)))
606 (install-file "README.md" doc)
607 #t))))))
608 (native-inputs
609 `(("autoconf" ,autoconf)
610 ("automake" ,automake)
611 ("pkg-config" ,pkg-config)
612 ("guile" ,guile-2.2)))
613 (inputs
614 `(("guile" ,guile-2.2)))
615 (synopsis "Structured access to bytevector contents for Guile")
616 (description
617 "Guile bytestructures offers a system imitating the type system
618 of the C programming language, to be used on bytevectors. C's type
619 system works on raw memory, and Guile works on bytevectors which are
620 an abstraction over raw memory. It's also more powerful than the C
621 type system, elevating types to first-class status.")
622 (license license:gpl3+)
623 (properties '((upstream-name . "bytestructures")))))
624
625 (define-public guile2.0-bytestructures
626 (package-for-guile-2.0 guile-bytestructures))
627
628 (define-public guile3.0-bytestructures
629 (package-for-guile-3.0 guile-bytestructures))
630
631 (define-public guile-git
632 (package
633 (name "guile-git")
634 (version "0.2.0")
635 (home-page "https://gitlab.com/guile-git/guile-git.git")
636 (source (origin
637 (method git-fetch)
638 (uri (git-reference (url home-page)
639 (commit (string-append "v" version))))
640 (sha256
641 (base32
642 "018hmfsh0rjwfvr4h7y10jc6k8a2k9xsirngghy3pjasin4nd2yz"))
643 (file-name (git-file-name name version))
644 (modules '((guix build utils)))
645 (snippet
646 '(begin
647 ;; Allow builds with Guile 3.0.
648 (substitute* "configure.ac"
649 (("^GUILE_PKG.*")
650 "GUILE_PKG([3.0 2.2 2.0])\n"))
651
652 ;; The 'guile.m4' that's shipped is too old and fails to
653 ;; recognize Guile 2.9/3.0. Delete it and pick the one
654 ;; provided by the Guile we're using.
655 (delete-file "m4/guile.m4")
656
657 #t))))
658 (build-system gnu-build-system)
659 (native-inputs
660 `(("autoconf" ,autoconf)
661 ("automake" ,automake)
662 ("texinfo" ,texinfo)
663 ("pkg-config" ,pkg-config)))
664 (inputs
665 `(("guile" ,guile-2.2)
666 ("libgit2" ,libgit2)))
667 (propagated-inputs
668 `(("guile-bytestructures" ,guile-bytestructures)))
669 (synopsis "Guile bindings for libgit2")
670 (description
671 "This package provides Guile bindings to libgit2, a library to
672 manipulate repositories of the Git version control system.")
673 (license license:gpl3+)))
674
675 (define-public guile3.0-git
676 (package-for-guile-3.0 guile-git))
677
678 (define-public guile2.0-git
679 (let ((base (package-for-guile-2.0 guile-git)))
680 (package
681 (inherit base)
682 ;; Libgit2's Guile test driver requires (ice-9 textual-ports), which is
683 ;; not in Guile 2.0. Thus, keep LIBGIT2 as-is here (i.e., built against
684 ;; Guile 2.2).
685 (inputs `(("libgit2" ,libgit2)
686 ,@(srfi-1:alist-delete "libgit2"
687 (package-inputs base)))))))
688
689 ;;; guile.scm ends here
690