gnu: MariaDB: Skip replication tests.
[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, 2020 Efraim Flashner <efraim@flashner.co.il>
14 ;;; Copyright © 2016, 2017 Nikita <nikita@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, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
21 ;;; Copyright © 2017, 2018 Julien Lepiller <julien@lepiller.eu>
22 ;;; Copyright © 2017, 2020 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, 2019, 2020 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, 2019 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 ;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
36 ;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
37 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
38 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
39 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
40 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
41 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
42 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
43 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
44 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
45 ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
46 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
47 ;;;
48 ;;; This file is part of GNU Guix.
49 ;;;
50 ;;; GNU Guix is free software; you can redistribute it and/or modify it
51 ;;; under the terms of the GNU General Public License as published by
52 ;;; the Free Software Foundation; either version 3 of the License, or (at
53 ;;; your option) any later version.
54 ;;;
55 ;;; GNU Guix is distributed in the hope that it will be useful, but
56 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
57 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58 ;;; GNU General Public License for more details.
59 ;;;
60 ;;; You should have received a copy of the GNU General Public License
61 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
62
63 (define-module (gnu packages databases)
64 #:use-module (gnu packages)
65 #:use-module (gnu packages admin)
66 #:use-module (gnu packages algebra)
67 #:use-module (gnu packages autotools)
68 #:use-module (gnu packages avahi)
69 #:use-module (gnu packages base)
70 #:use-module (gnu packages bash)
71 #:use-module (gnu packages bison)
72 #:use-module (gnu packages boost)
73 #:use-module (gnu packages check)
74 #:use-module (gnu packages cmake)
75 #:use-module (gnu packages compression)
76 #:use-module (gnu packages crypto)
77 #:use-module (gnu packages curl)
78 #:use-module (gnu packages cyrus-sasl)
79 #:use-module (gnu packages dbm)
80 #:use-module (gnu packages emacs)
81 #:use-module (gnu packages flex)
82 #:use-module (gnu packages gcc)
83 #:use-module (gnu packages gettext)
84 #:use-module (gnu packages glib)
85 #:use-module (gnu packages gnupg)
86 #:use-module (gnu packages guile)
87 #:use-module (gnu packages time)
88 #:use-module (gnu packages golang)
89 #:use-module (gnu packages jemalloc)
90 #:use-module (gnu packages language)
91 #:use-module (gnu packages libevent)
92 #:use-module (gnu packages linux)
93 #:use-module (gnu packages logging)
94 #:use-module (gnu packages man)
95 #:use-module (gnu packages maths)
96 #:use-module (gnu packages ncurses)
97 #:use-module (gnu packages onc-rpc)
98 #:use-module (gnu packages parallel)
99 #:use-module (gnu packages pcre)
100 #:use-module (gnu packages perl)
101 #:use-module (gnu packages perl-check)
102 #:use-module (gnu packages perl-web)
103 #:use-module (gnu packages pkg-config)
104 #:use-module (gnu packages popt)
105 #:use-module (gnu packages protobuf)
106 #:use-module (gnu packages python)
107 #:use-module (gnu packages python-crypto)
108 #:use-module (gnu packages python-web)
109 #:use-module (gnu packages python-science)
110 #:use-module (gnu packages python-xyz)
111 #:use-module (gnu packages rdf)
112 #:use-module (gnu packages readline)
113 #:use-module (gnu packages regex)
114 #:use-module (gnu packages rpc)
115 #:use-module (gnu packages ruby)
116 #:use-module (gnu packages serialization)
117 #:use-module (gnu packages sphinx)
118 #:use-module (gnu packages sqlite)
119 #:use-module (gnu packages tcl)
120 #:use-module (gnu packages terminals)
121 #:use-module (gnu packages textutils)
122 #:use-module (gnu packages tls)
123 #:use-module (gnu packages valgrind)
124 #:use-module (gnu packages web)
125 #:use-module (gnu packages xml)
126 #:use-module ((guix licenses) #:prefix license:)
127 #:use-module (guix packages)
128 #:use-module (guix download)
129 #:use-module (guix bzr-download)
130 #:use-module (guix git-download)
131 #:use-module (guix build-system emacs)
132 #:use-module (guix build-system gnu)
133 #:use-module (guix build-system go)
134 #:use-module (guix build-system perl)
135 #:use-module (guix build-system python)
136 #:use-module (guix build-system ruby)
137 #:use-module (guix build-system cmake)
138 #:use-module (guix build-system scons)
139 #:use-module (guix build-system trivial)
140 #:use-module (guix utils)
141 #:use-module (srfi srfi-1)
142 #:use-module (srfi srfi-26)
143 #:use-module (ice-9 match))
144
145 (define-public 4store
146 (package
147 (name "4store")
148 (version "1.1.6")
149 (source (origin
150 (method git-fetch)
151 (uri (git-reference
152 (url "https://github.com/4store/4store")
153 (commit (string-append "v" version))))
154 (file-name (git-file-name name version))
155 (sha256
156 (base32 "1kzdfmwpzy64cgqlkcz5v4klwx99w0jk7afckyf7yqbqb4rydmpk"))
157 (patches (search-patches "4store-unset-preprocessor-directive.patch"
158 "4store-fix-buildsystem.patch"))))
159 (build-system gnu-build-system)
160 (native-inputs
161 `(("perl" ,perl)
162 ("python" ,python-2)
163 ("autoconf" ,autoconf)
164 ("automake" ,automake)
165 ("gettext" ,gettext-minimal)
166 ("libtool" ,libtool)
167 ("pcre" ,pcre "bin") ;for 'pcre-config'
168 ("pkg-config" ,pkg-config)))
169 (inputs
170 `(("glib" ,glib)
171 ("rasqal" ,rasqal)
172 ("libxml2" ,libxml2)
173 ("raptor2" ,raptor2)
174 ("readline" ,readline)
175 ("avahi" ,avahi)
176 ("cyrus-sasl" ,cyrus-sasl)
177 ("openssl" ,openssl)
178 ("util-linux" ,util-linux "lib")))
179 ;; http://www.4store.org has been down for a while now.
180 (home-page "https://github.com/4store/4store")
181 (synopsis "Clustered RDF storage and query engine")
182 (description "4store is a RDF/SPARQL store written in C, supporting
183 either single machines or networked clusters.")
184 (license license:gpl3+)))
185
186 (define-public go-gopkg.in-mgo.v2
187 (package
188 (name "go-gopkg.in-mgo.v2")
189 (version "2016.08.01")
190 (source (origin
191 (method git-fetch)
192 (uri (git-reference
193 (url "https://github.com/go-mgo/mgo")
194 (commit (string-append "r" version))))
195 (file-name (git-file-name name version))
196 (sha256
197 (base32
198 "0rwbi1z63w43b0z9srm8m7iz1fdwx7bq7n2mz862d6liiaqa59jd"))))
199 (build-system go-build-system)
200 (arguments
201 `(#:import-path "gopkg.in/mgo.v2"
202 ;; TODO: The tests fail as MongoDB fails to start
203 ;; Error parsing command line: unrecognised option '--chunkSize'
204 #:tests? #f
205 #:phases
206 (modify-phases %standard-phases
207 (delete 'reset-gzip-timestamps)
208 (add-before 'check 'start-mongodb
209 (lambda* (#:key tests? #:allow-other-keys)
210 (when tests?
211 (with-directory-excursion "src/gopkg.in/mgo.v2"
212 (invoke "make" "startdb")))
213 #t))
214 (add-after 'check 'stop'mongodb
215 (lambda* (#:key tests? #:allow-other-keys)
216 (when tests?
217 (with-directory-excursion "src/gopkg.in/mgo.v2"
218 (invoke "make" "stopdb")))
219 #t)))))
220 (native-inputs
221 `(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
222 ("mongodb" ,mongodb)
223 ("daemontools" ,daemontools)))
224 (synopsis "@code{mgo} offers a rich MongoDB driver for Go.")
225 (description
226 "@code{mgo} (pronounced as mango) is a MongoDB driver for the Go language.
227 It implements a rich selection of features under a simple API following
228 standard Go idioms.")
229 (home-page "https://labix.org/mgo")
230 (license license:bsd-2)))
231
232 (define-public ephemeralpg
233 (package
234 (name "ephemeralpg")
235 (version "3.0")
236 (source
237 (origin
238 (method url-fetch)
239 (uri (string-append
240 "https://eradman.com/ephemeralpg/code/ephemeralpg-"
241 version ".tar.gz"))
242 (sha256
243 (base32 "1j0g7g114ma7y7sadbng5p1ss1zsm9zpicm77qspym6565733vvh"))))
244 (build-system gnu-build-system)
245 (arguments
246 '(#:make-flags (list "CC=gcc"
247 (string-append "PREFIX=" %output))
248 #:phases
249 (modify-phases %standard-phases
250 (delete 'configure) ; no configure script
251 (add-after 'install 'wrap
252 (lambda* (#:key inputs outputs #:allow-other-keys)
253 (let ((out (assoc-ref outputs "out")))
254 (wrap-program (string-append out "/bin/pg_tmp")
255 `("PATH" ":" prefix
256 (,(string-append (assoc-ref inputs "util-linux")
257 "/bin")
258 ,(string-append (assoc-ref inputs "postgresql")
259 "/bin")
260 ;; For getsocket.
261 ,(string-append out "/bin")))))
262 #t)))
263 #:test-target "test"))
264 (inputs
265 `(("postgresql" ,postgresql)
266 ("util-linux" ,util-linux)))
267 (native-inputs
268 ;; For tests.
269 `(("ruby" ,ruby)
270 ("which" ,which)))
271 (home-page "https://eradman.com/ephemeralpg/")
272 (synopsis "Run temporary PostgreSQL databases")
273 (description
274 "@code{pg_tmp} creates temporary PostgreSQL databases, suitable for tasks
275 like running software test suites. Temporary databases created with
276 @code{pg_tmp} have a limited shared memory footprint and are automatically
277 garbage-collected after a configurable number of seconds (the default is
278 60).")
279 (license license:isc)))
280
281 (define-public es-dump-restore
282 (package
283 (name "es-dump-restore")
284 (version "2.1.0")
285 (source
286 (origin
287 (method url-fetch)
288 (uri (rubygems-uri "es_dump_restore" version))
289 (sha256
290 (base32
291 "020yk7f1hw48clmf5501z3xv9shsdchyymcv0y2cci2c1xvr1mim"))))
292 (build-system ruby-build-system)
293 (arguments
294 '(#:tests? #f)) ;; No testsuite.
295 (propagated-inputs
296 `(("ruby-httpclient" ,ruby-httpclient)
297 ("ruby-multi-json" ,ruby-multi-json)
298 ("ruby-progress_bar" ,ruby-progress_bar)
299 ("ruby-rubyzip" ,ruby-rubyzip)
300 ("ruby-thor" ,ruby-thor)))
301 (synopsis "Utility for dumping and restoring ElasticSearch indexes")
302 (description
303 "This package provides a utility for dumping the contents of an
304 ElasticSearch index to a compressed file and restoring the dumpfile back to an
305 ElasticSearch server")
306 (home-page "https://github.com/patientslikeme/es_dump_restore")
307 (license license:expat)))
308
309 (define-public leveldb
310 (package
311 (name "leveldb")
312 (version "1.22")
313 (source (origin
314 (method git-fetch)
315 (uri (git-reference
316 (url "https://github.com/google/leveldb")
317 (commit version)))
318 (file-name (git-file-name name version))
319 (sha256
320 (base32
321 "0qrnhiyq7r4wa1a4wi82zgns35smj94mcjsc7kfs1k6ia9ys79z7"))))
322 (build-system cmake-build-system)
323 (arguments
324 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON" "-DLEVELDB_BUILD_TESTS=ON")))
325 (inputs
326 `(("snappy" ,snappy)))
327 (home-page "https://github.com/google/leveldb")
328 (synopsis "Fast key-value storage library")
329 (description
330 "LevelDB is a fast key-value storage library that provides an ordered
331 mapping from string keys to string values.")
332 (license license:bsd-3)))
333
334 (define-public memcached
335 (package
336 (name "memcached")
337 (version "1.5.20")
338 (source
339 (origin
340 (method url-fetch)
341 (uri (string-append
342 "https://memcached.org/files/memcached-" version ".tar.gz"))
343 (sha256
344 (base32 "1r511qr95q0ywdaql3pdjiwzkfqxhhfzb13ilvl7mznfm4iv1myg"))))
345 (build-system gnu-build-system)
346 (inputs
347 `(("libevent" ,libevent)
348 ("cyrus-sasl" ,cyrus-sasl)))
349 (home-page "https://memcached.org/")
350 (synopsis "In-memory caching service")
351 (description "Memcached is an in-memory key-value store. It has a small
352 and generic API, and was originally intended for use with dynamic web
353 applications.")
354 (license license:bsd-3)))
355
356 (define-public libmemcached
357 (package
358 (name "libmemcached")
359 (version "1.0.18")
360 ;; We build from the sources since we want to build the extra HTML
361 ;; documentation which is not included with the release.
362 (source (origin
363 (method bzr-fetch)
364 (uri (bzr-reference
365 (url "lp:libmemcached/1.0")
366 (revision (string-append "tag:" version))))
367 (file-name (string-append name "-" version "-checkout"))
368 (sha256
369 (base32
370 "1842s4dxdh21gdr46q4dgxigidcs6dkqnbnqjwb9l8r0bqx5nb10"))
371 (patches
372 (search-patches "libmemcached-build-with-gcc7.patch"))))
373 (build-system gnu-build-system)
374 (native-inputs
375 `(("memcached" ,memcached)
376 ("libtool" ,libtool)
377 ("autoconf" ,autoconf)
378 ("automake" ,automake)
379 ("bison" ,bison)
380 ("flex" ,flex)
381 ("perl" ,perl)
382 ("python-sphinx" ,python-sphinx))) ;to build the HTML doc.
383 (inputs
384 `(("libevent" ,libevent)
385 ("cyrus-sasl" ,cyrus-sasl)))
386 (outputs '("out" "doc"))
387 (arguments
388 '(#:phases
389 (modify-phases %standard-phases
390 (add-before 'bootstrap 'fix-configure.ac
391 ;; Move the AC_CONFIG_AUX_DIR macro use under AC_INIT, otherwise we
392 ;; get the error ``configure: error: cannot find install-sh,
393 ;; install.sh, or shtool in "." "./.." "./../.."`` (see:
394 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19539 and
395 ;; https://bugs.launchpad.net/libmemcached/+bug/1803922).
396 (lambda _
397 (delete-file "bootstrap.sh") ;not useful in the context of Guix
398 (substitute* "configure.ac"
399 (("^AC_CONFIG_AUX_DIR\\(\\[build-aux\\]\\).*") "")
400 (("(^AC_INIT.*)" anchor)
401 (string-append anchor "AC_CONFIG_AUX_DIR([build-aux])\n")))
402 #t))
403 (add-before 'bootstrap 'disable-failing-tests
404 ;; See: https://bugs.launchpad.net/libmemcached/+bug/1803926
405 (lambda _
406 ;; Mark some heavily failing test suites as expected to fail.
407 (substitute* "Makefile.am"
408 (("(XFAIL_TESTS =[^\n]*)" xfail_tests)
409 (string-append xfail_tests " tests/testudp"
410 " tests/libmemcached-1.0/testapp"
411 " tests/libmemcached-1.0/testsocket")))
412 ;; Disable two tests of the unittest test suite.
413 (substitute* "libtest/unittest.cc"
414 ((".*echo_fubar_BINARY \\},.*") "")
415 ((".*application_doesnotexist_BINARY \\},.*") ""))
416 #t))
417 (add-after 'disable-dns-tests 'build-and-install-html-doc
418 (lambda* (#:key outputs #:allow-other-keys)
419 (let ((html (string-append (assoc-ref outputs "doc")
420 "/share/doc/libmemcached/html/")))
421 (invoke "make" "install-html")
422 ;; Cleanup useless files.
423 (for-each delete-file-recursively
424 (map (lambda (x) (string-append html x))
425 '("_sources" ".doctrees" ".buildinfo"))))
426 #t)))))
427 (home-page "https://libmemcached.org/")
428 (synopsis "C++ library for memcached")
429 (description "libMemcached is a library to use memcached in C/C++
430 applications. It comes with a complete reference guide and documentation of
431 the API, and provides features such as:
432 @itemize
433 @item Asynchronous and synchronous transport support
434 @item Consistent hashing and distribution
435 @item Tunable hashing algorithm to match keys
436 @item Access to large object support
437 @item Local replication
438 @end itemize")
439 (license license:bsd-3)))
440
441 (define-public python-pylibmc
442 (package
443 (name "python-pylibmc")
444 (version "1.6.1")
445 (source
446 (origin
447 (method url-fetch)
448 (uri (pypi-uri "pylibmc" version))
449 (sha256
450 (base32 "1sg7d9j0v6g3xg3finf4l1hb72c13vcyyi6rqrc9shbx903d93ca"))))
451 (build-system python-build-system)
452 (arguments
453 '(#:phases
454 (modify-phases %standard-phases
455 (add-before 'check 'start-memcached-daemon
456 ;; The test suite requires a memcached server.
457 (lambda _
458 (invoke "memcached" "-d"))))))
459 (native-inputs
460 `(("memcached" ,memcached)
461 ("python-nose" ,python-nose)))
462 (inputs
463 `(("libmemcached" ,libmemcached)
464 ("zlib" ,zlib)
465 ("cyrus-sasl" ,cyrus-sasl)))
466 (home-page "http://sendapatch.se/projects/pylibmc/")
467 (synopsis "Python client for memcached")
468 (description
469 "@code{pylibmc} is a client in Python for memcached. It is a wrapper
470 around TangentOrg’s libmemcached library, and can be used as a drop-in
471 replacement for the code@{python-memcached} library.")
472 (license license:bsd-3)))
473
474 (define-public python2-pylibmc
475 (package-with-python2 python-pylibmc))
476
477 (define-public mongodb
478 (package
479 (name "mongodb")
480 (version "3.4.10")
481 (source (origin
482 (method url-fetch)
483 (uri (string-append "https://github.com/mongodb/mongo/archive/r"
484 version ".tar.gz"))
485 (file-name (string-append name "-" version ".tar.gz"))
486 (sha256
487 (base32 "0676lvkljj7a5hdhv78dbykqnqrj9lbn9799mi84b8vbnzsq961r"))
488 (modules '((guix build utils)))
489 (snippet
490 '(begin
491 (for-each (lambda (dir)
492 (delete-file-recursively
493 (string-append "src/third_party/" dir)))
494 '("pcre-8.41" "scons-2.5.0" "snappy-1.1.3"
495 "valgrind-3.11.0" "wiredtiger"
496 "yaml-cpp-0.5.3" "zlib-1.2.8"))
497 #t))
498 (patches
499 (list
500 (search-patch "mongodb-support-unknown-linux-distributions.patch")))))
501 (build-system scons-build-system)
502 (inputs
503 `(("openssl" ,openssl-1.0)
504 ("pcre" ,pcre)
505 ,@(match (%current-system)
506 ((or "x86_64-linux" "aarch64-linux" "mips64el-linux")
507 `(("wiredtiger" ,wiredtiger)))
508 (_ `()))
509 ("yaml-cpp" ,yaml-cpp)
510 ("zlib" ,zlib)
511 ("snappy" ,snappy)))
512 (native-inputs
513 `(("valgrind" ,valgrind)
514 ("perl" ,perl)
515 ("python" ,python-2)
516 ("python2-pymongo" ,python2-pymongo)
517 ("python2-pyyaml" ,python2-pyyaml)
518 ("tzdata" ,tzdata-for-tests)))
519 (arguments
520 `(#:scons ,scons-python2
521 #:phases
522 (let ((common-options
523 `(;; "--use-system-tcmalloc" TODO: Missing gperftools
524 "--use-system-pcre"
525 ;; wiredtiger is 64-bit only
526 ,,(if (any (cute string-prefix? <> (or (%current-target-system)
527 (%current-system)))
528 '("i686-linux" "armhf-linux"))
529 ``"--wiredtiger=off"
530 ``"--use-system-wiredtiger")
531 ;; TODO
532 ;; build/opt/mongo/db/fts/unicode/string.o failed: Error 1
533 ;; --use-system-boost
534 "--use-system-snappy"
535 "--use-system-zlib"
536 "--use-system-valgrind"
537 ;; "--use-system-stemmer" TODO: Missing relevant package
538 "--use-system-yaml"
539 "--disable-warnings-as-errors"
540 ,(format #f "--jobs=~a" (parallel-job-count))
541 "--ssl")))
542 (modify-phases %standard-phases
543 (add-after 'unpack 'patch
544 (lambda _
545 ;; Remove use of GNU extensions in parse_number_test.cpp, to
546 ;; allow compiling with GCC 7 or later
547 ;; https://jira.mongodb.org/browse/SERVER-28063
548 (substitute* "src/mongo/base/parse_number_test.cpp"
549 (("0xabcab\\.defdefP-10")
550 "687.16784283419838"))
551 #t))
552 (add-after 'unpack 'scons-propagate-environment
553 (lambda _
554 ;; Modify the SConstruct file to arrange for
555 ;; environment variables to be propagated.
556 (substitute* "SConstruct"
557 (("^env = Environment\\(")
558 "env = Environment(ENV=os.environ, "))
559 #t))
560 (add-after 'unpack 'create-version-file
561 (lambda _
562 (call-with-output-file "version.json"
563 (lambda (port)
564 (display ,(simple-format #f "{
565 \"version\": \"~A\"
566 }" version) port)))
567 #t))
568 (replace 'build
569 (lambda _
570 (apply invoke `("scons"
571 ,@common-options
572 "mongod" "mongo" "mongos"))))
573 (replace 'check
574 (lambda* (#:key tests? inputs #:allow-other-keys)
575 (setenv "TZDIR"
576 (string-append (assoc-ref inputs "tzdata")
577 "/share/zoneinfo"))
578 (when tests?
579 ;; Note that with the tests, especially the unittests, the
580 ;; build can take up to ~45GB of space, as many tests are
581 ;; individual executable files, with some being hundreds of
582 ;; megabytes in size.
583 (apply invoke `("scons" ,@common-options "dbtest" "unittests"))
584 (substitute* "build/unittests.txt"
585 ;; TODO: Don't run the async_stream_test, as it hangs
586 (("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
587 "")
588 ;; TODO: This test fails
589 ;; Expected 0UL != disks.size() (0 != 0) @src/mongo/util/procparser_test.cpp:476
590 (("^build\\/opt\\/mongo\\/util\\/procparser\\_test\n$")
591 ""))
592 (invoke "python" "buildscripts/resmoke.py"
593 "--suites=dbtest,unittests"
594 (format #f "--jobs=~a" (parallel-job-count))))
595 #t))
596 (replace 'install
597 (lambda* (#:key outputs #:allow-other-keys)
598 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
599 (install-file "mongod" bin)
600 (install-file "mongos" bin)
601 (install-file "mongo" bin))
602 #t))))))
603 (home-page "https://www.mongodb.org/")
604 (synopsis "High performance and high availability document database")
605 (description
606 "Mongo is a high-performance, high availability, schema-free
607 document-oriented database. A key goal of MongoDB is to bridge the gap
608 between key/value stores (which are fast and highly scalable) and traditional
609 RDBMS systems (which are deep in functionality).")
610 (license (list license:agpl3
611 ;; Some parts are licensed under the Apache License
612 license:asl2.0))))
613
614 (define-public mycli
615 (package
616 (name "mycli")
617 (version "1.22.2")
618 (source
619 (origin
620 (method url-fetch)
621 (uri (pypi-uri "mycli" version))
622 (sha256
623 (base32 "1lq2x95553vdmhw13cxcgsd2g2i32izhsb7hxd4m1iwf9b3msbpv"))))
624 (build-system python-build-system)
625 (arguments
626 `(#:tests? #f)) ; tests expect a running MySQL
627 (propagated-inputs
628 `(("python-cli-helpers" ,python-cli-helpers)
629 ("python-click" ,python-click)
630 ("python-configobj" ,python-configobj)
631 ("python-cryptography" ,python-cryptography)
632 ("python-prompt-toolkit" ,python-prompt-toolkit)
633 ("python-pygments" ,python-pygments)
634 ("python-pymysql" ,python-pymysql)
635 ("python-sqlparse" ,python-sqlparse)))
636 (home-page "http://mycli.net")
637 (synopsis
638 "Terminal Client for MySQL with AutoCompletion and Syntax Highlighting")
639 (description
640 "MyCLI is a command line interface for MySQL, MariaDB, and Percona with
641 auto-completion and syntax highlighting.")
642 (license license:bsd-3)))
643
644 ;; XXX When updating, check whether boost-for-mysql is still needed.
645 ;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
646 (define-public mysql
647 (package
648 (name "mysql")
649 (version "5.7.27")
650 (source (origin
651 (method url-fetch)
652 (uri (list (string-append
653 "https://dev.mysql.com/get/Downloads/MySQL-"
654 (version-major+minor version) "/"
655 name "-" version ".tar.gz")
656 (string-append
657 "https://downloads.mysql.com/archives/get/file/"
658 name "-" version ".tar.gz")))
659 (sha256
660 (base32
661 "1fhv16zr46pxm1j8vb8x8mh3nwzglg01arz8gnazbmjqldr5idpq"))))
662 (build-system cmake-build-system)
663 (arguments
664 `(#:configure-flags
665 '("-DBUILD_CONFIG=mysql_release"
666 "-DWITH_SSL=system"
667 "-DWITH_ZLIB=system"
668 "-DDEFAULT_CHARSET=utf8"
669 "-DDEFAULT_COLLATION=utf8_general_ci"
670 "-DMYSQL_DATADIR=/var/lib/mysql"
671 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
672 "-DINSTALL_INFODIR=share/mysql/docs"
673 "-DINSTALL_MANDIR=share/man"
674 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
675 "-DINSTALL_SCRIPTDIR=bin"
676 "-DINSTALL_INCLUDEDIR=include/mysql"
677 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
678 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
679 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
680 "-DINSTALL_DOCDIR=share/mysql/docs"
681 "-DINSTALL_SHAREDIR=share/mysql"
682 ;; Get rid of test data.
683 "-DINSTALL_MYSQLTESTDIR="
684 "-DINSTALL_SQLBENCHDIR=")
685 #:phases (modify-phases %standard-phases
686 (add-after
687 'install 'remove-extra-binaries
688 (lambda* (#:key outputs #:allow-other-keys)
689 (let ((out (assoc-ref outputs "out")))
690 ;; Remove the 3 *_embedded files, which weigh in at
691 ;; 14 MiB each.
692 (for-each delete-file
693 (find-files (string-append out "/bin")
694 "_embedded$"))
695 #t))))))
696 (native-inputs
697 `(("bison" ,bison)
698 ("perl" ,perl)
699 ("pkg-config" ,pkg-config)))
700 (inputs
701 `(("boost" ,boost-for-mysql)
702 ("libaio" ,libaio)
703 ("libtirpc" ,libtirpc)
704 ("ncurses" ,ncurses)
705 ("openssl" ,openssl)
706 ("rpcsvc-proto" ,rpcsvc-proto) ; rpcgen
707 ("zlib" ,zlib)))
708 (home-page "https://www.mysql.com/")
709 (synopsis "Fast, easy to use, and popular database")
710 (description
711 "MySQL is a fast, reliable, and easy to use relational database
712 management system that supports the standardized Structured Query
713 Language.")
714 (license license:gpl2)))
715
716 (define-public mariadb
717 (package
718 (name "mariadb")
719 (version "10.5.6")
720 (source (origin
721 (method url-fetch)
722 (uri (string-append "https://downloads.mariadb.com/MariaDB"
723 "/mariadb-" version "/source/mariadb-"
724 version ".tar.gz"))
725 (sha256
726 (base32
727 "1i257h0zdypdfj5wkg6ck9pxlkph0jvjs92k22pjr6gnx5lxs1gz"))
728 (modules '((guix build utils)))
729 (snippet
730 '(begin
731 ;; Delete bundled snappy and xz.
732 (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
733 (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
734 ;; This file checks that the bundled sources are present and
735 ;; declares build procedures for them.
736 (("^include\\(TokuThirdParty\\)") ""))
737 (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
738 ;; Don't attempt to use the procedures we just removed.
739 ((" build_lzma build_snappy") ""))
740
741 ;; Preserve CMakeLists.txt for these.
742 (for-each (lambda (file)
743 (unless (string-suffix? "CMakeLists.txt" file)
744 (delete-file file)))
745 (append (find-files "extra/wolfssl")
746 (find-files "zlib")))
747 #t))))
748 (build-system cmake-build-system)
749 (outputs '("out" "lib" "dev"))
750 (arguments
751 `(#:configure-flags
752 (list
753 "-DBUILD_CONFIG=mysql_release"
754 ;; Linking with libarchive fails, like this:
755
756 ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
757 ;; relocation R_X86_64_32 against `.bss' can not be used when
758 ;; making a shared object; recompile with -fPIC
759
760 ;; For now, disable the features that that use libarchive (xtrabackup).
761 "-DWITH_LIBARCHIVE=OFF"
762
763 ;; Disable the TokuDB engine, because its test suite frequently fails,
764 ;; and loading it crashes the server: <https://bugs.gnu.org/35521>.
765 "-DTOKUDB_OK=OFF"
766
767 ;; Ensure the system libraries are used.
768 "-DWITH_JEMALLOC=yes"
769 "-DWITH_PCRE=system"
770 "-DWITH_SSL=system"
771 "-DWITH_ZLIB=system"
772
773 "-DDEFAULT_CHARSET=utf8"
774 "-DDEFAULT_COLLATION=utf8_general_ci"
775 "-DMYSQL_DATADIR=/var/lib/mysql"
776 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
777 (string-append "-DCMAKE_INSTALL_PREFIX=" (assoc-ref %outputs "lib"))
778 (string-append "-DCMAKE_INSTALL_RPATH=" (assoc-ref %outputs "lib")
779 "/lib")
780 (string-append "-DINSTALL_INFODIR=" (assoc-ref %outputs "out")
781 "/share/mysql/docs")
782 (string-append "-DINSTALL_MANDIR=" (assoc-ref %outputs "out")
783 "/share/man")
784 (string-append "-DINSTALL_SCRIPTDIR=" (assoc-ref %outputs "out") "/bin")
785 (string-append "-DINSTALL_BINDIR=" (assoc-ref %outputs "out") "/bin")
786 "-DCMAKE_INSTALL_LIBDIR=lib"
787 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
788 (string-append "-DINSTALL_INCLUDEDIR=" (assoc-ref %outputs "dev")
789 "/include/mysql")
790 (string-append "-DINSTALL_DOCREADMEDIR=" (assoc-ref %outputs "out")
791 "/share/mysql/docs")
792 (string-append "-DINSTALL_DOCDIR=" (assoc-ref %outputs "out")
793 "/share/mysql/docs")
794 (string-append "-DINSTALL_SUPPORTFILESDIR=" (assoc-ref %outputs "out")
795 "/share/mysql/support-files")
796 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
797 "-DINSTALL_SHAREDIR=share")
798 #:phases
799 (modify-phases %standard-phases
800 (add-after 'unpack 'adjust-output-references
801 (lambda _
802 ;; The build system invariably prepends $CMAKE_INSTALL_PREFIX
803 ;; to other variables such as $INSTALL_INCLUDEDIR, which does
804 ;; not work when the latter uses an absolute file name.
805 (substitute* "libmariadb/mariadb_config/mariadb_config.c.in"
806 (("@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@")
807 "@INSTALL_INCLUDEDIR@"))
808 (substitute* "libmariadb/mariadb_config/libmariadb.pc.in"
809 (("\\$\\{prefix\\}/@INSTALL_INCLUDEDIR@")
810 "@INSTALL_INCLUDEDIR@"))
811 (substitute* "include/CMakeLists.txt"
812 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_INCLUDEDIR\\}")
813 "${INSTALL_INCLUDEDIR}"))
814 #t))
815 (add-after 'unpack 'adjust-tests
816 (lambda _
817 (let ((disabled-tests
818 '(;; These fail because root@hostname == root@localhost in
819 ;; the build environment, causing a user count mismatch.
820 ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
821 "funcs_1.is_columns_mysql"
822 "main.join_cache"
823 "main.explain_non_select"
824 "main.stat_tables"
825 "main.stat_tables_innodb"
826 "roles.acl_statistics"
827
828 ;; This file contains a time bomb which makes it fail after
829 ;; 2030-12-31. See <https://bugs.gnu.org/34351> for details.
830 "main.mysqldump"))
831
832 ;; This file contains a list of known-flaky tests for this
833 ;; release. Append our own items.
834 (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
835 (for-each (lambda (test)
836 (format unstable-tests "~a : ~a\n"
837 test "Disabled in Guix"))
838 disabled-tests)
839 (close-port unstable-tests)
840
841 ;; XXX: These fail because they expect a latin1 charset and
842 ;; collation. See <https://jira.mariadb.org/browse/MDEV-21264>.
843 (substitute* '("mysql-test/main/gis_notembedded.result"
844 "mysql-test/main/system_mysql_db.result")
845 (("latin1_swedish_ci") "utf8_general_ci")
846 (("\tlatin1") "\tutf8"))
847
848 (substitute* "mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test"
849 (("/bin/bash")
850 (which "bash")))
851
852 (substitute* "mysql-test/mysql-test-run.pl"
853 (("/bin/ls") (which "ls"))
854 (("/bin/sh") (which "sh")))
855 #t)))
856 (add-before 'configure 'disable-plugins
857 (lambda _
858 (let ((disable-plugin (lambda (name)
859 (call-with-output-file
860 (string-append "plugin/" name
861 "/CMakeLists.txt")
862 (lambda (port)
863 (format port "\n")))))
864 (disabled-plugins '(;; XXX: Causes a test failure.
865 "disks")))
866 (for-each disable-plugin disabled-plugins)
867 #t)))
868 (replace 'check
869 (lambda* (#:key (tests? #t) #:allow-other-keys)
870 (if tests?
871 (with-directory-excursion "mysql-test"
872 (invoke "./mtr" "--verbose"
873 "--retry=3"
874 "--testcase-timeout=40"
875 "--suite-timeout=600"
876 "--parallel" (number->string (parallel-job-count))
877 ;; Skip the replication tests: they are very I/O
878 ;; intensive and frequently causes indeterministic
879 ;; failures even on powerful hardware.
880 "--skip-rpl"
881 "--skip-test-list=unstable-tests"))
882 (format #t "test suite not run~%"))
883 #t))
884 (add-after
885 'install 'post-install
886 (lambda* (#:key inputs outputs #:allow-other-keys)
887 (let* ((out (assoc-ref outputs "out"))
888 (dev (assoc-ref outputs "dev"))
889 (lib (assoc-ref outputs "lib"))
890 (openssl (assoc-ref inputs "openssl")))
891 (substitute* (list (string-append out "/bin/mariadb-install-db")
892 (string-append out "/bin/mysql_install_db"))
893 (("basedir=\"\"")
894 (string-append "basedir=\"" out "\""))
895 (("\\$basedir/share/mysql")
896 (string-append lib "/share/mysql")))
897
898 ;; Remove unneeded files for testing.
899 (with-directory-excursion lib
900 (for-each delete-file-recursively
901 '("mysql-test" "sql-bench"))
902 ;; And static libraries.
903 (for-each delete-file (find-files "lib" "\\.a$")))
904 (with-directory-excursion out
905 (delete-file "share/man/man1/mysql-test-run.pl.1")
906 ;; Delete huge and unnecessary executables.
907 (for-each delete-file (find-files "bin" "test$")))
908 (mkdir-p (string-append dev "/share"))
909 (mkdir-p (string-append dev "/bin"))
910 (rename-file (string-append lib "/bin/mariadbd")
911 (string-append out "/bin/mariadbd"))
912 (rename-file (string-append lib "/bin/mysqld")
913 (string-append out "/bin/mysqld"))
914 (mkdir-p (string-append dev "/lib"))
915 (rename-file (string-append lib "/lib/pkgconfig")
916 (string-append dev "/lib/pkgconfig"))
917 (rename-file (string-append lib "/bin/mariadb_config")
918 (string-append dev "/bin/mariadb_config"))
919 (rename-file (string-append out "/bin/mysql_config")
920 (string-append dev "/bin/mysql_config"))
921
922 ;; Embed an absolute reference to OpenSSL in mysql_config
923 ;; and the pkg-config file to avoid propagation.
924 ;; XXX: how to do this for mariadb_config.c.in?
925 (substitute* (list (string-append dev "/bin/mysql_config")
926 (string-append dev "/lib/pkgconfig/mariadb.pc"))
927 (("-lssl -lcrypto" all)
928 (string-append "-L" openssl "/lib " all)))
929
930 #t))))))
931 (native-inputs
932 `(("bison" ,bison)
933 ("perl" ,perl)))
934 (inputs
935 `(("jemalloc" ,jemalloc)
936 ("libaio" ,libaio)
937 ("libxml2" ,libxml2)
938 ("ncurses" ,ncurses)
939 ("openssl" ,openssl)
940 ("pam" ,linux-pam)
941 ("pcre2" ,pcre2)
942 ("xz" ,xz)
943 ("zlib" ,zlib)))
944 ;; The test suite is very resource intensive and can take more than three
945 ;; hours on a x86_64 system. Give slow and busy machines some leeway.
946 (properties '((timeout . 64800))) ;18 hours
947 (home-page "https://mariadb.org/")
948 (synopsis "SQL database server")
949 (description
950 "MariaDB is a multi-user and multi-threaded SQL database server, designed
951 as a drop-in replacement of MySQL.")
952 (license license:gpl2)))
953
954 (define-public mariadb-connector-c
955 (package
956 (name "mariadb-connector-c")
957 (version "3.1.10")
958 (source (origin
959 (method url-fetch)
960 (uri (string-append
961 "https://downloads.mariadb.org/f/connector-c-"
962 version "/mariadb-connector-c-"
963 version "-src.tar.gz"))
964 (sha256
965 (base32
966 "13v5z4w1cl890lnr2fbwbziw638lqw2aga45vdq1z0cyrc9mcgmg"))))
967 (inputs
968 `(("openssl" ,openssl)))
969 (build-system cmake-build-system)
970 (arguments
971 '(#:tests? #f)) ; no tests
972 (home-page "https://mariadb.com/kb/en/mariadb-connector-c/")
973 (synopsis "Client library to connect to MySQL or MariaDB")
974 (description "The MariaDB Connector/C is used to connect applications
975 developed in C/C++ to MariaDB and MySQL databases.")
976 (license license:lgpl2.1+)))
977
978 ;; Don't forget to update the other postgresql packages when upgrading this one.
979 (define-public postgresql
980 (package
981 (name "postgresql")
982 (version "10.13")
983 (source (origin
984 (method url-fetch)
985 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
986 version "/postgresql-" version ".tar.bz2"))
987 (sha256
988 (base32
989 "1qal0yp7a90yzya7hl56gsmw5fvacplrdhpn7h9gnbyr1i2iyw2d"))
990 (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))
991 (build-system gnu-build-system)
992 (arguments
993 `(#:configure-flags '("--with-uuid=e2fs" "--with-openssl")
994 #:phases
995 (modify-phases %standard-phases
996 (add-before 'configure 'patch-/bin/sh
997 (lambda _
998 ;; Refer to the actual shell.
999 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
1000 "src/bin/psql/command.c")
1001 (("/bin/sh") (which "sh")))
1002 #t))
1003 (add-after 'build 'build-contrib
1004 (lambda _
1005 (invoke "make" "-C" "contrib")))
1006 (add-after 'install 'install-contrib
1007 (lambda _
1008 (invoke "make" "-C" "contrib" "install"))))))
1009 (inputs
1010 `(("readline" ,readline)
1011 ("libuuid" ,util-linux "lib")
1012 ("openssl" ,openssl)
1013 ("zlib" ,zlib)))
1014 (home-page "https://www.postgresql.org/")
1015 (synopsis "Powerful object-relational database system")
1016 (description
1017 "PostgreSQL is a powerful object-relational database system. It is fully
1018 ACID compliant, has full support for foreign keys, joins, views, triggers, and
1019 stored procedures (in multiple languages). It includes most SQL:2008 data
1020 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
1021 TIMESTAMP. It also supports storage of binary large objects, including
1022 pictures, sounds, or video.")
1023 (license (license:x11-style "file://COPYRIGHT"))))
1024
1025 (define-public postgresql-11
1026 (package
1027 (inherit postgresql)
1028 (name "postgresql")
1029 (version "11.6")
1030 (source (origin
1031 (method url-fetch)
1032 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1033 version "/postgresql-" version ".tar.bz2"))
1034 (sha256
1035 (base32
1036 "0w1iq488kpzfgfnlw4k32lz5by695mpnkq461jrgsr99z5zlz4j9"))))))
1037
1038 (define-public postgresql-9.6
1039 (package
1040 (inherit postgresql)
1041 (name "postgresql")
1042 (version "9.6.16")
1043 (source (origin
1044 (method url-fetch)
1045 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1046 version "/postgresql-" version ".tar.bz2"))
1047 (sha256
1048 (base32
1049 "1rr2dgv4ams8r2lp13w85c77rkmzpb88fjlc28mvlw6zq2fblv2w"))))))
1050
1051 (define-public python-pymysql
1052 (package
1053 (name "python-pymysql")
1054 (version "0.9.3")
1055 (source
1056 (origin
1057 (method url-fetch)
1058 (uri (pypi-uri "PyMySQL" version))
1059 (sha256
1060 (base32 "1ry8lxgdc1p3k7gbw20r405jqi5lvhi5wk83kxdbiv8xv3f5kh6q"))))
1061 (build-system python-build-system)
1062 (native-inputs
1063 `(("python-unittest2" ,python-unittest2)))
1064 (inputs
1065 `(("python-cryptography" ,python-cryptography)))
1066 (arguments
1067 `(#:tests? #f)) ; tests expect a running MySQL
1068 (home-page "https://github.com/PyMySQL/PyMySQL/")
1069 (synopsis "Pure-Python MySQL driver")
1070 (description
1071 "PyMySQL is a pure-Python MySQL client library, based on PEP 249.
1072 Most public APIs are compatible with @command{mysqlclient} and MySQLdb.")
1073 (license license:expat)))
1074
1075 (define-public python2-pymysql
1076 (package-with-python2 python-pymysql))
1077
1078 (define-public qdbm
1079 (package
1080 (name "qdbm")
1081 (version "1.8.78")
1082 (source
1083 (origin
1084 (method url-fetch)
1085 (uri (string-append "http://fallabs.com/" name "/"
1086 name "-" version ".tar.gz"))
1087 (sha256
1088 (base32
1089 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
1090 (build-system gnu-build-system)
1091 (arguments
1092 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1093 (assoc-ref %outputs "out")
1094 "/lib"))
1095 #:make-flags (list "CFLAGS=-fPIC")))
1096 (home-page "https://fallabs.com/qdbm/")
1097 (synopsis "Key-value database")
1098 (description "QDBM is a library of routines for managing a
1099 database. The database is a simple data file containing key-value
1100 pairs. Every key and value is serial bytes with variable length.
1101 Binary data as well as character strings can be used as a key or a
1102 value. There is no concept of data tables or data types. Records are
1103 organized in a hash table or B+ tree.")
1104 (license license:lgpl2.1+)))
1105
1106 (define-public recutils
1107 (package
1108 (name "recutils")
1109 (version "1.8")
1110 (source (origin
1111 (method url-fetch)
1112 (uri (string-append "mirror://gnu/recutils/recutils-"
1113 version ".tar.gz"))
1114 (sha256
1115 (base32
1116 "14xiln4immfsw8isnvwvq0h23f6z0wilpgsc4qzabnrzb5lsx3nz"))))
1117 (build-system gnu-build-system)
1118
1119 (arguments '(#:configure-flags
1120 (list (string-append "--with-bash-headers="
1121 (assoc-ref %build-inputs "bash:include")
1122 "/include/bash"))))
1123
1124 (native-inputs `(("bc" ,bc)
1125 ("bash:include" ,bash "include")
1126 ("check" ,check-0.14)
1127 ("libuuid" ,util-linux)
1128 ("pkg-config" ,pkg-config)))
1129
1130 ;; TODO: Add more optional inputs.
1131 (inputs `(("curl" ,curl)
1132 ("libgcrypt" ,libgcrypt)))
1133 (synopsis "Manipulate plain text files as databases")
1134 (description
1135 "GNU Recutils is a set of tools and libraries for creating and
1136 manipulating text-based, human-editable databases. Despite being text-based,
1137 databases created with Recutils carry all of the expected features such as
1138 unique fields, primary keys, time stamps and more. Many different field
1139 types are supported, as is encryption.")
1140 (license license:gpl3+)
1141 (home-page "https://www.gnu.org/software/recutils/")))
1142
1143 (define-public emacs-recutils
1144 (package
1145 (inherit recutils)
1146 (name "emacs-recutils")
1147 (build-system emacs-build-system)
1148 (arguments
1149 '(#:phases
1150 (modify-phases %standard-phases
1151 (add-after 'unpack 'change-directory
1152 (lambda _
1153 (chdir "etc")
1154 #t)))))
1155 (native-inputs '())
1156 (inputs '())
1157 (synopsis "Emacs mode for working with recutils database files")
1158 (description "This package provides an Emacs major mode @code{rec-mode}
1159 for working with GNU Recutils text-based, human-editable databases. It
1160 supports editing, navigation, and querying of recutils database files
1161 including field and record folding.")))
1162
1163 (define-public rocksdb
1164 (package
1165 (name "rocksdb")
1166 (version "6.11.4")
1167 (source (origin
1168 (method git-fetch)
1169 (uri (git-reference
1170 (url "https://github.com/facebook/rocksdb")
1171 (commit (string-append "v" version))))
1172 (file-name (git-file-name name version))
1173 (sha256
1174 (base32
1175 "0n19p9cd13jg0lnibrzwkxs4xlrhyj3knypkd2ic41arbds0bdnl"))
1176 (modules '((guix build utils)))
1177 (snippet
1178 '(begin
1179 ;; TODO: unbundle gtest.
1180 (delete-file "build_tools/gnu_parallel")
1181 (substitute* "Makefile"
1182 (("build_tools/gnu_parallel") "parallel"))
1183 #t))))
1184 (build-system gnu-build-system)
1185 (arguments
1186 `(#:make-flags (list "CC=gcc" "V=1"
1187 ;; Ceph requires that RTTI is enabled.
1188 "USE_RTTI=1"
1189 (string-append "INSTALL_PATH="
1190 (assoc-ref %outputs "out"))
1191
1192 ;; Running the full test suite takes hours and require
1193 ;; a lot of disk space. Instead we only run a subset
1194 ;; (see .travis.yml and Makefile).
1195 "ROCKSDBTESTS_END=db_tailing_iter_test")
1196 #:test-target "check_some"
1197 ;; Many tests fail on 32-bit platforms. There are multiple reports about
1198 ;; this upstream, but it's not going to be supported any time soon.
1199 #:tests? (let ((system ,(or (%current-target-system)
1200 (%current-system))))
1201 (or (string-prefix? "x86_64-linux" system)
1202 (string-prefix? "aarch64-linux" system)))
1203 #:phases
1204 (modify-phases %standard-phases
1205 (add-after 'unpack 'patch-Makefile
1206 (lambda _
1207 (substitute* "Makefile"
1208 ;; Don't depend on the static library when installing.
1209 (("install: install-static")
1210 "install: install-shared")
1211 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1212 #t))
1213 (delete 'configure)
1214 ;; The default target is only needed for tests and built on demand.
1215 (delete 'build)
1216 (add-before 'check 'disable-optimizations
1217 (lambda _
1218 ;; Prevent the build from passing '-march=native' to the compiler.
1219 (setenv "PORTABLE" "1")
1220 #t))
1221 (add-before 'check 'disable-failing-tests
1222 (lambda _
1223 (substitute* "Makefile"
1224 ;; These tests reliably fail due to "Too many open files".
1225 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
1226 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
1227 #t))
1228 (add-after 'check 'build
1229 ;; The default build target is a debug build for tests. The
1230 ;; install target depends on the "shared_lib" release target
1231 ;; so we build it here for clarity.
1232 (lambda* (#:key (make-flags '()) parallel-build? #:allow-other-keys)
1233 (apply invoke "make" "shared_lib"
1234 `(,@(if parallel-build?
1235 `("-j" ,(number->string (parallel-job-count)))
1236 '())
1237 ,@make-flags)))))))
1238 (native-inputs
1239 `(("parallel" ,parallel)
1240 ("perl" ,perl)
1241 ("procps" ,procps)
1242 ("python" ,python-2)
1243 ("which" ,which)))
1244 (inputs
1245 `(("bzip2" ,bzip2)
1246 ("gflags" ,gflags)
1247 ("jemalloc" ,jemalloc)
1248 ("lz4" ,lz4)
1249 ("snappy" ,snappy)
1250 ("zlib" ,zlib)))
1251 (home-page "https://rocksdb.org/")
1252 (synopsis "Persistent key-value store for fast storage")
1253 (description
1254 "RocksDB is a library that forms the core building block for a fast
1255 key-value server, especially suited for storing data on flash drives. It
1256 has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
1257 between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
1258 (RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
1259 compactions, making it specially suitable for storing multiple terabytes of
1260 data in a single database. RocksDB is partially based on @code{LevelDB}.")
1261 ;; RocksDB is dual licensed under GPL2 and ASL 2.0. Some header
1262 ;; files carry the 3-clause BSD license.
1263 (license (list license:gpl2 license:asl2.0 license:bsd-3))))
1264
1265 (define-public sparql-query
1266 (package
1267 (name "sparql-query")
1268 (version "1.1")
1269 (source (origin
1270 (method git-fetch)
1271 (uri (git-reference
1272 (url "https://github.com/tialaramex/sparql-query")
1273 (commit version)))
1274 (sha256
1275 (base32 "0a84a89idpjhj9w2y3fmvzv7ldps1cva1kxvfmh897k02kaniwxk"))
1276 (file-name (git-file-name name version))))
1277 (build-system gnu-build-system)
1278 (inputs
1279 `(("curl" ,curl)
1280 ("glib" ,glib)
1281 ("libxml2" ,libxml2)
1282 ("ncurses" ,ncurses)
1283 ("readline" ,readline)))
1284 (native-inputs
1285 `(("pkg-config" ,pkg-config)))
1286 (arguments
1287 `(#:make-flags '("CC=gcc")
1288 #:phases
1289 (modify-phases %standard-phases
1290 (delete 'configure)
1291 ;; The Makefile uses git to obtain versioning information. This phase
1292 ;; substitutes the git invocation with the package version.
1293 (add-after 'unpack 'remove-git-dependency
1294 (lambda _
1295 (substitute* "Makefile"
1296 (("^gitrev :=.*$")
1297 (string-append "gitrev = \"v" ,version "\"")))
1298 #t))
1299 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
1300 ;; This replacement does the same thing, except for using $PREFIX/bin
1301 ;; instead.
1302 (replace 'install
1303 (lambda* (#:key outputs #:allow-other-keys)
1304 (let* ((out (assoc-ref outputs "out"))
1305 (bin (string-append out "/bin")))
1306 (install-file "sparql-query" bin)
1307 (symlink (string-append bin "/sparql-query")
1308 (string-append bin "/sparql-update")))
1309 #t))
1310 (replace 'check
1311 (lambda* (#:key make-flags #:allow-other-keys)
1312 (apply invoke "make" `(,@make-flags "scan-test"))
1313 (invoke "./scan-test"))))))
1314 (home-page "https://github.com/tialaramex/sparql-query/")
1315 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
1316 (description "Sparql-query is a command-line tool for accessing SPARQL
1317 endpoints over HTTP. It has been intentionally designed to @code{feel} similar to
1318 tools for interrogating SQL databases. For example, you can enter a query over
1319 several lines, using a semi-colon at the end of a line to indicate the end of
1320 your query. It also supports readline so that you can more easily recall and
1321 edit previous queries, even across sessions. It can be used non-interactively,
1322 for example from a shell script.")
1323 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
1324 ;; others (like sparql-query.c) contain a GPLv2+ license header.
1325 (license (list license:gpl3+))))
1326
1327 (define-public sqitch
1328 (package
1329 (name "sqitch")
1330 (version "1.1.0")
1331 (source
1332 (origin
1333 (method url-fetch)
1334 (uri (string-append
1335 "mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-v"
1336 version ".tar.gz"))
1337 (sha256
1338 (base32 "1ayiwg9kh3w0nbacbcln7h944z94vq5vnnd5diz86033bpbnq57f"))))
1339 (build-system perl-build-system)
1340 (arguments
1341 '(#:phases
1342 (modify-phases %standard-phases
1343 (add-before 'check 'set-check-environment
1344 (lambda _
1345 (setenv "TZ" "UTC")
1346 (setenv "HOME" "/tmp")
1347 #t))
1348 (add-after 'install 'wrap-program
1349 (lambda* (#:key outputs #:allow-other-keys)
1350 (let* ((out (assoc-ref outputs "out"))
1351 (path (getenv "PERL5LIB")))
1352 (wrap-program (string-append out "/bin/sqitch")
1353 `("PERL5LIB" ":" prefix
1354 (,(string-append out "/lib/perl5/site_perl"
1355 ":"
1356 path)))))
1357 #t)))))
1358 (native-inputs
1359 `(("perl-capture-tiny" ,perl-capture-tiny)
1360 ("perl-io-pager" ,perl-io-pager)
1361 ("perl-module-build" ,perl-module-build)
1362 ("perl-module-runtime" ,perl-module-runtime)
1363 ("perl-path-class" ,perl-path-class)
1364 ("perl-test-deep" ,perl-test-deep)
1365 ("perl-test-dir" ,perl-test-dir)
1366 ("perl-test-exception" ,perl-test-exception)
1367 ("perl-test-file" ,perl-test-file)
1368 ("perl-test-file-contents" ,perl-test-file-contents)
1369 ("perl-test-mockmodule" ,perl-test-mockmodule)
1370 ("perl-test-mockobject" ,perl-test-mockobject)
1371 ("perl-test-nowarnings" ,perl-test-nowarnings)
1372 ("perl-test-warn" ,perl-test-warn)))
1373 (inputs
1374 `(("perl-class-xsaccessor" ,perl-class-xsaccessor)
1375 ("perl-clone" ,perl-clone)
1376 ("perl-config-gitlike" ,perl-config-gitlike)
1377 ("perl-datetime" ,perl-datetime)
1378 ("perl-datetime-timezone" ,perl-datetime-timezone)
1379 ("perl-dbd-mysql" ,perl-dbd-mysql)
1380 ("perl-dbd-pg" ,perl-dbd-pg)
1381 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1382 ("perl-dbi" ,perl-dbi)
1383 ("perl-devel-stacktrace" ,perl-devel-stacktrace)
1384 ("perl-encode-locale" ,perl-encode-locale)
1385 ("perl-hash-merge" ,perl-hash-merge)
1386 ("perl-ipc-run3" ,perl-ipc-run3)
1387 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
1388 ("perl-libintl-perl" ,perl-libintl-perl)
1389 ("perl-list-moreutils" ,perl-list-moreutils)
1390 ("perl-moo" ,perl-moo)
1391 ("perl-mysql-config" ,perl-mysql-config)
1392 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1393 ("perl-path-class" ,perl-path-class)
1394 ("perl-perlio-utf8_strict" ,perl-perlio-utf8_strict)
1395 ("perl-string-formatter" ,perl-string-formatter)
1396 ("perl-string-shellquote" ,perl-string-shellquote)
1397 ("perl-sub-exporter" ,perl-sub-exporter)
1398 ("perl-template-tiny" ,perl-template-tiny)
1399 ("perl-template-toolkit" ,perl-template-toolkit)
1400 ("perl-throwable" ,perl-throwable)
1401 ("perl-try-tiny" ,perl-try-tiny)
1402 ("perl-type-tiny" ,perl-type-tiny)
1403 ("perl-type-tiny-xs" ,perl-type-tiny-xs)
1404 ("perl-uri" ,perl-uri)
1405 ("perl-uri-db" ,perl-uri-db)))
1406 (home-page "https://sqitch.org/")
1407 (synopsis "Database change management tool")
1408 (description
1409 "Sqitch is a standalone change management system for database schemas,
1410 which uses SQL to describe changes.")
1411 (license license:x11)))
1412
1413 (define-public sqlcrush
1414 ;; Unfortunately, there is no proper upstream release and may never be.
1415 (let ((commit "b5f6868f189566a26eecc78d0f0659813c1aa98a")
1416 (revision "1"))
1417 (package
1418 (name "sqlcrush")
1419 (version (git-version "0.1.5" revision commit))
1420 (source (origin
1421 (method git-fetch)
1422 (uri (git-reference
1423 (url "https://github.com/coffeeandscripts/sqlcrush")
1424 (commit commit)))
1425 (file-name (git-file-name name version))
1426 (sha256
1427 (base32
1428 "0x3wy40r93p0jv3nbwj9a77wa4ff697d13r0wffmm7q9h3mzsww8"))))
1429 (build-system python-build-system)
1430 (inputs
1431 `(("python-cryptography" ,python-cryptography)
1432 ("python-psycopg2" ,python-psycopg2)
1433 ("python-pymysql" ,python-pymysql)
1434 ("python-sqlalchemy" ,python-sqlalchemy)))
1435 (home-page "https://github.com/coffeeandscripts/sqlcrush")
1436 (synopsis "Text console-based database viewer and editor")
1437 (description
1438 "SQLcrush lets you view and edit a database directly from the text
1439 console through an ncurses interface. You can explore each table's structure,
1440 browse and edit the contents, add and delete entries, all while tracking your
1441 changes.")
1442 (license license:gpl3+)))) ; no headers, see README.md
1443
1444 (define-public tdb
1445 (package
1446 (name "tdb")
1447 (version "1.4.3")
1448 (source (origin
1449 (method url-fetch)
1450 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
1451 version ".tar.gz"))
1452 (sha256
1453 (base32
1454 "06waz0k50c7v3chd08mzp2rv7w4k4q9isbxx3vhlfpx1vy9q61f8"))))
1455 (build-system gnu-build-system)
1456 (arguments
1457 '(#:phases
1458 (modify-phases %standard-phases
1459 (replace 'configure
1460 (lambda* (#:key outputs #:allow-other-keys)
1461 (let ((out (assoc-ref outputs "out")))
1462 ;; The 'configure' script is a wrapper for Waf and
1463 ;; doesn't recognize things like '--enable-fast-install'.
1464 (invoke "./configure"
1465 (string-append "--prefix=" out))))))))
1466 (native-inputs
1467 `(;; TODO: Build the documentation.
1468 ;; ("docbook-xsl" ,docbook-xsl)
1469 ;; ("libxml2" ,libxml2)
1470 ;; ("libxslt" ,libxslt)
1471 ("python" ,python) ;for the Waf build system
1472 ("which" ,which)))
1473 (home-page "https://tdb.samba.org/")
1474 (synopsis "Trivial database")
1475 (description
1476 "TDB is a Trivial Database. In concept, it is very much like GDBM,
1477 and BSD's DB except that it allows multiple simultaneous writers and uses
1478 locking internally to keep writers from trampling on each other. TDB is also
1479 extremely small.")
1480 (license license:lgpl3+)))
1481
1482 (define-public perl-dbi
1483 (package
1484 (name "perl-dbi")
1485 (version "1.643")
1486 (source (origin
1487 (method url-fetch)
1488 (uri (string-append
1489 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
1490 version ".tar.gz"))
1491 (sha256
1492 (base32
1493 "1yinx39960y241vf2sknxj0dfz82a5m9gvklq5rw78k0nlyrjawa"))))
1494 (build-system perl-build-system)
1495 (synopsis "Database independent interface for Perl")
1496 (description "This package provides an database interface for Perl.")
1497 (home-page "https://metacpan.org/release/DBI")
1498 (license license:perl-license)))
1499
1500 (define-public perl-dbix-class
1501 (package
1502 (name "perl-dbix-class")
1503 (version "0.082842")
1504 (source
1505 (origin
1506 (method url-fetch)
1507 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1508 "DBIx-Class-" version ".tar.gz"))
1509 (sha256
1510 (base32 "1rh7idjjbibc1zmiaaarask434lh0lx7f2xyfwmy37k9fa0xcpmh"))))
1511 (build-system perl-build-system)
1512 (native-inputs
1513 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
1514 ("perl-file-temp" ,perl-file-temp)
1515 ("perl-module-install" ,perl-module-install)
1516 ("perl-package-stash" ,perl-package-stash)
1517 ("perl-test-deep" ,perl-test-deep)
1518 ("perl-test-exception" ,perl-test-exception)
1519 ("perl-test-warn" ,perl-test-warn)))
1520 (propagated-inputs
1521 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1522 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1523 ("perl-class-inspector" ,perl-class-inspector)
1524 ("perl-config-any" ,perl-config-any)
1525 ("perl-context-preserve" ,perl-context-preserve)
1526 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
1527 ("perl-data-page" ,perl-data-page)
1528 ("perl-dbi" ,perl-dbi)
1529 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
1530 ("perl-hash-merge" ,perl-hash-merge)
1531 ("perl-module-find" ,perl-module-find)
1532 ("perl-moo" ,perl-moo)
1533 ("perl-mro-compat" ,perl-mro-compat)
1534 ("perl-namespace-clean" ,perl-namespace-clean)
1535 ("perl-path-class" ,perl-path-class)
1536 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
1537 ("perl-scope-guard" ,perl-scope-guard)
1538 ("perl-sql-abstract-classic" ,perl-sql-abstract-classic)
1539 ("perl-sub-name" ,perl-sub-name)
1540 ("perl-text-balanced" ,perl-text-balanced)
1541 ("perl-try-tiny" ,perl-try-tiny)))
1542 (home-page "https://metacpan.org/release/DBIx-Class")
1543 (synopsis "Extensible and flexible object <-> relational mapper")
1544 (description "An SQL to OO mapper with an object API inspired by
1545 Class::DBI (with a compatibility layer as a springboard for porting) and a
1546 resultset API that allows abstract encapsulation of database operations. It
1547 aims to make representing queries in your code as perl-ish as possible while
1548 still providing access to as many of the capabilities of the database as
1549 possible, including retrieving related records from multiple tables in a
1550 single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
1551 \"ORDER BY\" and \"HAVING\" support.")
1552 (license license:perl-license)))
1553
1554 (define-public perl-dbix-class-cursor-cached
1555 (package
1556 (name "perl-dbix-class-cursor-cached")
1557 (version "1.001004")
1558 (source
1559 (origin
1560 (method url-fetch)
1561 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
1562 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
1563 (sha256
1564 (base32
1565 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
1566 (build-system perl-build-system)
1567 (native-inputs
1568 `(("perl-cache-cache" ,perl-cache-cache)
1569 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1570 ("perl-module-install" ,perl-module-install)))
1571 (propagated-inputs
1572 `(("perl-carp-clan" ,perl-carp-clan)
1573 ("perl-dbix-class" ,perl-dbix-class)))
1574 (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached")
1575 (synopsis "Cursor with built-in caching support")
1576 (description "DBIx::Class::Cursor::Cached provides a cursor class with
1577 built-in caching support.")
1578 (license license:perl-license)))
1579
1580 (define-public perl-dbix-class-introspectablem2m
1581 (package
1582 (name "perl-dbix-class-introspectablem2m")
1583 (version "0.001002")
1584 (source
1585 (origin
1586 (method url-fetch)
1587 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1588 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
1589 (sha256
1590 (base32
1591 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
1592 (build-system perl-build-system)
1593 (native-inputs
1594 `(("perl-module-install" ,perl-module-install)))
1595 (propagated-inputs
1596 `(("perl-dbix-class" ,perl-dbix-class)))
1597 (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M")
1598 (synopsis "Introspect many-to-many relationships")
1599 (description "Because the many-to-many relationships are not real
1600 relationships, they can not be introspected with DBIx::Class. Many-to-many
1601 relationships are actually just a collection of convenience methods installed
1602 to bridge two relationships. This DBIx::Class component can be used to store
1603 all relevant information about these non-relationships so they can later be
1604 introspected and examined.")
1605 (license license:perl-license)))
1606
1607 (define-public perl-dbix-class-schema-loader
1608 (package
1609 (name "perl-dbix-class-schema-loader")
1610 (version "0.07049")
1611 (source
1612 (origin
1613 (method url-fetch)
1614 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1615 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
1616 (sha256
1617 (base32
1618 "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8"))))
1619 (build-system perl-build-system)
1620 (native-inputs
1621 `(("perl-config-any" ,perl-config-any)
1622 ("perl-config-general" ,perl-config-general)
1623 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1624 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
1625 ("perl-module-install" ,perl-module-install)
1626 ("perl-moose" ,perl-moose)
1627 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
1628 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
1629 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1630 ("perl-test-deep" ,perl-test-deep)
1631 ("perl-test-differences" ,perl-test-differences)
1632 ("perl-test-exception" ,perl-test-exception)
1633 ("perl-test-pod" ,perl-test-pod)
1634 ("perl-test-warn" ,perl-test-warn)))
1635 (propagated-inputs
1636 `(("perl-class-unload" ,perl-class-unload)
1637 ("perl-class-inspector" ,perl-class-inspector)
1638 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1639 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1640 ("perl-carp-clan" ,perl-carp-clan)
1641 ("perl-data-dump" ,perl-data-dump)
1642 ("perl-dbix-class" ,perl-dbix-class)
1643 ("perl-hash-merge" ,perl-hash-merge)
1644 ("perl-list-moreutils" ,perl-list-moreutils)
1645 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
1646 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
1647 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
1648 ("perl-namespace-clean" ,perl-namespace-clean)
1649 ("perl-mro-compat" ,perl-mro-compat)
1650 ("perl-scope-guard" ,perl-scope-guard)
1651 ("perl-string-camelcase" ,perl-string-camelcase)
1652 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
1653 ("perl-sub-name" ,perl-sub-name)
1654 ("perl-try-tiny" ,perl-try-tiny)))
1655 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
1656 (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader")
1657 (synopsis "Create a DBIx::Class::Schema based on a database")
1658 (description "DBIx::Class::Schema::Loader automates the definition of a
1659 DBIx::Class::Schema by scanning database table definitions and setting up the
1660 columns, primary keys, unique constraints and relationships.")
1661 (license license:perl-license)))
1662
1663 (define-public perl-dbd-pg
1664 (package
1665 (name "perl-dbd-pg")
1666 (version "3.7.4")
1667 (source
1668 (origin
1669 (method url-fetch)
1670 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
1671 "DBD-Pg-" version ".tar.gz"))
1672 (sha256
1673 (base32
1674 "0gkqlvbmzbdm0g4k328nlkjdg3wrjm5i2n9jxj1i8sqxkm79rylz"))))
1675 (build-system perl-build-system)
1676 (native-inputs
1677 `(("perl-dbi" ,perl-dbi)))
1678 (propagated-inputs
1679 `(("perl-dbi" ,perl-dbi)
1680 ("postgresql" ,postgresql)))
1681 (home-page "https://metacpan.org/release/DBD-Pg")
1682 (synopsis "DBI PostgreSQL interface")
1683 (description "This package provides a PostgreSQL driver for the Perl5
1684 @dfn{Database Interface} (DBI).")
1685 (license license:perl-license)))
1686
1687 (define-public perl-dbd-mysql
1688 (package
1689 (name "perl-dbd-mysql")
1690 (version "4.050")
1691 (source
1692 (origin
1693 (method url-fetch)
1694 (uri (string-append "mirror://cpan/authors/id/D/DV/DVEEDEN/"
1695 "DBD-mysql-" version ".tar.gz"))
1696 (sha256
1697 (base32 "0y4djb048i09dk19av7mzfb3khr72vw11p3ayw2p82jsy4gm8j2g"))))
1698 (build-system perl-build-system)
1699 (arguments
1700 `(#:phases
1701 (modify-phases %standard-phases
1702 (add-before 'configure 'skip-library-detection
1703 ;; Avoid depencies on perl-devel-checklib, openssl, and zlib. They
1704 ;; are really only needed for the test suite; their absence does not
1705 ;; affect the build or the end result.
1706 (lambda _
1707 (substitute* "Makefile.PL"
1708 (("use Devel::CheckLib;" match)
1709 (string-append "# " match))
1710 (("assert_lib")
1711 "print"))
1712 #t)))
1713 ;; Tests require running MySQL server.
1714 #:tests? #f))
1715 (propagated-inputs
1716 `(("perl-dbi" ,perl-dbi)
1717 ("mysql" ,mariadb "lib")
1718 ("mysql-dev" ,mariadb "dev")))
1719 (home-page "https://metacpan.org/release/DBD-mysql")
1720 (synopsis "DBI MySQL interface")
1721 (description "This package provides a MySQL driver for the Perl5
1722 @dfn{Database Interface} (DBI).")
1723 (license license:perl-license)))
1724
1725 (define-public perl-dbd-sqlite
1726 (package
1727 (name "perl-dbd-sqlite")
1728 (version "1.66")
1729 (source (origin
1730 (method url-fetch)
1731 (uri (string-append
1732 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
1733 version ".tar.gz"))
1734 (sha256
1735 (base32
1736 "1zljln5nh61gj3k22a1fv2vhx5l83waizmarwkh77hk6kzzmvrw9"))))
1737 (build-system perl-build-system)
1738 (inputs `(("sqlite" ,sqlite)))
1739 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
1740 (synopsis "SQlite interface for Perl")
1741 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
1742 the entire thing in the distribution. So in order to get a fast transaction
1743 capable RDBMS working for your Perl project you simply have to install this
1744 module, and nothing else.")
1745 (license license:perl-license)
1746 (home-page "https://metacpan.org/release/DBD-SQLite")))
1747
1748 (define-public perl-mysql-config
1749 (package
1750 (name "perl-mysql-config")
1751 (version "1.04")
1752 (source
1753 (origin
1754 (method url-fetch)
1755 (uri (string-append
1756 "mirror://cpan/authors/id/D/DA/DARREN/MySQL-Config-"
1757 version
1758 ".tar.gz"))
1759 (sha256
1760 (base32
1761 "1svn7ccw2gc4cazvc58j84rxhnc9vs01zpird0l8460598j475qr"))))
1762 (build-system perl-build-system)
1763 (home-page "https://metacpan.org/release/MySQL-Config")
1764 (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files")
1765 (description
1766 "@code{MySQL::Config} emulates the @code{load_defaults} function from
1767 libmysqlclient. It will fill an array with long options, ready to be parsed by
1768 @code{Getopt::Long}.")
1769 (license license:perl-license)))
1770
1771 (define-public perl-sql-abstract
1772 (package
1773 (name "perl-sql-abstract")
1774 (version "1.87")
1775 (source
1776 (origin
1777 (method url-fetch)
1778 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1779 "SQL-Abstract-" version ".tar.gz"))
1780 (sha256
1781 (base32 "0jhw91b23wc9bkfwcgvka4x5ddxk58m9bcp5ay7a3vx77nla09p9"))))
1782 (build-system perl-build-system)
1783 (native-inputs
1784 `(("perl-module-install" ,perl-module-install)
1785 ("perl-test-deep" ,perl-test-deep)
1786 ("perl-test-exception" ,perl-test-exception)
1787 ("perl-test-warn" ,perl-test-warn)))
1788 (propagated-inputs
1789 `(("perl-hash-merge" ,perl-hash-merge)
1790 ("perl-moo" ,perl-moo)
1791 ("perl-mro-compat" ,perl-mro-compat)
1792 ("perl-text-balanced" ,perl-text-balanced)))
1793 (home-page "https://metacpan.org/release/SQL-Abstract")
1794 (synopsis "Generate SQL from Perl data structures")
1795 (description "This module was inspired by the excellent DBIx::Abstract.
1796 While based on the concepts used by DBIx::Abstract, the concepts used have
1797 been modified to make the SQL easier to generate from Perl data structures.
1798 The underlying idea is for this module to do what you mean, based on the data
1799 structures you provide it, so that you don't have to modify your code every
1800 time your data changes.")
1801 (license license:perl-license)))
1802
1803 (define-public perl-sql-abstract-classic
1804 (package
1805 (name "perl-sql-abstract-classic")
1806 (version "1.91")
1807 (source
1808 (origin
1809 (method url-fetch)
1810 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1811 "SQL-Abstract-Classic-" version ".tar.gz"))
1812 (sha256
1813 (base32 "0a7g13hs3kdxrjn43sfli09mgsi9d6w0dfw6hlk268av17yisgaf"))))
1814 (build-system perl-build-system)
1815 (native-inputs
1816 `(("perl-test-deep" ,perl-test-deep)
1817 ("perl-test-exception" ,perl-test-exception)
1818 ("perl-test-warn" ,perl-test-warn)))
1819 (propagated-inputs
1820 `(("perl-mro-compat" ,perl-mro-compat)
1821 ("perl-sql-abstract" ,perl-sql-abstract)))
1822 (home-page "https://metacpan.org/release/SQL-Abstract-Classic")
1823 (synopsis "Generate SQL from Perl data structures")
1824 (description
1825 "This module is nearly identical to @code{SQL::Abstract} 1.81, and exists
1826 to preserve the ability of users to opt into the new way of doing things in
1827 later versions according to their own schedules.
1828
1829 It is an abstract SQL generation module based on the concepts used by
1830 @code{DBIx::Abstract}, with several important differences, especially when it
1831 comes to @code{WHERE} clauses. These concepts were modified to make the SQL
1832 easier to generate from Perl data structures.
1833
1834 The underlying idea is for this module to do what you mean, based on the data
1835 structures you provide it. You shouldn't have to modify your code every time
1836 your data changes, as this module figures it out.")
1837 (license license:perl-license)))
1838
1839 (define-public perl-sql-splitstatement
1840 (package
1841 (name "perl-sql-splitstatement")
1842 (version "1.00020")
1843 (source
1844 (origin
1845 (method url-fetch)
1846 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
1847 "SQL-SplitStatement-" version ".tar.gz"))
1848 (sha256
1849 (base32
1850 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
1851 (build-system perl-build-system)
1852 (native-inputs
1853 `(("perl-test-exception" ,perl-test-exception)))
1854 (propagated-inputs
1855 `(("perl-class-accessor" ,perl-class-accessor)
1856 ("perl-list-moreutils" ,perl-list-moreutils)
1857 ("perl-regexp-common" ,perl-regexp-common)
1858 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
1859 (home-page "https://metacpan.org/release/SQL-SplitStatement")
1860 (synopsis "Split SQL code into atomic statements")
1861 (description "This module tries to split any SQL code, even including
1862 non-standard extensions, into the atomic statements it is composed of.")
1863 (license license:perl-license)))
1864
1865 (define-public perl-sql-tokenizer
1866 (package
1867 (name "perl-sql-tokenizer")
1868 (version "0.24")
1869 (source
1870 (origin
1871 (method url-fetch)
1872 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
1873 "SQL-Tokenizer-" version ".tar.gz"))
1874 (sha256
1875 (base32
1876 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
1877 (build-system perl-build-system)
1878 (home-page "https://metacpan.org/release/SQL-Tokenizer")
1879 (synopsis "SQL tokenizer")
1880 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
1881 claim to be a parser or query verifier. It just creates sane tokens from a
1882 valid SQL query.")
1883 (license license:perl-license)))
1884
1885 (define-public unixodbc
1886 (package
1887 (name "unixodbc")
1888 (version "2.3.7")
1889 (source (origin
1890 (method url-fetch)
1891 (uri
1892 (string-append
1893 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
1894 version ".tar.gz"))
1895 (sha256
1896 (base32 "0xry3sg497wly8f7715a7gwkn2k36bcap0mvzjw74jj53yx6kwa5"))))
1897 (build-system gnu-build-system)
1898 (synopsis "Data source abstraction library")
1899 (description "Unixodbc is a library providing an API with which to access
1900 data sources. Data sources include SQL Servers and any software with an ODBC
1901 Driver.")
1902 (license license:lgpl2.1+)
1903 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
1904 (home-page "http://www.unixodbc.org")))
1905
1906 (define-public unqlite
1907 (package
1908 (name "unqlite")
1909 (version "1.1.6")
1910 (source (origin
1911 (method url-fetch)
1912 ;; Contains bug fixes against the official release, and has an
1913 ;; autotooled build system.
1914 (uri (string-append "https://github.com/aidin36/tocc/releases/"
1915 "download/v1.0.0/"
1916 "unqlite-unofficial-" version ".tar.gz"))
1917 (sha256
1918 (base32
1919 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
1920 (build-system gnu-build-system)
1921 (arguments `(#:tests? #f)) ;No check target
1922 (home-page "https://www.unqlite.org")
1923 (synopsis "In-memory key/value and document store")
1924 (description
1925 "UnQLite is an in-process software library which implements a
1926 self-contained, serverless, zero-configuration, transactional NoSQL
1927 database engine. UnQLite is a document store database similar to
1928 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
1929 similar to BerkeleyDB, LevelDB, etc.")
1930 (license license:bsd-2)))
1931
1932 (define-public redis
1933 (package
1934 (name "redis")
1935 (version "5.0.7")
1936 (source (origin
1937 (method url-fetch)
1938 (uri (string-append "http://download.redis.io/releases/redis-"
1939 version".tar.gz"))
1940 (sha256
1941 (base32
1942 "0ax8sf3vw0yadr41kzc04917scrg5wir1d94zmbz00b8pzm79nv1"))))
1943 (build-system gnu-build-system)
1944 (arguments
1945 '(#:tests? #f ; tests related to master/slave and replication fail
1946 #:phases (modify-phases %standard-phases
1947 (delete 'configure))
1948 #:make-flags `("CC=gcc"
1949 "MALLOC=libc"
1950 "LDFLAGS=-ldl"
1951 ,(string-append "PREFIX="
1952 (assoc-ref %outputs "out")))))
1953 (synopsis "Key-value cache and store")
1954 (description "Redis is an advanced key-value cache and store. Redis
1955 supports many data structures including strings, hashes, lists, sets, sorted
1956 sets, bitmaps and hyperloglogs.")
1957 (home-page "https://redis.io/")
1958 (license license:bsd-3)))
1959
1960 (define-public kyotocabinet
1961 (package
1962 (name "kyotocabinet")
1963 (version "1.2.78")
1964 (source (origin
1965 (method url-fetch)
1966 (uri (string-append "https://fallabs.com/kyotocabinet/pkg/"
1967 "kyotocabinet-" version ".tar.gz"))
1968 (sha256
1969 (base32
1970 "1bxkf9kmcavq9rqridb8mvmrk3hj4447ffi24m2admsbm61n6k29"))))
1971 (build-system gnu-build-system)
1972 (arguments
1973 `(#:configure-flags
1974 (list
1975 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
1976 (string-append "LDFLAGS=-Wl,-rpath="
1977 (assoc-ref %outputs "out") "/lib"))))
1978 (inputs `(("zlib" ,zlib)))
1979 (home-page "https://fallabs.com/kyotocabinet/")
1980 (synopsis
1981 "Kyoto Cabinet is a modern implementation of the DBM database")
1982 (description
1983 "Kyoto Cabinet is a standalone file-based database that supports Hash
1984 and B+ Tree data storage models. It is a fast key-value lightweight
1985 database and supports many programming languages. It is a NoSQL database.")
1986 (license license:gpl3+)))
1987
1988 (define-public tokyocabinet
1989 (package
1990 (name "tokyocabinet")
1991 (version "1.4.48")
1992 (source
1993 (origin
1994 (method url-fetch)
1995 (uri (string-append "http://fallabs.com/tokyocabinet/"
1996 name "-" version ".tar.gz"))
1997 (sha256
1998 (base32
1999 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
2000 (build-system gnu-build-system)
2001 (arguments
2002 `(#:configure-flags
2003 (list "--enable-pthread" "--enable-off64" "--enable-fastest"
2004 (string-append "LDFLAGS=-Wl,-rpath="
2005 (assoc-ref %outputs "out") "/lib"))))
2006 (inputs
2007 `(("zlib" ,zlib)))
2008 (home-page "http://fallabs.com/tokyocabinet/")
2009 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
2010 (description
2011 "Tokyo Cabinet is a library of routines for managing a database.
2012 The database is a simple data file containing records, each is a pair of a
2013 key and a value. Every key and value is serial bytes with variable length.
2014 Both binary data and character string can be used as a key and a value.
2015 There is neither concept of data tables nor data types. Records are
2016 organized in hash table, B+ tree, or fixed-length array.")
2017 (license license:lgpl2.1+)))
2018
2019 (define-public wiredtiger
2020 (package
2021 (name "wiredtiger")
2022 (version "2.9.1")
2023 (source (origin
2024 (method url-fetch)
2025 (uri (string-append
2026 "http://source.wiredtiger.com/releases/wiredtiger-"
2027 version ".tar.bz2"))
2028 (sha256
2029 (base32
2030 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
2031 (build-system gnu-build-system)
2032 (arguments
2033 '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib")
2034 #:phases
2035 (modify-phases %standard-phases
2036 (add-before 'check 'disable-test/fops
2037 (lambda _
2038 ;; XXX: timed out after 3600 seconds of silence
2039 (substitute* "Makefile"
2040 (("test/fops") ""))
2041 #t)))))
2042 (inputs
2043 `(("lz4" ,lz4)
2044 ("zlib" ,zlib)
2045 ("snappy" ,snappy)))
2046 (home-page "http://source.wiredtiger.com/")
2047 (synopsis "NoSQL data engine")
2048 (description
2049 "WiredTiger is an extensible platform for data management. It supports
2050 row-oriented storage (where all columns of a row are stored together),
2051 column-oriented storage (where columns are stored in groups, allowing for
2052 more efficient access and storage of column subsets) and log-structured merge
2053 trees (LSM), for sustained throughput under random insert workloads.")
2054 (license license:gpl3) ; or GPL-2
2055 ;; configure.ac: WiredTiger requires a 64-bit build.
2056 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
2057
2058 (define-public wiredtiger-3
2059 (package
2060 (inherit wiredtiger)
2061 (name "wiredtiger")
2062 (version "3.1.0")
2063 (source (origin
2064 (method url-fetch)
2065 (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-"
2066 version ".tar.bz2"))
2067 (sha256
2068 (base32
2069 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx"))))))
2070
2071 (define-public guile-wiredtiger
2072 (package
2073 (name "guile-wiredtiger")
2074 (version "0.7.0")
2075 (source (origin
2076 (method git-fetch)
2077 (uri (git-reference
2078 (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
2079 (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b")))
2080 (file-name (string-append name "-" version "-checkout"))
2081 (sha256
2082 (base32
2083 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595"))))
2084 (build-system gnu-build-system)
2085 (arguments
2086 '(#:parallel-tests? #f ;; tests can't be run in parallel, yet.
2087 #:configure-flags
2088 (list (string-append "--with-libwiredtiger-prefix="
2089 (assoc-ref %build-inputs "wiredtiger")))
2090 #:make-flags '("GUILE_AUTO_COMPILE=0")))
2091 (native-inputs
2092 `(("autoconf" ,autoconf)
2093 ("automake" ,automake)
2094 ("pkg-config" ,pkg-config)))
2095 (inputs
2096 `(("wiredtiger" ,wiredtiger-3)
2097 ("guile" ,guile-2.2)))
2098 (propagated-inputs
2099 `(("guile-bytestructures" ,guile-bytestructures)))
2100 (synopsis "WiredTiger bindings for GNU Guile")
2101 (description
2102 "This package provides Guile bindings to the WiredTiger ``NoSQL''
2103 database.")
2104 (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger")
2105 (license license:gpl3+)))
2106
2107 (define-public perl-db-file
2108 (package
2109 (name "perl-db-file")
2110 (version "1.854")
2111 (source
2112 (origin
2113 (method url-fetch)
2114 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
2115 version ".tar.gz"))
2116 (sha256
2117 (base32 "0fv0any5am6vr6h1wcwhnraj70hd55fs4d8c2y7chsc9alf9di5y"))))
2118 (build-system perl-build-system)
2119 (inputs `(("bdb" ,bdb)))
2120 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
2121 (arguments
2122 `(#:phases (modify-phases %standard-phases
2123 (add-before
2124 'configure 'modify-config.in
2125 (lambda* (#:key inputs #:allow-other-keys)
2126 (substitute* "config.in"
2127 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
2128 #t)))))
2129 (home-page "https://metacpan.org/release/DB_File")
2130 (synopsis "Perl5 access to Berkeley DB version 1.x")
2131 (description
2132 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
2133 (license license:perl-license)))
2134
2135 (define-public lmdb
2136 (package
2137 (name "lmdb")
2138 (version "0.9.26")
2139 (source
2140 (origin
2141 (method git-fetch)
2142 (uri (git-reference
2143 (url "https://git.openldap.org/openldap/openldap.git")
2144 (commit (string-append "LMDB_" version))))
2145 (file-name (git-file-name name version))
2146 (sha256
2147 (base32 "0323xwb2rqyrr9vr6gbxc2kl89drhqw0ifmyh9pg9qgqmymyhxdx"))))
2148 (build-system gnu-build-system)
2149 (arguments
2150 `(#:test-target "test"
2151 #:phases
2152 (modify-phases %standard-phases
2153 (replace 'configure
2154 (lambda* (#:key outputs #:allow-other-keys)
2155 (chdir "libraries/liblmdb")
2156 (substitute* "Makefile"
2157 (("/usr/local") (assoc-ref outputs "out")))
2158 #t)))))
2159 (home-page "https://symas.com/lmdb/")
2160 (synopsis "Lightning Memory-Mapped Database library")
2161 (description
2162 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
2163 transactional database. Unlike more complex relational databases, LMDB handles
2164 only key-value pairs (stored as arbitrary byte arrays) and relies on the
2165 underlying operating system for caching and locking, keeping the code small and
2166 simple.
2167 The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
2168 disk-based databases with high read performance that scales linearly over
2169 multiple cores. The size of each database is limited only by the size of the
2170 virtual address space — not physical RAM.")
2171 (license license:openldap2.8)))
2172
2173 (define-public lmdbxx
2174 (package
2175 (name "lmdbxx")
2176 (version "0.9.14.0")
2177 (source
2178 (origin
2179 (method git-fetch)
2180 (uri (git-reference
2181 (url "https://github.com/drycpp/lmdbxx")
2182 (commit version)))
2183 (file-name (git-file-name name version))
2184 (sha256
2185 (base32 "1jmb9wg2iqag6ps3z71bh72ymbcjrb6clwlkgrqf1sy80qwvlsn6"))))
2186 (arguments
2187 `(#:make-flags
2188 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
2189 #:phases
2190 (modify-phases %standard-phases
2191 (delete 'configure))))
2192 (build-system gnu-build-system)
2193 (inputs `(("lmdb" ,lmdb)))
2194 (home-page "http://lmdbxx.sourceforge.net")
2195 (synopsis "C++11 wrapper for the LMDB embedded B+ tree database library")
2196 (description "@code{lmdbxx} is a comprehensive @code{C++} wrapper for the
2197 @code{LMDB} embedded database library, offering both an error-checked
2198 procedural interface and an object-oriented resource interface with RAII
2199 semantics.")
2200 (license license:unlicense)))
2201
2202 (define-public libpqxx
2203 (package
2204 (name "libpqxx")
2205 (version "4.0.1")
2206 (source (origin
2207 (method url-fetch)
2208 (uri (string-append
2209 "http://pqxx.org/download/software/libpqxx/"
2210 name "-" version ".tar.gz"))
2211 (sha256
2212 (base32
2213 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
2214 (build-system gnu-build-system)
2215 (native-inputs
2216 `(("python" ,python-2)))
2217 (inputs `(("postgresql" ,postgresql)))
2218 (arguments
2219 `(#:tests? #f ; # FAIL: 1
2220 #:phases
2221 (modify-phases %standard-phases
2222 (add-before 'configure 'fix-sed-command
2223 (lambda _
2224 ;; Newer sed versions error out if double brackets are not used.
2225 (substitute* "configure"
2226 (("\\[:space:\\]") "[[:space:]]"))
2227 #t)))))
2228 (synopsis "C++ connector for PostgreSQL")
2229 (description
2230 "Libpqxx is a C++ library to enable user programs to communicate with the
2231 PostgreSQL database back-end. The database back-end can be local or it may be
2232 on another machine, accessed via TCP/IP.")
2233 (home-page "http://pqxx.org/")
2234 (license license:bsd-3)))
2235
2236 (define-public python-peewee
2237 (package
2238 (name "python-peewee")
2239 (version "3.9.6")
2240 (source
2241 (origin
2242 (method url-fetch)
2243 (uri (pypi-uri "peewee" version))
2244 (sha256
2245 (base32
2246 "1j4sh946k0736m7pd54z0y6i2hjhgg3kdllx1pwq8xkzzcgrx1xw"))))
2247 (build-system python-build-system)
2248 (arguments
2249 `(#:tests? #f)) ; Fails to import test data
2250 (native-inputs
2251 `(("python-cython" ,python-cython)))
2252 (home-page "https://github.com/coleifer/peewee/")
2253 (synopsis "Small object-relational mapping utility")
2254 (description
2255 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
2256 handles converting between pythonic values and those used by databases, so you
2257 can use Python types in your code without having to worry. It has built-in
2258 support for sqlite, mysql and postgresql. If you already have a database, you
2259 can autogenerate peewee models using @code{pwiz}, a model generator.")
2260 (license license:expat)))
2261
2262 (define-public python2-peewee
2263 (package-with-python2 python-peewee))
2264
2265 (define-public python-tortoise-orm
2266 (package
2267 (name "python-tortoise-orm")
2268 (version "0.16.7")
2269 (source
2270 (origin
2271 (method url-fetch)
2272 (uri (pypi-uri "tortoise-orm" version))
2273 (sha256
2274 (base32
2275 "0wr7p4v0b16ypm9fcpwpl99kf491m6w3jkd13xcsgq13fy73fbqc"))))
2276 (build-system python-build-system)
2277 ;; Disable tests for now. They pull in a lot of dependencies.
2278 (arguments `(#:tests? #f))
2279 (native-inputs
2280 `(("python-asynctest" ,python-asynctest)
2281 ("python-nose2" ,python-nose2)))
2282 (propagated-inputs
2283 `(("python-aiosqlite" ,python-aiosqlite)
2284 ("python-pypika" ,python-pypika)
2285 ("python-ciso8601" ,python-ciso8601)
2286 ("python-typing-extensions"
2287 ,python-typing-extensions)))
2288 (home-page
2289 "https://github.com/tortoise/tortoise-orm")
2290 (synopsis
2291 "Easy async ORM for python, built with relations in mind")
2292 (description
2293 "Tortoise ORM is an easy-to-use asyncio ORM (Object Relational Mapper)
2294 inspired by Django. Tortoise ORM was build with relations in mind and
2295 admiration for the excellent and popular Django ORM. It’s engraved in its
2296 design that you are working not with just tables, you work with relational
2297 data.")
2298 (license license:asl2.0)))
2299
2300 (define-public sqlcipher
2301 (package
2302 (name "sqlcipher")
2303 (version "3.4.2")
2304 (source
2305 (origin
2306 (method url-fetch)
2307 (uri (string-append "https://github.com/sqlcipher/" name
2308 "/archive/v" version ".tar.gz"))
2309 (sha256
2310 (base32 "1nxarwbci8jx99f1d0y1ivxcv25s78l1p7q6qy28lkpkcx8pm2b9"))
2311 (file-name (string-append name "-" version ".tar.gz"))))
2312 (build-system gnu-build-system)
2313 (inputs
2314 `(("libcrypto" ,openssl)
2315 ("libtcl8.6" ,tcl))) ; required for running the tests
2316 (native-inputs
2317 `(("tcl" ,tcl)))
2318 (arguments
2319 '(#:configure-flags
2320 '("--enable-tempstore=yes"
2321 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
2322 "LDFLAGS=-lcrypto -ltcl8.6"
2323 "--disable-tcl")
2324 ;; tests cannot be run from the Makefile
2325 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
2326 #:test-target "testfixture"
2327 #:phases
2328 (modify-phases %standard-phases
2329 (add-before 'check 'build-test-runner
2330 (assoc-ref %standard-phases 'check))
2331 (replace 'check
2332 (lambda _
2333 (invoke "./testfixture" "test/crypto.test"))))))
2334 (home-page "https://www.zetetic.net/sqlcipher/")
2335 (synopsis
2336 "Library providing transparent encryption of SQLite database files")
2337 (description "SQLCipher is an implementation of SQLite, extended to
2338 provide transparent 256-bit AES encryption of database files. Pages are
2339 encrypted before being written to disk and are decrypted when read back. It’s
2340 well suited for protecting embedded application databases and for mobile
2341 development.")
2342 ;; The source files
2343 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
2344 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
2345 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
2346 ;; source files are in the public domain.
2347 (license (list license:public-domain license:bsd-3))))
2348
2349 (define-public python-pyodbc-c
2350 (package
2351 (name "python-pyodbc-c")
2352 (version "3.1.4")
2353 (source
2354 (origin
2355 (method url-fetch)
2356 (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
2357 "archive.tar.gz?ref=v" version))
2358 (sha256
2359 (base32
2360 "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
2361 (file-name (string-append name "-" version ".tar.gz"))))
2362 (build-system python-build-system)
2363 (inputs
2364 `(("unixodbc" ,unixodbc)))
2365 (arguments
2366 `(;; No unit tests exist.
2367 #:tests? #f))
2368 (home-page "https://github.com/mkleehammer/pyodbc")
2369 (synopsis "Python ODBC Library")
2370 (description "@code{python-pyodbc-c} provides a Python DB-API driver
2371 for ODBC.")
2372 (license (license:x11-style "file://LICENSE.TXT"))))
2373
2374 (define-public python2-pyodbc-c
2375 (package-with-python2 python-pyodbc-c))
2376
2377 (define-public python-pyodbc
2378 (package
2379 (name "python-pyodbc")
2380 (version "4.0.30")
2381 (source
2382 (origin
2383 (method url-fetch)
2384 (uri (pypi-uri "pyodbc" version))
2385 (sha256
2386 (base32 "0skjpraar6hcwsy82612bpj8nw016ncyvvq88j5syrikxgp5saw5"))
2387 (file-name (string-append name "-" version ".tar.gz"))))
2388 (build-system python-build-system)
2389 (inputs
2390 `(("unixodbc" ,unixodbc)))
2391 (arguments
2392 `(#:tests? #f)) ; no unit tests exist
2393 (home-page "https://github.com/mkleehammer/pyodbc")
2394 (synopsis "Python ODBC Library")
2395 (description "@code{python-pyodbc} provides a Python DB-API driver
2396 for ODBC.")
2397 (license (license:x11-style "file:///LICENSE.TXT"))))
2398
2399 (define-public python2-pyodbc
2400 (package-with-python2 python-pyodbc))
2401
2402 (define-public mdbtools
2403 (package
2404 (name "mdbtools")
2405 (version "0.7.1")
2406 (source
2407 (origin
2408 (method git-fetch)
2409 (uri (git-reference
2410 (url "https://github.com/brianb/mdbtools")
2411 (commit version)))
2412 (file-name (git-file-name name version))
2413 (sha256
2414 (base32
2415 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
2416 (build-system gnu-build-system)
2417 (inputs
2418 `(("glib" ,glib)))
2419 (native-inputs
2420 `(("autoconf" ,autoconf)
2421 ("automake" ,automake)
2422 ("libtool" ,libtool)
2423 ("pkg-config" ,pkg-config)
2424 ("txt2man" ,txt2man)
2425 ("which" ,which)))
2426 (home-page "http://mdbtools.sourceforge.net/")
2427 (synopsis "Read Microsoft Access databases")
2428 (description "MDB Tools is a set of tools and applications to read the
2429 proprietary MDB file format used in Microsoft's Access database package. This
2430 includes programs to export schema and data from Microsoft's Access database
2431 file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
2432 etc., and an SQL engine for performing simple SQL queries.")
2433 (license (list license:lgpl2.0
2434 license:gpl2+))))
2435
2436 (define-public python-lmdb
2437 (package
2438 (name "python-lmdb")
2439 (version "1.0.0")
2440 (source (origin
2441 (method url-fetch)
2442 (uri (pypi-uri "lmdb" version))
2443 (sha256
2444 (base32
2445 "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1"))
2446 (modules '((guix build utils)))
2447 (snippet
2448 ;; Delete bundled lmdb source files.
2449 '(begin
2450 (for-each delete-file (list "lib/lmdb.h"
2451 "lib/mdb.c"
2452 "lib/midl.c"
2453 "lib/midl.h"))
2454 #t))))
2455 (build-system python-build-system)
2456 (inputs
2457 `(("lmdb" ,lmdb)))
2458 (arguments
2459 `(#:phases
2460 (modify-phases %standard-phases
2461 (add-before 'build 'use-system-lmdb
2462 (lambda* (#:key inputs #:allow-other-keys)
2463 (let ((lmdb (assoc-ref inputs "lmdb")))
2464 (setenv "LMDB_PURE" "set") ; don't apply env-copy-txn.patch
2465 (setenv "LMDB_FORCE_SYSTEM" "set")
2466 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
2467 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
2468 #t))))
2469 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
2470 #:tests? #f))
2471 (home-page "https://github.com/dw/py-lmdb")
2472 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
2473 (description
2474 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
2475 Memory-Mapped Database} (LMDB), a high-performance key-value store.")
2476 (license
2477 (list license:openldap2.8
2478 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
2479 ;; but not actually needed on platforms currently supported by Guix.
2480 license:bsd-3))))
2481
2482 (define-public python-orator
2483 (package
2484 (name "python-orator")
2485 (version "0.9.9")
2486 (source (origin
2487 (method url-fetch)
2488 (uri (pypi-uri "orator" version))
2489 (sha256
2490 (base32
2491 "0mbgybz63ryhr9p1f4glnls5c57jp6il3dw0kf97f3pj80687rvg"))))
2492 (build-system python-build-system)
2493 ;; FIXME: Tests are not distributed with PyPI, and the repository
2494 ;; does not contain setup.py. How to test?
2495 (arguments '(#:tests? #f))
2496 (propagated-inputs
2497 `(("python-backpack" ,python-backpack)
2498 ("python-blinker" ,python-blinker)
2499 ("python-cleo" ,python-cleo)
2500 ("python-faker" ,python-faker)
2501 ("python-inflection" ,python-inflection)
2502 ("python-lazy-object-proxy" ,python-lazy-object-proxy)
2503 ("python-pendulum" ,python-pendulum)
2504 ("python-pyaml" ,python-pyaml)
2505 ("python-pygments" ,python-pygments)
2506 ("python-pyyaml" ,python-pyyaml)
2507 ("python-simplejson" ,python-simplejson)
2508 ("python-six" ,python-six)
2509 ("python-wrapt" ,python-wrapt)))
2510 (home-page "https://orator-orm.com/")
2511 (synopsis "ActiveRecord ORM for Python")
2512 (description
2513 "Orator provides a simple ActiveRecord-like Object Relational Mapping
2514 implementation for Python.")
2515 (license license:expat)
2516 (properties `((python2-variant . ,(delay python2-orator))))))
2517
2518 (define-public python2-orator
2519 (package-with-python2 (strip-python2-variant python-orator)))
2520
2521 (define-public virtuoso-ose
2522 (package
2523 (name "virtuoso-ose")
2524 (version "7.2.5")
2525 (source
2526 (origin
2527 (method url-fetch)
2528 (uri (string-append
2529 "https://github.com/openlink/virtuoso-opensource/releases/"
2530 "download/v" version "/virtuoso-opensource-" version ".tar.gz"))
2531 (sha256
2532 (base32 "0r1xakclkfi69pzh8z2k16z3x0m49pxp764icj0ad4w4bb97fr42"))))
2533 (build-system gnu-build-system)
2534 (arguments
2535 `(#:tests? #f ; Tests require a network connection.
2536 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
2537 ;; This indicates that the internal zlib code may still be used.
2538 #:configure-flags '("--without-internal-zlib"
2539 "--with-readline"
2540 "--enable-static=no")
2541 #:phases
2542 (modify-phases %standard-phases
2543 ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in
2544 ;; the build output. The following phase removes it.
2545 (add-after 'install 'remove-static-libs
2546 (lambda* (#:key outputs #:allow-other-keys)
2547 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2548 (for-each (lambda (file)
2549 (delete-file (string-append lib "/" file)))
2550 '("libvirtuoso-t.a"
2551 "libvirtuoso-t.la"))))))))
2552 (inputs
2553 `(("openssl" ,openssl-1.0)
2554 ("net-tools" ,net-tools)
2555 ("readline" ,readline)
2556 ("zlib" ,zlib)))
2557 (home-page "http://vos.openlinksw.com/owiki/wiki/VOS/")
2558 (synopsis "Multi-model database system")
2559 (description "Virtuoso is a scalable cross-platform server that combines
2560 relational, graph, and document data management with web application server
2561 and web services platform functionality.")
2562 ;; configure: error: ... can only be build on 64bit platforms
2563 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))
2564 (license license:gpl2)))
2565
2566 (define-public python-ccm
2567 (package
2568 (name "python-ccm")
2569 (version "2.1.6")
2570 (source
2571 (origin
2572 (method url-fetch)
2573 (uri (pypi-uri "ccm" version))
2574 (sha256
2575 (base32
2576 "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n"))))
2577 (build-system python-build-system)
2578 (propagated-inputs
2579 `(("python-pyyaml" ,python-pyyaml)
2580 ;; Not listed in setup.py, but used in ccmlib/node.py for full
2581 ;; functionality
2582 ("python-psutil" ,python-psutil)
2583 ("python-six" ,python-six)))
2584 (home-page "https://github.com/pcmanus/ccm")
2585 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
2586 localhost")
2587 (description "Cassandra Cluster Manager is a development tool for testing
2588 local Cassandra clusters. It creates, launches and removes Cassandra clusters
2589 on localhost.")
2590 (license license:asl2.0)))
2591
2592 (define-public python2-ccm
2593 (package-with-python2 python-ccm))
2594
2595 (define-public python2-pysqlite
2596 (package
2597 (name "python2-pysqlite")
2598 (version "2.8.3")
2599 (source
2600 (origin
2601 (method url-fetch)
2602 (uri (pypi-uri "pysqlite" version))
2603 (sha256
2604 (base32
2605 "1424gwq9sil2ffmnizk60q36vydkv8rxs6m7xs987kz8cdc37lqp"))))
2606 (build-system python-build-system)
2607 (inputs
2608 `(("sqlite" ,sqlite)))
2609 (arguments
2610 `(#:python ,python-2 ; incompatible with Python 3
2611 #:tests? #f)) ; no test target
2612 (home-page "https://github.com/ghaering/pysqlite")
2613 (synopsis "SQLite bindings for Python")
2614 (description
2615 "Pysqlite provides SQLite bindings for Python that comply to the
2616 Database API 2.0T.")
2617 (license license:zlib)))
2618
2619 (define-public python-sqlalchemy
2620 (package
2621 (name "python-sqlalchemy")
2622 (version "1.3.18")
2623 (source
2624 (origin
2625 (method url-fetch)
2626 (uri (pypi-uri "SQLAlchemy" version))
2627 (sha256
2628 (base32 "1rwc6ss1cnz3kxx0p9p6xw0w79r8qw03lcc29k31yb3rcigvfbys"))))
2629 (build-system python-build-system)
2630 (native-inputs
2631 `(("python-cython" ,python-cython) ; for C extensions
2632 ("python-pytest" ,python-pytest)
2633 ("python-mock" ,python-mock))) ; for tests
2634 (arguments
2635 `(#:phases
2636 (modify-phases %standard-phases
2637 (replace 'check
2638 (lambda _ (invoke "py.test"))))))
2639 (home-page "https://www.sqlalchemy.org")
2640 (synopsis "Database abstraction library")
2641 (description
2642 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
2643 gives application developers the full power and flexibility of SQL. It
2644 provides a full suite of well known enterprise-level persistence patterns,
2645 designed for efficient and high-performing database access, adapted into a
2646 simple and Pythonic domain language.")
2647 (license license:x11)))
2648
2649 (define-public python2-sqlalchemy
2650 (package-with-python2 python-sqlalchemy))
2651
2652 (define-public python-sqlalchemy-utils
2653 (package
2654 (name "python-sqlalchemy-utils")
2655 (version "0.32.21")
2656 (source
2657 (origin
2658 (method url-fetch)
2659 (uri (pypi-uri "SQLAlchemy-Utils" version))
2660 (sha256
2661 (base32
2662 "1myn71dn8j74xglyh46f12sh8ywb7j0j732rzwq70kvwwnq32m73"))))
2663 (build-system python-build-system)
2664 (arguments
2665 '(#:tests? #f)) ; FIXME: Many tests require a running database server.
2666 ;; #:phases
2667 ;; (modify-phases %standard-phases
2668 ;; (replace 'check
2669 ;; (lambda _
2670 ;; (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
2671 (propagated-inputs
2672 `(("python-six" ,python-six)
2673 ("python-sqlalchemy" ,python-sqlalchemy)))
2674 (native-inputs
2675 `(("python-dateutil" ,python-dateutil)
2676 ("python-flexmock" ,python-flexmock)
2677 ("python-psycopg2" ,python-psycopg2)
2678 ("python-pytest" ,python-pytest)
2679 ("python-pytz" ,python-pytz)))
2680 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
2681 (synopsis "Various utility functions for SQLAlchemy")
2682 (description
2683 "SQLAlchemy-utils provides various utility functions and custom data types
2684 for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
2685
2686 You might also want to install the following optional dependencies:
2687 @enumerate
2688 @item @code{python-passlib}
2689 @item @code{python-babel}
2690 @item @code{python-cryptography}
2691 @item @code{python-pytz}
2692 @item @code{python-psycopg2}
2693 @item @code{python-furl}
2694 @item @code{python-flask-babel}
2695 @end enumerate
2696 ")
2697 (license license:bsd-3)))
2698
2699 (define-public python2-sqlalchemy-utils
2700 (package-with-python2 python-sqlalchemy-utils))
2701
2702 (define-public python-alchemy-mock
2703 (package
2704 (name "python-alchemy-mock")
2705 (version "0.4.3")
2706 (home-page "https://github.com/miki725/alchemy-mock")
2707 (source (origin
2708 (method url-fetch)
2709 (uri (pypi-uri "alchemy-mock" version))
2710 (sha256
2711 (base32
2712 "0ylxygl3bcdapzz529n8wgk7vx9gjwb3ism564ypkpd7dbsw653r"))))
2713 (build-system python-build-system)
2714 (arguments
2715 '(#:phases (modify-phases %standard-phases
2716 (replace 'check
2717 (lambda _
2718 ;; Create pytest.ini that adds doctest options to
2719 ;; prevent test failure. Taken from tox.ini.
2720 (call-with-output-file "pytest.ini"
2721 (lambda (port)
2722 (format port "[pytest]
2723 doctest_optionflags=IGNORE_EXCEPTION_DETAIL
2724 ")))
2725 (invoke "pytest" "-vv" "--doctest-modules"
2726 "alchemy_mock/"))))))
2727 (native-inputs
2728 `(("python-mock" ,python-mock)
2729 ("python-pytest" ,python-pytest)))
2730 (propagated-inputs
2731 `(("python-six" ,python-six)
2732 ("python-sqlalchemy" ,python-sqlalchemy)))
2733 (synopsis "Mock helpers for SQLAlchemy")
2734 (description
2735 "This package provides mock helpers for SQLAlchemy that makes it easy
2736 to mock an SQLAlchemy session while preserving the ability to do asserts.
2737
2738 Normally Normally SQLAlchemy's expressions cannot be easily compared as
2739 comparison on binary expression produces yet another binary expression, but
2740 this library provides functions to facilitate such comparisons.")
2741 (license license:expat)))
2742
2743 (define-public python-alembic
2744 (package
2745 (name "python-alembic")
2746 (version "1.4.3")
2747 (source
2748 (origin
2749 (method url-fetch)
2750 (uri (pypi-uri "alembic" version))
2751 (sha256
2752 (base32 "0if2dgb088clk738p26bwk50735h6jpd2kacdgc5capv2hiz6d2k"))))
2753 (build-system python-build-system)
2754 (arguments
2755 '(#:phases (modify-phases %standard-phases
2756 (replace 'check
2757 (lambda _
2758 (invoke "pytest" "-vv"))))))
2759 (native-inputs
2760 `(("python-mock" ,python-mock)
2761 ("python-pytest-cov" ,python-pytest-cov)))
2762 (propagated-inputs
2763 `(("python-dateutil" ,python-dateutil)
2764 ("python-sqlalchemy" ,python-sqlalchemy)
2765 ("python-mako" ,python-mako)
2766 ("python-editor" ,python-editor)))
2767 (home-page "https://bitbucket.org/zzzeek/alembic")
2768 (synopsis "Database migration tool for SQLAlchemy")
2769 (description
2770 "Alembic is a lightweight database migration tool for usage with the
2771 SQLAlchemy Database Toolkit for Python.")
2772 (license license:expat)))
2773
2774 (define-public python2-alembic
2775 (package-with-python2 python-alembic))
2776
2777 (define-public python-pickleshare
2778 (package
2779 (name "python-pickleshare")
2780 (version "0.7.5")
2781 (source
2782 (origin
2783 (method url-fetch)
2784 (uri (pypi-uri "pickleshare" version))
2785 (sha256
2786 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
2787 (build-system python-build-system)
2788 (arguments
2789 `(#:phases (modify-phases %standard-phases
2790 (replace 'check
2791 (lambda _
2792 (invoke "pytest"))))))
2793 (native-inputs
2794 `(("python-pytest" ,python-pytest)))
2795 (home-page "https://github.com/vivainio/pickleshare")
2796 (synopsis "Tiny key value database with concurrency support")
2797 (description
2798 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
2799 Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
2800 shelve, many processes can access the database simultaneously. Changing a
2801 value in database is immediately visible to other processes accessing the same
2802 database. Concurrency is possible because the values are stored in separate
2803 files. Hence the “database” is a directory where all files are governed by
2804 PickleShare.")
2805 (properties `((python2-variant . ,(delay python2-pickleshare))))
2806 (license license:expat)))
2807
2808 (define-public python2-pickleshare
2809 (let ((pickleshare (package-with-python2
2810 (strip-python2-variant python-pickleshare))))
2811 (package (inherit pickleshare)
2812 (propagated-inputs `(("python2-pathlib2" ,python2-pathlib2)
2813 ,@(package-propagated-inputs pickleshare))))))
2814
2815 (define-public python-apsw
2816 (package
2817 (name "python-apsw")
2818 (version "3.31.1-r1")
2819 (source
2820 (origin
2821 (method url-fetch)
2822 (uri (string-append "https://github.com/rogerbinns/apsw/releases"
2823 "/download/" version "/apsw-" version ".zip"))
2824 (sha256
2825 (base32
2826 "1gap5lr6c7bp134nzvfwr693i6d0fqyaysg3ms2cayjldv616yfx"))))
2827 (build-system python-build-system)
2828 (native-inputs
2829 `(("unzip" ,unzip)))
2830 (inputs
2831 `(("sqlite" ,sqlite)))
2832 (arguments
2833 `(#:phases
2834 (modify-phases %standard-phases
2835 (replace 'build
2836 (lambda _
2837 (invoke "python" "setup.py" "build" "--enable-all-extensions")
2838 #t))
2839 (add-after 'build 'build-test-helper
2840 (lambda _
2841 (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext"
2842 "-I." "-Isqlite3" "src/testextension.c")
2843 #t))
2844 (replace 'check
2845 (lambda* (#:key inputs outputs #:allow-other-keys)
2846 (add-installed-pythonpath inputs outputs)
2847 (invoke "python" "setup.py" "test")
2848 #t)))))
2849 (home-page "https://github.com/rogerbinns/apsw/")
2850 (synopsis "Another Python SQLite Wrapper")
2851 (description "APSW is a Python wrapper for the SQLite
2852 embedded relational database engine. In contrast to other wrappers such as
2853 pysqlite it focuses on being a minimal layer over SQLite attempting just to
2854 translate the complete SQLite API into Python.")
2855 (license license:zlib)))
2856
2857 (define-public python2-apsw
2858 (package-with-python2 python-apsw))
2859
2860 (define-public python-aiosqlite
2861 (package
2862 (name "python-aiosqlite")
2863 (version "0.12.0")
2864 (source
2865 (origin
2866 (method url-fetch)
2867 (uri (pypi-uri "aiosqlite" version))
2868 (sha256
2869 (base32
2870 "1w8248yz85xyzvvh4jaxnc59fqil45aka6h82kn1rcih4rjxbnn1"))))
2871 (build-system python-build-system)
2872 (native-inputs
2873 `(("python-aiounittest" ,python-aiounittest)))
2874 (home-page "https://github.com/jreese/aiosqlite")
2875 (synopsis
2876 "Asyncio bridge for sqlite3")
2877 (description
2878 "The package aiosqlite replicates the standard sqlite3 module, but with
2879 async versions of all the standard connection and cursor methods, and context
2880 managers for automatically closing connections.")
2881 (license license:expat)))
2882
2883 (define-public python2-neo4j-driver
2884 (package
2885 (name "python2-neo4j-driver")
2886 ;; NOTE: When upgrading to 1.5.0, please add a python3 variant.
2887 (version "1.4.0")
2888 (source (origin
2889 (method url-fetch)
2890 (uri (pypi-uri "neo4j-driver" version))
2891 (sha256
2892 (base32
2893 "011r1vh182p8mm83d8dz9rfnc3l7rf7fd00cyrbyfzi71jmc4g98"))))
2894 (build-system python-build-system)
2895 (arguments
2896 `(#:python ,python-2))
2897 (home-page "https://neo4j.com/developer/python/")
2898 (synopsis "Neo4j driver code written in Python")
2899 (description "This package provides the Neo4j Python driver that connects
2900 to the database using Neo4j's binary protocol. It aims to be minimal, while
2901 being idiomatic to Python.")
2902 (license license:asl2.0)))
2903
2904 (define-public python2-py2neo
2905 (package
2906 (name "python2-py2neo")
2907 (version "3.1.2")
2908 (source (origin
2909 (method url-fetch)
2910 (uri (pypi-uri "py2neo" version))
2911 (sha256
2912 (base32
2913 "1f1q95vqcvlc3nsc33p841swnjdcjazddlq2dzi3qfnjqjrajxw1"))))
2914 (build-system python-build-system)
2915 (arguments
2916 `(#:python ,python-2))
2917 (home-page "https://py2neo.org")
2918 (synopsis "Library and toolkit for working with Neo4j in Python")
2919 (description "This package provides a client library and toolkit for
2920 working with Neo4j from within Python applications and from the command
2921 line. The core library has no external dependencies and has been carefully
2922 designed to be easy and intuitive to use.")
2923 (license license:asl2.0)))
2924
2925 (define-public python-psycopg2
2926 (package
2927 (name "python-psycopg2")
2928 (version "2.8.6")
2929 (source
2930 (origin
2931 (method url-fetch)
2932 (uri (pypi-uri "psycopg2" version))
2933 (sha256
2934 (base32 "0hzmk6b1hb5riqkljr5xics6p4zbvmis6knbczb7zhq7273zc8zv"))))
2935 (build-system python-build-system)
2936 (arguments
2937 ;; Tests would require a postgresql database "psycopg2_test"
2938 ;; and a running postgresql database management service.
2939 `(#:tests? #f)) ; TODO re-enable after providing a test-db.
2940 (inputs
2941 `(("postgresql" ,postgresql))) ; libpq
2942 (home-page "http://initd.org/psycopg/")
2943 (synopsis "Python PostgreSQL adapter")
2944 (description
2945 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
2946 2.0.")
2947 (license license:lgpl3+)))
2948
2949 (define-public python2-psycopg2
2950 (package-with-python2 python-psycopg2))
2951
2952 (define-public python-sadisplay
2953 (package
2954 (name "python-sadisplay")
2955 (version "0.4.8")
2956 (source
2957 (origin
2958 (method url-fetch)
2959 (uri (pypi-uri "sadisplay" version))
2960 (sha256
2961 (base32
2962 "01d9lxhmgpb68gy8rd6zj6fcwp84n2qq210n1qsk3qbsir79bzh4"))))
2963 (build-system python-build-system)
2964 (propagated-inputs
2965 `(("python-sqlalchemy" ,python-sqlalchemy)))
2966 (native-inputs
2967 ;; For tests.
2968 `(("python-nose" ,python-nose)))
2969 (home-page "https://bitbucket.org/estin/sadisplay")
2970 (synopsis "SQLAlchemy schema displayer")
2971 (description "This package provides a program to build Entity
2972 Relationship diagrams from a SQLAlchemy model (or directly from the
2973 database).")
2974 (license license:bsd-3)))
2975
2976 (define-public python2-sadisplay
2977 (package-with-python2 python-sadisplay))
2978
2979 (define-public python-mysqlclient
2980 (package
2981 (name "python-mysqlclient")
2982 (version "2.0.1")
2983 (source
2984 (origin
2985 (method url-fetch)
2986 (uri (pypi-uri "mysqlclient" version))
2987 (sha256
2988 (base32
2989 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
2990 (build-system python-build-system)
2991 (arguments '(#:tests? #f)) ;XXX: requires a live database
2992 (inputs
2993 `(("mysql" ,mariadb "lib")
2994 ("mysql-dev" ,mariadb "dev")))
2995 (home-page "https://github.com/PyMySQL/mysqlclient-python")
2996 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
2997 (description "MySQLdb is an interface to the popular MySQL database server
2998 for Python. The design goals are:
2999 @enumerate
3000 @item Compliance with Python database API version 2.0 [PEP-0249],
3001 @item Thread-safety,
3002 @item Thread-friendliness (threads will not block each other).
3003 @end enumerate")
3004 (license license:gpl2)))
3005
3006 (define-public python-hiredis
3007 (package
3008 (name "python-hiredis")
3009 (version "0.2.0")
3010 (source
3011 (origin
3012 (method url-fetch)
3013 (uri (pypi-uri "hiredis" version))
3014 (sha256
3015 (base32
3016 "1dfm2k9l9zar9nw9fwmm74zrgraxdxs04vx9li56fjcf289qx5fa"))))
3017 (build-system python-build-system)
3018 (arguments
3019 ;; no tests
3020 `(#:tests? #f))
3021 (home-page "https://github.com/redis/hiredis-py")
3022 (synopsis "Python extension that wraps protocol parsing code in hiredis")
3023 (description "Python-hiredis is a python extension that wraps protocol
3024 parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
3025 (license license:bsd-3)))
3026
3027 (define-public python2-hiredis
3028 (package-with-python2 python-hiredis))
3029
3030 (define-public python-fakeredis
3031 (package
3032 (name "python-fakeredis")
3033 (version "1.2.1")
3034 (source
3035 (origin
3036 (method url-fetch)
3037 (uri (pypi-uri "fakeredis" version))
3038 (sha256
3039 (base32
3040 "1s12mn4q4hz7402139khn9fx56kibj7nn0d6w81hn0zs07b90wpc"))))
3041 (build-system python-build-system)
3042 (arguments
3043 ;; no tests
3044 `(#:tests? #f))
3045 (propagated-inputs
3046 `(("python-sortedcontainers" ,python-sortedcontainers)))
3047 (home-page "https://github.com/jamesls/fakeredis")
3048 (synopsis "Fake implementation of redis API for testing purposes")
3049 (description
3050 "Fakeredis is a pure-Python implementation of the redis-py Python client
3051 that simulates talking to a redis server. It was created for a single purpose:
3052 to write unit tests.
3053
3054 Setting up redis is not hard, but one often wants to write unit tests that don't
3055 talk to an external server such as redis. This module can be used as a
3056 reasonable substitute.")
3057 (license license:bsd-3)))
3058
3059 (define-public python2-fakeredis
3060 (package-with-python2 python-fakeredis))
3061
3062 (define-public python-redis
3063 (package
3064 (name "python-redis")
3065 (version "3.5.3")
3066 (source
3067 (origin
3068 (method url-fetch)
3069 (uri (pypi-uri "redis" version))
3070 (sha256
3071 (base32 "18h5b87g15x3j6pb1h2q27ri37p2qpvc9n2wgn5yl3b6m3y0qzhf"))))
3072 (build-system python-build-system)
3073 ;; Tests require a running Redis server.
3074 (arguments '(#:tests? #f))
3075 ;; As long as we are not running test, we do not need this input :-)
3076 ;;(native-inputs
3077 ;; `(("python-pytest" ,python-pytest)))
3078 (home-page "https://github.com/andymccurdy/redis-py")
3079 (synopsis "Redis Python client")
3080 (description
3081 "This package provides a Python interface to the Redis key-value store.")
3082 (license license:expat)))
3083
3084 (define-public python2-redis
3085 (package-with-python2 python-redis))
3086
3087 (define-public python-rq
3088 (package
3089 (name "python-rq")
3090 (version "1.5.2")
3091 (source
3092 (origin
3093 (method git-fetch)
3094 (uri (git-reference
3095 (url "https://github.com/rq/rq")
3096 (commit (string-append "v" version))))
3097 (file-name (git-file-name name version))
3098 (sha256
3099 (base32 "0ikqmpq0g1qiqwd7ar1286l4hqjb6aj2wr844gihhb8ijzwhp8va"))))
3100 (build-system python-build-system)
3101 (arguments
3102 '(#:phases (modify-phases %standard-phases
3103 (add-before 'check 'start-redis
3104 (lambda _
3105 (invoke "redis-server" "--daemonize" "yes")))
3106 (replace 'check
3107 (lambda* (#:key outputs #:allow-other-keys)
3108 (let ((out (assoc-ref outputs "out")))
3109 ;; Drop test that needs the SDK for Sentry.io.
3110 (delete-file "tests/test_sentry.py")
3111 ;; Ensure 'rq' and 'rqworker' ends up on PATH.
3112 (setenv "PATH" (string-append out "/bin:"
3113 (getenv "PATH")))
3114 (invoke "pytest" "-vv")))))))
3115 (native-inputs
3116 `(("python-mock" ,python-mock)
3117 ("python-pytest" ,python-pytest)
3118 ("redis" ,redis)))
3119 (propagated-inputs
3120 `(("python-click" ,python-click)
3121 ("python-redis" ,python-redis)))
3122 (home-page "https://python-rq.org/")
3123 (synopsis "Simple job queues for Python")
3124 (description
3125 "RQ (Redis Queue) is a simple Python library for queueing jobs and
3126 processing them in the background with workers. It is backed by Redis and it
3127 is designed to have a low barrier to entry.")
3128 (license license:bsd-2)))
3129
3130 (define-public python2-rq
3131 (package-with-python2 python-rq))
3132
3133 (define-public python-rq-scheduler
3134 (package
3135 (name "python-rq-scheduler")
3136 (version "0.10.0")
3137 (home-page "https://github.com/rq/rq-scheduler")
3138 (source (origin
3139 (method git-fetch)
3140 (uri (git-reference
3141 (url home-page)
3142 (commit (string-append "v" version))))
3143 (file-name (git-file-name name version))
3144 (sha256
3145 (base32
3146 "0xg6yazqs5kbr2ayvhvljs1h5vgx5k5dds613fmhswln7gglf9hk"))))
3147 (build-system python-build-system)
3148 (arguments
3149 '(#:phases (modify-phases %standard-phases
3150 (add-before 'check 'start-redis
3151 (lambda _
3152 (invoke "redis-server" "--daemonize" "yes")))
3153 (replace 'check
3154 (lambda _
3155 (substitute* "run_tests.py"
3156 (("/usr/bin/env")
3157 (which "env")))
3158 (invoke "./run_tests.py"))))))
3159 (native-inputs
3160 `(("redis" ,redis)
3161 ("which" ,which)))
3162 (propagated-inputs
3163 `(("python-croniter" ,python-croniter)
3164 ("python-rq" ,python-rq)))
3165 (synopsis "Job scheduling capabilities for RQ (Redis Queue)")
3166 (description
3167 "This package provides job scheduling capabilities to @code{python-rq}
3168 (Redis Queue).")
3169 (license license:expat)))
3170
3171 (define-public python-trollius-redis
3172 (package
3173 (name "python-trollius-redis")
3174 (version "0.1.4")
3175 (source
3176 (origin
3177 (method url-fetch)
3178 (uri (pypi-uri "trollius_redis" version))
3179 (sha256
3180 (base32
3181 "0k3vypszmgmaipgw9xscvgm79h2zd6p6ci8gdp5sxl6g5kbqr9fy"))))
3182 (build-system python-build-system)
3183 ;; TODO: Tests require packaging 'hiredis'.
3184 (arguments '(#:tests? #f))
3185 (home-page "https://github.com/benjolitz/trollius-redis")
3186 (synopsis "Port of asyncio-redis to trollius")
3187 (description "@code{trollius-redis} is a Redis client for Python
3188 trollius. It is an asynchronous IO (PEP 3156) implementation of the
3189 Redis protocol.")
3190 (license license:bsd-2)))
3191
3192 (define-public python2-trollius-redis
3193 (package-with-python2 python-trollius-redis))
3194
3195 (define-public python-sqlparse
3196 (package
3197 (name "python-sqlparse")
3198 (version "0.3.1")
3199 (source (origin
3200 (method url-fetch)
3201 (uri (pypi-uri "sqlparse" version))
3202 (sha256
3203 (base32
3204 "0j652a6z7bdf6c77aczfn8m8b2nsr1bcqq48wzghf8vi6wvj0qp1"))))
3205 (build-system python-build-system)
3206 (arguments
3207 `(#:phases
3208 (modify-phases %standard-phases
3209 (replace 'check
3210 (lambda _ (invoke "py.test"))))))
3211 (native-inputs
3212 `(("python-pytest" ,python-pytest)))
3213 (home-page "https://github.com/andialbrecht/sqlparse")
3214 (synopsis "Non-validating SQL parser")
3215 (description "Sqlparse is a non-validating SQL parser for Python. It
3216 provides support for parsing, splitting and formatting SQL statements.")
3217 (license license:bsd-3)))
3218
3219 (define-public python2-sqlparse
3220 (package-with-python2 python-sqlparse))
3221
3222 (define-public python-sql
3223 (package
3224 (name "python-sql")
3225 (version "1.0.0")
3226 (source
3227 (origin
3228 (method url-fetch)
3229 (uri (pypi-uri "python-sql" version))
3230 (sha256
3231 (base32 "05ni936y0ia9xmryl7mlhbj9i80nnvq1bi4zxhb96rv7yvpb3fqb"))))
3232 (build-system python-build-system)
3233 (home-page "https://python-sql.tryton.org/")
3234 (synopsis "Library to write SQL queries in a pythonic way")
3235 (description "@code{python-sql} is a library to write SQL queries, that
3236 transforms idiomatic python function calls to well-formed SQL queries.")
3237 (license license:bsd-3)))
3238
3239 (define-public python2-sql
3240 (package-with-python2 python-sql))
3241
3242 (define-public python-pypika
3243 (package
3244 (name "python-pypika")
3245 (version "0.37.2")
3246 (source
3247 (origin (method git-fetch)
3248 (uri (git-reference
3249 (url "https://github.com/kayak/pypika")
3250 (commit (string-append "v" version))))
3251 (file-name (git-file-name name version))
3252 (sha256
3253 (base32
3254 "089z1c778q1fwhzsc88ws8j5gm2hgxknibabn4wpax8rz2bfs3ck"))))
3255 (build-system python-build-system)
3256 (native-inputs
3257 `(("python-parameterized" ,python-parameterized)))
3258 (home-page "https://github.com/kayak/pypika")
3259 (synopsis "SQL query builder API for Python")
3260 (description
3261 "PyPika is a python SQL query builder that exposes the full richness of
3262 the SQL language using a syntax that reflects the resulting query.")
3263 (license license:asl2.0)))
3264
3265 (define-public mongo-tools
3266 (package
3267 (name "mongo-tools")
3268 (version "3.4.0")
3269 (source
3270 (origin (method git-fetch)
3271 (uri (git-reference
3272 (url "https://github.com/mongodb/mongo-tools")
3273 (commit (string-append "r" version))))
3274 (file-name (git-file-name name version))
3275 (sha256
3276 (base32
3277 "1bcsz5cvj39a7nsxsfqmz9igrw33j6yli9kffigqyscs52amw7x1"))))
3278 (build-system go-build-system)
3279 (arguments
3280 `(#:import-path "github.com/mongodb/mongo-tools"
3281 #:modules ((srfi srfi-1)
3282 (guix build go-build-system)
3283 (guix build utils))
3284 #:install-source? #f
3285 #:phases
3286 (let ((all-tools
3287 '("bsondump" "mongodump" "mongoexport" "mongofiles"
3288 "mongoimport" "mongooplog" "mongorestore"
3289 "mongostat" "mongotop")))
3290 (modify-phases %standard-phases
3291 (add-after 'unpack 'delete-bundled-source-code
3292 (lambda _
3293 (delete-file-recursively
3294 "src/github.com/mongodb/mongo-tools/vendor")
3295 #t))
3296 (add-after 'delete-bundled-source-code 'patch-source
3297 (lambda _
3298 ;; Remove a redundant argument that causes compilation to fail.
3299 (substitute*
3300 "src/github.com/mongodb/mongo-tools/mongorestore/filepath.go"
3301 (("skipping restore of system.profile collection\", db)")
3302 "skipping restore of system.profile collection\")"))
3303 #t))
3304 (replace 'build
3305 (lambda _
3306 (for-each (lambda (tool)
3307 (let ((command
3308 `("go" "build"
3309 ;; This is where the tests expect to find the
3310 ;; executables
3311 "-o" ,(string-append
3312 "src/github.com/mongodb/mongo-tools/bin/"
3313 tool)
3314 "-v"
3315 "-tags=\"ssl sasl\""
3316 "-ldflags"
3317 "-extldflags=-Wl,-z,now,-z,relro"
3318 ,(string-append
3319 "src/github.com/mongodb/mongo-tools/"
3320 tool "/main/" tool ".go"))))
3321 (simple-format #t "build: running ~A\n"
3322 (string-join command))
3323 (apply invoke command)))
3324 all-tools)
3325 #t))
3326 (replace 'check
3327 (lambda _
3328 (with-directory-excursion "src"
3329 (for-each (lambda (tool)
3330 (invoke
3331 "go" "test" "-v"
3332 (string-append "github.com/mongodb/mongo-tools/"
3333 tool)))
3334 all-tools))
3335 #t))
3336 (replace 'install
3337 (lambda* (#:key outputs #:allow-other-keys)
3338 (for-each (lambda (tool)
3339 (install-file
3340 (string-append "src/github.com/mongodb/mongo-tools/bin/"
3341 tool)
3342 (string-append (assoc-ref outputs "out")
3343 "/bin")))
3344 all-tools)
3345 #t))))))
3346 (native-inputs
3347 `(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
3348 ("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)
3349 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
3350 ("go-gopkg.in-mgo.v2" ,go-gopkg.in-mgo.v2)
3351 ("go-gopkg.in-tomb.v2" ,go-gopkg.in-tomb.v2)
3352 ("go-github.com-nsf-termbox-go" ,go-github.com-nsf-termbox-go)
3353 ("go-github.com-smartystreets-goconvey" ,go-github.com-smartystreets-goconvey)))
3354 (home-page "https://github.com/mongodb/mongo-tools")
3355 (synopsis "Various tools for interacting with MongoDB and BSON")
3356 (description
3357 "This package includes a collection of tools related to MongoDB.
3358 @table @code
3359 @item bsondump
3360 Display BSON files in a human-readable format
3361 @item mongoimport
3362 Convert data from JSON, TSV or CSV and insert them into a collection
3363 @item mongoexport
3364 Write an existing collection to CSV or JSON format
3365 @item mongodump/mongorestore
3366 Dump MongoDB backups to disk in the BSON format
3367 @item mongorestore
3368 Read MongoDB backups in the BSON format, and restore them to a live database
3369 @item mongostat
3370 Monitor live MongoDB servers, replica sets, or sharded clusters
3371 @item mongofiles
3372 Read, write, delete, or update files in GridFS
3373 @item mongooplog
3374 Replay oplog entries between MongoDB servers
3375 @item mongotop
3376 Monitor read/write activity on a mongo server
3377 @end table")
3378 (license license:asl2.0)))
3379
3380 ;; There are many wrappers for this in other languages. When touching, please
3381 ;; be sure to ensure all dependencies continue to build.
3382 (define-public apache-arrow
3383 (package
3384 (name "apache-arrow")
3385 (version "0.17.1")
3386 (source
3387 (origin
3388 (method git-fetch)
3389 (uri (git-reference
3390 (url "https://github.com/apache/arrow")
3391 (commit (string-append "apache-arrow-" version))))
3392 (file-name (git-file-name name version))
3393 (sha256
3394 (base32
3395 "02r6yx3yhywzikd3b0vfkjgddhfiriyx2vpm3jf5880wq59x798a"))))
3396 (build-system cmake-build-system)
3397 (arguments
3398 `(#:tests? #f
3399 #:phases
3400 (modify-phases %standard-phases
3401 (add-before 'configure 'enter-source-directory
3402 (lambda _ (chdir "cpp") #t))
3403 (add-after 'unpack 'set-env
3404 (lambda _
3405 (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
3406 (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
3407 (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
3408 (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson"))
3409 #t)))
3410 #:build-type "Release"
3411 #:configure-flags
3412 (list "-DARROW_PYTHON=ON"
3413 "-DARROW_GLOG=ON"
3414 ;; Parquet options
3415 "-DARROW_PARQUET=ON"
3416 "-DPARQUET_BUILD_EXECUTABLES=ON"
3417 ;; The maintainers disallow using system versions of
3418 ;; jemalloc:
3419 ;; https://issues.apache.org/jira/browse/ARROW-3507. This
3420 ;; is unfortunate because jemalloc increases performance:
3421 ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/.
3422 "-DARROW_JEMALLOC=OFF"
3423
3424 ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global
3425 ;; option that instructs the build system how to resolve
3426 ;; each dependency. SYSTEM = Finding the dependency in
3427 ;; system paths using CMake's built-in find_package
3428 ;; function, or using pkg-config for packages that do not
3429 ;; have this feature
3430 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
3431
3432 ;; Split output into its component packages.
3433 (string-append "-DCMAKE_INSTALL_PREFIX="
3434 (assoc-ref %outputs "lib"))
3435 (string-append "-DCMAKE_INSTALL_RPATH="
3436 (assoc-ref %outputs "lib")
3437 "/lib")
3438 (string-append "-DCMAKE_INSTALL_BINDIR="
3439 (assoc-ref %outputs "out")
3440 "/bin")
3441 (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
3442 (assoc-ref %outputs "include")
3443 "/share/include")
3444
3445
3446 "-DARROW_WITH_SNAPPY=ON"
3447 "-DARROW_WITH_ZLIB=ON"
3448 "-DARROW_WITH_ZSTD=ON"
3449 "-DARROW_WITH_LZ4=ON"
3450 "-DARROW_COMPUTE=ON"
3451 "-DARROW_CSV=ON"
3452 "-DARROW_DATASET=ON"
3453 "-DARROW_FILESYSTEM=ON"
3454 "-DARROW_HDFS=ON"
3455 "-DARROW_JSON=ON"
3456 ;; Arrow Python C++ integration library (required for
3457 ;; building pyarrow). This library must be built against
3458 ;; the same Python version for which you are building
3459 ;; pyarrow. NumPy must also be installed. Enabling this
3460 ;; option also enables ARROW_COMPUTE, ARROW_CSV,
3461 ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and
3462 ;; ARROW_JSON.
3463 "-DARROW_PYTHON=ON"
3464
3465 ;; Building the tests forces on all the
3466 ;; optional features and the use of static
3467 ;; libraries.
3468 "-DARROW_BUILD_TESTS=OFF"
3469 "-DBENCHMARK_ENABLE_GTEST_TESTS=OFF"
3470 ;;"-DBENCHMARK_ENABLE_TESTING=OFF"
3471 "-DARROW_BUILD_STATIC=OFF")))
3472 (inputs
3473 `(("boost" ,boost)
3474 ("brotli" ,google-brotli)
3475 ("double-conversion" ,double-conversion)
3476 ("snappy" ,snappy)
3477 ("gflags" ,gflags)
3478 ("glog" ,glog)
3479 ("apache-thrift" ,apache-thrift "lib")
3480 ("protobuf" ,protobuf)
3481 ("rapidjson" ,rapidjson)
3482 ("zlib" ,zlib)
3483 ("bzip2" ,bzip2)
3484 ("lz4" ,lz4)
3485 ("zstd" ,zstd "lib")
3486 ("re2" ,re2)
3487 ("grpc" ,grpc)
3488 ("python-3" ,python)
3489 ("python-numpy" ,python-numpy)))
3490 (native-inputs
3491 `(("pkg-config" ,pkg-config)))
3492 (outputs '("out" "lib" "include"))
3493 (home-page "https://arrow.apache.org/")
3494 (synopsis "Columnar in-memory analytics")
3495 (description "Apache Arrow is a columnar in-memory analytics layer
3496 designed to accelerate big data. It houses a set of canonical in-memory
3497 representations of flat and hierarchical data along with multiple
3498 language-bindings for structure manipulation. It also provides IPC and common
3499 algorithm implementations.")
3500 (license license:asl2.0)))
3501
3502 (define-public python-pyarrow
3503 (package
3504 (inherit apache-arrow)
3505 (name "python-pyarrow")
3506 (build-system python-build-system)
3507 (arguments
3508 '(#:tests? #f ; XXX There are no tests in the "python" directory
3509 #:phases
3510 (modify-phases %standard-phases
3511 (delete 'build) ; XXX the build is performed again during the install phase
3512 (add-after 'unpack 'enter-source-directory
3513 (lambda _ (chdir "python") #t))
3514 (add-after 'unpack 'make-git-checkout-writable
3515 (lambda _
3516 (for-each make-file-writable (find-files "."))
3517 #t)))))
3518 (propagated-inputs
3519 `(("apache-arrow" ,apache-arrow "lib")
3520 ("python-numpy" ,python-numpy)
3521 ("python-pandas" ,python-pandas)
3522 ("python-six" ,python-six)))
3523 (native-inputs
3524 `(("cmake" ,cmake-minimal)
3525 ("pkg-config" ,pkg-config)
3526 ("python-cython" ,python-cython)
3527 ("python-pytest" ,python-pytest)
3528 ("python-pytest-runner" ,python-pytest-runner)
3529 ("python-setuptools-scm" ,python-setuptools-scm)))
3530 (outputs '("out"))
3531 (home-page "https://arrow.apache.org/docs/python/")
3532 (synopsis "Python bindings for Apache Arrow")
3533 (description
3534 "This library provides a Pythonic API wrapper for the reference Arrow C++
3535 implementation, along with tools for interoperability with pandas, NumPy, and
3536 other traditional Python scientific computing packages.")
3537 (license license:asl2.0)))
3538
3539 (define-public python2-pyarrow
3540 (package-with-python2 python-pyarrow))
3541
3542 (define-public python-crate
3543 (package
3544 (name "python-crate")
3545 (version "0.23.2")
3546 (source (origin
3547 (method url-fetch)
3548 (uri (pypi-uri "crate" version))
3549 (sha256
3550 (base32
3551 "0ngmlvi320c5gsxab0s7qgq0ck4jdlcwvb6lbjhnfprafdp56vvx"))))
3552 (build-system python-build-system)
3553 (propagated-inputs
3554 `(("python-urllib3" ,python-urllib3)))
3555 (home-page "https://github.com/crate/crate-python")
3556 (synopsis "CrateDB Python client")
3557 (description
3558 "This package provides a Python client library for CrateDB.
3559 It implements the Python DB API 2.0 specification and includes support for
3560 SQLAlchemy.")
3561 (license license:asl2.0)))
3562
3563 (define-public libdbi
3564 (package
3565 (name "libdbi")
3566 (version "0.9.0")
3567 (source (origin
3568 (method url-fetch)
3569 (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-"
3570 version "/libdbi-" version ".tar.gz"))
3571 (sha256
3572 (base32
3573 "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
3574 (build-system gnu-build-system)
3575 (synopsis "Database independent abstraction layer in C")
3576 (description
3577 "This library implements a database independent abstraction layer in C,
3578 similar to the DBI/DBD layer in Perl. Writing one generic set of code,
3579 programmers can leverage the power of multiple databases and multiple
3580 simultaneous database connections by using this framework.")
3581 (home-page "http://libdbi.sourceforge.net/")
3582 (license license:lgpl2.1+)))
3583
3584 (define-public libdbi-drivers
3585 (package
3586 (name "libdbi-drivers")
3587 (version "0.9.0")
3588 (source (origin
3589 (method url-fetch)
3590 (uri (string-append "mirror://sourceforge/libdbi-drivers/"
3591 "libdbi-drivers/libdbi-drivers-" version
3592 "/libdbi-drivers-" version ".tar.gz"))
3593 (sha256
3594 (base32
3595 "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
3596 (build-system gnu-build-system)
3597 (native-inputs
3598 `(;; For tests.
3599 ("inetutils" ,inetutils)
3600 ("glibc-locales" ,glibc-locales)
3601 ("mariadb" ,mariadb)))
3602 (inputs
3603 `(("libdbi" ,libdbi)
3604 ("mariadb:dev" ,mariadb "dev")
3605 ("mariadb:lib" ,mariadb "lib")
3606 ("postgresql" ,postgresql)
3607 ("sqlite" ,sqlite)))
3608 (arguments
3609 `(#:configure-flags
3610 (let ((libdbi (assoc-ref %build-inputs "libdbi"))
3611 (mysql:inc (assoc-ref %build-inputs "mariadb:dev"))
3612 (mysql:lib (assoc-ref %build-inputs "mariadb:lib"))
3613 (postgresql (assoc-ref %build-inputs "postgresql"))
3614 (sqlite (assoc-ref %build-inputs "sqlite")))
3615 (list "--disable-docs"
3616 (string-append "--with-dbi-incdir=" libdbi "/include")
3617 (string-append "--with-dbi-libdir=" libdbi "/lib")
3618 "--with-mysql"
3619 (string-append "--with-mysql-incdir=" mysql:inc "/include/mysql")
3620 (string-append "--with-mysql-libdir=" mysql:lib "/lib")
3621 "--with-pgsql"
3622 (string-append "--with-pgsql-incdir=" postgresql "/include")
3623 (string-append "--with-pgsql-libdir=" postgresql "/lib")
3624 "--with-sqlite3"
3625 (string-append "--with-sqlite-incdir=" sqlite "/include")
3626 (string-append "--with-sqlite-libdir=" sqlite "/lib")))
3627 #:phases
3628 (modify-phases %standard-phases
3629 (add-after 'unpack 'fix-tests
3630 (lambda* (#:key inputs #:allow-other-keys)
3631 (substitute* "tests/test_mysql.sh"
3632 (("^MYMYSQLD=.*")
3633 (string-append "MYMYSQLD="
3634 (assoc-ref inputs "mariadb")
3635 "/bin/mysqld")))
3636 #t))
3637 (add-after 'install 'remove-empty-directories
3638 (lambda* (#:key outputs #:allow-other-keys)
3639 (let ((var (string-append (assoc-ref outputs "out") "/var")))
3640 (delete-file-recursively var))
3641 #t)))))
3642 (synopsis "Database drivers for the libdbi framework")
3643 (description
3644 "The @code{libdbi-drivers} library provides the database specific drivers
3645 for the @code{libdbi} framework.
3646
3647 The drivers officially supported by @code{libdbi} are:
3648 @itemize
3649 @item MySQL,
3650 @item PostgreSQL,
3651 @item SQLite.
3652 @end itemize")
3653 (home-page "http://libdbi-drivers.sourceforge.net/")
3654 (license license:lgpl2.1+)))
3655
3656 (define-public soci
3657 (package
3658 (name "soci")
3659 (version "4.0.0")
3660 (source (origin
3661 (method git-fetch)
3662 (uri (git-reference
3663 (url "https://github.com/SOCI/soci/")
3664 (commit version)))
3665 (file-name (git-file-name name version))
3666 (sha256
3667 (base32
3668 "06faswdxd2frqr9xnx6bxc7zwarlzsbdi3bqpz7kwdxsjvq41rnb"))))
3669 (build-system cmake-build-system)
3670 (inputs
3671 `(("postgresql" ,postgresql)
3672 ("sqlite" ,sqlite)
3673 ("odbc" ,unixodbc)
3674 ("boost" ,boost)
3675 ("mariadb:dev" ,mariadb "dev")
3676 ("mariadb:lib" ,mariadb "lib")))
3677 (arguments
3678 `(#:tests? #f ; Tests may require running database management systems.
3679 #:phases
3680 (modify-phases %standard-phases
3681 (add-after 'unpack 'fix-lib-path
3682 (lambda _
3683 (substitute* "CMakeLists.txt"
3684 (("set\\(SOCI_LIBDIR \"lib64\"\\)") ""))
3685 #t)))))
3686 (synopsis "C++ Database Access Library")
3687 (description
3688 "SOCI is an abstraction layer for several database backends, including
3689 PostreSQL, SQLite, ODBC and MySQL.")
3690 (home-page "http://soci.sourceforge.net/")
3691 (license license:boost1.0)))