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