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