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