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