1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2012, 2014, 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
5 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
8 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
10 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
12 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
13 ;;; Copyright © 2016 David Craven <david@craven.ch>
14 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
15 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
16 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
19 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
21 ;;; This file is part of GNU Guix.
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36 (define-module (gnu packages databases)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages algebra)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages avahi)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages bash)
43 #:use-module (gnu packages bison)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages crypto)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages cyrus-sasl)
50 #:use-module (gnu packages emacs)
51 #:use-module (gnu packages gettext)
52 #:use-module (gnu packages glib)
53 #:use-module (gnu packages gnupg)
54 #:use-module (gnu packages jemalloc)
55 #:use-module (gnu packages language)
56 #:use-module (gnu packages libevent)
57 #:use-module (gnu packages linux)
58 #:use-module (gnu packages man)
59 #:use-module (gnu packages ncurses)
60 #:use-module (gnu packages parallel)
61 #:use-module (gnu packages pcre)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages popt)
65 #:use-module (gnu packages python)
66 #:use-module (gnu packages rdf)
67 #:use-module (gnu packages readline)
68 #:use-module (gnu packages tcl)
69 #:use-module (gnu packages tls)
70 #:use-module (gnu packages xml)
71 #:use-module ((guix licenses) #:prefix license:)
72 #:use-module (guix packages)
73 #:use-module (guix download)
74 #:use-module (guix build-system gnu)
75 #:use-module (guix build-system perl)
76 #:use-module (guix build-system python)
77 #:use-module (guix build-system cmake)
78 #:use-module (guix utils)
79 #:use-module (srfi srfi-26)
80 #:use-module (ice-9 match))
88 (uri (string-append "https://github.com/garlik/4store/archive/v"
90 (file-name (string-append name "-" version ".tar.gz"))
92 (base32 "004fmcf1w75zhc1x3zc6kc97j4jqn2v5nhk6yb3z3cpfrhzi9j50"))
93 (patches (list (search-patch "4store-fix-buildsystem.patch")))))
94 (build-system gnu-build-system)
98 ("autoconf" ,autoconf)
99 ("automake" ,automake)
100 ("gettext" ,gettext-minimal)
102 ("pcre" ,pcre "bin") ;for 'pcre-config'
103 ("pkg-config" ,pkg-config)))
109 ("readline" ,readline)
111 ("cyrus-sasl" ,cyrus-sasl)
113 ("util-linux" ,util-linux)))
116 (modify-phases %standard-phases
117 (add-before 'configure 'generate-configure
119 (zero? (system* "./autogen.sh")))))))
120 ;; http://www.4store.org has been down for a while now.
121 (home-page "https://github.com/garlik/4store")
122 (synopsis "Clustered RDF storage and query engine")
123 (description "4store is a RDF/SPARQL store written in C, supporting
124 either single machines or networked clusters.")
125 (license license:gpl3+)))
133 (uri (string-append "mirror://gnu/gdbm/gdbm-"
137 "1smwz4x5qa4js0zf1w3asq6z7mh20zlgwbh2bk5dczw6xrk22yyr"))))
138 (arguments `(#:configure-flags '("--enable-libgdbm-compat")))
139 (build-system gnu-build-system)
140 (home-page "http://www.gnu.org.ua/software/gdbm")
142 "Hash library of database functions compatible with traditional dbm")
144 "GDBM is a library for manipulating hashed databases. It is used to
145 store key/value pairs in a file in a manner similar to the Unix dbm library
146 and provides interfaces to the traditional file format.")
147 (license license:gpl3+)))
155 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
159 "1isxx4jfmnh913jzhp8hhfngbk6dsg46f4kjpvvc56maj64jqqa7"))))
160 (build-system gnu-build-system)
161 (outputs '("out" ; programs, libraries, headers
162 "doc")) ; 94 MiB of HTML docs
164 '(#:tests? #f ; no check target available
165 #:disallowed-references ("doc")
169 (lambda* (#:key outputs #:allow-other-keys)
170 (let ((out (assoc-ref outputs "out"))
171 (doc (assoc-ref outputs "doc")))
172 ;; '--docdir' is not honored, so we need to patch.
173 (substitute* "dist/Makefile.in"
174 (("docdir[[:blank:]]*=.*")
175 (string-append "docdir = " doc "/share/doc/bdb")))
178 (system* "./dist/configure"
179 (string-append "--prefix=" out)
180 (string-append "CONFIG_SHELL=" (which "bash"))
181 (string-append "SHELL=" (which "bash"))
183 ;; Remove 7 MiB of .a files.
186 ;; The compatibility mode is needed by some packages,
190 ;; The following flag is needed so that the inclusion
191 ;; of db_cxx.h into C++ files works; it leads to
192 ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h.
195 (synopsis "Berkeley database")
197 "Berkeley DB is an embeddable database allowing developers the choice of
198 SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
199 ;; Starting with version 6, BDB is distributed under AGPL3. Many individual
200 ;; files are covered by the 3-clause BSD license.
201 (license (list license:agpl3+ license:bsd-3))
203 "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html")))
205 (define-public bdb-5.3
206 (package (inherit bdb)
209 (license (license:non-copyleft "file://LICENSE"
210 "See LICENSE in the distribution."))
213 (uri (string-append "http://download.oracle.com/berkeley-db/db-"
217 "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))))
219 `(#:tests? #f ; no check target available
220 #:disallowed-references ("doc")
224 (lambda* (#:key outputs #:allow-other-keys)
225 (let ((out (assoc-ref outputs "out"))
226 (doc (assoc-ref outputs "doc")))
227 ;; '--docdir' is not honored, so we need to patch.
228 (substitute* "dist/Makefile.in"
229 (("docdir[[:blank:]]*=.*")
230 (string-append "docdir = " doc "/share/doc/bdb")))
233 (system* "./dist/configure"
234 (string-append "--prefix=" out)
235 (string-append "CONFIG_SHELL=" (which "bash"))
236 (string-append "SHELL=" (which "bash"))
238 ;; Bdb doesn't recognize aarch64 as an architecture.
239 ,@(if (string=? "aarch64-linux" (%current-system))
240 '("--build=aarch64-unknown-linux-gnu")
243 ;; Remove 7 MiB of .a files.
246 ;; The compatibility mode is needed by some packages,
250 ;; The following flag is needed so that the inclusion
251 ;; of db_cxx.h into C++ files works; it leads to
252 ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h.
254 %standard-phases)))))
256 (define-public leveldb
262 (uri (string-append "https://github.com/google/leveldb"
263 "/archive/v" version ".tar.gz"))
264 (file-name (string-append name "-" version ".tar.gz"))
267 "0r36bcrj6b2afsp4aw1gjai3jbs1c7734pxpc1jz7hh9nasyiazm"))))
268 (build-system gnu-build-system)
270 '(#:make-flags (list "CC=gcc")
272 (modify-phases %standard-phases
275 ;; There is no install target, so we do it here.
276 (lambda* (#:key outputs #:allow-other-keys)
277 (let* ((out (assoc-ref outputs "out"))
278 (lib (string-append out "/lib"))
279 (include (string-append out "/include")))
280 (for-each (lambda (file)
281 (install-file file lib))
282 (find-files "out-shared" "^libleveldb\\.so.*$"))
283 (copy-recursively "include" include)
286 `(("snappy" ,snappy)))
287 (home-page "http://leveldb.org/")
288 (synopsis "Fast key-value storage library")
290 "LevelDB is a fast key-value storage library that provides an ordered
291 mapping from string keys to string values.")
292 (license license:bsd-3)))
294 (define-public memcached
302 "https://memcached.org/files/memcached-" version ".tar.gz"))
304 (base32 "0chwc0g7wfvcad36z8pf2jbgygdnm9nm1l6pwjsn3d2b089gh0f0"))))
305 (build-system gnu-build-system)
307 `(("libevent" ,libevent)
308 ("cyrus-sasl" ,cyrus-sasl)))
309 (home-page "https://memcached.org/")
310 (synopsis "In memory caching service")
311 (description "Memcached is a in memory key value store. It has a small
312 and generic API, and was originally intended for use with dynamic web
314 (license license:bsd-3)))
322 (uri (list (string-append
323 "http://dev.mysql.com/get/Downloads/MySQL-"
324 (version-major+minor version) "/"
325 name "-" version ".tar.gz")
327 "http://downloads.mysql.com/archives/get/file/"
328 name "-" version ".tar.gz")))
331 "1c8y54yk756179nx4dgg79dijmjdq5n8l057cnqsg70pjdpyfl9y"))))
332 (build-system cmake-build-system)
335 '("-DBUILD_CONFIG=mysql_release"
338 "-DDEFAULT_CHARSET=utf8"
339 "-DDEFAULT_COLLATION=utf8_general_ci"
340 "-DMYSQL_DATADIR=/var/lib/mysql"
341 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
342 "-DINSTALL_INFODIR=share/mysql/docs"
343 "-DINSTALL_MANDIR=share/man"
344 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
345 "-DINSTALL_SCRIPTDIR=bin"
346 "-DINSTALL_INCLUDEDIR=include/mysql"
347 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
348 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
349 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
350 "-DINSTALL_DOCDIR=share/mysql/docs"
351 "-DINSTALL_SHAREDIR=share/mysql"
352 ;; Get rid of test data.
353 "-DINSTALL_MYSQLTESTDIR="
354 "-DINSTALL_SQLBENCHDIR=")
355 #:phases (modify-phases %standard-phases
357 'unpack 'patch-boost-version
359 ;; Mysql wants boost-1.59.0 specifically
360 (substitute* "cmake/boost.cmake"
362 ,(match (string-split (package-version boost) #\.)
363 ((_ minor . _) minor))))))
365 'install 'remove-extra-binaries
366 (lambda* (#:key outputs #:allow-other-keys)
367 (let ((out (assoc-ref outputs "out")))
368 ;; Remove the 3 *_embedded files, which weigh in at
370 (for-each delete-file
371 (find-files (string-append out "/bin")
374 ;; On aarch64 the test suite runs out of memory and fails.
375 ,@(if (string-prefix? "aarch64-linux"
376 (or (%current-target-system) (%current-system)))
388 (home-page "http://www.mysql.com/")
389 (synopsis "Fast, easy to use, and popular database")
391 "MySQL is a fast, reliable, and easy to use relational database
392 management system that supports the standardized Structured Query
394 (license license:gpl2)))
396 (define-public mariadb
402 (uri (string-append "https://downloads.mariadb.org/f/"
403 name "-" version "/source/"
404 name "-" version ".tar.gz"))
407 "1mm0n8sl6grajk5rbrx55333laz5dg2abyl8mlsn7h8vdymfq1bj"))))
408 (build-system cmake-build-system)
411 '("-DBUILD_CONFIG=mysql_release"
412 ;; Linking with libarchive fails, like this:
414 ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
415 ;; relocation R_X86_64_32 against `.bss' can not be used when
416 ;; making a shared object; recompile with -fPIC
418 ;; For now, disable the features that that use libarchive (xtrabackup).
419 "-DWITH_LIBARCHIVE=OFF"
421 "-DDEFAULT_CHARSET=utf8"
422 "-DDEFAULT_COLLATION=utf8_general_ci"
423 "-DMYSQL_DATADIR=/var/lib/mysql"
424 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
425 "-DINSTALL_INFODIR=share/mysql/docs"
426 "-DINSTALL_MANDIR=share/man"
427 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
428 "-DINSTALL_SCRIPTDIR=bin"
429 "-DINSTALL_INCLUDEDIR=include/mysql"
430 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
431 "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
432 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
433 "-DINSTALL_DOCDIR=share/mysql/docs"
434 "-DINSTALL_SHAREDIR=share/mysql")
436 (modify-phases %standard-phases
438 'configure 'pre-configure
440 (setenv "CONFIG_SHELL" (which "sh"))
443 'install 'post-install
444 (lambda* (#:key outputs #:allow-other-keys)
445 (let* ((out (assoc-ref outputs "out"))
446 (test (assoc-ref outputs "test")))
447 (substitute* (string-append out "/bin/mysql_install_db")
449 (string-append "basedir=\"" out "\"")))
450 ;; Remove unneeded files for testing.
451 (with-directory-excursion out
452 (for-each delete-file-recursively
453 '("data" "mysql-test" "sql-bench"
454 "share/man/man1/mysql-test-run.pl.1")))))))))
459 `(("jemalloc" ,jemalloc)
466 (home-page "https://mariadb.org/")
467 (synopsis "SQL database server")
469 "MariaDB is a multi-user and multi-threaded SQL database server, designed
470 as a drop-in replacement of MySQL.")
471 (license license:gpl2)))
473 (define-public postgresql
479 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
480 version "/postgresql-" version ".tar.bz2"))
483 "1imrjp4vfslxj5rrvphcrrk21zv8kqw3gacmwradixh1d5rv6i8n"))))
484 (build-system gnu-build-system)
486 `(#:configure-flags '("--with-uuid=e2fs")
488 (modify-phases %standard-phases
489 (add-before 'configure 'patch-/bin/sh
491 ;; Refer to the actual shell.
492 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
493 "src/bin/psql/command.c")
494 (("/bin/sh") (which "sh")))
496 (add-after 'build 'build-contrib
498 (zero? (system* "make" "-C" "contrib"))))
499 (add-after 'install 'install-contrib
501 (zero? (system* "make" "-C" "contrib" "install")))))))
503 `(("readline" ,readline)
504 ("libuuid" ,util-linux)
506 (home-page "https://www.postgresql.org/")
507 (synopsis "Powerful object-relational database system")
509 "PostgreSQL is a powerful object-relational database system. It is fully
510 ACID compliant, has full support for foreign keys, joins, views, triggers, and
511 stored procedures (in multiple languages). It includes most SQL:2008 data
512 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
513 TIMESTAMP. It also supports storage of binary large objects, including
514 pictures, sounds, or video.")
515 (license (license:x11-style "file://COPYRIGHT"))))
524 (uri (string-append "http://fallabs.com/" name "/"
525 name "-" version ".tar.gz"))
528 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
529 (build-system gnu-build-system)
531 `( #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
532 (assoc-ref %outputs "out")
534 (home-page "http://fallabs.com/qdbm")
535 (synopsis "Key-value database")
536 (description "QDBM is a library of routines for managing a
537 database. The database is a simple data file containing key-value
538 pairs. Every key and value is serial bytes with variable length.
539 Binary data as well as character strings can be used as a key or a
540 value. There is no concept of data tables or data types. Records are
541 organized in a hash table or B+ tree.")
542 (license license:lgpl2.1+)))
544 (define-public recutils
550 (uri (string-append "mirror://gnu/recutils/recutils-"
554 "0cdwa4094x3yx7vn98xykvnlp9rngvd58d19vs3vh5hrvggccg93"))))
555 (build-system gnu-build-system)
557 ;; Running tests in parallel leads to test failures and crashes in
559 (arguments '(#:parallel-tests? #f
561 (list (string-append "--with-bash-headers="
562 (assoc-ref %build-inputs "bash:include")
565 #:phases (modify-phases %standard-phases
566 (add-before 'build 'set-bash4.4-header-location
568 (substitute* "bash/Makefile.in"
569 ;; Adjust the header search path for Bash
570 ;; 4.4 in accordance with 'bash.pc'.
571 (("AM_CPPFLAGS = (.*)$" _ rest)
572 (string-append "AM_CPPFLAGS = "
573 "-I$(BASH_HEADERS)/include "
576 ;; Install to PREFIX/lib/bash to match Bash
577 ;; 4.4's search path.
579 "libdir = @libdir@/bash\n"))
582 (native-inputs `(("emacs" ,emacs-minimal)
584 ("bash:include" ,bash "include")
585 ("libuuid" ,util-linux)))
587 ;; TODO: Add more optional inputs.
588 (inputs `(("curl" ,curl)
589 ("libgcrypt" ,libgcrypt)
591 (synopsis "Manipulate plain text files as databases")
593 "GNU Recutils is a set of tools and libraries for creating and
594 manipulating text-based, human-editable databases. Despite being text-based,
595 databases created with Recutils carry all of the expected features such as
596 unique fields, primary keys, time stamps and more. Many different field
597 types are supported, as is encryption.")
598 (license license:gpl3+)
599 (home-page "https://www.gnu.org/software/recutils/")))
601 (define-public rocksdb
607 (uri (string-append "https://github.com/facebook/rocksdb"
608 "/archive/v" version ".tar.gz"))
609 (file-name (string-append name "-" version ".tar.gz"))
612 "1v2q05bl56sfp51m09z7g6489hkfq4vf6b4qgfg3d96ylgmay9yb"))
613 (modules '((guix build utils)))
616 ;; TODO: unbundle gtest.
617 (delete-file "build_tools/gnu_parallel")
619 (build-system gnu-build-system)
621 `(#:make-flags (list "CC=gcc"
622 (string-append "INSTALL_PATH="
623 (assoc-ref %outputs "out")))
624 ;; Many tests fail on 32-bit platforms. There are multiple reports about
625 ;; this upstream, but it's not going to be supported any time soon.
626 #:tests? (let ((system ,(or (%current-target-system)
628 (or (string-prefix? "x86_64-linux" system)
629 (string-prefix? "aarch64-linux" system)))
631 (modify-phases %standard-phases
632 (add-after 'unpack 'patch-Makefile
634 (substitute* "Makefile"
635 (("build_tools/gnu_parallel") "parallel")
636 ;; Don't depend on the static library when installing.
637 (("install: install-static")
638 "install: install-shared")
639 (("#!/bin/sh") (string-append "#!" (which "sh"))))
642 ;; The default target is only needed for tests and built on demand.
644 (add-before 'check 'disable-optimizations
646 ;; Prevent the build from passing '-march=native' to the compiler.
647 (setenv "PORTABLE" "1")
649 (add-before 'check 'disable-failing-tests
651 (substitute* "Makefile"
652 ;; This test fails with GCC-5 and is unmaintained.
653 ;; https://github.com/facebook/rocksdb/issues/2148
654 (("^[[:blank:]]+spatial_db_test[[:blank:]]+\\\\") "\\")
655 ;; These tests reliably fail due to "Too many open files".
656 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
657 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
659 (add-after 'check 'build-release-libraries
660 ;; The default build target is a debug build for tests. The
661 ;; install target depends on "shared_lib" and "static_lib"
662 ;; targets for release builds so we build them here for clarity.
663 ;; TODO: Add debug output.
664 (lambda* (#:key (make-flags '()) #:allow-other-keys)
665 (zero? (apply system* "make" "shared_lib" make-flags)))))))
667 `(("parallel" ,parallel)
675 ("jemalloc" ,jemalloc)
679 (home-page "http://rocksdb.org/")
680 (synopsis "Persistent key-value store for fast storage")
682 "RocksDB is a library that forms the core building block for a fast
683 key-value server, especially suited for storing data on flash drives. It
684 has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
685 between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
686 (RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
687 compactions, making it specially suitable for storing multiple terabytes of
688 data in a single database. RocksDB is partially based on @code{LevelDB}.")
689 ;; RocksDB is BSD-3 and the JNI adapter is Apache 2.0.
690 (license (list license:bsd-3 license:asl2.0))))
692 (define-public sparql-query
694 (name "sparql-query")
698 (uri (string-append "https://github.com/tialaramex/"
699 name "/archive/" version ".tar.gz"))
701 (base32 "0yq3k20472rv8npcc420q9ab6idy584g5y0q501d360k5q0ggr8w"))
702 (file-name (string-append name "-" version ".tar.gz"))))
703 (build-system gnu-build-system)
705 `(("readline" ,readline)
711 `(("pkg-config" ,pkg-config)))
713 `(#:make-flags '("CC=gcc")
715 (modify-phases %standard-phases
717 ;; The Makefile uses git to obtain versioning information. This phase
718 ;; substitutes the git invocation with the package version.
719 (add-after 'unpack 'remove-git-dependency
721 (substitute* "Makefile"
723 (string-append "gitrev = \"v" ,version "\"")))))
724 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
725 ;; This replacement does the same thing, except for using $PREFIX/bin
728 (lambda* (#:key outputs #:allow-other-keys)
729 (let* ((out (assoc-ref outputs "out"))
730 (bin (string-append out "/bin")))
731 (install-file "sparql-query" bin)
732 (system* "ln" "--symbolic"
733 (string-append bin "/sparql-query")
734 (string-append bin "/sparql-update")))))
736 (lambda* (#:key make-flags #:allow-other-keys)
738 (zero? (apply system* "make" `(,@make-flags "scan-test")))
739 (zero? (system "./scan-test"))))))))
740 (home-page "https://github.com/tialaramex/sparql-query/")
741 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
742 (description "Sparql-query is a command-line tool for accessing SPARQL
743 endpoints over HTTP. It has been intentionally designed to 'feel' similar to
744 tools for interrogating SQL databases. For example, you can enter a query over
745 several lines, using a semi-colon at the end of a line to indicate the end of
746 your query. It also supports readline so that you can more easily recall and
747 edit previous queries, even across sessions. It can be used non-interactively,
748 for example from a shell script.")
749 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
750 ;; others (like sparql-query.c) contain a GPLv2+ license header.
751 (license (list license:gpl3+))))
753 (define-public sqlite
759 (uri (let ((numeric-version
760 (match (string-split version #\.)
761 ((first-digit other-digits ...)
762 (string-append first-digit
765 (map (cut string-pad <> 2 #\0)
768 (string-append "https://sqlite.org/2017/sqlite-autoconf-"
769 numeric-version ".tar.gz")))
772 "0k472gq0p706jq4529p60znvw02hdf172qxgbdv59q0n7anqbr54"))))
773 (build-system gnu-build-system)
774 (inputs `(("readline" ,readline)))
777 ;; Add -DSQLITE_SECURE_DELETE, -DSQLITE_ENABLE_UNLOCK_NOTIFY and
778 ;; -DSQLITE_ENABLE_DBSTAT_VTAB to CFLAGS. GNU Icecat will refuse
779 ;; to use the system SQLite unless these options are enabled.
780 (list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE "
781 "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
782 "-DSQLITE_ENABLE_DBSTAT_VTAB"))))
783 (home-page "https://www.sqlite.org/")
784 (synopsis "The SQLite database management system")
786 "SQLite is a software library that implements a self-contained, serverless,
787 zero-configuration, transactional SQL database engine. SQLite is the most
788 widely deployed SQL database engine in the world. The source code for SQLite
789 is in the public domain.")
790 (license license:public-domain)))
798 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
802 "1sfbia8xyaywgx9zy7x618vrvyx9gc3cgqf763shsii9javlnz9s"))))
803 (build-system gnu-build-system)
806 (modify-phases %standard-phases
808 (lambda* (#:key outputs #:allow-other-keys)
809 (let ((out (assoc-ref outputs "out")))
810 ;; The 'configure' script is a wrapper for Waf and
811 ;; doesn't recognize things like '--enable-fast-install'.
812 (zero? (system* "./configure"
813 (string-append "--prefix=" out)))))))))
815 `(;; TODO: Build the documentation.
816 ;; ("docbook-xsl" ,docbook-xsl)
817 ;; ("libxml2" ,libxml2)
818 ;; ("libxslt" ,libxslt)
819 ("python" ,python-2))) ;for the Waf build system
820 (home-page "https://tdb.samba.org/")
821 (synopsis "Trivial database")
823 "TDB is a Trivial Database. In concept, it is very much like GDBM,
824 and BSD's DB except that it allows multiple simultaneous writers and uses
825 locking internally to keep writers from trampling on each other. TDB is also
827 (license license:lgpl3+)))
829 (define-public perl-dbi
836 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
840 "0v37vnr5p0bx396cj0lb5kb69jbryq2mspp602hbgd04gklxqzcg"))))
841 (build-system perl-build-system)
842 (synopsis "Database independent interface for Perl")
843 (description "This package provides an database interface for Perl.")
844 (home-page "http://search.cpan.org/dist/DBI")
845 (license license:perl-license)))
847 (define-public perl-dbix-class
849 (name "perl-dbix-class")
854 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
855 "DBIx-Class-" version ".tar.gz"))
858 "1vw1f756g8m5hq11nqf5dk2cw2y4mqq91ca5p75fn5g3fp8syja0"))))
859 (build-system perl-build-system)
861 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
862 ("perl-file-temp" ,perl-file-temp)
863 ("perl-package-stash" ,perl-package-stash)
864 ("perl-test-deep" ,perl-test-deep)
865 ("perl-test-exception" ,perl-test-exception)
866 ("perl-test-warn" ,perl-test-warn)))
868 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
869 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
870 ("perl-class-inspector" ,perl-class-inspector)
871 ("perl-config-any" ,perl-config-any)
872 ("perl-context-preserve" ,perl-context-preserve)
873 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
874 ("perl-data-page" ,perl-data-page)
875 ("perl-dbi" ,perl-dbi)
876 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
877 ("perl-hash-merge" ,perl-hash-merge)
878 ("perl-module-find" ,perl-module-find)
879 ("perl-moo" ,perl-moo)
880 ("perl-mro-compat" ,perl-mro-compat)
881 ("perl-namespace-clean" ,perl-namespace-clean)
882 ("perl-path-class" ,perl-path-class)
883 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
884 ("perl-scope-guard" ,perl-scope-guard)
885 ("perl-sql-abstract" ,perl-sql-abstract)
886 ("perl-sub-name" ,perl-sub-name)
887 ("perl-text-balanced" ,perl-text-balanced)
888 ("perl-try-tiny" ,perl-try-tiny)))
889 (home-page "http://search.cpan.org/dist/DBIx-Class")
890 (synopsis "Extensible and flexible object <-> relational mapper")
891 (description "An SQL to OO mapper with an object API inspired by
892 Class::DBI (with a compatibility layer as a springboard for porting) and a
893 resultset API that allows abstract encapsulation of database operations. It
894 aims to make representing queries in your code as perl-ish as possible while
895 still providing access to as many of the capabilities of the database as
896 possible, including retrieving related records from multiple tables in a
897 single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
898 \"ORDER BY\" and \"HAVING\" support.")
899 (license license:perl-license)))
901 (define-public perl-dbix-class-cursor-cached
903 (name "perl-dbix-class-cursor-cached")
908 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
909 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
912 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
913 (build-system perl-build-system)
915 `(("perl-cache-cache" ,perl-cache-cache)
916 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
918 `(("perl-carp-clan" ,perl-carp-clan)
919 ("perl-dbix-class" ,perl-dbix-class)))
920 (home-page "http://search.cpan.org/dist/DBIx-Class-Cursor-Cached")
921 (synopsis "Cursor with built-in caching support")
922 (description "DBIx::Class::Cursor::Cached provides a cursor class with
923 built-in caching support.")
924 (license license:perl-license)))
926 (define-public perl-dbix-class-introspectablem2m
928 (name "perl-dbix-class-introspectablem2m")
933 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
934 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
937 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
938 (build-system perl-build-system)
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)))
951 (define-public perl-dbix-class-schema-loader
953 (name "perl-dbix-class-schema-loader")
958 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
959 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
962 "08cgn0dx42y9xsxas9np7s55a7qmy4kf6sfmx0jmk4hryvbapml3"))))
963 (build-system perl-build-system)
965 `(("perl-config-any" ,perl-config-any)
966 ("perl-config-general" ,perl-config-general)
967 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
968 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
969 ("perl-moose" ,perl-moose)
970 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
971 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
972 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
973 ("perl-test-deep" ,perl-test-deep)
974 ("perl-test-differences" ,perl-test-differences)
975 ("perl-test-exception" ,perl-test-exception)
976 ("perl-test-pod" ,perl-test-pod)
977 ("perl-test-warn" ,perl-test-warn)))
979 `(("perl-class-unload" ,perl-class-unload)
980 ("perl-class-inspector" ,perl-class-inspector)
981 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
982 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
983 ("perl-carp-clan" ,perl-carp-clan)
984 ("perl-data-dump" ,perl-data-dump)
985 ("perl-dbix-class" ,perl-dbix-class)
986 ("perl-hash-merge" ,perl-hash-merge)
987 ("perl-list-moreutils" ,perl-list-moreutils)
988 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
989 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
990 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
991 ("perl-namespace-clean" ,perl-namespace-clean)
992 ("perl-mro-compat" ,perl-mro-compat)
993 ("perl-scope-guard" ,perl-scope-guard)
994 ("perl-string-camelcase" ,perl-string-camelcase)
995 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
996 ("perl-sub-name" ,perl-sub-name)
997 ("perl-try-tiny" ,perl-try-tiny)))
998 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
999 (home-page "http://search.cpan.org/dist/DBIx-Class-Schema-Loader")
1000 (synopsis "Create a DBIx::Class::Schema based on a database")
1001 (description "DBIx::Class::Schema::Loader automates the definition of a
1002 DBIx::Class::Schema by scanning database table definitions and setting up the
1003 columns, primary keys, unique constraints and relationships.")
1004 (license license:perl-license)))
1006 (define-public perl-dbd-pg
1008 (name "perl-dbd-pg")
1013 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
1014 "DBD-Pg-" version ".tar.gz"))
1017 "03m9w1cd0yyrbqwkwcl92j1cpmasmm69f3hwvcrlfsi5fnwsk63y"))))
1018 (build-system perl-build-system)
1020 `(("perl-dbi" ,perl-dbi)))
1022 `(("perl-dbi" ,perl-dbi)
1023 ("postgresql" ,postgresql)))
1024 (home-page "http://search.cpan.org/dist/DBD-Pg")
1025 (synopsis "DBI PostgreSQL interface")
1026 (description "This package provides a PostgreSQL driver for the Perl5
1027 @dfn{Database Interface} (DBI).")
1028 (license license:perl-license)))
1030 (define-public perl-dbd-mysql
1032 (name "perl-dbd-mysql")
1037 (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
1038 "DBD-mysql-" version ".tar.gz"))
1041 "16bg7l28n65ngi1abjxvwk906a80i2vd5vzjn812dx8phdg8d7v2"))
1042 (patches (search-patches "perl-dbd-mysql-CVE-2017-10788.patch"))))
1043 (build-system perl-build-system)
1044 ;; Tests require running MySQL server
1045 (arguments `(#:tests? #f))
1047 `(("perl-dbi" ,perl-dbi)
1049 (home-page "http://search.cpan.org/dist/DBD-mysql")
1050 (synopsis "DBI MySQL interface")
1051 (description "This package provides a MySQL driver for the Perl5
1052 @dfn{Database Interface} (DBI).")
1053 (license license:perl-license)))
1055 (define-public perl-dbd-sqlite
1057 (name "perl-dbd-sqlite")
1062 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
1066 "0sbj9lx9syzpknvjv8cz9jndg32qz775vy2prgq305npv3dsca9r"))))
1067 (build-system perl-build-system)
1068 (inputs `(("sqlite" ,sqlite)))
1069 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
1070 (synopsis "SQlite interface for Perl")
1071 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
1072 the entire thing in the distribution. So in order to get a fast transaction
1073 capable RDBMS working for your Perl project you simply have to install this
1074 module, and nothing else.")
1075 (license license:perl-license)
1076 (home-page "http://search.cpan.org/~ishigaki/DBD-SQLite/lib/DBD/SQLite.pm")))
1078 (define-public perl-sql-abstract
1080 (name "perl-sql-abstract")
1085 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1086 "SQL-Abstract-" version ".tar.gz"))
1089 "17sgwq3mvqjhv3b77cnvrq60xgp8harjhlnvpwmxc914rqc5ckaz"))))
1090 (build-system perl-build-system)
1092 `(("perl-test-deep" ,perl-test-deep)
1093 ("perl-test-exception" ,perl-test-exception)
1094 ("perl-test-warn" ,perl-test-warn)))
1096 `(("perl-hash-merge" ,perl-hash-merge)
1097 ("perl-moo" ,perl-moo)
1098 ("perl-mro-compat" ,perl-mro-compat)
1099 ("perl-text-balanced" ,perl-text-balanced)))
1100 (home-page "http://search.cpan.org/dist/SQL-Abstract")
1101 (synopsis "Generate SQL from Perl data structures")
1102 (description "This module was inspired by the excellent DBIx::Abstract.
1103 While based on the concepts used by DBIx::Abstract, the concepts used have
1104 been modified to make the SQL easier to generate from Perl data structures.
1105 The underlying idea is for this module to do what you mean, based on the data
1106 structures you provide it, so that you don't have to modify your code every
1107 time your data changes.")
1108 (license license:perl-license)))
1110 (define-public perl-sql-splitstatement
1112 (name "perl-sql-splitstatement")
1117 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
1118 "SQL-SplitStatement-" version ".tar.gz"))
1121 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
1122 (build-system perl-build-system)
1124 `(("perl-test-exception" ,perl-test-exception)))
1126 `(("perl-class-accessor" ,perl-class-accessor)
1127 ("perl-list-moreutils" ,perl-list-moreutils)
1128 ("perl-regexp-common" ,perl-regexp-common)
1129 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
1130 (home-page "http://search.cpan.org/dist/SQL-SplitStatement")
1131 (synopsis "Split SQL code into atomic statements")
1132 (description "This module tries to split any SQL code, even including
1133 non-standard extensions, into the atomic statements it is composed of.")
1134 (license license:perl-license)))
1136 (define-public perl-sql-tokenizer
1138 (name "perl-sql-tokenizer")
1143 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
1144 "SQL-Tokenizer-" version ".tar.gz"))
1147 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
1148 (build-system perl-build-system)
1149 (home-page "http://search.cpan.org/dist/SQL-Tokenizer")
1150 (synopsis "SQL tokenizer")
1151 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
1152 claim to be a parser or query verifier. It just creates sane tokens from a
1154 (license license:perl-license)))
1156 (define-public unixodbc
1164 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
1167 (base32 "0f8y88rcc2akjvjv5y66yx7k0ms9h1s0vbcfy25j93didflhj59f"))))
1168 (build-system gnu-build-system)
1169 (synopsis "Data source abstraction library")
1170 (description "Unixodbc is a library providing an API with which to access
1171 data sources. Data sources include SQL Servers and any software with an ODBC
1173 (license license:lgpl2.1+)
1174 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
1175 (home-page "http://www.unixodbc.org")))
1177 (define-public unqlite
1183 ;; Contains bug fixes against the official release, and has an
1184 ;; autotooled build system.
1185 (uri (string-append "https://github.com/aidin36/tocc/releases/"
1187 "unqlite-unofficial-" version ".tar.gz"))
1190 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
1191 (build-system gnu-build-system)
1192 (arguments `(#:tests? #f)) ;No check target
1193 (home-page "http://www.unqlite.org")
1194 (synopsis "In-memory key/value and document store")
1196 "UnQLite is an in-process software library which implements a
1197 self-contained, serverless, zero-configuration, transactional NoSQL
1198 database engine. UnQLite is a document store database similar to
1199 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
1200 similar to BerkeleyDB, LevelDB, etc.")
1201 (license license:bsd-2)))
1203 (define-public redis
1209 (uri (string-append "http://download.redis.io/releases/redis-"
1213 "14bm8lkhylc93r4dgl7kkzzpw2xq7gr6w6h80n3jazqnx5mcsj90"))))
1214 (build-system gnu-build-system)
1216 '(#:tests? #f ; tests related to master/slave and replication fail
1217 #:phases (modify-phases %standard-phases
1218 (delete 'configure))
1219 #:make-flags `("CC=gcc"
1222 ,(string-append "PREFIX="
1223 (assoc-ref %outputs "out")))))
1224 (synopsis "Key-value cache and store")
1225 (description "Redis is an advanced key-value cache and store. Redis
1226 supports many data structures including strings, hashes, lists, sets, sorted
1227 sets, bitmaps and hyperloglogs.")
1228 (home-page "http://redis.io/")
1229 (license license:bsd-3)))
1231 (define-public kyotocabinet
1233 (name "kyotocabinet")
1237 (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
1238 name "-" version ".tar.gz"))
1241 "0g6js20x7vnpq4p8ghbw3mh9wpqksya9vwhzdx6dnlf354zjsal1"))))
1242 (build-system gnu-build-system)
1246 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
1247 (string-append "LDFLAGS=-Wl,-rpath="
1248 (assoc-ref %outputs "out") "/lib"))))
1249 (inputs `(("zlib" ,zlib)))
1250 (home-page "http://fallabs.com/kyotocabinet/")
1252 "Kyoto Cabinet is a modern implementation of the DBM database")
1254 "Kyoto Cabinet is a standalone file-based database that supports Hash
1255 and B+ Tree data storage models. It is a fast key-value lightweight
1256 database and supports many programming languages. It is a NoSQL database.")
1257 (license license:gpl3+)))
1259 (define-public tokyocabinet
1261 (name "tokyocabinet")
1266 (uri (string-append "http://fallabs.com/tokyocabinet/"
1267 name "-" version ".tar.gz"))
1270 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
1271 (build-system gnu-build-system)
1274 (list "--enable-pthread" "--enable-off64" "--enable-fastest"
1275 (string-append "LDFLAGS=-Wl,-rpath="
1276 (assoc-ref %outputs "out") "/lib"))))
1279 (home-page "http://fallabs.com/tokyocabinet/")
1280 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
1282 "Tokyo Cabinet is a library of routines for managing a database.
1283 The database is a simple data file containing records, each is a pair of a
1284 key and a value. Every key and value is serial bytes with variable length.
1285 Both binary data and character string can be used as a key and a value.
1286 There is neither concept of data tables nor data types. Records are
1287 organized in hash table, B+ tree, or fixed-length array.")
1288 (license license:lgpl2.1+)))
1290 (define-public wiredtiger
1297 "http://source.wiredtiger.com/releases/wiredtiger-"
1298 version ".tar.bz2"))
1301 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
1302 (build-system gnu-build-system)
1304 '(#:configure-flags '("--enable-lz4" "--enable-zlib")
1306 (modify-phases %standard-phases
1307 (add-before 'check 'disable-test/fops
1309 ;; XXX: timed out after 3600 seconds of silence
1310 (substitute* "Makefile"
1316 (home-page "http://source.wiredtiger.com/")
1317 (synopsis "NoSQL data engine")
1319 "WiredTiger is an extensible platform for data management. It supports
1320 row-oriented storage (where all columns of a row are stored together),
1321 column-oriented storage (where columns are stored in groups, allowing for
1322 more efficient access and storage of column subsets) and log-structured merge
1323 trees (LSM), for sustained throughput under random insert workloads.")
1324 (license license:gpl3) ; or GPL-2
1325 ;; configure.ac: WiredTiger requires a 64-bit build.
1326 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
1328 (define-public perl-db-file
1330 (name "perl-db-file")
1336 "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
1341 "1i5jz85z4hpx15lw6ix27pyvrf0ziyh4z33lii4d3wnhz83lg1mp"))))
1342 (build-system perl-build-system)
1343 (inputs `(("bdb" ,bdb)))
1344 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
1346 `(#:phases (modify-phases %standard-phases
1348 'configure 'modify-config.in
1349 (lambda* (#:key inputs #:allow-other-keys)
1350 (substitute* "config.in"
1351 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
1353 (home-page "http://search.cpan.org/dist/DB_File")
1355 "Perl5 access to Berkeley DB version 1.x")
1357 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
1358 (license license:perl-license)))
1366 (uri (string-append "https://github.com/LMDB/lmdb/archive/"
1367 "LMDB_" version ".tar.gz"))
1370 "0ndmj07hkm2ic60z1f4rdscxs7pq45hk9fibjyv5nhfclhsvd1qi"))))
1371 (build-system gnu-build-system)
1373 `(#:test-target "test"
1375 (modify-phases %standard-phases
1377 (lambda* (#:key outputs #:allow-other-keys)
1378 (chdir (string-append
1379 (getenv "PWD") "/lmdb-LMDB_" ,version "/libraries/liblmdb"))
1380 (substitute* "Makefile"
1381 (("/usr/local") (assoc-ref outputs "out")))
1383 (home-page "https://symas.com/products/lightning-memory-mapped-database")
1384 (synopsis "Lightning Memory-Mapped Database library")
1386 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
1387 transactional database. Unlike more complex relational databases, LMDB handles
1388 only key-value pairs (stored as arbitrary byte arrays) and relies on the
1389 underlying operating system for caching and locking, keeping the code small and
1391 The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
1392 disk-based databases with high read performance that scales linearly over
1393 multiple cores. The size of each database is limited only by the size of the
1394 virtual address space — not physical RAM.")
1395 (license license:openldap2.8)))
1397 (define-public libpqxx
1404 "http://pqxx.org/download/software/libpqxx/"
1405 name "-" version ".tar.gz"))
1408 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
1409 (build-system gnu-build-system)
1411 `(("python" ,python-2)))
1412 (inputs `(("postgresql" ,postgresql)))
1414 `(#:tests? #f ; # FAIL: 1
1416 (modify-phases %standard-phases
1417 (add-before 'configure 'fix-sed-command
1419 ;; Newer sed versions error out if double brackets are not used.
1420 (substitute* "configure"
1421 (("\\[:space:\\]") "[[:space:]]"))
1423 (synopsis "C++ connector for PostgreSQL")
1425 "Libpqxx is a C++ library to enable user programs to communicate with the
1426 PostgreSQL database back-end. The database back-end can be local or it may be
1427 on another machine, accessed via TCP/IP.")
1428 (home-page "http://pqxx.org/")
1429 (license license:bsd-3)))
1431 (define-public python-peewee
1433 (name "python-peewee")
1438 (uri (pypi-uri "peewee" version))
1441 "1605bk11s7aap2q4qyba93rx7yfh8b11kk0cqi08z8klx2iar8yd"))))
1442 (build-system python-build-system)
1444 `(#:tests? #f)) ; Fails to import test data
1446 `(("python-cython" ,python-cython)))
1447 (home-page "https://github.com/coleifer/peewee/")
1448 (synopsis "Small object-relational mapping utility")
1450 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
1451 handles converting between pythonic values and those used by databases, so you
1452 can use Python types in your code without having to worry. It has built-in
1453 support for sqlite, mysql and postgresql. If you already have a database, you
1454 can autogenerate peewee models using @code{pwiz}, a model generator.")
1455 (license license:expat)))
1457 (define-public python2-peewee
1458 (package-with-python2 python-peewee))
1460 (define-public sqlcipher
1467 (uri (string-append "https://github.com/sqlcipher/" name
1468 "/archive/v" version ".tar.gz"))
1470 (base32 "1gv58dlbpzrmznly52yqbxgvii0ib88zr3aszla1bsypwjr6flff"))
1471 (file-name (string-append name "-" version ".tar.gz"))))
1472 (build-system gnu-build-system)
1474 `(("libcrypto" ,openssl)
1475 ("libtcl8.6" ,tcl))) ; required for running the tests
1480 '("--enable-tempstore=yes"
1481 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
1482 "LDFLAGS=-lcrypto -ltcl8.6"
1484 ;; tests cannot be run from the Makefile
1485 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
1486 #:test-target "testfixture"
1488 (modify-phases %standard-phases
1489 (add-before 'check 'build-test-runner
1490 (assoc-ref %standard-phases 'check))
1494 (system* "./testfixture" "test/crypto.test")))))))
1495 (home-page "https://www.zetetic.net/sqlcipher/")
1497 "Library providing transparent encryption of SQLite database files")
1498 (description "SQLCipher is an implementation of SQLite, extended to
1499 provide transparent 256-bit AES encryption of database files. Pages are
1500 encrypted before being written to disk and are decrypted when read back. It’s
1501 well suited for protecting embedded application databases and for mobile
1504 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
1505 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
1506 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
1507 ;; source files are in the public domain.
1508 (license (list license:public-domain license:bsd-3))))
1510 (define-public python-pyodbc-c
1512 (name "python-pyodbc-c")
1517 (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
1518 "archive.tar.gz?ref=v" version))
1521 "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
1522 (file-name (string-append name "-" version ".tar.gz"))))
1523 (build-system python-build-system)
1525 `(("unixodbc" ,unixodbc)))
1527 `(;; No unit tests exist.
1529 (home-page "https://github.com/mkleehammer/pyodbc")
1530 (synopsis "Python ODBC Library")
1531 (description "@code{python-pyodbc-c} provides a Python DB-API driver
1533 (license (license:x11-style "file://LICENSE.TXT"))))
1535 (define-public python2-pyodbc-c
1536 (package-with-python2 python-pyodbc-c))
1538 (define-public mdbtools
1545 (uri (string-append "https://github.com/brianb/mdbtools/archive/"
1549 "05hbmxcq173kzb899gdi3bz2qcc1vi3n1qbbkwpsvrq7ggf11wyw"))
1550 (file-name (string-append name "-" version ".tar.gz"))))
1551 (build-system gnu-build-system)
1555 `(("autoconf" ,autoconf)
1556 ("automake" ,automake)
1557 ("libtool" ,libtool)
1558 ("pkg-config" ,pkg-config)
1559 ("txt2man" ,txt2man)
1563 (modify-phases %standard-phases
1564 (add-before 'configure 'autoreconf
1566 (zero? (system* "autoreconf" "-vfi")))))))
1567 (home-page "http://mdbtools.sourceforge.net/")
1568 (synopsis "Read Microsoft Access databases")
1569 (description "MDB Tools is a set of tools and applications to read the
1570 proprietary MDB file format used in Microsoft's Access database package. This
1571 includes programs to export schema and data from Microsoft's Access database
1572 file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
1573 etc., and an SQL engine for performing simple SQL queries.")
1574 (license (list license:lgpl2.0
1577 (define-public python-lmdb
1579 (name "python-lmdb")
1583 (uri (pypi-uri "lmdb" version))
1586 "01nw6r08jkipx6v92kw49z34wmwikrpvc5j9xawdiyg1n2526wrx"))
1587 (modules '((guix build utils)))
1589 ;; Delete bundled lmdb source files.
1590 '(for-each delete-file (list "lib/lmdb.h"
1594 (build-system python-build-system)
1599 (modify-phases %standard-phases
1600 (add-before 'build 'use-system-lmdb
1601 (lambda* (#:key inputs #:allow-other-keys)
1602 (let ((lmdb (assoc-ref inputs "lmdb")))
1603 (setenv "LMDB_FORCE_SYSTEM" "set")
1604 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
1605 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
1607 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
1609 (home-page "https://github.com/dw/py-lmdb")
1610 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
1612 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
1613 Memory-Mapped Database} (LMDB), a high-performance key-value store.")
1615 (list license:openldap2.8
1616 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
1617 ;; but not actually needed on platforms currently supported by Guix.
1620 (define-public python2-lmdb
1621 (package-with-python2 python-lmdb))