gnu: avidemux: Add output lib dir to rpath.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
00ebe474 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
b515822d 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
6bc24063 4;;; Copyright © 2015 Christopher Allan Webber <cwebber@dustycloud.org>
1722d680 5;;;
233e7676 6;;; This file is part of GNU Guix.
1722d680 7;;;
233e7676 8;;; GNU Guix is free software; you can redistribute it and/or modify it
1722d680
LC
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
233e7676 13;;; GNU Guix is distributed in the hope that it will be useful, but
1722d680
LC
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
233e7676 19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
1722d680 20
1ffa7090 21(define-module (gnu packages guile)
4a44e743 22 #:use-module (guix licenses)
59a43334 23 #:use-module (gnu packages)
9c782445 24 #:use-module (gnu packages bash)
1ffa7090
LC
25 #:use-module (gnu packages bdw-gc)
26 #:use-module (gnu packages gawk)
27 #:use-module (gnu packages gperf)
28 #:use-module (gnu packages libffi)
29 #:use-module (gnu packages autotools)
f906d30c 30 #:use-module (gnu packages flex)
1ffa7090
LC
31 #:use-module (gnu packages libunistring)
32 #:use-module (gnu packages m4)
33 #:use-module (gnu packages multiprecision)
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages readline)
ef02e1e9 36 #:use-module (gnu packages ncurses)
87d836b2 37 #:use-module (gnu packages ed)
ce0614dd 38 #:use-module (gnu packages base)
f906d30c
CAW
39 #:use-module (gnu packages texinfo)
40 #:use-module (gnu packages gettext)
1722d680 41 #:use-module (guix packages)
87f5d366 42 #:use-module (guix download)
6bc24063 43 #:use-module (guix git-download)
32795fcf 44 #:use-module (guix build-system gnu)
6bc24063 45 #:use-module (guix build-system trivial)
32795fcf
LC
46 #:use-module (guix utils)
47 #:use-module (ice-9 match))
1722d680
LC
48
49;;; Commentary:
50;;;
c44899a2 51;;; GNU Guile, and modules and extensions.
1722d680
LC
52;;;
53;;; Code:
54
c44899a2
LC
55(define-public guile-1.8
56 (package
57 (name "guile")
58 (version "1.8.8")
59 (source (origin
87f5d366 60 (method url-fetch)
0db342a5 61 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
62 ".tar.gz"))
63 (sha256
64 (base32
01eafd38
LC
65 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
66 (patches (list (search-patch "guile-1.8-cpp-4.5.patch")))))
c44899a2
LC
67 (build-system gnu-build-system)
68 (arguments '(#:configure-flags '("--disable-error-on-warning")
c44899a2
LC
69
70 ;; Insert a phase before `configure' to patch things up.
71 #:phases (alist-cons-before
72 'configure
2f4fbe1c 73 'patch-stuff
c44899a2
LC
74 (lambda* (#:key outputs #:allow-other-keys)
75 ;; Add a call to `lt_dladdsearchdir' so that
76 ;; `libguile-readline.so' & co. are in the
77 ;; loader's search path.
78 (substitute* "libguile/dynl.c"
2f4fbe1c
LC
79 (("lt_dlinit.*$" match)
80 (format #f
81 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
82 match
83 (assoc-ref outputs "out"))))
84
85 ;; The usual /bin/sh...
86 (substitute* "ice-9/popen.scm"
87 (("/bin/sh") (which "sh"))))
c44899a2 88 %standard-phases)))
01eafd38 89 (inputs `(("gawk" ,gawk)
c44899a2
LC
90 ("readline" ,readline)))
91
92 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
93 ;; propagated.
94 (propagated-inputs `(("gmp" ,gmp)
be11b102 95 ("libltdl" ,libltdl)))
c44899a2
LC
96
97 ;; When cross-compiling, a native version of Guile itself is needed.
98 (self-native-input? #t)
99
9be8d7c8
LC
100 (native-search-paths
101 (list (search-path-specification
102 (variable "GUILE_LOAD_PATH")
af070955 103 (files '("share/guile/site")))))
9be8d7c8 104
f50d2669 105 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 106 (description
a22dc0c4
LC
107 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
108official extension language of the GNU system. It is an implementation of
109the Scheme language which can be easily embedded in other applications to
110provide a convenient means of extending the functionality of the application
111without requiring the source code to be rewritten.")
c44899a2 112 (home-page "http://www.gnu.org/software/guile/")
4a44e743 113 (license lgpl2.0+)))
c44899a2
LC
114
115(define-public guile-2.0
116 (package
117 (name "guile")
b1a01474 118 (version "2.0.11")
c44899a2 119 (source (origin
87f5d366 120 (method url-fetch)
0db342a5 121 (uri (string-append "mirror://gnu/guile/guile-" version
c44899a2
LC
122 ".tar.xz"))
123 (sha256
124 (base32
b515822d
MW
125 "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"))
126 (patches (list (search-patch "guile-arm-fixes.patch")))))
c44899a2
LC
127 (build-system gnu-build-system)
128 (native-inputs `(("pkgconfig" ,pkg-config)))
129 (inputs `(("libffi" ,libffi)
9c782445 130 ("readline" ,readline)
cba95006 131 ("bash" ,bash)))
c44899a2
LC
132
133 (propagated-inputs
134 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
135 ;; reads `-lltdl -lunistring', adding them here will add the needed
136 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
137 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
138 ("libunistring" ,libunistring)
be11b102
LC
139
140 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
141 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
142 ("libltdl" ,libltdl)
c44899a2
LC
143
144 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
145 ;; must be propagated.
bda1bc6c 146 ("bdw-gc" ,libgc)
c44899a2
LC
147 ("gmp" ,gmp)))
148
149 (self-native-input? #t)
150
9bf62d9b
LC
151 (outputs '("out" "debug"))
152
8ffaa93b 153 (arguments
9c782445 154 `(#:phases (alist-cons-before
8ffaa93b
LC
155 'configure 'pre-configure
156 (lambda* (#:key inputs #:allow-other-keys)
58b4e8e8 157 ;; Tell (ice-9 popen) the file name of Bash.
8ffaa93b
LC
158 (let ((bash (assoc-ref inputs "bash")))
159 (substitute* "module/ice-9/popen.scm"
160 (("/bin/sh")
161 (string-append bash "/bin/bash")))))
db619089 162 %standard-phases)))
8ffaa93b 163
9be8d7c8
LC
164 (native-search-paths
165 (list (search-path-specification
166 (variable "GUILE_LOAD_PATH")
af070955 167 (files '("share/guile/site/2.0")))
9be8d7c8
LC
168 (search-path-specification
169 (variable "GUILE_LOAD_COMPILED_PATH")
af070955 170 (files '("share/guile/site/2.0")))))
9be8d7c8 171
f50d2669 172 (synopsis "Scheme implementation intended especially for extensions")
c44899a2 173 (description
a22dc0c4
LC
174 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
175official extension language of the GNU system. It is an implementation of
176the Scheme language which can be easily embedded in other applications to
177provide a convenient means of extending the functionality of the application
178without requiring the source code to be rewritten.")
c44899a2 179 (home-page "http://www.gnu.org/software/guile/")
4a44e743 180 (license lgpl3+)))
c44899a2 181
fa29b199
LC
182(define-public guile-2.0/fixed
183 ;; A package of Guile 2.0 that's rarely changed. It is the one used
184 ;; in the `base' module, and thus changing it entails a full rebuild.
bda1bc6c 185 guile-2.0)
fa29b199 186
f906d30c
CAW
187(define-public guile-for-guile-emacs
188 (package (inherit guile-2.0)
189 (name "guile-for-guile-emacs")
190 (version "20150510.d8d9a8d")
191 (source (origin
192 (method git-fetch)
193 (uri (git-reference
194 (url "git://git.hcoop.net/git/bpt/guile.git")
195 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
196 (sha256
197 (base32
198 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
199 (arguments
200 (substitute-keyword-arguments `(;; Tests aren't passing for now.
201 ;; Obviously we should re-enable this!
202 #:tests? #f
203 ,@(package-arguments guile-2.0))
204 ((#:phases phases)
205 `(modify-phases ,phases
206 (add-after 'unpack 'autogen
207 (lambda _
208 (zero? (system* "sh" "autogen.sh"))))
209 (add-before 'autogen 'patch-/bin/sh
210 (lambda _
211 (substitute* "build-aux/git-version-gen"
212 (("#!/bin/sh") (string-append "#!" (which "sh"))))
213 #t))))))
214 (native-inputs
215 `(("autoconf" ,autoconf)
216 ("automake" ,automake)
217 ("libtool" ,libtool)
218 ("flex" ,flex)
219 ("texinfo" ,texinfo)
220 ("gettext" ,gnu-gettext)
221 ,@(package-native-inputs guile-2.0)))))
222
c44899a2
LC
223\f
224;;;
225;;; Extensions.
226;;;
227
d6d9f1f7 228(define-public guile-reader
1722d680 229 (package
d6d9f1f7
LC
230 (name "guile-reader")
231 (version "0.6")
232 (source (origin
233 (method url-fetch)
234 (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
235 version ".tar.gz"))
236 (sha256
237 (base32
238 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
239 (build-system gnu-build-system)
240 (native-inputs `(("pkgconfig" ,pkg-config)
241 ("gperf" ,gperf)))
242 (inputs `(("guile" ,guile-2.0)))
7d9e8c08
LC
243 (arguments `(;; The extract-*.sh scripts really expect to run in the C
244 ;; locale. Failing to do that, we end up with a build
245 ;; failure while extracting doc. (Fixed in Guile-Reader's
246 ;; repo.)
247 #:locale "C"
248
249 #:configure-flags
d6d9f1f7
LC
250 (let ((out (assoc-ref %outputs "out")))
251 (list (string-append "--with-guilemoduledir="
252 out "/share/guile/site/2.0")))))
253 (synopsis "Framework for building readers for GNU Guile")
254 (description
255 "Guile-Reader is a simple framework for building readers for GNU Guile.
1722d680
LC
256
257The idea is to make it easy to build procedures that extend Guile’s read
35b9e423 258procedure. Readers supporting various syntax variants can easily be written,
1722d680 259possibly by re-using existing “token readers” of a standard Scheme
35b9e423 260readers. For example, it is used to implement Skribilo’s R5RS-derived
1722d680
LC
261document syntax.
262
263Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
264hopefully more powerful and flexible (for instance, one may instantiate as
265many readers as needed).")
d6d9f1f7
LC
266 (home-page "http://www.nongnu.org/guile-reader/")
267 (license gpl3+)))
1722d680 268
ef02e1e9
LC
269(define-public guile-ncurses
270 (package
271 (name "guile-ncurses")
31a123fe 272 (version "1.6")
ef02e1e9
LC
273 (source (origin
274 (method url-fetch)
275 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
276 version ".tar.gz"))
277 (sha256
278 (base32
31a123fe 279 "0wmk681zzi1wxw543r2s2r84ndnzxp69kr7pc01aw4l55hg7jn73"))))
ef02e1e9
LC
280 (build-system gnu-build-system)
281 (inputs `(("ncurses" ,ncurses)
282 ("guile" ,guile-2.0)))
283 (arguments
2c6b7c7d
LC
284 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
285 (string-append "--with-guilesitedir="
ef02e1e9 286 (assoc-ref %outputs "out")
3f69e393 287 "/share/guile/site/2.0"))
b0b72780
LC
288 #:phases (alist-cons-before
289 'check 'change-locale
290 (lambda _
291 ;; Use the locale that's actually available in the build
292 ;; environment.
293 (substitute* "test/f009_form_wide.test"
294 (("en_US\\.utf8")
295 "en_US.UTF-8")))
296 (alist-cons-after
297 'install 'post-install
298 (lambda* (#:key outputs #:allow-other-keys)
299 (let* ((out (assoc-ref outputs "out"))
300 (dir (string-append out "/share/guile/site/"))
301 (files (find-files dir ".scm")))
302 (substitute* files
303 (("\"libguile-ncurses\"")
304 (format #f "\"~a/lib/libguile-ncurses\""
305 out)))))
306 %standard-phases))))
ef02e1e9 307 (home-page "http://www.gnu.org/software/guile-ncurses/")
f50d2669 308 (synopsis "Guile bindings to ncurses")
ef02e1e9 309 (description
12bcf94a 310 "guile-ncurses provides Guile language bindings for the ncurses
79c311b8 311library.")
ef02e1e9
LC
312 (license lgpl3+)))
313
87d836b2
LC
314(define-public mcron
315 (package
316 (name "mcron")
d12c626c 317 (version "1.0.8")
87d836b2
LC
318 (source (origin
319 (method url-fetch)
320 (uri (string-append "mirror://gnu/mcron/mcron-"
321 version ".tar.gz"))
322 (sha256
323 (base32
d12c626c 324 "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b"))
01eafd38 325 (patches (list (search-patch "mcron-install.patch")))))
87d836b2 326 (build-system gnu-build-system)
b6c18d6a
LC
327 (native-inputs `(("pkg-config" ,pkg-config)))
328 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0)))
87d836b2 329 (home-page "http://www.gnu.org/software/mcron/")
f50d2669 330 (synopsis "Run jobs at scheduled times")
87d836b2 331 (description
79c311b8 332 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
a22dc0c4 333tasks on a schedule, such as every hour or every Monday. Mcron is written in
79c311b8
LC
334Guile, so its configuration can be written in Scheme; the original cron
335format is also supported.")
87d836b2
LC
336 (license gpl3+)))
337
3e9066fc
LC
338(define-public guile-lib
339 (package
340 (name "guile-lib")
341 (version "0.2.2")
342 (source (origin
343 (method url-fetch)
344 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
345 version ".tar.gz"))
346 (sha256
347 (base32
348 "1f9n2b5b5r75lzjinyk6zp6g20g60msa0jpfrk5hhg4j8cy0ih4b"))))
349 (build-system gnu-build-system)
350 (arguments
351 '(#:phases (alist-cons-before
352 'configure 'patch-module-dir
353 (lambda _
354 (substitute* "src/Makefile.in"
355 (("^moddir[[:blank:]]*=[[:blank:]]*([[:graph:]]+)" _ rhs)
356 (string-append "moddir = " rhs "/2.0\n"))))
357 %standard-phases)))
358 (inputs `(("guile" ,guile-2.0)))
359 (home-page "http://www.nongnu.org/guile-lib/")
360 (synopsis "Collection of useful Guile Scheme modules")
361 (description
35b9e423 362 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
3e9066fc
LC
363modules, allowing for people to cooperate integrating their generic Guile
364modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
365for Guile\".")
366
367 ;; The whole is under GPLv3+, but some modules are under laxer
368 ;; distribution terms such as LGPL and public domain. See `COPYING' for
369 ;; details.
370 (license gpl3+)))
371
6050a1fb
CR
372(define-public guile-json
373 (package
374 (name "guile-json")
cdf2b286 375 (version "0.4.0")
6050a1fb
CR
376 (source (origin
377 (method url-fetch)
378 (uri (string-append "mirror://savannah/guile-json/guile-json-"
379 version ".tar.gz"))
380 (sha256
381 (base32
cdf2b286 382 "0v06272rw4ycwzssjf3fzpk2vhpslvl55hz94q80vc6f74j0d5h6"))
bf6fcf54
LC
383 (modules '((guix build utils)))
384 (snippet
385 ;; Make sure everything goes under .../site/2.0, like Guile's
386 ;; search paths expects.
387 '(substitute* '("Makefile.in" "json/Makefile.in")
388 (("moddir =.*/share/guile/site" all)
389 (string-append all "/2.0"))))))
6050a1fb 390 (build-system gnu-build-system)
db5584dd 391 (native-inputs `(("guile" ,guile-2.0)))
6050a1fb
CR
392 (home-page "http://savannah.nongnu.org/projects/guile-json/")
393 (synopsis "JSON module for Guile")
394 (description
395 "Guile-json supports parsing and building JSON documents according to the
35b9e423 396http:://json.org specification. These are the main features:
6050a1fb
CR
397- Strictly complies to http://json.org specification.
398- Build JSON documents programmatically via macros.
399- Unicode support for strings.
400- Allows JSON pretty printing.")
401 (license lgpl3+)))
402
6bc24063
CAW
403(define-public guile-minikanren
404 (package
405 (name "guile-minikanren")
406 (version "20150424.e844d85")
407 (source (origin
408 (method git-fetch)
409 (uri (git-reference
410 (url "https://github.com/ijp/minikanren.git")
411 (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
412 (sha256
413 (base32
414 "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
415 (build-system trivial-build-system)
416 (arguments
417 `(#:modules
418 ((guix build utils)
419 (ice-9 match))
420 #:builder
421 (begin
422 (use-modules (guix build utils)
423 (ice-9 match))
424 (let* ((out (assoc-ref %outputs "out"))
425 (module-dir (string-append out "/share/guile/site/2.0"))
426 (source (assoc-ref %build-inputs "source"))
427 (doc (string-append out "/share/doc"))
428 (scm-files '("minikanren.scm"
429 "minikanren/mkextraforms.scm"
430 "minikanren/mkprelude.scm"
431 "minikanren/mk.scm"))
432 (guild (string-append (assoc-ref %build-inputs "guile")
433 "/bin/guild")))
434 ;; Make installation directories.
435 (mkdir-p (string-append module-dir "/minikanren"))
436 (mkdir-p doc)
437
438 ;; Compile .scm files and install.
439 (chdir source)
440 (setenv "GUILE_AUTO_COMPILE" "0")
441 (for-each (lambda (file)
442 (let* ((dest-file (string-append module-dir "/"
443 file ".scm"))
444 (go-file (match (string-split file #\.)
445 ((base _)
446 (string-append module-dir "/"
447 base ".go")))))
448 ;; Install source module.
449 (copy-file file dest-file)
450 ;; Install compiled module.
451 (unless (zero? (system* guild "compile"
452 "-L" source
453 "-o" go-file
454 file))
455 (error (format #f "Failed to compile ~s to ~s!"
456 file go-file)))))
457 scm-files)
458
459 ;; Also copy over the README.
460 (copy-file "README.org" (string-append doc "/README.org"))
461 #t))))
462 (inputs
463 `(("guile" ,guile-2.0)))
464 (home-page "https://github.com/ijp/minikanren")
465 (synopsis "miniKanren declarative logic system, packaged for Guile")
466 (description
467 "MiniKanren is a relational programming extension to the Scheme
468programming Language, written as a smaller version of Kanren suitable for
469pedagogical purposes. It is featured in the book, The Reasoned Schemer,
470written by Dan Friedman, William Byrd, and Oleg Kiselyov.
471
472This is Ian Price's r6rs packaged version of miniKranen, which deviates
473slightly from miniKanren mainline.
474
475See http://minikanren.org/ for more on miniKanren generally.")
476 (license expat)))
477
1722d680 478;;; guile.scm ends here