gnu: youtube-dl: Update to 2017.02.07.
[jackhill/guix/guix.git] / gnu / packages / databases.scm
CommitLineData
5f96f303 1;;; GNU Guix --- Functional package management for GNU
ff1f39e3 2;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
b86c013c 3;;; Copyright © 2012, 2014, 2015 Andreas Enge <andreas@enge.fr>
5f96f303 4;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
218a2106 5;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
8047d13d 6;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
e61fd0f0 7;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
77631745 8;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
b747a9db 9;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
b2476513 10;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
679b535b 11;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
4c6aa73b 12;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
0e1b262e 13;;; Copyright © 2016 David Craven <david@craven.ch>
fe71eee0 14;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
62ea44fc 15;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
b9f771a7 16;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
259a94e9 17;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
5f96f303
LC
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)
4c6aa73b
RJ
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages avahi)
b747a9db 38 #:use-module (gnu packages bash)
23bbd7dd 39 #:use-module (gnu packages boost)
62ea44fc 40 #:use-module (gnu packages crypto)
4c6aa73b
RJ
41 #:use-module (gnu packages gettext)
42 #:use-module (gnu packages glib)
5f96f303 43 #:use-module (gnu packages perl)
708155df 44 #:use-module (gnu packages language)
5f96f303 45 #:use-module (gnu packages linux)
62ea44fc 46 #:use-module (gnu packages tcl)
cc2b77df 47 #:use-module (gnu packages tls)
5f96f303
LC
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)
4c6aa73b 55 #:use-module (gnu packages cyrus-sasl)
5f96f303 56 #:use-module (gnu packages gnupg)
db60b1d9 57 #:use-module (gnu packages python)
d3c6ad0a 58 #:use-module (gnu packages parallel)
77631745 59 #:use-module (gnu packages pcre)
4c6aa73b 60 #:use-module (gnu packages pkg-config)
d3c6ad0a 61 #:use-module (gnu packages popt)
4c6aa73b 62 #:use-module (gnu packages rdf)
77631745
SB
63 #:use-module (gnu packages xml)
64 #:use-module (gnu packages bison)
65 #:use-module (gnu packages jemalloc)
5f96f303 66 #:use-module ((guix licenses)
6242b314 67 #:select (gpl2 gpl3 gpl3+ lgpl2.1+ lgpl3+ x11-style non-copyleft
a24fda81 68 agpl3+ bsd-2 bsd-3 public-domain asl2.0))
0e1b262e 69 #:use-module ((guix licenses) #:prefix license:)
5f96f303
LC
70 #:use-module (guix packages)
71 #:use-module (guix download)
72 #:use-module (guix build-system gnu)
274da61d 73 #:use-module (guix build-system perl)
4d98bfaf 74 #:use-module (guix build-system python)
77631745 75 #:use-module (guix build-system cmake)
329d13b8 76 #:use-module (guix utils)
5f96f303
LC
77 #:use-module (srfi srfi-26)
78 #:use-module (ice-9 match))
79
4c6aa73b
RJ
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)
b94a6ca0 98 ("gettext" ,gettext-minimal)
4c6aa73b 99 ("libtool" ,libtool)
74c8b174 100 ("pcre" ,pcre "bin") ;for 'pcre-config'
4c6aa73b
RJ
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)
4c6aa73b
RJ
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
122either single machines or networked clusters.")
123 (license gpl3+)))
124
b416aadf
LC
125(define-public gdbm
126 (package
127 (name "gdbm")
2135d1eb 128 (version "1.12")
b416aadf
LC
129 (source (origin
130 (method url-fetch)
131 (uri (string-append "mirror://gnu/gdbm/gdbm-"
132 version ".tar.gz"))
133 (sha256
134 (base32
2135d1eb 135 "1smwz4x5qa4js0zf1w3asq6z7mh20zlgwbh2bk5dczw6xrk22yyr"))))
b416aadf
LC
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
143store key/value pairs in a file in a manner similar to the Unix dbm library
144and provides interfaces to the traditional file format.")
145 (license gpl3+)))
146
5f96f303
LC
147(define-public bdb
148 (package
149 (name "bdb")
18e681bf 150 (version "6.2.23")
5f96f303
LC
151 (source (origin
152 (method url-fetch)
18e681bf
EF
153 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
154 version ".tar.gz"))
155 (sha256
156 (base32
157 "1isxx4jfmnh913jzhp8hhfngbk6dsg46f4kjpvvc56maj64jqqa7"))))
5f96f303
LC
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
ff1f39e3 163 #:disallowed-references ("doc")
5bef7749
AE
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")))
5f96f303 174
5bef7749
AE
175 (zero?
176 (system* "./dist/configure"
177 (string-append "--prefix=" out)
178 (string-append "CONFIG_SHELL=" (which "bash"))
179 (string-append "SHELL=" (which "bash"))
5f96f303 180
0e50d521
LC
181 ;; Remove 7 MiB of .a files.
182 "--disable-static"
183
5bef7749
AE
184 ;; The compatibility mode is needed by some packages,
185 ;; notably iproute2.
b86c013c
AE
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"))))
5f96f303 192 %standard-phases)))
35b9e423 193 (synopsis "Berkeley database")
5f96f303
LC
194 (description
195 "Berkeley DB is an embeddable database allowing developers the choice of
196SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
a24fda81
MB
197 ;; Starting with version 6, BDB is distributed under AGPL3. Many individual
198 ;; files are covered by the 3-clause BSD license.
199 (license (list agpl3+ bsd-3))
5f96f303
LC
200 (home-page
201 "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html")))
202
557fa39c
EF
203(define-public bdb-5.3
204 (package (inherit bdb)
205 (name "bdb")
206 (version "5.3.28")
a24fda81
MB
207 (license (non-copyleft "file://LICENSE"
208 "See LICENSE in the distribution."))
557fa39c
EF
209 (source (origin
210 (method url-fetch)
211 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
212 version ".tar.gz"))
213 (sha256
214 (base32
215 "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))))))
216
b9f771a7
MB
217(define-public leveldb
218 (package
219 (name "leveldb")
220 (version "1.19")
221 (source (origin
222 (method url-fetch)
223 (uri (string-append "https://github.com/google/leveldb"
224 "/archive/v" version ".tar.gz"))
225 (file-name (string-append name "-" version ".tar.gz"))
226 (sha256
227 (base32
228 "00jjgs9xlwycfkg0xd7n1rj6v9zrx7xc7hann6zalrjyhap18ykx"))))
229 (build-system gnu-build-system)
230 (arguments
231 '(#:make-flags (list "CC=gcc")
232 #:phases
233 (modify-phases %standard-phases
234 (delete 'configure)
235 (replace 'install
236 ;; There is no install target, so we do it here.
237 (lambda* (#:key outputs #:allow-other-keys)
238 (let* ((out (assoc-ref outputs "out"))
239 (lib (string-append out "/lib"))
240 (include (string-append out "/include")))
241 (for-each (lambda (file)
242 (install-file file lib))
243 (find-files "out-shared" "^libleveldb\\.so.*$"))
244 (copy-recursively "include" include)
245 #t))))))
246 (inputs
247 `(("snappy" ,snappy)))
248 (home-page "http://leveldb.org/")
249 (synopsis "Fast key-value storage library")
250 (description
251 "LevelDB is a fast key-value storage library that provides an ordered
252mapping from string keys to string values.")
253 (license bsd-3)))
254
5f96f303
LC
255(define-public mysql
256 (package
257 (name "mysql")
e63b19f5 258 (version "5.7.17")
5f96f303
LC
259 (source (origin
260 (method url-fetch)
23bbd7dd
EF
261 (uri (list (string-append
262 "http://dev.mysql.com/get/Downloads/MySQL-"
263 (version-major+minor version) "/"
264 name "-" version ".tar.gz")
265 (string-append
266 "http://downloads.mysql.com/archives/get/file/"
267 name "-" version ".tar.gz")))
5f96f303
LC
268 (sha256
269 (base32
e63b19f5 270 "0lcn9cm36n14g22bcppq5vf4nxbrl3khvlsp9hsixqdfb3l27gyf"))))
329d13b8
SB
271 (build-system cmake-build-system)
272 (arguments
69419655 273 `(#:configure-flags
329d13b8
SB
274 '("-DBUILD_CONFIG=mysql_release"
275 "-DWITH_SSL=system"
276 "-DWITH_ZLIB=system"
277 "-DDEFAULT_CHARSET=utf8"
278 "-DDEFAULT_COLLATION=utf8_general_ci"
279 "-DMYSQL_DATADIR=/var/lib/mysql"
280 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
281 "-DINSTALL_INFODIR=share/mysql/docs"
282 "-DINSTALL_MANDIR=share/man"
283 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
284 "-DINSTALL_SCRIPTDIR=bin"
285 "-DINSTALL_INCLUDEDIR=include/mysql"
286 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
287 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
288 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
289 "-DINSTALL_DOCDIR=share/mysql/docs"
290 "-DINSTALL_SHAREDIR=share/mysql"
291 ;; Get rid of test data.
292 "-DINSTALL_MYSQLTESTDIR="
3f289db6
LC
293 "-DINSTALL_SQLBENCHDIR=")
294 #:phases (modify-phases %standard-phases
295 (add-after
23bbd7dd
EF
296 'unpack 'patch-boost-version
297 (lambda _
298 ;; Mysql wants boost-1.59.0 specifically
299 (substitute* "cmake/boost.cmake"
69419655
EB
300 (("59")
301 ,(match (string-split (package-version boost) #\.)
302 ((_ minor . _) minor))))))
6a52df50
LC
303 (add-after
304 'install 'remove-extra-binaries
305 (lambda* (#:key outputs #:allow-other-keys)
306 (let ((out (assoc-ref outputs "out")))
307 ;; Remove the 3 *_embedded files, which weigh in at
308 ;; 14 MiB each.
309 (for-each delete-file
310 (find-files (string-append out "/bin")
311 "_embedded$"))
3f289db6 312 #t))))))
329d13b8
SB
313 (native-inputs
314 `(("bison" ,bison)
315 ("perl" ,perl)))
5f96f303 316 (inputs
23bbd7dd
EF
317 `(("boost" ,boost)
318 ("libaio" ,libaio)
319 ("ncurses" ,ncurses)
5f96f303 320 ("openssl" ,openssl)
23bbd7dd 321 ("zlib" ,zlib)))
5f96f303 322 (home-page "http://www.mysql.com/")
9e771e3b 323 (synopsis "Fast, easy to use, and popular database")
5f96f303
LC
324 (description
325 "MySQL is a fast, reliable, and easy to use relational database
326management system that supports the standardized Structured Query
327Language.")
328 (license gpl2)))
329
77631745
SB
330(define-public mariadb
331 (package
332 (name "mariadb")
10a87469 333 (version "10.1.21")
77631745
SB
334 (source (origin
335 (method url-fetch)
336 (uri (string-append "https://downloads.mariadb.org/f/"
337 name "-" version "/source/"
338 name "-" version ".tar.gz"))
339 (sha256
340 (base32
10a87469 341 "144lcm5awcf0k6a7saqfr4p2kg8r5wbdhdm4cmn2m8hyg1an70as"))))
77631745
SB
342 (build-system cmake-build-system)
343 (arguments
344 '(#:configure-flags
345 '("-DBUILD_CONFIG=mysql_release"
346 "-DDEFAULT_CHARSET=utf8"
347 "-DDEFAULT_COLLATION=utf8_general_ci"
348 "-DMYSQL_DATADIR=/var/lib/mysql"
349 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
350 "-DINSTALL_INFODIR=share/mysql/docs"
351 "-DINSTALL_MANDIR=share/man"
352 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
353 "-DINSTALL_SCRIPTDIR=bin"
354 "-DINSTALL_INCLUDEDIR=include/mysql"
355 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
356 "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
357 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
358 "-DINSTALL_DOCDIR=share/mysql/docs"
359 "-DINSTALL_SHAREDIR=share/mysql")
360 #:phases
361 (modify-phases %standard-phases
362 (add-before
363 'configure 'pre-configure
364 (lambda _
365 (setenv "CONFIG_SHELL" (which "sh"))
77631745
SB
366 #t))
367 (add-after
368 'install 'post-install
369 (lambda* (#:key outputs #:allow-other-keys)
370 (let* ((out (assoc-ref outputs "out"))
371 (test (assoc-ref outputs "test")))
372 (substitute* (string-append out "/bin/mysql_install_db")
373 (("basedir=\"\"")
374 (string-append "basedir=\"" out "\"")))
375 ;; Remove unneeded files for testing.
376 (with-directory-excursion out
377 (for-each delete-file-recursively
378 '("data" "mysql-test" "sql-bench"
379 "share/man/man1/mysql-test-run.pl.1")))))))))
380 (native-inputs
381 `(("bison" ,bison)
382 ("perl" ,perl)))
383 (inputs
384 `(("jemalloc" ,jemalloc)
385 ("libaio" ,libaio)
386 ("libxml2" ,libxml2)
387 ("ncurses" ,ncurses)
388 ("openssl" ,openssl)
389 ("pcre" ,pcre)
390 ("zlib" ,zlib)))
391 (home-page "https://mariadb.org/")
392 (synopsis "SQL database server")
393 (description
394 "MariaDB is a multi-user and multi-threaded SQL database server, designed
395as a drop-in replacement of MySQL.")
396 (license gpl2)))
397
5f96f303
LC
398(define-public postgresql
399 (package
400 (name "postgresql")
d887f420 401 (version "9.5.5")
5f96f303
LC
402 (source (origin
403 (method url-fetch)
dbeaf8f2 404 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
9020890b 405 version "/postgresql-" version ".tar.bz2"))
5f96f303
LC
406 (sha256
407 (base32
d887f420 408 "157kf6mdazmxfmd11f0akya2xcz6sfgprn7yqc26dpklps855ih2"))))
5f96f303 409 (build-system gnu-build-system)
dd213082
JD
410 (arguments
411 `(#:phases
412 (modify-phases %standard-phases
413 (add-before 'configure 'patch-/bin/sh
414 (lambda _
415 ;; Refer to the actual shell.
416 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
417 "src/bin/psql/command.c")
418 (("/bin/sh") (which "sh")))
419 #t)))))
5f96f303
LC
420 (inputs
421 `(("readline" ,readline)
422 ("zlib" ,zlib)))
d887f420 423 (home-page "https://www.postgresql.org/")
5f96f303
LC
424 (synopsis "Powerful object-relational database system")
425 (description
426 "PostgreSQL is a powerful object-relational database system. It is fully
427ACID compliant, has full support for foreign keys, joins, views, triggers, and
428stored procedures (in multiple languages). It includes most SQL:2008 data
429types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
430TIMESTAMP. It also supports storage of binary large objects, including
431pictures, sounds, or video.")
432 (license (x11-style "file://COPYRIGHT"))))
433
259a94e9
TD
434(define-public qdbm
435 (package
436 (name "qdbm")
437 (version "1.8.78")
438 (source
439 (origin
440 (method url-fetch)
441 (uri (string-append "http://fallabs.com/" name "/"
442 name "-" version ".tar.gz"))
443 (sha256
444 (base32
445 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
446 (build-system gnu-build-system)
447 (arguments
448 `( #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
449 (assoc-ref %outputs "out")
450 "/lib"))))
451 (home-page "http://fallabs.com/qdbm")
452 (synopsis "Key-value database")
453 (description "QDBM is a library of routines for managing a
454database. The database is a simple data file containing key-value
455pairs. Every key and value is serial bytes with variable length.
456Binary data as well as character strings can be used as a key or a
457value. There is no concept of data tables or data types. Records are
458organized in a hash table or B+ tree.")
459 (license license:lgpl2.1+)))
460
5f96f303
LC
461(define-public recutils
462 (package
463 (name "recutils")
464 (version "1.7")
465 (source (origin
466 (method url-fetch)
467 (uri (string-append "mirror://gnu/recutils/recutils-"
468 version ".tar.gz"))
469 (sha256
470 (base32
471 "0cdwa4094x3yx7vn98xykvnlp9rngvd58d19vs3vh5hrvggccg93"))))
472 (build-system gnu-build-system)
473
474 ;; Running tests in parallel leads to test failures and crashes in
475 ;; torture/utils.
b747a9db
LF
476 (arguments '(#:parallel-tests? #f
477 #:configure-flags
478 (list (string-append "--with-bash-headers="
479 (assoc-ref %build-inputs "bash:include")
c21af659
LC
480 "/include/bash"))
481
482 #:phases (modify-phases %standard-phases
483 (add-before 'build 'set-bash4.4-header-location
484 (lambda _
485 (substitute* "bash/Makefile.in"
486 ;; Adjust the header search path for Bash
487 ;; 4.4 in accordance with 'bash.pc'.
488 (("AM_CPPFLAGS = (.*)$" _ rest)
489 (string-append "AM_CPPFLAGS = "
490 "-I$(BASH_HEADERS)/include "
491 rest))
492
493 ;; Install to PREFIX/lib/bash to match Bash
494 ;; 4.4's search path.
495 (("^libdir = .*$")
496 "libdir = @libdir@/bash\n"))
497 #t)))))
5f96f303 498
b8fc3622 499 (native-inputs `(("emacs" ,emacs-minimal)
7ae7ca0e 500 ("bc" ,bc)
b747a9db 501 ("bash:include" ,bash "include")
b3546174 502 ("libuuid" ,util-linux)))
5f96f303
LC
503
504 ;; TODO: Add more optional inputs.
5f96f303
LC
505 (inputs `(("curl" ,curl)
506 ("libgcrypt" ,libgcrypt)
507 ("check" ,check)))
508 (synopsis "Manipulate plain text files as databases")
509 (description
510 "GNU Recutils is a set of tools and libraries for creating and
511manipulating text-based, human-editable databases. Despite being text-based,
512databases created with Recutils carry all of the expected features such as
c5779c93
LC
513unique fields, primary keys, time stamps and more. Many different field
514types are supported, as is encryption.")
5f96f303
LC
515 (license gpl3+)
516 (home-page "http://www.gnu.org/software/recutils/")))
517
d3c6ad0a
MB
518(define-public rocksdb
519 (package
520 (name "rocksdb")
521 (version "5.0.2")
522 (source (origin
523 (method url-fetch)
524 (uri (string-append "https://github.com/facebook/rocksdb"
525 "/archive/v" version ".tar.gz"))
526 (file-name (string-append name "-" version ".tar.gz"))
527 (sha256
528 (base32
529 "1jj8b50w8jr3bnyjzk2hmlzq9x49yihjilx3xlq2rfdx3q9x4fay"))
530 (modules '((guix build utils)))
531 (snippet
532 '(begin
533 ;; TODO: unbundle gtest.
534 (delete-file "build_tools/gnu_parallel")
535 #t))))
536 (build-system gnu-build-system)
537 (arguments
538 '(#:make-flags (list "CC=gcc"
539 ;; Make the resulting library position-independent so the
540 ;; static version can be included in shared objects.
541 "EXTRA_CXXFLAGS=-fPIC"
542 (string-append "INSTALL_PATH="
543 (assoc-ref %outputs "out")))
544 #:phases
545 (modify-phases %standard-phases
546 (add-after 'unpack 'patch-Makefile
547 (lambda _
548 (substitute* "Makefile"
549 (("build_tools/gnu_parallel") "parallel")
550 (("#!/bin/sh") (string-append "#!" (which "sh"))))
551 #t))
552 (delete 'configure)
553 (add-before 'check 'disable-failing-tests
554 (lambda _
555 (substitute* "Makefile"
556 ;; These tests reliably fail due to "Too many open files".
557 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
558 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
559 #t))
560 (add-after
561 'check 'build-release-libraries
562 ;; The 'check' target depends on the default target which is compiled
563 ;; with debug symbols. The 'install' target depends on shared and
564 ;; static release targets so we build them here for clarity.
565 ;; TODO: Add debug output.
566 (lambda* (#:key (make-flags '()) #:allow-other-keys)
567 ;; Prevent the build from adding machine-specific optimizations.
568 ;; This does not work if passed as a make flag...
569 (setenv "PORTABLE" "1")
570 (and (zero? (apply system* "make" "static_lib" make-flags))
571 (zero? (apply system* "make" "shared_lib" make-flags)))))
572 (add-after 'install 'delete-static-library
573 (lambda* (#:key outputs #:allow-other-keys)
574 (let* ((out (assoc-ref outputs "out"))
575 (lib (string-append out "/lib")))
576 (for-each (lambda (file)
577 (delete-file file))
578 (find-files lib "\\.l?a$"))
579 #t))))))
580 (native-inputs
581 `(("parallel" ,parallel)
582 ("perl" ,perl)
583 ("procps" ,procps)
584 ("python" ,python-2)))
585 (inputs
586 `(("bzip2" ,bzip2)
587 ("gflags" ,gflags)
588 ("jemalloc" ,jemalloc)
589 ("lz4" ,lz4)
590 ("snappy" ,snappy)
591 ("zlib" ,zlib)))
592 (home-page "http://rocksdb.org/")
593 (synopsis "Persistent key-value store for fast storage")
594 (description
595 "RocksDB is a library that forms the core building block for a fast
596key-value server, especially suited for storing data on flash drives. It
597has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
598between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
599(RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
600compactions, making it specially suitable for storing multiple terabytes of
601data in a single database. RocksDB is partially based on @code{LevelDB}.")
602 ;; RocksDB is BSD-3 and the JNI adapter is Apache 2.0.
603 (license (list bsd-3 asl2.0))))
604
b92d02d9
RJ
605(define-public sparql-query
606 (package
607 (name "sparql-query")
608 (version "1.1")
609 (source (origin
610 (method url-fetch)
611 (uri (string-append "https://github.com/tialaramex/"
612 name "/archive/" version ".tar.gz"))
613 (sha256
614 (base32 "0yq3k20472rv8npcc420q9ab6idy584g5y0q501d360k5q0ggr8w"))
615 (file-name (string-append name "-" version ".tar.gz"))))
616 (build-system gnu-build-system)
617 (inputs
618 `(("readline" ,readline)
619 ("ncurses" ,ncurses)
620 ("glib" ,glib)
621 ("libxml2" ,libxml2)
622 ("curl" ,curl)))
623 (native-inputs
624 `(("pkg-config" ,pkg-config)))
625 (arguments
626 `(#:make-flags '("CC=gcc")
627 #:phases
628 (modify-phases %standard-phases
629 (delete 'configure)
630 ;; The Makefile uses git to obtain versioning information. This phase
631 ;; substitutes the git invocation with the package version.
632 (add-after 'unpack 'remove-git-dependency
633 (lambda _
634 (substitute* "Makefile"
635 (("^gitrev :=.*$")
636 (string-append "gitrev = \"v" ,version "\"")))))
637 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
638 ;; This replacement does the same thing, except for using $PREFIX/bin
639 ;; instead.
640 (replace 'install
641 (lambda* (#:key outputs #:allow-other-keys)
642 (let* ((out (assoc-ref outputs "out"))
643 (bin (string-append out "/bin")))
644 (install-file "sparql-query" bin)
645 (system* "ln" "--symbolic"
646 (string-append bin "/sparql-query")
647 (string-append bin "/sparql-update")))))
648 (replace 'check
649 (lambda* (#:key make-flags #:allow-other-keys)
650 (and
651 (zero? (apply system* "make" `(,@make-flags "scan-test")))
652 (zero? (system "./scan-test"))))))))
653 (home-page "https://github.com/tialaramex/sparql-query/")
654 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
655 (description "Sparql-query is a command-line tool for accessing SPARQL
656endpoints over HTTP. It has been intentionally designed to 'feel' similar to
657tools for interrogating SQL databases. For example, you can enter a query over
658several lines, using a semi-colon at the end of a line to indicate the end of
659your query. It also supports readline so that you can more easily recall and
660edit previous queries, even across sessions. It can be used non-interactively,
661for example from a shell script.")
662 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
663 ;; others (like sparql-query.c) contain a GPLv2+ license header.
664 (license (list gpl3+))))
665
5f96f303
LC
666(define-public sqlite
667 (package
668 (name "sqlite")
a66a2a01 669 (version "3.14.1")
5f96f303
LC
670 (source (origin
671 (method url-fetch)
672 ;; TODO: Download from sqlite.org once this bug :
673 ;; http://lists.gnu.org/archive/html/bug-guile/2013-01/msg00027.html
674 ;; has been fixed.
675 (uri (let ((numeric-version
676 (match (string-split version #\.)
677 ((first-digit other-digits ...)
678 (string-append first-digit
679 (string-pad-right
680 (string-concatenate
681 (map (cut string-pad <> 2 #\0)
682 other-digits))
683 6 #\0))))))
42e66649
SB
684 (list
685 (string-append
75710da6
LC
686 "https://fossies.org/linux/misc/sqlite-autoconf-"
687 numeric-version ".tar.gz")
42e66649 688 (string-append
75710da6
LC
689 "http://distfiles.gentoo.org/distfiles/"
690 "/sqlite-autoconf-" numeric-version ".tar.gz"))
6f96706d
LC
691
692 ;; XXX: As of 2015-09-08, SourceForge is squatting the URL
693 ;; below, returning 200 and showing an advertising page.
694 ;; (string-append
695 ;; "mirror://sourceforge/sqlite.mirror/SQLite%20" version
696 ;; "/sqlite-autoconf-" numeric-version ".tar.gz")
697 ))
5f96f303
LC
698 (sha256
699 (base32
a66a2a01 700 "19j73j44akqgc6m82wm98yvnmm3mfzmfqr8mp3n7n080d53q4wdw"))))
5f96f303 701 (build-system gnu-build-system)
8f1d22b7 702 (inputs `(("readline" ,readline)))
49689377
MW
703 (arguments
704 `(#:configure-flags
73dc727e
DC
705 ;; Add -DSQLITE_SECURE_DELETE, -DSQLITE_ENABLE_UNLOCK_NOTIFY and
706 ;; -DSQLITE_ENABLE_DBSTAT_VTAB to CFLAGS. GNU Icecat will refuse
707 ;; to use the system SQLite unless these options are enabled.
708 (list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
709 "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
710 "-DSQLITE_ENABLE_DBSTAT_VTAB"))))
5f96f303
LC
711 (home-page "http://www.sqlite.org/")
712 (synopsis "The SQLite database management system")
713 (description
714 "SQLite is a software library that implements a self-contained, serverless,
35b9e423
EB
715zero-configuration, transactional SQL database engine. SQLite is the most
716widely deployed SQL database engine in the world. The source code for SQLite
717is in the public domain.")
5f96f303 718 (license public-domain)))
db60b1d9 719
b28a3351
MB
720(define-public sqlite-3.15.1
721 (package (inherit sqlite)
722 (version "3.15.1")
723 (source (origin
724 (method url-fetch)
725 (uri (let ((numeric-version
726 (match (string-split version #\.)
727 ((first-digit other-digits ...)
728 (string-append first-digit
729 (string-pad-right
730 (string-concatenate
731 (map (cut string-pad <> 2 #\0)
732 other-digits))
733 6 #\0))))))
734 (string-append "https://sqlite.org/2016/sqlite-autoconf-"
735 numeric-version ".tar.gz")))
736 (sha256
737 (base32
738 "1ig2d9jzzixiifmgqsl6kjcvy17jwxby3s24gfnc5qvyd6vqkyjx"))))))
739
db60b1d9
LC
740(define-public tdb
741 (package
742 (name "tdb")
1abd0904 743 (version "1.3.11")
db60b1d9
LC
744 (source (origin
745 (method url-fetch)
ca473fc2 746 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
db60b1d9
LC
747 version ".tar.gz"))
748 (sha256
749 (base32
1abd0904 750 "0i1l38h0vyck6zkcj4fn2l03spadlmyr1qa1xpdp9dy2ccbm3s1r"))))
db60b1d9
LC
751 (build-system gnu-build-system)
752 (arguments
6ccb7814
EF
753 '(#:phases
754 (modify-phases %standard-phases
755 (replace 'configure
756 (lambda* (#:key outputs #:allow-other-keys)
757 (let ((out (assoc-ref outputs "out")))
758 ;; The 'configure' script is a wrapper for Waf and
759 ;; doesn't recognize things like '--enable-fast-install'.
760 (zero? (system* "./configure"
761 (string-append "--prefix=" out)))))))))
db60b1d9
LC
762 (native-inputs
763 `(;; TODO: Build the documentation.
764 ;; ("docbook-xsl" ,docbook-xsl)
765 ;; ("libxml2" ,libxml2)
766 ;; ("libxslt" ,libxslt)
767 ("python" ,python-2))) ;for the Waf build system
1abd0904 768 (home-page "https://tdb.samba.org/")
35b9e423 769 (synopsis "Trivial database")
db60b1d9
LC
770 (description
771 "TDB is a Trivial Database. In concept, it is very much like GDBM,
772and BSD's DB except that it allows multiple simultaneous writers and uses
773locking internally to keep writers from trampling on each other. TDB is also
774extremely small.")
775 (license lgpl3+)))
274da61d
LC
776
777(define-public perl-dbi
778 (package
779 (name "perl-dbi")
6138dede 780 (version "1.636")
274da61d
LC
781 (source (origin
782 (method url-fetch)
783 (uri (string-append
784 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
785 version ".tar.gz"))
786 (sha256
787 (base32
6138dede 788 "0v37vnr5p0bx396cj0lb5kb69jbryq2mspp602hbgd04gklxqzcg"))))
274da61d
LC
789 (build-system perl-build-system)
790 (synopsis "Database independent interface for Perl")
791 (description "This package provides an database interface for Perl.")
6138dede 792 (home-page "http://search.cpan.org/dist/DBI")
274da61d
LC
793 (license (package-license perl))))
794
feae3395
EB
795(define-public perl-dbix-class
796 (package
797 (name "perl-dbix-class")
5d78d746 798 (version "0.082840")
feae3395
EB
799 (source
800 (origin
801 (method url-fetch)
802 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
803 "DBIx-Class-" version ".tar.gz"))
804 (sha256
805 (base32
5d78d746 806 "1vw1f756g8m5hq11nqf5dk2cw2y4mqq91ca5p75fn5g3fp8syja0"))))
feae3395
EB
807 (build-system perl-build-system)
808 (native-inputs
809 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
810 ("perl-file-temp" ,perl-file-temp)
811 ("perl-package-stash" ,perl-package-stash)
812 ("perl-test-deep" ,perl-test-deep)
813 ("perl-test-exception" ,perl-test-exception)
814 ("perl-test-warn" ,perl-test-warn)))
815 (propagated-inputs
816 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
817 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
818 ("perl-class-inspector" ,perl-class-inspector)
819 ("perl-config-any" ,perl-config-any)
820 ("perl-context-preserve" ,perl-context-preserve)
821 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
822 ("perl-data-page" ,perl-data-page)
823 ("perl-dbi" ,perl-dbi)
824 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
825 ("perl-hash-merge" ,perl-hash-merge)
826 ("perl-module-find" ,perl-module-find)
827 ("perl-moo" ,perl-moo)
828 ("perl-mro-compat" ,perl-mro-compat)
829 ("perl-namespace-clean" ,perl-namespace-clean)
830 ("perl-path-class" ,perl-path-class)
831 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
832 ("perl-scope-guard" ,perl-scope-guard)
833 ("perl-sql-abstract" ,perl-sql-abstract)
834 ("perl-sub-name" ,perl-sub-name)
835 ("perl-text-balanced" ,perl-text-balanced)
836 ("perl-try-tiny" ,perl-try-tiny)))
837 (home-page "http://search.cpan.org/dist/DBIx-Class")
838 (synopsis "Extensible and flexible object <-> relational mapper")
839 (description "An SQL to OO mapper with an object API inspired by
840Class::DBI (with a compatibility layer as a springboard for porting) and a
841resultset API that allows abstract encapsulation of database operations. It
842aims to make representing queries in your code as perl-ish as possible while
843still providing access to as many of the capabilities of the database as
844possible, including retrieving related records from multiple tables in a
845single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
846\"ORDER BY\" and \"HAVING\" support.")
e61fd0f0
EB
847 (license (package-license perl))))
848
4e4039e5
EB
849(define-public perl-dbix-class-cursor-cached
850 (package
851 (name "perl-dbix-class-cursor-cached")
180cb81b 852 (version "1.001004")
4e4039e5
EB
853 (source
854 (origin
855 (method url-fetch)
856 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
857 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
858 (sha256
859 (base32
180cb81b 860 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
4e4039e5
EB
861 (build-system perl-build-system)
862 (native-inputs
863 `(("perl-cache-cache" ,perl-cache-cache)
864 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
865 (propagated-inputs
866 `(("perl-carp-clan" ,perl-carp-clan)
867 ("perl-dbix-class" ,perl-dbix-class)))
868 (home-page "http://search.cpan.org/dist/DBIx-Class-Cursor-Cached")
869 (synopsis "Cursor with built-in caching support")
870 (description "DBIx::Class::Cursor::Cached provides a cursor class with
871built-in caching support.")
872 (license (package-license perl))))
873
e61fd0f0
EB
874(define-public perl-dbix-class-introspectablem2m
875 (package
876 (name "perl-dbix-class-introspectablem2m")
7a462b80 877 (version "0.001002")
e61fd0f0
EB
878 (source
879 (origin
880 (method url-fetch)
68a9d6df 881 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
e61fd0f0
EB
882 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
883 (sha256
884 (base32
7a462b80 885 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
e61fd0f0
EB
886 (build-system perl-build-system)
887 (propagated-inputs
888 `(("perl-dbix-class" ,perl-dbix-class)))
889 (home-page "http://search.cpan.org/dist/DBIx-Class-IntrospectableM2M")
890 (synopsis "Introspect many-to-many relationships")
891 (description "Because the many-to-many relationships are not real
892relationships, they can not be introspected with DBIx::Class. Many-to-many
893relationships are actually just a collection of convenience methods installed
894to bridge two relationships. This DBIx::Class component can be used to store
895all relevant information about these non-relationships so they can later be
896introspected and examined.")
708155df
EB
897 (license (package-license perl))))
898
899(define-public perl-dbix-class-schema-loader
900 (package
901 (name "perl-dbix-class-schema-loader")
ebd2dbbf 902 (version "0.07046")
708155df
EB
903 (source
904 (origin
905 (method url-fetch)
906 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
907 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
908 (sha256
909 (base32
ebd2dbbf 910 "08cgn0dx42y9xsxas9np7s55a7qmy4kf6sfmx0jmk4hryvbapml3"))))
708155df
EB
911 (build-system perl-build-system)
912 (native-inputs
913 `(("perl-config-any" ,perl-config-any)
914 ("perl-config-general" ,perl-config-general)
915 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
916 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
917 ("perl-moose" ,perl-moose)
918 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
919 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
920 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
921 ("perl-test-deep" ,perl-test-deep)
922 ("perl-test-differences" ,perl-test-differences)
923 ("perl-test-exception" ,perl-test-exception)
924 ("perl-test-pod" ,perl-test-pod)
925 ("perl-test-warn" ,perl-test-warn)))
926 (propagated-inputs
927 `(("perl-class-unload" ,perl-class-unload)
928 ("perl-class-inspector" ,perl-class-inspector)
929 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
930 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
931 ("perl-carp-clan" ,perl-carp-clan)
932 ("perl-data-dump" ,perl-data-dump)
933 ("perl-dbix-class" ,perl-dbix-class)
934 ("perl-hash-merge" ,perl-hash-merge)
935 ("perl-list-moreutils" ,perl-list-moreutils)
936 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
937 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
938 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
939 ("perl-namespace-clean" ,perl-namespace-clean)
940 ("perl-mro-compat" ,perl-mro-compat)
941 ("perl-scope-guard" ,perl-scope-guard)
942 ("perl-string-camelcase" ,perl-string-camelcase)
943 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
944 ("perl-sub-name" ,perl-sub-name)
945 ("perl-try-tiny" ,perl-try-tiny)))
946 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
947 (home-page "http://search.cpan.org/dist/DBIx-Class-Schema-Loader")
948 (synopsis "Create a DBIx::Class::Schema based on a database")
949 (description "DBIx::Class::Schema::Loader automates the definition of a
950DBIx::Class::Schema by scanning database table definitions and setting up the
951columns, primary keys, unique constraints and relationships.")
274da61d
LC
952 (license (package-license perl))))
953
186eb132
EB
954(define-public perl-dbd-pg
955 (package
956 (name "perl-dbd-pg")
957 (version "3.5.1")
958 (source
959 (origin
960 (method url-fetch)
961 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
962 "DBD-Pg-" version ".tar.gz"))
963 (sha256
964 (base32
965 "0z0kf1kjgbi5f6nr63i2fnrx7629d9lvxg1q8sficwb3zdf1ggzx"))))
966 (build-system perl-build-system)
967 (native-inputs
968 `(("perl-dbi" ,perl-dbi)))
969 (propagated-inputs
970 `(("perl-dbi" ,perl-dbi)
971 ("postgresql" ,postgresql)))
972 (home-page "http://search.cpan.org/dist/DBD-Pg")
973 (synopsis "DBI PostgreSQL interface")
f33e71fc
LC
974 (description "This package provides a PostgreSQL driver for the Perl5
975@dfn{Database Interface} (DBI).")
186eb132
EB
976 (license (package-license perl))))
977
4b7857a4
RW
978(define-public perl-dbd-mysql
979 (package
980 (name "perl-dbd-mysql")
7c635ed6 981 (version "4.041")
4b7857a4
RW
982 (source
983 (origin
984 (method url-fetch)
7c635ed6 985 (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
4b7857a4
RW
986 "DBD-mysql-" version ".tar.gz"))
987 (sha256
988 (base32
7c635ed6 989 "0h4h6zwzj8fwh9ljb8svnsa0a3ch4p10hp59kpdibdb4qh8xwxs7"))))
4b7857a4
RW
990 (build-system perl-build-system)
991 ;; Tests require running MySQL server
992 (arguments `(#:tests? #f))
993 (propagated-inputs
994 `(("perl-dbi" ,perl-dbi)
995 ("mysql" ,mysql)))
996 (home-page "http://search.cpan.org/dist/DBD-mysql")
997 (synopsis "DBI MySQL interface")
998 (description "This package provides a MySQL driver for the Perl5
999@dfn{Database Interface} (DBI).")
1000 (license (package-license perl))))
1001
274da61d
LC
1002(define-public perl-dbd-sqlite
1003 (package
1004 (name "perl-dbd-sqlite")
467d4c85 1005 (version "1.52")
274da61d
LC
1006 (source (origin
1007 (method url-fetch)
1008 (uri (string-append
1009 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
1010 version ".tar.gz"))
1011 (sha256
1012 (base32
467d4c85 1013 "0kimb2qr1rh07yylbbfybwcizpmy61ck667amypn4clmkfg0knm6"))))
274da61d
LC
1014 (build-system perl-build-system)
1015 (inputs `(("sqlite" ,sqlite)))
1016 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
1017 (synopsis "SQlite interface for Perl")
1018 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
1019the entire thing in the distribution. So in order to get a fast transaction
1020capable RDBMS working for your Perl project you simply have to install this
1021module, and nothing else.")
1022 (license (package-license perl))
1023 (home-page "http://search.cpan.org/~ishigaki/DBD-SQLite/lib/DBD/SQLite.pm")))
14e84b2d 1024
dd90952e
EB
1025(define-public perl-sql-abstract
1026 (package
1027 (name "perl-sql-abstract")
1028 (version "1.81")
1029 (source
1030 (origin
1031 (method url-fetch)
1032 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1033 "SQL-Abstract-" version ".tar.gz"))
1034 (sha256
1035 (base32
1036 "17sgwq3mvqjhv3b77cnvrq60xgp8harjhlnvpwmxc914rqc5ckaz"))))
1037 (build-system perl-build-system)
1038 (native-inputs
1039 `(("perl-test-deep" ,perl-test-deep)
1040 ("perl-test-exception" ,perl-test-exception)
1041 ("perl-test-warn" ,perl-test-warn)))
1042 (propagated-inputs
1043 `(("perl-hash-merge" ,perl-hash-merge)
1044 ("perl-moo" ,perl-moo)
1045 ("perl-mro-compat" ,perl-mro-compat)
1046 ("perl-text-balanced" ,perl-text-balanced)))
1047 (home-page "http://search.cpan.org/dist/SQL-Abstract")
1048 (synopsis "Generate SQL from Perl data structures")
1049 (description "This module was inspired by the excellent DBIx::Abstract.
1050While based on the concepts used by DBIx::Abstract, the concepts used have
1051been modified to make the SQL easier to generate from Perl data structures.
1052The underlying idea is for this module to do what you mean, based on the data
1053structures you provide it, so that you don't have to modify your code every
e881752c 1054time your data changes.")
dd90952e 1055 (license (package-license perl))))
14e84b2d 1056
b4dcb026
EB
1057(define-public perl-sql-splitstatement
1058 (package
1059 (name "perl-sql-splitstatement")
1060 (version "1.00020")
1061 (source
1062 (origin
1063 (method url-fetch)
1064 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
1065 "SQL-SplitStatement-" version ".tar.gz"))
1066 (sha256
1067 (base32
1068 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
1069 (build-system perl-build-system)
1070 (native-inputs
1071 `(("perl-test-exception" ,perl-test-exception)))
1072 (propagated-inputs
1073 `(("perl-class-accessor" ,perl-class-accessor)
1074 ("perl-list-moreutils" ,perl-list-moreutils)
1075 ("perl-regexp-common" ,perl-regexp-common)
1076 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
1077 (home-page "http://search.cpan.org/dist/SQL-SplitStatement")
1078 (synopsis "Split SQL code into atomic statements")
1079 (description "This module tries to split any SQL code, even including
1080non-standard extensions, into the atomic statements it is composed of.")
1081 (license (package-license perl))))
1082
718c89c1
EB
1083(define-public perl-sql-tokenizer
1084 (package
1085 (name "perl-sql-tokenizer")
1086 (version "0.24")
1087 (source
1088 (origin
1089 (method url-fetch)
1090 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
1091 "SQL-Tokenizer-" version ".tar.gz"))
1092 (sha256
1093 (base32
1094 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
1095 (build-system perl-build-system)
1096 (home-page "http://search.cpan.org/dist/SQL-Tokenizer")
1097 (synopsis "SQL tokenizer")
1098 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
1099claim to be a parser or query verifier. It just creates sane tokens from a
1100valid SQL query.")
1101 (license (package-license perl))))
1102
14e84b2d
JD
1103(define-public unixodbc
1104 (package
1105 (name "unixodbc")
3fef0a2f 1106 (version "2.3.4")
14e84b2d
JD
1107 (source (origin
1108 (method url-fetch)
e881752c 1109 (uri
14e84b2d 1110 (string-append
3fef0a2f
EF
1111 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
1112 version ".tar.gz"))
14e84b2d 1113 (sha256
3fef0a2f 1114 (base32 "0f8y88rcc2akjvjv5y66yx7k0ms9h1s0vbcfy25j93didflhj59f"))))
14e84b2d
JD
1115 (build-system gnu-build-system)
1116 (synopsis "Data source abstraction library")
1117 (description "Unixodbc is a library providing an API with which to access
1118data sources. Data sources include SQL Servers and any software with an ODBC
1119Driver.")
e881752c 1120 (license lgpl2.1+)
14e84b2d
JD
1121 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
1122 (home-page "http://www.unixodbc.org")))
b4a9c924
EB
1123
1124(define-public unqlite
1125 (package
1126 (name "unqlite")
1127 (version "1.1.6")
1128 (source (origin
1129 (method url-fetch)
1130 ;; Contains bug fixes against the official release, and has an
1131 ;; autotooled build system.
1132 (uri (string-append "https://github.com/aidin36/tocc/releases/"
1133 "download/v1.0.0/"
1134 "unqlite-unofficial-" version ".tar.gz"))
1135 (sha256
1136 (base32
1137 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
1138 (build-system gnu-build-system)
1139 (arguments `(#:tests? #f)) ;No check target
1140 (home-page "http://www.unqlite.org")
1141 (synopsis "In-memory key/value and document store")
1142 (description
1143 "UnQLite is an in-process software library which implements a
1144self-contained, serverless, zero-configuration, transactional NoSQL
1145database engine. UnQLite is a document store database similar to
1146MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
69b4ffcf 1147similar to BerkeleyDB, LevelDB, etc.")
b4a9c924 1148 (license bsd-2)))
463f6766
DT
1149
1150(define-public redis
1151 (package
1152 (name "redis")
b25f060f 1153 (version "3.2.4")
463f6766
DT
1154 (source (origin
1155 (method url-fetch)
1156 (uri (string-append "http://download.redis.io/releases/redis-"
1157 version".tar.gz"))
1158 (sha256
1159 (base32
b25f060f 1160 "1wb9jd692a0y52bkkxr6815kk4g039mirjdrvqx24265lv2l5l1a"))))
463f6766
DT
1161 (build-system gnu-build-system)
1162 (arguments
1163 '(#:tests? #f ; tests related to master/slave and replication fail
1164 #:phases (modify-phases %standard-phases
1165 (delete 'configure))
1166 #:make-flags `("CC=gcc"
1167 "MALLOC=libc"
b25f060f 1168 "LDFLAGS=-ldl"
463f6766
DT
1169 ,(string-append "PREFIX="
1170 (assoc-ref %outputs "out")))))
1171 (synopsis "Key-value cache and store")
1172 (description "Redis is an advanced key-value cache and store. Redis
1173supports many data structures including strings, hashes, lists, sets, sorted
1174sets, bitmaps and hyperloglogs.")
1175 (home-page "http://redis.io/")
1176 (license bsd-3)))
a65e2a02 1177
1178(define-public kyotocabinet
1179 (package
1180 (name "kyotocabinet")
1181 (version "1.2.76")
1182 (source (origin
1183 (method url-fetch)
1184 (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
1185 name "-" version ".tar.gz"))
1186 (sha256
1187 (base32
1188 "0g6js20x7vnpq4p8ghbw3mh9wpqksya9vwhzdx6dnlf354zjsal1"))))
1189 (build-system gnu-build-system)
1190 (arguments
1191 `(#:configure-flags
1192 (list
1193 (string-append "LDFLAGS=-Wl,-rpath="
1194 (assoc-ref %outputs "out") "/lib"))))
1195 (inputs `(("zlib" ,zlib)))
1196 (home-page "http://fallabs.com/kyotocabinet/")
1197 (synopsis
1198 "Kyoto Cabinet is a modern implementation of the DBM database")
1199 (description
1200 "Kyoto Cabinet is a standalone file-based database that supports Hash
1201and B+ Tree data storage models. It is a fast key-value lightweight
1202database and supports many programming languages. It is a NoSQL database.")
1203 (license gpl3+)))
6242b314
SB
1204
1205(define-public wiredtiger
1206 (package
1207 (name "wiredtiger")
81e95821 1208 (version "2.9.1")
6242b314
SB
1209 (source (origin
1210 (method url-fetch)
1211 (uri (string-append
1212 "http://source.wiredtiger.com/releases/wiredtiger-"
1213 version ".tar.bz2"))
1214 (sha256
1215 (base32
81e95821 1216 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
6242b314
SB
1217 (build-system gnu-build-system)
1218 (arguments
1219 '(#:configure-flags '("--enable-lz4" "--enable-zlib")
1220 #:phases
1221 (modify-phases %standard-phases
1222 (add-before 'check 'disable-test/fops
1223 (lambda _
1224 ;; XXX: timed out after 3600 seconds of silence
1225 (substitute* "Makefile"
1226 (("test/fops") ""))
1227 #t)))))
1228 (inputs
1229 `(("lz4" ,lz4)
1230 ("zlib" ,zlib)))
1231 (home-page "http://source.wiredtiger.com/")
1232 (synopsis "NoSQL data engine")
1233 (description
1234 "WiredTiger is an extensible platform for data management. It supports
1235row-oriented storage (where all columns of a row are stored together),
1236column-oriented storage (where columns are stored in groups, allowing for
1237more efficient access and storage of column subsets) and log-structured merge
1238trees (LSM), for sustained throughput under random insert workloads.")
1239 (license gpl3) ; or GPL-2
1240 ;; configure.ac: WiredTiger requires a 64-bit build.
1241 (supported-systems '("x86_64-linux" "mips64el-linux"))))
90c2ee88
DM
1242
1243(define-public perl-db-file
1244 (package
1245 (name "perl-db-file")
1246 (version "1.838")
1247 (source
1248 (origin
1249 (method url-fetch)
1250 (uri (string-append
1251 "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
1252 version
1253 ".tar.gz"))
1254 (sha256
1255 (base32
1256 "0yp5d5zr8dk9g6xdh7ygi5bq63q7nxvhd58dk2i3ki4nb7yv2yh9"))))
1257 (build-system perl-build-system)
1258 (inputs `(("bdb" ,bdb)))
1259 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
1260 (arguments
1261 `(#:phases (modify-phases %standard-phases
1262 (add-before
1263 'configure 'modify-config.in
1264 (lambda* (#:key inputs #:allow-other-keys)
1265 (substitute* "config.in"
1266 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
1267 #t)))))
1268 (home-page "http://search.cpan.org/dist/DB_File")
1269 (synopsis
1270 "Perl5 access to Berkeley DB version 1.x")
1271 (description
1272 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
1273 (license (package-license perl))))
0e1b262e
DC
1274
1275(define-public lmdb
1276 (package
1277 (name "lmdb")
1278 (version "0.9.18")
1279 (source (origin
1280 (method url-fetch)
1281 (uri (string-append "https://github.com/LMDB/lmdb/archive/"
1282 "LMDB_" version ".tar.gz"))
1283 (sha256
1284 (base32
1285 "12crvzxky8in99ibh22k4ppmkgqs28yy3v7yy944za7fsrqv8dfx"))))
1286 (build-system gnu-build-system)
1287 (arguments
1288 `(#:test-target "test"
1289 #:phases
1290 (modify-phases %standard-phases
1291 (replace 'configure
1292 (lambda* (#:key outputs #:allow-other-keys)
1293 (chdir (string-append
1294 (getenv "PWD") "/lmdb-LMDB_" ,version "/libraries/liblmdb"))
1295 (substitute* "Makefile"
1296 (("/usr/local") (assoc-ref outputs "out")))
1297 #t)))))
1298 (home-page "https://symas.com/products/lightning-memory-mapped-database")
1299 (synopsis "Lightning memory-mapped database library")
1300 (description "Lightning memory-mapped database library.")
1301 (license license:openldap2.8)))
fe71eee0
JN
1302
1303(define-public libpqxx
1304 (package
1305 (name "libpqxx")
1306 (version "4.0.1")
1307 (source (origin
1308 (method url-fetch)
1309 (uri (string-append
1310 "http://pqxx.org/download/software/libpqxx/"
1311 name "-" version ".tar.gz"))
1312 (sha256
1313 (base32
1314 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
1315 (build-system gnu-build-system)
1316 (native-inputs
1317 `(("python" ,python-2)))
1318 (inputs `(("postgresql" ,postgresql)))
1319 (arguments
1320 `(#:tests? #f)) ; # FAIL: 1
1321 (synopsis "C++ connector for PostgreSQL")
1322 (description
1323 "Libpqxx is a C++ library to enable user programs to communicate with the
1324PostgreSQL database back-end. The database back-end can be local or it may be
1325on another machine, accessed via TCP/IP.")
1326 (home-page "http://pqxx.org/")
1327 (license license:bsd-3)))
4d98bfaf
EF
1328
1329(define-public python-peewee
1330 (package
1331 (name "python-peewee")
1332 (version "2.8.3")
1333 (source
1334 (origin
1335 (method url-fetch)
1336 (uri (pypi-uri "peewee" version))
1337 (sha256
1338 (base32
1339 "1605bk11s7aap2q4qyba93rx7yfh8b11kk0cqi08z8klx2iar8yd"))))
1340 (build-system python-build-system)
1341 (arguments
1342 `(#:tests? #f)) ; Fails to import test data
1343 (native-inputs
1344 `(("python-cython" ,python-cython)))
1345 (home-page "https://github.com/coleifer/peewee/")
1346 (synopsis "Small object-relational mapping utility")
1347 (description
1348 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
1349handles converting between pythonic values and those used by databases, so you
1350can use Python types in your code without having to worry. It has built-in
1351support for sqlite, mysql and postgresql. If you already have a database, you
1352can autogenerate peewee models using @code{pwiz}, a model generator.")
1353 (license license:expat)))
1354
1355(define-public python2-peewee
1356 (package-with-python2 python-peewee))
62ea44fc
AP
1357
1358(define-public sqlcipher
1359 (package
1360 (name "sqlcipher")
1361 (version "3.3.1")
1362 (source
1363 (origin
1364 (method url-fetch)
1365 (uri (string-append "https://github.com/sqlcipher/" name
1366 "/archive/v" version ".tar.gz"))
1367 (sha256
1368 (base32 "1gv58dlbpzrmznly52yqbxgvii0ib88zr3aszla1bsypwjr6flff"))
1369 (file-name (string-append name "-" version ".tar.gz"))))
1370 (build-system gnu-build-system)
1371 (inputs
1372 `(("libcrypto" ,openssl)
1373 ("libtcl8.6" ,tcl))) ; required for running the tests
1374 (native-inputs
1375 `(("tcl" ,tcl)))
1376 (arguments
1377 '(#:configure-flags
1378 '("--enable-tempstore=yes"
1379 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
1380 "LDFLAGS=-lcrypto -ltcl8.6"
1381 "--disable-tcl")
1382 ;; tests cannot be run from the Makefile
1383 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
1384 #:test-target "testfixture"
1385 #:phases
1386 (modify-phases %standard-phases
1387 (add-before 'check 'build-test-runner
1388 (assoc-ref %standard-phases 'check))
1389 (replace 'check
1390 (lambda _
1391 (zero?
1392 (system* "./testfixture" "test/crypto.test")))))))
1393 (home-page "https://www.zetetic.net/sqlcipher/")
1394 (synopsis
1395 "Library providing transparent encryption of SQLite database files")
1396 (description "SQLCipher is an implementation of SQLite, extended to
1397provide transparent 256-bit AES encryption of database files. Pages are
1398encrypted before being written to disk and are decrypted when read back. It’s
1399well suited for protecting embedded application databases and for mobile
1400development.")
1401 ;; The source files
1402 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
1403 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
1404 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
1405 ;; source files are in the public domain.
1406 (license (list license:public-domain license:bsd-3))))