1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Christopher Allan Webber <cwebber@dustycloud.org>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
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.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages guile)
22 #:use-module (guix licenses)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages bash)
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)
30 #:use-module (gnu packages flex)
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)
36 #:use-module (gnu packages ncurses)
37 #:use-module (gnu packages ed)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages texinfo)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages gdbm)
42 #:use-module (guix packages)
43 #:use-module (guix download)
44 #:use-module (guix git-download)
45 #:use-module (guix build-system gnu)
46 #:use-module (guix build-system trivial)
47 #:use-module (guix utils)
48 #:use-module (ice-9 match))
52 ;;; GNU Guile, and modules and extensions.
56 (define-public guile-1.8
62 (uri (string-append "mirror://gnu/guile/guile-" version
66 "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))
67 (patches (list (search-patch "guile-1.8-cpp-4.5.patch")))))
68 (build-system gnu-build-system)
69 (arguments '(#:configure-flags '("--disable-error-on-warning")
71 ;; Insert a phase before `configure' to patch things up.
72 #:phases (alist-cons-before
75 (lambda* (#:key outputs #:allow-other-keys)
76 ;; Add a call to `lt_dladdsearchdir' so that
77 ;; `libguile-readline.so' & co. are in the
78 ;; loader's search path.
79 (substitute* "libguile/dynl.c"
80 (("lt_dlinit.*$" match)
82 " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
84 (assoc-ref outputs "out"))))
86 ;; The usual /bin/sh...
87 (substitute* "ice-9/popen.scm"
88 (("/bin/sh") (which "sh"))))
90 (inputs `(("gawk" ,gawk)
91 ("readline" ,readline)))
93 ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
95 (propagated-inputs `(("gmp" ,gmp)
96 ("libltdl" ,libltdl)))
98 ;; When cross-compiling, a native version of Guile itself is needed.
99 (self-native-input? #t)
102 (list (search-path-specification
103 (variable "GUILE_LOAD_PATH")
104 (files '("share/guile/site")))))
106 (synopsis "Scheme implementation intended especially for extensions")
108 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
109 official extension language of the GNU system. It is an implementation of
110 the Scheme language which can be easily embedded in other applications to
111 provide a convenient means of extending the functionality of the application
112 without requiring the source code to be rewritten.")
113 (home-page "http://www.gnu.org/software/guile/")
116 (define-public guile-2.0
122 (uri (string-append "mirror://gnu/guile/guile-" version
126 "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"))
127 (patches (list (search-patch "guile-arm-fixes.patch")))))
128 (build-system gnu-build-system)
129 (native-inputs `(("pkgconfig" ,pkg-config)))
130 (inputs `(("libffi" ,libffi)
131 ("readline" ,readline)
135 `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
136 ;; reads `-lltdl -lunistring', adding them here will add the needed
137 ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
138 ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
139 ("libunistring" ,libunistring)
141 ;; Depend on LIBLTDL, not LIBTOOL. That way, we avoid some the extra
142 ;; dependencies that LIBTOOL has, which is helpful during bootstrap.
145 ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
146 ;; must be propagated.
150 (self-native-input? #t)
152 (outputs '("out" "debug"))
155 `(#:phases (alist-cons-before
156 'configure 'pre-configure
157 (lambda* (#:key inputs #:allow-other-keys)
158 ;; Tell (ice-9 popen) the file name of Bash.
159 (let ((bash (assoc-ref inputs "bash")))
160 (substitute* "module/ice-9/popen.scm"
162 (string-append bash "/bin/bash")))))
166 (list (search-path-specification
167 (variable "GUILE_LOAD_PATH")
168 (files '("share/guile/site/2.0")))
169 (search-path-specification
170 (variable "GUILE_LOAD_COMPILED_PATH")
171 (files '("share/guile/site/2.0")))))
173 (synopsis "Scheme implementation intended especially for extensions")
175 "Guile is the GNU Ubiquitous Intelligent Language for Extensions, the
176 official extension language of the GNU system. It is an implementation of
177 the Scheme language which can be easily embedded in other applications to
178 provide a convenient means of extending the functionality of the application
179 without requiring the source code to be rewritten.")
180 (home-page "http://www.gnu.org/software/guile/")
183 (define-public guile-2.0/fixed
184 ;; A package of Guile 2.0 that's rarely changed. It is the one used
185 ;; in the `base' module, and thus changing it entails a full rebuild.
188 (define-public guile-for-guile-emacs
189 (package (inherit guile-2.0)
190 (name "guile-for-guile-emacs")
191 (version "20150510.d8d9a8d")
195 (url "git://git.hcoop.net/git/bpt/guile.git")
196 (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
199 "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))
201 (substitute-keyword-arguments `(;; Tests aren't passing for now.
202 ;; Obviously we should re-enable this!
204 ,@(package-arguments guile-2.0))
206 `(modify-phases ,phases
207 (add-after 'unpack 'autogen
209 (zero? (system* "sh" "autogen.sh"))))
210 (add-before 'autogen 'patch-/bin/sh
212 (substitute* "build-aux/git-version-gen"
213 (("#!/bin/sh") (string-append "#!" (which "sh"))))
216 `(("autoconf" ,autoconf)
217 ("automake" ,automake)
221 ("gettext" ,gnu-gettext)
222 ,@(package-native-inputs guile-2.0)))))
229 (define-public guile-reader
231 (name "guile-reader")
235 (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
239 "020wz5w8z6g79nbqifg2n496wxwkcjzh8xizpv6mz0hczpl155ma"))))
240 (build-system gnu-build-system)
241 (native-inputs `(("pkgconfig" ,pkg-config)
243 (inputs `(("guile" ,guile-2.0)))
244 (arguments `(#:configure-flags
245 (let ((out (assoc-ref %outputs "out")))
246 (list (string-append "--with-guilemoduledir="
247 out "/share/guile/site/2.0")))))
248 (synopsis "Framework for building readers for GNU Guile")
250 "Guile-Reader is a simple framework for building readers for GNU Guile.
252 The idea is to make it easy to build procedures that extend Guile’s read
253 procedure. Readers supporting various syntax variants can easily be written,
254 possibly by re-using existing “token readers” of a standard Scheme
255 readers. For example, it is used to implement Skribilo’s R5RS-derived
258 Guile-Reader’s approach is similar to Common Lisp’s “read table”, but
259 hopefully more powerful and flexible (for instance, one may instantiate as
260 many readers as needed).")
261 (home-page "http://www.nongnu.org/guile-reader/")
264 (define-public guile-ncurses
266 (name "guile-ncurses")
270 (uri (string-append "mirror://gnu/guile-ncurses/guile-ncurses-"
274 "0wmk681zzi1wxw543r2s2r84ndnzxp69kr7pc01aw4l55hg7jn73"))))
275 (build-system gnu-build-system)
276 (inputs `(("ncurses" ,ncurses)
277 ("guile" ,guile-2.0)))
279 '(#:configure-flags (list "--with-ncursesw" ; Unicode support
280 (string-append "--with-guilesitedir="
281 (assoc-ref %outputs "out")
282 "/share/guile/site/2.0"))
283 #:phases (alist-cons-before
284 'check 'change-locale
286 ;; Use the locale that's actually available in the build
288 (substitute* "test/f009_form_wide.test"
292 'install 'post-install
293 (lambda* (#:key outputs #:allow-other-keys)
294 (let* ((out (assoc-ref outputs "out"))
295 (dir (string-append out "/share/guile/site/"))
296 (files (find-files dir ".scm")))
298 (("\"libguile-ncurses\"")
299 (format #f "\"~a/lib/libguile-ncurses\""
302 (home-page "http://www.gnu.org/software/guile-ncurses/")
303 (synopsis "Guile bindings to ncurses")
305 "guile-ncurses provides Guile language bindings for the ncurses
315 (uri (string-append "mirror://gnu/mcron/mcron-"
319 "0zparwgf01jgl1x53ik71ghabldq6zz18ha4dscps1i0qrzgap1b"))
320 (patches (list (search-patch "mcron-install.patch")))))
321 (build-system gnu-build-system)
322 (native-inputs `(("pkg-config" ,pkg-config)))
323 (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.0)))
324 (home-page "http://www.gnu.org/software/mcron/")
325 (synopsis "Run jobs at scheduled times")
327 "GNU Mcron is a complete replacement for Vixie cron. It is used to run
328 tasks on a schedule, such as every hour or every Monday. Mcron is written in
329 Guile, so its configuration can be written in Scheme; the original cron
330 format is also supported.")
333 (define-public guile-lib
339 (uri (string-append "mirror://savannah/guile-lib/guile-lib-"
343 "1f9n2b5b5r75lzjinyk6zp6g20g60msa0jpfrk5hhg4j8cy0ih4b"))))
344 (build-system gnu-build-system)
346 '(#:phases (alist-cons-before
347 'configure 'patch-module-dir
349 (substitute* "src/Makefile.in"
350 (("^moddir[[:blank:]]*=[[:blank:]]*([[:graph:]]+)" _ rhs)
351 (string-append "moddir = " rhs "/2.0\n"))))
353 (inputs `(("guile" ,guile-2.0)))
354 (home-page "http://www.nongnu.org/guile-lib/")
355 (synopsis "Collection of useful Guile Scheme modules")
357 "Guile-Lib is intended as an accumulation place for pure-scheme Guile
358 modules, allowing for people to cooperate integrating their generic Guile
359 modules into a coherent library. Think \"a down-scaled, limited-scope CPAN
362 ;; The whole is under GPLv3+, but some modules are under laxer
363 ;; distribution terms such as LGPL and public domain. See `COPYING' for
367 (define-public guile-json
373 (uri (string-append "mirror://savannah/guile-json/guile-json-"
377 "0v06272rw4ycwzssjf3fzpk2vhpslvl55hz94q80vc6f74j0d5h6"))
378 (modules '((guix build utils)))
380 ;; Make sure everything goes under .../site/2.0, like Guile's
381 ;; search paths expects.
382 '(substitute* '("Makefile.in" "json/Makefile.in")
383 (("moddir =.*/share/guile/site" all)
384 (string-append all "/2.0"))))))
385 (build-system gnu-build-system)
386 (native-inputs `(("guile" ,guile-2.0)))
387 (home-page "http://savannah.nongnu.org/projects/guile-json/")
388 (synopsis "JSON module for Guile")
390 "Guile-json supports parsing and building JSON documents according to the
391 http:://json.org specification. These are the main features:
392 - Strictly complies to http://json.org specification.
393 - Build JSON documents programmatically via macros.
394 - Unicode support for strings.
395 - Allows JSON pretty printing.")
398 (define-public guile-minikanren
400 (name "guile-minikanren")
401 (version "20150424.e844d85")
405 (url "https://github.com/ijp/minikanren.git")
406 (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
409 "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
410 (build-system trivial-build-system)
417 (use-modules (guix build utils)
419 (let* ((out (assoc-ref %outputs "out"))
420 (module-dir (string-append out "/share/guile/site/2.0"))
421 (source (assoc-ref %build-inputs "source"))
422 (doc (string-append out "/share/doc"))
423 (scm-files '("minikanren.scm"
424 "minikanren/mkextraforms.scm"
425 "minikanren/mkprelude.scm"
426 "minikanren/mk.scm"))
427 (guild (string-append (assoc-ref %build-inputs "guile")
429 ;; Make installation directories.
430 (mkdir-p (string-append module-dir "/minikanren"))
433 ;; Compile .scm files and install.
435 (setenv "GUILE_AUTO_COMPILE" "0")
436 (for-each (lambda (file)
437 (let* ((dest-file (string-append module-dir "/"
439 (go-file (match (string-split file #\.)
441 (string-append module-dir "/"
443 ;; Install source module.
444 (copy-file file dest-file)
445 ;; Install compiled module.
446 (unless (zero? (system* guild "compile"
450 (error (format #f "Failed to compile ~s to ~s!"
454 ;; Also copy over the README.
455 (copy-file "README.org" (string-append doc "/README.org"))
458 `(("guile" ,guile-2.0)))
459 (home-page "https://github.com/ijp/minikanren")
460 (synopsis "miniKanren declarative logic system, packaged for Guile")
462 "MiniKanren is a relational programming extension to the Scheme
463 programming Language, written as a smaller version of Kanren suitable for
464 pedagogical purposes. It is featured in the book, The Reasoned Schemer,
465 written by Dan Friedman, William Byrd, and Oleg Kiselyov.
467 This is Ian Price's r6rs packaged version of miniKranen, which deviates
468 slightly from miniKanren mainline.
470 See http://minikanren.org/ for more on miniKanren generally.")
474 ;; There are two guile-gdbm packages, one using the FFI and one with
475 ;; direct C bindings, hence the verbose name.
477 (define-public guile-gdbm-ffi
479 (name "guile-gdbm-ffi")
480 (version "20120209.fa1d5b6")
484 (url "https://github.com/ijp/guile-gdbm.git")
485 (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
488 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
489 (build-system trivial-build-system)
495 (use-modules (guix build utils)
496 (system base compile))
498 (let* ((out (assoc-ref %outputs "out"))
499 (module-dir (string-append out "/share/guile/site/2.0"))
500 (source (assoc-ref %build-inputs "source"))
501 (doc (string-append out "/share/doc"))
502 (guild (string-append (assoc-ref %build-inputs "guile")
505 (string-append module-dir "/gdbm.scm"))
507 (string-append module-dir "/gdbm.go")))
508 ;; Make installation directories.
512 ;; Switch directory for compiling and installing
516 (copy-file "gdbm.scm" gdbm.scm-dest)
519 (substitute* gdbm.scm-dest
520 (("\\(dynamic-link \"libgdbm\"\\)")
521 (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
522 (assoc-ref %build-inputs "gdbm"))))
524 ;; compile to the destination
525 (compile-file gdbm.scm-dest
526 #:output-file gdbm.go-dest)))))
528 `(("guile" ,guile-2.0)))
531 (home-page "https://github.com/ijp/guile-gdbm")
532 (synopsis "Guile bindings to the GDBM library via Guile's FFI")
534 "Guile bindings to the GDBM key-value storage system, using
535 Guile's foreign function interface.")
538 ;;; guile.scm ends here