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