container: Gracefully report mount errors in the child process.
[jackhill/guix/guix.git] / gnu / packages / databases.scm
index 594ccb2..7e0188b 100644 (file)
@@ -1,11 +1,15 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2012, 2014 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2012, 2014, 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
-;;; Copyright © 2014 David Thompson <davet@gnu.org>
-;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
+;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
+;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Nils Gillmann <niasterisk@grrlz.net>
+;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 
 (define-module (gnu packages databases)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages avahi)
+  #:use-module (gnu packages bash)
+  #:use-module (gnu packages boost)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages glib)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages language)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages check)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages cyrus-sasl)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages python)
   #:use-module (gnu packages pcre)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages rdf)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages jemalloc)
   #:use-module ((guix licenses)
-                #:select (gpl2 gpl3+ lgpl2.1+ lgpl3+ x11-style non-copyleft
-                          bsd-2 public-domain))
+                #:select (gpl2 gpl3 gpl3+ lgpl2.1+ lgpl3+ x11-style non-copyleft
+                          bsd-2 bsd-3 public-domain))
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (srfi srfi-26)
   #:use-module (ice-9 match))
 
+(define-public 4store
+  (package
+    (name "4store")
+    (version "1.1.6")
+    (source (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/garlik/4store/archive/v"
+                          version ".tar.gz"))
+      (file-name (string-append name "-" version ".tar.gz"))
+      (sha256
+       (base32 "004fmcf1w75zhc1x3zc6kc97j4jqn2v5nhk6yb3z3cpfrhzi9j50"))
+      (patches (list (search-patch "4store-fix-buildsystem.patch")))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("perl" ,perl)
+       ("python" ,python-2)
+       ("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("gettext" ,gnu-gettext)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("glib" ,glib)
+       ("rasqal" ,rasqal)
+       ("libxml2" ,libxml2)
+       ("raptor2" ,raptor2)
+       ("readline" ,readline)
+       ("avahi" ,avahi)
+       ("pcre" ,pcre)
+       ("cyrus-sasl" ,cyrus-sasl)
+       ("openssl" ,openssl)
+       ("util-linux" ,util-linux)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'generate-configure
+           (lambda _
+             (zero? (system* "./autogen.sh")))))))
+    ;; http://www.4store.org has been down for a while now.
+    (home-page "https://github.com/garlik/4store")
+    (synopsis "Clustered RDF storage and query engine")
+    (description "4store is a RDF/SPARQL store written in C, supporting
+either single machines or networked clusters.")
+      (license gpl3+)))
+
+(define-public gdbm
+  (package
+    (name "gdbm")
+    (version "1.11")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnu/gdbm/gdbm-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "1hz3jgh3pd4qzp6jy0l8pd8x01g9abw7csnrlnj1a2sxy122z4cd"))))
+    (arguments `(#:configure-flags '("--enable-libgdbm-compat")))
+    (build-system gnu-build-system)
+    (home-page "http://www.gnu.org/software/gdbm/")
+    (synopsis
+     "Hash library of database functions compatible with traditional dbm")
+    (description
+     "GDBM is a library for manipulating hashed databases.  It is used to
+store key/value pairs in a file in a manner similar to the Unix dbm library
+and provides interfaces to the traditional file format.")
+    (license gpl3+)))
+
 (define-public bdb
   (package
     (name "bdb")
                "doc"))                           ; 94 MiB of HTML docs
     (arguments
      '(#:tests? #f                            ; no check target available
-                #:phases
-                (alist-replace
-                 'configure
-                 (lambda* (#:key outputs #:allow-other-keys)
-                   (let ((out (assoc-ref outputs "out"))
-                         (doc (assoc-ref outputs "doc")))
-                     ;; '--docdir' is not honored, so we need to patch.
-                     (substitute* "dist/Makefile.in"
-                       (("docdir[[:blank:]]*=.*")
-                        (string-append "docdir = " doc "/share/doc/bdb")))
-
-                     (zero?
-                      (system* "./dist/configure"
-                               (string-append "--prefix=" out)
-                               (string-append "CONFIG_SHELL=" (which "bash"))
-                               (string-append "SHELL=" (which "bash"))
-
-                               ;; The compatibility mode is needed by some packages,
-                               ;; notably iproute2.
-                               "--enable-compat185"))))
+       #:phases
+       (alist-replace
+        'configure
+        (lambda* (#:key outputs #:allow-other-keys)
+          (let ((out (assoc-ref outputs "out"))
+                (doc (assoc-ref outputs "doc")))
+            ;; '--docdir' is not honored, so we need to patch.
+            (substitute* "dist/Makefile.in"
+              (("docdir[[:blank:]]*=.*")
+               (string-append "docdir = " doc "/share/doc/bdb")))
+
+            (zero?
+             (system* "./dist/configure"
+                      (string-append "--prefix=" out)
+                      (string-append "CONFIG_SHELL=" (which "bash"))
+                      (string-append "SHELL=" (which "bash"))
+
+                      ;; The compatibility mode is needed by some packages,
+                      ;; notably iproute2.
+                      "--enable-compat185"
+
+                      ;; The following flag is needed so that the inclusion
+                      ;; of db_cxx.h into C++ files works; it leads to
+                      ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h.
+                      "--enable-cxx"))))
                  %standard-phases)))
     (synopsis "Berkeley database")
     (description
@@ -101,16 +186,19 @@ SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
 (define-public mysql
   (package
     (name "mysql")
-    (version "5.6.25")
+    (version "5.7.12")
     (source (origin
              (method url-fetch)
-             (uri (string-append
-                   "http://dev.mysql.com/get/Downloads/MySQL-"
-                   (version-major+minor version) "/"
-                   name "-" version ".tar.gz"))
+             (uri (list (string-append
+                          "http://dev.mysql.com/get/Downloads/MySQL-"
+                          (version-major+minor version) "/"
+                          name "-" version ".tar.gz")
+                        (string-append
+                          "http://downloads.mysql.com/archives/get/file/"
+                          name "-" version ".tar.gz")))
              (sha256
               (base32
-               "1gbz5i1z3nswpq3q8f477vrx7g15j8n41pyb94k0jfnkhc5rq1qm"))))
+               "11qwbid666fspq143ymi86yva2b01lybaqh26k92rciasav3r11j"))))
     (build-system cmake-build-system)
     (arguments
      '(#:configure-flags
@@ -136,16 +224,11 @@ SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
          "-DINSTALL_SQLBENCHDIR=")
        #:phases (modify-phases %standard-phases
                   (add-after
-                   'install 'strip-extra-references
-                   (lambda* (#:key outputs #:allow-other-keys)
-                     ;; Strip references to GCC and other build-time
-                     ;; dependencies.
-                     (let ((out (assoc-ref outputs "out")))
-                       (for-each remove-store-references
-                                 (list (string-append out "/bin/mysqlbug")
-                                       (string-append
-                                        out "/share/mysql/docs/INFO_BIN")))
-                       #t)))
+                   'unpack 'patch-boost-version
+                   (lambda _
+                     ;; Mysql wants boost-1.59.0 specifically
+                     (substitute* "cmake/boost.cmake"
+                                  (("59") "60"))))
                   (add-after
                    'install 'remove-extra-binaries
                    (lambda* (#:key outputs #:allow-other-keys)
@@ -160,10 +243,11 @@ SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
      `(("bison" ,bison)
        ("perl" ,perl)))
     (inputs
-     `(("libaio" ,libaio)
+     `(("boost" ,boost)
+       ("libaio" ,libaio)
+       ("ncurses" ,ncurses)
        ("openssl" ,openssl)
-       ("zlib" ,zlib)
-       ("ncurses" ,ncurses)))
+       ("zlib" ,zlib)))
     (home-page "http://www.mysql.com/")
     (synopsis "Fast, easy to use, and popular database")
     (description
@@ -175,7 +259,7 @@ Language.")
 (define-public mariadb
   (package
     (name "mariadb")
-    (version "10.0.18")
+    (version "10.1.12")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://downloads.mariadb.org/f/"
@@ -183,7 +267,7 @@ Language.")
                                   name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1xcs391cm0vnl9bvx1470v8z4d77zqv16n6iaqi12jm0ma8fwvv8"))))
+                "1rzlc2ns84x540asbkgdp9562haxhlszfpdqh64i9pz4q1m4cpvr"))))
     (build-system cmake-build-system)
     (arguments
      '(#:configure-flags
@@ -243,15 +327,25 @@ as a drop-in replacement of MySQL.")
 (define-public postgresql
   (package
     (name "postgresql")
-    (version "9.3.7")
+    (version "9.5.3")
     (source (origin
               (method url-fetch)
-              (uri (string-append "http://ftp.postgresql.org/pub/source/v"
+              (uri (string-append "https://ftp.postgresql.org/pub/source/v"
                                   version "/postgresql-" version ".tar.bz2"))
               (sha256
                (base32
-                "0ggz0i91znv053zx9qas7pjf93s5by3dk84z1jxbjkg8yyrnlx4b"))))
+                "1d500d2qsdzysnis6qi84xchnz5xh8kx8sjfmkbsijwaqlfw11bk"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'patch-/bin/sh
+                     (lambda _
+                       ;; Refer to the actual shell.
+                       (substitute* '("src/bin/pg_ctl/pg_ctl.c"
+                                      "src/bin/psql/command.c")
+                         (("/bin/sh") (which "sh")))
+                       #t)))))
     (inputs
      `(("readline" ,readline)
        ("zlib" ,zlib)))
@@ -281,15 +375,18 @@ pictures, sounds, or video.")
 
     ;; Running tests in parallel leads to test failures and crashes in
     ;; torture/utils.
-    (arguments '(#:parallel-tests? #f))
+    (arguments '(#:parallel-tests? #f
+                 #:configure-flags
+                 (list (string-append "--with-bash-headers="
+                                      (assoc-ref %build-inputs "bash:include")
+                                      "/include/bash"))))
 
-    (native-inputs `(("emacs" ,emacs-no-x)
-                     ("bc" ,bc)))
+    (native-inputs `(("emacs" ,emacs-minimal)
+                     ("bc" ,bc)
+                     ("bash:include" ,bash "include")
+                     ("libuuid" ,util-linux)))
 
     ;; TODO: Add more optional inputs.
-    ;; FIXME: Our Bash doesn't have development headers (need for the 'readrec'
-    ;; built-in command), but it's not clear how to get them installed.
-    ;; See <https://lists.gnu.org/archive/html/bug-bash/2014-03/msg00125.html>.
     (inputs `(("curl" ,curl)
               ("libgcrypt" ,libgcrypt)
               ("check" ,check)))
@@ -306,7 +403,7 @@ types are supported, as is encryption.")
 (define-public sqlite
   (package
    (name "sqlite")
-   (version "3.8.10.2")
+   (version "3.10.0")
    (source (origin
             (method url-fetch)
             ;; TODO: Download from sqlite.org once this bug :
@@ -321,12 +418,23 @@ types are supported, as is encryption.")
                                             (map (cut string-pad <> 2 #\0)
                                                  other-digits))
                                            6 #\0))))))
-                   (string-append
-                    "mirror://sourceforge/sqlite.mirror/SQLite%20" version
-                    "/sqlite-autoconf-" numeric-version ".tar.gz")))
+                   (list
+                    (string-append
+                     "https://fossies.org/linux/misc/sqlite-autoconf-"
+                     numeric-version ".tar.gz")
+                    (string-append
+                     "http://distfiles.gentoo.org/distfiles/"
+                     "/sqlite-autoconf-" numeric-version ".tar.gz"))
+
+                   ;; XXX: As of 2015-09-08, SourceForge is squatting the URL
+                   ;; below, returning 200 and showing an advertising page.
+                   ;; (string-append
+                   ;;  "mirror://sourceforge/sqlite.mirror/SQLite%20" version
+                   ;;  "/sqlite-autoconf-" numeric-version ".tar.gz")
+                   ))
             (sha256
              (base32
-              "09nnaqx50gl1vmfvdipirizr61q3s0ywlql50f9kr1bx9rdfb0l3"))))
+              "0hhhv6si0pyf5i8bv7a71953m0b4gk6s3j2h09caf7vif0njkk23"))))
    (build-system gnu-build-system)
    (inputs `(("readline" ,readline)))
    (arguments
@@ -347,14 +455,14 @@ is in the public domain.")
 (define-public tdb
   (package
     (name "tdb")
-    (version "1.3.0")
+    (version "1.3.9")
     (source (origin
               (method url-fetch)
-              (uri (string-append "http://samba.org/ftp/tdb/tdb-"
+              (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
                                   version ".tar.gz"))
               (sha256
                (base32
-                "085sd2kii72fr0c4pdc7c7m0xk34nc66wnjp21c83dss826y9gh4"))))
+                "1ll4q17scax1arg12faj8p25jq1f7q9irc3pwla0ziymwqkgf0bi"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases (alist-replace
@@ -581,6 +689,30 @@ columns, primary keys, unique constraints and relationships.")
     (description "")
     (license (package-license perl))))
 
+(define-public perl-dbd-mysql
+  (package
+    (name "perl-dbd-mysql")
+    (version "4.033")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/C/CA/CAPTTOFU/"
+                           "DBD-mysql-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0769xakykps0cx368g4vaips4w3bjk383rianiavq7sq6g6bp66c"))))
+    (build-system perl-build-system)
+    ;; Tests require running MySQL server
+    (arguments `(#:tests? #f))
+    (propagated-inputs
+     `(("perl-dbi" ,perl-dbi)
+       ("mysql" ,mysql)))
+    (home-page "http://search.cpan.org/dist/DBD-mysql")
+    (synopsis "DBI MySQL interface")
+    (description "This package provides a MySQL driver for the Perl5
+@dfn{Database Interface} (DBI).")
+    (license (package-license perl))))
+
 (define-public perl-dbd-sqlite
   (package
     (name "perl-dbd-sqlite")
@@ -685,14 +817,15 @@ valid SQL query.")
 (define-public unixodbc
   (package
    (name "unixodbc")
-   (version "2.3.2")
+   (version "2.3.4")
    (source (origin
             (method url-fetch)
             (uri
              (string-append
-              "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-" version ".tar.gz"))
+              "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
+              version ".tar.gz"))
             (sha256
-             (base32 "16jw5fq7wgfky6ak1h2j2pqx99jivsdl4q8aq6immpr55xs5jd4w"))))
+             (base32 "0f8y88rcc2akjvjv5y66yx7k0ms9h1s0vbcfy25j93didflhj59f"))))
    (build-system gnu-build-system)
    (synopsis "Data source abstraction library")
    (description "Unixodbc is a library providing an API with which to access
@@ -725,5 +858,97 @@ Driver.")
 self-contained, serverless, zero-configuration, transactional NoSQL
 database engine.  UnQLite is a document store database similar to
 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
-similar to BerkelyDB, LevelDB, etc.")
+similar to BerkeleyDB, LevelDB, etc.")
     (license bsd-2)))
+
+(define-public redis
+  (package
+    (name "redis")
+    (version "3.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://download.redis.io/releases/redis-"
+                                  version".tar.gz"))
+              (sha256
+               (base32
+                "0ql7zp061xr66a1dzpa6a0ijm8zm133dd364va7q5h8avkrim7wq"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f ; tests related to master/slave and replication fail
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure))
+       #:make-flags `("CC=gcc"
+                      "MALLOC=libc"
+                      ,(string-append "PREFIX="
+                                      (assoc-ref %outputs "out")))))
+    (synopsis "Key-value cache and store")
+    (description "Redis is an advanced key-value cache and store.  Redis
+supports many data structures including strings, hashes, lists, sets, sorted
+sets, bitmaps and hyperloglogs.")
+    (home-page "http://redis.io/")
+    (license bsd-3)))
+
+(define-public kyotocabinet
+  (package
+    (name "kyotocabinet")
+    (version "1.2.76")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
+                                  name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0g6js20x7vnpq4p8ghbw3mh9wpqksya9vwhzdx6dnlf354zjsal1"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list
+        (string-append "LDFLAGS=-Wl,-rpath="
+                       (assoc-ref %outputs "out") "/lib"))))
+    (inputs `(("zlib" ,zlib)))
+    (home-page "http://fallabs.com/kyotocabinet/")
+    (synopsis
+     "Kyoto Cabinet is a modern implementation of the DBM database")
+    (description
+     "Kyoto Cabinet is a standalone file-based database that supports Hash
+and B+ Tree data storage models.  It is a fast key-value lightweight
+database and supports many programming languages.  It is a NoSQL database.")
+    (license gpl3+)))
+
+(define-public wiredtiger
+  (package
+    (name "wiredtiger")
+    (version "2.8.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://source.wiredtiger.com/releases/wiredtiger-"
+                    version ".tar.bz2"))
+              (sha256
+               (base32
+                "1qh7y5paisdxq19jgg81ld7i32lz920n5k30hdpxnr8ll9c4hgjr"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags '("--enable-lz4" "--enable-zlib")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'disable-test/fops
+           (lambda _
+             ;; XXX: timed out after 3600 seconds of silence
+             (substitute* "Makefile"
+               (("test/fops") ""))
+             #t)))))
+    (inputs
+     `(("lz4" ,lz4)
+       ("zlib" ,zlib)))
+    (home-page "http://source.wiredtiger.com/")
+    (synopsis "NoSQL data engine")
+    (description
+     "WiredTiger is an extensible platform for data management.  It supports
+row-oriented storage (where all columns of a row are stored together),
+column-oriented storage (where columns are stored in groups, allowing for
+more efficient access and storage of column subsets) and log-structured merge
+trees (LSM), for sustained throughput under random insert workloads.")
+    (license gpl3) ; or GPL-2
+    ;; configure.ac: WiredTiger requires a 64-bit build.
+    (supported-systems '("x86_64-linux" "mips64el-linux"))))