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