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