gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
973c6f18 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
0791437f
RW
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>
c5793e7e 6;;; Copyright © 2015, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
c5793e7e 7;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
0791437f 8;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
a71d3358 9;;; Copyright © 2016, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
aaf1bdc3 10;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
0791437f 11;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
e53bf62e 12;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
0791437f
RW
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>
c8e3651a 16;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
0791437f 17;;; Copyright © 2019 Taylan Kammer <taylan.kammer@gmail.com>
3d867fea 18;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
1722d680 19;;;
233e7676 20;;; This file is part of GNU Guix.
1722d680 21;;;
233e7676 22;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
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;;;
233e7676 27;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
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
233e7676 33;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 34
1ffa7090 35(define-module (gnu packages guile)
71e0f217 36 #:use-module ((guix licenses) #:prefix license:)
59a43334 37 #:use-module (gnu packages)
146c6b62
RW
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
9c782445 40 #:use-module (gnu packages bash)
1ffa7090 41 #:use-module (gnu packages bdw-gc)
148585c2 42 #:use-module (gnu packages compression)
255d1bbe 43 #:use-module (gnu packages dbm)
146c6b62 44 #:use-module (gnu packages flex)
1ffa7090 45 #:use-module (gnu packages gawk)
146c6b62 46 #:use-module (gnu packages gettext)
973c6f18 47 #:use-module (gnu packages gperf)
ee8ee748 48 #:use-module (gnu packages hurd)
1ffa7090 49 #:use-module (gnu packages libffi)
1ffa7090 50 #:use-module (gnu packages libunistring)
7119cca8 51 #:use-module (gnu packages linux)
1ffa7090
LC
52 #:use-module (gnu packages m4)
53 #:use-module (gnu packages multiprecision)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages readline)
cd0322a3 56 #:use-module (gnu packages sqlite)
f906d30c 57 #:use-module (gnu packages texinfo)
bd233722 58 #:use-module (gnu packages version-control)
1722d680 59 #:use-module (guix packages)
87f5d366 60 #:use-module (guix download)
6bc24063 61 #:use-module (guix git-download)
32795fcf 62 #:use-module (guix build-system gnu)
977d8666 63 #:use-module (guix build-system guile)
84af1e74 64 #:use-module (guix deprecation)
32795fcf 65 #:use-module (guix utils)
d4660a54
MC
66 #:use-module (ice-9 match)
67 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
1722d680
LC
68
69;;; Commentary:
70;;;
c44899a2 71;;; GNU Guile, and modules and extensions.
1722d680
LC
72;;;
73;;; Code:
74
c44899a2
LC
75(define-public guile-1.8
76 (package
77 (name "guile")
78 (version "1.8.8")
79 (source (origin
87f5d366 80 (method url-fetch)
0db342a5 81 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
82 ".tar.gz"))
83 (sha256
84 (base32
01eafd38 85 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
fc1adab1 86 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
c44899a2
LC
87 (build-system gnu-build-system)
88 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
89
90 ;; Insert a phase before `configure' to patch things up.
dc1d3cde
KK
91 #:phases
92 (modify-phases %standard-phases
93 (add-before 'configure 'patch-stuff
94 (lambda* (#:key outputs #:allow-other-keys)
95 ;; Add a call to `lt_dladdsearchdir' so that
96 ;; `libguile-readline.so' & co. are in the
97 ;; loader's search path.
98 (substitute* "libguile/dynl.c"
99 (("lt_dlinit.*$" match)
100 (format #f
101 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
102 match
103 (assoc-ref outputs "out"))))
2f4fbe1c 104
dc1d3cde
KK
105 ;; The usual /bin/sh...
106 (substitute* "ice-9/popen.scm"
107 (("/bin/sh") (which "sh")))
108 #t)))))
528ea990
LC
109
110 ;; When cross-compiling, a native version of Guile itself is needed.
111 (native-inputs (if (%current-target-system)
112 `(("self" ,this-package))
113 '()))
114
01eafd38 115 (inputs `(("gawk" ,gawk)
c44899a2
LC
116 ("readline" ,readline)))
117
118 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
119 ;; propagated.
120 (propagated-inputs `(("gmp" ,gmp)
be11b102 121 ("libltdl" ,libltdl)))
c44899a2 122
9be8d7c8
LC
123 (native-search-paths
124 (list (search-path-specification
125 (variable "GUILE_LOAD_PATH")
af070955 126 (files '("share/guile/site")))))
9be8d7c8 127
f50d2669 128 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 129 (description
a22dc0c4
LC
130 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
131official extension language of the GNU system. It is an implementation of
132the Scheme language which can be easily embedded in other applications to
133provide a convenient means of extending the functionality of the application
134without requiring the source code to be rewritten.")
6fd52309 135 (home-page "https://www.gnu.org/software/guile/")
71e0f217 136 (license license:lgpl2.0+)))
c44899a2
LC
137
138(define-public guile-2.0
139 (package
140 (name "guile")
b5efd14a 141 (version "2.0.14")
c44899a2 142 (source (origin
87f5d366 143 (method url-fetch)
0db342a5 144 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
145 ".tar.xz"))
146 (sha256
147 (base32
b5efd14a 148 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
c44899a2 149 (build-system gnu-build-system)
528ea990
LC
150
151 ;; When cross-compiling, a native version of Guile itself is needed.
152 (native-inputs `(,@(if (%current-target-system)
153 `(("self" ,this-package))
154 '())
155 ("pkgconfig" ,pkg-config)))
c44899a2 156 (inputs `(("libffi" ,libffi)
88da729f 157 ,@(libiconv-if-needed)
baf549df
LC
158
159 ;; We need Bash when cross-compiling because some of the scripts
160 ;; in bin/ refer to it. Use 'bash-minimal' because we don't need
161 ;; an interactive Bash with Readline and all.
162 ,@(if (target-mingw?) '() `(("bash" ,bash-minimal)))))
c44899a2
LC
163 (propagated-inputs
164 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
165 ;; reads `-lltdl -lunistring', adding them here will add the needed
166 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
167 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
168 ("libunistring" ,libunistring)
be11b102
LC
169
170 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
171 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
172 ("libltdl" ,libltdl)
c44899a2
LC
173
174 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
175 ;; must be propagated.
bda1bc6c 176 ("bdw-gc" ,libgc)
c44899a2
LC
177 ("gmp" ,gmp)))
178
9bf62d9b
LC
179 (outputs '("out" "debug"))
180
8ffaa93b 181 (arguments
20897536
TGR
182 `(#:configure-flags '("--disable-static") ; saves 3 MiB
183 #:phases
184 (modify-phases %standard-phases
ba2f61bb
JN
185 ,@(if (hurd-system?)
186 '((add-after 'unpack 'disable-tests
187 (lambda _
188 ;; Hangs at: "Running 00-repl-server.test"
189 (rename-file "test-suite/tests/00-repl-server.test" "00-repl-server.test")
190 ;; Sometimes Hangs at: "Running 00-socket.test"
191 (rename-file "test-suite/tests/00-socket.test" "00-socket.test")
192 ;; FAIL: srfi-18.test: thread-sleep!: thread sleeps fractions of a second
193 (rename-file "test-suite/tests/srfi-18.test" "srfi-18.test")
194 ;; failed to remove 't-guild-compile-7215.go.tdL7yC
195 (substitute* "test-suite/standalone/Makefile.in"
196 (("test-guild-compile ") ""))
197 #t)))
198 '())
20897536
TGR
199 (add-before 'configure 'pre-configure
200 (lambda* (#:key inputs #:allow-other-keys)
201 ;; Tell (ice-9 popen) the file name of Bash.
202 (let ((bash (assoc-ref inputs "bash")))
203 (substitute* "module/ice-9/popen.scm"
204 ;; If bash is #f allow fallback for user to provide
205 ;; "bash" in PATH. This happens when cross-building to
206 ;; MinGW for which we do not have Bash yet.
207 (("/bin/sh")
208 ,@(if (target-mingw?)
209 '((if bash
210 (string-append bash "/bin/bash")
211 "bash"))
212 '((string-append bash "/bin/bash")))))
213 #t))))))
8ffaa93b 214
9be8d7c8
LC
215 (native-search-paths
216 (list (search-path-specification
217 (variable "GUILE_LOAD_PATH")
af070955 218 (files '("share/guile/site/2.0")))
9be8d7c8
LC
219 (search-path-specification
220 (variable "GUILE_LOAD_COMPILED_PATH")
b03f270e 221 (files '("lib/guile/2.0/site-ccache")))))
9be8d7c8 222
f50d2669 223 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 224 (description
a22dc0c4
LC
225 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
226official extension language of the GNU system. It is an implementation of
227the Scheme language which can be easily embedded in other applications to
228provide a convenient means of extending the functionality of the application
229without requiring the source code to be rewritten.")
6fd52309 230 (home-page "https://www.gnu.org/software/guile/")
71e0f217 231 (license license:lgpl3+)))
c44899a2 232
f6396d86 233(define-public guile-2.2
f906d30c 234 (package (inherit guile-2.0)
f6396d86 235 (name "guile")
edc8fd2e 236 (version "2.2.7")
4eae7980
LC
237 (source (origin
238 (method url-fetch)
34d624ce
LC
239
240 ;; Note: we are limited to one of the compression formats
241 ;; supported by the bootstrap binaries, so no lzip here.
80a72572 242 (uri (string-append "mirror://gnu/guile/guile-" version
34d624ce 243 ".tar.xz"))
4eae7980
LC
244 (sha256
245 (base32
edc8fd2e 246 "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd"))
d9f0788a 247 (modules '((guix build utils)))
44f07d1d
CD
248 (patches (search-patches
249 "guile-2.2-skip-oom-test.patch"))
d9f0788a
LC
250
251 ;; Remove the pre-built object files. Instead, build everything
252 ;; from source, at the expense of significantly longer build
253 ;; times (almost 3 hours on a 4-core Intel i5).
6cbee49d
MW
254 (snippet '(begin
255 (for-each delete-file
256 (find-files "prebuilt" "\\.go$"))
257 #t))))
4fbd0f4f 258 (properties '((timeout . 72000) ;20 hours
16b0f205 259 (max-silent-time . 36000))) ;10 hours (needed on ARM
1577a658 260 ; when heavily loaded)
dd90ed89
DT
261 (native-search-paths
262 (list (search-path-specification
263 (variable "GUILE_LOAD_PATH")
264 (files '("share/guile/site/2.2")))
265 (search-path-specification
266 (variable "GUILE_LOAD_COMPILED_PATH")
1dcca83a 267 (files '("lib/guile/2.2/site-ccache")))))))
4eae7980 268
edc8fd2e 269(define-deprecated guile-2.2/bug-fix guile-2.2)
4bd6f1d1 270
8400d097
LC
271(define-public guile-2.2.4
272 (package/inherit
273 guile-2.2
274 (version "2.2.4")
275 (source (origin
276 (inherit (package-source guile-2.2))
277 (uri (string-append "mirror://gnu/guile/guile-" version
278 ".tar.xz"))
279 (sha256
280 (base32
281 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))))))
34d624ce 282
e7921d5e
LC
283(define-public guile-3.0
284 ;; This is the latest Guile stable version.
2d0e802f
DT
285 (package
286 (inherit guile-2.2)
b6bee63b 287 (name "guile")
7f1aa73b 288 (version "3.0.2")
2d0e802f
DT
289 (source (origin
290 (inherit (package-source guile-2.2))
1a30351b 291 (uri (string-append "mirror://gnu/guile/guile-"
2d0e802f
DT
292 version ".tar.xz"))
293 (sha256
294 (base32
7f1aa73b 295 "12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k"))))
916ec91f
LC
296 (arguments
297 ;; XXX: JIT-enabled Guile crashes in obscure ways on GNU/Hurd.
298 (if (hurd-target?)
299 (substitute-keyword-arguments (package-arguments guile-2.2)
300 ((#:configure-flags flags ''())
301 `(cons "--disable-jit" ,flags)))
302 (package-arguments guile-2.2)))
2d0e802f
DT
303 (native-search-paths
304 (list (search-path-specification
305 (variable "GUILE_LOAD_PATH")
306 (files '("share/guile/site/3.0")))
307 (search-path-specification
308 (variable "GUILE_LOAD_COMPILED_PATH")
309 (files '("lib/guile/3.0/site-ccache"
e7921d5e
LC
310 "share/guile/site/3.0")))))))
311
9e91f862 312(define-public guile-3.0-latest
89ab6bfb 313 ;; TODO: Make this 'guile-3.0' on the next rebuild cycle.
21cf0d36
MO
314 (package-with-extra-patches
315 (package
316 (inherit guile-3.0)
317 (version "3.0.5")
318 (source (origin
319 (inherit (package-source guile-3.0))
320 (uri (string-append "mirror://gnu/guile/guile-"
321 version ".tar.xz"))
322 (sha256
323 (base32
324 "1wah6fq1h8vmbpdadjych1mq8hyqkd7p015cbxm14ri37l1gnxid")))))
325 ;; Remove on the next rebuild cycle.
326 (search-patches "guile-2.2-skip-so-test.patch")))
89ab6bfb 327
cef392f3
CB
328(define-public guile-3.0/libgc-7
329 ;; Using libgc-7 avoid crashes that can occur, particularly when loading
330 ;; data in to the Guix Data Service:
331 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40525
332 (hidden-package
333 (package
9e91f862 334 (inherit guile-3.0-latest)
cef392f3
CB
335 (propagated-inputs
336 `(("bdw-gc" ,libgc-7)
337 ,@(srfi-1:alist-delete "bdw-gc" (package-propagated-inputs guile-3.0)))))))
338
b6bee63b
LC
339(define-public guile-3.0/fixed
340 ;; A package of Guile that's rarely changed. It is the one used in the
341 ;; `base' module, and thus changing it entails a full rebuild.
342 (package
343 (inherit guile-3.0)
344 (properties '((hidden? . #t) ;people should install 'guile-2.2'
345 (timeout . 72000) ;20 hours
346 (max-silent-time . 36000))))) ;10 hours (needed on ARM
347 ; when heavily loaded)
348
973c6f18
LC
349(define-public guile-next
350 (let ((version "3.0.5")
351 (revision "0")
352 (commit "91547abf54d5e0795afda2781259ab8923eb527b"))
353 (package
354 (inherit guile-3.0)
355 (name "guile-next")
356 (version (git-version version revision commit))
357 (source (origin
358 ;; The main goal here is to allow for '--with-branch'.
359 (method git-fetch)
360 (uri (git-reference
361 (url "https://git.savannah.gnu.org/git/guile.git")
362 (commit commit)))
363 (sha256
364 (base32
365 "09i1c77h2shygylfk0av31jsc1my6zjl230b2cx6vyl58q8c0cqy"))))
366 (arguments
367 (substitute-keyword-arguments (package-arguments guile-3.0)
368 ((#:phases phases '%standard-phases)
369 `(modify-phases ,phases
370 (add-before 'check 'skip-failing-tests
371 (lambda _
372 (substitute* "test-suite/standalone/test-out-of-memory"
373 (("!#") "!#\n\n(exit 77)\n"))
374 (delete-file "test-suite/tests/version.test")
375 #t))))))
376 (native-inputs
377 `(("autoconf" ,autoconf)
378 ("automake" ,automake)
379 ("libtool" ,libtool)
380 ("flex" ,flex)
381 ("gettext" ,gnu-gettext)
382 ("texinfo" ,texinfo)
383 ("gperf" ,gperf)
384 ,@(package-native-inputs guile-3.0)))
385 (synopsis "Development version of GNU Guile"))))
386
7c3b6b2e 387(define* (make-guile-readline guile #:optional (name "guile-readline"))
2ba2c98d 388 (package
7c3b6b2e 389 (name name)
2ba2c98d
LC
390 (version (package-version guile))
391 (source (package-source guile))
392 (build-system gnu-build-system)
393 (arguments
394 '(#:configure-flags '("--disable-silent-rules")
395 #:phases (modify-phases %standard-phases
396 (add-before 'build 'chdir
397 (lambda* (#:key outputs #:allow-other-keys)
398 (invoke "make" "-C" "libguile" "scmconfig.h")
399 (invoke "make" "-C" "lib")
400 (chdir "guile-readline")
401
402 (substitute* "Makefile"
403 (("../libguile/libguile-[[:graph:]]+\\.la")
404 ;; Remove dependency on libguile-X.Y.la.
405 "")
406 (("^READLINE_LIBS = (.*)$" _ libs)
407 ;; Link against the provided libguile.
408 (string-append "READLINE_LIBS = "
409 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
410 libs "\n"))
411 (("\\$\\(top_builddir\\)/meta/build-env")
412 ;; Use the provided Guile, not the one from
413 ;; $(builddir).
414 "")
415
416 ;; Install modules to the 'site' directories.
417 (("^moddir = .*$")
418 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
419 (("^ccachedir = .*$")
420 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
421
422 ;; Load 'guile-readline.so' from the right place.
423 (substitute* "ice-9/readline.scm"
424 (("load-extension \"guile-readline\"")
425 (format #f "load-extension \
426 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
427 (assoc-ref outputs "out"))))
428 #t)))))
429 (home-page (package-home-page guile))
430 (native-inputs (package-native-inputs guile))
431 (inputs
432 `(,@(package-inputs guile) ;to placate 'configure'
433 ,@(package-propagated-inputs guile)
434 ("guile" ,guile)
435 ("readline" ,readline)))
436 (synopsis "Line editing support for GNU Guile")
437 (description
438 "This module provides line editing support via the Readline library for
439GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
440@code{activate-readline} procedure to enable it.")
441 (license license:gpl3+)))
442
443(define-public guile-readline
142cd4dc 444 (make-guile-readline guile-3.0))
2ba2c98d 445
142cd4dc
MB
446(define-public guile2.2-readline
447 (make-guile-readline guile-2.2 "guile2.2-readline"))
7c3b6b2e 448
8f4acad7
LC
449(define (guile-variant-package-name prefix)
450 (lambda (name)
451 "Return NAME with PREFIX instead of \"guile-\", when applicable."
452 (if (string-prefix? "guile-" name)
453 (string-append prefix "-"
454 (string-drop name
455 (string-length "guile-")))
456 name)))
947a5d47 457
8f4acad7 458(define package-for-guile-2.0
10b507b2 459 ;; A procedure that rewrites the dependency tree of the given package to use
e8bc2a01
MB
460 ;; GUILE-2.0 instead of GUILE-3.0.
461 (package-input-rewriting `((,guile-3.0 . ,guile-2.0))
8819551c
LC
462 (guile-variant-package-name "guile2.0")
463 #:deep? #f))
947a5d47 464
b6bee63b
LC
465(define package-for-guile-2.2
466 (package-input-rewriting `((,guile-3.0 . ,guile-2.2))
8819551c
LC
467 (guile-variant-package-name "guile2.2")
468 #:deep? #f))
b6bee63b
LC
469
470(define-syntax define-deprecated-guile3.0-package
471 (lambda (s)
472 "Define a deprecated package alias for \"guile3.0-something\"."
473 (syntax-case s ()
474 ((_ name)
475 (and (identifier? #'name)
476 (string-prefix? "guile3.0-" (symbol->string (syntax->datum
477 #'name))))
478 (let ((->guile (lambda (str)
479 (let ((base (string-drop str
480 (string-length "guile3.0-"))))
481 (string-append "guile-" base)))))
482 (with-syntax ((package-name (symbol->string (syntax->datum #'name)))
483 (package
484 (datum->syntax
485 #'name
486 (string->symbol
f69cf407
LC
487 (->guile (symbol->string (syntax->datum
488 #'name))))))
489 (old-name
490 ;; XXX: This is the name generated by
491 ;; 'define-deprecated'.
492 (datum->syntax
493 #'name
494 (symbol-append '% (syntax->datum #'name)
495 '/deprecated))))
b6bee63b
LC
496 #'(begin
497 (define-deprecated name package
498 (deprecated-package package-name package))
f69cf407 499 (export old-name))))))))
89a99d53 500
142cd4dc
MB
501(define-deprecated-guile3.0-package guile3.0-readline)
502
4eae7980 503(define-public guile-for-guile-emacs
a71d3358
RW
504 (let ((commit "15ca78482ac0dd2e3eb36dcb31765d8652d7106d")
505 (revision "1"))
506 (package (inherit guile-2.2)
507 (name "guile-for-guile-emacs")
508 (version (git-version "2.1.2" revision commit))
509 (source (origin
510 (method git-fetch)
511 (uri (git-reference
512 (url "git://git.savannah.gnu.org/guile.git")
513 (commit commit)))
514 (file-name (git-file-name name version))
515 (sha256
516 (base32
517 "1l7ik4q4zk7vq4m3gnwizc0b64b1mdr31hxqlzxs94xaf2lvi7s2"))))
518 (arguments
519 (substitute-keyword-arguments (package-arguments guile-2.2)
520 ((#:phases phases '%standard-phases)
521 `(modify-phases ,phases
522 (replace 'bootstrap
523 (lambda _
524 ;; Disable broken tests.
525 ;; TODO: Fix them!
526 (substitute* "test-suite/tests/gc.test"
527 (("\\(pass-if \"after-gc-hook gets called\"" m)
528 (string-append "#;" m)))
529 (substitute* "test-suite/tests/version.test"
530 (("\\(pass-if \"version reporting works\"" m)
531 (string-append "#;" m)))
532 ;; Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler.
533 ;; FAIL: test-out-of-memory
534 (substitute* "test-suite/standalone/Makefile.am"
535 (("(check_SCRIPTS|TESTS) \\+= test-out-of-memory") ""))
536
537 (patch-shebang "build-aux/git-version-gen")
538 (invoke "sh" "autogen.sh")
539 #t))))))
540 (native-inputs
541 `(("autoconf" ,autoconf)
542 ("automake" ,automake)
543 ("libtool" ,libtool)
544 ("flex" ,flex)
545 ("texinfo" ,texinfo)
546 ("gettext" ,gettext-minimal)
547 ,@(package-native-inputs guile-2.2))))))
be3feafe 548
c44899a2
LC
549\f
550;;;
551;;; Extensions.
552;;;
553
84af1e74 554(define-public guile-json-1
6050a1fb
CR
555 (package
556 (name "guile-json")
327ebd55 557 (version "1.3.2")
f52ef55e 558 (home-page "https://github.com/aconchillo/guile-json")
6050a1fb 559 (source (origin
ffc72ec6 560 (method url-fetch)
28123c01
LC
561 (uri (string-append "mirror://savannah/guile-json/guile-json-"
562 version ".tar.gz"))
ffc72ec6
LC
563 (sha256
564 (base32
327ebd55 565 "0m6yzb169r6iz56k3nkncjaiijwi4p0x9ijn1p5ax3s77jklxy9k"))))
6050a1fb 566 (build-system gnu-build-system)
327ebd55
EF
567 (arguments
568 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
6efccabe 569 (native-inputs `(("pkg-config" ,pkg-config)
f52ef55e
LC
570 ("guile" ,guile-2.2)))
571 (inputs `(("guile" ,guile-2.2)))
6050a1fb
CR
572 (synopsis "JSON module for Guile")
573 (description
0f31d4f0
LC
574 "Guile-JSON supports parsing and building JSON documents according to the
575specification. These are the main features:
576
577@itemize
578@item Strictly complies to @uref{http://json.org, specification}.
579@item Build JSON documents programmatically via macros.
580@item Unicode support for strings.
581@item Allows JSON pretty printing.
582@end itemize\n")
15214828
LC
583
584 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
585 (license license:gpl3+)))
6050a1fb 586
84af1e74
LC
587;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
588;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
589;; 'guile-json-3'.
9b65dea8 590(define-deprecated guile-json guile-json-1)
7f81cce3 591(export guile-json)
584a3ca3 592
2252f087 593(define-public guile2.0-json
84af1e74 594 (package-for-guile-2.0 guile-json-1))
947a5d47 595
152d4076
LC
596(define-public guile-json-3
597 ;; This version is incompatible with 1.x; see the 'NEWS' file.
598 (package
84af1e74 599 (inherit guile-json-1)
152d4076 600 (name "guile-json")
5d9e2187 601 (version "3.5.0")
152d4076
LC
602 (source (origin
603 (method url-fetch)
28123c01
LC
604 (uri (string-append "mirror://savannah/guile-json/guile-json-"
605 version ".tar.gz"))
152d4076
LC
606 (sha256
607 (base32
5d9e2187
MB
608 "0nj0684qgh6ppkbdyxqfyjwsv2qbyairxpi8fzrhsi3xnc7jn4im"))))
609 (native-inputs `(("pkg-config" ,pkg-config)
b6bee63b 610 ("guile" ,guile-3.0)))
5d9e2187 611 (inputs `(("guile" ,guile-3.0)))))
b6bee63b 612
89a99d53 613(define-public guile3.0-json
b6bee63b 614 (deprecated-package "guile3.0-json" guile-json-3))
89a99d53 615
793a48ed
LC
616(define-public guile-json-4
617 (package
618 (inherit guile-json-3)
619 (name "guile-json")
fc5f9de5 620 (version "4.5.2")
793a48ed
LC
621 (source (origin
622 (method url-fetch)
623 (uri (string-append "mirror://savannah/guile-json/guile-json-"
624 version ".tar.gz"))
625 (sha256
626 (base32
fc5f9de5 627 "0cqr0ljqmzlc2bwrapcsmcgxg147h66mcxf23824ri5i6vn4dc0s"))))))
793a48ed
LC
628
629(define-public guile2.2-json
630 (package-for-guile-2.2 guile-json-4))
631
93e7199b
CAW
632;; There are two guile-gdbm packages, one using the FFI and one with
633;; direct C bindings, hence the verbose name.
634
635(define-public guile-gdbm-ffi
636 (package
637 (name "guile-gdbm-ffi")
638 (version "20120209.fa1d5b6")
639 (source (origin
640 (method git-fetch)
641 (uri (git-reference
b0e7b699 642 (url "https://github.com/ijp/guile-gdbm")
93e7199b 643 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
821f4dc2 644 (file-name (string-append name "-" version "-checkout"))
977d8666
LC
645 (patches (search-patches
646 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
93e7199b
CAW
647 (sha256
648 (base32
649 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
977d8666
LC
650 (build-system guile-build-system)
651 (arguments
652 '(#:phases (modify-phases %standard-phases
653 (add-after 'unpack 'move-examples
654 (lambda* (#:key outputs #:allow-other-keys)
655 ;; Move examples where they belong.
656 (let* ((out (assoc-ref outputs "out"))
657 (doc (string-append out "/share/doc/"
658 (strip-store-file-name out)
659 "/examples")))
660 (copy-recursively "examples" doc)
661 (delete-file-recursively "examples")
662 #t)))
663 (add-after 'unpack 'set-libgdbm-file-name
664 (lambda* (#:key inputs #:allow-other-keys)
665 (substitute* "gdbm.scm"
666 (("\\(dynamic-link \"libgdbm\"\\)")
667 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
668 (assoc-ref inputs "gdbm"))))
669 #t)))))
670 (native-inputs
b6bee63b 671 `(("guile" ,guile-3.0)))
56f31a9f 672 (inputs
56f31a9f 673 `(("gdbm" ,gdbm)))
93e7199b
CAW
674 (home-page "https://github.com/ijp/guile-gdbm")
675 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
676 (description
677 "Guile bindings to the GDBM key-value storage system, using
678Guile's foreign function interface.")
71e0f217 679 (license license:gpl3+)))
93e7199b 680
5bd3a841
LC
681(define-public guile2.0-gdbm-ffi
682 (package-for-guile-2.0 guile-gdbm-ffi))
683
b6bee63b
LC
684(define-public guile2.2-gdbm-ffi
685 (package-for-guile-2.2 guile-gdbm-ffi))
686
687(define-deprecated-guile3.0-package guile3.0-gdbm-ffi)
93e7199b 688
e8ac1f8f 689(define-public guile-sqlite3
319e26e4
LC
690 (package
691 (name "guile-sqlite3")
1eec6b0c 692 (version "0.1.2")
3527f600 693 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
319e26e4
LC
694 (source (origin
695 (method git-fetch)
696 (uri (git-reference
697 (url home-page)
698 (commit (string-append "v" version))))
699 (sha256
700 (base32
1eec6b0c 701 "1nryy9j3bk34i0alkmc9bmqsm0ayz92k1cdf752mvhyjjn8nr928"))
29e4d3ea 702 (file-name (string-append name "-" version "-checkout"))))
319e26e4
LC
703 (build-system gnu-build-system)
704 (native-inputs
705 `(("autoconf" ,autoconf)
706 ("automake" ,automake)
02ed227f 707 ("guile" ,guile-3.0)
319e26e4
LC
708 ("pkg-config" ,pkg-config)))
709 (inputs
b6bee63b 710 `(("guile" ,guile-3.0)
319e26e4
LC
711 ("sqlite" ,sqlite)))
712 (synopsis "Access SQLite databases from Guile")
713 (description
714 "This package provides Guile bindings to the SQLite database system.")
715 (license license:gpl3+)))
e8ac1f8f 716
c8e3651a
EB
717(define-public guile2.0-sqlite3
718 (package-for-guile-2.0 guile-sqlite3))
719
b6bee63b
LC
720(define-public guile2.2-sqlite3
721 (package-for-guile-2.2 guile-sqlite3))
722
723(define-deprecated-guile3.0-package guile3.0-sqlite3)
d15e4b1d 724
3b5783fc
AB
725(define-public guile-bytestructures
726 (package
727 (name "guile-bytestructures")
b1eb7448 728 (version "1.0.10")
16e42db0 729 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
3b5783fc 730 (source (origin
16e42db0
MO
731 (method git-fetch)
732 (uri (git-reference
733 (url home-page)
0a1da465 734 (commit version)))
43476625 735 (file-name (git-file-name name version))
3b5783fc
AB
736 (sha256
737 (base32
b1eb7448 738 "14k50jln32kkxv41hvsdgjkkfj6xlv06vc1caz01qkgk1fzh72nk"))))
4f85f7f7 739 (build-system gnu-build-system)
9a78e181 740 (arguments
7ed9c312
LC
741 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
742
743 #:phases (modify-phases %standard-phases
744 (add-after 'install 'install-doc
745 (lambda* (#:key outputs #:allow-other-keys)
746 (let* ((out (assoc-ref outputs "out"))
747 (package ,(package-full-name this-package "-"))
748 (doc (string-append out "/share/doc/" package)))
749 (install-file "README.md" doc)
750 #t))))))
726ecfeb 751 (native-inputs
16e42db0
MO
752 `(("autoconf" ,autoconf)
753 ("automake" ,automake)
b9a9c8ef 754 ("pkg-config" ,pkg-config)
b6bee63b 755 ("guile" ,guile-3.0)))
3b5783fc 756 (inputs
b6bee63b 757 `(("guile" ,guile-3.0)))
3b5783fc
AB
758 (synopsis "Structured access to bytevector contents for Guile")
759 (description
760 "Guile bytestructures offers a system imitating the type system
761of the C programming language, to be used on bytevectors. C's type
762system works on raw memory, and Guile works on bytevectors which are
763an abstraction over raw memory. It's also more powerful than the C
764type system, elevating types to first-class status.")
abba4073
LC
765 (license license:gpl3+)
766 (properties '((upstream-name . "bytestructures")))))
3b5783fc 767
726ecfeb
LC
768(define-public guile2.0-bytestructures
769 (package-for-guile-2.0 guile-bytestructures))
770
b6bee63b
LC
771(define-public guile2.2-bytestructures
772 (package-for-guile-2.2 guile-bytestructures))
773
774(define-deprecated-guile3.0-package guile3.0-bytestructures)
89a99d53 775
bd233722 776(define-public guile-git
e85035c9
LC
777 (package
778 (name "guile-git")
50d9bccb 779 (version "0.5.1")
e85035c9
LC
780 (home-page "https://gitlab.com/guile-git/guile-git.git")
781 (source (origin
7a6625e8
XC
782 (method git-fetch)
783 (uri (git-reference
784 (url home-page)
785 (commit (string-append "v" version))))
786 (file-name (git-file-name name version))
e85035c9
LC
787 (sha256
788 (base32
50d9bccb 789 "1x3wa6la4j1wcfxyhhjlmd7yp85wwpny0y6lrzpz803i9z5fwagc"))))
e85035c9 790 (build-system gnu-build-system)
3d867fea
EF
791 (arguments
792 `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ; to prevent guild warnings
e85035c9 793 (native-inputs
96a9675b 794 `(("pkg-config" ,pkg-config)
7a6625e8
XC
795 ("autoconf" ,autoconf)
796 ("automake" ,automake)
797 ("texinfo" ,texinfo)
b6bee63b 798 ("guile" ,guile-3.0)
96a9675b 799 ("guile-bytestructures" ,guile-bytestructures)))
e85035c9 800 (inputs
b6bee63b 801 `(("guile" ,guile-3.0)
e85035c9
LC
802 ("libgit2" ,libgit2)))
803 (propagated-inputs
804 `(("guile-bytestructures" ,guile-bytestructures)))
805 (synopsis "Guile bindings for libgit2")
806 (description
807 "This package provides Guile bindings to libgit2, a library to
bd233722 808manipulate repositories of the Git version control system.")
e85035c9 809 (license license:gpl3+)))
c5793e7e 810
b6bee63b
LC
811(define-public guile2.2-git
812 (package-for-guile-2.2 guile-git))
01c11aeb 813
70bc6085 814(define-public guile2.0-git
2bd60ca1 815 (package-for-guile-2.0 guile-git))
70bc6085 816
b6bee63b
LC
817(define-deprecated-guile3.0-package guile3.0-git)
818
e5758aeb
MO
819(define-public guile-zlib
820 (package
821 (name "guile-zlib")
97b45977 822 (version "0.1.0")
44241391
MO
823 (source
824 (origin
4aa7dfe4
MO
825 ;; XXX: Do not use "git-fetch" method here that would create and
826 ;; endless inclusion loop, because this package is used as an extension
827 ;; in the same method.
44241391
MO
828 (method url-fetch)
829 (uri
97b45977 830 (string-append "https://notabug.org/guile-zlib/guile-zlib/archive/v"
44241391 831 version ".tar.gz"))
b4d6e378 832 (file-name (string-append name "-" version ".tar.gz"))
44241391 833 (sha256
97b45977 834 ;; content hash: 1ip18nzwnczqyhn9cpzxkm9vzpi5fz5sy96cgjhmp7cwhnkmv6zv
44241391 835 (base32
97b45977 836 "1safz7rrbdf1d98x3lgx5v74kivpyf9n1v6pdyy22vd0f2sjdir5"))))
e5758aeb
MO
837 (build-system gnu-build-system)
838 (arguments
839 '(#:make-flags
840 '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
841 (native-inputs
842 `(("autoconf" ,autoconf)
843 ("automake" ,automake)
65777dce
MO
844 ("pkg-config" ,pkg-config)
845 ,@(if (%current-target-system)
846 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
847 '())))
e5758aeb
MO
848 (inputs
849 `(("guile" ,guile-3.0)
850 ("zlib" ,zlib)))
851 (synopsis "Guile bindings to zlib")
852 (description
853 "This package provides Guile bindings for zlib, a lossless
854data-compression library. The bindings are written in pure Scheme by using
855Guile's foreign function interface.")
856 (home-page "https://notabug.org/guile-zlib/guile-zlib")
857 (license license:gpl3+)))
a8307a17 858
e5758aeb
MO
859(define-public guile-lzlib
860 (package
861 (name "guile-lzlib")
af56f60e 862 (version "0.0.2")
69361e88
MO
863 (source
864 (origin
865 (method url-fetch)
866 (uri
867 (string-append "https://notabug.org/guile-lzlib/guile-lzlib/archive/"
868 version ".tar.gz"))
90748666 869 (file-name (string-append name "-" version ".tar.gz"))
69361e88
MO
870 (sha256
871 (base32
af56f60e 872 "11sggvncyx08ssp1s5xii4d6nskh1qwqihnbpzzvkrs7sivxn8w6"))))
e5758aeb
MO
873 (build-system gnu-build-system)
874 (arguments
875 '(#:make-flags
876 '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
877 (native-inputs
878 `(("autoconf" ,autoconf)
879 ("automake" ,automake)
0c50d723
MO
880 ("pkg-config" ,pkg-config)
881 ,@(if (%current-target-system)
882 `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc'
883 '())))
e5758aeb
MO
884 (inputs
885 `(("guile" ,guile-3.0)
886 ("lzlib" ,lzlib)))
887 (synopsis "Guile bindings to lzlib")
888 (description
889 "This package provides Guile bindings for lzlib, a C library for
890in-memory LZMA compression and decompression. The bindings are written in
891pure Scheme by using Guile's foreign function interface.")
892 (home-page "https://notabug.org/guile-lzlib/guile-lzlib")
893 (license license:gpl3+)))
894
32568f5b
LC
895(define-public guile-zstd
896 (package
897 (name "guile-zstd")
898 (version "0.1.1")
899 (home-page "https://notabug.org/guile-zstd/guile-zstd")
900 (source (origin
901 (method git-fetch)
902 (uri (git-reference (url home-page)
903 (commit (string-append "v" version))))
904 (file-name (git-file-name name version))
905 (sha256
906 (base32
907 "1c8l7829b5yx8wdc0mrhzjfwb6h9hb7cd8dfxcr71a7vlsi86310"))))
908 (build-system gnu-build-system)
909 (native-inputs
910 `(("autoconf" ,autoconf)
911 ("automake" ,automake)
912 ("pkg-config" ,pkg-config)
913 ("guile" ,guile-3.0)))
914 (inputs
915 `(("zstd" ,zstd "lib")
916 ("guile" ,guile-3.0)))
917 (synopsis "GNU Guile bindings to the zstd compression library")
918 (description
919 "This package provides a GNU Guile interface to the zstd (``zstandard'')
920compression library.")
921 (license license:gpl3+)))
922
e5758aeb 923;;; guile.scm ends here