Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / databases.scm
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>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
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.
25 ;;;
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.
30 ;;;
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/>.
33
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))
79
80 (define-public 4store
81 (package
82 (name "4store")
83 (version "1.1.6")
84 (source (origin
85 (method url-fetch)
86 (uri (string-append "https://github.com/garlik/4store/archive/v"
87 version ".tar.gz"))
88 (file-name (string-append name "-" version ".tar.gz"))
89 (sha256
90 (base32 "004fmcf1w75zhc1x3zc6kc97j4jqn2v5nhk6yb3z3cpfrhzi9j50"))
91 (patches (list (search-patch "4store-fix-buildsystem.patch")))))
92 (build-system gnu-build-system)
93 (native-inputs
94 `(("perl" ,perl)
95 ("python" ,python-2)
96 ("autoconf" ,autoconf)
97 ("automake" ,automake)
98 ("gettext" ,gettext-minimal)
99 ("libtool" ,libtool)
100 ("pcre" ,pcre "bin") ;for 'pcre-config'
101 ("pkg-config" ,pkg-config)))
102 (inputs
103 `(("glib" ,glib)
104 ("rasqal" ,rasqal)
105 ("libxml2" ,libxml2)
106 ("raptor2" ,raptor2)
107 ("readline" ,readline)
108 ("avahi" ,avahi)
109 ("cyrus-sasl" ,cyrus-sasl)
110 ("openssl" ,openssl)
111 ("util-linux" ,util-linux)))
112 (arguments
113 `(#:phases
114 (modify-phases %standard-phases
115 (add-before 'configure 'generate-configure
116 (lambda _
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.")
123 (license gpl3+)))
124
125 (define-public gdbm
126 (package
127 (name "gdbm")
128 (version "1.12")
129 (source (origin
130 (method url-fetch)
131 (uri (string-append "mirror://gnu/gdbm/gdbm-"
132 version ".tar.gz"))
133 (sha256
134 (base32
135 "1smwz4x5qa4js0zf1w3asq6z7mh20zlgwbh2bk5dczw6xrk22yyr"))))
136 (arguments `(#:configure-flags '("--enable-libgdbm-compat")))
137 (build-system gnu-build-system)
138 (home-page "http://www.gnu.org/software/gdbm/")
139 (synopsis
140 "Hash library of database functions compatible with traditional dbm")
141 (description
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.")
145 (license gpl3+)))
146
147 (define-public bdb
148 (package
149 (name "bdb")
150 (version "6.2.23")
151 (source (origin
152 (method url-fetch)
153 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
154 version ".tar.gz"))
155 (sha256
156 (base32
157 "1isxx4jfmnh913jzhp8hhfngbk6dsg46f4kjpvvc56maj64jqqa7"))))
158 (build-system gnu-build-system)
159 (outputs '("out" ; programs, libraries, headers
160 "doc")) ; 94 MiB of HTML docs
161 (arguments
162 '(#:tests? #f ; no check target available
163 #:disallowed-references ("doc")
164 #:phases
165 (alist-replace
166 'configure
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")))
174
175 (zero?
176 (system* "./dist/configure"
177 (string-append "--prefix=" out)
178 (string-append "CONFIG_SHELL=" (which "bash"))
179 (string-append "SHELL=" (which "bash"))
180
181 ;; Remove 7 MiB of .a files.
182 "--disable-static"
183
184 ;; The compatibility mode is needed by some packages,
185 ;; notably iproute2.
186 "--enable-compat185"
187
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.
191 "--enable-cxx"))))
192 %standard-phases)))
193 (synopsis "Berkeley database")
194 (description
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."))
199 (home-page
200 "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html")))
201
202 (define-public bdb-5.3
203 (package (inherit bdb)
204 (name "bdb")
205 (version "5.3.28")
206 (source (origin
207 (method url-fetch)
208 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
209 version ".tar.gz"))
210 (sha256
211 (base32
212 "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))))))
213
214 (define-public leveldb
215 (package
216 (name "leveldb")
217 (version "1.19")
218 (source (origin
219 (method url-fetch)
220 (uri (string-append "https://github.com/google/leveldb"
221 "/archive/v" version ".tar.gz"))
222 (file-name (string-append name "-" version ".tar.gz"))
223 (sha256
224 (base32
225 "00jjgs9xlwycfkg0xd7n1rj6v9zrx7xc7hann6zalrjyhap18ykx"))))
226 (build-system gnu-build-system)
227 (arguments
228 '(#:make-flags (list "CC=gcc")
229 #:phases
230 (modify-phases %standard-phases
231 (delete 'configure)
232 (replace 'install
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)
242 #t))))))
243 (inputs
244 `(("snappy" ,snappy)))
245 (home-page "http://leveldb.org/")
246 (synopsis "Fast key-value storage library")
247 (description
248 "LevelDB is a fast key-value storage library that provides an ordered
249 mapping from string keys to string values.")
250 (license bsd-3)))
251
252 (define-public mysql
253 (package
254 (name "mysql")
255 (version "5.7.17")
256 (source (origin
257 (method url-fetch)
258 (uri (list (string-append
259 "http://dev.mysql.com/get/Downloads/MySQL-"
260 (version-major+minor version) "/"
261 name "-" version ".tar.gz")
262 (string-append
263 "http://downloads.mysql.com/archives/get/file/"
264 name "-" version ".tar.gz")))
265 (sha256
266 (base32
267 "0lcn9cm36n14g22bcppq5vf4nxbrl3khvlsp9hsixqdfb3l27gyf"))))
268 (build-system cmake-build-system)
269 (arguments
270 `(#:configure-flags
271 '("-DBUILD_CONFIG=mysql_release"
272 "-DWITH_SSL=system"
273 "-DWITH_ZLIB=system"
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
292 (add-after
293 'unpack 'patch-boost-version
294 (lambda _
295 ;; Mysql wants boost-1.59.0 specifically
296 (substitute* "cmake/boost.cmake"
297 (("59")
298 ,(match (string-split (package-version boost) #\.)
299 ((_ minor . _) minor))))))
300 (add-after
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
305 ;; 14 MiB each.
306 (for-each delete-file
307 (find-files (string-append out "/bin")
308 "_embedded$"))
309 #t))))))
310 (native-inputs
311 `(("bison" ,bison)
312 ("perl" ,perl)))
313 (inputs
314 `(("boost" ,boost)
315 ("libaio" ,libaio)
316 ("ncurses" ,ncurses)
317 ("openssl" ,openssl)
318 ("zlib" ,zlib)))
319 (home-page "http://www.mysql.com/")
320 (synopsis "Fast, easy to use, and popular database")
321 (description
322 "MySQL is a fast, reliable, and easy to use relational database
323 management system that supports the standardized Structured Query
324 Language.")
325 (license gpl2)))
326
327 (define-public mariadb
328 (package
329 (name "mariadb")
330 (version "10.1.21")
331 (source (origin
332 (method url-fetch)
333 (uri (string-append "https://downloads.mariadb.org/f/"
334 name "-" version "/source/"
335 name "-" version ".tar.gz"))
336 (sha256
337 (base32
338 "144lcm5awcf0k6a7saqfr4p2kg8r5wbdhdm4cmn2m8hyg1an70as"))))
339 (build-system cmake-build-system)
340 (arguments
341 '(#:configure-flags
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")
357 #:phases
358 (modify-phases %standard-phases
359 (add-before
360 'configure 'pre-configure
361 (lambda _
362 (setenv "CONFIG_SHELL" (which "sh"))
363 #t))
364 (add-after
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")
370 (("basedir=\"\"")
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")))))))))
377 (native-inputs
378 `(("bison" ,bison)
379 ("perl" ,perl)))
380 (inputs
381 `(("jemalloc" ,jemalloc)
382 ("libaio" ,libaio)
383 ("libxml2" ,libxml2)
384 ("ncurses" ,ncurses)
385 ("openssl" ,openssl)
386 ("pcre" ,pcre)
387 ("zlib" ,zlib)))
388 (home-page "https://mariadb.org/")
389 (synopsis "SQL database server")
390 (description
391 "MariaDB is a multi-user and multi-threaded SQL database server, designed
392 as a drop-in replacement of MySQL.")
393 (license gpl2)))
394
395 (define-public postgresql
396 (package
397 (name "postgresql")
398 (version "9.5.5")
399 (source (origin
400 (method url-fetch)
401 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
402 version "/postgresql-" version ".tar.bz2"))
403 (sha256
404 (base32
405 "157kf6mdazmxfmd11f0akya2xcz6sfgprn7yqc26dpklps855ih2"))))
406 (build-system gnu-build-system)
407 (arguments
408 `(#:phases
409 (modify-phases %standard-phases
410 (add-before 'configure 'patch-/bin/sh
411 (lambda _
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")))
416 #t)))))
417 (inputs
418 `(("readline" ,readline)
419 ("zlib" ,zlib)))
420 (home-page "https://www.postgresql.org/")
421 (synopsis "Powerful object-relational database system")
422 (description
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"))))
430
431 (define-public qdbm
432 (package
433 (name "qdbm")
434 (version "1.8.78")
435 (source
436 (origin
437 (method url-fetch)
438 (uri (string-append "http://fallabs.com/" name "/"
439 name "-" version ".tar.gz"))
440 (sha256
441 (base32
442 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
443 (build-system gnu-build-system)
444 (arguments
445 `( #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
446 (assoc-ref %outputs "out")
447 "/lib"))))
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+)))
457
458 (define-public recutils
459 (package
460 (name "recutils")
461 (version "1.7")
462 (source (origin
463 (method url-fetch)
464 (uri (string-append "mirror://gnu/recutils/recutils-"
465 version ".tar.gz"))
466 (sha256
467 (base32
468 "0cdwa4094x3yx7vn98xykvnlp9rngvd58d19vs3vh5hrvggccg93"))))
469 (build-system gnu-build-system)
470
471 ;; Running tests in parallel leads to test failures and crashes in
472 ;; torture/utils.
473 (arguments '(#:parallel-tests? #f
474 #:configure-flags
475 (list (string-append "--with-bash-headers="
476 (assoc-ref %build-inputs "bash:include")
477 "/include/bash"))
478
479 #:phases (modify-phases %standard-phases
480 (add-before 'build 'set-bash4.4-header-location
481 (lambda _
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 "
488 rest))
489
490 ;; Install to PREFIX/lib/bash to match Bash
491 ;; 4.4's search path.
492 (("^libdir = .*$")
493 "libdir = @libdir@/bash\n"))
494 #t)))))
495
496 (native-inputs `(("emacs" ,emacs-minimal)
497 ("bc" ,bc)
498 ("bash:include" ,bash "include")
499 ("libuuid" ,util-linux)))
500
501 ;; TODO: Add more optional inputs.
502 (inputs `(("curl" ,curl)
503 ("libgcrypt" ,libgcrypt)
504 ("check" ,check)))
505 (synopsis "Manipulate plain text files as databases")
506 (description
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.")
512 (license gpl3+)
513 (home-page "http://www.gnu.org/software/recutils/")))
514
515 (define-public rocksdb
516 (package
517 (name "rocksdb")
518 (version "5.0.2")
519 (source (origin
520 (method url-fetch)
521 (uri (string-append "https://github.com/facebook/rocksdb"
522 "/archive/v" version ".tar.gz"))
523 (file-name (string-append name "-" version ".tar.gz"))
524 (sha256
525 (base32
526 "1jj8b50w8jr3bnyjzk2hmlzq9x49yihjilx3xlq2rfdx3q9x4fay"))
527 (modules '((guix build utils)))
528 (snippet
529 '(begin
530 ;; TODO: unbundle gtest.
531 (delete-file "build_tools/gnu_parallel")
532 #t))))
533 (build-system gnu-build-system)
534 (arguments
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")))
541 #:phases
542 (modify-phases %standard-phases
543 (add-after 'unpack 'patch-Makefile
544 (lambda _
545 (substitute* "Makefile"
546 (("build_tools/gnu_parallel") "parallel")
547 (("#!/bin/sh") (string-append "#!" (which "sh"))))
548 #t))
549 (delete 'configure)
550 (add-before 'check 'disable-failing-tests
551 (lambda _
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:]]+\\\\") "\\"))
556 #t))
557 (add-after
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)
574 (delete-file file))
575 (find-files lib "\\.l?a$"))
576 #t))))))
577 (native-inputs
578 `(("parallel" ,parallel)
579 ("perl" ,perl)
580 ("procps" ,procps)
581 ("python" ,python-2)))
582 (inputs
583 `(("bzip2" ,bzip2)
584 ("gflags" ,gflags)
585 ("jemalloc" ,jemalloc)
586 ("lz4" ,lz4)
587 ("snappy" ,snappy)
588 ("zlib" ,zlib)))
589 (home-page "http://rocksdb.org/")
590 (synopsis "Persistent key-value store for fast storage")
591 (description
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))))
601
602 (define-public sparql-query
603 (package
604 (name "sparql-query")
605 (version "1.1")
606 (source (origin
607 (method url-fetch)
608 (uri (string-append "https://github.com/tialaramex/"
609 name "/archive/" version ".tar.gz"))
610 (sha256
611 (base32 "0yq3k20472rv8npcc420q9ab6idy584g5y0q501d360k5q0ggr8w"))
612 (file-name (string-append name "-" version ".tar.gz"))))
613 (build-system gnu-build-system)
614 (inputs
615 `(("readline" ,readline)
616 ("ncurses" ,ncurses)
617 ("glib" ,glib)
618 ("libxml2" ,libxml2)
619 ("curl" ,curl)))
620 (native-inputs
621 `(("pkg-config" ,pkg-config)))
622 (arguments
623 `(#:make-flags '("CC=gcc")
624 #:phases
625 (modify-phases %standard-phases
626 (delete 'configure)
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
630 (lambda _
631 (substitute* "Makefile"
632 (("^gitrev :=.*$")
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
636 ;; instead.
637 (replace 'install
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")))))
645 (replace 'check
646 (lambda* (#:key make-flags #:allow-other-keys)
647 (and
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+))))
662
663 (define-public sqlite
664 (package
665 (name "sqlite")
666 (version "3.16.2")
667 (source (origin
668 (method url-fetch)
669 (uri (let ((numeric-version
670 (match (string-split version #\.)
671 ((first-digit other-digits ...)
672 (string-append first-digit
673 (string-pad-right
674 (string-concatenate
675 (map (cut string-pad <> 2 #\0)
676 other-digits))
677 6 #\0))))))
678 (string-append "https://sqlite.org/2017/sqlite-autoconf-"
679 numeric-version ".tar.gz")))
680 (sha256
681 (base32
682 "059n4s9qd35qpbd4g29y9ay99a6f68ad7k65g430rxb6jcz0rk35"))))
683 (build-system gnu-build-system)
684 (inputs `(("readline" ,readline)))
685 (arguments
686 `(#:configure-flags
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")
695 (description
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)))
701
702 (define-public tdb
703 (package
704 (name "tdb")
705 (version "1.3.11")
706 (source (origin
707 (method url-fetch)
708 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
709 version ".tar.gz"))
710 (sha256
711 (base32
712 "0i1l38h0vyck6zkcj4fn2l03spadlmyr1qa1xpdp9dy2ccbm3s1r"))))
713 (build-system gnu-build-system)
714 (arguments
715 '(#:phases
716 (modify-phases %standard-phases
717 (replace 'configure
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)))))))))
724 (native-inputs
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")
732 (description
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
736 extremely small.")
737 (license lgpl3+)))
738
739 (define-public perl-dbi
740 (package
741 (name "perl-dbi")
742 (version "1.636")
743 (source (origin
744 (method url-fetch)
745 (uri (string-append
746 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
747 version ".tar.gz"))
748 (sha256
749 (base32
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))))
756
757 (define-public perl-dbix-class
758 (package
759 (name "perl-dbix-class")
760 (version "0.082840")
761 (source
762 (origin
763 (method url-fetch)
764 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
765 "DBIx-Class-" version ".tar.gz"))
766 (sha256
767 (base32
768 "1vw1f756g8m5hq11nqf5dk2cw2y4mqq91ca5p75fn5g3fp8syja0"))))
769 (build-system perl-build-system)
770 (native-inputs
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)))
777 (propagated-inputs
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))))
810
811 (define-public perl-dbix-class-cursor-cached
812 (package
813 (name "perl-dbix-class-cursor-cached")
814 (version "1.001004")
815 (source
816 (origin
817 (method url-fetch)
818 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
819 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
820 (sha256
821 (base32
822 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
823 (build-system perl-build-system)
824 (native-inputs
825 `(("perl-cache-cache" ,perl-cache-cache)
826 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
827 (propagated-inputs
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))))
835
836 (define-public perl-dbix-class-introspectablem2m
837 (package
838 (name "perl-dbix-class-introspectablem2m")
839 (version "0.001002")
840 (source
841 (origin
842 (method url-fetch)
843 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
844 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
845 (sha256
846 (base32
847 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
848 (build-system perl-build-system)
849 (propagated-inputs
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))))
860
861 (define-public perl-dbix-class-schema-loader
862 (package
863 (name "perl-dbix-class-schema-loader")
864 (version "0.07046")
865 (source
866 (origin
867 (method url-fetch)
868 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
869 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
870 (sha256
871 (base32
872 "08cgn0dx42y9xsxas9np7s55a7qmy4kf6sfmx0jmk4hryvbapml3"))))
873 (build-system perl-build-system)
874 (native-inputs
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)))
888 (propagated-inputs
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))))
915
916 (define-public perl-dbd-pg
917 (package
918 (name "perl-dbd-pg")
919 (version "3.5.1")
920 (source
921 (origin
922 (method url-fetch)
923 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
924 "DBD-Pg-" version ".tar.gz"))
925 (sha256
926 (base32
927 "0z0kf1kjgbi5f6nr63i2fnrx7629d9lvxg1q8sficwb3zdf1ggzx"))))
928 (build-system perl-build-system)
929 (native-inputs
930 `(("perl-dbi" ,perl-dbi)))
931 (propagated-inputs
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))))
939
940 (define-public perl-dbd-mysql
941 (package
942 (name "perl-dbd-mysql")
943 (version "4.041")
944 (source
945 (origin
946 (method url-fetch)
947 (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
948 "DBD-mysql-" version ".tar.gz"))
949 (sha256
950 (base32
951 "0h4h6zwzj8fwh9ljb8svnsa0a3ch4p10hp59kpdibdb4qh8xwxs7"))))
952 (build-system perl-build-system)
953 ;; Tests require running MySQL server
954 (arguments `(#:tests? #f))
955 (propagated-inputs
956 `(("perl-dbi" ,perl-dbi)
957 ("mysql" ,mysql)))
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))))
963
964 (define-public perl-dbd-sqlite
965 (package
966 (name "perl-dbd-sqlite")
967 (version "1.52")
968 (source (origin
969 (method url-fetch)
970 (uri (string-append
971 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
972 version ".tar.gz"))
973 (sha256
974 (base32
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")))
986
987 (define-public perl-sql-abstract
988 (package
989 (name "perl-sql-abstract")
990 (version "1.81")
991 (source
992 (origin
993 (method url-fetch)
994 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
995 "SQL-Abstract-" version ".tar.gz"))
996 (sha256
997 (base32
998 "17sgwq3mvqjhv3b77cnvrq60xgp8harjhlnvpwmxc914rqc5ckaz"))))
999 (build-system perl-build-system)
1000 (native-inputs
1001 `(("perl-test-deep" ,perl-test-deep)
1002 ("perl-test-exception" ,perl-test-exception)
1003 ("perl-test-warn" ,perl-test-warn)))
1004 (propagated-inputs
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))))
1018
1019 (define-public perl-sql-splitstatement
1020 (package
1021 (name "perl-sql-splitstatement")
1022 (version "1.00020")
1023 (source
1024 (origin
1025 (method url-fetch)
1026 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
1027 "SQL-SplitStatement-" version ".tar.gz"))
1028 (sha256
1029 (base32
1030 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
1031 (build-system perl-build-system)
1032 (native-inputs
1033 `(("perl-test-exception" ,perl-test-exception)))
1034 (propagated-inputs
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))))
1044
1045 (define-public perl-sql-tokenizer
1046 (package
1047 (name "perl-sql-tokenizer")
1048 (version "0.24")
1049 (source
1050 (origin
1051 (method url-fetch)
1052 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
1053 "SQL-Tokenizer-" version ".tar.gz"))
1054 (sha256
1055 (base32
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
1062 valid SQL query.")
1063 (license (package-license perl))))
1064
1065 (define-public unixodbc
1066 (package
1067 (name "unixodbc")
1068 (version "2.3.4")
1069 (source (origin
1070 (method url-fetch)
1071 (uri
1072 (string-append
1073 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
1074 version ".tar.gz"))
1075 (sha256
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
1081 Driver.")
1082 (license lgpl2.1+)
1083 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
1084 (home-page "http://www.unixodbc.org")))
1085
1086 (define-public unqlite
1087 (package
1088 (name "unqlite")
1089 (version "1.1.6")
1090 (source (origin
1091 (method url-fetch)
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/"
1095 "download/v1.0.0/"
1096 "unqlite-unofficial-" version ".tar.gz"))
1097 (sha256
1098 (base32
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")
1104 (description
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.")
1110 (license bsd-2)))
1111
1112 (define-public redis
1113 (package
1114 (name "redis")
1115 (version "3.2.4")
1116 (source (origin
1117 (method url-fetch)
1118 (uri (string-append "http://download.redis.io/releases/redis-"
1119 version".tar.gz"))
1120 (sha256
1121 (base32
1122 "1wb9jd692a0y52bkkxr6815kk4g039mirjdrvqx24265lv2l5l1a"))))
1123 (build-system gnu-build-system)
1124 (arguments
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"
1129 "MALLOC=libc"
1130 "LDFLAGS=-ldl"
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/")
1138 (license bsd-3)))
1139
1140 (define-public kyotocabinet
1141 (package
1142 (name "kyotocabinet")
1143 (version "1.2.76")
1144 (source (origin
1145 (method url-fetch)
1146 (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
1147 name "-" version ".tar.gz"))
1148 (sha256
1149 (base32
1150 "0g6js20x7vnpq4p8ghbw3mh9wpqksya9vwhzdx6dnlf354zjsal1"))))
1151 (build-system gnu-build-system)
1152 (arguments
1153 `(#:configure-flags
1154 (list
1155 (string-append "LDFLAGS=-Wl,-rpath="
1156 (assoc-ref %outputs "out") "/lib"))))
1157 (inputs `(("zlib" ,zlib)))
1158 (home-page "http://fallabs.com/kyotocabinet/")
1159 (synopsis
1160 "Kyoto Cabinet is a modern implementation of the DBM database")
1161 (description
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.")
1165 (license gpl3+)))
1166
1167 (define-public wiredtiger
1168 (package
1169 (name "wiredtiger")
1170 (version "2.9.1")
1171 (source (origin
1172 (method url-fetch)
1173 (uri (string-append
1174 "http://source.wiredtiger.com/releases/wiredtiger-"
1175 version ".tar.bz2"))
1176 (sha256
1177 (base32
1178 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
1179 (build-system gnu-build-system)
1180 (arguments
1181 '(#:configure-flags '("--enable-lz4" "--enable-zlib")
1182 #:phases
1183 (modify-phases %standard-phases
1184 (add-before 'check 'disable-test/fops
1185 (lambda _
1186 ;; XXX: timed out after 3600 seconds of silence
1187 (substitute* "Makefile"
1188 (("test/fops") ""))
1189 #t)))))
1190 (inputs
1191 `(("lz4" ,lz4)
1192 ("zlib" ,zlib)))
1193 (home-page "http://source.wiredtiger.com/")
1194 (synopsis "NoSQL data engine")
1195 (description
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"))))
1204
1205 (define-public perl-db-file
1206 (package
1207 (name "perl-db-file")
1208 (version "1.838")
1209 (source
1210 (origin
1211 (method url-fetch)
1212 (uri (string-append
1213 "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
1214 version
1215 ".tar.gz"))
1216 (sha256
1217 (base32
1218 "0yp5d5zr8dk9g6xdh7ygi5bq63q7nxvhd58dk2i3ki4nb7yv2yh9"))))
1219 (build-system perl-build-system)
1220 (inputs `(("bdb" ,bdb)))
1221 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
1222 (arguments
1223 `(#:phases (modify-phases %standard-phases
1224 (add-before
1225 'configure 'modify-config.in
1226 (lambda* (#:key inputs #:allow-other-keys)
1227 (substitute* "config.in"
1228 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
1229 #t)))))
1230 (home-page "http://search.cpan.org/dist/DB_File")
1231 (synopsis
1232 "Perl5 access to Berkeley DB version 1.x")
1233 (description
1234 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
1235 (license (package-license perl))))
1236
1237 (define-public lmdb
1238 (package
1239 (name "lmdb")
1240 (version "0.9.18")
1241 (source (origin
1242 (method url-fetch)
1243 (uri (string-append "https://github.com/LMDB/lmdb/archive/"
1244 "LMDB_" version ".tar.gz"))
1245 (sha256
1246 (base32
1247 "12crvzxky8in99ibh22k4ppmkgqs28yy3v7yy944za7fsrqv8dfx"))))
1248 (build-system gnu-build-system)
1249 (arguments
1250 `(#:test-target "test"
1251 #:phases
1252 (modify-phases %standard-phases
1253 (replace 'configure
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")))
1259 #t)))))
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)))
1264
1265 (define-public libpqxx
1266 (package
1267 (name "libpqxx")
1268 (version "4.0.1")
1269 (source (origin
1270 (method url-fetch)
1271 (uri (string-append
1272 "http://pqxx.org/download/software/libpqxx/"
1273 name "-" version ".tar.gz"))
1274 (sha256
1275 (base32
1276 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
1277 (build-system gnu-build-system)
1278 (native-inputs
1279 `(("python" ,python-2)))
1280 (inputs `(("postgresql" ,postgresql)))
1281 (arguments
1282 `(#:tests? #f)) ; # FAIL: 1
1283 (synopsis "C++ connector for PostgreSQL")
1284 (description
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)))
1290
1291 (define-public python-peewee
1292 (package
1293 (name "python-peewee")
1294 (version "2.8.3")
1295 (source
1296 (origin
1297 (method url-fetch)
1298 (uri (pypi-uri "peewee" version))
1299 (sha256
1300 (base32
1301 "1605bk11s7aap2q4qyba93rx7yfh8b11kk0cqi08z8klx2iar8yd"))))
1302 (build-system python-build-system)
1303 (arguments
1304 `(#:tests? #f)) ; Fails to import test data
1305 (native-inputs
1306 `(("python-cython" ,python-cython)))
1307 (home-page "https://github.com/coleifer/peewee/")
1308 (synopsis "Small object-relational mapping utility")
1309 (description
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)))
1316
1317 (define-public python2-peewee
1318 (package-with-python2 python-peewee))
1319
1320 (define-public sqlcipher
1321 (package
1322 (name "sqlcipher")
1323 (version "3.3.1")
1324 (source
1325 (origin
1326 (method url-fetch)
1327 (uri (string-append "https://github.com/sqlcipher/" name
1328 "/archive/v" version ".tar.gz"))
1329 (sha256
1330 (base32 "1gv58dlbpzrmznly52yqbxgvii0ib88zr3aszla1bsypwjr6flff"))
1331 (file-name (string-append name "-" version ".tar.gz"))))
1332 (build-system gnu-build-system)
1333 (inputs
1334 `(("libcrypto" ,openssl)
1335 ("libtcl8.6" ,tcl))) ; required for running the tests
1336 (native-inputs
1337 `(("tcl" ,tcl)))
1338 (arguments
1339 '(#:configure-flags
1340 '("--enable-tempstore=yes"
1341 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
1342 "LDFLAGS=-lcrypto -ltcl8.6"
1343 "--disable-tcl")
1344 ;; tests cannot be run from the Makefile
1345 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
1346 #:test-target "testfixture"
1347 #:phases
1348 (modify-phases %standard-phases
1349 (add-before 'check 'build-test-runner
1350 (assoc-ref %standard-phases 'check))
1351 (replace 'check
1352 (lambda _
1353 (zero?
1354 (system* "./testfixture" "test/crypto.test")))))))
1355 (home-page "https://www.zetetic.net/sqlcipher/")
1356 (synopsis
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
1362 development.")
1363 ;; The source files
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))))