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