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