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