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