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