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