gnu: ovmf: Adapt to CPLUS_INCLUDE_PATH changes.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
9b65dea8 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 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
RW
8;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
9;;; Copyright © 2016, 2019 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>
1722d680 18;;;
233e7676 19;;; This file is part of GNU Guix.
1722d680 20;;;
233e7676 21;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
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;;;
233e7676 26;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
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
233e7676 32;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 33
1ffa7090 34(define-module (gnu packages guile)
71e0f217 35 #:use-module ((guix licenses) #:prefix license:)
59a43334 36 #:use-module (gnu packages)
146c6b62
RW
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
9c782445 39 #:use-module (gnu packages bash)
1ffa7090 40 #:use-module (gnu packages bdw-gc)
148585c2 41 #:use-module (gnu packages compression)
255d1bbe 42 #:use-module (gnu packages dbm)
146c6b62 43 #:use-module (gnu packages flex)
1ffa7090 44 #:use-module (gnu packages gawk)
146c6b62 45 #:use-module (gnu packages gettext)
ee8ee748 46 #:use-module (gnu packages hurd)
1ffa7090 47 #:use-module (gnu packages libffi)
1ffa7090 48 #:use-module (gnu packages libunistring)
7119cca8 49 #:use-module (gnu packages linux)
1ffa7090
LC
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)
cd0322a3 54 #:use-module (gnu packages sqlite)
f906d30c 55 #:use-module (gnu packages texinfo)
bd233722 56 #:use-module (gnu packages version-control)
1722d680 57 #:use-module (guix packages)
87f5d366 58 #:use-module (guix download)
6bc24063 59 #:use-module (guix git-download)
32795fcf 60 #:use-module (guix build-system gnu)
977d8666 61 #:use-module (guix build-system guile)
84af1e74 62 #:use-module (guix deprecation)
32795fcf 63 #:use-module (guix utils)
d4660a54
MC
64 #:use-module (ice-9 match)
65 #:use-module ((srfi srfi-1) #:prefix srfi-1:))
1722d680
LC
66
67;;; Commentary:
68;;;
c44899a2 69;;; GNU Guile, and modules and extensions.
1722d680
LC
70;;;
71;;; Code:
72
c44899a2
LC
73(define-public guile-1.8
74 (package
75 (name "guile")
76 (version "1.8.8")
77 (source (origin
87f5d366 78 (method url-fetch)
0db342a5 79 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
80 ".tar.gz"))
81 (sha256
82 (base32
01eafd38 83 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
fc1adab1 84 (patches (search-patches "guile-1.8-cpp-4.5.patch"))))
c44899a2
LC
85 (build-system gnu-build-system)
86 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
87
88 ;; Insert a phase before `configure' to patch things up.
dc1d3cde
KK
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"))))
2f4fbe1c 102
dc1d3cde
KK
103 ;; The usual /bin/sh...
104 (substitute* "ice-9/popen.scm"
105 (("/bin/sh") (which "sh")))
106 #t)))))
528ea990
LC
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
01eafd38 113 (inputs `(("gawk" ,gawk)
c44899a2
LC
114 ("readline" ,readline)))
115
116 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
117 ;; propagated.
118 (propagated-inputs `(("gmp" ,gmp)
be11b102 119 ("libltdl" ,libltdl)))
c44899a2 120
9be8d7c8
LC
121 (native-search-paths
122 (list (search-path-specification
123 (variable "GUILE_LOAD_PATH")
af070955 124 (files '("share/guile/site")))))
9be8d7c8 125
f50d2669 126 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 127 (description
a22dc0c4
LC
128 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
129official extension language of the GNU system. It is an implementation of
130the Scheme language which can be easily embedded in other applications to
131provide a convenient means of extending the functionality of the application
132without requiring the source code to be rewritten.")
6fd52309 133 (home-page "https://www.gnu.org/software/guile/")
71e0f217 134 (license license:lgpl2.0+)))
c44899a2
LC
135
136(define-public guile-2.0
137 (package
138 (name "guile")
b5efd14a 139 (version "2.0.14")
c44899a2 140 (source (origin
87f5d366 141 (method url-fetch)
0db342a5 142 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
143 ".tar.xz"))
144 (sha256
145 (base32
b5efd14a 146 "10lxc6l5alf3lzbs3ihnbfy6dfcrsyf8667wa57f26vf4mk2ai78"))))
c44899a2 147 (build-system gnu-build-system)
528ea990
LC
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)))
c44899a2 154 (inputs `(("libffi" ,libffi)
88da729f 155 ,@(libiconv-if-needed)
baf549df
LC
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)))))
c44899a2
LC
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)
be11b102
LC
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)
c44899a2
LC
171
172 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
173 ;; must be propagated.
bda1bc6c 174 ("bdw-gc" ,libgc)
c44899a2
LC
175 ("gmp" ,gmp)))
176
9bf62d9b
LC
177 (outputs '("out" "debug"))
178
8ffaa93b 179 (arguments
20897536
TGR
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))))))
8ffaa93b 198
9be8d7c8
LC
199 (native-search-paths
200 (list (search-path-specification
201 (variable "GUILE_LOAD_PATH")
af070955 202 (files '("share/guile/site/2.0")))
9be8d7c8
LC
203 (search-path-specification
204 (variable "GUILE_LOAD_COMPILED_PATH")
b03f270e 205 (files '("lib/guile/2.0/site-ccache")))))
9be8d7c8 206
f50d2669 207 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 208 (description
a22dc0c4
LC
209 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
210official extension language of the GNU system. It is an implementation of
211the Scheme language which can be easily embedded in other applications to
212provide a convenient means of extending the functionality of the application
213without requiring the source code to be rewritten.")
6fd52309 214 (home-page "https://www.gnu.org/software/guile/")
71e0f217 215 (license license:lgpl3+)))
c44899a2 216
f6396d86 217(define-public guile-2.2
f906d30c 218 (package (inherit guile-2.0)
f6396d86 219 (name "guile")
edc8fd2e 220 (version "2.2.7")
4eae7980
LC
221 (source (origin
222 (method url-fetch)
34d624ce
LC
223
224 ;; Note: we are limited to one of the compression formats
225 ;; supported by the bootstrap binaries, so no lzip here.
80a72572 226 (uri (string-append "mirror://gnu/guile/guile-" version
34d624ce 227 ".tar.xz"))
4eae7980
LC
228 (sha256
229 (base32
edc8fd2e 230 "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd"))
d9f0788a 231 (modules '((guix build utils)))
44f07d1d
CD
232 (patches (search-patches
233 "guile-2.2-skip-oom-test.patch"))
d9f0788a
LC
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).
6cbee49d
MW
238 (snippet '(begin
239 (for-each delete-file
240 (find-files "prebuilt" "\\.go$"))
241 #t))))
4fbd0f4f 242 (properties '((timeout . 72000) ;20 hours
16b0f205 243 (max-silent-time . 36000))) ;10 hours (needed on ARM
1577a658 244 ; when heavily loaded)
dd90ed89
DT
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")
1dcca83a 251 (files '("lib/guile/2.2/site-ccache")))))))
4eae7980 252
edc8fd2e 253(define-deprecated guile-2.2/bug-fix guile-2.2)
4bd6f1d1 254
8400d097
LC
255(define-public guile-2.2.4
256 (package/inherit
257 guile-2.2
258 (version "2.2.4")
259 (source (origin
260 (inherit (package-source guile-2.2))
261 (uri (string-append "mirror://gnu/guile/guile-" version
262 ".tar.xz"))
263 (sha256
264 (base32
265 "07p3g0v2ba2vlfbfidqzlgbhnzdx46wh2rgc5gszq1mjyx5bks6r"))))))
34d624ce 266
e7921d5e
LC
267(define-public guile-3.0
268 ;; This is the latest Guile stable version.
2d0e802f
DT
269 (package
270 (inherit guile-2.2)
b6bee63b 271 (name "guile")
98619142 272 (version "3.0.1")
2d0e802f
DT
273 (source (origin
274 (inherit (package-source guile-2.2))
1a30351b 275 (uri (string-append "mirror://gnu/guile/guile-"
2d0e802f
DT
276 version ".tar.xz"))
277 (sha256
278 (base32
98619142
LC
279 "1jakps3127h8g69ixgb4zwc8v2g29dmwql1vi3pwg30kzp8fm5nn"))
280 (patches
281 (append (search-patches "guile-3.0-crash.patch")
282 (origin-patches (package-source guile-2.2))))))
2d0e802f
DT
283 (native-search-paths
284 (list (search-path-specification
285 (variable "GUILE_LOAD_PATH")
286 (files '("share/guile/site/3.0")))
287 (search-path-specification
288 (variable "GUILE_LOAD_COMPILED_PATH")
289 (files '("lib/guile/3.0/site-ccache"
e7921d5e
LC
290 "share/guile/site/3.0")))))))
291
292(define-public guile-next guile-3.0)
5cd074ea 293
b6bee63b
LC
294(define-public guile-3.0/fixed
295 ;; A package of Guile that's rarely changed. It is the one used in the
296 ;; `base' module, and thus changing it entails a full rebuild.
297 (package
298 (inherit guile-3.0)
299 (properties '((hidden? . #t) ;people should install 'guile-2.2'
300 (timeout . 72000) ;20 hours
301 (max-silent-time . 36000))))) ;10 hours (needed on ARM
302 ; when heavily loaded)
303
7c3b6b2e 304(define* (make-guile-readline guile #:optional (name "guile-readline"))
2ba2c98d 305 (package
7c3b6b2e 306 (name name)
2ba2c98d
LC
307 (version (package-version guile))
308 (source (package-source guile))
309 (build-system gnu-build-system)
310 (arguments
311 '(#:configure-flags '("--disable-silent-rules")
312 #:phases (modify-phases %standard-phases
313 (add-before 'build 'chdir
314 (lambda* (#:key outputs #:allow-other-keys)
315 (invoke "make" "-C" "libguile" "scmconfig.h")
316 (invoke "make" "-C" "lib")
317 (chdir "guile-readline")
318
319 (substitute* "Makefile"
320 (("../libguile/libguile-[[:graph:]]+\\.la")
321 ;; Remove dependency on libguile-X.Y.la.
322 "")
323 (("^READLINE_LIBS = (.*)$" _ libs)
324 ;; Link against the provided libguile.
325 (string-append "READLINE_LIBS = "
326 "-lguile-$(GUILE_EFFECTIVE_VERSION) "
327 libs "\n"))
328 (("\\$\\(top_builddir\\)/meta/build-env")
329 ;; Use the provided Guile, not the one from
330 ;; $(builddir).
331 "")
332
333 ;; Install modules to the 'site' directories.
334 (("^moddir = .*$")
335 "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n")
336 (("^ccachedir = .*$")
337 "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n"))
338
339 ;; Load 'guile-readline.so' from the right place.
340 (substitute* "ice-9/readline.scm"
341 (("load-extension \"guile-readline\"")
342 (format #f "load-extension \
343 (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")"
344 (assoc-ref outputs "out"))))
345 #t)))))
346 (home-page (package-home-page guile))
347 (native-inputs (package-native-inputs guile))
348 (inputs
349 `(,@(package-inputs guile) ;to placate 'configure'
350 ,@(package-propagated-inputs guile)
351 ("guile" ,guile)
352 ("readline" ,readline)))
353 (synopsis "Line editing support for GNU Guile")
354 (description
355 "This module provides line editing support via the Readline library for
356GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its
357@code{activate-readline} procedure to enable it.")
358 (license license:gpl3+)))
359
360(define-public guile-readline
142cd4dc 361 (make-guile-readline guile-3.0))
2ba2c98d 362
142cd4dc
MB
363(define-public guile2.2-readline
364 (make-guile-readline guile-2.2 "guile2.2-readline"))
7c3b6b2e 365
8f4acad7
LC
366(define (guile-variant-package-name prefix)
367 (lambda (name)
368 "Return NAME with PREFIX instead of \"guile-\", when applicable."
369 (if (string-prefix? "guile-" name)
370 (string-append prefix "-"
371 (string-drop name
372 (string-length "guile-")))
373 name)))
947a5d47 374
8f4acad7 375(define package-for-guile-2.0
10b507b2
LC
376 ;; A procedure that rewrites the dependency tree of the given package to use
377 ;; GUILE-2.0 instead of GUILE-2.2.
c9c51ac3 378 (package-input-rewriting `((,guile-2.2 . ,guile-2.0))
8f4acad7 379 (guile-variant-package-name "guile2.0")))
947a5d47 380
b6bee63b
LC
381(define package-for-guile-2.2
382 (package-input-rewriting `((,guile-3.0 . ,guile-2.2))
383 (guile-variant-package-name "guile2.2")))
384
385(define-syntax define-deprecated-guile3.0-package
386 (lambda (s)
387 "Define a deprecated package alias for \"guile3.0-something\"."
388 (syntax-case s ()
389 ((_ name)
390 (and (identifier? #'name)
391 (string-prefix? "guile3.0-" (symbol->string (syntax->datum
392 #'name))))
393 (let ((->guile (lambda (str)
394 (let ((base (string-drop str
395 (string-length "guile3.0-"))))
396 (string-append "guile-" base)))))
397 (with-syntax ((package-name (symbol->string (syntax->datum #'name)))
398 (package
399 (datum->syntax
400 #'name
401 (string->symbol
402 (->guile (symbol->string (syntax->datum #'name)))))))
403 #'(begin
404 (define-deprecated name package
405 (deprecated-package package-name package))
406 (export name))))))))
89a99d53 407
142cd4dc
MB
408(define-deprecated-guile3.0-package guile3.0-readline)
409
4eae7980 410(define-public guile-for-guile-emacs
f6396d86 411 (package (inherit guile-2.2)
4eae7980
LC
412 (name "guile-for-guile-emacs")
413 (version "20150510.d8d9a8d")
f906d30c
CAW
414 (source (origin
415 (method git-fetch)
416 (uri (git-reference
4eae7980
LC
417 (url "git://git.hcoop.net/git/bpt/guile.git")
418 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
51988e3a 419 (file-name (string-append name "-" version "-checkout"))
f906d30c
CAW
420 (sha256
421 (base32
4eae7980 422 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
f906d30c 423 (arguments
8924e3fd
RW
424 `(;; Tests aren't passing for now.
425 ;; Obviously we should re-enable this!
426 #:tests? #f
427 ,@(package-arguments guile-2.2)))
f906d30c
CAW
428 (native-inputs
429 `(("autoconf" ,autoconf)
430 ("automake" ,automake)
431 ("libtool" ,libtool)
432 ("flex" ,flex)
433 ("texinfo" ,texinfo)
b94a6ca0 434 ("gettext" ,gettext-minimal)
f6396d86 435 ,@(package-native-inputs guile-2.2)))
daeb61f7
RW
436 ;; Same as in guile-2.0
437 (native-search-paths
438 (list (search-path-specification
439 (variable "GUILE_LOAD_PATH")
440 (files '("share/guile/site/2.0")))
441 (search-path-specification
442 (variable "GUILE_LOAD_COMPILED_PATH")
31769b9f 443 (files '("lib/guile/2.0/site-ccache"
daeb61f7 444 "share/guile/site/2.0")))))))
be3feafe 445
c44899a2
LC
446\f
447;;;
448;;; Extensions.
449;;;
450
84af1e74 451(define-public guile-json-1
6050a1fb
CR
452 (package
453 (name "guile-json")
15214828 454 (version "1.2.0")
f52ef55e 455 (home-page "https://github.com/aconchillo/guile-json")
6050a1fb 456 (source (origin
ffc72ec6 457 (method url-fetch)
28123c01
LC
458 (uri (string-append "mirror://savannah/guile-json/guile-json-"
459 version ".tar.gz"))
ffc72ec6
LC
460 (sha256
461 (base32
6efccabe 462 "15gnb84d7hpazqhskkf3g9z4r6knw54wfj4ch5270kakz1lp70c9"))))
6050a1fb 463 (build-system gnu-build-system)
6efccabe 464 (native-inputs `(("pkg-config" ,pkg-config)
f52ef55e
LC
465 ("guile" ,guile-2.2)))
466 (inputs `(("guile" ,guile-2.2)))
6050a1fb
CR
467 (synopsis "JSON module for Guile")
468 (description
0f31d4f0
LC
469 "Guile-JSON supports parsing and building JSON documents according to the
470specification. These are the main features:
471
472@itemize
473@item Strictly complies to @uref{http://json.org, specification}.
474@item Build JSON documents programmatically via macros.
475@item Unicode support for strings.
476@item Allows JSON pretty printing.
477@end itemize\n")
15214828
LC
478
479 ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+).
480 (license license:gpl3+)))
6050a1fb 481
84af1e74
LC
482;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or
483;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for
484;; 'guile-json-3'.
9b65dea8 485(define-deprecated guile-json guile-json-1)
7f81cce3 486(export guile-json)
584a3ca3 487
2252f087 488(define-public guile2.0-json
84af1e74 489 (package-for-guile-2.0 guile-json-1))
947a5d47 490
152d4076
LC
491(define-public guile-json-3
492 ;; This version is incompatible with 1.x; see the 'NEWS' file.
493 (package
84af1e74 494 (inherit guile-json-1)
152d4076 495 (name "guile-json")
4e029919 496 (version "3.2.0")
152d4076
LC
497 (source (origin
498 (method url-fetch)
28123c01
LC
499 (uri (string-append "mirror://savannah/guile-json/guile-json-"
500 version ".tar.gz"))
152d4076
LC
501 (sha256
502 (base32
b6bee63b
LC
503 "14m6b6g2maw0mkvfm4x63rqb54vgbpn1gcqs715ijw4bikfzlqfz"))))
504 (native-inputs `(("pkg-config" ,pkg-config)
505 ("guile" ,guile-3.0)))
506 (inputs `(("guile" ,guile-3.0)))))
507
508(define-public guile2.2-json
509 (package-for-guile-2.2 guile-json-3))
152d4076 510
89a99d53 511(define-public guile3.0-json
b6bee63b 512 (deprecated-package "guile3.0-json" guile-json-3))
89a99d53 513
93e7199b
CAW
514;; There are two guile-gdbm packages, one using the FFI and one with
515;; direct C bindings, hence the verbose name.
516
517(define-public guile-gdbm-ffi
518 (package
519 (name "guile-gdbm-ffi")
520 (version "20120209.fa1d5b6")
521 (source (origin
522 (method git-fetch)
523 (uri (git-reference
524 (url "https://github.com/ijp/guile-gdbm.git")
525 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
821f4dc2 526 (file-name (string-append name "-" version "-checkout"))
977d8666
LC
527 (patches (search-patches
528 "guile-gdbm-ffi-support-gdbm-1.14.patch"))
93e7199b
CAW
529 (sha256
530 (base32
531 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
977d8666
LC
532 (build-system guile-build-system)
533 (arguments
534 '(#:phases (modify-phases %standard-phases
535 (add-after 'unpack 'move-examples
536 (lambda* (#:key outputs #:allow-other-keys)
537 ;; Move examples where they belong.
538 (let* ((out (assoc-ref outputs "out"))
539 (doc (string-append out "/share/doc/"
540 (strip-store-file-name out)
541 "/examples")))
542 (copy-recursively "examples" doc)
543 (delete-file-recursively "examples")
544 #t)))
545 (add-after 'unpack 'set-libgdbm-file-name
546 (lambda* (#:key inputs #:allow-other-keys)
547 (substitute* "gdbm.scm"
548 (("\\(dynamic-link \"libgdbm\"\\)")
549 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
550 (assoc-ref inputs "gdbm"))))
551 #t)))))
552 (native-inputs
b6bee63b 553 `(("guile" ,guile-3.0)))
56f31a9f 554 (inputs
56f31a9f 555 `(("gdbm" ,gdbm)))
93e7199b
CAW
556 (home-page "https://github.com/ijp/guile-gdbm")
557 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
558 (description
559 "Guile bindings to the GDBM key-value storage system, using
560Guile's foreign function interface.")
71e0f217 561 (license license:gpl3+)))
93e7199b 562
5bd3a841
LC
563(define-public guile2.0-gdbm-ffi
564 (package-for-guile-2.0 guile-gdbm-ffi))
565
b6bee63b
LC
566(define-public guile2.2-gdbm-ffi
567 (package-for-guile-2.2 guile-gdbm-ffi))
568
569(define-deprecated-guile3.0-package guile3.0-gdbm-ffi)
93e7199b 570
e8ac1f8f 571(define-public guile-sqlite3
319e26e4
LC
572 (package
573 (name "guile-sqlite3")
574 (version "0.1.0")
3527f600 575 (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git")
319e26e4
LC
576 (source (origin
577 (method git-fetch)
578 (uri (git-reference
579 (url home-page)
580 (commit (string-append "v" version))))
581 (sha256
582 (base32
583 "1nv8j7wk6b5n4p22szyi8lv8fs31rrzxhzz16gyj8r38c1fyp9qp"))
e53bf62e
MO
584 (file-name (string-append name "-" version "-checkout"))
585 (patches
9d5aa009 586 (search-patches "guile-sqlite3-fix-cross-compilation.patch"))
d15e4b1d
LC
587 (modules '((guix build utils)))
588 (snippet
589 '(begin
590 ;; Allow builds with Guile 3.0.
591 (substitute* "configure.ac"
592 (("^GUILE_PKG.*")
593 "GUILE_PKG([3.0 2.2 2.0])\n"))
594 #t))))
319e26e4
LC
595 (build-system gnu-build-system)
596 (native-inputs
597 `(("autoconf" ,autoconf)
598 ("automake" ,automake)
02ed227f 599 ("guile" ,guile-3.0)
319e26e4
LC
600 ("pkg-config" ,pkg-config)))
601 (inputs
b6bee63b 602 `(("guile" ,guile-3.0)
319e26e4
LC
603 ("sqlite" ,sqlite)))
604 (synopsis "Access SQLite databases from Guile")
605 (description
606 "This package provides Guile bindings to the SQLite database system.")
607 (license license:gpl3+)))
e8ac1f8f 608
c8e3651a
EB
609(define-public guile2.0-sqlite3
610 (package-for-guile-2.0 guile-sqlite3))
611
b6bee63b
LC
612(define-public guile2.2-sqlite3
613 (package-for-guile-2.2 guile-sqlite3))
614
615(define-deprecated-guile3.0-package guile3.0-sqlite3)
d15e4b1d 616
3b5783fc
AB
617(define-public guile-bytestructures
618 (package
619 (name "guile-bytestructures")
247a47bc 620 (version "1.0.7")
16e42db0 621 (home-page "https://github.com/TaylanUB/scheme-bytestructures")
3b5783fc 622 (source (origin
16e42db0
MO
623 (method git-fetch)
624 (uri (git-reference
625 (url home-page)
626 (commit (string-append "v" version))))
43476625 627 (file-name (git-file-name name version))
3b5783fc
AB
628 (sha256
629 (base32
247a47bc 630 "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb"))))
4f85f7f7 631 (build-system gnu-build-system)
9a78e181 632 (arguments
7ed9c312
LC
633 `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
634
635 #:phases (modify-phases %standard-phases
636 (add-after 'install 'install-doc
637 (lambda* (#:key outputs #:allow-other-keys)
638 (let* ((out (assoc-ref outputs "out"))
639 (package ,(package-full-name this-package "-"))
640 (doc (string-append out "/share/doc/" package)))
641 (install-file "README.md" doc)
642 #t))))))
726ecfeb 643 (native-inputs
16e42db0
MO
644 `(("autoconf" ,autoconf)
645 ("automake" ,automake)
b9a9c8ef 646 ("pkg-config" ,pkg-config)
b6bee63b 647 ("guile" ,guile-3.0)))
3b5783fc 648 (inputs
b6bee63b 649 `(("guile" ,guile-3.0)))
3b5783fc
AB
650 (synopsis "Structured access to bytevector contents for Guile")
651 (description
652 "Guile bytestructures offers a system imitating the type system
653of the C programming language, to be used on bytevectors. C's type
654system works on raw memory, and Guile works on bytevectors which are
655an abstraction over raw memory. It's also more powerful than the C
656type system, elevating types to first-class status.")
abba4073
LC
657 (license license:gpl3+)
658 (properties '((upstream-name . "bytestructures")))))
3b5783fc 659
726ecfeb
LC
660(define-public guile2.0-bytestructures
661 (package-for-guile-2.0 guile-bytestructures))
662
b6bee63b
LC
663(define-public guile2.2-bytestructures
664 (package-for-guile-2.2 guile-bytestructures))
665
666(define-deprecated-guile3.0-package guile3.0-bytestructures)
89a99d53 667
bd233722 668(define-public guile-git
e85035c9
LC
669 (package
670 (name "guile-git")
25623647 671 (version "0.3.0")
e85035c9
LC
672 (home-page "https://gitlab.com/guile-git/guile-git.git")
673 (source (origin
25623647
MB
674 (method url-fetch)
675 (uri (string-append "https://gitlab.com/guile-git/guile-git/uploads/"
676 "4c563d8e7e1ff84396abe8ca7011bcaf/guile-git-"
677 version ".tar.gz"))
e85035c9
LC
678 (sha256
679 (base32
25623647 680 "0c5i3d16hp7gp9rd78vk9zc45js8bphf92m4lbb5gyi4l1yl7kkm"))))
e85035c9
LC
681 (build-system gnu-build-system)
682 (native-inputs
96a9675b 683 `(("pkg-config" ,pkg-config)
b6bee63b 684 ("guile" ,guile-3.0)
96a9675b 685 ("guile-bytestructures" ,guile-bytestructures)))
e85035c9 686 (inputs
b6bee63b 687 `(("guile" ,guile-3.0)
e85035c9
LC
688 ("libgit2" ,libgit2)))
689 (propagated-inputs
690 `(("guile-bytestructures" ,guile-bytestructures)))
691 (synopsis "Guile bindings for libgit2")
692 (description
693 "This package provides Guile bindings to libgit2, a library to
bd233722 694manipulate repositories of the Git version control system.")
e85035c9 695 (license license:gpl3+)))
c5793e7e 696
b6bee63b
LC
697(define-public guile2.2-git
698 (package-for-guile-2.2 guile-git))
01c11aeb 699
70bc6085 700(define-public guile2.0-git
60353203
LC
701 (let ((base (package-for-guile-2.0 guile-git)))
702 (package
703 (inherit base)
704 ;; Libgit2's Guile test driver requires (ice-9 textual-ports), which is
705 ;; not in Guile 2.0. Thus, keep LIBGIT2 as-is here (i.e., built against
706 ;; Guile 2.2).
707 (inputs `(("libgit2" ,libgit2)
708 ,@(srfi-1:alist-delete "libgit2"
709 (package-inputs base)))))))
70bc6085 710
b6bee63b
LC
711(define-deprecated-guile3.0-package guile3.0-git)
712
1722d680 713;;; guile.scm ends here
a8307a17 714