1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2012, 2014, 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
5 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
8 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
10 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
12 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
13 ;;; Copyright © 2016 David Craven <david@craven.ch>
14 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
15 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
16 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages databases)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages avahi)
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages boost)
40 #:use-module (gnu packages crypto)
41 #:use-module (gnu packages gettext)
42 #:use-module (gnu packages glib)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages language)
45 #:use-module (gnu packages linux)
46 #:use-module (gnu packages tcl)
47 #:use-module (gnu packages tls)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages ncurses)
50 #:use-module (gnu packages readline)
51 #:use-module (gnu packages emacs)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages algebra)
54 #:use-module (gnu packages curl)
55 #:use-module (gnu packages cyrus-sasl)
56 #:use-module (gnu packages gnupg)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages parallel)
59 #:use-module (gnu packages pcre)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages popt)
62 #:use-module (gnu packages rdf)
63 #:use-module (gnu packages xml)
64 #:use-module (gnu packages bison)
65 #:use-module (gnu packages jemalloc)
66 #:use-module ((guix licenses)
67 #:select (gpl2 gpl3 gpl3+ lgpl2.1+ lgpl3+ x11-style non-copyleft
68 bsd-2 bsd-3 public-domain asl2.0))
69 #:use-module ((guix licenses) #:prefix license:)
70 #:use-module (guix packages)
71 #:use-module (guix download)
72 #:use-module (guix build-system gnu)
73 #:use-module (guix build-system perl)
74 #:use-module (guix build-system python)
75 #:use-module (guix build-system cmake)
76 #:use-module (guix utils)
77 #:use-module (srfi srfi-26)
78 #:use-module (ice-9 match))
86 (uri (string-append "https://github.com/garlik/4store/archive/v"
88 (file-name (string-append name "-" version ".tar.gz"))
90 (base32 "004fmcf1w75zhc1x3zc6kc97j4jqn2v5nhk6yb3z3cpfrhzi9j50"))
91 (patches (list (search-patch "4store-fix-buildsystem.patch")))))
92 (build-system gnu-build-system)
96 ("autoconf" ,autoconf)
97 ("automake" ,automake)
98 ("gettext" ,gettext-minimal)
100 ("pcre" ,pcre "bin") ;for 'pcre-config'
101 ("pkg-config" ,pkg-config)))
107 ("readline" ,readline)
109 ("cyrus-sasl" ,cyrus-sasl)
111 ("util-linux" ,util-linux)))
114 (modify-phases %standard-phases
115 (add-before 'configure 'generate-configure
117 (zero? (system* "./autogen.sh")))))))
118 ;; http://www.4store.org has been down for a while now.
119 (home-page "https://github.com/garlik/4store")
120 (synopsis "Clustered RDF storage and query engine")
121 (description "4store is a RDF/SPARQL store written in C, supporting
122 either single machines or networked clusters.")
131 (uri (string-append "mirror://gnu/gdbm/gdbm-"
135 "1smwz4x5qa4js0zf1w3asq6z7mh20zlgwbh2bk5dczw6xrk22yyr"))))
136 (arguments `(#:configure-flags '("--enable-libgdbm-compat")))
137 (build-system gnu-build-system)
138 (home-page "http://www.gnu.org/software/gdbm/")
140 "Hash library of database functions compatible with traditional dbm")
142 "GDBM is a library for manipulating hashed databases. It is used to
143 store key/value pairs in a file in a manner similar to the Unix dbm library
144 and provides interfaces to the traditional file format.")
153 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
157 "1isxx4jfmnh913jzhp8hhfngbk6dsg46f4kjpvvc56maj64jqqa7"))))
158 (build-system gnu-build-system)
159 (outputs '("out" ; programs, libraries, headers
160 "doc")) ; 94 MiB of HTML docs
162 '(#:tests? #f ; no check target available
163 #:disallowed-references ("doc")
167 (lambda* (#:key outputs #:allow-other-keys)
168 (let ((out (assoc-ref outputs "out"))
169 (doc (assoc-ref outputs "doc")))
170 ;; '--docdir' is not honored, so we need to patch.
171 (substitute* "dist/Makefile.in"
172 (("docdir[[:blank:]]*=.*")
173 (string-append "docdir = " doc "/share/doc/bdb")))
176 (system* "./dist/configure"
177 (string-append "--prefix=" out)
178 (string-append "CONFIG_SHELL=" (which "bash"))
179 (string-append "SHELL=" (which "bash"))
181 ;; Remove 7 MiB of .a files.
184 ;; The compatibility mode is needed by some packages,
188 ;; The following flag is needed so that the inclusion
189 ;; of db_cxx.h into C++ files works; it leads to
190 ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h.
193 (synopsis "Berkeley database")
195 "Berkeley DB is an embeddable database allowing developers the choice of
196 SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
197 (license (non-copyleft "file://LICENSE"
198 "See LICENSE in the distribution."))
200 "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html")))
202 (define-public bdb-5.3
203 (package (inherit bdb)
208 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
212 "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))))))
214 (define-public leveldb
220 (uri (string-append "https://github.com/google/leveldb"
221 "/archive/v" version ".tar.gz"))
222 (file-name (string-append name "-" version ".tar.gz"))
225 "00jjgs9xlwycfkg0xd7n1rj6v9zrx7xc7hann6zalrjyhap18ykx"))))
226 (build-system gnu-build-system)
228 '(#:make-flags (list "CC=gcc")
230 (modify-phases %standard-phases
233 ;; There is no install target, so we do it here.
234 (lambda* (#:key outputs #:allow-other-keys)
235 (let* ((out (assoc-ref outputs "out"))
236 (lib (string-append out "/lib"))
237 (include (string-append out "/include")))
238 (for-each (lambda (file)
239 (install-file file lib))
240 (find-files "out-shared" "^libleveldb\\.so.*$"))
241 (copy-recursively "include" include)
244 `(("snappy" ,snappy)))
245 (home-page "http://leveldb.org/")
246 (synopsis "Fast key-value storage library")
248 "LevelDB is a fast key-value storage library that provides an ordered
249 mapping from string keys to string values.")
258 (uri (list (string-append
259 "http://dev.mysql.com/get/Downloads/MySQL-"
260 (version-major+minor version) "/"
261 name "-" version ".tar.gz")
263 "http://downloads.mysql.com/archives/get/file/"
264 name "-" version ".tar.gz")))
267 "0lcn9cm36n14g22bcppq5vf4nxbrl3khvlsp9hsixqdfb3l27gyf"))))
268 (build-system cmake-build-system)
271 '("-DBUILD_CONFIG=mysql_release"
274 "-DDEFAULT_CHARSET=utf8"
275 "-DDEFAULT_COLLATION=utf8_general_ci"
276 "-DMYSQL_DATADIR=/var/lib/mysql"
277 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
278 "-DINSTALL_INFODIR=share/mysql/docs"
279 "-DINSTALL_MANDIR=share/man"
280 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
281 "-DINSTALL_SCRIPTDIR=bin"
282 "-DINSTALL_INCLUDEDIR=include/mysql"
283 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
284 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
285 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
286 "-DINSTALL_DOCDIR=share/mysql/docs"
287 "-DINSTALL_SHAREDIR=share/mysql"
288 ;; Get rid of test data.
289 "-DINSTALL_MYSQLTESTDIR="
290 "-DINSTALL_SQLBENCHDIR=")
291 #:phases (modify-phases %standard-phases
293 'unpack 'patch-boost-version
295 ;; Mysql wants boost-1.59.0 specifically
296 (substitute* "cmake/boost.cmake"
298 ,(match (string-split (package-version boost) #\.)
299 ((_ minor . _) minor))))))
301 'install 'remove-extra-binaries
302 (lambda* (#:key outputs #:allow-other-keys)
303 (let ((out (assoc-ref outputs "out")))
304 ;; Remove the 3 *_embedded files, which weigh in at
306 (for-each delete-file
307 (find-files (string-append out "/bin")
319 (home-page "http://www.mysql.com/")
320 (synopsis "Fast, easy to use, and popular database")
322 "MySQL is a fast, reliable, and easy to use relational database
323 management system that supports the standardized Structured Query
327 (define-public mariadb
333 (uri (string-append "https://downloads.mariadb.org/f/"
334 name "-" version "/source/"
335 name "-" version ".tar.gz"))
338 "144lcm5awcf0k6a7saqfr4p2kg8r5wbdhdm4cmn2m8hyg1an70as"))))
339 (build-system cmake-build-system)
342 '("-DBUILD_CONFIG=mysql_release"
343 "-DDEFAULT_CHARSET=utf8"
344 "-DDEFAULT_COLLATION=utf8_general_ci"
345 "-DMYSQL_DATADIR=/var/lib/mysql"
346 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
347 "-DINSTALL_INFODIR=share/mysql/docs"
348 "-DINSTALL_MANDIR=share/man"
349 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
350 "-DINSTALL_SCRIPTDIR=bin"
351 "-DINSTALL_INCLUDEDIR=include/mysql"
352 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
353 "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
354 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
355 "-DINSTALL_DOCDIR=share/mysql/docs"
356 "-DINSTALL_SHAREDIR=share/mysql")
358 (modify-phases %standard-phases
360 'configure 'pre-configure
362 (setenv "CONFIG_SHELL" (which "sh"))
365 'install 'post-install
366 (lambda* (#:key outputs #:allow-other-keys)
367 (let* ((out (assoc-ref outputs "out"))
368 (test (assoc-ref outputs "test")))
369 (substitute* (string-append out "/bin/mysql_install_db")
371 (string-append "basedir=\"" out "\"")))
372 ;; Remove unneeded files for testing.
373 (with-directory-excursion out
374 (for-each delete-file-recursively
375 '("data" "mysql-test" "sql-bench"
376 "share/man/man1/mysql-test-run.pl.1")))))))))
381 `(("jemalloc" ,jemalloc)
388 (home-page "https://mariadb.org/")
389 (synopsis "SQL database server")
391 "MariaDB is a multi-user and multi-threaded SQL database server, designed
392 as a drop-in replacement of MySQL.")
395 (define-public postgresql
401 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
402 version "/postgresql-" version ".tar.bz2"))
405 "157kf6mdazmxfmd11f0akya2xcz6sfgprn7yqc26dpklps855ih2"))))
406 (build-system gnu-build-system)
409 (modify-phases %standard-phases
410 (add-before 'configure 'patch-/bin/sh
412 ;; Refer to the actual shell.
413 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
414 "src/bin/psql/command.c")
415 (("/bin/sh") (which "sh")))
418 `(("readline" ,readline)
420 (home-page "https://www.postgresql.org/")
421 (synopsis "Powerful object-relational database system")
423 "PostgreSQL is a powerful object-relational database system. It is fully
424 ACID compliant, has full support for foreign keys, joins, views, triggers, and
425 stored procedures (in multiple languages). It includes most SQL:2008 data
426 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
427 TIMESTAMP. It also supports storage of binary large objects, including
428 pictures, sounds, or video.")
429 (license (x11-style "file://COPYRIGHT"))))
438 (uri (string-append "http://fallabs.com/" name "/"
439 name "-" version ".tar.gz"))
442 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
443 (build-system gnu-build-system)
445 `( #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
446 (assoc-ref %outputs "out")
448 (home-page "http://fallabs.com/qdbm")
449 (synopsis "Key-value database")
450 (description "QDBM is a library of routines for managing a
451 database. The database is a simple data file containing key-value
452 pairs. Every key and value is serial bytes with variable length.
453 Binary data as well as character strings can be used as a key or a
454 value. There is no concept of data tables or data types. Records are
455 organized in a hash table or B+ tree.")
456 (license license:lgpl2.1+)))
458 (define-public recutils
464 (uri (string-append "mirror://gnu/recutils/recutils-"
468 "0cdwa4094x3yx7vn98xykvnlp9rngvd58d19vs3vh5hrvggccg93"))))
469 (build-system gnu-build-system)
471 ;; Running tests in parallel leads to test failures and crashes in
473 (arguments '(#:parallel-tests? #f
475 (list (string-append "--with-bash-headers="
476 (assoc-ref %build-inputs "bash:include")
479 #:phases (modify-phases %standard-phases
480 (add-before 'build 'set-bash4.4-header-location
482 (substitute* "bash/Makefile.in"
483 ;; Adjust the header search path for Bash
484 ;; 4.4 in accordance with 'bash.pc'.
485 (("AM_CPPFLAGS = (.*)$" _ rest)
486 (string-append "AM_CPPFLAGS = "
487 "-I$(BASH_HEADERS)/include "
490 ;; Install to PREFIX/lib/bash to match Bash
491 ;; 4.4's search path.
493 "libdir = @libdir@/bash\n"))
496 (native-inputs `(("emacs" ,emacs-minimal)
498 ("bash:include" ,bash "include")
499 ("libuuid" ,util-linux)))
501 ;; TODO: Add more optional inputs.
502 (inputs `(("curl" ,curl)
503 ("libgcrypt" ,libgcrypt)
505 (synopsis "Manipulate plain text files as databases")
507 "GNU Recutils is a set of tools and libraries for creating and
508 manipulating text-based, human-editable databases. Despite being text-based,
509 databases created with Recutils carry all of the expected features such as
510 unique fields, primary keys, time stamps and more. Many different field
511 types are supported, as is encryption.")
513 (home-page "http://www.gnu.org/software/recutils/")))
515 (define-public rocksdb
521 (uri (string-append "https://github.com/facebook/rocksdb"
522 "/archive/v" version ".tar.gz"))
523 (file-name (string-append name "-" version ".tar.gz"))
526 "1jj8b50w8jr3bnyjzk2hmlzq9x49yihjilx3xlq2rfdx3q9x4fay"))
527 (modules '((guix build utils)))
530 ;; TODO: unbundle gtest.
531 (delete-file "build_tools/gnu_parallel")
533 (build-system gnu-build-system)
535 '(#:make-flags (list "CC=gcc"
536 ;; Make the resulting library position-independent so the
537 ;; static version can be included in shared objects.
538 "EXTRA_CXXFLAGS=-fPIC"
539 (string-append "INSTALL_PATH="
540 (assoc-ref %outputs "out")))
542 (modify-phases %standard-phases
543 (add-after 'unpack 'patch-Makefile
545 (substitute* "Makefile"
546 (("build_tools/gnu_parallel") "parallel")
547 (("#!/bin/sh") (string-append "#!" (which "sh"))))
550 (add-before 'check 'disable-failing-tests
552 (substitute* "Makefile"
553 ;; These tests reliably fail due to "Too many open files".
554 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
555 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
558 'check 'build-release-libraries
559 ;; The 'check' target depends on the default target which is compiled
560 ;; with debug symbols. The 'install' target depends on shared and
561 ;; static release targets so we build them here for clarity.
562 ;; TODO: Add debug output.
563 (lambda* (#:key (make-flags '()) #:allow-other-keys)
564 ;; Prevent the build from adding machine-specific optimizations.
565 ;; This does not work if passed as a make flag...
566 (setenv "PORTABLE" "1")
567 (and (zero? (apply system* "make" "static_lib" make-flags))
568 (zero? (apply system* "make" "shared_lib" make-flags)))))
569 (add-after 'install 'delete-static-library
570 (lambda* (#:key outputs #:allow-other-keys)
571 (let* ((out (assoc-ref outputs "out"))
572 (lib (string-append out "/lib")))
573 (for-each (lambda (file)
575 (find-files lib "\\.l?a$"))
578 `(("parallel" ,parallel)
581 ("python" ,python-2)))
585 ("jemalloc" ,jemalloc)
589 (home-page "http://rocksdb.org/")
590 (synopsis "Persistent key-value store for fast storage")
592 "RocksDB is a library that forms the core building block for a fast
593 key-value server, especially suited for storing data on flash drives. It
594 has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
595 between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
596 (RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
597 compactions, making it specially suitable for storing multiple terabytes of
598 data in a single database. RocksDB is partially based on @code{LevelDB}.")
599 ;; RocksDB is BSD-3 and the JNI adapter is Apache 2.0.
600 (license (list bsd-3 asl2.0))))
602 (define-public sparql-query
604 (name "sparql-query")
608 (uri (string-append "https://github.com/tialaramex/"
609 name "/archive/" version ".tar.gz"))
611 (base32 "0yq3k20472rv8npcc420q9ab6idy584g5y0q501d360k5q0ggr8w"))
612 (file-name (string-append name "-" version ".tar.gz"))))
613 (build-system gnu-build-system)
615 `(("readline" ,readline)
621 `(("pkg-config" ,pkg-config)))
623 `(#:make-flags '("CC=gcc")
625 (modify-phases %standard-phases
627 ;; The Makefile uses git to obtain versioning information. This phase
628 ;; substitutes the git invocation with the package version.
629 (add-after 'unpack 'remove-git-dependency
631 (substitute* "Makefile"
633 (string-append "gitrev = \"v" ,version "\"")))))
634 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
635 ;; This replacement does the same thing, except for using $PREFIX/bin
638 (lambda* (#:key outputs #:allow-other-keys)
639 (let* ((out (assoc-ref outputs "out"))
640 (bin (string-append out "/bin")))
641 (install-file "sparql-query" bin)
642 (system* "ln" "--symbolic"
643 (string-append bin "/sparql-query")
644 (string-append bin "/sparql-update")))))
646 (lambda* (#:key make-flags #:allow-other-keys)
648 (zero? (apply system* "make" `(,@make-flags "scan-test")))
649 (zero? (system "./scan-test"))))))))
650 (home-page "https://github.com/tialaramex/sparql-query/")
651 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
652 (description "Sparql-query is a command-line tool for accessing SPARQL
653 endpoints over HTTP. It has been intentionally designed to 'feel' similar to
654 tools for interrogating SQL databases. For example, you can enter a query over
655 several lines, using a semi-colon at the end of a line to indicate the end of
656 your query. It also supports readline so that you can more easily recall and
657 edit previous queries, even across sessions. It can be used non-interactively,
658 for example from a shell script.")
659 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
660 ;; others (like sparql-query.c) contain a GPLv2+ license header.
661 (license (list gpl3+))))
663 (define-public sqlite
669 (uri (let ((numeric-version
670 (match (string-split version #\.)
671 ((first-digit other-digits ...)
672 (string-append first-digit
675 (map (cut string-pad <> 2 #\0)
678 (string-append "https://sqlite.org/2017/sqlite-autoconf-"
679 numeric-version ".tar.gz")))
682 "059n4s9qd35qpbd4g29y9ay99a6f68ad7k65g430rxb6jcz0rk35"))))
683 (build-system gnu-build-system)
684 (inputs `(("readline" ,readline)))
687 ;; Add -DSQLITE_SECURE_DELETE, -DSQLITE_ENABLE_UNLOCK_NOTIFY and
688 ;; -DSQLITE_ENABLE_DBSTAT_VTAB to CFLAGS. GNU Icecat will refuse
689 ;; to use the system SQLite unless these options are enabled.
690 (list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
691 "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
692 "-DSQLITE_ENABLE_DBSTAT_VTAB"))))
693 (home-page "https://www.sqlite.org/")
694 (synopsis "The SQLite database management system")
696 "SQLite is a software library that implements a self-contained, serverless,
697 zero-configuration, transactional SQL database engine. SQLite is the most
698 widely deployed SQL database engine in the world. The source code for SQLite
699 is in the public domain.")
700 (license public-domain)))
708 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
712 "0i1l38h0vyck6zkcj4fn2l03spadlmyr1qa1xpdp9dy2ccbm3s1r"))))
713 (build-system gnu-build-system)
716 (modify-phases %standard-phases
718 (lambda* (#:key outputs #:allow-other-keys)
719 (let ((out (assoc-ref outputs "out")))
720 ;; The 'configure' script is a wrapper for Waf and
721 ;; doesn't recognize things like '--enable-fast-install'.
722 (zero? (system* "./configure"
723 (string-append "--prefix=" out)))))))))
725 `(;; TODO: Build the documentation.
726 ;; ("docbook-xsl" ,docbook-xsl)
727 ;; ("libxml2" ,libxml2)
728 ;; ("libxslt" ,libxslt)
729 ("python" ,python-2))) ;for the Waf build system
730 (home-page "https://tdb.samba.org/")
731 (synopsis "Trivial database")
733 "TDB is a Trivial Database. In concept, it is very much like GDBM,
734 and BSD's DB except that it allows multiple simultaneous writers and uses
735 locking internally to keep writers from trampling on each other. TDB is also
739 (define-public perl-dbi
746 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
750 "0v37vnr5p0bx396cj0lb5kb69jbryq2mspp602hbgd04gklxqzcg"))))
751 (build-system perl-build-system)
752 (synopsis "Database independent interface for Perl")
753 (description "This package provides an database interface for Perl.")
754 (home-page "http://search.cpan.org/dist/DBI")
755 (license (package-license perl))))
757 (define-public perl-dbix-class
759 (name "perl-dbix-class")
764 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
765 "DBIx-Class-" version ".tar.gz"))
768 "1vw1f756g8m5hq11nqf5dk2cw2y4mqq91ca5p75fn5g3fp8syja0"))))
769 (build-system perl-build-system)
771 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
772 ("perl-file-temp" ,perl-file-temp)
773 ("perl-package-stash" ,perl-package-stash)
774 ("perl-test-deep" ,perl-test-deep)
775 ("perl-test-exception" ,perl-test-exception)
776 ("perl-test-warn" ,perl-test-warn)))
778 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
779 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
780 ("perl-class-inspector" ,perl-class-inspector)
781 ("perl-config-any" ,perl-config-any)
782 ("perl-context-preserve" ,perl-context-preserve)
783 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
784 ("perl-data-page" ,perl-data-page)
785 ("perl-dbi" ,perl-dbi)
786 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
787 ("perl-hash-merge" ,perl-hash-merge)
788 ("perl-module-find" ,perl-module-find)
789 ("perl-moo" ,perl-moo)
790 ("perl-mro-compat" ,perl-mro-compat)
791 ("perl-namespace-clean" ,perl-namespace-clean)
792 ("perl-path-class" ,perl-path-class)
793 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
794 ("perl-scope-guard" ,perl-scope-guard)
795 ("perl-sql-abstract" ,perl-sql-abstract)
796 ("perl-sub-name" ,perl-sub-name)
797 ("perl-text-balanced" ,perl-text-balanced)
798 ("perl-try-tiny" ,perl-try-tiny)))
799 (home-page "http://search.cpan.org/dist/DBIx-Class")
800 (synopsis "Extensible and flexible object <-> relational mapper")
801 (description "An SQL to OO mapper with an object API inspired by
802 Class::DBI (with a compatibility layer as a springboard for porting) and a
803 resultset API that allows abstract encapsulation of database operations. It
804 aims to make representing queries in your code as perl-ish as possible while
805 still providing access to as many of the capabilities of the database as
806 possible, including retrieving related records from multiple tables in a
807 single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
808 \"ORDER BY\" and \"HAVING\" support.")
809 (license (package-license perl))))
811 (define-public perl-dbix-class-cursor-cached
813 (name "perl-dbix-class-cursor-cached")
818 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
819 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
822 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
823 (build-system perl-build-system)
825 `(("perl-cache-cache" ,perl-cache-cache)
826 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
828 `(("perl-carp-clan" ,perl-carp-clan)
829 ("perl-dbix-class" ,perl-dbix-class)))
830 (home-page "http://search.cpan.org/dist/DBIx-Class-Cursor-Cached")
831 (synopsis "Cursor with built-in caching support")
832 (description "DBIx::Class::Cursor::Cached provides a cursor class with
833 built-in caching support.")
834 (license (package-license perl))))
836 (define-public perl-dbix-class-introspectablem2m
838 (name "perl-dbix-class-introspectablem2m")
843 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
844 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
847 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
848 (build-system perl-build-system)
850 `(("perl-dbix-class" ,perl-dbix-class)))
851 (home-page "http://search.cpan.org/dist/DBIx-Class-IntrospectableM2M")
852 (synopsis "Introspect many-to-many relationships")
853 (description "Because the many-to-many relationships are not real
854 relationships, they can not be introspected with DBIx::Class. Many-to-many
855 relationships are actually just a collection of convenience methods installed
856 to bridge two relationships. This DBIx::Class component can be used to store
857 all relevant information about these non-relationships so they can later be
858 introspected and examined.")
859 (license (package-license perl))))
861 (define-public perl-dbix-class-schema-loader
863 (name "perl-dbix-class-schema-loader")
868 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
869 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
872 "08cgn0dx42y9xsxas9np7s55a7qmy4kf6sfmx0jmk4hryvbapml3"))))
873 (build-system perl-build-system)
875 `(("perl-config-any" ,perl-config-any)
876 ("perl-config-general" ,perl-config-general)
877 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
878 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
879 ("perl-moose" ,perl-moose)
880 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
881 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
882 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
883 ("perl-test-deep" ,perl-test-deep)
884 ("perl-test-differences" ,perl-test-differences)
885 ("perl-test-exception" ,perl-test-exception)
886 ("perl-test-pod" ,perl-test-pod)
887 ("perl-test-warn" ,perl-test-warn)))
889 `(("perl-class-unload" ,perl-class-unload)
890 ("perl-class-inspector" ,perl-class-inspector)
891 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
892 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
893 ("perl-carp-clan" ,perl-carp-clan)
894 ("perl-data-dump" ,perl-data-dump)
895 ("perl-dbix-class" ,perl-dbix-class)
896 ("perl-hash-merge" ,perl-hash-merge)
897 ("perl-list-moreutils" ,perl-list-moreutils)
898 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
899 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
900 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
901 ("perl-namespace-clean" ,perl-namespace-clean)
902 ("perl-mro-compat" ,perl-mro-compat)
903 ("perl-scope-guard" ,perl-scope-guard)
904 ("perl-string-camelcase" ,perl-string-camelcase)
905 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
906 ("perl-sub-name" ,perl-sub-name)
907 ("perl-try-tiny" ,perl-try-tiny)))
908 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
909 (home-page "http://search.cpan.org/dist/DBIx-Class-Schema-Loader")
910 (synopsis "Create a DBIx::Class::Schema based on a database")
911 (description "DBIx::Class::Schema::Loader automates the definition of a
912 DBIx::Class::Schema by scanning database table definitions and setting up the
913 columns, primary keys, unique constraints and relationships.")
914 (license (package-license perl))))
916 (define-public perl-dbd-pg
923 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
924 "DBD-Pg-" version ".tar.gz"))
927 "0z0kf1kjgbi5f6nr63i2fnrx7629d9lvxg1q8sficwb3zdf1ggzx"))))
928 (build-system perl-build-system)
930 `(("perl-dbi" ,perl-dbi)))
932 `(("perl-dbi" ,perl-dbi)
933 ("postgresql" ,postgresql)))
934 (home-page "http://search.cpan.org/dist/DBD-Pg")
935 (synopsis "DBI PostgreSQL interface")
936 (description "This package provides a PostgreSQL driver for the Perl5
937 @dfn{Database Interface} (DBI).")
938 (license (package-license perl))))
940 (define-public perl-dbd-mysql
942 (name "perl-dbd-mysql")
947 (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
948 "DBD-mysql-" version ".tar.gz"))
951 "0h4h6zwzj8fwh9ljb8svnsa0a3ch4p10hp59kpdibdb4qh8xwxs7"))))
952 (build-system perl-build-system)
953 ;; Tests require running MySQL server
954 (arguments `(#:tests? #f))
956 `(("perl-dbi" ,perl-dbi)
958 (home-page "http://search.cpan.org/dist/DBD-mysql")
959 (synopsis "DBI MySQL interface")
960 (description "This package provides a MySQL driver for the Perl5
961 @dfn{Database Interface} (DBI).")
962 (license (package-license perl))))
964 (define-public perl-dbd-sqlite
966 (name "perl-dbd-sqlite")
971 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
975 "0kimb2qr1rh07yylbbfybwcizpmy61ck667amypn4clmkfg0knm6"))))
976 (build-system perl-build-system)
977 (inputs `(("sqlite" ,sqlite)))
978 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
979 (synopsis "SQlite interface for Perl")
980 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
981 the entire thing in the distribution. So in order to get a fast transaction
982 capable RDBMS working for your Perl project you simply have to install this
983 module, and nothing else.")
984 (license (package-license perl))
985 (home-page "http://search.cpan.org/~ishigaki/DBD-SQLite/lib/DBD/SQLite.pm")))
987 (define-public perl-sql-abstract
989 (name "perl-sql-abstract")
994 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
995 "SQL-Abstract-" version ".tar.gz"))
998 "17sgwq3mvqjhv3b77cnvrq60xgp8harjhlnvpwmxc914rqc5ckaz"))))
999 (build-system perl-build-system)
1001 `(("perl-test-deep" ,perl-test-deep)
1002 ("perl-test-exception" ,perl-test-exception)
1003 ("perl-test-warn" ,perl-test-warn)))
1005 `(("perl-hash-merge" ,perl-hash-merge)
1006 ("perl-moo" ,perl-moo)
1007 ("perl-mro-compat" ,perl-mro-compat)
1008 ("perl-text-balanced" ,perl-text-balanced)))
1009 (home-page "http://search.cpan.org/dist/SQL-Abstract")
1010 (synopsis "Generate SQL from Perl data structures")
1011 (description "This module was inspired by the excellent DBIx::Abstract.
1012 While based on the concepts used by DBIx::Abstract, the concepts used have
1013 been modified to make the SQL easier to generate from Perl data structures.
1014 The underlying idea is for this module to do what you mean, based on the data
1015 structures you provide it, so that you don't have to modify your code every
1016 time your data changes.")
1017 (license (package-license perl))))
1019 (define-public perl-sql-splitstatement
1021 (name "perl-sql-splitstatement")
1026 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
1027 "SQL-SplitStatement-" version ".tar.gz"))
1030 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
1031 (build-system perl-build-system)
1033 `(("perl-test-exception" ,perl-test-exception)))
1035 `(("perl-class-accessor" ,perl-class-accessor)
1036 ("perl-list-moreutils" ,perl-list-moreutils)
1037 ("perl-regexp-common" ,perl-regexp-common)
1038 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
1039 (home-page "http://search.cpan.org/dist/SQL-SplitStatement")
1040 (synopsis "Split SQL code into atomic statements")
1041 (description "This module tries to split any SQL code, even including
1042 non-standard extensions, into the atomic statements it is composed of.")
1043 (license (package-license perl))))
1045 (define-public perl-sql-tokenizer
1047 (name "perl-sql-tokenizer")
1052 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
1053 "SQL-Tokenizer-" version ".tar.gz"))
1056 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
1057 (build-system perl-build-system)
1058 (home-page "http://search.cpan.org/dist/SQL-Tokenizer")
1059 (synopsis "SQL tokenizer")
1060 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
1061 claim to be a parser or query verifier. It just creates sane tokens from a
1063 (license (package-license perl))))
1065 (define-public unixodbc
1073 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
1076 (base32 "0f8y88rcc2akjvjv5y66yx7k0ms9h1s0vbcfy25j93didflhj59f"))))
1077 (build-system gnu-build-system)
1078 (synopsis "Data source abstraction library")
1079 (description "Unixodbc is a library providing an API with which to access
1080 data sources. Data sources include SQL Servers and any software with an ODBC
1083 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
1084 (home-page "http://www.unixodbc.org")))
1086 (define-public unqlite
1092 ;; Contains bug fixes against the official release, and has an
1093 ;; autotooled build system.
1094 (uri (string-append "https://github.com/aidin36/tocc/releases/"
1096 "unqlite-unofficial-" version ".tar.gz"))
1099 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
1100 (build-system gnu-build-system)
1101 (arguments `(#:tests? #f)) ;No check target
1102 (home-page "http://www.unqlite.org")
1103 (synopsis "In-memory key/value and document store")
1105 "UnQLite is an in-process software library which implements a
1106 self-contained, serverless, zero-configuration, transactional NoSQL
1107 database engine. UnQLite is a document store database similar to
1108 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
1109 similar to BerkeleyDB, LevelDB, etc.")
1112 (define-public redis
1118 (uri (string-append "http://download.redis.io/releases/redis-"
1122 "1wb9jd692a0y52bkkxr6815kk4g039mirjdrvqx24265lv2l5l1a"))))
1123 (build-system gnu-build-system)
1125 '(#:tests? #f ; tests related to master/slave and replication fail
1126 #:phases (modify-phases %standard-phases
1127 (delete 'configure))
1128 #:make-flags `("CC=gcc"
1131 ,(string-append "PREFIX="
1132 (assoc-ref %outputs "out")))))
1133 (synopsis "Key-value cache and store")
1134 (description "Redis is an advanced key-value cache and store. Redis
1135 supports many data structures including strings, hashes, lists, sets, sorted
1136 sets, bitmaps and hyperloglogs.")
1137 (home-page "http://redis.io/")
1140 (define-public kyotocabinet
1142 (name "kyotocabinet")
1146 (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
1147 name "-" version ".tar.gz"))
1150 "0g6js20x7vnpq4p8ghbw3mh9wpqksya9vwhzdx6dnlf354zjsal1"))))
1151 (build-system gnu-build-system)
1155 (string-append "LDFLAGS=-Wl,-rpath="
1156 (assoc-ref %outputs "out") "/lib"))))
1157 (inputs `(("zlib" ,zlib)))
1158 (home-page "http://fallabs.com/kyotocabinet/")
1160 "Kyoto Cabinet is a modern implementation of the DBM database")
1162 "Kyoto Cabinet is a standalone file-based database that supports Hash
1163 and B+ Tree data storage models. It is a fast key-value lightweight
1164 database and supports many programming languages. It is a NoSQL database.")
1167 (define-public wiredtiger
1174 "http://source.wiredtiger.com/releases/wiredtiger-"
1175 version ".tar.bz2"))
1178 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
1179 (build-system gnu-build-system)
1181 '(#:configure-flags '("--enable-lz4" "--enable-zlib")
1183 (modify-phases %standard-phases
1184 (add-before 'check 'disable-test/fops
1186 ;; XXX: timed out after 3600 seconds of silence
1187 (substitute* "Makefile"
1193 (home-page "http://source.wiredtiger.com/")
1194 (synopsis "NoSQL data engine")
1196 "WiredTiger is an extensible platform for data management. It supports
1197 row-oriented storage (where all columns of a row are stored together),
1198 column-oriented storage (where columns are stored in groups, allowing for
1199 more efficient access and storage of column subsets) and log-structured merge
1200 trees (LSM), for sustained throughput under random insert workloads.")
1201 (license gpl3) ; or GPL-2
1202 ;; configure.ac: WiredTiger requires a 64-bit build.
1203 (supported-systems '("x86_64-linux" "mips64el-linux"))))
1205 (define-public perl-db-file
1207 (name "perl-db-file")
1213 "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
1218 "0yp5d5zr8dk9g6xdh7ygi5bq63q7nxvhd58dk2i3ki4nb7yv2yh9"))))
1219 (build-system perl-build-system)
1220 (inputs `(("bdb" ,bdb)))
1221 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
1223 `(#:phases (modify-phases %standard-phases
1225 'configure 'modify-config.in
1226 (lambda* (#:key inputs #:allow-other-keys)
1227 (substitute* "config.in"
1228 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
1230 (home-page "http://search.cpan.org/dist/DB_File")
1232 "Perl5 access to Berkeley DB version 1.x")
1234 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
1235 (license (package-license perl))))
1243 (uri (string-append "https://github.com/LMDB/lmdb/archive/"
1244 "LMDB_" version ".tar.gz"))
1247 "12crvzxky8in99ibh22k4ppmkgqs28yy3v7yy944za7fsrqv8dfx"))))
1248 (build-system gnu-build-system)
1250 `(#:test-target "test"
1252 (modify-phases %standard-phases
1254 (lambda* (#:key outputs #:allow-other-keys)
1255 (chdir (string-append
1256 (getenv "PWD") "/lmdb-LMDB_" ,version "/libraries/liblmdb"))
1257 (substitute* "Makefile"
1258 (("/usr/local") (assoc-ref outputs "out")))
1260 (home-page "https://symas.com/products/lightning-memory-mapped-database")
1261 (synopsis "Lightning memory-mapped database library")
1262 (description "Lightning memory-mapped database library.")
1263 (license license:openldap2.8)))
1265 (define-public libpqxx
1272 "http://pqxx.org/download/software/libpqxx/"
1273 name "-" version ".tar.gz"))
1276 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
1277 (build-system gnu-build-system)
1279 `(("python" ,python-2)))
1280 (inputs `(("postgresql" ,postgresql)))
1282 `(#:tests? #f)) ; # FAIL: 1
1283 (synopsis "C++ connector for PostgreSQL")
1285 "Libpqxx is a C++ library to enable user programs to communicate with the
1286 PostgreSQL database back-end. The database back-end can be local or it may be
1287 on another machine, accessed via TCP/IP.")
1288 (home-page "http://pqxx.org/")
1289 (license license:bsd-3)))
1291 (define-public python-peewee
1293 (name "python-peewee")
1298 (uri (pypi-uri "peewee" version))
1301 "1605bk11s7aap2q4qyba93rx7yfh8b11kk0cqi08z8klx2iar8yd"))))
1302 (build-system python-build-system)
1304 `(#:tests? #f)) ; Fails to import test data
1306 `(("python-cython" ,python-cython)))
1307 (home-page "https://github.com/coleifer/peewee/")
1308 (synopsis "Small object-relational mapping utility")
1310 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
1311 handles converting between pythonic values and those used by databases, so you
1312 can use Python types in your code without having to worry. It has built-in
1313 support for sqlite, mysql and postgresql. If you already have a database, you
1314 can autogenerate peewee models using @code{pwiz}, a model generator.")
1315 (license license:expat)))
1317 (define-public python2-peewee
1318 (package-with-python2 python-peewee))
1320 (define-public sqlcipher
1327 (uri (string-append "https://github.com/sqlcipher/" name
1328 "/archive/v" version ".tar.gz"))
1330 (base32 "1gv58dlbpzrmznly52yqbxgvii0ib88zr3aszla1bsypwjr6flff"))
1331 (file-name (string-append name "-" version ".tar.gz"))))
1332 (build-system gnu-build-system)
1334 `(("libcrypto" ,openssl)
1335 ("libtcl8.6" ,tcl))) ; required for running the tests
1340 '("--enable-tempstore=yes"
1341 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
1342 "LDFLAGS=-lcrypto -ltcl8.6"
1344 ;; tests cannot be run from the Makefile
1345 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
1346 #:test-target "testfixture"
1348 (modify-phases %standard-phases
1349 (add-before 'check 'build-test-runner
1350 (assoc-ref %standard-phases 'check))
1354 (system* "./testfixture" "test/crypto.test")))))))
1355 (home-page "https://www.zetetic.net/sqlcipher/")
1357 "Library providing transparent encryption of SQLite database files")
1358 (description "SQLCipher is an implementation of SQLite, extended to
1359 provide transparent 256-bit AES encryption of database files. Pages are
1360 encrypted before being written to disk and are decrypted when read back. It’s
1361 well suited for protecting embedded application databases and for mobile
1364 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
1365 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
1366 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
1367 ;; source files are in the public domain.
1368 (license (list license:public-domain license:bsd-3))))