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