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