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