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