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