gnu: r-quantreg: Update to 5.67.
[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 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
19 ;;;
20 ;;; This file is part of GNU Guix.
21 ;;;
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
26 ;;;
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
31 ;;;
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35 (define-module (gnu packages guile)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages bash)
41 #:use-module (gnu packages bdw-gc)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages dbm)
44 #:use-module (gnu packages flex)
45 #:use-module (gnu packages gawk)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages hurd)
48 #:use-module (gnu packages libffi)
49 #:use-module (gnu packages libunistring)
50 #:use-module (gnu packages linux)
51 #:use-module (gnu packages m4)
52 #:use-module (gnu packages multiprecision)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages readline)
55 #:use-module (gnu packages sqlite)
56 #:use-module (gnu packages texinfo)
57 #:use-module (gnu packages version-control)
58 #:use-module (guix packages)
59 #:use-module (guix download)
60 #:use-module (guix git-download)
61 #:use-module (guix build-system gnu)
62 #:use-module (guix build-system guile)
63 #:use-module (guix deprecation)
64 #:use-module (guix utils)
65 #:use-module (ice-9 match)
66 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
67
68 ;;; Commentary:
69 ;;;
70 ;;; GNU Guile, and modules and extensions.
71 ;;;
72 ;;; Code:
73
74 (define-public guile-1.8
75 (package
76 (name "guile")
77 (version "1.8.8")
78 (source (origin
79 (method url-fetch)
80 (uri (string-append "mirror://gnu/guile/guile-" version
81 ".tar.gz"))
82 (sha256
83 (base32
84 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
85 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
86 (build-system gnu-build-system)
87 (arguments '(#:configure-flags '("--disable-error-on-warning")
88
89 ;; Insert a phase before `configure' to patch things up.
90 #:phases
91 (modify-phases %standard-phases
92 (add-before 'configure 'patch-stuff
93 (lambda* (#:key outputs #:allow-other-keys)
94 ;; Add a call to `lt_dladdsearchdir' so that
95 ;; `libguile-readline.so' & co. are in the
96 ;; loader's search path.
97 (substitute* "libguile/dynl.c"
98 (("lt_dlinit.*$" match)
99 (format #f
100 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
101 match
102 (assoc-ref outputs "out"))))
103
104 ;; The usual /bin/sh...
105 (substitute* "ice-9/popen.scm"
106 (("/bin/sh") (which "sh")))
107 #t)))))
108
109 ;; When cross-compiling, a native version of Guile itself is needed.
110 (native-inputs (if (%current-target-system)
111 `(("self" ,this-package))
112 '()))
113
114 (inputs `(("gawk" ,gawk)
115 ("readline" ,readline)))
116
117 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
118 ;; propagated.
119 (propagated-inputs `(("gmp" ,gmp)
120 ("libltdl" ,libltdl)))
121
122 (native-search-paths
123 (list (search-path-specification
124 (variable "GUILE_LOAD_PATH")
125 (files '("share/guile/site")))))
126
127 (synopsis "Scheme implementation intended especially for extensions")
128 (description
129 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
130 official extension language of the GNU system. It is an implementation of
131 the Scheme language which can be easily embedded in other applications to
132 provide a convenient means of extending the functionality of the application
133 without requiring the source code to be rewritten.")
134 (home-page "https://www.gnu.org/software/guile/")
135 (license license:lgpl2.0+)))
136
137 (define-public guile-2.0
138 (package
139 (name "guile")
140 (version "2.0.14")
141 (source (origin
142 (method url-fetch)
143 (uri (string-append "mirror://gnu/guile/guile-" version
144 ".tar.xz"))
145 (sha256
146 (base32
147 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
148 (build-system gnu-build-system)
149
150 ;; When cross-compiling, a native version of Guile itself is needed.
151 (native-inputs `(,@(if (%current-target-system)
152 `(("self" ,this-package))
153 '())
154 ("pkgconfig" ,pkg-config)))
155 (inputs `(("libffi" ,libffi)
156 ,@(libiconv-if-needed)
157
158 ;; We need Bash when cross-compiling because some of the scripts
159 ;; in bin/ refer to it. Use 'bash-minimal' because we don't need
160 ;; an interactive Bash with Readline and all.
161 ,@(if (target-mingw?) '() `(("bash" ,bash-minimal)))))
162 (propagated-inputs
163 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
164 ;; reads `-lltdl -lunistring', adding them here will add the needed
165 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
166 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
167 ("libunistring" ,libunistring)
168
169 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
170 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
171 ("libltdl" ,libltdl)
172
173 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
174 ;; must be propagated.
175 ("bdw-gc" ,libgc)
176 ("gmp" ,gmp)))
177
178 (outputs '("out" "debug"))
179
180 (arguments
181 `(#:configure-flags '("--disable-static") ; saves 3 MiB
182 #:phases
183 (modify-phases %standard-phases
184 ,@(if (hurd-system?)
185 '((add-after 'unpack 'disable-tests
186 (lambda _
187 ;; Hangs at: "Running 00-repl-server.test"
188 (rename-file "test-suite/tests/00-repl-server.test" "00-repl-server.test")
189 ;; Sometimes Hangs at: "Running 00-socket.test"
190 (rename-file "test-suite/tests/00-socket.test" "00-socket.test")
191 ;; FAIL: srfi-18.test: thread-sleep!: thread sleeps fractions of a second
192 (rename-file "test-suite/tests/srfi-18.test" "srfi-18.test")
193 ;; failed to remove 't-guild-compile-7215.go.tdL7yC
194 (substitute* "test-suite/standalone/Makefile.in"
195 (("test-guild-compile ") ""))
196 #t)))
197 '())
198 (add-before 'configure 'pre-configure
199 (lambda* (#:key inputs #:allow-other-keys)
200 ;; Tell (ice-9 popen) the file name of Bash.
201 (let ((bash (assoc-ref inputs "bash")))
202 (substitute* "module/ice-9/popen.scm"
203 ;; If bash is #f allow fallback for user to provide
204 ;; "bash" in PATH. This happens when cross-building to
205 ;; MinGW for which we do not have Bash yet.
206 (("/bin/sh")
207 ,@(if (target-mingw?)
208 '((if bash
209 (string-append bash "/bin/bash")
210 "bash"))
211 '((string-append bash "/bin/bash")))))
212 #t))))))
213
214 (native-search-paths
215 (list (search-path-specification
216 (variable "GUILE_LOAD_PATH")
217 (files '("share/guile/site/2.0")))
218 (search-path-specification
219 (variable "GUILE_LOAD_COMPILED_PATH")
220 (files '("lib/guile/2.0/site-ccache")))))
221
222 (synopsis "Scheme implementation intended especially for extensions")
223 (description
224 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
225 official extension language of the GNU system. It is an implementation of
226 the Scheme language which can be easily embedded in other applications to
227 provide a convenient means of extending the functionality of the application
228 without requiring the source code to be rewritten.")
229 (home-page "https://www.gnu.org/software/guile/")
230 (license license:lgpl3+)))
231
232 (define-public guile-2.2
233 (package (inherit guile-2.0)
234 (name "guile")
235 (version "2.2.7")
236 (source (origin
237 (method url-fetch)
238
239 ;; Note: we are limited to one of the compression formats
240 ;; supported by the bootstrap binaries, so no lzip here.
241 (uri (string-append "mirror://gnu/guile/guile-" version
242 ".tar.xz"))
243 (sha256
244 (base32
245 "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd"))
246 (modules '((guix build utils)))
247 (patches (search-patches
248 "guile-2.2-skip-oom-test.patch"))
249
250 ;; Remove the pre-built object files. Instead, build everything
251 ;; from source, at the expense of significantly longer build
252 ;; times (almost 3 hours on a 4-core Intel i5).
253 (snippet '(begin
254 (for-each delete-file
255 (find-files "prebuilt" "\\.go$"))
256 #t))))
257 (properties '((timeout . 72000) ;20 hours
258 (max-silent-time . 36000))) ;10 hours (needed on ARM
259 ; when heavily loaded)
260 (native-search-paths
261 (list (search-path-specification
262 (variable "GUILE_LOAD_PATH")
263 (files '("share/guile/site/2.2")))
264 (search-path-specification
265 (variable "GUILE_LOAD_COMPILED_PATH")
266 (files '("lib/guile/2.2/site-ccache")))))))
267
268 (define-deprecated guile-2.2/bug-fix guile-2.2)
269
270 (define-public guile-2.2.4
271 (package/inherit
272 guile-2.2
273 (version "2.2.4")
274 (source (origin
275 (inherit (package-source guile-2.2))
276 (uri (string-append "mirror://gnu/guile/guile-" version
277 ".tar.xz"))
278 (sha256
279 (base32
280 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))))))
281
282 (define-public guile-3.0
283 ;; This is the latest Guile stable version.
284 (package
285 (inherit guile-2.2)
286 (name "guile")
287 (version "3.0.2")
288 (source (origin
289 (inherit (package-source guile-2.2))
290 (uri (string-append "mirror://gnu/guile/guile-"
291 version ".tar.xz"))
292 (sha256
293 (base32
294 "12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k"))))
295 (arguments
296 ;; XXX: JIT-enabled Guile crashes in obscure ways on GNU/Hurd.
297 (if (hurd-target?)
298 (substitute-keyword-arguments (package-arguments guile-2.2)
299 ((#:configure-flags flags ''())
300 `(cons "--disable-jit" ,flags)))
301 (package-arguments guile-2.2)))
302 (native-search-paths
303 (list (search-path-specification
304 (variable "GUILE_LOAD_PATH")
305 (files '("share/guile/site/3.0")))
306 (search-path-specification
307 (variable "GUILE_LOAD_COMPILED_PATH")
308 (files '("lib/guile/3.0/site-ccache"
309 "share/guile/site/3.0")))))))
310
311 (define-public guile-3.0-latest
312 ;; TODO: Make this 'guile-3.0' on the next rebuild cycle.
313 (package
314 (inherit guile-3.0)
315 (version "3.0.4")
316 (source (origin
317 (inherit (package-source guile-3.0))
318 (uri (string-append "mirror://gnu/guile/guile-"
319 version ".tar.xz"))
320 (sha256
321 (base32
322 "0c8dkyvs6xbxp7rgnhkyakajzhakay7qn9kahj1mj49x5vf4fybb"))))))
323
324 (define-public guile-next
325 (deprecated-package "guile-next" guile-3.0))
326
327 (define-public guile-3.0/libgc-7
328 ;; Using libgc-7 avoid crashes that can occur, particularly when loading
329 ;; data in to the Guix Data Service:
330 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40525
331 (hidden-package
332 (package
333 (inherit guile-3.0-latest)
334 (propagated-inputs
335 `(("bdw-gc" ,libgc-7)
336 ,@(srfi-1:alist-delete "bdw-gc" (package-propagated-inputs guile-3.0)))))))
337
338 (define-public guile-3.0/fixed
339 ;; A package of Guile that's rarely changed. It is the one used in the
340 ;; `base' module, and thus changing it entails a full rebuild.
341 (package
342 (inherit guile-3.0)
343 (properties '((hidden? . #t) ;people should install 'guile-2.2'
344 (timeout . 72000) ;20 hours
345 (max-silent-time . 36000))))) ;10 hours (needed on ARM
346 ; when heavily loaded)
347
348 (define* (make-guile-readline guile #:optional (name "guile-readline"))
349 (package
350 (name name)
351 (version (package-version guile))
352 (source (package-source guile))
353 (build-system gnu-build-system)
354 (arguments
355 '(#:configure-flags '("--disable-silent-rules")
356 #:phases (modify-phases %standard-phases
357 (add-before 'build 'chdir
358 (lambda* (#:key outputs #:allow-other-keys)
359 (invoke "make" "-C" "libguile" "scmconfig.h")
360 (invoke "make" "-C" "lib")
361 (chdir "guile-readline")
362
363 (substitute* "Makefile"
364 (("../libguile/libguile-[[:graph:]]+\\.la")
365 ;; Remove dependency on libguile-X.Y.la.
366 "")
367 (("^READLINE_LIBS = (.*)$" _ libs)
368 ;; Link against the provided libguile.
369 (string-append "READLINE_LIBS = "
370 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
371 libs "\n"))
372 (("\\$\\(top_builddir\\)/meta/build-env")
373 ;; Use the provided Guile, not the one from
374 ;; $(builddir).
375 "")
376
377 ;; Install modules to the 'site' directories.
378 (("^moddir = .*$")
379 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
380 (("^ccachedir = .*$")
381 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
382
383 ;; Load 'guile-readline.so' from the right place.
384 (substitute* "ice-9/readline.scm"
385 (("load-extension \"guile-readline\"")
386 (format #f "load-extension \
387 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
388 (assoc-ref outputs "out"))))
389 #t)))))
390 (home-page (package-home-page guile))
391 (native-inputs (package-native-inputs guile))
392 (inputs
393 `(,@(package-inputs guile) ;to placate 'configure'
394 ,@(package-propagated-inputs guile)
395 ("guile" ,guile)
396 ("readline" ,readline)))
397 (synopsis "Line editing support for GNU Guile")
398 (description
399 "This module provides line editing support via the Readline library for
400 GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
401 @code{activate-readline} procedure to enable it.")
402 (license license:gpl3+)))
403
404 (define-public guile-readline
405 (make-guile-readline guile-3.0))
406
407 (define-public guile2.2-readline
408 (make-guile-readline guile-2.2 "guile2.2-readline"))
409
410 (define (guile-variant-package-name prefix)
411 (lambda (name)
412 "Return NAME with PREFIX instead of \"guile-\", when applicable."
413 (if (string-prefix? "guile-" name)
414 (string-append prefix "-"
415 (string-drop name
416 (string-length "guile-")))
417 name)))
418
419 (define package-for-guile-2.0
420 ;; A procedure that rewrites the dependency tree of the given package to use
421 ;; GUILE-2.0 instead of GUILE-3.0.
422 (package-input-rewriting `((,guile-3.0 . ,guile-2.0))
423 (guile-variant-package-name "guile2.0")))
424
425 (define package-for-guile-2.2
426 (package-input-rewriting `((,guile-3.0 . ,guile-2.2))
427 (guile-variant-package-name "guile2.2")))
428
429 (define-syntax define-deprecated-guile3.0-package
430 (lambda (s)
431 "Define a deprecated package alias for \"guile3.0-something\"."
432 (syntax-case s ()
433 ((_ name)
434 (and (identifier? #'name)
435 (string-prefix? "guile3.0-" (symbol->string (syntax->datum
436 #'name))))
437 (let ((->guile (lambda (str)
438 (let ((base (string-drop str
439 (string-length "guile3.0-"))))
440 (string-append "guile-" base)))))
441 (with-syntax ((package-name (symbol->string (syntax->datum #'name)))
442 (package
443 (datum->syntax
444 #'name
445 (string->symbol
446 (->guile (symbol->string (syntax->datum
447 #'name))))))
448 (old-name
449 ;; XXX: This is the name generated by
450 ;; 'define-deprecated'.
451 (datum->syntax
452 #'name
453 (symbol-append '% (syntax->datum #'name)
454 '/deprecated))))
455 #'(begin
456 (define-deprecated name package
457 (deprecated-package package-name package))
458 (export old-name))))))))
459
460 (define-deprecated-guile3.0-package guile3.0-readline)
461
462 (define-public guile-for-guile-emacs
463 (let ((commit "15ca78482ac0dd2e3eb36dcb31765d8652d7106d")
464 (revision "1"))
465 (package (inherit guile-2.2)
466 (name "guile-for-guile-emacs")
467 (version (git-version "2.1.2" revision commit))
468 (source (origin
469 (method git-fetch)
470 (uri (git-reference
471 (url "git://git.savannah.gnu.org/guile.git")
472 (commit commit)))
473 (file-name (git-file-name name version))
474 (sha256
475 (base32
476 "1l7ik4q4zk7vq4m3gnwizc0b64b1mdr31hxqlzxs94xaf2lvi7s2"))))
477 (arguments
478 (substitute-keyword-arguments (package-arguments guile-2.2)
479 ((#:phases phases '%standard-phases)
480 `(modify-phases ,phases
481 (replace 'bootstrap
482 (lambda _
483 ;; Disable broken tests.
484 ;; TODO: Fix them!
485 (substitute* "test-suite/tests/gc.test"
486 (("\\(pass-if \"after-gc-hook gets called\"" m)
487 (string-append "#;" m)))
488 (substitute* "test-suite/tests/version.test"
489 (("\\(pass-if \"version reporting works\"" m)
490 (string-append "#;" m)))
491 ;; Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler.
492 ;; FAIL: test-out-of-memory
493 (substitute* "test-suite/standalone/Makefile.am"
494 (("(check_SCRIPTS|TESTS) \\+= test-out-of-memory") ""))
495
496 (patch-shebang "build-aux/git-version-gen")
497 (invoke "sh" "autogen.sh")
498 #t))))))
499 (native-inputs
500 `(("autoconf" ,autoconf)
501 ("automake" ,automake)
502 ("libtool" ,libtool)
503 ("flex" ,flex)
504 ("texinfo" ,texinfo)
505 ("gettext" ,gettext-minimal)
506 ,@(package-native-inputs guile-2.2))))))
507
508 \f
509 ;;;
510 ;;; Extensions.
511 ;;;
512
513 (define-public guile-json-1
514 (package
515 (name "guile-json")
516 (version "1.3.2")
517 (home-page "https://github.com/aconchillo/guile-json")
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 "0m6yzb169r6iz56k3nkncjaiijwi4p0x9ijn1p5ax3s77jklxy9k"))))
525 (build-system gnu-build-system)
526 (arguments
527 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
528 (native-inputs `(("pkg-config" ,pkg-config)
529 ("guile" ,guile-2.2)))
530 (inputs `(("guile" ,guile-2.2)))
531 (synopsis "JSON module for Guile")
532 (description
533 "Guile-JSON supports parsing and building JSON documents according to the
534 specification. These are the main features:
535
536 @itemize
537 @item Strictly complies to @uref{http://json.org, specification}.
538 @item Build JSON documents programmatically via macros.
539 @item Unicode support for strings.
540 @item Allows JSON pretty printing.
541 @end itemize\n")
542
543 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
544 (license license:gpl3+)))
545
546 ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
547 ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
548 ;; 'guile-json-3'.
549 (define-deprecated guile-json guile-json-1)
550 (export guile-json)
551
552 (define-public guile2.0-json
553 (package-for-guile-2.0 guile-json-1))
554
555 (define-public guile-json-3
556 ;; This version is incompatible with 1.x; see the 'NEWS' file.
557 (package
558 (inherit guile-json-1)
559 (name "guile-json")
560 (version "3.5.0")
561 (source (origin
562 (method url-fetch)
563 (uri (string-append "mirror://savannah/guile-json/guile-json-"
564 version ".tar.gz"))
565 (sha256
566 (base32
567 "0nj0684qgh6ppkbdyxqfyjwsv2qbyairxpi8fzrhsi3xnc7jn4im"))))
568 (native-inputs `(("pkg-config" ,pkg-config)
569 ("guile" ,guile-3.0)))
570 (inputs `(("guile" ,guile-3.0)))))
571
572 (define-public guile3.0-json
573 (deprecated-package "guile3.0-json" guile-json-3))
574
575 (define-public guile-json-4
576 (package
577 (inherit guile-json-3)
578 (name "guile-json")
579 (version "4.3.2")
580 (source (origin
581 (method url-fetch)
582 (uri (string-append "mirror://savannah/guile-json/guile-json-"
583 version ".tar.gz"))
584 (sha256
585 (base32
586 "0255c7f053z4p9mqzhpxwbfx3y47j9nfvlgnm8xasdclyzmjl9y2"))))))
587
588 (define-public guile2.2-json
589 (package-for-guile-2.2 guile-json-4))
590
591 ;; There are two guile-gdbm packages, one using the FFI and one with
592 ;; direct C bindings, hence the verbose name.
593
594 (define-public guile-gdbm-ffi
595 (package
596 (name "guile-gdbm-ffi")
597 (version "20120209.fa1d5b6")
598 (source (origin
599 (method git-fetch)
600 (uri (git-reference
601 (url "https://github.com/ijp/guile-gdbm")
602 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
603 (file-name (string-append name "-" version "-checkout"))
604 (patches (search-patches
605 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
606 (sha256
607 (base32
608 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
609 (build-system guile-build-system)
610 (arguments
611 '(#:phases (modify-phases %standard-phases
612 (add-after 'unpack 'move-examples
613 (lambda* (#:key outputs #:allow-other-keys)
614 ;; Move examples where they belong.
615 (let* ((out (assoc-ref outputs "out"))
616 (doc (string-append out "/share/doc/"
617 (strip-store-file-name out)
618 "/examples")))
619 (copy-recursively "examples" doc)
620 (delete-file-recursively "examples")
621 #t)))
622 (add-after 'unpack 'set-libgdbm-file-name
623 (lambda* (#:key inputs #:allow-other-keys)
624 (substitute* "gdbm.scm"
625 (("\\(dynamic-link \"libgdbm\"\\)")
626 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
627 (assoc-ref inputs "gdbm"))))
628 #t)))))
629 (native-inputs
630 `(("guile" ,guile-3.0)))
631 (inputs
632 `(("gdbm" ,gdbm)))
633 (home-page "https://github.com/ijp/guile-gdbm")
634 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
635 (description
636 "Guile bindings to the GDBM key-value storage system, using
637 Guile's foreign function interface.")
638 (license license:gpl3+)))
639
640 (define-public guile2.0-gdbm-ffi
641 (package-for-guile-2.0 guile-gdbm-ffi))
642
643 (define-public guile2.2-gdbm-ffi
644 (package-for-guile-2.2 guile-gdbm-ffi))
645
646 (define-deprecated-guile3.0-package guile3.0-gdbm-ffi)
647
648 (define-public guile-sqlite3
649 (package
650 (name "guile-sqlite3")
651 (version "0.1.2")
652 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
653 (source (origin
654 (method git-fetch)
655 (uri (git-reference
656 (url home-page)
657 (commit (string-append "v" version))))
658 (sha256
659 (base32
660 "1nryy9j3bk34i0alkmc9bmqsm0ayz92k1cdf752mvhyjjn8nr928"))
661 (file-name (string-append name "-" version "-checkout"))))
662 (build-system gnu-build-system)
663 (native-inputs
664 `(("autoconf" ,autoconf)
665 ("automake" ,automake)
666 ("guile" ,guile-3.0)
667 ("pkg-config" ,pkg-config)))
668 (inputs
669 `(("guile" ,guile-3.0)
670 ("sqlite" ,sqlite)))
671 (synopsis "Access SQLite databases from Guile")
672 (description
673 "This package provides Guile bindings to the SQLite database system.")
674 (license license:gpl3+)))
675
676 (define-public guile2.0-sqlite3
677 (package-for-guile-2.0 guile-sqlite3))
678
679 (define-public guile2.2-sqlite3
680 (package-for-guile-2.2 guile-sqlite3))
681
682 (define-deprecated-guile3.0-package guile3.0-sqlite3)
683
684 (define-public guile-bytestructures
685 (package
686 (name "guile-bytestructures")
687 (version "1.0.7")
688 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
689 (source (origin
690 (method git-fetch)
691 (uri (git-reference
692 (url home-page)
693 (commit (string-append "v" version))))
694 (file-name (git-file-name name version))
695 (sha256
696 (base32
697 "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb"))))
698 (build-system gnu-build-system)
699 (arguments
700 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
701
702 #:phases (modify-phases %standard-phases
703 (add-after 'install 'install-doc
704 (lambda* (#:key outputs #:allow-other-keys)
705 (let* ((out (assoc-ref outputs "out"))
706 (package ,(package-full-name this-package "-"))
707 (doc (string-append out "/share/doc/" package)))
708 (install-file "README.md" doc)
709 #t))))))
710 (native-inputs
711 `(("autoconf" ,autoconf)
712 ("automake" ,automake)
713 ("pkg-config" ,pkg-config)
714 ("guile" ,guile-3.0)))
715 (inputs
716 `(("guile" ,guile-3.0)))
717 (synopsis "Structured access to bytevector contents for Guile")
718 (description
719 "Guile bytestructures offers a system imitating the type system
720 of the C programming language, to be used on bytevectors. C's type
721 system works on raw memory, and Guile works on bytevectors which are
722 an abstraction over raw memory. It's also more powerful than the C
723 type system, elevating types to first-class status.")
724 (license license:gpl3+)
725 (properties '((upstream-name . "bytestructures")))))
726
727 (define-public guile2.0-bytestructures
728 (package-for-guile-2.0 guile-bytestructures))
729
730 (define-public guile2.2-bytestructures
731 (package-for-guile-2.2 guile-bytestructures))
732
733 (define-deprecated-guile3.0-package guile3.0-bytestructures)
734
735 (define-public guile-git
736 (package
737 (name "guile-git")
738 (version "0.3.0")
739 (home-page "https://gitlab.com/guile-git/guile-git.git")
740 (source (origin
741 (method url-fetch)
742 (uri (string-append "https://gitlab.com/guile-git/guile-git/uploads/"
743 "4c563d8e7e1ff84396abe8ca7011bcaf/guile-git-"
744 version ".tar.gz"))
745 (sha256
746 (base32
747 "0c5i3d16hp7gp9rd78vk9zc45js8bphf92m4lbb5gyi4l1yl7kkm"))))
748 (build-system gnu-build-system)
749 (arguments
750 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ; to prevent guild warnings
751 (native-inputs
752 `(("pkg-config" ,pkg-config)
753 ("guile" ,guile-3.0)
754 ("guile-bytestructures" ,guile-bytestructures)))
755 (inputs
756 `(("guile" ,guile-3.0)
757 ("libgit2" ,libgit2)))
758 (propagated-inputs
759 `(("guile-bytestructures" ,guile-bytestructures)))
760 (synopsis "Guile bindings for libgit2")
761 (description
762 "This package provides Guile bindings to libgit2, a library to
763 manipulate repositories of the Git version control system.")
764 (license license:gpl3+)))
765
766 (define-public guile2.2-git
767 (package-for-guile-2.2 guile-git))
768
769 (define-public guile2.0-git
770 (let ((base (package-for-guile-2.0 guile-git)))
771 (package
772 (inherit base)
773 ;; Libgit2's Guile test driver requires (ice-9 textual-ports), which is
774 ;; not in Guile 2.0. Thus, keep LIBGIT2 as-is here (i.e., built against
775 ;; Guile 2.2).
776 (inputs `(("libgit2" ,libgit2)
777 ,@(srfi-1:alist-delete "libgit2"
778 (package-inputs base)))))))
779
780 (define-deprecated-guile3.0-package guile3.0-git)
781
782 (define-public guile-zlib
783 (package
784 (name "guile-zlib")
785 (version "0.0.1")
786 (source
787 (origin
788 ;; XXX: Do not use "git-fetch" method here that would create and
789 ;; endless inclusion loop, because this package is used as an extension
790 ;; in the same method.
791 (method url-fetch)
792 (uri
793 (string-append "https://notabug.org/guile-zlib/guile-zlib/archive/"
794 version ".tar.gz"))
795 (file-name (string-append name "-" version ".tar.gz"))
796 (sha256
797 (base32
798 "1caz6cbl6sg5567nk68z88rshp0m26zmb0a9ry1jkc1ivpk0n47i"))))
799 (build-system gnu-build-system)
800 (arguments
801 '(#:make-flags
802 '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
803 (native-inputs
804 `(("autoconf" ,autoconf)
805 ("automake" ,automake)
806 ("pkg-config" ,pkg-config)
807 ,@(if (%current-target-system)
808 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
809 '())))
810 (inputs
811 `(("guile" ,guile-3.0)
812 ("zlib" ,zlib)))
813 (synopsis "Guile bindings to zlib")
814 (description
815 "This package provides Guile bindings for zlib, a lossless
816 data-compression library. The bindings are written in pure Scheme by using
817 Guile's foreign function interface.")
818 (home-page "https://notabug.org/guile-zlib/guile-zlib")
819 (license license:gpl3+)))
820
821 (define-public guile-lzlib
822 (package
823 (name "guile-lzlib")
824 (version "0.0.1")
825 (source
826 (origin
827 (method url-fetch)
828 (uri
829 (string-append "https://notabug.org/guile-lzlib/guile-lzlib/archive/"
830 version ".tar.gz"))
831 (file-name (string-append name "-" version ".tar.gz"))
832 (sha256
833 (base32
834 "0rdmszn1qix085ci2mddwq5cypipc004fk7arrrkgn9bv39hazza"))))
835 (build-system gnu-build-system)
836 (arguments
837 '(#:make-flags
838 '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
839 (native-inputs
840 `(("autoconf" ,autoconf)
841 ("automake" ,automake)
842 ("pkg-config" ,pkg-config)
843 ,@(if (%current-target-system)
844 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
845 '())))
846 (inputs
847 `(("guile" ,guile-3.0)
848 ("lzlib" ,lzlib)))
849 (synopsis "Guile bindings to lzlib")
850 (description
851 "This package provides Guile bindings for lzlib, a C library for
852 in-memory LZMA compression and decompression. The bindings are written in
853 pure Scheme by using Guile's foreign function interface.")
854 (home-page "https://notabug.org/guile-lzlib/guile-lzlib")
855 (license license:gpl3+)))
856
857 ;;; guile.scm ends here