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