gnu: dealii: Update to 8.5.0.
[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, 2017 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
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 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
19 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
20 ;;;
21 ;;; This file is part of GNU Guix.
22 ;;;
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
27 ;;;
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
32 ;;;
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35
36 (define-module (gnu packages databases)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages algebra)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages avahi)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages bash)
43 #:use-module (gnu packages bison)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages crypto)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages cyrus-sasl)
50 #:use-module (gnu packages emacs)
51 #:use-module (gnu packages gettext)
52 #:use-module (gnu packages glib)
53 #:use-module (gnu packages gnupg)
54 #:use-module (gnu packages jemalloc)
55 #:use-module (gnu packages language)
56 #:use-module (gnu packages libevent)
57 #:use-module (gnu packages linux)
58 #:use-module (gnu packages man)
59 #:use-module (gnu packages ncurses)
60 #:use-module (gnu packages parallel)
61 #:use-module (gnu packages pcre)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages popt)
65 #:use-module (gnu packages python)
66 #:use-module (gnu packages rdf)
67 #:use-module (gnu packages readline)
68 #:use-module (gnu packages tcl)
69 #:use-module (gnu packages tls)
70 #:use-module (gnu packages xml)
71 #:use-module ((guix licenses) #:prefix license:)
72 #:use-module (guix packages)
73 #:use-module (guix download)
74 #:use-module (guix build-system gnu)
75 #:use-module (guix build-system perl)
76 #:use-module (guix build-system python)
77 #:use-module (guix build-system cmake)
78 #:use-module (guix utils)
79 #:use-module (srfi srfi-26)
80 #:use-module (ice-9 match))
81
82 (define-public 4store
83 (package
84 (name "4store")
85 (version "1.1.6")
86 (source (origin
87 (method url-fetch)
88 (uri (string-append "https://github.com/garlik/4store/archive/v"
89 version ".tar.gz"))
90 (file-name (string-append name "-" version ".tar.gz"))
91 (sha256
92 (base32 "004fmcf1w75zhc1x3zc6kc97j4jqn2v5nhk6yb3z3cpfrhzi9j50"))
93 (patches (list (search-patch "4store-fix-buildsystem.patch")))))
94 (build-system gnu-build-system)
95 (native-inputs
96 `(("perl" ,perl)
97 ("python" ,python-2)
98 ("autoconf" ,autoconf)
99 ("automake" ,automake)
100 ("gettext" ,gettext-minimal)
101 ("libtool" ,libtool)
102 ("pcre" ,pcre "bin") ;for 'pcre-config'
103 ("pkg-config" ,pkg-config)))
104 (inputs
105 `(("glib" ,glib)
106 ("rasqal" ,rasqal)
107 ("libxml2" ,libxml2)
108 ("raptor2" ,raptor2)
109 ("readline" ,readline)
110 ("avahi" ,avahi)
111 ("cyrus-sasl" ,cyrus-sasl)
112 ("openssl" ,openssl)
113 ("util-linux" ,util-linux)))
114 (arguments
115 `(#:phases
116 (modify-phases %standard-phases
117 (add-before 'configure 'generate-configure
118 (lambda _
119 (zero? (system* "./autogen.sh")))))))
120 ;; http://www.4store.org has been down for a while now.
121 (home-page "https://github.com/garlik/4store")
122 (synopsis "Clustered RDF storage and query engine")
123 (description "4store is a RDF/SPARQL store written in C, supporting
124 either single machines or networked clusters.")
125 (license license:gpl3+)))
126
127 (define-public gdbm
128 (package
129 (name "gdbm")
130 (version "1.12")
131 (source (origin
132 (method url-fetch)
133 (uri (string-append "mirror://gnu/gdbm/gdbm-"
134 version ".tar.gz"))
135 (sha256
136 (base32
137 "1smwz4x5qa4js0zf1w3asq6z7mh20zlgwbh2bk5dczw6xrk22yyr"))))
138 (arguments `(#:configure-flags '("--enable-libgdbm-compat")))
139 (build-system gnu-build-system)
140 (home-page "http://www.gnu.org.ua/software/gdbm")
141 (synopsis
142 "Hash library of database functions compatible with traditional dbm")
143 (description
144 "GDBM is a library for manipulating hashed databases. It is used to
145 store key/value pairs in a file in a manner similar to the Unix dbm library
146 and provides interfaces to the traditional file format.")
147 (license license:gpl3+)))
148
149 (define-public bdb
150 (package
151 (name "bdb")
152 (version "6.2.23")
153 (source (origin
154 (method url-fetch)
155 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
156 version ".tar.gz"))
157 (sha256
158 (base32
159 "1isxx4jfmnh913jzhp8hhfngbk6dsg46f4kjpvvc56maj64jqqa7"))))
160 (build-system gnu-build-system)
161 (outputs '("out" ; programs, libraries, headers
162 "doc")) ; 94 MiB of HTML docs
163 (arguments
164 '(#:tests? #f ; no check target available
165 #:disallowed-references ("doc")
166 #:phases
167 (alist-replace
168 'configure
169 (lambda* (#:key outputs #:allow-other-keys)
170 (let ((out (assoc-ref outputs "out"))
171 (doc (assoc-ref outputs "doc")))
172 ;; '--docdir' is not honored, so we need to patch.
173 (substitute* "dist/Makefile.in"
174 (("docdir[[:blank:]]*=.*")
175 (string-append "docdir = " doc "/share/doc/bdb")))
176
177 (zero?
178 (system* "./dist/configure"
179 (string-append "--prefix=" out)
180 (string-append "CONFIG_SHELL=" (which "bash"))
181 (string-append "SHELL=" (which "bash"))
182
183 ;; Remove 7 MiB of .a files.
184 "--disable-static"
185
186 ;; The compatibility mode is needed by some packages,
187 ;; notably iproute2.
188 "--enable-compat185"
189
190 ;; The following flag is needed so that the inclusion
191 ;; of db_cxx.h into C++ files works; it leads to
192 ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h.
193 "--enable-cxx"))))
194 %standard-phases)))
195 (synopsis "Berkeley database")
196 (description
197 "Berkeley DB is an embeddable database allowing developers the choice of
198 SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
199 ;; Starting with version 6, BDB is distributed under AGPL3. Many individual
200 ;; files are covered by the 3-clause BSD license.
201 (license (list license:agpl3+ license:bsd-3))
202 (home-page
203 "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html")))
204
205 (define-public bdb-5.3
206 (package (inherit bdb)
207 (name "bdb")
208 (version "5.3.28")
209 (license (license:non-copyleft "file://LICENSE"
210 "See LICENSE in the distribution."))
211 (source (origin
212 (method url-fetch)
213 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
214 version ".tar.gz"))
215 (sha256
216 (base32
217 "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))))
218 (arguments
219 `(#:tests? #f ; no check target available
220 #:disallowed-references ("doc")
221 #:phases
222 (alist-replace
223 'configure
224 (lambda* (#:key outputs #:allow-other-keys)
225 (let ((out (assoc-ref outputs "out"))
226 (doc (assoc-ref outputs "doc")))
227 ;; '--docdir' is not honored, so we need to patch.
228 (substitute* "dist/Makefile.in"
229 (("docdir[[:blank:]]*=.*")
230 (string-append "docdir = " doc "/share/doc/bdb")))
231
232 (zero?
233 (system* "./dist/configure"
234 (string-append "--prefix=" out)
235 (string-append "CONFIG_SHELL=" (which "bash"))
236 (string-append "SHELL=" (which "bash"))
237
238 ;; Bdb doesn't recognize aarch64 as an architecture.
239 ,@(if (string=? "aarch64-linux" (%current-system))
240 '("--build=aarch64-unknown-linux-gnu")
241 '())
242
243 ;; Remove 7 MiB of .a files.
244 "--disable-static"
245
246 ;; The compatibility mode is needed by some packages,
247 ;; notably iproute2.
248 "--enable-compat185"
249
250 ;; The following flag is needed so that the inclusion
251 ;; of db_cxx.h into C++ files works; it leads to
252 ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h.
253 "--enable-cxx"))))
254 %standard-phases)))))
255
256 (define-public leveldb
257 (package
258 (name "leveldb")
259 (version "1.20")
260 (source (origin
261 (method url-fetch)
262 (uri (string-append "https://github.com/google/leveldb"
263 "/archive/v" version ".tar.gz"))
264 (file-name (string-append name "-" version ".tar.gz"))
265 (sha256
266 (base32
267 "0r36bcrj6b2afsp4aw1gjai3jbs1c7734pxpc1jz7hh9nasyiazm"))))
268 (build-system gnu-build-system)
269 (arguments
270 '(#:make-flags (list "CC=gcc")
271 #:phases
272 (modify-phases %standard-phases
273 (delete 'configure)
274 (replace 'install
275 ;; There is no install target, so we do it here.
276 (lambda* (#:key outputs #:allow-other-keys)
277 (let* ((out (assoc-ref outputs "out"))
278 (lib (string-append out "/lib"))
279 (include (string-append out "/include")))
280 (for-each (lambda (file)
281 (install-file file lib))
282 (find-files "out-shared" "^libleveldb\\.so.*$"))
283 (copy-recursively "include" include)
284 #t))))))
285 (inputs
286 `(("snappy" ,snappy)))
287 (home-page "http://leveldb.org/")
288 (synopsis "Fast key-value storage library")
289 (description
290 "LevelDB is a fast key-value storage library that provides an ordered
291 mapping from string keys to string values.")
292 (license license:bsd-3)))
293
294 (define-public memcached
295 (package
296 (name "memcached")
297 (version "1.5.0")
298 (source
299 (origin
300 (method url-fetch)
301 (uri (string-append
302 "https://memcached.org/files/memcached-" version ".tar.gz"))
303 (sha256
304 (base32 "0chwc0g7wfvcad36z8pf2jbgygdnm9nm1l6pwjsn3d2b089gh0f0"))))
305 (build-system gnu-build-system)
306 (inputs
307 `(("libevent" ,libevent)
308 ("cyrus-sasl" ,cyrus-sasl)))
309 (home-page "https://memcached.org/")
310 (synopsis "In memory caching service")
311 (description "Memcached is a in memory key value store. It has a small
312 and generic API, and was originally intended for use with dynamic web
313 applications.")
314 (license license:bsd-3)))
315
316 (define-public mysql
317 (package
318 (name "mysql")
319 (version "5.7.19")
320 (source (origin
321 (method url-fetch)
322 (uri (list (string-append
323 "http://dev.mysql.com/get/Downloads/MySQL-"
324 (version-major+minor version) "/"
325 name "-" version ".tar.gz")
326 (string-append
327 "http://downloads.mysql.com/archives/get/file/"
328 name "-" version ".tar.gz")))
329 (sha256
330 (base32
331 "1c8y54yk756179nx4dgg79dijmjdq5n8l057cnqsg70pjdpyfl9y"))))
332 (build-system cmake-build-system)
333 (arguments
334 `(#:configure-flags
335 '("-DBUILD_CONFIG=mysql_release"
336 "-DWITH_SSL=system"
337 "-DWITH_ZLIB=system"
338 "-DDEFAULT_CHARSET=utf8"
339 "-DDEFAULT_COLLATION=utf8_general_ci"
340 "-DMYSQL_DATADIR=/var/lib/mysql"
341 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
342 "-DINSTALL_INFODIR=share/mysql/docs"
343 "-DINSTALL_MANDIR=share/man"
344 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
345 "-DINSTALL_SCRIPTDIR=bin"
346 "-DINSTALL_INCLUDEDIR=include/mysql"
347 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
348 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
349 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
350 "-DINSTALL_DOCDIR=share/mysql/docs"
351 "-DINSTALL_SHAREDIR=share/mysql"
352 ;; Get rid of test data.
353 "-DINSTALL_MYSQLTESTDIR="
354 "-DINSTALL_SQLBENCHDIR=")
355 #:phases (modify-phases %standard-phases
356 (add-after
357 'unpack 'patch-boost-version
358 (lambda _
359 ;; Mysql wants boost-1.59.0 specifically
360 (substitute* "cmake/boost.cmake"
361 (("59")
362 ,(match (string-split (package-version boost) #\.)
363 ((_ minor . _) minor))))))
364 (add-after
365 'install 'remove-extra-binaries
366 (lambda* (#:key outputs #:allow-other-keys)
367 (let ((out (assoc-ref outputs "out")))
368 ;; Remove the 3 *_embedded files, which weigh in at
369 ;; 14 MiB each.
370 (for-each delete-file
371 (find-files (string-append out "/bin")
372 "_embedded$"))
373 #t))))
374 ;; On aarch64 the test suite runs out of memory and fails.
375 ,@(if (string-prefix? "aarch64-linux"
376 (or (%current-target-system) (%current-system)))
377 '(#:tests? #f)
378 '())))
379 (native-inputs
380 `(("bison" ,bison)
381 ("perl" ,perl)))
382 (inputs
383 `(("boost" ,boost)
384 ("libaio" ,libaio)
385 ("ncurses" ,ncurses)
386 ("openssl" ,openssl)
387 ("zlib" ,zlib)))
388 (home-page "http://www.mysql.com/")
389 (synopsis "Fast, easy to use, and popular database")
390 (description
391 "MySQL is a fast, reliable, and easy to use relational database
392 management system that supports the standardized Structured Query
393 Language.")
394 (license license:gpl2)))
395
396 (define-public mariadb
397 (package
398 (name "mariadb")
399 (version "10.1.25")
400 (source (origin
401 (method url-fetch)
402 (uri (string-append "https://downloads.mariadb.org/f/"
403 name "-" version "/source/"
404 name "-" version ".tar.gz"))
405 (sha256
406 (base32
407 "1mm0n8sl6grajk5rbrx55333laz5dg2abyl8mlsn7h8vdymfq1bj"))))
408 (build-system cmake-build-system)
409 (arguments
410 '(#:configure-flags
411 '("-DBUILD_CONFIG=mysql_release"
412 ;; Linking with libarchive fails, like this:
413
414 ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
415 ;; relocation R_X86_64_32 against `.bss' can not be used when
416 ;; making a shared object; recompile with -fPIC
417
418 ;; For now, disable the features that that use libarchive (xtrabackup).
419 "-DWITH_LIBARCHIVE=OFF"
420
421 "-DDEFAULT_CHARSET=utf8"
422 "-DDEFAULT_COLLATION=utf8_general_ci"
423 "-DMYSQL_DATADIR=/var/lib/mysql"
424 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
425 "-DINSTALL_INFODIR=share/mysql/docs"
426 "-DINSTALL_MANDIR=share/man"
427 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
428 "-DINSTALL_SCRIPTDIR=bin"
429 "-DINSTALL_INCLUDEDIR=include/mysql"
430 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
431 "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
432 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
433 "-DINSTALL_DOCDIR=share/mysql/docs"
434 "-DINSTALL_SHAREDIR=share/mysql")
435 #:phases
436 (modify-phases %standard-phases
437 (add-before
438 'configure 'pre-configure
439 (lambda _
440 (setenv "CONFIG_SHELL" (which "sh"))
441 #t))
442 (add-after
443 'install 'post-install
444 (lambda* (#:key outputs #:allow-other-keys)
445 (let* ((out (assoc-ref outputs "out"))
446 (test (assoc-ref outputs "test")))
447 (substitute* (string-append out "/bin/mysql_install_db")
448 (("basedir=\"\"")
449 (string-append "basedir=\"" out "\"")))
450 ;; Remove unneeded files for testing.
451 (with-directory-excursion out
452 (for-each delete-file-recursively
453 '("data" "mysql-test" "sql-bench"
454 "share/man/man1/mysql-test-run.pl.1")))))))))
455 (native-inputs
456 `(("bison" ,bison)
457 ("perl" ,perl)))
458 (inputs
459 `(("jemalloc" ,jemalloc)
460 ("libaio" ,libaio)
461 ("libxml2" ,libxml2)
462 ("ncurses" ,ncurses)
463 ("openssl" ,openssl)
464 ("pcre" ,pcre)
465 ("zlib" ,zlib)))
466 (home-page "https://mariadb.org/")
467 (synopsis "SQL database server")
468 (description
469 "MariaDB is a multi-user and multi-threaded SQL database server, designed
470 as a drop-in replacement of MySQL.")
471 (license license:gpl2)))
472
473 (define-public postgresql
474 (package
475 (name "postgresql")
476 (version "9.6.3")
477 (source (origin
478 (method url-fetch)
479 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
480 version "/postgresql-" version ".tar.bz2"))
481 (sha256
482 (base32
483 "1imrjp4vfslxj5rrvphcrrk21zv8kqw3gacmwradixh1d5rv6i8n"))))
484 (build-system gnu-build-system)
485 (arguments
486 `(#:configure-flags '("--with-uuid=e2fs")
487 #:phases
488 (modify-phases %standard-phases
489 (add-before 'configure 'patch-/bin/sh
490 (lambda _
491 ;; Refer to the actual shell.
492 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
493 "src/bin/psql/command.c")
494 (("/bin/sh") (which "sh")))
495 #t))
496 (add-after 'build 'build-contrib
497 (lambda _
498 (zero? (system* "make" "-C" "contrib"))))
499 (add-after 'install 'install-contrib
500 (lambda _
501 (zero? (system* "make" "-C" "contrib" "install")))))))
502 (inputs
503 `(("readline" ,readline)
504 ("libuuid" ,util-linux)
505 ("zlib" ,zlib)))
506 (home-page "https://www.postgresql.org/")
507 (synopsis "Powerful object-relational database system")
508 (description
509 "PostgreSQL is a powerful object-relational database system. It is fully
510 ACID compliant, has full support for foreign keys, joins, views, triggers, and
511 stored procedures (in multiple languages). It includes most SQL:2008 data
512 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
513 TIMESTAMP. It also supports storage of binary large objects, including
514 pictures, sounds, or video.")
515 (license (license:x11-style "file://COPYRIGHT"))))
516
517 (define-public qdbm
518 (package
519 (name "qdbm")
520 (version "1.8.78")
521 (source
522 (origin
523 (method url-fetch)
524 (uri (string-append "http://fallabs.com/" name "/"
525 name "-" version ".tar.gz"))
526 (sha256
527 (base32
528 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
529 (build-system gnu-build-system)
530 (arguments
531 `( #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
532 (assoc-ref %outputs "out")
533 "/lib"))))
534 (home-page "http://fallabs.com/qdbm")
535 (synopsis "Key-value database")
536 (description "QDBM is a library of routines for managing a
537 database. The database is a simple data file containing key-value
538 pairs. Every key and value is serial bytes with variable length.
539 Binary data as well as character strings can be used as a key or a
540 value. There is no concept of data tables or data types. Records are
541 organized in a hash table or B+ tree.")
542 (license license:lgpl2.1+)))
543
544 (define-public recutils
545 (package
546 (name "recutils")
547 (version "1.7")
548 (source (origin
549 (method url-fetch)
550 (uri (string-append "mirror://gnu/recutils/recutils-"
551 version ".tar.gz"))
552 (sha256
553 (base32
554 "0cdwa4094x3yx7vn98xykvnlp9rngvd58d19vs3vh5hrvggccg93"))))
555 (build-system gnu-build-system)
556
557 ;; Running tests in parallel leads to test failures and crashes in
558 ;; torture/utils.
559 (arguments '(#:parallel-tests? #f
560 #:configure-flags
561 (list (string-append "--with-bash-headers="
562 (assoc-ref %build-inputs "bash:include")
563 "/include/bash"))
564
565 #:phases (modify-phases %standard-phases
566 (add-before 'build 'set-bash4.4-header-location
567 (lambda _
568 (substitute* "bash/Makefile.in"
569 ;; Adjust the header search path for Bash
570 ;; 4.4 in accordance with 'bash.pc'.
571 (("AM_CPPFLAGS = (.*)$" _ rest)
572 (string-append "AM_CPPFLAGS = "
573 "-I$(BASH_HEADERS)/include "
574 rest))
575
576 ;; Install to PREFIX/lib/bash to match Bash
577 ;; 4.4's search path.
578 (("^libdir = .*$")
579 "libdir = @libdir@/bash\n"))
580 #t)))))
581
582 (native-inputs `(("emacs" ,emacs-minimal)
583 ("bc" ,bc)
584 ("bash:include" ,bash "include")
585 ("libuuid" ,util-linux)))
586
587 ;; TODO: Add more optional inputs.
588 (inputs `(("curl" ,curl)
589 ("libgcrypt" ,libgcrypt)
590 ("check" ,check)))
591 (synopsis "Manipulate plain text files as databases")
592 (description
593 "GNU Recutils is a set of tools and libraries for creating and
594 manipulating text-based, human-editable databases. Despite being text-based,
595 databases created with Recutils carry all of the expected features such as
596 unique fields, primary keys, time stamps and more. Many different field
597 types are supported, as is encryption.")
598 (license license:gpl3+)
599 (home-page "https://www.gnu.org/software/recutils/")))
600
601 (define-public rocksdb
602 (package
603 (name "rocksdb")
604 (version "5.2.1")
605 (source (origin
606 (method url-fetch)
607 (uri (string-append "https://github.com/facebook/rocksdb"
608 "/archive/v" version ".tar.gz"))
609 (file-name (string-append name "-" version ".tar.gz"))
610 (sha256
611 (base32
612 "1v2q05bl56sfp51m09z7g6489hkfq4vf6b4qgfg3d96ylgmay9yb"))
613 (modules '((guix build utils)))
614 (snippet
615 '(begin
616 ;; TODO: unbundle gtest.
617 (delete-file "build_tools/gnu_parallel")
618 #t))))
619 (build-system gnu-build-system)
620 (arguments
621 `(#:make-flags (list "CC=gcc"
622 (string-append "INSTALL_PATH="
623 (assoc-ref %outputs "out")))
624 ;; Many tests fail on 32-bit platforms. There are multiple reports about
625 ;; this upstream, but it's not going to be supported any time soon.
626 #:tests? (let ((system ,(or (%current-target-system)
627 (%current-system))))
628 (or (string-prefix? "x86_64-linux" system)
629 (string-prefix? "aarch64-linux" system)))
630 #:phases
631 (modify-phases %standard-phases
632 (add-after 'unpack 'patch-Makefile
633 (lambda _
634 (substitute* "Makefile"
635 (("build_tools/gnu_parallel") "parallel")
636 ;; Don't depend on the static library when installing.
637 (("install: install-static")
638 "install: install-shared")
639 (("#!/bin/sh") (string-append "#!" (which "sh"))))
640 #t))
641 (delete 'configure)
642 ;; The default target is only needed for tests and built on demand.
643 (delete 'build)
644 (add-before 'check 'disable-optimizations
645 (lambda _
646 ;; Prevent the build from passing '-march=native' to the compiler.
647 (setenv "PORTABLE" "1")
648 #t))
649 (add-before 'check 'disable-failing-tests
650 (lambda _
651 (substitute* "Makefile"
652 ;; This test fails with GCC-5 and is unmaintained.
653 ;; https://github.com/facebook/rocksdb/issues/2148
654 (("^[[:blank:]]+spatial_db_test[[:blank:]]+\\\\") "\\")
655 ;; These tests reliably fail due to "Too many open files".
656 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
657 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
658 #t))
659 (add-after 'check 'build-release-libraries
660 ;; The default build target is a debug build for tests. The
661 ;; install target depends on "shared_lib" and "static_lib"
662 ;; targets for release builds so we build them here for clarity.
663 ;; TODO: Add debug output.
664 (lambda* (#:key (make-flags '()) #:allow-other-keys)
665 (zero? (apply system* "make" "shared_lib" make-flags)))))))
666 (native-inputs
667 `(("parallel" ,parallel)
668 ("perl" ,perl)
669 ("procps" ,procps)
670 ("python" ,python-2)
671 ("which" ,which)))
672 (inputs
673 `(("bzip2" ,bzip2)
674 ("gflags" ,gflags)
675 ("jemalloc" ,jemalloc)
676 ("lz4" ,lz4)
677 ("snappy" ,snappy)
678 ("zlib" ,zlib)))
679 (home-page "http://rocksdb.org/")
680 (synopsis "Persistent key-value store for fast storage")
681 (description
682 "RocksDB is a library that forms the core building block for a fast
683 key-value server, especially suited for storing data on flash drives. It
684 has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
685 between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
686 (RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
687 compactions, making it specially suitable for storing multiple terabytes of
688 data in a single database. RocksDB is partially based on @code{LevelDB}.")
689 ;; RocksDB is BSD-3 and the JNI adapter is Apache 2.0.
690 (license (list license:bsd-3 license:asl2.0))))
691
692 (define-public sparql-query
693 (package
694 (name "sparql-query")
695 (version "1.1")
696 (source (origin
697 (method url-fetch)
698 (uri (string-append "https://github.com/tialaramex/"
699 name "/archive/" version ".tar.gz"))
700 (sha256
701 (base32 "0yq3k20472rv8npcc420q9ab6idy584g5y0q501d360k5q0ggr8w"))
702 (file-name (string-append name "-" version ".tar.gz"))))
703 (build-system gnu-build-system)
704 (inputs
705 `(("readline" ,readline)
706 ("ncurses" ,ncurses)
707 ("glib" ,glib)
708 ("libxml2" ,libxml2)
709 ("curl" ,curl)))
710 (native-inputs
711 `(("pkg-config" ,pkg-config)))
712 (arguments
713 `(#:make-flags '("CC=gcc")
714 #:phases
715 (modify-phases %standard-phases
716 (delete 'configure)
717 ;; The Makefile uses git to obtain versioning information. This phase
718 ;; substitutes the git invocation with the package version.
719 (add-after 'unpack 'remove-git-dependency
720 (lambda _
721 (substitute* "Makefile"
722 (("^gitrev :=.*$")
723 (string-append "gitrev = \"v" ,version "\"")))))
724 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
725 ;; This replacement does the same thing, except for using $PREFIX/bin
726 ;; instead.
727 (replace 'install
728 (lambda* (#:key outputs #:allow-other-keys)
729 (let* ((out (assoc-ref outputs "out"))
730 (bin (string-append out "/bin")))
731 (install-file "sparql-query" bin)
732 (system* "ln" "--symbolic"
733 (string-append bin "/sparql-query")
734 (string-append bin "/sparql-update")))))
735 (replace 'check
736 (lambda* (#:key make-flags #:allow-other-keys)
737 (and
738 (zero? (apply system* "make" `(,@make-flags "scan-test")))
739 (zero? (system "./scan-test"))))))))
740 (home-page "https://github.com/tialaramex/sparql-query/")
741 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
742 (description "Sparql-query is a command-line tool for accessing SPARQL
743 endpoints over HTTP. It has been intentionally designed to 'feel' similar to
744 tools for interrogating SQL databases. For example, you can enter a query over
745 several lines, using a semi-colon at the end of a line to indicate the end of
746 your query. It also supports readline so that you can more easily recall and
747 edit previous queries, even across sessions. It can be used non-interactively,
748 for example from a shell script.")
749 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
750 ;; others (like sparql-query.c) contain a GPLv2+ license header.
751 (license (list license:gpl3+))))
752
753 (define-public sqlite
754 (package
755 (name "sqlite")
756 (version "3.17.0")
757 (source (origin
758 (method url-fetch)
759 (uri (let ((numeric-version
760 (match (string-split version #\.)
761 ((first-digit other-digits ...)
762 (string-append first-digit
763 (string-pad-right
764 (string-concatenate
765 (map (cut string-pad <> 2 #\0)
766 other-digits))
767 6 #\0))))))
768 (string-append "https://sqlite.org/2017/sqlite-autoconf-"
769 numeric-version ".tar.gz")))
770 (sha256
771 (base32
772 "0k472gq0p706jq4529p60znvw02hdf172qxgbdv59q0n7anqbr54"))))
773 (build-system gnu-build-system)
774 (inputs `(("readline" ,readline)))
775 (arguments
776 `(#:configure-flags
777 ;; Add -DSQLITE_SECURE_DELETE, -DSQLITE_ENABLE_UNLOCK_NOTIFY and
778 ;; -DSQLITE_ENABLE_DBSTAT_VTAB to CFLAGS. GNU Icecat will refuse
779 ;; to use the system SQLite unless these options are enabled.
780 (list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
781 "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
782 "-DSQLITE_ENABLE_DBSTAT_VTAB"))))
783 (home-page "https://www.sqlite.org/")
784 (synopsis "The SQLite database management system")
785 (description
786 "SQLite is a software library that implements a self-contained, serverless,
787 zero-configuration, transactional SQL database engine. SQLite is the most
788 widely deployed SQL database engine in the world. The source code for SQLite
789 is in the public domain.")
790 (license license:public-domain)))
791
792 (define-public tdb
793 (package
794 (name "tdb")
795 (version "1.3.14")
796 (source (origin
797 (method url-fetch)
798 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
799 version ".tar.gz"))
800 (sha256
801 (base32
802 "1sfbia8xyaywgx9zy7x618vrvyx9gc3cgqf763shsii9javlnz9s"))))
803 (build-system gnu-build-system)
804 (arguments
805 '(#:phases
806 (modify-phases %standard-phases
807 (replace 'configure
808 (lambda* (#:key outputs #:allow-other-keys)
809 (let ((out (assoc-ref outputs "out")))
810 ;; The 'configure' script is a wrapper for Waf and
811 ;; doesn't recognize things like '--enable-fast-install'.
812 (zero? (system* "./configure"
813 (string-append "--prefix=" out)))))))))
814 (native-inputs
815 `(;; TODO: Build the documentation.
816 ;; ("docbook-xsl" ,docbook-xsl)
817 ;; ("libxml2" ,libxml2)
818 ;; ("libxslt" ,libxslt)
819 ("python" ,python-2))) ;for the Waf build system
820 (home-page "https://tdb.samba.org/")
821 (synopsis "Trivial database")
822 (description
823 "TDB is a Trivial Database. In concept, it is very much like GDBM,
824 and BSD's DB except that it allows multiple simultaneous writers and uses
825 locking internally to keep writers from trampling on each other. TDB is also
826 extremely small.")
827 (license license:lgpl3+)))
828
829 (define-public perl-dbi
830 (package
831 (name "perl-dbi")
832 (version "1.636")
833 (source (origin
834 (method url-fetch)
835 (uri (string-append
836 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
837 version ".tar.gz"))
838 (sha256
839 (base32
840 "0v37vnr5p0bx396cj0lb5kb69jbryq2mspp602hbgd04gklxqzcg"))))
841 (build-system perl-build-system)
842 (synopsis "Database independent interface for Perl")
843 (description "This package provides an database interface for Perl.")
844 (home-page "http://search.cpan.org/dist/DBI")
845 (license license:perl-license)))
846
847 (define-public perl-dbix-class
848 (package
849 (name "perl-dbix-class")
850 (version "0.082840")
851 (source
852 (origin
853 (method url-fetch)
854 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
855 "DBIx-Class-" version ".tar.gz"))
856 (sha256
857 (base32
858 "1vw1f756g8m5hq11nqf5dk2cw2y4mqq91ca5p75fn5g3fp8syja0"))))
859 (build-system perl-build-system)
860 (native-inputs
861 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
862 ("perl-file-temp" ,perl-file-temp)
863 ("perl-package-stash" ,perl-package-stash)
864 ("perl-test-deep" ,perl-test-deep)
865 ("perl-test-exception" ,perl-test-exception)
866 ("perl-test-warn" ,perl-test-warn)))
867 (propagated-inputs
868 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
869 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
870 ("perl-class-inspector" ,perl-class-inspector)
871 ("perl-config-any" ,perl-config-any)
872 ("perl-context-preserve" ,perl-context-preserve)
873 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
874 ("perl-data-page" ,perl-data-page)
875 ("perl-dbi" ,perl-dbi)
876 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
877 ("perl-hash-merge" ,perl-hash-merge)
878 ("perl-module-find" ,perl-module-find)
879 ("perl-moo" ,perl-moo)
880 ("perl-mro-compat" ,perl-mro-compat)
881 ("perl-namespace-clean" ,perl-namespace-clean)
882 ("perl-path-class" ,perl-path-class)
883 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
884 ("perl-scope-guard" ,perl-scope-guard)
885 ("perl-sql-abstract" ,perl-sql-abstract)
886 ("perl-sub-name" ,perl-sub-name)
887 ("perl-text-balanced" ,perl-text-balanced)
888 ("perl-try-tiny" ,perl-try-tiny)))
889 (home-page "http://search.cpan.org/dist/DBIx-Class")
890 (synopsis "Extensible and flexible object <-> relational mapper")
891 (description "An SQL to OO mapper with an object API inspired by
892 Class::DBI (with a compatibility layer as a springboard for porting) and a
893 resultset API that allows abstract encapsulation of database operations. It
894 aims to make representing queries in your code as perl-ish as possible while
895 still providing access to as many of the capabilities of the database as
896 possible, including retrieving related records from multiple tables in a
897 single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
898 \"ORDER BY\" and \"HAVING\" support.")
899 (license license:perl-license)))
900
901 (define-public perl-dbix-class-cursor-cached
902 (package
903 (name "perl-dbix-class-cursor-cached")
904 (version "1.001004")
905 (source
906 (origin
907 (method url-fetch)
908 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
909 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
910 (sha256
911 (base32
912 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
913 (build-system perl-build-system)
914 (native-inputs
915 `(("perl-cache-cache" ,perl-cache-cache)
916 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
917 (propagated-inputs
918 `(("perl-carp-clan" ,perl-carp-clan)
919 ("perl-dbix-class" ,perl-dbix-class)))
920 (home-page "http://search.cpan.org/dist/DBIx-Class-Cursor-Cached")
921 (synopsis "Cursor with built-in caching support")
922 (description "DBIx::Class::Cursor::Cached provides a cursor class with
923 built-in caching support.")
924 (license license:perl-license)))
925
926 (define-public perl-dbix-class-introspectablem2m
927 (package
928 (name "perl-dbix-class-introspectablem2m")
929 (version "0.001002")
930 (source
931 (origin
932 (method url-fetch)
933 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
934 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
935 (sha256
936 (base32
937 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
938 (build-system perl-build-system)
939 (propagated-inputs
940 `(("perl-dbix-class" ,perl-dbix-class)))
941 (home-page "http://search.cpan.org/dist/DBIx-Class-IntrospectableM2M")
942 (synopsis "Introspect many-to-many relationships")
943 (description "Because the many-to-many relationships are not real
944 relationships, they can not be introspected with DBIx::Class. Many-to-many
945 relationships are actually just a collection of convenience methods installed
946 to bridge two relationships. This DBIx::Class component can be used to store
947 all relevant information about these non-relationships so they can later be
948 introspected and examined.")
949 (license license:perl-license)))
950
951 (define-public perl-dbix-class-schema-loader
952 (package
953 (name "perl-dbix-class-schema-loader")
954 (version "0.07046")
955 (source
956 (origin
957 (method url-fetch)
958 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
959 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
960 (sha256
961 (base32
962 "08cgn0dx42y9xsxas9np7s55a7qmy4kf6sfmx0jmk4hryvbapml3"))))
963 (build-system perl-build-system)
964 (native-inputs
965 `(("perl-config-any" ,perl-config-any)
966 ("perl-config-general" ,perl-config-general)
967 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
968 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
969 ("perl-moose" ,perl-moose)
970 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
971 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
972 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
973 ("perl-test-deep" ,perl-test-deep)
974 ("perl-test-differences" ,perl-test-differences)
975 ("perl-test-exception" ,perl-test-exception)
976 ("perl-test-pod" ,perl-test-pod)
977 ("perl-test-warn" ,perl-test-warn)))
978 (propagated-inputs
979 `(("perl-class-unload" ,perl-class-unload)
980 ("perl-class-inspector" ,perl-class-inspector)
981 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
982 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
983 ("perl-carp-clan" ,perl-carp-clan)
984 ("perl-data-dump" ,perl-data-dump)
985 ("perl-dbix-class" ,perl-dbix-class)
986 ("perl-hash-merge" ,perl-hash-merge)
987 ("perl-list-moreutils" ,perl-list-moreutils)
988 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
989 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
990 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
991 ("perl-namespace-clean" ,perl-namespace-clean)
992 ("perl-mro-compat" ,perl-mro-compat)
993 ("perl-scope-guard" ,perl-scope-guard)
994 ("perl-string-camelcase" ,perl-string-camelcase)
995 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
996 ("perl-sub-name" ,perl-sub-name)
997 ("perl-try-tiny" ,perl-try-tiny)))
998 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
999 (home-page "http://search.cpan.org/dist/DBIx-Class-Schema-Loader")
1000 (synopsis "Create a DBIx::Class::Schema based on a database")
1001 (description "DBIx::Class::Schema::Loader automates the definition of a
1002 DBIx::Class::Schema by scanning database table definitions and setting up the
1003 columns, primary keys, unique constraints and relationships.")
1004 (license license:perl-license)))
1005
1006 (define-public perl-dbd-pg
1007 (package
1008 (name "perl-dbd-pg")
1009 (version "3.5.3")
1010 (source
1011 (origin
1012 (method url-fetch)
1013 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
1014 "DBD-Pg-" version ".tar.gz"))
1015 (sha256
1016 (base32
1017 "03m9w1cd0yyrbqwkwcl92j1cpmasmm69f3hwvcrlfsi5fnwsk63y"))))
1018 (build-system perl-build-system)
1019 (native-inputs
1020 `(("perl-dbi" ,perl-dbi)))
1021 (propagated-inputs
1022 `(("perl-dbi" ,perl-dbi)
1023 ("postgresql" ,postgresql)))
1024 (home-page "http://search.cpan.org/dist/DBD-Pg")
1025 (synopsis "DBI PostgreSQL interface")
1026 (description "This package provides a PostgreSQL driver for the Perl5
1027 @dfn{Database Interface} (DBI).")
1028 (license license:perl-license)))
1029
1030 (define-public perl-dbd-mysql
1031 (package
1032 (name "perl-dbd-mysql")
1033 (version "4.043")
1034 (source
1035 (origin
1036 (method url-fetch)
1037 (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
1038 "DBD-mysql-" version ".tar.gz"))
1039 (sha256
1040 (base32
1041 "16bg7l28n65ngi1abjxvwk906a80i2vd5vzjn812dx8phdg8d7v2"))
1042 (patches (search-patches "perl-dbd-mysql-CVE-2017-10788.patch"))))
1043 (build-system perl-build-system)
1044 ;; Tests require running MySQL server
1045 (arguments `(#:tests? #f))
1046 (propagated-inputs
1047 `(("perl-dbi" ,perl-dbi)
1048 ("mysql" ,mysql)))
1049 (home-page "http://search.cpan.org/dist/DBD-mysql")
1050 (synopsis "DBI MySQL interface")
1051 (description "This package provides a MySQL driver for the Perl5
1052 @dfn{Database Interface} (DBI).")
1053 (license license:perl-license)))
1054
1055 (define-public perl-dbd-sqlite
1056 (package
1057 (name "perl-dbd-sqlite")
1058 (version "1.54")
1059 (source (origin
1060 (method url-fetch)
1061 (uri (string-append
1062 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
1063 version ".tar.gz"))
1064 (sha256
1065 (base32
1066 "0sbj9lx9syzpknvjv8cz9jndg32qz775vy2prgq305npv3dsca9r"))))
1067 (build-system perl-build-system)
1068 (inputs `(("sqlite" ,sqlite)))
1069 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
1070 (synopsis "SQlite interface for Perl")
1071 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
1072 the entire thing in the distribution. So in order to get a fast transaction
1073 capable RDBMS working for your Perl project you simply have to install this
1074 module, and nothing else.")
1075 (license license:perl-license)
1076 (home-page "http://search.cpan.org/~ishigaki/DBD-SQLite/lib/DBD/SQLite.pm")))
1077
1078 (define-public perl-sql-abstract
1079 (package
1080 (name "perl-sql-abstract")
1081 (version "1.81")
1082 (source
1083 (origin
1084 (method url-fetch)
1085 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1086 "SQL-Abstract-" version ".tar.gz"))
1087 (sha256
1088 (base32
1089 "17sgwq3mvqjhv3b77cnvrq60xgp8harjhlnvpwmxc914rqc5ckaz"))))
1090 (build-system perl-build-system)
1091 (native-inputs
1092 `(("perl-test-deep" ,perl-test-deep)
1093 ("perl-test-exception" ,perl-test-exception)
1094 ("perl-test-warn" ,perl-test-warn)))
1095 (propagated-inputs
1096 `(("perl-hash-merge" ,perl-hash-merge)
1097 ("perl-moo" ,perl-moo)
1098 ("perl-mro-compat" ,perl-mro-compat)
1099 ("perl-text-balanced" ,perl-text-balanced)))
1100 (home-page "http://search.cpan.org/dist/SQL-Abstract")
1101 (synopsis "Generate SQL from Perl data structures")
1102 (description "This module was inspired by the excellent DBIx::Abstract.
1103 While based on the concepts used by DBIx::Abstract, the concepts used have
1104 been modified to make the SQL easier to generate from Perl data structures.
1105 The underlying idea is for this module to do what you mean, based on the data
1106 structures you provide it, so that you don't have to modify your code every
1107 time your data changes.")
1108 (license license:perl-license)))
1109
1110 (define-public perl-sql-splitstatement
1111 (package
1112 (name "perl-sql-splitstatement")
1113 (version "1.00020")
1114 (source
1115 (origin
1116 (method url-fetch)
1117 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
1118 "SQL-SplitStatement-" version ".tar.gz"))
1119 (sha256
1120 (base32
1121 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
1122 (build-system perl-build-system)
1123 (native-inputs
1124 `(("perl-test-exception" ,perl-test-exception)))
1125 (propagated-inputs
1126 `(("perl-class-accessor" ,perl-class-accessor)
1127 ("perl-list-moreutils" ,perl-list-moreutils)
1128 ("perl-regexp-common" ,perl-regexp-common)
1129 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
1130 (home-page "http://search.cpan.org/dist/SQL-SplitStatement")
1131 (synopsis "Split SQL code into atomic statements")
1132 (description "This module tries to split any SQL code, even including
1133 non-standard extensions, into the atomic statements it is composed of.")
1134 (license license:perl-license)))
1135
1136 (define-public perl-sql-tokenizer
1137 (package
1138 (name "perl-sql-tokenizer")
1139 (version "0.24")
1140 (source
1141 (origin
1142 (method url-fetch)
1143 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
1144 "SQL-Tokenizer-" version ".tar.gz"))
1145 (sha256
1146 (base32
1147 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
1148 (build-system perl-build-system)
1149 (home-page "http://search.cpan.org/dist/SQL-Tokenizer")
1150 (synopsis "SQL tokenizer")
1151 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
1152 claim to be a parser or query verifier. It just creates sane tokens from a
1153 valid SQL query.")
1154 (license license:perl-license)))
1155
1156 (define-public unixodbc
1157 (package
1158 (name "unixodbc")
1159 (version "2.3.4")
1160 (source (origin
1161 (method url-fetch)
1162 (uri
1163 (string-append
1164 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
1165 version ".tar.gz"))
1166 (sha256
1167 (base32 "0f8y88rcc2akjvjv5y66yx7k0ms9h1s0vbcfy25j93didflhj59f"))))
1168 (build-system gnu-build-system)
1169 (synopsis "Data source abstraction library")
1170 (description "Unixodbc is a library providing an API with which to access
1171 data sources. Data sources include SQL Servers and any software with an ODBC
1172 Driver.")
1173 (license license:lgpl2.1+)
1174 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
1175 (home-page "http://www.unixodbc.org")))
1176
1177 (define-public unqlite
1178 (package
1179 (name "unqlite")
1180 (version "1.1.6")
1181 (source (origin
1182 (method url-fetch)
1183 ;; Contains bug fixes against the official release, and has an
1184 ;; autotooled build system.
1185 (uri (string-append "https://github.com/aidin36/tocc/releases/"
1186 "download/v1.0.0/"
1187 "unqlite-unofficial-" version ".tar.gz"))
1188 (sha256
1189 (base32
1190 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
1191 (build-system gnu-build-system)
1192 (arguments `(#:tests? #f)) ;No check target
1193 (home-page "http://www.unqlite.org")
1194 (synopsis "In-memory key/value and document store")
1195 (description
1196 "UnQLite is an in-process software library which implements a
1197 self-contained, serverless, zero-configuration, transactional NoSQL
1198 database engine. UnQLite is a document store database similar to
1199 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
1200 similar to BerkeleyDB, LevelDB, etc.")
1201 (license license:bsd-2)))
1202
1203 (define-public redis
1204 (package
1205 (name "redis")
1206 (version "4.0.1")
1207 (source (origin
1208 (method url-fetch)
1209 (uri (string-append "http://download.redis.io/releases/redis-"
1210 version".tar.gz"))
1211 (sha256
1212 (base32
1213 "14bm8lkhylc93r4dgl7kkzzpw2xq7gr6w6h80n3jazqnx5mcsj90"))))
1214 (build-system gnu-build-system)
1215 (arguments
1216 '(#:tests? #f ; tests related to master/slave and replication fail
1217 #:phases (modify-phases %standard-phases
1218 (delete 'configure))
1219 #:make-flags `("CC=gcc"
1220 "MALLOC=libc"
1221 "LDFLAGS=-ldl"
1222 ,(string-append "PREFIX="
1223 (assoc-ref %outputs "out")))))
1224 (synopsis "Key-value cache and store")
1225 (description "Redis is an advanced key-value cache and store. Redis
1226 supports many data structures including strings, hashes, lists, sets, sorted
1227 sets, bitmaps and hyperloglogs.")
1228 (home-page "http://redis.io/")
1229 (license license:bsd-3)))
1230
1231 (define-public kyotocabinet
1232 (package
1233 (name "kyotocabinet")
1234 (version "1.2.76")
1235 (source (origin
1236 (method url-fetch)
1237 (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
1238 name "-" version ".tar.gz"))
1239 (sha256
1240 (base32
1241 "0g6js20x7vnpq4p8ghbw3mh9wpqksya9vwhzdx6dnlf354zjsal1"))))
1242 (build-system gnu-build-system)
1243 (arguments
1244 `(#:configure-flags
1245 (list
1246 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
1247 (string-append "LDFLAGS=-Wl,-rpath="
1248 (assoc-ref %outputs "out") "/lib"))))
1249 (inputs `(("zlib" ,zlib)))
1250 (home-page "http://fallabs.com/kyotocabinet/")
1251 (synopsis
1252 "Kyoto Cabinet is a modern implementation of the DBM database")
1253 (description
1254 "Kyoto Cabinet is a standalone file-based database that supports Hash
1255 and B+ Tree data storage models. It is a fast key-value lightweight
1256 database and supports many programming languages. It is a NoSQL database.")
1257 (license license:gpl3+)))
1258
1259 (define-public tokyocabinet
1260 (package
1261 (name "tokyocabinet")
1262 (version "1.4.48")
1263 (source
1264 (origin
1265 (method url-fetch)
1266 (uri (string-append "http://fallabs.com/tokyocabinet/"
1267 name "-" version ".tar.gz"))
1268 (sha256
1269 (base32
1270 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
1271 (build-system gnu-build-system)
1272 (arguments
1273 `(#:configure-flags
1274 (list "--enable-pthread" "--enable-off64" "--enable-fastest"
1275 (string-append "LDFLAGS=-Wl,-rpath="
1276 (assoc-ref %outputs "out") "/lib"))))
1277 (inputs
1278 `(("zlib" ,zlib)))
1279 (home-page "http://fallabs.com/tokyocabinet/")
1280 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
1281 (description
1282 "Tokyo Cabinet is a library of routines for managing a database.
1283 The database is a simple data file containing records, each is a pair of a
1284 key and a value. Every key and value is serial bytes with variable length.
1285 Both binary data and character string can be used as a key and a value.
1286 There is neither concept of data tables nor data types. Records are
1287 organized in hash table, B+ tree, or fixed-length array.")
1288 (license license:lgpl2.1+)))
1289
1290 (define-public wiredtiger
1291 (package
1292 (name "wiredtiger")
1293 (version "2.9.1")
1294 (source (origin
1295 (method url-fetch)
1296 (uri (string-append
1297 "http://source.wiredtiger.com/releases/wiredtiger-"
1298 version ".tar.bz2"))
1299 (sha256
1300 (base32
1301 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
1302 (build-system gnu-build-system)
1303 (arguments
1304 '(#:configure-flags '("--enable-lz4" "--enable-zlib")
1305 #:phases
1306 (modify-phases %standard-phases
1307 (add-before 'check 'disable-test/fops
1308 (lambda _
1309 ;; XXX: timed out after 3600 seconds of silence
1310 (substitute* "Makefile"
1311 (("test/fops") ""))
1312 #t)))))
1313 (inputs
1314 `(("lz4" ,lz4)
1315 ("zlib" ,zlib)))
1316 (home-page "http://source.wiredtiger.com/")
1317 (synopsis "NoSQL data engine")
1318 (description
1319 "WiredTiger is an extensible platform for data management. It supports
1320 row-oriented storage (where all columns of a row are stored together),
1321 column-oriented storage (where columns are stored in groups, allowing for
1322 more efficient access and storage of column subsets) and log-structured merge
1323 trees (LSM), for sustained throughput under random insert workloads.")
1324 (license license:gpl3) ; or GPL-2
1325 ;; configure.ac: WiredTiger requires a 64-bit build.
1326 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
1327
1328 (define-public perl-db-file
1329 (package
1330 (name "perl-db-file")
1331 (version "1.840")
1332 (source
1333 (origin
1334 (method url-fetch)
1335 (uri (string-append
1336 "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
1337 version
1338 ".tar.gz"))
1339 (sha256
1340 (base32
1341 "1i5jz85z4hpx15lw6ix27pyvrf0ziyh4z33lii4d3wnhz83lg1mp"))))
1342 (build-system perl-build-system)
1343 (inputs `(("bdb" ,bdb)))
1344 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
1345 (arguments
1346 `(#:phases (modify-phases %standard-phases
1347 (add-before
1348 'configure 'modify-config.in
1349 (lambda* (#:key inputs #:allow-other-keys)
1350 (substitute* "config.in"
1351 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
1352 #t)))))
1353 (home-page "http://search.cpan.org/dist/DB_File")
1354 (synopsis
1355 "Perl5 access to Berkeley DB version 1.x")
1356 (description
1357 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
1358 (license license:perl-license)))
1359
1360 (define-public lmdb
1361 (package
1362 (name "lmdb")
1363 (version "0.9.21")
1364 (source (origin
1365 (method url-fetch)
1366 (uri (string-append "https://github.com/LMDB/lmdb/archive/"
1367 "LMDB_" version ".tar.gz"))
1368 (sha256
1369 (base32
1370 "0ndmj07hkm2ic60z1f4rdscxs7pq45hk9fibjyv5nhfclhsvd1qi"))))
1371 (build-system gnu-build-system)
1372 (arguments
1373 `(#:test-target "test"
1374 #:phases
1375 (modify-phases %standard-phases
1376 (replace 'configure
1377 (lambda* (#:key outputs #:allow-other-keys)
1378 (chdir (string-append
1379 (getenv "PWD") "/lmdb-LMDB_" ,version "/libraries/liblmdb"))
1380 (substitute* "Makefile"
1381 (("/usr/local") (assoc-ref outputs "out")))
1382 #t)))))
1383 (home-page "https://symas.com/products/lightning-memory-mapped-database")
1384 (synopsis "Lightning Memory-Mapped Database library")
1385 (description
1386 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
1387 transactional database. Unlike more complex relational databases, LMDB handles
1388 only key-value pairs (stored as arbitrary byte arrays) and relies on the
1389 underlying operating system for caching and locking, keeping the code small and
1390 simple.
1391 The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
1392 disk-based databases with high read performance that scales linearly over
1393 multiple cores. The size of each database is limited only by the size of the
1394 virtual address space — not physical RAM.")
1395 (license license:openldap2.8)))
1396
1397 (define-public libpqxx
1398 (package
1399 (name "libpqxx")
1400 (version "4.0.1")
1401 (source (origin
1402 (method url-fetch)
1403 (uri (string-append
1404 "http://pqxx.org/download/software/libpqxx/"
1405 name "-" version ".tar.gz"))
1406 (sha256
1407 (base32
1408 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
1409 (build-system gnu-build-system)
1410 (native-inputs
1411 `(("python" ,python-2)))
1412 (inputs `(("postgresql" ,postgresql)))
1413 (arguments
1414 `(#:tests? #f ; # FAIL: 1
1415 #:phases
1416 (modify-phases %standard-phases
1417 (add-before 'configure 'fix-sed-command
1418 (lambda _
1419 ;; Newer sed versions error out if double brackets are not used.
1420 (substitute* "configure"
1421 (("\\[:space:\\]") "[[:space:]]"))
1422 #t)))))
1423 (synopsis "C++ connector for PostgreSQL")
1424 (description
1425 "Libpqxx is a C++ library to enable user programs to communicate with the
1426 PostgreSQL database back-end. The database back-end can be local or it may be
1427 on another machine, accessed via TCP/IP.")
1428 (home-page "http://pqxx.org/")
1429 (license license:bsd-3)))
1430
1431 (define-public python-peewee
1432 (package
1433 (name "python-peewee")
1434 (version "2.8.3")
1435 (source
1436 (origin
1437 (method url-fetch)
1438 (uri (pypi-uri "peewee" version))
1439 (sha256
1440 (base32
1441 "1605bk11s7aap2q4qyba93rx7yfh8b11kk0cqi08z8klx2iar8yd"))))
1442 (build-system python-build-system)
1443 (arguments
1444 `(#:tests? #f)) ; Fails to import test data
1445 (native-inputs
1446 `(("python-cython" ,python-cython)))
1447 (home-page "https://github.com/coleifer/peewee/")
1448 (synopsis "Small object-relational mapping utility")
1449 (description
1450 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
1451 handles converting between pythonic values and those used by databases, so you
1452 can use Python types in your code without having to worry. It has built-in
1453 support for sqlite, mysql and postgresql. If you already have a database, you
1454 can autogenerate peewee models using @code{pwiz}, a model generator.")
1455 (license license:expat)))
1456
1457 (define-public python2-peewee
1458 (package-with-python2 python-peewee))
1459
1460 (define-public sqlcipher
1461 (package
1462 (name "sqlcipher")
1463 (version "3.3.1")
1464 (source
1465 (origin
1466 (method url-fetch)
1467 (uri (string-append "https://github.com/sqlcipher/" name
1468 "/archive/v" version ".tar.gz"))
1469 (sha256
1470 (base32 "1gv58dlbpzrmznly52yqbxgvii0ib88zr3aszla1bsypwjr6flff"))
1471 (file-name (string-append name "-" version ".tar.gz"))))
1472 (build-system gnu-build-system)
1473 (inputs
1474 `(("libcrypto" ,openssl)
1475 ("libtcl8.6" ,tcl))) ; required for running the tests
1476 (native-inputs
1477 `(("tcl" ,tcl)))
1478 (arguments
1479 '(#:configure-flags
1480 '("--enable-tempstore=yes"
1481 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
1482 "LDFLAGS=-lcrypto -ltcl8.6"
1483 "--disable-tcl")
1484 ;; tests cannot be run from the Makefile
1485 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
1486 #:test-target "testfixture"
1487 #:phases
1488 (modify-phases %standard-phases
1489 (add-before 'check 'build-test-runner
1490 (assoc-ref %standard-phases 'check))
1491 (replace 'check
1492 (lambda _
1493 (zero?
1494 (system* "./testfixture" "test/crypto.test")))))))
1495 (home-page "https://www.zetetic.net/sqlcipher/")
1496 (synopsis
1497 "Library providing transparent encryption of SQLite database files")
1498 (description "SQLCipher is an implementation of SQLite, extended to
1499 provide transparent 256-bit AES encryption of database files. Pages are
1500 encrypted before being written to disk and are decrypted when read back. It’s
1501 well suited for protecting embedded application databases and for mobile
1502 development.")
1503 ;; The source files
1504 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
1505 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
1506 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
1507 ;; source files are in the public domain.
1508 (license (list license:public-domain license:bsd-3))))
1509
1510 (define-public python-pyodbc-c
1511 (package
1512 (name "python-pyodbc-c")
1513 (version "3.1.4")
1514 (source
1515 (origin
1516 (method url-fetch)
1517 (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
1518 "archive.tar.gz?ref=v" version))
1519 (sha256
1520 (base32
1521 "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
1522 (file-name (string-append name "-" version ".tar.gz"))))
1523 (build-system python-build-system)
1524 (inputs
1525 `(("unixodbc" ,unixodbc)))
1526 (arguments
1527 `(;; No unit tests exist.
1528 #:tests? #f))
1529 (home-page "https://github.com/mkleehammer/pyodbc")
1530 (synopsis "Python ODBC Library")
1531 (description "@code{python-pyodbc-c} provides a Python DB-API driver
1532 for ODBC.")
1533 (license (license:x11-style "file://LICENSE.TXT"))))
1534
1535 (define-public python2-pyodbc-c
1536 (package-with-python2 python-pyodbc-c))
1537
1538 (define-public mdbtools
1539 (package
1540 (name "mdbtools")
1541 (version "0.7.1")
1542 (source
1543 (origin
1544 (method url-fetch)
1545 (uri (string-append "https://github.com/brianb/mdbtools/archive/"
1546 version ".tar.gz"))
1547 (sha256
1548 (base32
1549 "05hbmxcq173kzb899gdi3bz2qcc1vi3n1qbbkwpsvrq7ggf11wyw"))
1550 (file-name (string-append name "-" version ".tar.gz"))))
1551 (build-system gnu-build-system)
1552 (inputs
1553 `(("glib" ,glib)))
1554 (native-inputs
1555 `(("autoconf" ,autoconf)
1556 ("automake" ,automake)
1557 ("libtool" ,libtool)
1558 ("pkg-config" ,pkg-config)
1559 ("txt2man" ,txt2man)
1560 ("which" ,which)))
1561 (arguments
1562 `(#:phases
1563 (modify-phases %standard-phases
1564 (add-before 'configure 'autoreconf
1565 (lambda _
1566 (zero? (system* "autoreconf" "-vfi")))))))
1567 (home-page "http://mdbtools.sourceforge.net/")
1568 (synopsis "Read Microsoft Access databases")
1569 (description "MDB Tools is a set of tools and applications to read the
1570 proprietary MDB file format used in Microsoft's Access database package. This
1571 includes programs to export schema and data from Microsoft's Access database
1572 file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
1573 etc., and an SQL engine for performing simple SQL queries.")
1574 (license (list license:lgpl2.0
1575 license:gpl2+))))
1576
1577 (define-public python-lmdb
1578 (package
1579 (name "python-lmdb")
1580 (version "0.92")
1581 (source (origin
1582 (method url-fetch)
1583 (uri (pypi-uri "lmdb" version))
1584 (sha256
1585 (base32
1586 "01nw6r08jkipx6v92kw49z34wmwikrpvc5j9xawdiyg1n2526wrx"))
1587 (modules '((guix build utils)))
1588 (snippet
1589 ;; Delete bundled lmdb source files.
1590 '(for-each delete-file (list "lib/lmdb.h"
1591 "lib/mdb.c"
1592 "lib/midl.c"
1593 "lib/midl.h")))))
1594 (build-system python-build-system)
1595 (inputs
1596 `(("lmdb" ,lmdb)))
1597 (arguments
1598 `(#:phases
1599 (modify-phases %standard-phases
1600 (add-before 'build 'use-system-lmdb
1601 (lambda* (#:key inputs #:allow-other-keys)
1602 (let ((lmdb (assoc-ref inputs "lmdb")))
1603 (setenv "LMDB_FORCE_SYSTEM" "set")
1604 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
1605 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
1606 #t))))
1607 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
1608 #:tests? #f))
1609 (home-page "https://github.com/dw/py-lmdb")
1610 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
1611 (description
1612 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
1613 Memory-Mapped Database} (LMDB), a high-performance key-value store.")
1614 (license
1615 (list license:openldap2.8
1616 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
1617 ;; but not actually needed on platforms currently supported by Guix.
1618 license:bsd-3))))
1619
1620 (define-public python2-lmdb
1621 (package-with-python2 python-lmdb))