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