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