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