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