gnu: Adjust formatting as recommended by 'guix lint'.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
index d5a95a0..82776e6 100644 (file)
@@ -29,6 +29,7 @@
   #: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)
@@ -38,7 +39,8 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages gettext)
-  #:use-module (gnu packages gdbm)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages python)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -188,15 +190,15 @@ without requiring the source code to be rewritten.")
 (define-public guile-next
   (package (inherit guile-2.0)
     (name "guile-next")
-    (version "20150815.00884bb")
+    (version "20151025.e5bccb6")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "git://git.sv.gnu.org/guile.git")
-                    (commit "00884bb79fff41fdf5f22f24a74e366a94a14c9b")))
+                    (commit "e5bccb6e5df3485152bc6501e1f36275e09c6352")))
               (sha256
                (base32
-                "0qk8m9aq3i7pzw6npim58xmsvjqfz5kl1pkyb6b43awn2vydydi5"))))
+                "0z7ywryfcargrpz8hdrz6sfs06c2h2y9baqin3mbjvvg96a5bx47"))))
 
     (arguments
      (substitute-keyword-arguments `(;; Tests aren't passing for now.
@@ -241,6 +243,56 @@ without requiring the source code to be rewritten.")
 ;;; 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")
@@ -295,25 +347,21 @@ many readers as needed).")
                                (string-append "--with-guilesitedir="
                                               (assoc-ref %outputs "out")
                                               "/share/guile/site/2.0"))
-       #:phases (alist-cons-before
-                 'check 'change-locale
-                 (lambda _
-                   ;; Use the locale that's actually available in the build
-                   ;; environment.
-                   (substitute* "test/f009_form_wide.test"
-                     (("en_US\\.utf8")
-                      "en_US.UTF-8")))
-                 (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)))))
-                  %standard-phases))))
+
+       ;; 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)))))
+                 %standard-phases)))
     (home-page "http://www.gnu.org/software/guile-ncurses/")
     (synopsis "Guile bindings to ncurses")
     (description
@@ -485,6 +533,84 @@ 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.
@@ -600,4 +726,80 @@ interface for reading articles in any format.")
 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