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