gnu: Adjust formatting as recommended by 'guix lint'.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
index ca8d4c8..82776e6 100644 (file)
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2015 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages gperf)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages flex)
   #:use-module (gnu packages libunistring)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ed)
-  #:use-module (gnu packages which)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages python)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:use-module (guix utils)
   #:use-module (ice-9 match))
 
@@ -178,22 +187,123 @@ without requiring the source code to be rewritten.")
   ;; in the `base' module, and thus changing it entails a full rebuild.
   guile-2.0)
 
+(define-public guile-next
+  (package (inherit guile-2.0)
+    (name "guile-next")
+    (version "20151025.e5bccb6")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "git://git.sv.gnu.org/guile.git")
+                    (commit "e5bccb6e5df3485152bc6501e1f36275e09c6352")))
+              (sha256
+               (base32
+                "0z7ywryfcargrpz8hdrz6sfs06c2h2y9baqin3mbjvvg96a5bx47"))))
+
+    (arguments
+     (substitute-keyword-arguments `(;; Tests aren't passing for now.
+                                     ;; Obviously we should re-enable this!
+                                     #:tests? #f
+                                     ,@(package-arguments guile-2.0))
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'autogen
+                      (lambda _
+                        (zero? (system* "sh" "autogen.sh"))))
+           (add-before 'autogen 'patch-/bin/sh
+                       (lambda _
+                         (substitute* "build-aux/git-version-gen"
+                           (("#!/bin/sh") (string-append "#!" (which "sh"))))
+                         #t))))))
+    (synopsis "Snapshot of what will become version 2.2 of GNU Guile")
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("flex" ,flex)
+       ("texinfo" ,texinfo)
+       ("gettext" ,gnu-gettext)
+       ,@(package-native-inputs guile-2.0)))))
+
+(define-public guile-for-guile-emacs
+  (package (inherit guile-next)
+    (name "guile-for-guile-emacs")
+    (version "20150510.d8d9a8d")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "git://git.hcoop.net/git/bpt/guile.git")
+                    (commit "d8d9a8da05ec876acba81a559798eb5eeceb5a17")))
+              (sha256
+               (base32
+                "00sprsshy16y8pxjy126hr2adqcvvzzz96hjyjwgg8swva1qh6b0"))))))
+
 \f
 ;;;
 ;;; Extensions.
 ;;;
 
