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