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