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