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