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