Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / databases.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2013, 2017 Cyril Roelandt <tipecaml@gmail.com>
5 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
8 ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
10 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
11 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
14 ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
15 ;;; Copyright © 2016, 2017, 2018 Roel Janssen <roel@gnu.org>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
18 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
19 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
20 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
21 ;;; Copyright © 2017, 2018 Julien Lepiller <julien@lepiller.eu>
22 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
23 ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
24 ;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
25 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
26 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
27 ;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
28 ;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
29 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
30 ;;; Copyright © 2017, 2018 Pierre Langlois <pierre.langlois@gmx.com>
31 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
32 ;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
33 ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
34 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
35 ;;;
36 ;;; This file is part of GNU Guix.
37 ;;;
38 ;;; GNU Guix is free software; you can redistribute it and/or modify it
39 ;;; under the terms of the GNU General Public License as published by
40 ;;; the Free Software Foundation; either version 3 of the License, or (at
41 ;;; your option) any later version.
42 ;;;
43 ;;; GNU Guix is distributed in the hope that it will be useful, but
44 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
45 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 ;;; GNU General Public License for more details.
47 ;;;
48 ;;; You should have received a copy of the GNU General Public License
49 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
50
51 (define-module (gnu packages databases)
52 #:use-module (gnu packages)
53 #:use-module (gnu packages admin)
54 #:use-module (gnu packages algebra)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages avahi)
57 #:use-module (gnu packages base)
58 #:use-module (gnu packages bash)
59 #:use-module (gnu packages bison)
60 #:use-module (gnu packages boost)
61 #:use-module (gnu packages check)
62 #:use-module (gnu packages cmake)
63 #:use-module (gnu packages compression)
64 #:use-module (gnu packages crypto)
65 #:use-module (gnu packages curl)
66 #:use-module (gnu packages cyrus-sasl)
67 #:use-module (gnu packages dbm)
68 #:use-module (gnu packages emacs)
69 #:use-module (gnu packages gettext)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnupg)
72 #:use-module (gnu packages guile)
73 #:use-module (gnu packages time)
74 #:use-module (gnu packages golang)
75 #:use-module (gnu packages jemalloc)
76 #:use-module (gnu packages language)
77 #:use-module (gnu packages libevent)
78 #:use-module (gnu packages linux)
79 #:use-module (gnu packages man)
80 #:use-module (gnu packages ncurses)
81 #:use-module (gnu packages parallel)
82 #:use-module (gnu packages pcre)
83 #:use-module (gnu packages perl)
84 #:use-module (gnu packages perl-check)
85 #:use-module (gnu packages pkg-config)
86 #:use-module (gnu packages popt)
87 #:use-module (gnu packages python)
88 #:use-module (gnu packages python-crypto)
89 #:use-module (gnu packages python-xyz)
90 #:use-module (gnu packages rdf)
91 #:use-module (gnu packages readline)
92 #:use-module (gnu packages ruby)
93 #:use-module (gnu packages serialization)
94 #:use-module (gnu packages sqlite)
95 #:use-module (gnu packages tcl)
96 #:use-module (gnu packages terminals)
97 #:use-module (gnu packages textutils)
98 #:use-module (gnu packages tls)
99 #:use-module (gnu packages valgrind)
100 #:use-module (gnu packages web)
101 #:use-module (gnu packages xml)
102 #:use-module ((guix licenses) #:prefix license:)
103 #:use-module (guix packages)
104 #:use-module (guix download)
105 #:use-module (guix git-download)
106 #:use-module (guix build-system gnu)
107 #:use-module (guix build-system go)
108 #:use-module (guix build-system perl)
109 #:use-module (guix build-system python)
110 #:use-module (guix build-system ruby)
111 #:use-module (guix build-system cmake)
112 #:use-module (guix build-system scons)
113 #:use-module ((guix build utils) #:hide (which))
114 #:use-module (guix utils)
115 #:use-module (srfi srfi-1)
116 #:use-module (srfi srfi-26)
117 #:use-module (ice-9 match))
118
119 (define-public 4store
120 (package
121 (name "4store")
122 (version "1.1.6")
123 (source (origin
124 (method url-fetch)
125 (uri (string-append "https://github.com/4store/4store/archive/v"
126 version ".tar.gz"))
127 (file-name (string-append name "-" version ".tar.gz"))
128 (sha256
129 (base32 "004fmcf1w75zhc1x3zc6kc97j4jqn2v5nhk6yb3z3cpfrhzi9j50"))
130 (patches (search-patches "4store-unset-preprocessor-directive.patch"
131 "4store-fix-buildsystem.patch"))))
132 (build-system gnu-build-system)
133 (native-inputs
134 `(("perl" ,perl)
135 ("python" ,python-2)
136 ("autoconf" ,autoconf)
137 ("automake" ,automake)
138 ("gettext" ,gettext-minimal)
139 ("libtool" ,libtool)
140 ("pcre" ,pcre "bin") ;for 'pcre-config'
141 ("pkg-config" ,pkg-config)))
142 (inputs
143 `(("glib" ,glib)
144 ("rasqal" ,rasqal)
145 ("libxml2" ,libxml2)
146 ("raptor2" ,raptor2)
147 ("readline" ,readline)
148 ("avahi" ,avahi)
149 ("cyrus-sasl" ,cyrus-sasl)
150 ("openssl" ,openssl)
151 ("util-linux" ,util-linux)))
152 (arguments
153 `(#:phases
154 (modify-phases %standard-phases
155 (add-after 'unpack 'generate-configure
156 (lambda _
157 (invoke "sh" "autogen.sh"))))))
158 ;; http://www.4store.org has been down for a while now.
159 (home-page "https://github.com/4store/4store")
160 (synopsis "Clustered RDF storage and query engine")
161 (description "4store is a RDF/SPARQL store written in C, supporting
162 either single machines or networked clusters.")
163 (license license:gpl3+)))
164
165 (define-public go-gopkg.in-mgo.v2
166 (package
167 (name "go-gopkg.in-mgo.v2")
168 (version "2016.08.01")
169 (source (origin
170 (method git-fetch)
171 (uri (git-reference
172 (url "https://github.com/go-mgo/mgo")
173 (commit (string-append "r" version))))
174 (file-name (git-file-name name version))
175 (sha256
176 (base32
177 "0rwbi1z63w43b0z9srm8m7iz1fdwx7bq7n2mz862d6liiaqa59jd"))))
178 (build-system go-build-system)
179 (arguments
180 `(#:import-path "gopkg.in/mgo.v2"
181 ;; TODO: The tests fail as MongoDB fails to start
182 ;; Error parsing command line: unrecognised option '--chunkSize'
183 #:tests? #f
184 #:phases
185 (modify-phases %standard-phases
186 (delete 'reset-gzip-timestamps)
187 (add-before 'check 'start-mongodb
188 (lambda* (#:key tests? #:allow-other-keys)
189 (when tests?
190 (with-directory-excursion "src/gopkg.in/mgo.v2"
191 (invoke "make" "startdb")))
192 #t))
193 (add-after 'check 'stop'mongodb
194 (lambda* (#:key tests? #:allow-other-keys)
195 (when tests?
196 (with-directory-excursion "src/gopkg.in/mgo.v2"
197 (invoke "make" "stopdb")))
198 #t)))))
199 (native-inputs
200 `(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
201 ("mongodb" ,mongodb)
202 ("daemontools" ,daemontools)))
203 (synopsis "@code{mgo} offers a rich MongoDB driver for Go.")
204 (description
205 "@code{mgo} (pronounced as mango) is a MongoDB driver for the Go language.
206 It implements a rich selection of features under a simple API following
207 standard Go idioms.")
208 (home-page "http://labix.org/mgo")
209 (license license:bsd-2)))
210
211 (define-public es-dump-restore
212 (package
213 (name "es-dump-restore")
214 (version "2.1.0")
215 (source
216 (origin
217 (method url-fetch)
218 (uri (rubygems-uri "es_dump_restore" version))
219 (sha256
220 (base32
221 "020yk7f1hw48clmf5501z3xv9shsdchyymcv0y2cci2c1xvr1mim"))))
222 (build-system ruby-build-system)
223 (arguments
224 '(#:tests? #f)) ;; No testsuite.
225 (propagated-inputs
226 `(("ruby-httpclient" ,ruby-httpclient)
227 ("ruby-multi-json" ,ruby-multi-json)
228 ("ruby-progress_bar" ,ruby-progress_bar)
229 ("ruby-rubyzip" ,ruby-rubyzip)
230 ("ruby-thor" ,ruby-thor)))
231 (synopsis "Utility for dumping and restoring ElasticSearch indexes")
232 (description
233 "This package provides a utility for dumping the contents of an
234 ElasticSearch index to a compressed file and restoring the dumpfile back to an
235 ElasticSearch server")
236 (home-page "https://github.com/patientslikeme/es_dump_restore")
237 (license license:expat)))
238
239 (define-public leveldb
240 (package
241 (name "leveldb")
242 (version "1.20")
243 (source (origin
244 (method url-fetch)
245 (uri (string-append "https://github.com/google/leveldb"
246 "/archive/v" version ".tar.gz"))
247 (file-name (string-append name "-" version ".tar.gz"))
248 (sha256
249 (base32
250 "0r36bcrj6b2afsp4aw1gjai3jbs1c7734pxpc1jz7hh9nasyiazm"))))
251 (build-system gnu-build-system)
252 (arguments
253 '(#:make-flags (list "CC=gcc")
254 #:phases
255 (modify-phases %standard-phases
256 (delete 'configure)
257 (replace 'install
258 ;; There is no install target, so we do it here.
259 (lambda* (#:key outputs #:allow-other-keys)
260 (let* ((out (assoc-ref outputs "out"))
261 (lib (string-append out "/lib"))
262 (include (string-append out "/include")))
263 (for-each (lambda (file)
264 (install-file file lib))
265 (find-files "out-shared" "^libleveldb\\.so.*$"))
266 (copy-recursively "include" include)
267 #t))))))
268 (inputs
269 `(("snappy" ,snappy)))
270 (home-page "http://leveldb.org/")
271 (synopsis "Fast key-value storage library")
272 (description
273 "LevelDB is a fast key-value storage library that provides an ordered
274 mapping from string keys to string values.")
275 (license license:bsd-3)))
276
277 (define-public memcached
278 (package
279 (name "memcached")
280 (version "1.5.10")
281 (source
282 (origin
283 (method url-fetch)
284 (uri (string-append
285 "https://memcached.org/files/memcached-" version ".tar.gz"))
286 (sha256
287 (base32
288 "0jqw3z0408yx0lzc6ykn4d29n02dk31kqnmq9b3ldmcnpl6hck29"))))
289 (build-system gnu-build-system)
290 (inputs
291 `(("libevent" ,libevent)
292 ("cyrus-sasl" ,cyrus-sasl)))
293 (home-page "https://memcached.org/")
294 (synopsis "In-memory caching service")
295 (description "Memcached is an in-memory key-value store. It has a small
296 and generic API, and was originally intended for use with dynamic web
297 applications.")
298 (license license:bsd-3)))
299
300 (define-public mongodb
301 (package
302 (name "mongodb")
303 (version "3.4.10")
304 (source (origin
305 (method url-fetch)
306 (uri (string-append "https://github.com/mongodb/mongo/archive/r"
307 version ".tar.gz"))
308 (file-name (string-append name "-" version ".tar.gz"))
309 (sha256
310 (base32 "0676lvkljj7a5hdhv78dbykqnqrj9lbn9799mi84b8vbnzsq961r"))
311 (modules '((guix build utils)))
312 (snippet
313 '(begin
314 (for-each (lambda (dir)
315 (delete-file-recursively
316 (string-append "src/third_party/" dir)))
317 '("pcre-8.41" "scons-2.5.0" "snappy-1.1.3"
318 "valgrind-3.11.0" "wiredtiger"
319 "yaml-cpp-0.5.3" "zlib-1.2.8"))
320 #t))
321 (patches
322 (list
323 (search-patch "mongodb-support-unknown-linux-distributions.patch")))))
324 (build-system scons-build-system)
325 (inputs
326 `(("openssl" ,openssl)
327 ("pcre" ,pcre)
328 ,@(match (%current-system)
329 ((or "x86_64-linux" "aarch64-linux" "mips64el-linux")
330 `(("wiredtiger" ,wiredtiger)))
331 (_ `()))
332 ("yaml-cpp" ,yaml-cpp)
333 ("zlib" ,zlib)
334 ("snappy" ,snappy)))
335 (native-inputs
336 `(("valgrind" ,valgrind)
337 ("perl" ,perl)
338 ("python" ,python2-minimal)
339 ("python2-pymongo" ,python2-pymongo)
340 ("python2-pyyaml" ,python2-pyyaml)
341 ("tzdata" ,tzdata)))
342 (arguments
343 `(#:scons ,scons-python2
344 #:phases
345 (let ((common-options
346 `(;; "--use-system-tcmalloc" TODO: Missing gperftools
347 "--use-system-pcre"
348 ;; wiredtiger is 64-bit only
349 ,,(if (any (cute string-prefix? <> (or (%current-target-system)
350 (%current-system)))
351 '("i686-linux" "armhf-linux"))
352 ``"--wiredtiger=off"
353 ``"--use-system-wiredtiger")
354 ;; TODO
355 ;; build/opt/mongo/db/fts/unicode/string.o failed: Error 1
356 ;; --use-system-boost
357 "--use-system-snappy"
358 "--use-system-zlib"
359 "--use-system-valgrind"
360 ;; "--use-system-stemmer" TODO: Missing relevant package
361 "--use-system-yaml"
362 "--disable-warnings-as-errors"
363 ,(format #f "--jobs=~a" (parallel-job-count))
364 "--ssl")))
365 (modify-phases %standard-phases
366 (add-after 'unpack 'scons-propagate-environment
367 (lambda _
368 ;; Modify the SConstruct file to arrange for
369 ;; environment variables to be propagated.
370 (substitute* "SConstruct"
371 (("^env = Environment\\(")
372 "env = Environment(ENV=os.environ, "))
373 #t))
374 (add-after 'unpack 'create-version-file
375 (lambda _
376 (call-with-output-file "version.json"
377 (lambda (port)
378 (display ,(simple-format #f "{
379 \"version\": \"~A\"
380 }" version) port)))
381 #t))
382 (replace 'build
383 (lambda _
384 (apply invoke `("scons"
385 ,@common-options
386 "mongod" "mongo" "mongos"))))
387 (replace 'check
388 (lambda* (#:key tests? inputs #:allow-other-keys)
389 (setenv "TZDIR"
390 (string-append (assoc-ref inputs "tzdata")
391 "/share/zoneinfo"))
392 (when tests?
393 ;; Note that with the tests, especially the unittests, the
394 ;; build can take up to ~45GB of space, as many tests are
395 ;; individual executable files, with some being hundreds of
396 ;; megabytes in size.
397 (apply invoke `("scons" ,@common-options "dbtest" "unittests"))
398 (substitute* "build/unittests.txt"
399 ;; TODO: Don't run the async_stream_test, as it hangs
400 (("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
401 "")
402 ;; TODO: This test fails
403 ;; Expected 0UL != disks.size() (0 != 0) @src/mongo/util/procparser_test.cpp:476
404 (("^build\\/opt\\/mongo\\/util\\/procparser\\_test\n$")
405 ""))
406 (invoke "python" "buildscripts/resmoke.py"
407 "--suites=dbtest,unittests"
408 (format #f "--jobs=~a" (parallel-job-count))))
409 #t))
410 (replace 'install
411 (lambda* (#:key outputs #:allow-other-keys)
412 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
413 (install-file "mongod" bin)
414 (install-file "mongos" bin)
415 (install-file "mongo" bin))
416 #t))))))
417 (home-page "https://www.mongodb.org/")
418 (synopsis "High performance and high availability document database")
419 (description
420 "Mongo is a high-performance, high availability, schema-free
421 document-oriented database. A key goal of MongoDB is to bridge the gap
422 between key/value stores (which are fast and highly scalable) and traditional
423 RDBMS systems (which are deep in functionality).")
424 (license (list license:agpl3
425 ;; Some parts are licensed under the Apache License
426 license:asl2.0))))
427
428 ;; XXX When updating, check whether boost-for-mysql is still needed.
429 ;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
430 (define-public mysql
431 (package
432 (name "mysql")
433 (version "5.7.23")
434 (source (origin
435 (method url-fetch)
436 (uri (list (string-append
437 "https://dev.mysql.com/get/Downloads/MySQL-"
438 (version-major+minor version) "/"
439 name "-" version ".tar.gz")
440 (string-append
441 "https://downloads.mysql.com/archives/get/file/"
442 name "-" version ".tar.gz")))
443 (sha256
444 (base32
445 "0rbc3xsc11lq2dm0ip6gxa16c06hi74scb97x5cw7yhbabaz4c07"))))
446 (build-system cmake-build-system)
447 (arguments
448 `(#:configure-flags
449 '("-DBUILD_CONFIG=mysql_release"
450 "-DWITH_SSL=system"
451 "-DWITH_ZLIB=system"
452 "-DDEFAULT_CHARSET=utf8"
453 "-DDEFAULT_COLLATION=utf8_general_ci"
454 "-DMYSQL_DATADIR=/var/lib/mysql"
455 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
456 "-DINSTALL_INFODIR=share/mysql/docs"
457 "-DINSTALL_MANDIR=share/man"
458 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
459 "-DINSTALL_SCRIPTDIR=bin"
460 "-DINSTALL_INCLUDEDIR=include/mysql"
461 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
462 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
463 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
464 "-DINSTALL_DOCDIR=share/mysql/docs"
465 "-DINSTALL_SHAREDIR=share/mysql"
466 ;; Get rid of test data.
467 "-DINSTALL_MYSQLTESTDIR="
468 "-DINSTALL_SQLBENCHDIR=")
469 #:phases (modify-phases %standard-phases
470 (add-after
471 'install 'remove-extra-binaries
472 (lambda* (#:key outputs #:allow-other-keys)
473 (let ((out (assoc-ref outputs "out")))
474 ;; Remove the 3 *_embedded files, which weigh in at
475 ;; 14 MiB each.
476 (for-each delete-file
477 (find-files (string-append out "/bin")
478 "_embedded$"))
479 #t))))))
480 (native-inputs
481 `(("bison" ,bison)
482 ("perl" ,perl)))
483 (inputs
484 `(("boost" ,boost-for-mysql)
485 ("libaio" ,libaio)
486 ("ncurses" ,ncurses)
487 ("openssl" ,openssl)
488 ("zlib" ,zlib)))
489 (home-page "https://www.mysql.com/")
490 (synopsis "Fast, easy to use, and popular database")
491 (description
492 "MySQL is a fast, reliable, and easy to use relational database
493 management system that supports the standardized Structured Query
494 Language.")
495 (license license:gpl2)))
496
497 (define-public mariadb
498 (package
499 (name "mariadb")
500 (version "10.1.37")
501 (source (origin
502 (method url-fetch)
503 (uri (string-append "https://downloads.mariadb.org/f/"
504 name "-" version "/source/"
505 name "-" version ".tar.gz"))
506 (sha256
507 (base32
508 "0ijdmdn9mcciwv361zfmja6b1h6qpbdqgrnnq6kkdapplyq1dmcc"))
509 (patches (search-patches "mariadb-client-test-32bit.patch"))
510 (modules '((guix build utils)))
511 (snippet
512 '(begin
513 ;; Delete bundled snappy and xz.
514 (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
515 (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
516 ;; This file checks that the bundled sources are present and
517 ;; declares build procedures for them.
518 (("^include\\(TokuThirdParty\\)") ""))
519 (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
520 ;; Don't attempt to use the procedures we just removed.
521 ((" build_lzma build_snappy") ""))
522
523 ;; Preserve CMakeLists.txt for these.
524 (for-each (lambda (file)
525 (unless (string-suffix? "CMakeLists.txt" file)
526 (delete-file file)))
527 (append (find-files "extra/yassl")
528 (find-files "pcre") (find-files "zlib")))
529 #t))))
530 (build-system cmake-build-system)
531 (arguments
532 `(#:configure-flags
533 '("-DBUILD_CONFIG=mysql_release"
534 ;; Linking with libarchive fails, like this:
535
536 ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
537 ;; relocation R_X86_64_32 against `.bss' can not be used when
538 ;; making a shared object; recompile with -fPIC
539
540 ;; For now, disable the features that that use libarchive (xtrabackup).
541 "-DWITH_LIBARCHIVE=OFF"
542
543 ;; Ensure the system libraries are used.
544 "-DWITH_JEMALLOC=yes"
545 "-DWITH_PCRE=system"
546 "-DWITH_SSL=system"
547 "-DWITH_ZLIB=system"
548
549 "-DDEFAULT_CHARSET=utf8"
550 "-DDEFAULT_COLLATION=utf8_general_ci"
551 "-DMYSQL_DATADIR=/var/lib/mysql"
552 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
553 "-DINSTALL_INFODIR=share/mysql/docs"
554 "-DINSTALL_MANDIR=share/man"
555 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
556 "-DINSTALL_SCRIPTDIR=bin"
557 "-DINSTALL_INCLUDEDIR=include/mysql"
558 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
559 "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
560 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
561 "-DINSTALL_DOCDIR=share/mysql/docs"
562 "-DINSTALL_SHAREDIR=share")
563 #:phases
564 (modify-phases %standard-phases
565 (add-after 'unpack 'fix-pcre-detection
566 (lambda _
567 ;; The bundled PCRE in MariaDB has a patch that was upstreamed
568 ;; in version 8.34. Unfortunately the upstream patch behaves
569 ;; slightly differently and the build system fails to detect it.
570 ;; See <https://bugs.exim.org/show_bug.cgi?id=2173>.
571 ;; XXX: Consider patching PCRE instead.
572 (substitute* "cmake/pcre.cmake"
573 ((" OR NOT PCRE_STACK_SIZE_OK") ""))
574 #t))
575 (add-after 'unpack 'adjust-tests
576 (lambda _
577 (let ((disabled-tests
578 '(;; These fail because root@hostname == root@localhost in
579 ;; the build environment, causing a user count mismatch.
580 ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
581 "main.join_cache"
582 "main.explain_non_select"
583 "main.stat_tables_innodb"
584 "roles.acl_statistics"
585 "main.mysqldump"
586 "innodb_fts.crash_recovery"
587
588 ;; FIXME: This test fails on i686:
589 ;; -myisampack: Can't create/write to file (Errcode: 17 "File exists")
590 ;; +myisampack: Can't create/write to file (Errcode: 17 "File exists)
591 ;; When running "myisampack --join=foo/t3 foo/t1 foo/t2"
592 ;; (all three tables must exist and be identical)
593 ;; in a loop it produces the same error around 1/240 times.
594 ;; montywi on #maria suggested removing the real_end check in
595 ;; "strings/my_vsnprintf.c" on line 503, yet it still does not
596 ;; reach the ending quote occasionally. Disable it for now.
597 "main.myisampack"
598 ;; FIXME: This test fails on armhf-linux:
599 "mroonga/storage.index_read_multiple_double"))
600
601 ;; This file contains a list of known-flaky tests for this
602 ;; release. Append our own items.
603 (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
604 (for-each (lambda (test)
605 (format unstable-tests "~a : ~a\n"
606 test "Disabled in Guix"))
607 disabled-tests)
608 (close-port unstable-tests)
609
610 (substitute* "mysql-test/mysql-test-run.pl"
611 (("/bin/ls") (which "ls"))
612 (("/bin/sh") (which "sh")))
613 #t)))
614 (add-before 'configure 'disable-plugins
615 (lambda _
616 (let ((disable-plugin (lambda (name)
617 (call-with-output-file
618 (string-append "plugin/" name
619 "/CMakeLists.txt")
620 (lambda (port)
621 (format port "\n")))))
622 (disabled-plugins '(;; XXX: Causes a test failure.
623 "disks")))
624 (for-each disable-plugin disabled-plugins)
625 #t)))
626 (replace 'check
627 (lambda* (#:key (tests? #t) #:allow-other-keys)
628 (if tests?
629 (with-directory-excursion "mysql-test"
630 (invoke "./mtr" "--verbose"
631 "--retry=3"
632 "--testcase-timeout=40"
633 "--suite-timeout=600"
634 "--parallel" (number->string (parallel-job-count))
635 "--skip-test-list=unstable-tests"))
636 (format #t "test suite not run~%"))
637 #t))
638 (add-after
639 'install 'post-install
640 (lambda* (#:key outputs #:allow-other-keys)
641 (let* ((out (assoc-ref outputs "out"))
642 (test (assoc-ref outputs "test")))
643 (substitute* (string-append out "/bin/mysql_install_db")
644 (("basedir=\"\"")
645 (string-append "basedir=\"" out "\"")))
646 ;; Remove unneeded files for testing.
647 (with-directory-excursion out
648 (for-each delete-file-recursively
649 '("data" "mysql-test" "sql-bench"
650 "share/man/man1/mysql-test-run.pl.1"))
651 ;; Delete huge and unnecessary executables.
652 (for-each delete-file (find-files "bin" "(test|embedded)"))
653 ;; And static libraries.
654 (for-each delete-file (find-files "lib" "\\.a$")))
655 #t))))))
656 (native-inputs
657 `(("bison" ,bison)
658 ("perl" ,perl)))
659 (inputs
660 `(("jemalloc" ,jemalloc)
661 ("libaio" ,libaio)
662 ("libxml2" ,libxml2)
663 ("ncurses" ,ncurses)
664 ("pcre" ,pcre)
665 ("snappy" ,snappy)
666 ("xz" ,xz)
667 ("zlib" ,zlib)))
668 (propagated-inputs
669 ;; mariadb.pc says -lssl -lcrypto, so propagate it.
670 `(("openssl" ,openssl)))
671 ;; The test suite is very resource intensive and can take more than three
672 ;; hours on a x86_64 system. Give slow and busy machines some leeway.
673 (properties '((timeout . 64800))) ;18 hours
674 (home-page "https://mariadb.org/")
675 (synopsis "SQL database server")
676 (description
677 "MariaDB is a multi-user and multi-threaded SQL database server, designed
678 as a drop-in replacement of MySQL.")
679 (license license:gpl2)))
680
681 ;; Don't forget to update the other postgresql packages when upgrading this one.
682 (define-public postgresql
683 (package
684 (name "postgresql")
685 (version "10.6")
686 (source (origin
687 (method url-fetch)
688 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
689 version "/postgresql-" version ".tar.bz2"))
690 (sha256
691 (base32
692 "0jv26y3f10svrjxzsgqxg956c86b664azyk2wppzpa5x11pjga38"))
693 (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))
694 (build-system gnu-build-system)
695 (arguments
696 `(#:configure-flags '("--with-uuid=e2fs")
697 #:phases
698 (modify-phases %standard-phases
699 (add-before 'configure 'patch-/bin/sh
700 (lambda _
701 ;; Refer to the actual shell.
702 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
703 "src/bin/psql/command.c")
704 (("/bin/sh") (which "sh")))
705 #t))
706 (add-after 'build 'build-contrib
707 (lambda _
708 (invoke "make" "-C" "contrib")))
709 (add-after 'install 'install-contrib
710 (lambda _
711 (invoke "make" "-C" "contrib" "install"))))))
712 (inputs
713 `(("readline" ,readline)
714 ("libuuid" ,util-linux)
715 ("zlib" ,zlib)))
716 (home-page "https://www.postgresql.org/")
717 (synopsis "Powerful object-relational database system")
718 (description
719 "PostgreSQL is a powerful object-relational database system. It is fully
720 ACID compliant, has full support for foreign keys, joins, views, triggers, and
721 stored procedures (in multiple languages). It includes most SQL:2008 data
722 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
723 TIMESTAMP. It also supports storage of binary large objects, including
724 pictures, sounds, or video.")
725 (license (license:x11-style "file://COPYRIGHT"))))
726
727 (define-public postgresql-9.6
728 (package
729 (inherit postgresql)
730 (name "postgresql")
731 (version "9.6.11")
732 (source (origin
733 (method url-fetch)
734 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
735 version "/postgresql-" version ".tar.bz2"))
736 (sha256
737 (base32
738 "0c55akrkzqd6p6a8hr0338wk246hl76r9j16p4zn3s51d7f0l99q"))))))
739
740 (define-public python-pymysql
741 (package
742 (name "python-pymysql")
743 (version "0.9.2")
744 (source
745 (origin
746 (method url-fetch)
747 (uri (pypi-uri "PyMySQL" version))
748 (sha256
749 (base32
750 "0gvi63f1zq1bbd30x28kqyx351hal1yc323ckp0mihainb5n1iwy"))))
751 (build-system python-build-system)
752 (native-inputs
753 `(("python-unittest2" ,python-unittest2)))
754 (inputs
755 `(("python-cryptography" ,python-cryptography)))
756 (arguments
757 `(#:tests? #f)) ; tests expect a running MySQL
758 (home-page "https://github.com/PyMySQL/PyMySQL/")
759 (synopsis "Pure-Python MySQL driver")
760 (description
761 "PyMySQL is a pure-Python MySQL client library, based on PEP 249.
762 Most public APIs are compatible with @command{mysqlclient} and MySQLdb.")
763 (license license:expat)))
764
765 (define-public python2-pymysql
766 (package-with-python2 python-pymysql))
767
768 (define-public qdbm
769 (package
770 (name "qdbm")
771 (version "1.8.78")
772 (source
773 (origin
774 (method url-fetch)
775 (uri (string-append "http://fallabs.com/" name "/"
776 name "-" version ".tar.gz"))
777 (sha256
778 (base32
779 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
780 (build-system gnu-build-system)
781 (arguments
782 `( #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
783 (assoc-ref %outputs "out")
784 "/lib"))))
785 (home-page "http://fallabs.com/qdbm")
786 (synopsis "Key-value database")
787 (description "QDBM is a library of routines for managing a
788 database. The database is a simple data file containing key-value
789 pairs. Every key and value is serial bytes with variable length.
790 Binary data as well as character strings can be used as a key or a
791 value. There is no concept of data tables or data types. Records are
792 organized in a hash table or B+ tree.")
793 (license license:lgpl2.1+)))
794
795 (define-public recutils
796 (package
797 (name "recutils")
798 (version "1.8")
799 (source (origin
800 (method url-fetch)
801 (uri (string-append "mirror://gnu/recutils/recutils-"
802 version ".tar.gz"))
803 (sha256
804 (base32
805 "14xiln4immfsw8isnvwvq0h23f6z0wilpgsc4qzabnrzb5lsx3nz"))))
806 (build-system gnu-build-system)
807
808 (arguments '(#:configure-flags
809 (list (string-append "--with-bash-headers="
810 (assoc-ref %build-inputs "bash:include")
811 "/include/bash"))))
812
813 (native-inputs `(("emacs" ,emacs-minimal)
814 ("bc" ,bc)
815 ("bash:include" ,bash "include")
816 ("check" ,check)
817 ("libuuid" ,util-linux)
818 ("pkg-config" ,pkg-config)))
819
820 ;; TODO: Add more optional inputs.
821 (inputs `(("curl" ,curl)
822 ("libgcrypt" ,libgcrypt)))
823 (synopsis "Manipulate plain text files as databases")
824 (description
825 "GNU Recutils is a set of tools and libraries for creating and
826 manipulating text-based, human-editable databases. Despite being text-based,
827 databases created with Recutils carry all of the expected features such as
828 unique fields, primary keys, time stamps and more. Many different field
829 types are supported, as is encryption.")
830 (license license:gpl3+)
831 (home-page "https://www.gnu.org/software/recutils/")))
832
833 (define-public rocksdb
834 (package
835 (name "rocksdb")
836 (version "5.15.10")
837 (source (origin
838 (method git-fetch)
839 (uri (git-reference
840 (url "https://github.com/facebook/rocksdb")
841 (commit (string-append "v" version))))
842 (file-name (git-file-name name version))
843 (sha256
844 (base32
845 "0q26frbj9pykarcfa0yxgwncxlvsqhjkby0jrbfs1a8srja688r4"))
846 (modules '((guix build utils)))
847 (snippet
848 '(begin
849 ;; TODO: unbundle gtest.
850 (delete-file "build_tools/gnu_parallel")
851 (substitute* "Makefile"
852 (("build_tools/gnu_parallel") "parallel"))
853 #t))))
854 (build-system gnu-build-system)
855 (arguments
856 `(#:make-flags (list "CC=gcc" "V=1"
857 ;; Ceph requires that RTTI is enabled.
858 "USE_RTTI=1"
859 (string-append "INSTALL_PATH="
860 (assoc-ref %outputs "out"))
861
862 ;; Running the full test suite takes hours and require
863 ;; a lot of disk space. Instead we only run a subset
864 ;; (see .travis.yml and Makefile).
865 "ROCKSDBTESTS_END=db_tailing_iter_test")
866 #:test-target "check_some"
867 ;; Many tests fail on 32-bit platforms. There are multiple reports about
868 ;; this upstream, but it's not going to be supported any time soon.
869 #:tests? (let ((system ,(or (%current-target-system)
870 (%current-system))))
871 (or (string-prefix? "x86_64-linux" system)
872 (string-prefix? "aarch64-linux" system)))
873 #:phases
874 (modify-phases %standard-phases
875 (add-after 'unpack 'patch-Makefile
876 (lambda _
877 (substitute* "Makefile"
878 ;; Don't depend on the static library when installing.
879 (("install: install-static")
880 "install: install-shared")
881 (("#!/bin/sh") (string-append "#!" (which "sh"))))
882 #t))
883 (delete 'configure)
884 ;; The default target is only needed for tests and built on demand.
885 (delete 'build)
886 (add-before 'check 'disable-optimizations
887 (lambda _
888 ;; Prevent the build from passing '-march=native' to the compiler.
889 (setenv "PORTABLE" "1")
890 #t))
891 (add-before 'check 'disable-failing-tests
892 (lambda _
893 (substitute* "Makefile"
894 ;; These tests reliably fail due to "Too many open files".
895 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
896 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
897 #t))
898 (add-after 'check 'build
899 ;; The default build target is a debug build for tests. The
900 ;; install target depends on the "shared_lib" release target
901 ;; so we build it here for clarity.
902 (lambda* (#:key (make-flags '()) parallel-build? #:allow-other-keys)
903 (apply invoke "make" "shared_lib"
904 `(,@(if parallel-build?
905 `("-j" ,(number->string (parallel-job-count)))
906 '())
907 ,@make-flags)))))))
908 (native-inputs
909 `(("parallel" ,parallel)
910 ("perl" ,perl)
911 ("procps" ,procps)
912 ("python" ,python-2)
913 ("which" ,which)))
914 (inputs
915 `(("bzip2" ,bzip2)
916 ("gflags" ,gflags)
917 ("jemalloc" ,jemalloc)
918 ("lz4" ,lz4)
919 ("snappy" ,snappy)
920 ("zlib" ,zlib)))
921 (home-page "http://rocksdb.org/")
922 (synopsis "Persistent key-value store for fast storage")
923 (description
924 "RocksDB is a library that forms the core building block for a fast
925 key-value server, especially suited for storing data on flash drives. It
926 has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
927 between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
928 (RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
929 compactions, making it specially suitable for storing multiple terabytes of
930 data in a single database. RocksDB is partially based on @code{LevelDB}.")
931 ;; RocksDB is dual licensed under GPL2 and ASL 2.0. Some header
932 ;; files carry the 3-clause BSD license.
933 (license (list license:gpl2 license:asl2.0 license:bsd-3))))
934
935 (define-public sparql-query
936 (package
937 (name "sparql-query")
938 (version "1.1")
939 (source (origin
940 (method url-fetch)
941 (uri (string-append "https://github.com/tialaramex/"
942 name "/archive/" version ".tar.gz"))
943 (sha256
944 (base32 "0yq3k20472rv8npcc420q9ab6idy584g5y0q501d360k5q0ggr8w"))
945 (file-name (string-append name "-" version ".tar.gz"))))
946 (build-system gnu-build-system)
947 (inputs
948 `(("readline" ,readline)
949 ("ncurses" ,ncurses)
950 ("glib" ,glib)
951 ("libxml2" ,libxml2)
952 ("curl" ,curl)))
953 (native-inputs
954 `(("pkg-config" ,pkg-config)))
955 (arguments
956 `(#:make-flags '("CC=gcc")
957 #:phases
958 (modify-phases %standard-phases
959 (delete 'configure)
960 ;; The Makefile uses git to obtain versioning information. This phase
961 ;; substitutes the git invocation with the package version.
962 (add-after 'unpack 'remove-git-dependency
963 (lambda _
964 (substitute* "Makefile"
965 (("^gitrev :=.*$")
966 (string-append "gitrev = \"v" ,version "\"")))
967 #t))
968 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
969 ;; This replacement does the same thing, except for using $PREFIX/bin
970 ;; instead.
971 (replace 'install
972 (lambda* (#:key outputs #:allow-other-keys)
973 (let* ((out (assoc-ref outputs "out"))
974 (bin (string-append out "/bin")))
975 (install-file "sparql-query" bin)
976 (symlink (string-append bin "/sparql-query")
977 (string-append bin "/sparql-update")))
978 #t))
979 (replace 'check
980 (lambda* (#:key make-flags #:allow-other-keys)
981 (apply invoke "make" `(,@make-flags "scan-test"))
982 (invoke "./scan-test"))))))
983 (home-page "https://github.com/tialaramex/sparql-query/")
984 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
985 (description "Sparql-query is a command-line tool for accessing SPARQL
986 endpoints over HTTP. It has been intentionally designed to 'feel' similar to
987 tools for interrogating SQL databases. For example, you can enter a query over
988 several lines, using a semi-colon at the end of a line to indicate the end of
989 your query. It also supports readline so that you can more easily recall and
990 edit previous queries, even across sessions. It can be used non-interactively,
991 for example from a shell script.")
992 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
993 ;; others (like sparql-query.c) contain a GPLv2+ license header.
994 (license (list license:gpl3+))))
995
996 (define-public sqlcrush
997 ;; Unfortunately, there is no proper upstream release and may never be.
998 (let ((commit "b5f6868f189566a26eecc78d0f0659813c1aa98a")
999 (revision "1"))
1000 (package
1001 (name "sqlcrush")
1002 (version (git-version "0.1.5" revision commit))
1003 (source (origin
1004 (method git-fetch)
1005 (uri (git-reference
1006 (url "https://github.com/coffeeandscripts/sqlcrush.git")
1007 (commit commit)))
1008 (file-name (git-file-name name version))
1009 (sha256
1010 (base32
1011 "0x3wy40r93p0jv3nbwj9a77wa4ff697d13r0wffmm7q9h3mzsww8"))))
1012 (build-system python-build-system)
1013 (inputs
1014 `(("python-cryptography" ,python-cryptography)
1015 ("python-psycopg2" ,python-psycopg2)
1016 ("python-pymysql" ,python-pymysql)
1017 ("python-sqlalchemy" ,python-sqlalchemy)))
1018 (home-page "https://github.com/coffeeandscripts/sqlcrush")
1019 (synopsis "Text console-based database viewer and editor")
1020 (description
1021 "SQLcrush lets you view and edit a database directly from the text
1022 console through an ncurses interface. You can explore each table's structure,
1023 browse and edit the contents, add and delete entries, all while tracking your
1024 changes.")
1025 (license license:gpl3+)))) ; no headers, see README.md
1026
1027 (define-public tdb
1028 (package
1029 (name "tdb")
1030 (version "1.3.16")
1031 (source (origin
1032 (method url-fetch)
1033 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
1034 version ".tar.gz"))
1035 (sha256
1036 (base32
1037 "1ibcz466xwk1x6xvzlgzd5va4lyrjzm3rnjak29kkwk7cmhw4gva"))))
1038 (build-system gnu-build-system)
1039 (arguments
1040 '(#:phases
1041 (modify-phases %standard-phases
1042 (replace 'configure
1043 (lambda* (#:key outputs #:allow-other-keys)
1044 (let ((out (assoc-ref outputs "out")))
1045 ;; The 'configure' script is a wrapper for Waf and
1046 ;; doesn't recognize things like '--enable-fast-install'.
1047 (invoke "./configure"
1048 (string-append "--prefix=" out))))))))
1049 (native-inputs
1050 `(;; TODO: Build the documentation.
1051 ;; ("docbook-xsl" ,docbook-xsl)
1052 ;; ("libxml2" ,libxml2)
1053 ;; ("libxslt" ,libxslt)
1054 ("python" ,python-2))) ;for the Waf build system
1055 (home-page "https://tdb.samba.org/")
1056 (synopsis "Trivial database")
1057 (description
1058 "TDB is a Trivial Database. In concept, it is very much like GDBM,
1059 and BSD's DB except that it allows multiple simultaneous writers and uses
1060 locking internally to keep writers from trampling on each other. TDB is also
1061 extremely small.")
1062 (license license:lgpl3+)))
1063
1064 (define-public perl-dbi
1065 (package
1066 (name "perl-dbi")
1067 (version "1.641")
1068 (source (origin
1069 (method url-fetch)
1070 (uri (string-append
1071 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
1072 version ".tar.gz"))
1073 (sha256
1074 (base32
1075 "1hf2x29bnqf2x1v4bdhji802z7n2mbg7h1amv8gdkqyhrlrfa2am"))))
1076 (build-system perl-build-system)
1077 (synopsis "Database independent interface for Perl")
1078 (description "This package provides an database interface for Perl.")
1079 (home-page "https://metacpan.org/release/DBI")
1080 (license license:perl-license)))
1081
1082 (define-public perl-dbix-class
1083 (package
1084 (name "perl-dbix-class")
1085 (version "0.082841")
1086 (source
1087 (origin
1088 (method url-fetch)
1089 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1090 "DBIx-Class-" version ".tar.gz"))
1091 (sha256
1092 (base32
1093 "1gf3hgv8f9rnr8bl4ljgsqk4aliphmvljhsk4282kvdc4mcgh1fp"))))
1094 (build-system perl-build-system)
1095 (native-inputs
1096 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
1097 ("perl-file-temp" ,perl-file-temp)
1098 ("perl-module-install" ,perl-module-install)
1099 ("perl-package-stash" ,perl-package-stash)
1100 ("perl-test-deep" ,perl-test-deep)
1101 ("perl-test-exception" ,perl-test-exception)
1102 ("perl-test-warn" ,perl-test-warn)))
1103 (propagated-inputs
1104 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1105 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1106 ("perl-class-inspector" ,perl-class-inspector)
1107 ("perl-config-any" ,perl-config-any)
1108 ("perl-context-preserve" ,perl-context-preserve)
1109 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
1110 ("perl-data-page" ,perl-data-page)
1111 ("perl-dbi" ,perl-dbi)
1112 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
1113 ("perl-hash-merge" ,perl-hash-merge)
1114 ("perl-module-find" ,perl-module-find)
1115 ("perl-moo" ,perl-moo)
1116 ("perl-mro-compat" ,perl-mro-compat)
1117 ("perl-namespace-clean" ,perl-namespace-clean)
1118 ("perl-path-class" ,perl-path-class)
1119 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
1120 ("perl-scope-guard" ,perl-scope-guard)
1121 ("perl-sql-abstract" ,perl-sql-abstract)
1122 ("perl-sub-name" ,perl-sub-name)
1123 ("perl-text-balanced" ,perl-text-balanced)
1124 ("perl-try-tiny" ,perl-try-tiny)))
1125 (home-page "https://metacpan.org/release/DBIx-Class")
1126 (synopsis "Extensible and flexible object <-> relational mapper")
1127 (description "An SQL to OO mapper with an object API inspired by
1128 Class::DBI (with a compatibility layer as a springboard for porting) and a
1129 resultset API that allows abstract encapsulation of database operations. It
1130 aims to make representing queries in your code as perl-ish as possible while
1131 still providing access to as many of the capabilities of the database as
1132 possible, including retrieving related records from multiple tables in a
1133 single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
1134 \"ORDER BY\" and \"HAVING\" support.")
1135 (license license:perl-license)))
1136
1137 (define-public perl-dbix-class-cursor-cached
1138 (package
1139 (name "perl-dbix-class-cursor-cached")
1140 (version "1.001004")
1141 (source
1142 (origin
1143 (method url-fetch)
1144 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
1145 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
1146 (sha256
1147 (base32
1148 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
1149 (build-system perl-build-system)
1150 (native-inputs
1151 `(("perl-cache-cache" ,perl-cache-cache)
1152 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1153 ("perl-module-install" ,perl-module-install)))
1154 (propagated-inputs
1155 `(("perl-carp-clan" ,perl-carp-clan)
1156 ("perl-dbix-class" ,perl-dbix-class)))
1157 (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached")
1158 (synopsis "Cursor with built-in caching support")
1159 (description "DBIx::Class::Cursor::Cached provides a cursor class with
1160 built-in caching support.")
1161 (license license:perl-license)))
1162
1163 (define-public perl-dbix-class-introspectablem2m
1164 (package
1165 (name "perl-dbix-class-introspectablem2m")
1166 (version "0.001002")
1167 (source
1168 (origin
1169 (method url-fetch)
1170 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1171 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
1172 (sha256
1173 (base32
1174 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
1175 (build-system perl-build-system)
1176 (native-inputs
1177 `(("perl-module-install" ,perl-module-install)))
1178 (propagated-inputs
1179 `(("perl-dbix-class" ,perl-dbix-class)))
1180 (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M")
1181 (synopsis "Introspect many-to-many relationships")
1182 (description "Because the many-to-many relationships are not real
1183 relationships, they can not be introspected with DBIx::Class. Many-to-many
1184 relationships are actually just a collection of convenience methods installed
1185 to bridge two relationships. This DBIx::Class component can be used to store
1186 all relevant information about these non-relationships so they can later be
1187 introspected and examined.")
1188 (license license:perl-license)))
1189
1190 (define-public perl-dbix-class-schema-loader
1191 (package
1192 (name "perl-dbix-class-schema-loader")
1193 (version "0.07049")
1194 (source
1195 (origin
1196 (method url-fetch)
1197 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1198 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
1199 (sha256
1200 (base32
1201 "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8"))))
1202 (build-system perl-build-system)
1203 (native-inputs
1204 `(("perl-config-any" ,perl-config-any)
1205 ("perl-config-general" ,perl-config-general)
1206 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1207 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
1208 ("perl-module-install" ,perl-module-install)
1209 ("perl-moose" ,perl-moose)
1210 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
1211 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
1212 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1213 ("perl-test-deep" ,perl-test-deep)
1214 ("perl-test-differences" ,perl-test-differences)
1215 ("perl-test-exception" ,perl-test-exception)
1216 ("perl-test-pod" ,perl-test-pod)
1217 ("perl-test-warn" ,perl-test-warn)))
1218 (propagated-inputs
1219 `(("perl-class-unload" ,perl-class-unload)
1220 ("perl-class-inspector" ,perl-class-inspector)
1221 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1222 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1223 ("perl-carp-clan" ,perl-carp-clan)
1224 ("perl-data-dump" ,perl-data-dump)
1225 ("perl-dbix-class" ,perl-dbix-class)
1226 ("perl-hash-merge" ,perl-hash-merge)
1227 ("perl-list-moreutils" ,perl-list-moreutils)
1228 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
1229 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
1230 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
1231 ("perl-namespace-clean" ,perl-namespace-clean)
1232 ("perl-mro-compat" ,perl-mro-compat)
1233 ("perl-scope-guard" ,perl-scope-guard)
1234 ("perl-string-camelcase" ,perl-string-camelcase)
1235 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
1236 ("perl-sub-name" ,perl-sub-name)
1237 ("perl-try-tiny" ,perl-try-tiny)))
1238 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
1239 (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader")
1240 (synopsis "Create a DBIx::Class::Schema based on a database")
1241 (description "DBIx::Class::Schema::Loader automates the definition of a
1242 DBIx::Class::Schema by scanning database table definitions and setting up the
1243 columns, primary keys, unique constraints and relationships.")
1244 (license license:perl-license)))
1245
1246 (define-public perl-dbd-pg
1247 (package
1248 (name "perl-dbd-pg")
1249 (version "3.7.4")
1250 (source
1251 (origin
1252 (method url-fetch)
1253 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
1254 "DBD-Pg-" version ".tar.gz"))
1255 (sha256
1256 (base32
1257 "0gkqlvbmzbdm0g4k328nlkjdg3wrjm5i2n9jxj1i8sqxkm79rylz"))))
1258 (build-system perl-build-system)
1259 (native-inputs
1260 `(("perl-dbi" ,perl-dbi)))
1261 (propagated-inputs
1262 `(("perl-dbi" ,perl-dbi)
1263 ("postgresql" ,postgresql)))
1264 (home-page "https://metacpan.org/release/DBD-Pg")
1265 (synopsis "DBI PostgreSQL interface")
1266 (description "This package provides a PostgreSQL driver for the Perl5
1267 @dfn{Database Interface} (DBI).")
1268 (license license:perl-license)))
1269
1270 (define-public perl-dbd-mysql
1271 (package
1272 (name "perl-dbd-mysql")
1273 (version "4.048")
1274 (source
1275 (origin
1276 (method url-fetch)
1277 (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
1278 "DBD-mysql-" version ".tar.gz"))
1279 (sha256
1280 (base32
1281 "1zqmch6c9gq06z90mkmk1skajk2kaggriw19ym5w04l7wv5gydqp"))))
1282 (build-system perl-build-system)
1283 (arguments
1284 `(#:phases
1285 (modify-phases %standard-phases
1286 (add-before 'configure 'skip-library-detection
1287 ;; Avoid depencies on perl-devel-checklib, openssl, and zlib. They
1288 ;; are really only needed for the test suite; their absence does not
1289 ;; affect the build or the end result.
1290 (lambda _
1291 (substitute* "Makefile.PL"
1292 (("use Devel::CheckLib;" match)
1293 (string-append "# " match))
1294 (("assert_lib")
1295 "print"))
1296 #t)))
1297 ;; Tests require running MySQL server.
1298 #:tests? #f))
1299 (propagated-inputs
1300 `(("perl-dbi" ,perl-dbi)
1301 ("mysql" ,mysql)))
1302 (home-page "https://metacpan.org/release/DBD-mysql")
1303 (synopsis "DBI MySQL interface")
1304 (description "This package provides a MySQL driver for the Perl5
1305 @dfn{Database Interface} (DBI).")
1306 (license license:perl-license)))
1307
1308 (define-public perl-dbd-sqlite
1309 (package
1310 (name "perl-dbd-sqlite")
1311 (version "1.58")
1312 (source (origin
1313 (method url-fetch)
1314 (uri (string-append
1315 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
1316 version ".tar.gz"))
1317 (sha256
1318 (base32
1319 "0fqx386jgs9mmrknr7smmzapf07izgivza7x08lfm39ks2cxs83i"))))
1320 (build-system perl-build-system)
1321 (inputs `(("sqlite" ,sqlite)))
1322 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
1323 (synopsis "SQlite interface for Perl")
1324 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
1325 the entire thing in the distribution. So in order to get a fast transaction
1326 capable RDBMS working for your Perl project you simply have to install this
1327 module, and nothing else.")
1328 (license license:perl-license)
1329 (home-page "https://metacpan.org/release/DBD-SQLite")))
1330
1331 (define-public perl-sql-abstract
1332 (package
1333 (name "perl-sql-abstract")
1334 (version "1.85")
1335 (source
1336 (origin
1337 (method url-fetch)
1338 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1339 "SQL-Abstract-" version ".tar.gz"))
1340 (sha256
1341 (base32
1342 "1aycggrvppy2zgkwwn85jkdz93n5gsx4dambrjk67k5067hayi4z"))))
1343 (build-system perl-build-system)
1344 (native-inputs
1345 `(("perl-module-install" ,perl-module-install)
1346 ("perl-test-deep" ,perl-test-deep)
1347 ("perl-test-exception" ,perl-test-exception)
1348 ("perl-test-warn" ,perl-test-warn)))
1349 (propagated-inputs
1350 `(("perl-hash-merge" ,perl-hash-merge)
1351 ("perl-moo" ,perl-moo)
1352 ("perl-mro-compat" ,perl-mro-compat)
1353 ("perl-text-balanced" ,perl-text-balanced)))
1354 (home-page "https://metacpan.org/release/SQL-Abstract")
1355 (synopsis "Generate SQL from Perl data structures")
1356 (description "This module was inspired by the excellent DBIx::Abstract.
1357 While based on the concepts used by DBIx::Abstract, the concepts used have
1358 been modified to make the SQL easier to generate from Perl data structures.
1359 The underlying idea is for this module to do what you mean, based on the data
1360 structures you provide it, so that you don't have to modify your code every
1361 time your data changes.")
1362 (license license:perl-license)))
1363
1364 (define-public perl-sql-splitstatement
1365 (package
1366 (name "perl-sql-splitstatement")
1367 (version "1.00020")
1368 (source
1369 (origin
1370 (method url-fetch)
1371 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
1372 "SQL-SplitStatement-" version ".tar.gz"))
1373 (sha256
1374 (base32
1375 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
1376 (build-system perl-build-system)
1377 (native-inputs
1378 `(("perl-test-exception" ,perl-test-exception)))
1379 (propagated-inputs
1380 `(("perl-class-accessor" ,perl-class-accessor)
1381 ("perl-list-moreutils" ,perl-list-moreutils)
1382 ("perl-regexp-common" ,perl-regexp-common)
1383 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
1384 (home-page "https://metacpan.org/release/SQL-SplitStatement")
1385 (synopsis "Split SQL code into atomic statements")
1386 (description "This module tries to split any SQL code, even including
1387 non-standard extensions, into the atomic statements it is composed of.")
1388 (license license:perl-license)))
1389
1390 (define-public perl-sql-tokenizer
1391 (package
1392 (name "perl-sql-tokenizer")
1393 (version "0.24")
1394 (source
1395 (origin
1396 (method url-fetch)
1397 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
1398 "SQL-Tokenizer-" version ".tar.gz"))
1399 (sha256
1400 (base32
1401 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
1402 (build-system perl-build-system)
1403 (home-page "https://metacpan.org/release/SQL-Tokenizer")
1404 (synopsis "SQL tokenizer")
1405 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
1406 claim to be a parser or query verifier. It just creates sane tokens from a
1407 valid SQL query.")
1408 (license license:perl-license)))
1409
1410 (define-public unixodbc
1411 (package
1412 (name "unixodbc")
1413 (version "2.3.7")
1414 (source (origin
1415 (method url-fetch)
1416 (uri
1417 (string-append
1418 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
1419 version ".tar.gz"))
1420 (sha256
1421 (base32 "0xry3sg497wly8f7715a7gwkn2k36bcap0mvzjw74jj53yx6kwa5"))))
1422 (build-system gnu-build-system)
1423 (synopsis "Data source abstraction library")
1424 (description "Unixodbc is a library providing an API with which to access
1425 data sources. Data sources include SQL Servers and any software with an ODBC
1426 Driver.")
1427 (license license:lgpl2.1+)
1428 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
1429 (home-page "http://www.unixodbc.org")))
1430
1431 (define-public unqlite
1432 (package
1433 (name "unqlite")
1434 (version "1.1.6")
1435 (source (origin
1436 (method url-fetch)
1437 ;; Contains bug fixes against the official release, and has an
1438 ;; autotooled build system.
1439 (uri (string-append "https://github.com/aidin36/tocc/releases/"
1440 "download/v1.0.0/"
1441 "unqlite-unofficial-" version ".tar.gz"))
1442 (sha256
1443 (base32
1444 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
1445 (build-system gnu-build-system)
1446 (arguments `(#:tests? #f)) ;No check target
1447 (home-page "http://www.unqlite.org")
1448 (synopsis "In-memory key/value and document store")
1449 (description
1450 "UnQLite is an in-process software library which implements a
1451 self-contained, serverless, zero-configuration, transactional NoSQL
1452 database engine. UnQLite is a document store database similar to
1453 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
1454 similar to BerkeleyDB, LevelDB, etc.")
1455 (license license:bsd-2)))
1456
1457 (define-public redis
1458 (package
1459 (name "redis")
1460 (version "4.0.10")
1461 (source (origin
1462 (method url-fetch)
1463 (uri (string-append "http://download.redis.io/releases/redis-"
1464 version".tar.gz"))
1465 (sha256
1466 (base32
1467 "194cydhv3hf4v95ifvjvsqrs4jn3ffrkg5lvxj5d3y04lwsp9dhx"))))
1468 (build-system gnu-build-system)
1469 (arguments
1470 '(#:tests? #f ; tests related to master/slave and replication fail
1471 #:phases (modify-phases %standard-phases
1472 (delete 'configure))
1473 #:make-flags `("CC=gcc"
1474 "MALLOC=libc"
1475 "LDFLAGS=-ldl"
1476 ,(string-append "PREFIX="
1477 (assoc-ref %outputs "out")))))
1478 (synopsis "Key-value cache and store")
1479 (description "Redis is an advanced key-value cache and store. Redis
1480 supports many data structures including strings, hashes, lists, sets, sorted
1481 sets, bitmaps and hyperloglogs.")
1482 (home-page "http://redis.io/")
1483 (license license:bsd-3)))
1484
1485 (define-public kyotocabinet
1486 (package
1487 (name "kyotocabinet")
1488 (version "1.2.76")
1489 (source (origin
1490 (method url-fetch)
1491 (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
1492 name "-" version ".tar.gz"))
1493 (sha256
1494 (base32
1495 "0g6js20x7vnpq4p8ghbw3mh9wpqksya9vwhzdx6dnlf354zjsal1"))))
1496 (build-system gnu-build-system)
1497 (arguments
1498 `(#:configure-flags
1499 (list
1500 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
1501 (string-append "LDFLAGS=-Wl,-rpath="
1502 (assoc-ref %outputs "out") "/lib"))))
1503 (inputs `(("zlib" ,zlib)))
1504 (home-page "http://fallabs.com/kyotocabinet/")
1505 (synopsis
1506 "Kyoto Cabinet is a modern implementation of the DBM database")
1507 (description
1508 "Kyoto Cabinet is a standalone file-based database that supports Hash
1509 and B+ Tree data storage models. It is a fast key-value lightweight
1510 database and supports many programming languages. It is a NoSQL database.")
1511 (license license:gpl3+)))
1512
1513 (define-public tokyocabinet
1514 (package
1515 (name "tokyocabinet")
1516 (version "1.4.48")
1517 (source
1518 (origin
1519 (method url-fetch)
1520 (uri (string-append "http://fallabs.com/tokyocabinet/"
1521 name "-" version ".tar.gz"))
1522 (sha256
1523 (base32
1524 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
1525 (build-system gnu-build-system)
1526 (arguments
1527 `(#:configure-flags
1528 (list "--enable-pthread" "--enable-off64" "--enable-fastest"
1529 (string-append "LDFLAGS=-Wl,-rpath="
1530 (assoc-ref %outputs "out") "/lib"))))
1531 (inputs
1532 `(("zlib" ,zlib)))
1533 (home-page "http://fallabs.com/tokyocabinet/")
1534 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
1535 (description
1536 "Tokyo Cabinet is a library of routines for managing a database.
1537 The database is a simple data file containing records, each is a pair of a
1538 key and a value. Every key and value is serial bytes with variable length.
1539 Both binary data and character string can be used as a key and a value.
1540 There is neither concept of data tables nor data types. Records are
1541 organized in hash table, B+ tree, or fixed-length array.")
1542 (license license:lgpl2.1+)))
1543
1544 (define-public wiredtiger
1545 (package
1546 (name "wiredtiger")
1547 (version "2.9.1")
1548 (source (origin
1549 (method url-fetch)
1550 (uri (string-append
1551 "http://source.wiredtiger.com/releases/wiredtiger-"
1552 version ".tar.bz2"))
1553 (sha256
1554 (base32
1555 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
1556 (build-system gnu-build-system)
1557 (arguments
1558 '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib")
1559 #:phases
1560 (modify-phases %standard-phases
1561 (add-before 'check 'disable-test/fops
1562 (lambda _
1563 ;; XXX: timed out after 3600 seconds of silence
1564 (substitute* "Makefile"
1565 (("test/fops") ""))
1566 #t)))))
1567 (inputs
1568 `(("lz4" ,lz4)
1569 ("zlib" ,zlib)
1570 ("snappy" ,snappy)))
1571 (home-page "http://source.wiredtiger.com/")
1572 (synopsis "NoSQL data engine")
1573 (description
1574 "WiredTiger is an extensible platform for data management. It supports
1575 row-oriented storage (where all columns of a row are stored together),
1576 column-oriented storage (where columns are stored in groups, allowing for
1577 more efficient access and storage of column subsets) and log-structured merge
1578 trees (LSM), for sustained throughput under random insert workloads.")
1579 (license license:gpl3) ; or GPL-2
1580 ;; configure.ac: WiredTiger requires a 64-bit build.
1581 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
1582
1583 (define-public wiredtiger-3
1584 (package
1585 (inherit wiredtiger)
1586 (name "wiredtiger")
1587 (version "3.1.0")
1588 (source (origin
1589 (method url-fetch)
1590 (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-"
1591 version ".tar.bz2"))
1592 (sha256
1593 (base32
1594 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx"))))))
1595
1596 (define-public guile-wiredtiger
1597 (package
1598 (name "guile-wiredtiger")
1599 (version "0.7.0")
1600 (source (origin
1601 (method git-fetch)
1602 (uri (git-reference
1603 (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
1604 (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b")))
1605 (file-name (string-append name "-" version "-checkout"))
1606 (sha256
1607 (base32
1608 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595"))))
1609 (build-system gnu-build-system)
1610 (arguments
1611 '(#:parallel-tests? #f ;; tests can't be run in parallel, yet.
1612 #:configure-flags
1613 (list (string-append "--with-libwiredtiger-prefix="
1614 (assoc-ref %build-inputs "wiredtiger")))
1615 #:make-flags '("GUILE_AUTO_COMPILE=0")))
1616 (native-inputs
1617 `(("autoconf" ,autoconf)
1618 ("automake" ,automake)
1619 ("pkg-config" ,pkg-config)))
1620 (inputs
1621 `(("wiredtiger" ,wiredtiger-3)
1622 ("guile" ,guile-2.2)))
1623 (propagated-inputs
1624 `(("guile-bytestructures" ,guile-bytestructures)))
1625 (synopsis "WiredTiger bindings for GNU Guile")
1626 (description
1627 "This package provides Guile bindings to the WiredTiger ``NoSQL''
1628 database.")
1629 (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger")
1630 (license license:gpl3+)))
1631
1632 (define-public perl-db-file
1633 (package
1634 (name "perl-db-file")
1635 (version "1.842")
1636 (source
1637 (origin
1638 (method url-fetch)
1639 (uri (string-append
1640 "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
1641 version
1642 ".tar.gz"))
1643 (sha256
1644 (base32
1645 "0w2d99vs9qarng2f9fpg3gchfdzy6an13507jhclcl8wv183h5hg"))))
1646 (build-system perl-build-system)
1647 (inputs `(("bdb" ,bdb)))
1648 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
1649 (arguments
1650 `(#:phases (modify-phases %standard-phases
1651 (add-before
1652 'configure 'modify-config.in
1653 (lambda* (#:key inputs #:allow-other-keys)
1654 (substitute* "config.in"
1655 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
1656 #t)))))
1657 (home-page "https://metacpan.org/release/DB_File")
1658 (synopsis
1659 "Perl5 access to Berkeley DB version 1.x")
1660 (description
1661 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
1662 (license license:perl-license)))
1663
1664 (define-public lmdb
1665 (package
1666 (name "lmdb")
1667 (version "0.9.22")
1668 (source (origin
1669 (method url-fetch)
1670 (uri (string-append "https://github.com/LMDB/lmdb/archive/"
1671 "LMDB_" version ".tar.gz"))
1672 (sha256
1673 (base32
1674 "0a7a8535csrvw71mrgx680m5d17bnxmmhcccij30idifi1cpi4pk"))))
1675 (build-system gnu-build-system)
1676 (arguments
1677 `(#:test-target "test"
1678 #:phases
1679 (modify-phases %standard-phases
1680 (replace 'configure
1681 (lambda* (#:key outputs #:allow-other-keys)
1682 (chdir (string-append
1683 (getenv "PWD") "/lmdb-LMDB_" ,version "/libraries/liblmdb"))
1684 (substitute* "Makefile"
1685 (("/usr/local") (assoc-ref outputs "out")))
1686 #t)))))
1687 (home-page "https://symas.com/products/lightning-memory-mapped-database")
1688 (synopsis "Lightning Memory-Mapped Database library")
1689 (description
1690 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
1691 transactional database. Unlike more complex relational databases, LMDB handles
1692 only key-value pairs (stored as arbitrary byte arrays) and relies on the
1693 underlying operating system for caching and locking, keeping the code small and
1694 simple.
1695 The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
1696 disk-based databases with high read performance that scales linearly over
1697 multiple cores. The size of each database is limited only by the size of the
1698 virtual address space — not physical RAM.")
1699 (license license:openldap2.8)))
1700
1701 (define-public libpqxx
1702 (package
1703 (name "libpqxx")
1704 (version "4.0.1")
1705 (source (origin
1706 (method url-fetch)
1707 (uri (string-append
1708 "http://pqxx.org/download/software/libpqxx/"
1709 name "-" version ".tar.gz"))
1710 (sha256
1711 (base32
1712 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
1713 (build-system gnu-build-system)
1714 (native-inputs
1715 `(("python" ,python-2)))
1716 (inputs `(("postgresql" ,postgresql)))
1717 (arguments
1718 `(#:tests? #f ; # FAIL: 1
1719 #:phases
1720 (modify-phases %standard-phases
1721 (add-before 'configure 'fix-sed-command
1722 (lambda _
1723 ;; Newer sed versions error out if double brackets are not used.
1724 (substitute* "configure"
1725 (("\\[:space:\\]") "[[:space:]]"))
1726 #t)))))
1727 (synopsis "C++ connector for PostgreSQL")
1728 (description
1729 "Libpqxx is a C++ library to enable user programs to communicate with the
1730 PostgreSQL database back-end. The database back-end can be local or it may be
1731 on another machine, accessed via TCP/IP.")
1732 (home-page "http://pqxx.org/")
1733 (license license:bsd-3)))
1734
1735 (define-public python-peewee
1736 (package
1737 (name "python-peewee")
1738 (version "2.10.2")
1739 (source
1740 (origin
1741 (method url-fetch)
1742 (uri (pypi-uri "peewee" version))
1743 (sha256
1744 (base32
1745 "10f2mrd5hw6rjklrzaix2lsxlgc8vx3xak54arcy6yd791zhchi3"))))
1746 (build-system python-build-system)
1747 (arguments
1748 `(#:tests? #f)) ; Fails to import test data
1749 (native-inputs
1750 `(("python-cython" ,python-cython)))
1751 (home-page "https://github.com/coleifer/peewee/")
1752 (synopsis "Small object-relational mapping utility")
1753 (description
1754 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
1755 handles converting between pythonic values and those used by databases, so you
1756 can use Python types in your code without having to worry. It has built-in
1757 support for sqlite, mysql and postgresql. If you already have a database, you
1758 can autogenerate peewee models using @code{pwiz}, a model generator.")
1759 (license license:expat)))
1760
1761 (define-public python2-peewee
1762 (package-with-python2 python-peewee))
1763
1764 (define-public sqlcipher
1765 (package
1766 (name "sqlcipher")
1767 (version "3.4.2")
1768 (source
1769 (origin
1770 (method url-fetch)
1771 (uri (string-append "https://github.com/sqlcipher/" name
1772 "/archive/v" version ".tar.gz"))
1773 (sha256
1774 (base32 "1nxarwbci8jx99f1d0y1ivxcv25s78l1p7q6qy28lkpkcx8pm2b9"))
1775 (file-name (string-append name "-" version ".tar.gz"))))
1776 (build-system gnu-build-system)
1777 (inputs
1778 `(("libcrypto" ,openssl)
1779 ("libtcl8.6" ,tcl))) ; required for running the tests
1780 (native-inputs
1781 `(("tcl" ,tcl)))
1782 (arguments
1783 '(#:configure-flags
1784 '("--enable-tempstore=yes"
1785 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
1786 "LDFLAGS=-lcrypto -ltcl8.6"
1787 "--disable-tcl")
1788 ;; tests cannot be run from the Makefile
1789 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
1790 #:test-target "testfixture"
1791 #:phases
1792 (modify-phases %standard-phases
1793 (add-before 'check 'build-test-runner
1794 (assoc-ref %standard-phases 'check))
1795 (replace 'check
1796 (lambda _
1797 (invoke "./testfixture" "test/crypto.test"))))))
1798 (home-page "https://www.zetetic.net/sqlcipher/")
1799 (synopsis
1800 "Library providing transparent encryption of SQLite database files")
1801 (description "SQLCipher is an implementation of SQLite, extended to
1802 provide transparent 256-bit AES encryption of database files. Pages are
1803 encrypted before being written to disk and are decrypted when read back. It’s
1804 well suited for protecting embedded application databases and for mobile
1805 development.")
1806 ;; The source files
1807 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
1808 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
1809 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
1810 ;; source files are in the public domain.
1811 (license (list license:public-domain license:bsd-3))))
1812
1813 (define-public python-pyodbc-c
1814 (package
1815 (name "python-pyodbc-c")
1816 (version "3.1.4")
1817 (source
1818 (origin
1819 (method url-fetch)
1820 (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
1821 "archive.tar.gz?ref=v" version))
1822 (sha256
1823 (base32
1824 "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
1825 (file-name (string-append name "-" version ".tar.gz"))))
1826 (build-system python-build-system)
1827 (inputs
1828 `(("unixodbc" ,unixodbc)))
1829 (arguments
1830 `(;; No unit tests exist.
1831 #:tests? #f))
1832 (home-page "https://github.com/mkleehammer/pyodbc")
1833 (synopsis "Python ODBC Library")
1834 (description "@code{python-pyodbc-c} provides a Python DB-API driver
1835 for ODBC.")
1836 (license (license:x11-style "file://LICENSE.TXT"))))
1837
1838 (define-public python2-pyodbc-c
1839 (package-with-python2 python-pyodbc-c))
1840
1841 (define-public python-pyodbc
1842 (package
1843 (name "python-pyodbc")
1844 (version "4.0.24")
1845 (source
1846 (origin
1847 (method url-fetch)
1848 (uri (pypi-uri "pyodbc" version))
1849 (sha256
1850 (base32
1851 "1m311vi7vpay1j7rkq71fpsk0gb7454k4lldk5b63hyy6yvsn9j3"))
1852 (file-name (string-append name "-" version ".tar.gz"))))
1853 (build-system python-build-system)
1854 (inputs
1855 `(("unixodbc" ,unixodbc)))
1856 (arguments
1857 `(;; No unit tests exist.
1858 #:tests? #f))
1859 (home-page "https://github.com/mkleehammer/pyodbc")
1860 (synopsis "Python ODBC Library")
1861 (description "@code{python-pyodbc} provides a Python DB-API driver
1862 for ODBC.")
1863 (license (license:x11-style "file:///LICENSE.TXT"))))
1864
1865 (define-public python2-pyodbc
1866 (package-with-python2 python-pyodbc))
1867
1868 (define-public mdbtools
1869 (package
1870 (name "mdbtools")
1871 (version "0.7.1")
1872 (source
1873 (origin
1874 (method git-fetch)
1875 (uri (git-reference
1876 (url "https://github.com/brianb/mdbtools.git")
1877 (commit version)))
1878 (file-name (git-file-name name version))
1879 (sha256
1880 (base32
1881 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
1882 (build-system gnu-build-system)
1883 (inputs
1884 `(("glib" ,glib)))
1885 (native-inputs
1886 `(("autoconf" ,autoconf)
1887 ("automake" ,automake)
1888 ("libtool" ,libtool)
1889 ("pkg-config" ,pkg-config)
1890 ("txt2man" ,txt2man)
1891 ("which" ,which)))
1892 (home-page "http://mdbtools.sourceforge.net/")
1893 (synopsis "Read Microsoft Access databases")
1894 (description "MDB Tools is a set of tools and applications to read the
1895 proprietary MDB file format used in Microsoft's Access database package. This
1896 includes programs to export schema and data from Microsoft's Access database
1897 file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
1898 etc., and an SQL engine for performing simple SQL queries.")
1899 (license (list license:lgpl2.0
1900 license:gpl2+))))
1901
1902 (define-public python-lmdb
1903 (package
1904 (name "python-lmdb")
1905 (version "0.94")
1906 (source (origin
1907 (method url-fetch)
1908 (uri (pypi-uri "lmdb" version))
1909 (sha256
1910 (base32
1911 "1zh38gvkqw1jm5105if6rr7ccbgyxr7k2rm5ygb9ab3bq82pyaww"))
1912 (modules '((guix build utils)))
1913 (snippet
1914 ;; Delete bundled lmdb source files.
1915 '(begin
1916 (for-each delete-file (list "lib/lmdb.h"
1917 "lib/mdb.c"
1918 "lib/midl.c"
1919 "lib/midl.h"))
1920 #t))))
1921 (build-system python-build-system)
1922 (inputs
1923 `(("lmdb" ,lmdb)))
1924 (arguments
1925 `(#:phases
1926 (modify-phases %standard-phases
1927 (add-before 'build 'use-system-lmdb
1928 (lambda* (#:key inputs #:allow-other-keys)
1929 (let ((lmdb (assoc-ref inputs "lmdb")))
1930 (setenv "LMDB_FORCE_SYSTEM" "set")
1931 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
1932 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
1933 #t))))
1934 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
1935 #:tests? #f))
1936 (home-page "https://github.com/dw/py-lmdb")
1937 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
1938 (description
1939 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
1940 Memory-Mapped Database} (LMDB), a high-performance key-value store.")
1941 (license
1942 (list license:openldap2.8
1943 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
1944 ;; but not actually needed on platforms currently supported by Guix.
1945 license:bsd-3))))
1946
1947 (define-public python2-lmdb
1948 (package-with-python2 python-lmdb))
1949
1950 (define-public python-orator
1951 (package
1952 (name "python-orator")
1953 (version "0.9.7")
1954 (source (origin
1955 (method url-fetch)
1956 (uri (pypi-uri "orator" version))
1957 (sha256
1958 (base32
1959 "14r58z64fdp76ixnvmi4lni762b405ynmsx6chr1qihs3yl9zn6c"))))
1960 (build-system python-build-system)
1961 (arguments
1962 `(#:phases
1963 (modify-phases %standard-phases
1964 (add-after 'unpack 'loosen-dependencies
1965 ;; Tests are not actually run since they are not included with the
1966 ;; distributed package, but dependencies are checked.
1967 (lambda _
1968 (substitute* "setup.py"
1969 ((",<.*'") "'")
1970 (("flexmock==0.9.7") "flexmock")
1971 ;; The pytest-mock package is out of date, so we remove minimum
1972 ;; version requirement.
1973 (("pytest-mock.*'") "pytest-mock'"))
1974 #t)))))
1975 (native-inputs
1976 `(("python-pytest-mock" ,python-pytest-mock)
1977 ("python-pytest" ,python-pytest)
1978 ("python-flexmock" ,python-flexmock)))
1979 (propagated-inputs
1980 `(("python-backpack" ,python-backpack)
1981 ("python-blinker" ,python-blinker)
1982 ("python-cleo" ,python-cleo)
1983 ("python-faker" ,python-faker)
1984 ("python-inflection" ,python-inflection)
1985 ("python-lazy-object-proxy" ,python-lazy-object-proxy)
1986 ("python-pendulum" ,python-pendulum)
1987 ("python-pyaml" ,python-pyaml)
1988 ("python-pygments" ,python-pygments)
1989 ("python-simplejson" ,python-simplejson)
1990 ("python-six" ,python-six)
1991 ("python-wrapt" ,python-wrapt)))
1992 (home-page "https://orator-orm.com/")
1993 (synopsis "ActiveRecord ORM for Python")
1994 (description
1995 "Orator provides a simple ActiveRecord-like Object Relational Mapping
1996 implementation for Python.")
1997 (license license:expat)
1998 (properties `((python2-variant . ,(delay python2-orator))))))
1999
2000 (define-public python2-orator
2001 (package-with-python2 (strip-python2-variant python-orator)))
2002
2003 (define-public virtuoso-ose
2004 (package
2005 (name "virtuoso-ose")
2006 (version "7.2.5")
2007 (source
2008 (origin
2009 (method url-fetch)
2010 (uri (string-append
2011 "https://github.com/openlink/virtuoso-opensource/releases/"
2012 "download/v" version "/virtuoso-opensource-" version ".tar.gz"))
2013 (sha256
2014 (base32 "0r1xakclkfi69pzh8z2k16z3x0m49pxp764icj0ad4w4bb97fr42"))))
2015 (build-system gnu-build-system)
2016 (arguments
2017 `(#:tests? #f ; Tests require a network connection.
2018 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
2019 ;; This indicates that the internal zlib code may still be used.
2020 #:configure-flags '("--without-internal-zlib"
2021 "--with-readline")))
2022 (inputs
2023 `(("openssl" ,openssl)
2024 ("net-tools" ,net-tools)
2025 ("readline" ,readline)
2026 ("zlib" ,zlib)))
2027 (home-page "http://vos.openlinksw.com/owiki/wiki/VOS/")
2028 (synopsis "Multi-model database system")
2029 (description "Virtuoso is a scalable cross-platform server that combines
2030 relational, graph, and document data management with web application server
2031 and web services platform functionality.")
2032 ;; configure: error: ... can only be build on 64bit platforms
2033 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))
2034 (license license:gpl2)))
2035
2036 (define-public python-ccm
2037 (package
2038 (name "python-ccm")
2039 (version "2.1.6")
2040 (source
2041 (origin
2042 (method url-fetch)
2043 (uri (pypi-uri "ccm" version))
2044 (sha256
2045 (base32
2046 "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n"))))
2047 (build-system python-build-system)
2048 (propagated-inputs
2049 `(("python-pyyaml" ,python-pyyaml)
2050 ;; Not listed in setup.py, but used in ccmlib/node.py for full
2051 ;; functionality
2052 ("python-psutil" ,python-psutil)
2053 ("python-six" ,python-six)))
2054 (home-page "https://github.com/pcmanus/ccm")
2055 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
2056 localhost")
2057 (description "Cassandra Cluster Manager is a development tool for testing
2058 local Cassandra clusters. It creates, launches and removes Cassandra clusters
2059 on localhost.")
2060 (license license:asl2.0)))
2061
2062 (define-public python2-ccm
2063 (package-with-python2 python-ccm))
2064
2065 (define-public python2-pysqlite
2066 (package
2067 (name "python2-pysqlite")
2068 (version "2.8.3")
2069 (source
2070 (origin
2071 (method url-fetch)
2072 (uri (pypi-uri "pysqlite" version))
2073 (sha256
2074 (base32
2075 "1424gwq9sil2ffmnizk60q36vydkv8rxs6m7xs987kz8cdc37lqp"))))
2076 (build-system python-build-system)
2077 (inputs
2078 `(("sqlite" ,sqlite)))
2079 (arguments
2080 `(#:python ,python-2 ; incompatible with Python 3
2081 #:tests? #f)) ; no test target
2082 (home-page "https://github.com/ghaering/pysqlite")
2083 (synopsis "SQLite bindings for Python")
2084 (description
2085 "Pysqlite provides SQLite bindings for Python that comply to the
2086 Database API 2.0T.")
2087 (license license:zlib)))
2088
2089 (define-public python-sqlalchemy
2090 (package
2091 (name "python-sqlalchemy")
2092 (version "1.2.11")
2093 (source
2094 (origin
2095 (method url-fetch)
2096 (uri (pypi-uri "SQLAlchemy" version))
2097 (sha256
2098 (base32
2099 "094mmbs4igrxplfyqd59j90jb83ixpbbzqc0w49yw81m82nnjrgg"))))
2100 (build-system python-build-system)
2101 (native-inputs
2102 `(("python-cython" ,python-cython) ;for c extensions
2103 ("python-pytest" ,python-pytest)
2104 ("python-mock" ,python-mock))) ;for tests
2105 (arguments
2106 `(#:phases
2107 (modify-phases %standard-phases
2108 (replace 'check
2109 (lambda _ (invoke "py.test"))))))
2110 (home-page "http://www.sqlalchemy.org")
2111 (synopsis "Database abstraction library")
2112 (description
2113 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
2114 gives application developers the full power and flexibility of SQL. It
2115 provides a full suite of well known enterprise-level persistence patterns,
2116 designed for efficient and high-performing database access, adapted into a
2117 simple and Pythonic domain language.")
2118 (license license:x11)))
2119
2120 (define-public python2-sqlalchemy
2121 (package-with-python2 python-sqlalchemy))
2122
2123 (define-public python-sqlalchemy-utils
2124 (package
2125 (name "python-sqlalchemy-utils")
2126 (version "0.32.21")
2127 (source
2128 (origin
2129 (method url-fetch)
2130 (uri (pypi-uri "SQLAlchemy-Utils" version))
2131 (sha256
2132 (base32
2133 "1myn71dn8j74xglyh46f12sh8ywb7j0j732rzwq70kvwwnq32m73"))))
2134 (build-system python-build-system)
2135 (arguments
2136 '(#:tests? #f)) ; FIXME: Many tests require a running database server.
2137 ;; #:phases
2138 ;; (modify-phases %standard-phases
2139 ;; (replace 'check
2140 ;; (lambda _
2141 ;; (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
2142 (propagated-inputs
2143 `(("python-six" ,python-six)
2144 ("python-sqlalchemy" ,python-sqlalchemy)))
2145 (native-inputs
2146 `(("python-dateutil" ,python-dateutil)
2147 ("python-flexmock" ,python-flexmock)
2148 ("python-psycopg2" ,python-psycopg2)
2149 ("python-pytest" ,python-pytest)
2150 ("python-pytz" ,python-pytz)))
2151 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
2152 (synopsis "Various utility functions for SQLAlchemy")
2153 (description
2154 "SQLAlchemy-utils provides various utility functions and custom data types
2155 for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
2156
2157 You might also want to install the following optional dependencies:
2158 @enumerate
2159 @item @code{python-passlib}
2160 @item @code{python-babel}
2161 @item @code{python-cryptography}
2162 @item @code{python-pytz}
2163 @item @code{python-psycopg2}
2164 @item @code{python-furl}
2165 @item @code{python-flask-babel}
2166 @end enumerate
2167 ")
2168 (license license:bsd-3)))
2169
2170 (define-public python2-sqlalchemy-utils
2171 (package-with-python2 python-sqlalchemy-utils))
2172
2173 (define-public python-alembic
2174 (package
2175 (name "python-alembic")
2176 (version "1.0.2")
2177 (source
2178 (origin
2179 (method url-fetch)
2180 (uri (pypi-uri "alembic" version))
2181 (sha256
2182 (base32
2183 "0asqz9mwc4w8bsar1icv3ik9jslxrj3gv3yxgmhc6nc6r9qbkg04"))))
2184 (build-system python-build-system)
2185 (native-inputs
2186 `(("python-mock" ,python-mock)
2187 ("python-pytest-cov" ,python-pytest-cov)))
2188 (propagated-inputs
2189 `(("python-dateutil" ,python-dateutil)
2190 ("python-sqlalchemy" ,python-sqlalchemy)
2191 ("python-mako" ,python-mako)
2192 ("python-editor" ,python-editor)))
2193 (home-page "https://bitbucket.org/zzzeek/alembic")
2194 (synopsis
2195 "Database migration tool for SQLAlchemy")
2196 (description
2197 "Alembic is a lightweight database migration tool for usage with the
2198 SQLAlchemy Database Toolkit for Python.")
2199 (license license:expat)))
2200
2201 (define-public python2-alembic
2202 (package-with-python2 python-alembic))
2203
2204 (define-public python-pickleshare
2205 (package
2206 (name "python-pickleshare")
2207 (version "0.7.5")
2208 (source
2209 (origin
2210 (method url-fetch)
2211 (uri (pypi-uri "pickleshare" version))
2212 (sha256
2213 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
2214 (build-system python-build-system)
2215 (arguments
2216 `(#:phases (modify-phases %standard-phases
2217 (replace 'check
2218 (lambda _
2219 (invoke "pytest"))))))
2220 (native-inputs
2221 `(("python-pytest" ,python-pytest)))
2222 (home-page "https://github.com/vivainio/pickleshare")
2223 (synopsis "Tiny key value database with concurrency support")
2224 (description
2225 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
2226 Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
2227 shelve, many processes can access the database simultaneously. Changing a
2228 value in database is immediately visible to other processes accessing the same
2229 database. Concurrency is possible because the values are stored in separate
2230 files. Hence the “database” is a directory where all files are governed by
2231 PickleShare.")
2232 (properties `((python2-variant . ,(delay python2-pickleshare))))
2233 (license license:expat)))
2234
2235 (define-public python2-pickleshare
2236 (let ((pickleshare (package-with-python2
2237 (strip-python2-variant python-pickleshare))))
2238 (package (inherit pickleshare)
2239 (propagated-inputs `(("python2-pathlib2" ,python2-pathlib2)
2240 ,@(package-propagated-inputs pickleshare))))))
2241
2242 (define-public python-apsw
2243 (package
2244 (name "python-apsw")
2245 (version "3.20.1-r1")
2246 (source
2247 (origin
2248 (method url-fetch)
2249 (uri (string-append "https://github.com/rogerbinns/apsw/archive/"
2250 version ".tar.gz"))
2251 (file-name (string-append "apsw-" version ".tar.gz"))
2252 (sha256
2253 (base32
2254 "00ai7m2pqi26qaflhz314d8k5i3syw7xzr145fhfl0crhyh6adz2"))))
2255 (build-system python-build-system)
2256 (inputs
2257 `(("sqlite" ,sqlite)))
2258 (arguments
2259 `(#:phases
2260 (modify-phases %standard-phases
2261 (replace 'build
2262 (lambda _
2263 (invoke "python" "setup.py" "build" "--enable-all-extensions")
2264 #t))
2265 (add-after 'build 'build-test-helper
2266 (lambda _
2267 (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext"
2268 "-I." "-Isqlite3" "src/testextension.c")
2269 #t))
2270 (delete 'check)
2271 (add-after 'install 'check
2272 (lambda* (#:key inputs outputs #:allow-other-keys)
2273 (add-installed-pythonpath inputs outputs)
2274 (invoke "python" "setup.py" "test")
2275 #t)))))
2276 (home-page "https://github.com/rogerbinns/apsw/")
2277 (synopsis "Another Python SQLite Wrapper")
2278 (description "APSW is a Python wrapper for the SQLite
2279 embedded relational database engine. In contrast to other wrappers such as
2280 pysqlite it focuses on being a minimal layer over SQLite attempting just to
2281 translate the complete SQLite API into Python.")
2282 (license license:zlib)))
2283
2284 (define-public python2-apsw
2285 (package-with-python2 python-apsw))
2286
2287 (define-public python2-neo4j-driver
2288 (package
2289 (name "python2-neo4j-driver")
2290 ;; NOTE: When upgrading to 1.5.0, please add a python3 variant.
2291 (version "1.4.0")
2292 (source (origin
2293 (method url-fetch)
2294 (uri (pypi-uri "neo4j-driver" version))
2295 (sha256
2296 (base32
2297 "011r1vh182p8mm83d8dz9rfnc3l7rf7fd00cyrbyfzi71jmc4g98"))))
2298 (build-system python-build-system)
2299 (arguments
2300 `(#:python ,python-2))
2301 (home-page "https://neo4j.com/developer/python/")
2302 (synopsis "Neo4j driver code written in Python")
2303 (description "This package provides the Neo4j Python driver that connects
2304 to the database using Neo4j's binary protocol. It aims to be minimal, while
2305 being idiomatic to Python.")
2306 (license license:asl2.0)))
2307
2308 (define-public python2-py2neo
2309 (package
2310 (name "python2-py2neo")
2311 (version "3.1.2")
2312 (source (origin
2313 (method url-fetch)
2314 (uri (pypi-uri "py2neo" version))
2315 (sha256
2316 (base32
2317 "1f1q95vqcvlc3nsc33p841swnjdcjazddlq2dzi3qfnjqjrajxw1"))))
2318 (build-system python-build-system)
2319 (arguments
2320 `(#:python ,python-2))
2321 (home-page "http://py2neo.org")
2322 (synopsis "Library and toolkit for working with Neo4j in Python")
2323 (description "This package provides a client library and toolkit for
2324 working with Neo4j from within Python applications and from the command
2325 line. The core library has no external dependencies and has been carefully
2326 designed to be easy and intuitive to use.")
2327 (license license:asl2.0)))
2328
2329 (define-public python-psycopg2
2330 (package
2331 (name "python-psycopg2")
2332 (version "2.7.5")
2333 (source
2334 (origin
2335 (method url-fetch)
2336 (uri (pypi-uri "psycopg2" version))
2337 (sha256
2338 (base32
2339 "17klx964gw8z0znl0raz3by8vdc7cq5gxj4pdcrfcina84nrdkzc"))))
2340 (build-system python-build-system)
2341 (arguments
2342 ;; Tests would require a postgresql database "psycopg2_test"
2343 ;; and a running postgresql database management service.
2344 `(#:tests? #f)) ; TODO re-enable after providing a test-db.
2345 (inputs
2346 `(("postgresql" ,postgresql))) ; libpq
2347 (home-page "http://initd.org/psycopg/")
2348 (synopsis "Python PostgreSQL adapter")
2349 (description
2350 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
2351 2.0.")
2352 (license license:lgpl3+)))
2353
2354 (define-public python2-psycopg2
2355 (package-with-python2 python-psycopg2))
2356
2357 (define-public python-sadisplay
2358 (package
2359 (name "python-sadisplay")
2360 (version "0.4.8")
2361 (source
2362 (origin
2363 (method url-fetch)
2364 (uri (pypi-uri "sadisplay" version))
2365 (sha256
2366 (base32
2367 "01d9lxhmgpb68gy8rd6zj6fcwp84n2qq210n1qsk3qbsir79bzh4"))))
2368 (build-system python-build-system)
2369 (propagated-inputs
2370 `(("python-sqlalchemy" ,python-sqlalchemy)))
2371 (native-inputs
2372 ;; For tests.
2373 `(("python-nose" ,python-nose)))
2374 (home-page "https://bitbucket.org/estin/sadisplay")
2375 (synopsis "SQLAlchemy schema displayer")
2376 (description "This package provides a program to build Entity
2377 Relationship diagrams from a SQLAlchemy model (or directly from the
2378 database).")
2379 (license license:bsd-3)))
2380
2381 (define-public python2-sadisplay
2382 (package-with-python2 python-sadisplay))
2383
2384 (define-public python-mysqlclient
2385 (package
2386 (name "python-mysqlclient")
2387 (version "1.3.13")
2388 (source
2389 (origin
2390 (method url-fetch)
2391 (uri (pypi-uri "mysqlclient" version))
2392 (sha256
2393 (base32
2394 "0kv4a1icwdav8jpl7qvnr931lw5h3v22ids6lwq6qpi1hjzf33pz"))))
2395 (build-system python-build-system)
2396 (native-inputs
2397 `(("mariadb" ,mariadb)
2398 ("nose" ,python-nose)
2399 ("mock" ,python-mock)
2400 ("py.test" ,python-pytest)))
2401 (inputs
2402 `(("mysql" ,mysql)
2403 ("libz" ,zlib)
2404 ("openssl" ,openssl)))
2405 (home-page "https://github.com/PyMySQL/mysqlclient-python")
2406 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
2407 (description "MySQLdb is an interface to the popular MySQL database server
2408 for Python. The design goals are:
2409 @enumerate
2410 @item Compliance with Python database API version 2.0 [PEP-0249],
2411 @item Thread-safety,
2412 @item Thread-friendliness (threads will not block each other).
2413 @end enumerate")
2414 (license license:gpl2)))
2415
2416 (define-public python2-mysqlclient
2417 (package-with-python2 python-mysqlclient))
2418
2419 (define-public python-hiredis
2420 (package
2421 (name "python-hiredis")
2422 (version "0.2.0")
2423 (source
2424 (origin
2425 (method url-fetch)
2426 (uri (pypi-uri "hiredis" version))
2427 (sha256
2428 (base32
2429 "1dfm2k9l9zar9nw9fwmm74zrgraxdxs04vx9li56fjcf289qx5fa"))))
2430 (build-system python-build-system)
2431 (arguments
2432 ;; no tests
2433 `(#:tests? #f))
2434 (home-page "https://github.com/redis/hiredis-py")
2435 (synopsis "Python extension that wraps protocol parsing code in hiredis")
2436 (description "Python-hiredis is a python extension that wraps protocol
2437 parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
2438 (license license:bsd-3)))
2439
2440 (define-public python2-hiredis
2441 (package-with-python2 python-hiredis))
2442
2443 (define-public python-fakeredis
2444 (package
2445 (name "python-fakeredis")
2446 (version "0.8.2")
2447 (source
2448 (origin
2449 (method url-fetch)
2450 (uri (pypi-uri "fakeredis" version))
2451 (sha256
2452 (base32
2453 "0zncahj3byyasyfx9i7k991ph0n0lq8v3a21pqri5qxn9564bk9r"))))
2454 (build-system python-build-system)
2455 (arguments
2456 ;; no tests
2457 `(#:tests? #f))
2458 (home-page "https://github.com/jamesls/fakeredis")
2459 (synopsis "Fake implementation of redis API for testing purposes")
2460 (description
2461 "Fakeredis is a pure-Python implementation of the redis-py Python client
2462 that simulates talking to a redis server. It was created for a single purpose:
2463 to write unit tests.
2464
2465 Setting up redis is not hard, but one often wants to write unit tests that don't
2466 talk to an external server such as redis. This module can be used as a
2467 reasonable substitute.")
2468 (license license:bsd-3)))
2469
2470 (define-public python2-fakeredis
2471 (package-with-python2 python-fakeredis))
2472
2473 (define-public python-redis
2474 (package
2475 (name "python-redis")
2476 (version "2.10.6")
2477 (source
2478 (origin
2479 (method url-fetch)
2480 (uri (pypi-uri "redis" version))
2481 (sha256
2482 (base32 "03vcgklykny0g0wpvqmy8p6azi2s078317wgb2xjv5m2rs9sjb52"))))
2483 (build-system python-build-system)
2484 ;; Tests require a running Redis server
2485 (arguments '(#:tests? #f))
2486 ;; As long as we are not running test, we do not need this input :-)
2487 ;;(native-inputs
2488 ;; `(("python-pytest" ,python-pytest)))
2489 (home-page "https://github.com/andymccurdy/redis-py")
2490 (synopsis "Redis Python client")
2491 (description
2492 "This package provides a Python interface to the Redis key-value store.")
2493 (license license:expat)))
2494
2495 (define-public python2-redis
2496 (package-with-python2 python-redis))
2497
2498 (define-public python-rq
2499 (package
2500 (name "python-rq")
2501 (version "0.12.0")
2502 (source
2503 (origin
2504 (method url-fetch)
2505 (uri (pypi-uri "rq" version))
2506 (sha256
2507 (base32 "16d8kni57xlnah2hawy4xgw21xrv3f64j5q5shyp3zxx4yd9iibs"))))
2508 (build-system python-build-system)
2509 (propagated-inputs
2510 `(("python-click" ,python-click)
2511 ("python-redis" ,python-redis)))
2512 (home-page "http://python-rq.org/")
2513 (synopsis "Simple job queues for Python")
2514 (description
2515 "RQ (Redis Queue) is a simple Python library for queueing jobs and
2516 processing them in the background with workers. It is backed by Redis and it
2517 is designed to have a low barrier to entry.")
2518 (license license:bsd-2)))
2519
2520 (define-public python2-rq
2521 (package-with-python2 python-rq))
2522
2523 (define-public python-trollius-redis
2524 (package
2525 (name "python-trollius-redis")
2526 (version "0.1.4")
2527 (source
2528 (origin
2529 (method url-fetch)
2530 (uri (pypi-uri "trollius_redis" version))
2531 (sha256
2532 (base32
2533 "0k3vypszmgmaipgw9xscvgm79h2zd6p6ci8gdp5sxl6g5kbqr9fy"))))
2534 (build-system python-build-system)
2535 ;; TODO: Tests require packaging 'hiredis'.
2536 (arguments '(#:tests? #f))
2537 (home-page "https://github.com/benjolitz/trollius-redis")
2538 (synopsis "Port of asyncio-redis to trollius")
2539 (description "@code{trollius-redis} is a Redis client for Python
2540 trollius. It is an asynchronious IO (PEP 3156) implementation of the
2541 Redis protocol.")
2542 (license license:bsd-2)))
2543
2544 (define-public python2-trollius-redis
2545 (package-with-python2 python-trollius-redis))
2546
2547 (define-public python-sqlparse
2548 (package
2549 (name "python-sqlparse")
2550 (version "0.2.4")
2551 (source (origin
2552 (method url-fetch)
2553 (uri (pypi-uri "sqlparse" version))
2554 (sha256
2555 (base32
2556 "1v3xh0bkfhb262dbndgzhivpnhdwavdzz8jjhx9vx0xbrx2880nf"))))
2557 (build-system python-build-system)
2558 (arguments
2559 `(#:phases
2560 (modify-phases %standard-phases
2561 (replace 'check
2562 (lambda _ (invoke "py.test"))))))
2563 (native-inputs
2564 `(("python-pytest" ,python-pytest)))
2565 (home-page "https://github.com/andialbrecht/sqlparse")
2566 (synopsis "Non-validating SQL parser")
2567 (description "Sqlparse is a non-validating SQL parser for Python. It
2568 provides support for parsing, splitting and formatting SQL statements.")
2569 (license license:bsd-3)))
2570
2571 (define-public python2-sqlparse
2572 (package-with-python2 python-sqlparse))
2573
2574 (define-public python-sql
2575 (package
2576 (name "python-sql")
2577 (version "0.9")
2578 (source
2579 (origin
2580 (method url-fetch)
2581 (uri (pypi-uri "python-sql" version))
2582 (sha256
2583 (base32
2584 "0p6kaqj02vz0habmdx37zjk6hjxdfm8aw737zs059vvpr70ird87"))))
2585 (build-system python-build-system)
2586 (home-page "https://python-sql.tryton.org/")
2587 (synopsis "Library to write SQL queries in a pythonic way")
2588 (description "@code{python-sql} is a library to write SQL queries, that
2589 transforms idiomatic python function calls to well-formed SQL queries.")
2590 (license license:bsd-3)))
2591
2592 (define-public python2-sql
2593 (package-with-python2 python-sql))
2594
2595 (define-public mongo-tools
2596 (package
2597 (name "mongo-tools")
2598 (version "3.4.0")
2599 (source
2600 (origin (method git-fetch)
2601 (uri (git-reference
2602 (url "https://github.com/mongodb/mongo-tools")
2603 (commit (string-append "r" version))))
2604 (file-name (git-file-name name version))
2605 (sha256
2606 (base32
2607 "1bcsz5cvj39a7nsxsfqmz9igrw33j6yli9kffigqyscs52amw7x1"))))
2608 (build-system go-build-system)
2609 (arguments
2610 `(#:import-path "github.com/mongodb/mongo-tools"
2611 #:modules ((srfi srfi-1)
2612 (guix build go-build-system)
2613 (guix build utils))
2614 #:phases
2615 (let ((all-tools
2616 '("bsondump" "mongodump" "mongoexport" "mongofiles"
2617 "mongoimport" "mongooplog" "mongorestore"
2618 "mongostat" "mongotop")))
2619 (modify-phases %standard-phases
2620 (add-after 'unpack 'delete-bundled-source-code
2621 (lambda _
2622 (delete-file-recursively
2623 "src/github.com/mongodb/mongo-tools/vendor")
2624 #t))
2625 (add-after 'delete-bundled-source-code 'patch-source
2626 (lambda _
2627 ;; Remove a redundant argument that causes compilation to fail.
2628 (substitute*
2629 "src/github.com/mongodb/mongo-tools/mongorestore/filepath.go"
2630 (("skipping restore of system.profile collection\", db)")
2631 "skipping restore of system.profile collection\")"))
2632 #t))
2633 ;; We don't need to install the source code for end-user applications
2634 (delete 'install-source)
2635 (replace 'build
2636 (lambda _
2637 (for-each (lambda (tool)
2638 (let ((command
2639 `("go" "build"
2640 ;; This is where the tests expect to find the
2641 ;; executables
2642 "-o" ,(string-append
2643 "src/github.com/mongodb/mongo-tools/bin/"
2644 tool)
2645 "-v"
2646 "-tags=\"ssl sasl\""
2647 "-ldflags"
2648 "-extldflags=-Wl,-z,now,-z,relro"
2649 ,(string-append
2650 "src/github.com/mongodb/mongo-tools/"
2651 tool "/main/" tool ".go"))))
2652 (simple-format #t "build: running ~A\n"
2653 (string-join command))
2654 (apply invoke command)))
2655 all-tools)
2656 #t))
2657 (replace 'check
2658 (lambda _
2659 (with-directory-excursion "src"
2660 (for-each (lambda (tool)
2661 (invoke
2662 "go" "test" "-v"
2663 (string-append "github.com/mongodb/mongo-tools/"
2664 tool)))
2665 all-tools))
2666 #t))
2667 (replace 'install
2668 (lambda* (#:key outputs #:allow-other-keys)
2669 (for-each (lambda (tool)
2670 (install-file
2671 (string-append "src/github.com/mongodb/mongo-tools/bin/"
2672 tool)
2673 (string-append (assoc-ref outputs "out")
2674 "/bin")))
2675 all-tools)
2676 #t))))))
2677 (native-inputs
2678 `(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
2679 ("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)
2680 ("go-golang.org-x-crypto-ssh-terminal" ,go-golang.org-x-crypto-ssh-terminal)
2681 ("go-gopkg.in-mgo.v2" ,go-gopkg.in-mgo.v2)
2682 ("go-gopkg.in-tomb.v2" ,go-gopkg.in-tomb.v2)
2683 ("go-github.com-nsf-termbox-go" ,go-github.com-nsf-termbox-go)
2684 ("go-github.com-smartystreets-goconvey" ,go-github.com-smartystreets-goconvey)))
2685 (home-page "https://github.com/mongodb/mongo-tools")
2686 (synopsis "Various tools for interacting with MongoDB and BSON")
2687 (description
2688 "This package includes a collection of tools related to MongoDB.
2689 @table @code
2690 @item bsondump
2691 Display BSON files in a human-readable format
2692 @item mongoimport
2693 Convert data from JSON, TSV or CSV and insert them into a collection
2694 @item mongoexport
2695 Write an existing collection to CSV or JSON format
2696 @item mongodump/mongorestore
2697 Dump MongoDB backups to disk in the BSON format
2698 @item mongorestore
2699 Read MongoDB backups in the BSON format, and restore them to a live database
2700 @item mongostat
2701 Monitor live MongoDB servers, replica sets, or sharded clusters
2702 @item mongofiles
2703 Read, write, delete, or update files in GridFS
2704 @item mongooplog
2705 Replay oplog entries between MongoDB servers
2706 @item mongotop
2707 Monitor read/write activity on a mongo server
2708 @end table")
2709 (license license:asl2.0)))
2710
2711 (define-public apache-arrow
2712 (package
2713 (name "apache-arrow")
2714 (version "0.7.0")
2715 (source
2716 (origin
2717 (method git-fetch)
2718 (uri (git-reference
2719 (url "https://github.com/apache/arrow")
2720 (commit (string-append "apache-arrow-" version))))
2721 (file-name (git-file-name name version))
2722 (sha256
2723 (base32
2724 "1x7sdd8lbs3nfqjql1pcgbkjc19bls56zmgjayshkmablvlc4dy3"))))
2725 (build-system cmake-build-system)
2726 (arguments
2727 `(#:tests? #f
2728 #:phases
2729 (modify-phases %standard-phases
2730 (add-before 'configure 'enter-source-directory
2731 (lambda _ (chdir "cpp") #t))
2732 (add-after 'unpack 'set-env
2733 (lambda _
2734 (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
2735 (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
2736 (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
2737 (setenv "JEMALLOC_HOME" (assoc-ref %build-inputs "jemalloc"))
2738 (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson"))
2739 #t)))
2740 #:build-type "Release"
2741 #:configure-flags
2742 (list "-DARROW_PYTHON=ON"
2743
2744 ;; Install to PREFIX/lib (the default is
2745 ;; PREFIX/lib64).
2746 (string-append "-DCMAKE_INSTALL_LIBDIR="
2747 (assoc-ref %outputs "out")
2748 "/lib")
2749
2750 ;; XXX These Guix package offer static
2751 ;; libraries that are not position independent,
2752 ;; and ld fails to link them into the arrow .so
2753 "-DARROW_WITH_SNAPPY=OFF"
2754 "-DARROW_WITH_ZLIB=OFF"
2755 "-DARROW_WITH_ZSTD=OFF"
2756 "-DARROW_WITH_LZ4=OFF"
2757
2758 ;; Building the tests forces on all the
2759 ;; optional features and the use of static
2760 ;; libraries.
2761 "-DARROW_BUILD_TESTS=OFF"
2762 "-DARROW_BUILD_STATIC=OFF")))
2763 (inputs
2764 `(("boost" ,boost)
2765 ("rapidjson" ,rapidjson)
2766 ("brotli" ,google-brotli)
2767 ("flatbuffers" ,flatbuffers)
2768 ;; Arrow is not yet compatible with jemalloc >= 5:
2769 ;; https://issues.apache.org/jira/browse/ARROW-1141
2770 ("jemalloc" ,jemalloc-4.5.0)
2771 ("python-3" ,python)
2772 ("python-numpy" ,python-numpy)))
2773 (home-page "https://arrow.apache.org/")
2774 (synopsis "Columnar in-memory analytics")
2775 (description "Apache Arrow is a columnar in-memory analytics layer
2776 designed to accelerate big data. It houses a set of canonical in-memory
2777 representations of flat and hierarchical data along with multiple
2778 language-bindings for structure manipulation. It also provides IPC and common
2779 algorithm implementations.")
2780 (license license:asl2.0)))
2781
2782 (define-public python-pyarrow
2783 (package
2784 (name "python-pyarrow")
2785 (version "0.7.0")
2786 (source
2787 (origin
2788 (method git-fetch)
2789 (uri (git-reference
2790 (url "https://github.com/apache/arrow")
2791 (commit (string-append "apache-arrow-" version))))
2792 (file-name (git-file-name name version))
2793 (sha256
2794 (base32
2795 "1x7sdd8lbs3nfqjql1pcgbkjc19bls56zmgjayshkmablvlc4dy3"))))
2796 (build-system python-build-system)
2797 (arguments
2798 '(#:tests? #f ; XXX Test failures related to missing libhdfs, libhdfs3,
2799 ; and "Unsupported numpy type 22".
2800 #:phases
2801 (modify-phases %standard-phases
2802 (add-after 'unpack 'enter-source-directory
2803 (lambda _ (chdir "python") #t))
2804 (add-after 'unpack 'set-env
2805 (lambda _
2806 (setenv "ARROW_HOME" (assoc-ref %build-inputs "apache-arrow"))
2807 #t)))))
2808 (propagated-inputs
2809 `(("apache-arrow" ,apache-arrow)
2810 ("python-numpy" ,python-numpy)
2811 ("python-pandas" ,python-pandas)
2812 ("python-six" ,python-six)))
2813 (native-inputs
2814 `(("cmake" ,cmake)
2815 ("python-cython" ,python-cython)
2816 ("python-pytest" ,python-pytest)
2817 ("python-setuptools-scm" ,python-setuptools-scm)))
2818 (home-page "https://arrow.apache.org/docs/python/")
2819 (synopsis "Python bindings for Apache Arrow")
2820 (description "This library provides a Pythonic API wrapper for the reference
2821 Arrow C++ implementation, along with tools for interoperability with pandas,
2822 NumPy, and other traditional Python scientific computing packages.")
2823 (license license:asl2.0)))
2824
2825 (define-public python2-pyarrow
2826 (package-with-python2 python-pyarrow))