gnu: python-tortoise-orm: Fix dependencies.
[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 (("pytz>=2020\\.4,<2021\\.0") "pytz")
2474 ;; Not required, since ciso8601 is used.
2475 (("'iso8601>=0\\.1\\.13,<0\\.2\\.0',") ""))
2476 #t)))))
2477 (native-inputs
2478 `(("python-asynctest" ,python-asynctest)
2479 ("python-nose2" ,python-nose2)))
2480 (propagated-inputs
2481 `(("python-aiosqlite" ,python-aiosqlite)
2482 ("python-pypika" ,python-pypika)
2483 ("python-ciso8601" ,python-ciso8601)
2484 ("python-pytz" ,python-pytz)
2485 ("python-typing-extensions"
2486 ,python-typing-extensions)))
2487 (home-page
2488 "https://github.com/tortoise/tortoise-orm")
2489 (synopsis
2490 "Easy async ORM for python, built with relations in mind")
2491 (description
2492 "Tortoise ORM is an easy-to-use asyncio ORM (Object Relational Mapper)
2493 inspired by Django. Tortoise ORM was build with relations in mind and
2494 admiration for the excellent and popular Django ORM. It’s engraved in its
2495 design that you are working not with just tables, you work with relational
2496 data.")
2497 (license license:asl2.0)))
2498
2499 (define-public sqlcipher
2500 (package
2501 (name "sqlcipher")
2502 (version "3.4.2")
2503 (source
2504 (origin
2505 (method url-fetch)
2506 (uri (string-append "https://github.com/sqlcipher/" name
2507 "/archive/v" version ".tar.gz"))
2508 (sha256
2509 (base32 "1nxarwbci8jx99f1d0y1ivxcv25s78l1p7q6qy28lkpkcx8pm2b9"))
2510 (file-name (string-append name "-" version ".tar.gz"))))
2511 (build-system gnu-build-system)
2512 (inputs
2513 `(("libcrypto" ,openssl)
2514 ("libtcl8.6" ,tcl))) ; required for running the tests
2515 (native-inputs
2516 `(("tcl" ,tcl)))
2517 (arguments
2518 '(#:configure-flags
2519 '("--enable-tempstore=yes"
2520 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
2521 "LDFLAGS=-lcrypto -ltcl8.6"
2522 "--disable-tcl")
2523 ;; tests cannot be run from the Makefile
2524 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
2525 #:test-target "testfixture"
2526 #:phases
2527 (modify-phases %standard-phases
2528 (add-before 'check 'build-test-runner
2529 (assoc-ref %standard-phases 'check))
2530 (replace 'check
2531 (lambda _
2532 (invoke "./testfixture" "test/crypto.test"))))))
2533 (home-page "https://www.zetetic.net/sqlcipher/")
2534 (synopsis
2535 "Library providing transparent encryption of SQLite database files")
2536 (description "SQLCipher is an implementation of SQLite, extended to
2537 provide transparent 256-bit AES encryption of database files. Pages are
2538 encrypted before being written to disk and are decrypted when read back. It’s
2539 well suited for protecting embedded application databases and for mobile
2540 development.")
2541 ;; The source files
2542 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
2543 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
2544 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
2545 ;; source files are in the public domain.
2546 (license (list license:public-domain license:bsd-3))))
2547
2548 (define-public python-pyodbc-c
2549 (package
2550 (name "python-pyodbc-c")
2551 (version "3.1.4")
2552 (source
2553 (origin
2554 (method url-fetch)
2555 (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
2556 "archive.tar.gz?ref=v" version))
2557 (sha256
2558 (base32
2559 "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
2560 (file-name (string-append name "-" version ".tar.gz"))))
2561 (build-system python-build-system)
2562 (inputs
2563 `(("unixodbc" ,unixodbc)))
2564 (arguments
2565 `(;; No unit tests exist.
2566 #:tests? #f))
2567 (home-page "https://github.com/mkleehammer/pyodbc")
2568 (synopsis "Python ODBC Library")
2569 (description "@code{python-pyodbc-c} provides a Python DB-API driver
2570 for ODBC.")
2571 (license (license:x11-style "file://LICENSE.TXT"))))
2572
2573 (define-public python2-pyodbc-c
2574 (package-with-python2 python-pyodbc-c))
2575
2576 (define-public python-pyodbc
2577 (package
2578 (name "python-pyodbc")
2579 (version "4.0.30")
2580 (source
2581 (origin
2582 (method url-fetch)
2583 (uri (pypi-uri "pyodbc" version))
2584 (sha256
2585 (base32 "0skjpraar6hcwsy82612bpj8nw016ncyvvq88j5syrikxgp5saw5"))
2586 (file-name (string-append name "-" version ".tar.gz"))))
2587 (build-system python-build-system)
2588 (inputs
2589 `(("unixodbc" ,unixodbc)))
2590 (arguments
2591 `(#:tests? #f)) ; no unit tests exist
2592 (home-page "https://github.com/mkleehammer/pyodbc")
2593 (synopsis "Python ODBC Library")
2594 (description "@code{python-pyodbc} provides a Python DB-API driver
2595 for ODBC.")
2596 (license (license:x11-style "file:///LICENSE.TXT"))))
2597
2598 (define-public python2-pyodbc
2599 (package-with-python2 python-pyodbc))
2600
2601 (define-public mdbtools
2602 (package
2603 (name "mdbtools")
2604 (version "0.7.1")
2605 (source
2606 (origin
2607 (method git-fetch)
2608 (uri (git-reference
2609 (url "https://github.com/brianb/mdbtools")
2610 (commit version)))
2611 (file-name (git-file-name name version))
2612 (sha256
2613 (base32
2614 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
2615 (build-system gnu-build-system)
2616 (inputs
2617 `(("glib" ,glib)))
2618 (native-inputs
2619 `(("autoconf" ,autoconf)
2620 ("automake" ,automake)
2621 ("libtool" ,libtool)
2622 ("pkg-config" ,pkg-config)
2623 ("txt2man" ,txt2man)
2624 ("which" ,which)))
2625 (home-page "http://mdbtools.sourceforge.net/")
2626 (synopsis "Read Microsoft Access databases")
2627 (description "MDB Tools is a set of tools and applications to read the
2628 proprietary MDB file format used in Microsoft's Access database package. This
2629 includes programs to export schema and data from Microsoft's Access database
2630 file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
2631 etc., and an SQL engine for performing simple SQL queries.")
2632 (license (list license:lgpl2.0
2633 license:gpl2+))))
2634
2635 (define-public python-lmdb
2636 (package
2637 (name "python-lmdb")
2638 (version "1.0.0")
2639 (source (origin
2640 (method url-fetch)
2641 (uri (pypi-uri "lmdb" version))
2642 (sha256
2643 (base32
2644 "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1"))
2645 (modules '((guix build utils)))
2646 (snippet
2647 ;; Delete bundled lmdb source files.
2648 '(begin
2649 (for-each delete-file (list "lib/lmdb.h"
2650 "lib/mdb.c"
2651 "lib/midl.c"
2652 "lib/midl.h"))
2653 #t))))
2654 (build-system python-build-system)
2655 (inputs
2656 `(("lmdb" ,lmdb)))
2657 (arguments
2658 `(#:phases
2659 (modify-phases %standard-phases
2660 (add-before 'build 'use-system-lmdb
2661 (lambda* (#:key inputs #:allow-other-keys)
2662 (let ((lmdb (assoc-ref inputs "lmdb")))
2663 (setenv "LMDB_PURE" "set") ; don't apply env-copy-txn.patch
2664 (setenv "LMDB_FORCE_SYSTEM" "set")
2665 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
2666 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
2667 #t))))
2668 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
2669 #:tests? #f))
2670 (home-page "https://github.com/dw/py-lmdb")
2671 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
2672 (description
2673 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
2674 Memory-Mapped Database} (LMDB), a high-performance key-value store.")
2675 (license
2676 (list license:openldap2.8
2677 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
2678 ;; but not actually needed on platforms currently supported by Guix.
2679 license:bsd-3))))
2680
2681 (define-public python-orator
2682 (package
2683 (name "python-orator")
2684 (version "0.9.9")
2685 (source (origin
2686 (method url-fetch)
2687 (uri (pypi-uri "orator" version))
2688 (sha256
2689 (base32
2690 "0mbgybz63ryhr9p1f4glnls5c57jp6il3dw0kf97f3pj80687rvg"))))
2691 (build-system python-build-system)
2692 ;; FIXME: Tests are not distributed with PyPI, and the repository
2693 ;; does not contain setup.py. How to test?
2694 (arguments '(#:tests? #f))
2695 (propagated-inputs
2696 `(("python-backpack" ,python-backpack)
2697 ("python-blinker" ,python-blinker)
2698 ("python-cleo" ,python-cleo)
2699 ("python-faker" ,python-faker)
2700 ("python-inflection" ,python-inflection)
2701 ("python-lazy-object-proxy" ,python-lazy-object-proxy)
2702 ("python-pendulum" ,python-pendulum)
2703 ("python-pyaml" ,python-pyaml)
2704 ("python-pygments" ,python-pygments)
2705 ("python-pyyaml" ,python-pyyaml)
2706 ("python-simplejson" ,python-simplejson)
2707 ("python-six" ,python-six)
2708 ("python-wrapt" ,python-wrapt)))
2709 (home-page "https://orator-orm.com/")
2710 (synopsis "ActiveRecord ORM for Python")
2711 (description
2712 "Orator provides a simple ActiveRecord-like Object Relational Mapping
2713 implementation for Python.")
2714 (license license:expat)
2715 (properties `((python2-variant . ,(delay python2-orator))))))
2716
2717 (define-public python2-orator
2718 (package-with-python2 (strip-python2-variant python-orator)))
2719
2720 (define-public virtuoso-ose
2721 (package
2722 (name "virtuoso-ose")
2723 (version "7.2.5")
2724 (source
2725 (origin
2726 (method url-fetch)
2727 (uri (string-append
2728 "https://github.com/openlink/virtuoso-opensource/releases/"
2729 "download/v" version "/virtuoso-opensource-" version ".tar.gz"))
2730 (sha256
2731 (base32 "0r1xakclkfi69pzh8z2k16z3x0m49pxp764icj0ad4w4bb97fr42"))))
2732 (build-system gnu-build-system)
2733 (arguments
2734 `(#:tests? #f ; Tests require a network connection.
2735 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
2736 ;; This indicates that the internal zlib code may still be used.
2737 #:configure-flags '("--without-internal-zlib"
2738 "--with-readline"
2739 "--enable-static=no")
2740 #:phases
2741 (modify-phases %standard-phases
2742 ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in
2743 ;; the build output. The following phase removes it.
2744 (add-after 'install 'remove-static-libs
2745 (lambda* (#:key outputs #:allow-other-keys)
2746 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2747 (for-each (lambda (file)
2748 (delete-file (string-append lib "/" file)))
2749 '("libvirtuoso-t.a"
2750 "libvirtuoso-t.la"))))))))
2751 (inputs
2752 `(("openssl" ,openssl-1.0)
2753 ("net-tools" ,net-tools)
2754 ("readline" ,readline)
2755 ("zlib" ,zlib)))
2756 (home-page "http://vos.openlinksw.com/owiki/wiki/VOS/")
2757 (synopsis "Multi-model database system")
2758 (description "Virtuoso is a scalable cross-platform server that combines
2759 relational, graph, and document data management with web application server
2760 and web services platform functionality.")
2761 ;; configure: error: ... can only be build on 64bit platforms
2762 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))
2763 (license license:gpl2)))
2764
2765 (define-public python-ccm
2766 (package
2767 (name "python-ccm")
2768 (version "2.1.6")
2769 (source
2770 (origin
2771 (method url-fetch)
2772 (uri (pypi-uri "ccm" version))
2773 (sha256
2774 (base32
2775 "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n"))))
2776 (build-system python-build-system)
2777 (propagated-inputs
2778 `(("python-pyyaml" ,python-pyyaml)
2779 ;; Not listed in setup.py, but used in ccmlib/node.py for full
2780 ;; functionality
2781 ("python-psutil" ,python-psutil)
2782 ("python-six" ,python-six)))
2783 (home-page "https://github.com/pcmanus/ccm")
2784 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
2785 localhost")
2786 (description "Cassandra Cluster Manager is a development tool for testing
2787 local Cassandra clusters. It creates, launches and removes Cassandra clusters
2788 on localhost.")
2789 (license license:asl2.0)))
2790
2791 (define-public python2-ccm
2792 (package-with-python2 python-ccm))
2793
2794 (define-public python2-pysqlite
2795 (package
2796 (name "python2-pysqlite")
2797 (version "2.8.3")
2798 (source
2799 (origin
2800 (method url-fetch)
2801 (uri (pypi-uri "pysqlite" version))
2802 (sha256
2803 (base32
2804 "1424gwq9sil2ffmnizk60q36vydkv8rxs6m7xs987kz8cdc37lqp"))))
2805 (build-system python-build-system)
2806 (inputs
2807 `(("sqlite" ,sqlite)))
2808 (arguments
2809 `(#:python ,python-2 ; incompatible with Python 3
2810 #:tests? #f)) ; no test target
2811 (home-page "https://github.com/ghaering/pysqlite")
2812 (synopsis "SQLite bindings for Python")
2813 (description
2814 "Pysqlite provides SQLite bindings for Python that comply to the
2815 Database API 2.0T.")
2816 (license license:zlib)))
2817
2818 (define-public python-sqlalchemy
2819 (package
2820 (name "python-sqlalchemy")
2821 (version "1.3.20")
2822 (source
2823 (origin
2824 (method url-fetch)
2825 (uri (pypi-uri "SQLAlchemy" version))
2826 (sha256
2827 (base32 "18b9am7bsqc4nj3d2h5r93i002apczxfvpfpcqbd6f0385zmrwnj"))))
2828 (build-system python-build-system)
2829 (native-inputs
2830 `(("python-cython" ,python-cython) ; for C extensions
2831 ("python-pytest" ,python-pytest)
2832 ("python-mock" ,python-mock))) ; for tests
2833 (arguments
2834 `(#:phases
2835 (modify-phases %standard-phases
2836 (replace 'check
2837 (lambda _ (invoke "py.test"))))))
2838 (home-page "https://www.sqlalchemy.org")
2839 (synopsis "Database abstraction library")
2840 (description
2841 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
2842 gives application developers the full power and flexibility of SQL. It
2843 provides a full suite of well known enterprise-level persistence patterns,
2844 designed for efficient and high-performing database access, adapted into a
2845 simple and Pythonic domain language.")
2846 (license license:x11)))
2847
2848 (define-public python2-sqlalchemy
2849 (package-with-python2 python-sqlalchemy))
2850
2851 (define-public python-sqlalchemy-utils
2852 (package
2853 (name "python-sqlalchemy-utils")
2854 (version "0.32.21")
2855 (source
2856 (origin
2857 (method url-fetch)
2858 (uri (pypi-uri "SQLAlchemy-Utils" version))
2859 (sha256
2860 (base32
2861 "1myn71dn8j74xglyh46f12sh8ywb7j0j732rzwq70kvwwnq32m73"))))
2862 (build-system python-build-system)
2863 (arguments
2864 '(#:tests? #f)) ; FIXME: Many tests require a running database server.
2865 ;; #:phases
2866 ;; (modify-phases %standard-phases
2867 ;; (replace 'check
2868 ;; (lambda _
2869 ;; (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
2870 (propagated-inputs
2871 `(("python-six" ,python-six)
2872 ("python-sqlalchemy" ,python-sqlalchemy)))
2873 (native-inputs
2874 `(("python-dateutil" ,python-dateutil)
2875 ("python-flexmock" ,python-flexmock)
2876 ("python-psycopg2" ,python-psycopg2)
2877 ("python-pytest" ,python-pytest)
2878 ("python-pytz" ,python-pytz)))
2879 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
2880 (synopsis "Various utility functions for SQLAlchemy")
2881 (description
2882 "SQLAlchemy-utils provides various utility functions and custom data types
2883 for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
2884
2885 You might also want to install the following optional dependencies:
2886 @enumerate
2887 @item @code{python-passlib}
2888 @item @code{python-babel}
2889 @item @code{python-cryptography}
2890 @item @code{python-pytz}
2891 @item @code{python-psycopg2}
2892 @item @code{python-furl}
2893 @item @code{python-flask-babel}
2894 @end enumerate
2895 ")
2896 (license license:bsd-3)))
2897
2898 (define-public python2-sqlalchemy-utils
2899 (package-with-python2 python-sqlalchemy-utils))
2900
2901 (define-public python-alchemy-mock
2902 (package
2903 (name "python-alchemy-mock")
2904 (version "0.4.3")
2905 (home-page "https://github.com/miki725/alchemy-mock")
2906 (source (origin
2907 (method url-fetch)
2908 (uri (pypi-uri "alchemy-mock" version))
2909 (sha256
2910 (base32
2911 "0ylxygl3bcdapzz529n8wgk7vx9gjwb3ism564ypkpd7dbsw653r"))))
2912 (build-system python-build-system)
2913 (arguments
2914 '(#:phases (modify-phases %standard-phases
2915 (replace 'check
2916 (lambda _
2917 ;; Create pytest.ini that adds doctest options to
2918 ;; prevent test failure. Taken from tox.ini.
2919 (call-with-output-file "pytest.ini"
2920 (lambda (port)
2921 (format port "[pytest]
2922 doctest_optionflags=IGNORE_EXCEPTION_DETAIL
2923 ")))
2924 (invoke "pytest" "-vv" "--doctest-modules"
2925 "alchemy_mock/"))))))
2926 (native-inputs
2927 `(("python-mock" ,python-mock)
2928 ("python-pytest" ,python-pytest)))
2929 (propagated-inputs
2930 `(("python-six" ,python-six)
2931 ("python-sqlalchemy" ,python-sqlalchemy)))
2932 (synopsis "Mock helpers for SQLAlchemy")
2933 (description
2934 "This package provides mock helpers for SQLAlchemy that makes it easy
2935 to mock an SQLAlchemy session while preserving the ability to do asserts.
2936
2937 Normally Normally SQLAlchemy's expressions cannot be easily compared as
2938 comparison on binary expression produces yet another binary expression, but
2939 this library provides functions to facilitate such comparisons.")
2940 (license license:expat)))
2941
2942 (define-public python-alembic
2943 (package
2944 (name "python-alembic")
2945 (version "1.4.3")
2946 (source
2947 (origin
2948 (method url-fetch)
2949 (uri (pypi-uri "alembic" version))
2950 (sha256
2951 (base32 "0if2dgb088clk738p26bwk50735h6jpd2kacdgc5capv2hiz6d2k"))))
2952 (build-system python-build-system)
2953 (arguments
2954 '(#:phases (modify-phases %standard-phases
2955 (replace 'check
2956 (lambda _
2957 (invoke "pytest" "-vv"))))))
2958 (native-inputs
2959 `(("python-mock" ,python-mock)
2960 ("python-pytest-cov" ,python-pytest-cov)))
2961 (propagated-inputs
2962 `(("python-dateutil" ,python-dateutil)
2963 ("python-sqlalchemy" ,python-sqlalchemy)
2964 ("python-mako" ,python-mako)
2965 ("python-editor" ,python-editor)))
2966 (home-page "https://bitbucket.org/zzzeek/alembic")
2967 (synopsis "Database migration tool for SQLAlchemy")
2968 (description
2969 "Alembic is a lightweight database migration tool for usage with the
2970 SQLAlchemy Database Toolkit for Python.")
2971 (license license:expat)))
2972
2973 (define-public python2-alembic
2974 (package-with-python2 python-alembic))
2975
2976 (define-public python-pickleshare
2977 (package
2978 (name "python-pickleshare")
2979 (version "0.7.5")
2980 (source
2981 (origin
2982 (method url-fetch)
2983 (uri (pypi-uri "pickleshare" version))
2984 (sha256
2985 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
2986 (build-system python-build-system)
2987 (arguments
2988 `(#:phases (modify-phases %standard-phases
2989 (replace 'check
2990 (lambda _
2991 (invoke "pytest"))))))
2992 (native-inputs
2993 `(("python-pytest" ,python-pytest)))
2994 (home-page "https://github.com/vivainio/pickleshare")
2995 (synopsis "Tiny key value database with concurrency support")
2996 (description
2997 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
2998 Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
2999 shelve, many processes can access the database simultaneously. Changing a
3000 value in database is immediately visible to other processes accessing the same
3001 database. Concurrency is possible because the values are stored in separate
3002 files. Hence the “database” is a directory where all files are governed by
3003 PickleShare.")
3004 (properties `((python2-variant . ,(delay python2-pickleshare))))
3005 (license license:expat)))
3006
3007 (define-public python2-pickleshare
3008 (let ((pickleshare (package-with-python2
3009 (strip-python2-variant python-pickleshare))))
3010 (package (inherit pickleshare)
3011 (propagated-inputs `(("python2-pathlib2" ,python2-pathlib2)
3012 ,@(package-propagated-inputs pickleshare))))))
3013
3014 (define-public python-apsw
3015 (package
3016 (name "python-apsw")
3017 (version "3.31.1-r1")
3018 (source
3019 (origin
3020 (method url-fetch)
3021 (uri (string-append "https://github.com/rogerbinns/apsw/releases"
3022 "/download/" version "/apsw-" version ".zip"))
3023 (sha256
3024 (base32
3025 "1gap5lr6c7bp134nzvfwr693i6d0fqyaysg3ms2cayjldv616yfx"))))
3026 (build-system python-build-system)
3027 (native-inputs
3028 `(("unzip" ,unzip)))
3029 (inputs
3030 `(("sqlite" ,sqlite)))
3031 (arguments
3032 `(#:phases
3033 (modify-phases %standard-phases
3034 (replace 'build
3035 (lambda _
3036 (invoke "python" "setup.py" "build" "--enable-all-extensions")
3037 #t))
3038 (add-after 'build 'build-test-helper
3039 (lambda _
3040 (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext"
3041 "-I." "-Isqlite3" "src/testextension.c")
3042 #t))
3043 (replace 'check
3044 (lambda* (#:key inputs outputs #:allow-other-keys)
3045 (add-installed-pythonpath inputs outputs)
3046 (invoke "python" "setup.py" "test")
3047 #t)))))
3048 (home-page "https://github.com/rogerbinns/apsw/")
3049 (synopsis "Another Python SQLite Wrapper")
3050 (description "APSW is a Python wrapper for the SQLite
3051 embedded relational database engine. In contrast to other wrappers such as
3052 pysqlite it focuses on being a minimal layer over SQLite attempting just to
3053 translate the complete SQLite API into Python.")
3054 (license license:zlib)))
3055
3056 (define-public python2-apsw
3057 (package-with-python2 python-apsw))
3058
3059 (define-public python-aiosqlite
3060 (package
3061 (name "python-aiosqlite")
3062 (version "0.17.0")
3063 (source
3064 (origin
3065 (method url-fetch)
3066 (uri (pypi-uri "aiosqlite" version))
3067 (sha256
3068 (base32
3069 "0lgfpbkcd730hbgj3zlrbx2y8fzvdns2zj3s4r4l31n49g1arrph"))))
3070 (build-system python-build-system)
3071 (arguments
3072 '(#:phases (modify-phases %standard-phases
3073 (replace 'check
3074 (lambda* (#:key tests? #:allow-other-keys)
3075 (if tests?
3076 (invoke "python" "-m" "unittest" "aiosqlite.tests")
3077 (format #t "test suite not run~%"))
3078 #t)))))
3079 (propagated-inputs
3080 `(("python-typing-extensions" ,python-typing-extensions)))
3081 (native-inputs
3082 `(("python-aiounittest" ,python-aiounittest)))
3083 (home-page "https://github.com/jreese/aiosqlite")
3084 (synopsis
3085 "Asyncio bridge for sqlite3")
3086 (description
3087 "The package aiosqlite replicates the standard sqlite3 module, but with
3088 async versions of all the standard connection and cursor methods, and context
3089 managers for automatically closing connections.")
3090 (license license:expat)))
3091
3092 (define-public python2-neo4j-driver
3093 (package
3094 (name "python2-neo4j-driver")
3095 ;; NOTE: When upgrading to 1.5.0, please add a python3 variant.
3096 (version "1.4.0")
3097 (source (origin
3098 (method url-fetch)
3099 (uri (pypi-uri "neo4j-driver" version))
3100 (sha256
3101 (base32
3102 "011r1vh182p8mm83d8dz9rfnc3l7rf7fd00cyrbyfzi71jmc4g98"))))
3103 (build-system python-build-system)
3104 (arguments
3105 `(#:python ,python-2))
3106 (home-page "https://neo4j.com/developer/python/")
3107 (synopsis "Neo4j driver code written in Python")
3108 (description "This package provides the Neo4j Python driver that connects
3109 to the database using Neo4j's binary protocol. It aims to be minimal, while
3110 being idiomatic to Python.")
3111 (license license:asl2.0)))
3112
3113 (define-public python2-py2neo
3114 (package
3115 (name "python2-py2neo")
3116 (version "3.1.2")
3117 (source (origin
3118 (method url-fetch)
3119 (uri (pypi-uri "py2neo" version))
3120 (sha256
3121 (base32
3122 "1f1q95vqcvlc3nsc33p841swnjdcjazddlq2dzi3qfnjqjrajxw1"))))
3123 (build-system python-build-system)
3124 (arguments
3125 `(#:python ,python-2))
3126 (home-page "https://py2neo.org")
3127 (synopsis "Library and toolkit for working with Neo4j in Python")
3128 (description "This package provides a client library and toolkit for
3129 working with Neo4j from within Python applications and from the command
3130 line. The core library has no external dependencies and has been carefully
3131 designed to be easy and intuitive to use.")
3132 (license license:asl2.0)))
3133
3134 (define-public python-psycopg2
3135 (package
3136 (name "python-psycopg2")
3137 (version "2.8.6")
3138 (source
3139 (origin
3140 (method url-fetch)
3141 (uri (pypi-uri "psycopg2" version))
3142 (sha256
3143 (base32 "0hzmk6b1hb5riqkljr5xics6p4zbvmis6knbczb7zhq7273zc8zv"))))
3144 (build-system python-build-system)
3145 (arguments
3146 ;; Tests would require a postgresql database "psycopg2_test"
3147 ;; and a running postgresql database management service.
3148 `(#:tests? #f)) ; TODO re-enable after providing a test-db.
3149 (inputs
3150 `(("postgresql" ,postgresql))) ; libpq
3151 (home-page "http://initd.org/psycopg/")
3152 (synopsis "Python PostgreSQL adapter")
3153 (description
3154 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
3155 2.0.")
3156 (license license:lgpl3+)))
3157
3158 (define-public python2-psycopg2
3159 (package-with-python2 python-psycopg2))
3160
3161 (define-public python-sadisplay
3162 (package
3163 (name "python-sadisplay")
3164 (version "0.4.8")
3165 (source
3166 (origin
3167 (method url-fetch)
3168 (uri (pypi-uri "sadisplay" version))
3169 (sha256
3170 (base32
3171 "01d9lxhmgpb68gy8rd6zj6fcwp84n2qq210n1qsk3qbsir79bzh4"))))
3172 (build-system python-build-system)
3173 (propagated-inputs
3174 `(("python-sqlalchemy" ,python-sqlalchemy)))
3175 (native-inputs
3176 ;; For tests.
3177 `(("python-nose" ,python-nose)))
3178 (home-page "https://bitbucket.org/estin/sadisplay")
3179 (synopsis "SQLAlchemy schema displayer")
3180 (description "This package provides a program to build Entity
3181 Relationship diagrams from a SQLAlchemy model (or directly from the
3182 database).")
3183 (license license:bsd-3)))
3184
3185 (define-public python2-sadisplay
3186 (package-with-python2 python-sadisplay))
3187
3188 (define-public yoyo-migrations
3189 (package
3190 (name "yoyo-migrations")
3191 (version "7.2.0")
3192 (source
3193 (origin
3194 ;; We use the upstream repository, as the tests are not included in the
3195 ;; PyPI releases.
3196 (method hg-fetch)
3197 (uri (hg-reference
3198 (url "https://hg.sr.ht/~olly/yoyo")
3199 (changeset (string-append "v" version "-release"))))
3200 (file-name (string-append name "-" version "-checkout"))
3201 (sha256
3202 (base32 "0q2z9bgdj3wyix7yvqsayfs21grp5av8ilh411lgmjhigszkvhcq"))))
3203 (build-system python-build-system)
3204 (arguments
3205 ;; XXX: Tests require a connection to some pgsql database and psycopg
3206 ;; fails to connect to it.
3207 '(#:tests? #f))
3208 (propagated-inputs
3209 `(("python-sqlparse" ,python-sqlparse)
3210 ("python-tabulate" ,python-tabulate)))
3211 (home-page "https://ollycope.com/software/yoyo/latest/")
3212 (synopsis "Database migrations with SQL")
3213 (description
3214 "Yoyo is a database schema migration tool. Migrations are written as SQL
3215 files or Python scripts that define a list of migration steps.")
3216 (license license:asl2.0)))
3217
3218 (define-public python-mysqlclient
3219 (package
3220 (name "python-mysqlclient")
3221 (version "2.0.1")
3222 (source
3223 (origin
3224 (method url-fetch)
3225 (uri (pypi-uri "mysqlclient" version))
3226 (sha256
3227 (base32
3228 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
3229 (build-system python-build-system)
3230 (arguments '(#:tests? #f)) ;XXX: requires a live database
3231 (inputs
3232 `(("mysql-dev" ,mariadb "dev")))
3233 (home-page "https://github.com/PyMySQL/mysqlclient-python")
3234 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
3235 (description "MySQLdb is an interface to the popular MySQL database server
3236 for Python. The design goals are:
3237 @enumerate
3238 @item Compliance with Python database API version 2.0 [PEP-0249],
3239 @item Thread-safety,
3240 @item Thread-friendliness (threads will not block each other).
3241 @end enumerate")
3242 (license license:gpl2)))
3243
3244 (define-public python-hiredis
3245 (package
3246 (name "python-hiredis")
3247 (version "0.2.0")
3248 (source
3249 (origin
3250 (method url-fetch)
3251 (uri (pypi-uri "hiredis" version))
3252 (sha256
3253 (base32
3254 "1dfm2k9l9zar9nw9fwmm74zrgraxdxs04vx9li56fjcf289qx5fa"))))
3255 (build-system python-build-system)
3256 (arguments
3257 ;; no tests
3258 `(#:tests? #f))
3259 (home-page "https://github.com/redis/hiredis-py")
3260 (synopsis "Python extension that wraps protocol parsing code in hiredis")
3261 (description "Python-hiredis is a python extension that wraps protocol
3262 parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
3263 (license license:bsd-3)))
3264
3265 (define-public python2-hiredis
3266 (package-with-python2 python-hiredis))
3267
3268 (define-public python-fakeredis
3269 (package
3270 (name "python-fakeredis")
3271 (version "1.2.1")
3272 (source
3273 (origin
3274 (method url-fetch)
3275 (uri (pypi-uri "fakeredis" version))
3276 (sha256
3277 (base32
3278 "1s12mn4q4hz7402139khn9fx56kibj7nn0d6w81hn0zs07b90wpc"))))
3279 (build-system python-build-system)
3280 (arguments
3281 ;; no tests
3282 `(#:tests? #f))
3283 (propagated-inputs
3284 `(("python-sortedcontainers" ,python-sortedcontainers)))
3285 (home-page "https://github.com/jamesls/fakeredis")
3286 (synopsis "Fake implementation of redis API for testing purposes")
3287 (description
3288 "Fakeredis is a pure-Python implementation of the redis-py Python client
3289 that simulates talking to a redis server. It was created for a single purpose:
3290 to write unit tests.
3291
3292 Setting up redis is not hard, but one often wants to write unit tests that don't
3293 talk to an external server such as redis. This module can be used as a
3294 reasonable substitute.")
3295 (license license:bsd-3)))
3296
3297 (define-public python2-fakeredis
3298 (package-with-python2 python-fakeredis))
3299
3300 (define-public python-redis
3301 (package
3302 (name "python-redis")
3303 (version "3.5.3")
3304 (source
3305 (origin
3306 (method url-fetch)
3307 (uri (pypi-uri "redis" version))
3308 (sha256
3309 (base32 "18h5b87g15x3j6pb1h2q27ri37p2qpvc9n2wgn5yl3b6m3y0qzhf"))))
3310 (build-system python-build-system)
3311 ;; Tests require a running Redis server.
3312 (arguments '(#:tests? #f))
3313 ;; As long as we are not running test, we do not need this input :-)
3314 ;;(native-inputs
3315 ;; `(("python-pytest" ,python-pytest)))
3316 (home-page "https://github.com/andymccurdy/redis-py")
3317 (synopsis "Redis Python client")
3318 (description
3319 "This package provides a Python interface to the Redis key-value store.")
3320 (license license:expat)))
3321
3322 (define-public python2-redis
3323 (package-with-python2 python-redis))
3324
3325 (define-public python-rq
3326 (package
3327 (name "python-rq")
3328 (version "1.5.2")
3329 (source
3330 (origin
3331 (method git-fetch)
3332 (uri (git-reference
3333 (url "https://github.com/rq/rq")
3334 (commit (string-append "v" version))))
3335 (file-name (git-file-name name version))
3336 (sha256
3337 (base32 "0ikqmpq0g1qiqwd7ar1286l4hqjb6aj2wr844gihhb8ijzwhp8va"))))
3338 (build-system python-build-system)
3339 (arguments
3340 '(#:phases (modify-phases %standard-phases
3341 (add-before 'check 'start-redis
3342 (lambda _
3343 (invoke "redis-server" "--daemonize" "yes")))
3344 (replace 'check
3345 (lambda* (#:key outputs #:allow-other-keys)
3346 (let ((out (assoc-ref outputs "out")))
3347 ;; Drop test that needs the SDK for Sentry.io.
3348 (delete-file "tests/test_sentry.py")
3349 ;; Ensure 'rq' and 'rqworker' ends up on PATH.
3350 (setenv "PATH" (string-append out "/bin:"
3351 (getenv "PATH")))
3352 (invoke "pytest" "-vv")))))))
3353 (native-inputs
3354 `(("python-mock" ,python-mock)
3355 ("python-pytest" ,python-pytest)
3356 ("redis" ,redis)))
3357 (propagated-inputs
3358 `(("python-click" ,python-click)
3359 ("python-redis" ,python-redis)))
3360 (home-page "https://python-rq.org/")
3361 (synopsis "Simple job queues for Python")
3362 (description
3363 "RQ (Redis Queue) is a simple Python library for queueing jobs and
3364 processing them in the background with workers. It is backed by Redis and it
3365 is designed to have a low barrier to entry.")
3366 (license license:bsd-2)))
3367
3368 (define-public python-rq-scheduler
3369 (package
3370 (name "python-rq-scheduler")
3371 (version "0.10.0")
3372 (home-page "https://github.com/rq/rq-scheduler")
3373 (source (origin
3374 (method git-fetch)
3375 (uri (git-reference
3376 (url home-page)
3377 (commit (string-append "v" version))))
3378 (file-name (git-file-name name version))
3379 (sha256
3380 (base32
3381 "0xg6yazqs5kbr2ayvhvljs1h5vgx5k5dds613fmhswln7gglf9hk"))))
3382 (build-system python-build-system)
3383 (arguments
3384 '(#:phases (modify-phases %standard-phases
3385 (add-before 'check 'start-redis
3386 (lambda _
3387 (invoke "redis-server" "--daemonize" "yes")))
3388 (replace 'check
3389 (lambda _
3390 (substitute* "run_tests.py"
3391 (("/usr/bin/env")
3392 (which "env")))
3393 (invoke "./run_tests.py"))))))
3394 (native-inputs
3395 `(("redis" ,redis)
3396 ("which" ,which)))
3397 (propagated-inputs
3398 `(("python-croniter" ,python-croniter)
3399 ("python-rq" ,python-rq)))
3400 (synopsis "Job scheduling capabilities for RQ (Redis Queue)")
3401 (description
3402 "This package provides job scheduling capabilities to @code{python-rq}
3403 (Redis Queue).")
3404 (license license:expat)))
3405
3406 (define-public python-trollius-redis
3407 (package
3408 (name "python-trollius-redis")
3409 (version "0.1.4")
3410 (source
3411 (origin
3412 (method url-fetch)
3413 (uri (pypi-uri "trollius_redis" version))
3414 (sha256
3415 (base32
3416 "0k3vypszmgmaipgw9xscvgm79h2zd6p6ci8gdp5sxl6g5kbqr9fy"))))
3417 (build-system python-build-system)
3418 ;; TODO: Tests require packaging 'hiredis'.
3419 (arguments '(#:tests? #f))
3420 (home-page "https://github.com/benjolitz/trollius-redis")
3421 (synopsis "Port of asyncio-redis to trollius")
3422 (description "@code{trollius-redis} is a Redis client for Python
3423 trollius. It is an asynchronous IO (PEP 3156) implementation of the
3424 Redis protocol.")
3425 (license license:bsd-2)))
3426
3427 (define-public python2-trollius-redis
3428 (package-with-python2 python-trollius-redis))
3429
3430 (define-public python-sqlparse
3431 (package
3432 (name "python-sqlparse")
3433 (version "0.3.1")
3434 (source (origin
3435 (method url-fetch)
3436 (uri (pypi-uri "sqlparse" version))
3437 (sha256
3438 (base32
3439 "0j652a6z7bdf6c77aczfn8m8b2nsr1bcqq48wzghf8vi6wvj0qp1"))))
3440 (build-system python-build-system)
3441 (arguments
3442 `(#:phases
3443 (modify-phases %standard-phases
3444 (replace 'check
3445 (lambda _ (invoke "py.test"))))))
3446 (native-inputs
3447 `(("python-pytest" ,python-pytest)))
3448 (home-page "https://github.com/andialbrecht/sqlparse")
3449 (synopsis "Non-validating SQL parser")
3450 (description "Sqlparse is a non-validating SQL parser for Python. It
3451 provides support for parsing, splitting and formatting SQL statements.")
3452 (license license:bsd-3)))
3453
3454 (define-public python2-sqlparse
3455 (package-with-python2 python-sqlparse))
3456
3457 (define-public python-sql
3458 (package
3459 (name "python-sql")
3460 (version "1.0.0")
3461 (source
3462 (origin
3463 (method url-fetch)
3464 (uri (pypi-uri "python-sql" version))
3465 (sha256
3466 (base32 "05ni936y0ia9xmryl7mlhbj9i80nnvq1bi4zxhb96rv7yvpb3fqb"))))
3467 (build-system python-build-system)
3468 (home-page "https://python-sql.tryton.org/")
3469 (synopsis "Library to write SQL queries in a pythonic way")
3470 (description "@code{python-sql} is a library to write SQL queries, that
3471 transforms idiomatic python function calls to well-formed SQL queries.")
3472 (license license:bsd-3)))
3473
3474 (define-public python2-sql
3475 (package-with-python2 python-sql))
3476
3477 (define-public python-pypika
3478 (package
3479 (name "python-pypika")
3480 (version "0.47.6")
3481 (source
3482 (origin (method git-fetch)
3483 (uri (git-reference
3484 (url "https://github.com/kayak/pypika")
3485 (commit (string-append "v" version))))
3486 (file-name (git-file-name name version))
3487 (sha256
3488 (base32
3489 "001pg36sw9a36zdd1kccbymcxndphjcjbbrsy6ri7ng8h4dgz549"))))
3490 (build-system python-build-system)
3491 (native-inputs
3492 `(("python-parameterized" ,python-parameterized)))
3493 (home-page "https://github.com/kayak/pypika")
3494 (synopsis "SQL query builder API for Python")
3495 (description
3496 "PyPika is a python SQL query builder that exposes the full richness of
3497 the SQL language using a syntax that reflects the resulting query.")
3498 (license license:asl2.0)))
3499
3500 ;; There are many wrappers for this in other languages. When touching, please
3501 ;; be sure to ensure all dependencies continue to build.
3502 (define-public apache-arrow
3503 (package
3504 (name "apache-arrow")
3505 (version "3.0.0")
3506 (source
3507 (origin
3508 (method git-fetch)
3509 (uri (git-reference
3510 (url "https://github.com/apache/arrow")
3511 (commit (string-append "apache-arrow-" version))))
3512 (file-name (git-file-name name version))
3513 (sha256
3514 (base32
3515 "03ngddh3r1g6f9aja2jlfksgvgyzmxmfy4bxvzjrcv5fvl5x8ii0"))))
3516 (build-system cmake-build-system)
3517 (arguments
3518 `(#:tests? #f
3519 #:phases
3520 (modify-phases %standard-phases
3521 (add-before 'configure 'enter-source-directory
3522 (lambda _ (chdir "cpp") #t))
3523 (add-after 'unpack 'set-env
3524 (lambda _
3525 (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
3526 (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
3527 (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
3528 (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson"))
3529 #t)))
3530 #:build-type "Release"
3531 #:configure-flags
3532 (list "-DARROW_PYTHON=ON"
3533 "-DARROW_GLOG=ON"
3534 ;; Parquet options
3535 "-DARROW_PARQUET=ON"
3536 "-DPARQUET_BUILD_EXECUTABLES=ON"
3537 ;; The maintainers disallow using system versions of
3538 ;; jemalloc:
3539 ;; https://issues.apache.org/jira/browse/ARROW-3507. This
3540 ;; is unfortunate because jemalloc increases performance:
3541 ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/.
3542 "-DARROW_JEMALLOC=OFF"
3543
3544 ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global
3545 ;; option that instructs the build system how to resolve
3546 ;; each dependency. SYSTEM = Finding the dependency in
3547 ;; system paths using CMake's built-in find_package
3548 ;; function, or using pkg-config for packages that do not
3549 ;; have this feature
3550 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
3551
3552 ;; Split output into its component packages.
3553 (string-append "-DCMAKE_INSTALL_PREFIX="
3554 (assoc-ref %outputs "lib"))
3555 (string-append "-DCMAKE_INSTALL_RPATH="
3556 (assoc-ref %outputs "lib")
3557 "/lib")
3558 (string-append "-DCMAKE_INSTALL_BINDIR="
3559 (assoc-ref %outputs "out")
3560 "/bin")
3561 (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
3562 (assoc-ref %outputs "include")
3563 "/share/include")
3564
3565
3566 "-DARROW_WITH_SNAPPY=ON"
3567 "-DARROW_WITH_ZLIB=ON"
3568 "-DARROW_WITH_ZSTD=ON"
3569 "-DARROW_WITH_LZ4=ON"
3570 "-DARROW_COMPUTE=ON"
3571 "-DARROW_CSV=ON"
3572 "-DARROW_DATASET=ON"
3573 "-DARROW_FILESYSTEM=ON"
3574 "-DARROW_HDFS=ON"
3575 "-DARROW_JSON=ON"
3576 ;; Arrow Python C++ integration library (required for
3577 ;; building pyarrow). This library must be built against
3578 ;; the same Python version for which you are building
3579 ;; pyarrow. NumPy must also be installed. Enabling this
3580 ;; option also enables ARROW_COMPUTE, ARROW_CSV,
3581 ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and
3582 ;; ARROW_JSON.
3583 "-DARROW_PYTHON=ON"
3584
3585 ;; Building the tests forces on all the
3586 ;; optional features and the use of static
3587 ;; libraries.
3588 "-DARROW_BUILD_TESTS=OFF"
3589 "-DBENCHMARK_ENABLE_GTEST_TESTS=OFF"
3590 ;;"-DBENCHMARK_ENABLE_TESTING=OFF"
3591 "-DARROW_BUILD_STATIC=OFF")))
3592 (inputs
3593 `(("apache-thrift" ,apache-thrift "lib")
3594 ("boost" ,boost)
3595 ("brotli" ,google-brotli)
3596 ("bzip2" ,bzip2)
3597 ("double-conversion" ,double-conversion)
3598 ("gflags" ,gflags)
3599 ("glog" ,glog)
3600 ("grpc" ,grpc)
3601 ("lz4" ,lz4)
3602 ("protobuf" ,protobuf)
3603 ("python-3" ,python)
3604 ("python-numpy" ,python-numpy)
3605 ("rapidjson" ,rapidjson)
3606 ("re2" ,re2)
3607 ("snappy" ,snappy)
3608 ("utf8proc" ,utf8proc)
3609 ("zlib" ,zlib)
3610 ("zstd" ,zstd "lib")))
3611 (native-inputs
3612 `(("pkg-config" ,pkg-config)))
3613 (outputs '("out" "lib" "include"))
3614 (home-page "https://arrow.apache.org/")
3615 (synopsis "Columnar in-memory analytics")
3616 (description "Apache Arrow is a columnar in-memory analytics layer
3617 designed to accelerate big data. It houses a set of canonical in-memory
3618 representations of flat and hierarchical data along with multiple
3619 language-bindings for structure manipulation. It also provides IPC and common
3620 algorithm implementations.")
3621 (license license:asl2.0)))
3622
3623 (define-public python-pyarrow
3624 (package
3625 (inherit apache-arrow)
3626 (name "python-pyarrow")
3627 (build-system python-build-system)
3628 (arguments
3629 '(#:tests? #f ; XXX There are no tests in the "python" directory
3630 #:phases
3631 (modify-phases %standard-phases
3632 (delete 'build) ; XXX the build is performed again during the install phase
3633 (add-after 'unpack 'enter-source-directory
3634 (lambda _ (chdir "python") #t))
3635 (add-after 'unpack 'make-git-checkout-writable
3636 (lambda _
3637 (for-each make-file-writable (find-files "."))
3638 #t)))))
3639 (propagated-inputs
3640 `(("apache-arrow" ,apache-arrow "lib")
3641 ("python-numpy" ,python-numpy)
3642 ("python-pandas" ,python-pandas)
3643 ("python-six" ,python-six)))
3644 (native-inputs
3645 `(("cmake" ,cmake-minimal)
3646 ("pkg-config" ,pkg-config)
3647 ("python-cython" ,python-cython)
3648 ("python-pytest" ,python-pytest)
3649 ("python-pytest-runner" ,python-pytest-runner)
3650 ("python-setuptools-scm" ,python-setuptools-scm)))
3651 (outputs '("out"))
3652 (home-page "https://arrow.apache.org/docs/python/")
3653 (synopsis "Python bindings for Apache Arrow")
3654 (description
3655 "This library provides a Pythonic API wrapper for the reference Arrow C++
3656 implementation, along with tools for interoperability with pandas, NumPy, and
3657 other traditional Python scientific computing packages.")
3658 (license license:asl2.0)))
3659
3660 (define-public python-crate
3661 (package
3662 (name "python-crate")
3663 (version "0.23.2")
3664 (source (origin
3665 (method url-fetch)
3666 (uri (pypi-uri "crate" version))
3667 (sha256
3668 (base32
3669 "0ngmlvi320c5gsxab0s7qgq0ck4jdlcwvb6lbjhnfprafdp56vvx"))))
3670 (build-system python-build-system)
3671 (propagated-inputs
3672 `(("python-urllib3" ,python-urllib3)))
3673 (home-page "https://github.com/crate/crate-python")
3674 (synopsis "CrateDB Python client")
3675 (description
3676 "This package provides a Python client library for CrateDB.
3677 It implements the Python DB API 2.0 specification and includes support for
3678 SQLAlchemy.")
3679 (license license:asl2.0)))
3680
3681 (define-public libdbi
3682 (package
3683 (name "libdbi")
3684 (version "0.9.0")
3685 (source (origin
3686 (method url-fetch)
3687 (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-"
3688 version "/libdbi-" version ".tar.gz"))
3689 (sha256
3690 (base32
3691 "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
3692 (build-system gnu-build-system)
3693 (synopsis "Database independent abstraction layer in C")
3694 (description
3695 "This library implements a database independent abstraction layer in C,
3696 similar to the DBI/DBD layer in Perl. Writing one generic set of code,
3697 programmers can leverage the power of multiple databases and multiple
3698 simultaneous database connections by using this framework.")
3699 (home-page "http://libdbi.sourceforge.net/")
3700 (license license:lgpl2.1+)))
3701
3702 (define-public libdbi-drivers
3703 (package
3704 (name "libdbi-drivers")
3705 (version "0.9.0")
3706 (source (origin
3707 (method url-fetch)
3708 (uri (string-append "mirror://sourceforge/libdbi-drivers/"
3709 "libdbi-drivers/libdbi-drivers-" version
3710 "/libdbi-drivers-" version ".tar.gz"))
3711 (sha256
3712 (base32
3713 "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
3714 (build-system gnu-build-system)
3715 (native-inputs
3716 `(;; For tests.
3717 ("inetutils" ,inetutils)
3718 ("glibc-locales" ,glibc-locales)
3719 ("mariadb" ,mariadb)))
3720 (inputs
3721 `(("libdbi" ,libdbi)
3722 ("mariadb:dev" ,mariadb "dev")
3723 ("mariadb:lib" ,mariadb "lib")
3724 ("postgresql" ,postgresql)
3725 ("sqlite" ,sqlite)))
3726 (arguments
3727 `(#:configure-flags
3728 (let ((libdbi (assoc-ref %build-inputs "libdbi"))
3729 (mysql:inc (assoc-ref %build-inputs "mariadb:dev"))
3730 (mysql:lib (assoc-ref %build-inputs "mariadb:lib"))
3731 (postgresql (assoc-ref %build-inputs "postgresql"))
3732 (sqlite (assoc-ref %build-inputs "sqlite")))
3733 (list "--disable-docs"
3734 (string-append "--with-dbi-incdir=" libdbi "/include")
3735 (string-append "--with-dbi-libdir=" libdbi "/lib")
3736 "--with-mysql"
3737 (string-append "--with-mysql-incdir=" mysql:inc "/include/mysql")
3738 (string-append "--with-mysql-libdir=" mysql:lib "/lib")
3739 "--with-pgsql"
3740 (string-append "--with-pgsql-incdir=" postgresql "/include")
3741 (string-append "--with-pgsql-libdir=" postgresql "/lib")
3742 "--with-sqlite3"
3743 (string-append "--with-sqlite-incdir=" sqlite "/include")
3744 (string-append "--with-sqlite-libdir=" sqlite "/lib")))
3745 #:tests? #f ; FIXME: Find why the tests get stuck forever.
3746 #:phases
3747 (modify-phases %standard-phases
3748 (add-after 'unpack 'fix-tests
3749 (lambda* (#:key inputs #:allow-other-keys)
3750 (substitute* "tests/test_mysql.sh"
3751 (("^MYMYSQLD=.*")
3752 (string-append "MYMYSQLD="
3753 (assoc-ref inputs "mariadb")
3754 "/bin/mysqld")))
3755 #t))
3756 (add-after 'install 'remove-empty-directories
3757 (lambda* (#:key outputs #:allow-other-keys)
3758 (let ((var (string-append (assoc-ref outputs "out") "/var")))
3759 (delete-file-recursively var))
3760 #t)))))
3761 (synopsis "Database drivers for the libdbi framework")
3762 (description
3763 "The @code{libdbi-drivers} library provides the database specific drivers
3764 for the @code{libdbi} framework.
3765
3766 The drivers officially supported by @code{libdbi} are:
3767 @itemize
3768 @item MySQL,
3769 @item PostgreSQL,
3770 @item SQLite.
3771 @end itemize")
3772 (home-page "http://libdbi-drivers.sourceforge.net/")
3773 (license license:lgpl2.1+)))
3774
3775 (define-public soci
3776 (package
3777 (name "soci")
3778 (version "4.0.1")
3779 (source (origin
3780 (method git-fetch)
3781 (uri (git-reference
3782 (url "https://github.com/SOCI/soci/")
3783 (commit version)))
3784 (file-name (git-file-name name version))
3785 (sha256
3786 (base32
3787 "14x2gjblkgpflv75wl144cyjp1sis5rbxnr9r2gj3yw16v2av0bp"))))
3788 (build-system cmake-build-system)
3789 (propagated-inputs
3790 ;; Headers of soci has include-references to headers of these inputs.
3791 `(("firebird" ,firebird)
3792 ("postgresql" ,postgresql)
3793 ("sqlite" ,sqlite)
3794 ("odbc" ,unixodbc)
3795 ("boost" ,boost)
3796 ("mariadb:dev" ,mariadb "dev")))
3797 (arguments
3798 `(#:configure-flags
3799 ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs it.
3800 (list "-DCMAKE_CXX_STANDARD=17"
3801 "-DSOCI_LIBDIR=lib")
3802 #:tests? #f)) ; may require running database management systems
3803 (synopsis "C++ Database Access Library")
3804 (description
3805 "SOCI is an abstraction layer for several database backends, including
3806 PostreSQL, SQLite, ODBC and MySQL.")
3807 (home-page "http://soci.sourceforge.net/")
3808 (license license:boost1.0)))
3809
3810 (define-public freetds
3811 (package
3812 (name "freetds")
3813 (version "1.2.18")
3814 (source
3815 (origin
3816 (method url-fetch)
3817 (uri (string-append "https://www.freetds.org/files/stable/"
3818 "freetds-" version ".tar.gz"))
3819 (sha256
3820 (base32 "1hspvwxwdd1apadsy2b40dpjik8kfwcvdamvhpg3lnm15n02fb50"))))
3821 (build-system gnu-build-system)
3822 (arguments
3823 ;; NOTE: (Sharlatan-20210110213908+0000) some tests require DB connection,
3824 ;; disabled for now.
3825 `(#:tests? #f))
3826 (home-page "https://www.freetds.org/")
3827 (synopsis "Client libraries for MS SQL and Sybase servers")
3828 (description
3829 "FreeTDS is an implementation of the Tabular DataStream protocol, used for
3830 connecting to MS SQL and Sybase servers over TCP/IP.")
3831 (license license:lgpl2.0+)))