+(define-public artanis
+  (package
+    (name "artanis")
+    (version "0.1.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "ftp://alpha.gnu.org/gnu/artanis/artanis-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "1mc2zy6n9wnn4hzi3zp3jd6b5rlr0lv7fvh800xf4fyrxg0zia4g"))))
+    (build-system gnu-build-system)
+    ;; TODO: Add guile-dbi and guile-dbd optional dependencies.
+    (inputs `(("guile" ,guile-2.0)))
+    (native-inputs `(("bash"       ,bash)         ;for the `source' builtin
+                     ("pkgconfig"  ,pkg-config)
+                     ("util-linux" ,util-linux))) ;for the `script' command
+    (arguments
+     '(#:make-flags
+       ;; TODO: The documentation must be built with the `docs' target.
+       (let* ((out (assoc-ref %outputs "out"))
+              (dir (string-append out "/share/guile/site/2.0")))
+         ;; Don't use (%site-dir) for site paths.
+         (list (string-append "MOD_PATH=" dir)
+               (string-append "MOD_COMPILED_PATH=" dir)))
+       #:test-target "test"
+       #:phases
+       (modify-phases %standard-phases
+         (add-before
+          'install 'substitute-root-dir
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let ((out  (assoc-ref outputs "out")))
+              (substitute* "Makefile"   ;ignore the execution of bash.bashrc
+                ((" /etc/bash.bashrc") " /dev/null"))
+              (substitute* "Makefile"   ;set the root of config files to OUT
+                ((" /etc") (string-append " " out "/etc")))
+              (mkdir-p (string-append out "/bin")) ;for the `art' executable
+              #t))))))
+    (synopsis "Web application framework written in Guile")
+    (description "GNU Artanis is a web application framework written in Guile
+Scheme.  A web application framework (WAF) is a software framework that is
+designed to support the development of dynamic websites, web applications, web
+services and web resources.  The framework aims to alleviate the overhead
+associated with common activities performed in web development.  Artanis
+provides several tools for web development: database access, templating
+frameworks, session management, URL-remapping for RESTful, page caching, and
+more.")
+    (home-page "https://www.gnu.org/software/artanis/")
+    (license (list gpl3+ lgpl3+))))     ;dual license
+
 (define-public guile-reader
   (package
     (name "guile-reader")
-    (version "0.6")
+    (version "0.6.1")
     (source  (origin
                (method url-fetch)
                (uri (string-append "mirror://savannah/guile-reader/guile-reader-"
                                    version ".tar.gz"))
                (sha256
                 (base32
-                 "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
+                 "020wz5w8z6g79nbqifg2n496wxwkcjzh8xizpv6mz0hczpl155ma"))))
     (build-system gnu-build-system)
     (native-inputs `(("pkgconfig" ,pkg-config)
                      ("gperf" ,gperf)))
@@ -237,26 +347,21 @@ many readers as needed).")
                                (string-append "--with-guilesitedir="
                                               (assoc-ref %outputs "out")
                                               "/share/guile/site/2.0"))
+
+       ;; Work around <http://bugs.gnu.org/21677>.
+       #:make-flags '("XFAIL_TESTS=curses_034_util.test")
+
        #:phases (alist-cons-after
                  'install 'post-install
                  (lambda* (#:key outputs #:allow-other-keys)
                    (let* ((out   (assoc-ref outputs "out"))
                           (dir   (string-append out "/share/guile/site/"))
                           (files (find-files dir ".scm")))
-                    (substitute* files
-                      (("\"libguile-ncurses\"")
-                       (format #f "\"~a/lib/libguile-ncurses\""
-                               out)))))
-                 (alist-cons-before
-                  'check 'install-locales
-                  (lambda _
-                    ;; One of the tests requires the availability of a UTF-8
-                    ;; locale and otherwise fails.
-                    (setenv "LOCPATH" (getcwd))
-                    (zero? (system* "localedef" "--no-archive"
-                                    "--prefix" (getcwd) "-i" "en_US"
-                                    "-f" "UTF-8" "./en_US.utf8")))
-                  %standard-phases))))
+                     (substitute* files
+                       (("\"libguile-ncurses\"")
+                        (format #f "\"~a/lib/libguile-ncurses\""
+                                out)))))
+                 %standard-phases)))
     (home-page "http://www.gnu.org/software/guile-ncurses/")
     (synopsis "Guile bindings to ncurses")
     (description
@@ -353,4 +458,348 @@ http:://json.org specification.  These are the main features:
 - Allows JSON pretty printing.")
     (license lgpl3+)))
 
+(define-public guile-minikanren
+  (package
+    (name "guile-minikanren")
+    (version "20150424.e844d85")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ijp/minikanren.git")
+                    (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
+              (sha256
+               (base32
+                "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules
+       ((guix build utils)
+        (ice-9 match))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (ice-9 match))
+         (let* ((out (assoc-ref %outputs "out"))
+                (module-dir (string-append out "/share/guile/site/2.0"))
+                (source (assoc-ref %build-inputs "source"))
+                (doc (string-append out "/share/doc/guile-minikanren"))
+                (scm-files '("minikanren.scm"
+                             "minikanren/mkextraforms.scm"
+                             "minikanren/mkprelude.scm"
+                             "minikanren/mk.scm"))
+                (guild (string-append (assoc-ref %build-inputs "guile")
+                                      "/bin/guild")))
+           ;; Make installation directories.
+           (mkdir-p (string-append module-dir "/minikanren"))
+           (mkdir-p doc)
+
+           ;; Compile .scm files and install.
+           (chdir source)
+           (setenv "GUILE_AUTO_COMPILE" "0")
+           (for-each (lambda (file)
+                       (let* ((dest-file (string-append module-dir "/"
+                                                        file ".scm"))
+                              (go-file (match (string-split file #\.)
+                                         ((base _)
+                                          (string-append module-dir "/"
+                                                         base ".go")))))
+                         ;; Install source module.
+                         (copy-file file dest-file)
+                         ;; Install compiled module.
+                         (unless (zero? (system* guild "compile"
+                                                 "-L" source
+                                                 "-o" go-file
+                                                 file))
+                           (error (format #f "Failed to compile ~s to ~s!"
+                                          file go-file)))))
+                     scm-files)
+
+           ;; Also copy over the README.
+           (install-file "README.org" doc)
+           #t))))
+    (inputs
+     `(("guile" ,guile-2.0)))
+    (home-page "https://github.com/ijp/minikanren")
+    (synopsis "MiniKanren declarative logic system, packaged for Guile")
+    (description
+     "MiniKanren is a relational programming extension to the Scheme
+programming Language, written as a smaller version of Kanren suitable for
+pedagogical purposes.  It is featured in the book, The Reasoned Schemer,
+written by Dan Friedman, William Byrd, and Oleg Kiselyov.
+
+This is Ian Price's r6rs packaged version of miniKanren, which deviates
+slightly from miniKanren mainline.
+
+See http://minikanren.org/ for more on miniKanren generally.")
+    (license expat)))
+
+(define-public guile-irregex
+  (package
+    (name "guile-irregex")
+    (version "0.9.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://synthcode.com/scheme/irregex/irregex-"
+                    version
+                    ".tar.gz"))
+              (sha256
+               (base32
+                "1b8jl7bycyl2ssp6sb1j24pp9hvqyxm85ki9bmwd50glyyjs5zay"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:modules ((guix build utils)
+                  (ice-9 match)
+                  (guix build gnu-build-system))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'build)
+         (delete 'check)
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (begin
+               (use-modules (guix build utils)
+                            (ice-9 match))
+               (let* ((out (assoc-ref outputs "out"))
+                      (module-dir (string-append out "/share/guile/site/2.0"))
+                      (source (assoc-ref inputs "source"))
+                      (doc (string-append out "/share/doc/guile-irregex/"))
+                      (guild (string-append (assoc-ref %build-inputs "guile")
+                                            "/bin/guild")))
+                 ;; Make installation directories.
+                 (mkdir-p (string-append module-dir "/rx/source"))
+                 (mkdir-p doc)
+
+                 ;; Compile .scm files and install.
+                 (setenv "GUILE_AUTO_COMPILE" "0")
+
+                 (for-each (lambda (copy-info)
+                             (match copy-info
+                               ((src-file dest-file-basis)
+                                (let* ((dest-file (string-append
+                                                   module-dir dest-file-basis
+                                                   ".scm"))
+                                       (go-file (string-append
+                                                 module-dir dest-file-basis
+                                                 ".go")))
+                                  ;; Install source module.
+                                  (copy-file src-file
+                                             dest-file)
+                                  ;; Install compiled module.
+                                  (unless (zero? (system* guild "compile"
+                                                          "-L" (getcwd)
+                                                          "-o" go-file
+                                                          src-file))
+                                    (error (format #f "Failed to compile ~s to ~s!"
+                                                   src-file dest-file)))))))
+                           '(("irregex-guile.scm" "/rx/irregex")
+                             ("irregex.scm" "/rx/source/irregex")
+                             ;; Not really reachable via guile's packaging system,
+                             ;; but nice to have around
+                             ("irregex-utils.scm" "/rx/source/irregex-utils")))
+
+                 ;; Also copy over the README.
+                 (install-file "irregex.html" doc)
+                 #t)))))))
+    (inputs
+     `(("guile" ,guile-2.0)))
+    (home-page "http://synthcode.com/scheme/irregex")
+    (synopsis "S-expression based regular expressions")
+    (description
+     "Irregex is an s-expression based alternative to your classic
+string-based regular expressions.  It implements SRFI 115 and is deeply
+inspired by the SCSH regular expression system.")
+    (license bsd-3)))
+
+;; There are two guile-gdbm packages, one using the FFI and one with
+;; direct C bindings, hence the verbose name.
+
+(define-public guile-gdbm-ffi
+  (package
+    (name "guile-gdbm-ffi")
+    (version "20120209.fa1d5b6")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ijp/guile-gdbm.git")
+                    (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246")))
+              (sha256
+               (base32
+                "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules
+       ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (system base compile))
+
+         (let* ((out (assoc-ref %outputs "out"))
+                (module-dir (string-append out "/share/guile/site/2.0"))
+                (source (assoc-ref %build-inputs "source"))
+                (doc (string-append out "/share/doc"))
+                (guild (string-append (assoc-ref %build-inputs "guile")
+                                      "/bin/guild"))
+                (gdbm.scm-dest
+                 (string-append module-dir "/gdbm.scm"))
+                (gdbm.go-dest
+                 (string-append module-dir "/gdbm.go")))
+           ;; Make installation directories.
+           (mkdir-p module-dir)
+           (mkdir-p doc)
+
+           ;; Switch directory for compiling and installing
+           (chdir source)
+
+           ;; copy the source
+           (copy-file "gdbm.scm" gdbm.scm-dest)
+
+           ;; Patch the FFI
+           (substitute* gdbm.scm-dest
+             (("\\(dynamic-link \"libgdbm\"\\)")
+              (format #f "(dynamic-link \"~a/lib/libgdbm.so\")"
+                      (assoc-ref %build-inputs "gdbm"))))
+
+           ;; compile to the destination
+           (compile-file gdbm.scm-dest
+                         #:output-file gdbm.go-dest)))))
+    (inputs
+     `(("guile" ,guile-2.0)))
+    (propagated-inputs
+     `(("gdbm" ,gdbm)))
+    (home-page "https://github.com/ijp/guile-gdbm")
+    (synopsis "Guile bindings to the GDBM library via Guile's FFI")
+    (description
+     "Guile bindings to the GDBM key-value storage system, using
+Guile's foreign function interface.")
+    (license gpl3+)))
+
+(define-public haunt
+  (package
+    (name "haunt")
+    (version "0.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://files.dthompson.us/haunt/haunt-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "15q1qwjnay7k90ppqrzqsmikvwyj61mjvf1zahyd9gm4vi2fgb3x"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("guile" ,guile-2.0)))
+    (synopsis "Functional static site generator")
+    (description "Haunt is a static site generator written in Guile
+Scheme.  Haunt features a functional build system and an extensible
+interface for reading articles in any format.")
+    (home-page "http://haunt.dthompson.us")
+    (license gpl3+)))
+
+(define-public guile-redis
+  (package
+    (name "guile-redis")
+    (version "0.1.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://savannah/guile-redis/guile-redis-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "0vx6if6b4r3kwx64vzbs6vpc0cpcr85x11w9vkzq27gw8n7isv56"))
+              (modules '((guix build utils)))
+              (snippet
+               ;; Make sure everything goes under .../site/2.0, like Guile's
+               ;; search paths expects.
+               '(substitute* '("Makefile.in"
+                               "redis/Makefile.in"
+                               "redis/commands/Makefile.in")
+                  (("moddir =.*/share/guile/site" all)
+                   (string-append all "/2.0"))))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("guile" ,guile-2.0)))
+    (home-page "http://savannah.nongnu.org/projects/guile-redis/")
+    (synopsis "Redis client library for Guile")
+    (description "Guile-redis provides a Scheme interface to the Redis
+key-value cache and store.")
+    (license lgpl3+)))
+
+(define-public guile-wisp
+  (package
+    (name "guile-wisp")
+    (version "0.9.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://bitbucket.org/ArneBab/"
+                                  "wisp/downloads/wisp-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "0y5fxacalkgbv9s71h58vdvm2h2ln3rk024dd0vszwcf953as5fq"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:modules ((system base compile)
+                  ,@%gnu-build-system-modules)
+       #:phases
+       (modify-phases %standard-phases
+         (add-before
+          'configure 'substitute-before-config
+
+          (lambda* (#:key inputs #:allow-other-keys)
+            (let ((bash (assoc-ref inputs "bash")))
+              ;; configure checks for guile-2.0, but ours is just named "guile" :)
+              (substitute* "configure"
+                (("guile-2.0") "guile"))
+              ;; Puts together some test files with /bin/bash hardcoded
+              (substitute* "Makefile.in"
+                (("/bin/bash")
+                 (string-append bash "/bin/bash") ))
+              #t)))
+
+         ;; auto compilation breaks, but if we set HOME to /tmp,
+         ;; that works ok
+         (add-before
+          'check 'auto-compile-hacky-workaround
+          (lambda _
+            (setenv "HOME" "/tmp")
+            #t))
+         (replace
+          'install
+          (lambda* (#:key outputs inputs #:allow-other-keys)
+            (let* ((out (assoc-ref outputs "out"))
+                   (module-dir (string-append out "/share/guile/site/2.0"))
+                   (language-dir
+                    (string-append module-dir "/language/wisp"))
+                   (guild (string-append (assoc-ref inputs "guile")
+                                         "/bin/guild")))
+              ;; Make installation directories.
+              (mkdir-p module-dir)
+              (mkdir-p language-dir)
+
+              ;; copy the source
+              (copy-file "wisp-scheme.scm"
+                         (string-append module-dir "/wisp-scheme.scm"))
+              (copy-file "language/wisp/spec.scm"
+                         (string-append language-dir "/spec.scm"))
+
+              ;; compile to the destination
+              (compile-file "wisp-scheme.scm"
+                            #:output-file (string-append
+                                           module-dir "/wisp-scheme.go"))
+              (compile-file "language/wisp/spec.scm"
+                            #:output-file (string-append
+                                           language-dir "/spec.go"))
+              #t))))))
+    (home-page "http://draketo.de/english/wisp")
+    (inputs
+     `(("guile" ,guile-2.0)
+       ("python" ,python)))
+    (synopsis "Whitespace to lisp syntax for Guile")
+    (description "Wisp is a syntax for Guile which provides a Python-like
+whitespace-significant language.  It may be easier on the eyes for some
+users and in some situations.")
+    (license gpl3+)))
+
 ;;; guile.scm ends here