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