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