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