gnu: Add ocaml-markup.
[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>
c007e35d 13;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
47956fa0 14;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
6d09a7b5 15;;; Copyright © 2016, 2017, 2018 Roel Janssen <roel@gnu.org>
0e1b262e 16;;; Copyright © 2016 David Craven <david@craven.ch>
fe71eee0 17;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
62ea44fc 18;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
a8714bf6 19;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
7fa9cca8 20;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
c336567d 21;;; Copyright © 2017, 2018 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>
245e7a68 26;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
38abef12 27;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
19601e89 28;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
231123ee 29;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
7bcc3405 30;;; Copyright © 2017, 2018 Pierre Langlois <pierre.langlois@gmx.com>
e58d3a59 31;;; Copyright © 2015, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
16973071 32;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
3926a099 33;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
dae7661a 34;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
da602679 35;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
5f96f303
LC
36;;;
37;;; This file is part of GNU Guix.
38;;;
39;;; GNU Guix is free software; you can redistribute it and/or modify it
40;;; under the terms of the GNU General Public License as published by
41;;; the Free Software Foundation; either version 3 of the License, or (at
42;;; your option) any later version.
43;;;
44;;; GNU Guix is distributed in the hope that it will be useful, but
45;;; WITHOUT ANY WARRANTY; without even the implied warranty of
46;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47;;; GNU General Public License for more details.
48;;;
49;;; You should have received a copy of the GNU General Public License
50;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
51
52(define-module (gnu packages databases)
53 #:use-module (gnu packages)
58071723 54 #:use-module (gnu packages admin)
06a035db 55 #:use-module (gnu packages algebra)
4c6aa73b
RJ
56 #:use-module (gnu packages autotools)
57 #:use-module (gnu packages avahi)
77e52190 58 #:use-module (gnu packages base)
b747a9db 59 #:use-module (gnu packages bash)
06a035db 60 #:use-module (gnu packages bison)
23bbd7dd 61 #:use-module (gnu packages boost)
06a035db 62 #:use-module (gnu packages check)
dae7661a 63 #:use-module (gnu packages cmake)
06a035db 64 #:use-module (gnu packages compression)
62ea44fc 65 #:use-module (gnu packages crypto)
06a035db
MB
66 #:use-module (gnu packages curl)
67 #:use-module (gnu packages cyrus-sasl)
255d1bbe 68 #:use-module (gnu packages dbm)
06a035db 69 #:use-module (gnu packages emacs)
da602679 70 #:use-module (gnu packages flex)
4c6aa73b
RJ
71 #:use-module (gnu packages gettext)
72 #:use-module (gnu packages glib)
06a035db 73 #:use-module (gnu packages gnupg)
16973071 74 #:use-module (gnu packages guile)
da1f7a9e 75 #:use-module (gnu packages time)
33c88fcb 76 #:use-module (gnu packages golang)
06a035db 77 #:use-module (gnu packages jemalloc)
708155df 78 #:use-module (gnu packages language)
686144e9 79 #:use-module (gnu packages libevent)
5f96f303 80 #:use-module (gnu packages linux)
d39a84e8 81 #:use-module (gnu packages man)
5f96f303 82 #:use-module (gnu packages ncurses)
d3c6ad0a 83 #:use-module (gnu packages parallel)
77631745 84 #:use-module (gnu packages pcre)
06a035db 85 #:use-module (gnu packages perl)
5ccde207 86 #:use-module (gnu packages perl-check)
cabe8f18 87 #:use-module (gnu packages perl-web)
4c6aa73b 88 #:use-module (gnu packages pkg-config)
d3c6ad0a 89 #:use-module (gnu packages popt)
06a035db 90 #:use-module (gnu packages python)
9763102b 91 #:use-module (gnu packages python-crypto)
44d10b1f 92 #:use-module (gnu packages python-xyz)
4c6aa73b 93 #:use-module (gnu packages rdf)
06a035db 94 #:use-module (gnu packages readline)
afcbb020 95 #:use-module (gnu packages ruby)
6bbbca90 96 #:use-module (gnu packages serialization)
cd0322a3 97 #:use-module (gnu packages sqlite)
06a035db 98 #:use-module (gnu packages tcl)
33c88fcb
CB
99 #:use-module (gnu packages terminals)
100 #:use-module (gnu packages textutils)
06a035db 101 #:use-module (gnu packages tls)
6bbbca90 102 #:use-module (gnu packages valgrind)
dae7661a 103 #:use-module (gnu packages web)
77631745 104 #:use-module (gnu packages xml)
0e1b262e 105 #:use-module ((guix licenses) #:prefix license:)
5f96f303
LC
106 #:use-module (guix packages)
107 #:use-module (guix download)
da602679 108 #:use-module (guix bzr-download)
16973071 109 #:use-module (guix git-download)
5f96f303 110 #:use-module (guix build-system gnu)
58071723 111 #:use-module (guix build-system go)
274da61d 112 #:use-module (guix build-system perl)
4d98bfaf 113 #:use-module (guix build-system python)
afcbb020 114 #:use-module (guix build-system ruby)
77631745 115 #:use-module (guix build-system cmake)
6e385b76 116 #:use-module (guix build-system scons)
51b0f09e 117 #:use-module ((guix build utils) #:hide (which))
329d13b8 118 #:use-module (guix utils)
29cfbfca 119 #:use-module (srfi srfi-1)
5f96f303
LC
120 #:use-module (srfi srfi-26)
121 #:use-module (ice-9 match))
122
4c6aa73b
RJ
123(define-public 4store
124 (package
125 (name "4store")
126 (version "1.1.6")
127 (source (origin
128 (method url-fetch)
bbf9092b 129 (uri (string-append "https://github.com/4store/4store/archive/v"
4c6aa73b
RJ
130 version ".tar.gz"))
131 (file-name (string-append name "-" version ".tar.gz"))
132 (sha256
133 (base32 "004fmcf1w75zhc1x3zc6kc97j4jqn2v5nhk6yb3z3cpfrhzi9j50"))
ea09f99f
RJ
134 (patches (search-patches "4store-unset-preprocessor-directive.patch"
135 "4store-fix-buildsystem.patch"))))
4c6aa73b
RJ
136 (build-system gnu-build-system)
137 (native-inputs
138 `(("perl" ,perl)
139 ("python" ,python-2)
140 ("autoconf" ,autoconf)
141 ("automake" ,automake)
b94a6ca0 142 ("gettext" ,gettext-minimal)
4c6aa73b 143 ("libtool" ,libtool)
74c8b174 144 ("pcre" ,pcre "bin") ;for 'pcre-config'
4c6aa73b
RJ
145 ("pkg-config" ,pkg-config)))
146 (inputs
147 `(("glib" ,glib)
148 ("rasqal" ,rasqal)
149 ("libxml2" ,libxml2)
150 ("raptor2" ,raptor2)
151 ("readline" ,readline)
152 ("avahi" ,avahi)
4c6aa73b
RJ
153 ("cyrus-sasl" ,cyrus-sasl)
154 ("openssl" ,openssl)
155 ("util-linux" ,util-linux)))
156 (arguments
157 `(#:phases
158 (modify-phases %standard-phases
d10092b8 159 (add-after 'unpack 'generate-configure
4c6aa73b 160 (lambda _
96272e28 161 (invoke "sh" "autogen.sh"))))))
4c6aa73b 162 ;; http://www.4store.org has been down for a while now.
bbf9092b 163 (home-page "https://github.com/4store/4store")
4c6aa73b
RJ
164 (synopsis "Clustered RDF storage and query engine")
165 (description "4store is a RDF/SPARQL store written in C, supporting
166either single machines or networked clusters.")
ba8b9f8d 167 (license license:gpl3+)))
4c6aa73b 168
58071723
CB
169(define-public go-gopkg.in-mgo.v2
170 (package
171 (name "go-gopkg.in-mgo.v2")
172 (version "2016.08.01")
173 (source (origin
174 (method git-fetch)
175 (uri (git-reference
176 (url "https://github.com/go-mgo/mgo")
177 (commit (string-append "r" version))))
178 (file-name (git-file-name name version))
179 (sha256
180 (base32
181 "0rwbi1z63w43b0z9srm8m7iz1fdwx7bq7n2mz862d6liiaqa59jd"))))
182 (build-system go-build-system)
183 (arguments
184 `(#:import-path "gopkg.in/mgo.v2"
185 ;; TODO: The tests fail as MongoDB fails to start
186 ;; Error parsing command line: unrecognised option '--chunkSize'
187 #:tests? #f
188 #:phases
189 (modify-phases %standard-phases
190 (delete 'reset-gzip-timestamps)
191 (add-before 'check 'start-mongodb
192 (lambda* (#:key tests? #:allow-other-keys)
96272e28
MW
193 (when tests?
194 (with-directory-excursion "src/gopkg.in/mgo.v2"
195 (invoke "make" "startdb")))
196 #t))
58071723
CB
197 (add-after 'check 'stop'mongodb
198 (lambda* (#:key tests? #:allow-other-keys)
96272e28
MW
199 (when tests?
200 (with-directory-excursion "src/gopkg.in/mgo.v2"
201 (invoke "make" "stopdb")))
202 #t)))))
58071723
CB
203 (native-inputs
204 `(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
205 ("mongodb" ,mongodb)
206 ("daemontools" ,daemontools)))
207 (synopsis "@code{mgo} offers a rich MongoDB driver for Go.")
208 (description
209 "@code{mgo} (pronounced as mango) is a MongoDB driver for the Go language.
210It implements a rich selection of features under a simple API following
211standard Go idioms.")
212 (home-page "http://labix.org/mgo")
213 (license license:bsd-2)))
214
afcbb020
CB
215(define-public es-dump-restore
216 (package
217 (name "es-dump-restore")
218 (version "2.1.0")
219 (source
220 (origin
221 (method url-fetch)
222 (uri (rubygems-uri "es_dump_restore" version))
223 (sha256
224 (base32
225 "020yk7f1hw48clmf5501z3xv9shsdchyymcv0y2cci2c1xvr1mim"))))
226 (build-system ruby-build-system)
227 (arguments
0076f5a9 228 '(#:tests? #f)) ;; No testsuite.
afcbb020
CB
229 (propagated-inputs
230 `(("ruby-httpclient" ,ruby-httpclient)
231 ("ruby-multi-json" ,ruby-multi-json)
232 ("ruby-progress_bar" ,ruby-progress_bar)
233 ("ruby-rubyzip" ,ruby-rubyzip)
234 ("ruby-thor" ,ruby-thor)))
235 (synopsis "Utility for dumping and restoring ElasticSearch indexes")
236 (description
237 "This package provides a utility for dumping the contents of an
238ElasticSearch index to a compressed file and restoring the dumpfile back to an
239ElasticSearch server")
240 (home-page "https://github.com/patientslikeme/es_dump_restore")
241 (license license:expat)))
242
b9f771a7
MB
243(define-public leveldb
244 (package
245 (name "leveldb")
3a32be71 246 (version "1.22")
b9f771a7 247 (source (origin
ad7c77fd
MB
248 (method git-fetch)
249 (uri (git-reference
250 (url "https://github.com/google/leveldb")
5cc013f0 251 (commit version)))
ad7c77fd 252 (file-name (git-file-name name version))
b9f771a7
MB
253 (sha256
254 (base32
3a32be71 255 "0qrnhiyq7r4wa1a4wi82zgns35smj94mcjsc7kfs1k6ia9ys79z7"))))
5cc013f0 256 (build-system cmake-build-system)
b9f771a7 257 (arguments
5cc013f0 258 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON" "-DLEVELDB_BUILD_TESTS=ON")))
b9f771a7
MB
259 (inputs
260 `(("snappy" ,snappy)))
261 (home-page "http://leveldb.org/")
262 (synopsis "Fast key-value storage library")
263 (description
264 "LevelDB is a fast key-value storage library that provides an ordered
265mapping from string keys to string values.")
ba8b9f8d 266 (license license:bsd-3)))
b9f771a7 267
686144e9
CB
268(define-public memcached
269 (package
270 (name "memcached")
fe74e6ac 271 (version "1.5.13")
686144e9
CB
272 (source
273 (origin
274 (method url-fetch)
275 (uri (string-append
276 "https://memcached.org/files/memcached-" version ".tar.gz"))
277 (sha256
fe74e6ac 278 (base32 "0qsdkjrns4f02lmabq8c7mzl5n4382q2p6a0dvmsjdcpjisagqb1"))))
686144e9
CB
279 (build-system gnu-build-system)
280 (inputs
281 `(("libevent" ,libevent)
282 ("cyrus-sasl" ,cyrus-sasl)))
283 (home-page "https://memcached.org/")
61d996b9
TGR
284 (synopsis "In-memory caching service")
285 (description "Memcached is an in-memory key-value store. It has a small
686144e9
CB
286and generic API, and was originally intended for use with dynamic web
287applications.")
288 (license license:bsd-3)))
289
da602679
MC
290(define-public libmemcached
291 (package
292 (name "libmemcached")
293 (version "1.0.18")
294 ;; We build from the sources since we want to build the extra HTML
295 ;; documentation which is not included with the release.
296 (source (origin
297 (method bzr-fetch)
298 (uri (bzr-reference
299 (url "lp:libmemcached/1.0")
300 (revision (string-append "tag:" version))))
301 (file-name (string-append name "-" version "-checkout"))
302 (sha256
303 (base32
304 "1842s4dxdh21gdr46q4dgxigidcs6dkqnbnqjwb9l8r0bqx5nb10"))))
305 (build-system gnu-build-system)
306 (native-inputs
307 `(("memcached" ,memcached)
308 ("libtool" ,libtool)
309 ("autoconf" ,autoconf)
310 ("automake" ,automake)
311 ("bison" ,bison)
312 ("flex" ,flex)
313 ("perl" ,perl)
314 ("python-sphinx" ,python-sphinx))) ;to build the HTML doc.
315 (inputs
316 `(("libevent" ,libevent)
317 ("cyrus-sasl" ,cyrus-sasl)))
318 (outputs '("out" "doc"))
319 (arguments
320 '(#:phases
321 (modify-phases %standard-phases
322 (add-before 'bootstrap 'fix-configure.ac
323 ;; Move the AC_CONFIG_AUX_DIR macro use under AC_INIT, otherwise we
324 ;; get the error ``configure: error: cannot find install-sh,
325 ;; install.sh, or shtool in "." "./.." "./../.."`` (see:
326 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19539 and
327 ;; https://bugs.launchpad.net/libmemcached/+bug/1803922).
328 (lambda _
329 (delete-file "bootstrap.sh") ;not useful in the context of Guix
330 (substitute* "configure.ac"
331 (("^AC_CONFIG_AUX_DIR\\(\\[build-aux\\]\\).*") "")
332 (("(^AC_INIT.*)" anchor)
333 (string-append anchor "AC_CONFIG_AUX_DIR([build-aux])\n")))
334 #t))
335 (add-before 'bootstrap 'disable-failing-tests
336 ;; See: https://bugs.launchpad.net/libmemcached/+bug/1803926
337 (lambda _
338 ;; Mark some heavily failing test suites as expected to fail.
339 (substitute* "Makefile.am"
340 (("(XFAIL_TESTS =[^\n]*)" xfail_tests)
341 (string-append xfail_tests " tests/testudp"
342 " tests/libmemcached-1.0/testapp"
343 " tests/libmemcached-1.0/testsocket")))
344 ;; Disable two tests of the unittest test suite.
345 (substitute* "libtest/unittest.cc"
346 ((".*echo_fubar_BINARY \\},.*") "")
347 ((".*application_doesnotexist_BINARY \\},.*") ""))
348 #t))
349 (add-after 'disable-dns-tests 'build-and-install-html-doc
350 (lambda* (#:key outputs #:allow-other-keys)
351 (let ((html (string-append (assoc-ref outputs "doc")
352 "/share/doc/libmemcached/html/")))
353 (invoke "make" "install-html")
354 ;; Cleanup useless files.
355 (for-each delete-file-recursively
356 (map (lambda (x) (string-append html x))
357 '("_sources" ".doctrees" ".buildinfo"))))
358 #t)))))
359 (home-page "https://libmemcached.org/")
360 (synopsis "C++ library for memcached")
361 (description "libMemcached is a library to use memcached in C/C++
362applications. It comes with a complete reference guide and documentation of
363the API, and provides features such as:
364@itemize
365@item Asynchronous and synchronous transport support
366@item Consistent hashing and distribution
367@item Tunable hashing algorithm to match keys
368@item Access to large object support
369@item Local replication
370@end itemize")
371 (license license:bsd-3)))
372
063edf92
MC
373(define-public python-pylibmc
374 (package
375 (name "python-pylibmc")
376 (version "1.6.0")
377 (source
378 (origin
379 (method url-fetch)
380 (uri (pypi-uri "pylibmc" version))
381 (sha256
382 (base32
383 "1n6nvvhl0g52gpzzwdj1my6049xljkfwyxxygnwda9smrbj7pyay"))))
384 (build-system python-build-system)
385 (arguments
386 '(#:phases
387 (modify-phases %standard-phases
388 (add-before 'check 'start-memcached-daemon
389 ;; The test suite requires a memcached server.
390 (lambda _
391 (invoke "memcached" "-d"))))))
392 (native-inputs
393 `(("memcached" ,memcached)
394 ("python-nose" ,python-nose)))
395 (inputs
396 `(("libmemcached" ,libmemcached)
397 ("zlib" ,zlib)
398 ("cyrus-sasl" ,cyrus-sasl)))
399 (home-page
400 "http://sendapatch.se/projects/pylibmc/")
401 (synopsis
402 "Python client for memcached")
403 (description
404 "@code{pylibmc} is a client in Python for memcached. It is a wrapper
405around TangentOrg’s libmemcached library, and can be used as a drop-in
406replacement for the code@{python-memcached} library.")
407 (license license:bsd-3)))
408
409(define-public python2-pylibmc
410 (package-with-python2 python-pylibmc))
411
6bbbca90
CB
412(define-public mongodb
413 (package
414 (name "mongodb")
f1c49e75 415 (version "3.4.10")
6bbbca90
CB
416 (source (origin
417 (method url-fetch)
418 (uri (string-append "https://github.com/mongodb/mongo/archive/r"
419 version ".tar.gz"))
420 (file-name (string-append name "-" version ".tar.gz"))
421 (sha256
f1c49e75 422 (base32 "0676lvkljj7a5hdhv78dbykqnqrj9lbn9799mi84b8vbnzsq961r"))
51b0f09e
EF
423 (modules '((guix build utils)))
424 (snippet
425 '(begin
426 (for-each (lambda (dir)
427 (delete-file-recursively
428 (string-append "src/third_party/" dir)))
429 '("pcre-8.41" "scons-2.5.0" "snappy-1.1.3"
430 "valgrind-3.11.0" "wiredtiger"
6cbee49d
MW
431 "yaml-cpp-0.5.3" "zlib-1.2.8"))
432 #t))
6bbbca90
CB
433 (patches
434 (list
435 (search-patch "mongodb-support-unknown-linux-distributions.patch")))))
6e385b76 436 (build-system scons-build-system)
6bbbca90
CB
437 (inputs
438 `(("openssl" ,openssl)
439 ("pcre" ,pcre)
319b52c3
EF
440 ,@(match (%current-system)
441 ((or "x86_64-linux" "aarch64-linux" "mips64el-linux")
442 `(("wiredtiger" ,wiredtiger)))
443 (_ `()))
6bbbca90
CB
444 ("yaml-cpp" ,yaml-cpp)
445 ("zlib" ,zlib)
51b0f09e 446 ("snappy" ,snappy)))
6bbbca90 447 (native-inputs
6e385b76 448 `(("valgrind" ,valgrind)
90205b62 449 ("perl" ,perl)
61506fe5 450 ("python" ,python-2)
90205b62
CB
451 ("python2-pymongo" ,python2-pymongo)
452 ("python2-pyyaml" ,python2-pyyaml)
453 ("tzdata" ,tzdata)))
6bbbca90 454 (arguments
6e385b76
AI
455 `(#:scons ,scons-python2
456 #:phases
6bbbca90
CB
457 (let ((common-options
458 `(;; "--use-system-tcmalloc" TODO: Missing gperftools
459 "--use-system-pcre"
29cfbfca
EF
460 ;; wiredtiger is 64-bit only
461 ,,(if (any (cute string-prefix? <> (or (%current-target-system)
462 (%current-system)))
463 '("i686-linux" "armhf-linux"))
464 ``"--wiredtiger=off"
319b52c3 465 ``"--use-system-wiredtiger")
6bbbca90
CB
466 ;; TODO
467 ;; build/opt/mongo/db/fts/unicode/string.o failed: Error 1
468 ;; --use-system-boost
469 "--use-system-snappy"
470 "--use-system-zlib"
471 "--use-system-valgrind"
472 ;; "--use-system-stemmer" TODO: Missing relevant package
473 "--use-system-yaml"
474 "--disable-warnings-as-errors"
475 ,(format #f "--jobs=~a" (parallel-job-count))
476 "--ssl")))
477 (modify-phases %standard-phases
6bbbca90
CB
478 (add-after 'unpack 'scons-propagate-environment
479 (lambda _
480 ;; Modify the SConstruct file to arrange for
481 ;; environment variables to be propagated.
482 (substitute* "SConstruct"
483 (("^env = Environment\\(")
484 "env = Environment(ENV=os.environ, "))
485 #t))
486 (add-after 'unpack 'create-version-file
487 (lambda _
488 (call-with-output-file "version.json"
489 (lambda (port)
490 (display ,(simple-format #f "{
491 \"version\": \"~A\"
492}" version) port)))
493 #t))
494 (replace 'build
495 (lambda _
d9bcdfce 496 (apply invoke `("scons"
6bbbca90 497 ,@common-options
d9bcdfce 498 "mongod" "mongo" "mongos"))))
6bbbca90 499 (replace 'check
90205b62
CB
500 (lambda* (#:key tests? inputs #:allow-other-keys)
501 (setenv "TZDIR"
502 (string-append (assoc-ref inputs "tzdata")
503 "/share/zoneinfo"))
96272e28
MW
504 (when tests?
505 ;; Note that with the tests, especially the unittests, the
506 ;; build can take up to ~45GB of space, as many tests are
507 ;; individual executable files, with some being hundreds of
508 ;; megabytes in size.
509 (apply invoke `("scons" ,@common-options "dbtest" "unittests"))
510 (substitute* "build/unittests.txt"
511 ;; TODO: Don't run the async_stream_test, as it hangs
512 (("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
513 "")
514 ;; TODO: This test fails
515 ;; Expected 0UL != disks.size() (0 != 0) @src/mongo/util/procparser_test.cpp:476
516 (("^build\\/opt\\/mongo\\/util\\/procparser\\_test\n$")
517 ""))
518 (invoke "python" "buildscripts/resmoke.py"
519 "--suites=dbtest,unittests"
520 (format #f "--jobs=~a" (parallel-job-count))))
521 #t))
6bbbca90 522 (replace 'install
96272e28
MW
523 (lambda* (#:key outputs #:allow-other-keys)
524 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
6bbbca90
CB
525 (install-file "mongod" bin)
526 (install-file "mongos" bin)
527 (install-file "mongo" bin))
528 #t))))))
529 (home-page "https://www.mongodb.org/")
530 (synopsis "High performance and high availability document database")
531 (description
532 "Mongo is a high-performance, high availability, schema-free
533document-oriented database. A key goal of MongoDB is to bridge the gap
534between key/value stores (which are fast and highly scalable) and traditional
535RDBMS systems (which are deep in functionality).")
536 (license (list license:agpl3
537 ;; Some parts are licensed under the Apache License
538 license:asl2.0))))
539
7cbf06d8
TGR
540;; XXX When updating, check whether boost-for-mysql is still needed.
541;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
5f96f303
LC
542(define-public mysql
543 (package
544 (name "mysql")
8ecf3f7e 545 (version "5.7.23")
5f96f303
LC
546 (source (origin
547 (method url-fetch)
23bbd7dd 548 (uri (list (string-append
7fe3a57a 549 "https://dev.mysql.com/get/Downloads/MySQL-"
23bbd7dd
EF
550 (version-major+minor version) "/"
551 name "-" version ".tar.gz")
552 (string-append
7fe3a57a 553 "https://downloads.mysql.com/archives/get/file/"
23bbd7dd 554 name "-" version ".tar.gz")))
5f96f303
LC
555 (sha256
556 (base32
8ecf3f7e 557 "0rbc3xsc11lq2dm0ip6gxa16c06hi74scb97x5cw7yhbabaz4c07"))))
329d13b8
SB
558 (build-system cmake-build-system)
559 (arguments
69419655 560 `(#:configure-flags
329d13b8
SB
561 '("-DBUILD_CONFIG=mysql_release"
562 "-DWITH_SSL=system"
563 "-DWITH_ZLIB=system"
564 "-DDEFAULT_CHARSET=utf8"
565 "-DDEFAULT_COLLATION=utf8_general_ci"
566 "-DMYSQL_DATADIR=/var/lib/mysql"
567 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
568 "-DINSTALL_INFODIR=share/mysql/docs"
569 "-DINSTALL_MANDIR=share/man"
570 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
571 "-DINSTALL_SCRIPTDIR=bin"
572 "-DINSTALL_INCLUDEDIR=include/mysql"
573 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
574 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
575 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
576 "-DINSTALL_DOCDIR=share/mysql/docs"
577 "-DINSTALL_SHAREDIR=share/mysql"
578 ;; Get rid of test data.
579 "-DINSTALL_MYSQLTESTDIR="
3f289db6
LC
580 "-DINSTALL_SQLBENCHDIR=")
581 #:phases (modify-phases %standard-phases
6a52df50
LC
582 (add-after
583 'install 'remove-extra-binaries
584 (lambda* (#:key outputs #:allow-other-keys)
585 (let ((out (assoc-ref outputs "out")))
586 ;; Remove the 3 *_embedded files, which weigh in at
587 ;; 14 MiB each.
588 (for-each delete-file
589 (find-files (string-append out "/bin")
590 "_embedded$"))
7d099cbe 591 #t))))))
329d13b8
SB
592 (native-inputs
593 `(("bison" ,bison)
594 ("perl" ,perl)))
5f96f303 595 (inputs
7cbf06d8 596 `(("boost" ,boost-for-mysql)
23bbd7dd
EF
597 ("libaio" ,libaio)
598 ("ncurses" ,ncurses)
5f96f303 599 ("openssl" ,openssl)
23bbd7dd 600 ("zlib" ,zlib)))
7fe3a57a 601 (home-page "https://www.mysql.com/")
9e771e3b 602 (synopsis "Fast, easy to use, and popular database")
5f96f303
LC
603 (description
604 "MySQL is a fast, reliable, and easy to use relational database
605management system that supports the standardized Structured Query
606Language.")
ba8b9f8d 607 (license license:gpl2)))
5f96f303 608
77631745
SB
609(define-public mariadb
610 (package
611 (name "mariadb")
0ce64334 612 (version "10.1.38")
77631745
SB
613 (source (origin
614 (method url-fetch)
615 (uri (string-append "https://downloads.mariadb.org/f/"
616 name "-" version "/source/"
617 name "-" version ".tar.gz"))
618 (sha256
619 (base32
0ce64334 620 "0zq77w3ff9q781fn8cv46vy1v4ggb8vjarjvk51k653x4gyg9wfa"))
fb76ef84 621 (patches (search-patches "mariadb-client-test-32bit.patch"))
2001d2da
MB
622 (modules '((guix build utils)))
623 (snippet
624 '(begin
625 ;; Delete bundled snappy and xz.
626 (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
4333d48a
MB
627 (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
628 ;; This file checks that the bundled sources are present and
629 ;; declares build procedures for them.
630 (("^include\\(TokuThirdParty\\)") ""))
631 (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
632 ;; Don't attempt to use the procedures we just removed.
633 ((" build_lzma build_snappy") ""))
2001d2da
MB
634
635 ;; Preserve CMakeLists.txt for these.
636 (for-each (lambda (file)
637 (unless (string-suffix? "CMakeLists.txt" file)
638 (delete-file file)))
639 (append (find-files "extra/yassl")
640 (find-files "pcre") (find-files "zlib")))
641 #t))))
77631745
SB
642 (build-system cmake-build-system)
643 (arguments
5193ae64 644 `(#:configure-flags
77631745 645 '("-DBUILD_CONFIG=mysql_release"
6cf8e576
LF
646 ;; Linking with libarchive fails, like this:
647
648 ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
649 ;; relocation R_X86_64_32 against `.bss' can not be used when
650 ;; making a shared object; recompile with -fPIC
651
652 ;; For now, disable the features that that use libarchive (xtrabackup).
653 "-DWITH_LIBARCHIVE=OFF"
654
2001d2da
MB
655 ;; Ensure the system libraries are used.
656 "-DWITH_JEMALLOC=yes"
657 "-DWITH_PCRE=system"
658 "-DWITH_SSL=system"
659 "-DWITH_ZLIB=system"
660
77631745
SB
661 "-DDEFAULT_CHARSET=utf8"
662 "-DDEFAULT_COLLATION=utf8_general_ci"
663 "-DMYSQL_DATADIR=/var/lib/mysql"
664 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
665 "-DINSTALL_INFODIR=share/mysql/docs"
666 "-DINSTALL_MANDIR=share/man"
667 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
668 "-DINSTALL_SCRIPTDIR=bin"
669 "-DINSTALL_INCLUDEDIR=include/mysql"
670 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
671 "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
672 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
673 "-DINSTALL_DOCDIR=share/mysql/docs"
4c27ea06 674 "-DINSTALL_SHAREDIR=share")
77631745
SB
675 #:phases
676 (modify-phases %standard-phases
4333d48a 677 (add-after 'unpack 'fix-pcre-detection
2001d2da
MB
678 (lambda _
679 ;; The bundled PCRE in MariaDB has a patch that was upstreamed
680 ;; in version 8.34. Unfortunately the upstream patch behaves
681 ;; slightly differently and the build system fails to detect it.
682 ;; See <https://bugs.exim.org/show_bug.cgi?id=2173>.
683 ;; XXX: Consider patching PCRE instead.
684 (substitute* "cmake/pcre.cmake"
685 ((" OR NOT PCRE_STACK_SIZE_OK") ""))
2001d2da 686 #t))
3869f39e
MB
687 (add-after 'unpack 'adjust-tests
688 (lambda _
689 (let ((disabled-tests
690 '(;; These fail because root@hostname == root@localhost in
691 ;; the build environment, causing a user count mismatch.
692 ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
693 "main.join_cache"
694 "main.explain_non_select"
1d957c79 695 "main.stat_tables_innodb"
3418e43b 696 "roles.acl_statistics"
69fb26d4
MB
697
698 ;; This file contains a time bomb which makes it fail after
0ce64334 699 ;; 2030-12-31. See <https://bugs.gnu.org/34351> for details.
38f77be4 700 "main.mysqldump"
69fb26d4
MB
701
702 ;; XXX: Fails sporadically.
38f77be4 703 "innodb_fts.crash_recovery"
3418e43b
MB
704
705 ;; FIXME: This test fails on i686:
706 ;; -myisampack: Can't create/write to file (Errcode: 17 "File exists")
707 ;; +myisampack: Can't create/write to file (Errcode: 17 "File exists)
708 ;; When running "myisampack --join=foo/t3 foo/t1 foo/t2"
709 ;; (all three tables must exist and be identical)
710 ;; in a loop it produces the same error around 1/240 times.
711 ;; montywi on #maria suggested removing the real_end check in
712 ;; "strings/my_vsnprintf.c" on line 503, yet it still does not
713 ;; reach the ending quote occasionally. Disable it for now.
62694caa
EF
714 "main.myisampack"
715 ;; FIXME: This test fails on armhf-linux:
716 "mroonga/storage.index_read_multiple_double"))
3869f39e
MB
717
718 ;; This file contains a list of known-flaky tests for this
719 ;; release. Append our own items.
720 (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
721 (for-each (lambda (test)
722 (format unstable-tests "~a : ~a\n"
723 test "Disabled in Guix"))
724 disabled-tests)
725 (close-port unstable-tests)
726
727 (substitute* "mysql-test/mysql-test-run.pl"
728 (("/bin/ls") (which "ls"))
729 (("/bin/sh") (which "sh")))
730 #t)))
5b4d2e40
MB
731 (add-before 'configure 'disable-plugins
732 (lambda _
733 (let ((disable-plugin (lambda (name)
734 (call-with-output-file
735 (string-append "plugin/" name
736 "/CMakeLists.txt")
737 (lambda (port)
738 (format port "\n")))))
03335824 739 (disabled-plugins '(;; XXX: Causes a test failure.
3869f39e 740 "disks")))
5b4d2e40
MB
741 (for-each disable-plugin disabled-plugins)
742 #t)))
3869f39e
MB
743 (replace 'check
744 (lambda* (#:key (tests? #t) #:allow-other-keys)
745 (if tests?
746 (with-directory-excursion "mysql-test"
747 (invoke "./mtr" "--verbose"
3418e43b 748 "--retry=3"
71179b35
MB
749 "--testcase-timeout=40"
750 "--suite-timeout=600"
3869f39e
MB
751 "--parallel" (number->string (parallel-job-count))
752 "--skip-test-list=unstable-tests"))
753 (format #t "test suite not run~%"))
754 #t))
77631745
SB
755 (add-after
756 'install 'post-install
757 (lambda* (#:key outputs #:allow-other-keys)
758 (let* ((out (assoc-ref outputs "out"))
759 (test (assoc-ref outputs "test")))
760 (substitute* (string-append out "/bin/mysql_install_db")
761 (("basedir=\"\"")
762 (string-append "basedir=\"" out "\"")))
763 ;; Remove unneeded files for testing.
764 (with-directory-excursion out
765 (for-each delete-file-recursively
766 '("data" "mysql-test" "sql-bench"
963157f1 767 "share/man/man1/mysql-test-run.pl.1"))
43cec3fb
MB
768 ;; Delete huge and unnecessary executables.
769 (for-each delete-file (find-files "bin" "(test|embedded)"))
963157f1
MB
770 ;; And static libraries.
771 (for-each delete-file (find-files "lib" "\\.a$")))
841ee2a8 772 #t))))))
77631745
SB
773 (native-inputs
774 `(("bison" ,bison)
03335824 775 ("perl" ,perl)))
77631745
SB
776 (inputs
777 `(("jemalloc" ,jemalloc)
778 ("libaio" ,libaio)
779 ("libxml2" ,libxml2)
780 ("ncurses" ,ncurses)
77631745 781 ("pcre" ,pcre)
2001d2da
MB
782 ("snappy" ,snappy)
783 ("xz" ,xz)
77631745 784 ("zlib" ,zlib)))
22f5c076
MB
785 (propagated-inputs
786 ;; mariadb.pc says -lssl -lcrypto, so propagate it.
787 `(("openssl" ,openssl)))
3869f39e
MB
788 ;; The test suite is very resource intensive and can take more than three
789 ;; hours on a x86_64 system. Give slow and busy machines some leeway.
790 (properties '((timeout . 64800))) ;18 hours
77631745
SB
791 (home-page "https://mariadb.org/")
792 (synopsis "SQL database server")
793 (description
794 "MariaDB is a multi-user and multi-threaded SQL database server, designed
795as a drop-in replacement of MySQL.")
ba8b9f8d 796 (license license:gpl2)))
77631745 797
97dd1b15 798;; Don't forget to update the other postgresql packages when upgrading this one.
5f96f303
LC
799(define-public postgresql
800 (package
801 (name "postgresql")
2950d33c 802 (version "10.7")
5f96f303
LC
803 (source (origin
804 (method url-fetch)
dbeaf8f2 805 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
9020890b 806 version "/postgresql-" version ".tar.bz2"))
5f96f303
LC
807 (sha256
808 (base32
2950d33c 809 "1piyfcrcqscjhnnwn91kdvr764s7d0qz4lgygf9bl6qc71ji1vdz"))
c336567d 810 (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))
5f96f303 811 (build-system gnu-build-system)
dd213082 812 (arguments
8b7e6d00 813 `(#:configure-flags '("--with-uuid=e2fs" "--with-openssl")
b7aa3f5d 814 #:phases
dd213082
JD
815 (modify-phases %standard-phases
816 (add-before 'configure 'patch-/bin/sh
817 (lambda _
818 ;; Refer to the actual shell.
819 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
820 "src/bin/psql/command.c")
821 (("/bin/sh") (which "sh")))
b7aa3f5d
DM
822 #t))
823 (add-after 'build 'build-contrib
824 (lambda _
1fbad3ad 825 (invoke "make" "-C" "contrib")))
b7aa3f5d
DM
826 (add-after 'install 'install-contrib
827 (lambda _
1fbad3ad 828 (invoke "make" "-C" "contrib" "install"))))))
5f96f303
LC
829 (inputs
830 `(("readline" ,readline)
b7aa3f5d 831 ("libuuid" ,util-linux)
8b7e6d00 832 ("openssl" ,openssl)
5f96f303 833 ("zlib" ,zlib)))
d887f420 834 (home-page "https://www.postgresql.org/")
5f96f303
LC
835 (synopsis "Powerful object-relational database system")
836 (description
837 "PostgreSQL is a powerful object-relational database system. It is fully
838ACID compliant, has full support for foreign keys, joins, views, triggers, and
839stored procedures (in multiple languages). It includes most SQL:2008 data
840types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
841TIMESTAMP. It also supports storage of binary large objects, including
842pictures, sounds, or video.")
ba8b9f8d 843 (license (license:x11-style "file://COPYRIGHT"))))
5f96f303 844
7658d89b
EF
845(define-public postgresql-9.6
846 (package
847 (inherit postgresql)
848 (name "postgresql")
0447a2a8 849 (version "9.6.13")
7658d89b
EF
850 (source (origin
851 (method url-fetch)
852 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
853 version "/postgresql-" version ".tar.bz2"))
854 (sha256
855 (base32
0447a2a8 856 "197964wb5pc5fx81a6mh9hlcrr9sgr3nqlpmljv6asi9aq0d5gpc"))))))
7658d89b 857
9763102b
TGR
858(define-public python-pymysql
859 (package
860 (name "python-pymysql")
4cb2f29e 861 (version "0.9.3")
9763102b
TGR
862 (source
863 (origin
864 (method url-fetch)
865 (uri (pypi-uri "PyMySQL" version))
866 (sha256
4cb2f29e 867 (base32 "1ry8lxgdc1p3k7gbw20r405jqi5lvhi5wk83kxdbiv8xv3f5kh6q"))))
9763102b
TGR
868 (build-system python-build-system)
869 (native-inputs
870 `(("python-unittest2" ,python-unittest2)))
871 (inputs
872 `(("python-cryptography" ,python-cryptography)))
873 (arguments
874 `(#:tests? #f)) ; tests expect a running MySQL
875 (home-page "https://github.com/PyMySQL/PyMySQL/")
876 (synopsis "Pure-Python MySQL driver")
877 (description
878 "PyMySQL is a pure-Python MySQL client library, based on PEP 249.
879Most public APIs are compatible with @command{mysqlclient} and MySQLdb.")
880 (license license:expat)))
881
882(define-public python2-pymysql
883 (package-with-python2 python-pymysql))
884
259a94e9
TD
885(define-public qdbm
886 (package
887 (name "qdbm")
888 (version "1.8.78")
889 (source
890 (origin
891 (method url-fetch)
892 (uri (string-append "http://fallabs.com/" name "/"
893 name "-" version ".tar.gz"))
894 (sha256
895 (base32
896 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
897 (build-system gnu-build-system)
898 (arguments
899 `( #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
900 (assoc-ref %outputs "out")
901 "/lib"))))
902 (home-page "http://fallabs.com/qdbm")
903 (synopsis "Key-value database")
904 (description "QDBM is a library of routines for managing a
905database. The database is a simple data file containing key-value
906pairs. Every key and value is serial bytes with variable length.
907Binary data as well as character strings can be used as a key or a
908value. There is no concept of data tables or data types. Records are
909organized in a hash table or B+ tree.")
910 (license license:lgpl2.1+)))
911
5f96f303
LC
912(define-public recutils
913 (package
914 (name "recutils")
c007e35d 915 (version "1.8")
5f96f303
LC
916 (source (origin
917 (method url-fetch)
918 (uri (string-append "mirror://gnu/recutils/recutils-"
919 version ".tar.gz"))
920 (sha256
921 (base32
c007e35d 922 "14xiln4immfsw8isnvwvq0h23f6z0wilpgsc4qzabnrzb5lsx3nz"))))
5f96f303
LC
923 (build-system gnu-build-system)
924
c007e35d 925 (arguments '(#:configure-flags
b747a9db
LF
926 (list (string-append "--with-bash-headers="
927 (assoc-ref %build-inputs "bash:include")
c007e35d 928 "/include/bash"))))
5f96f303 929
b8fc3622 930 (native-inputs `(("emacs" ,emacs-minimal)
7ae7ca0e 931 ("bc" ,bc)
b747a9db 932 ("bash:include" ,bash "include")
c007e35d
EF
933 ("check" ,check)
934 ("libuuid" ,util-linux)
935 ("pkg-config" ,pkg-config)))
5f96f303
LC
936
937 ;; TODO: Add more optional inputs.
5f96f303 938 (inputs `(("curl" ,curl)
c007e35d 939 ("libgcrypt" ,libgcrypt)))
5f96f303
LC
940 (synopsis "Manipulate plain text files as databases")
941 (description
942 "GNU Recutils is a set of tools and libraries for creating and
943manipulating text-based, human-editable databases. Despite being text-based,
944databases created with Recutils carry all of the expected features such as
c5779c93
LC
945unique fields, primary keys, time stamps and more. Many different field
946types are supported, as is encryption.")
ba8b9f8d 947 (license license:gpl3+)
6fd52309 948 (home-page "https://www.gnu.org/software/recutils/")))
5f96f303 949
d3c6ad0a
MB
950(define-public rocksdb
951 (package
952 (name "rocksdb")
5ae458be 953 (version "5.18.3")
d3c6ad0a 954 (source (origin
8dd36658
MB
955 (method git-fetch)
956 (uri (git-reference
957 (url "https://github.com/facebook/rocksdb")
958 (commit (string-append "v" version))))
959 (file-name (git-file-name name version))
d3c6ad0a
MB
960 (sha256
961 (base32
5ae458be 962 "1v2slmmr1dsgf8z0qcfg1y9x1al96859rg48b66p9nsawczd5zv9"))
d3c6ad0a
MB
963 (modules '((guix build utils)))
964 (snippet
965 '(begin
966 ;; TODO: unbundle gtest.
967 (delete-file "build_tools/gnu_parallel")
7fa9cca8
MB
968 (substitute* "Makefile"
969 (("build_tools/gnu_parallel") "parallel"))
d3c6ad0a
MB
970 #t))))
971 (build-system gnu-build-system)
972 (arguments
7fa9cca8
MB
973 `(#:make-flags (list "CC=gcc" "V=1"
974 ;; Ceph requires that RTTI is enabled.
975 "USE_RTTI=1"
d3c6ad0a 976 (string-append "INSTALL_PATH="
7fa9cca8
MB
977 (assoc-ref %outputs "out"))
978
979 ;; Running the full test suite takes hours and require
980 ;; a lot of disk space. Instead we only run a subset
981 ;; (see .travis.yml and Makefile).
982 "ROCKSDBTESTS_END=db_tailing_iter_test")
983 #:test-target "check_some"
d7b344c5
MB
984 ;; Many tests fail on 32-bit platforms. There are multiple reports about
985 ;; this upstream, but it's not going to be supported any time soon.
986 #:tests? (let ((system ,(or (%current-target-system)
987 (%current-system))))
988 (or (string-prefix? "x86_64-linux" system)
989 (string-prefix? "aarch64-linux" system)))
d3c6ad0a
MB
990 #:phases
991 (modify-phases %standard-phases
992 (add-after 'unpack 'patch-Makefile
993 (lambda _
994 (substitute* "Makefile"
f91c677c
MB
995 ;; Don't depend on the static library when installing.
996 (("install: install-static")
997 "install: install-shared")
d3c6ad0a
MB
998 (("#!/bin/sh") (string-append "#!" (which "sh"))))
999 #t))
1000 (delete 'configure)
d7b344c5
MB
1001 ;; The default target is only needed for tests and built on demand.
1002 (delete 'build)
1003 (add-before 'check 'disable-optimizations
1004 (lambda _
1005 ;; Prevent the build from passing '-march=native' to the compiler.
1006 (setenv "PORTABLE" "1")
1007 #t))
d3c6ad0a
MB
1008 (add-before 'check 'disable-failing-tests
1009 (lambda _
1010 (substitute* "Makefile"
1011 ;; These tests reliably fail due to "Too many open files".
1012 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
1013 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
1014 #t))
7fa9cca8 1015 (add-after 'check 'build
f91c677c 1016 ;; The default build target is a debug build for tests. The
7fa9cca8
MB
1017 ;; install target depends on the "shared_lib" release target
1018 ;; so we build it here for clarity.
1019 (lambda* (#:key (make-flags '()) parallel-build? #:allow-other-keys)
1020 (apply invoke "make" "shared_lib"
1021 `(,@(if parallel-build?
1022 `("-j" ,(number->string (parallel-job-count)))
1023 '())
1024 ,@make-flags)))))))
d3c6ad0a
MB
1025 (native-inputs
1026 `(("parallel" ,parallel)
1027 ("perl" ,perl)
1028 ("procps" ,procps)
77e52190
MB
1029 ("python" ,python-2)
1030 ("which" ,which)))
d3c6ad0a
MB
1031 (inputs
1032 `(("bzip2" ,bzip2)
1033 ("gflags" ,gflags)
1034 ("jemalloc" ,jemalloc)
1035 ("lz4" ,lz4)
1036 ("snappy" ,snappy)
1037 ("zlib" ,zlib)))
1038 (home-page "http://rocksdb.org/")
1039 (synopsis "Persistent key-value store for fast storage")
1040 (description
1041 "RocksDB is a library that forms the core building block for a fast
1042key-value server, especially suited for storing data on flash drives. It
1043has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
1044between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
1045(RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
1046compactions, making it specially suitable for storing multiple terabytes of
1047data in a single database. RocksDB is partially based on @code{LevelDB}.")
7fa9cca8
MB
1048 ;; RocksDB is dual licensed under GPL2 and ASL 2.0. Some header
1049 ;; files carry the 3-clause BSD license.
1050 (license (list license:gpl2 license:asl2.0 license:bsd-3))))
d3c6ad0a 1051
b92d02d9
RJ
1052(define-public sparql-query
1053 (package
1054 (name "sparql-query")
1055 (version "1.1")
1056 (source (origin
1057 (method url-fetch)
1058 (uri (string-append "https://github.com/tialaramex/"
1059 name "/archive/" version ".tar.gz"))
1060 (sha256
1061 (base32 "0yq3k20472rv8npcc420q9ab6idy584g5y0q501d360k5q0ggr8w"))
1062 (file-name (string-append name "-" version ".tar.gz"))))
1063 (build-system gnu-build-system)
1064 (inputs
1065 `(("readline" ,readline)
1066 ("ncurses" ,ncurses)
1067 ("glib" ,glib)
1068 ("libxml2" ,libxml2)
1069 ("curl" ,curl)))
1070 (native-inputs
1071 `(("pkg-config" ,pkg-config)))
1072 (arguments
1073 `(#:make-flags '("CC=gcc")
1074 #:phases
1075 (modify-phases %standard-phases
1076 (delete 'configure)
1077 ;; The Makefile uses git to obtain versioning information. This phase
1078 ;; substitutes the git invocation with the package version.
1079 (add-after 'unpack 'remove-git-dependency
1080 (lambda _
1081 (substitute* "Makefile"
1082 (("^gitrev :=.*$")
96272e28
MW
1083 (string-append "gitrev = \"v" ,version "\"")))
1084 #t))
b92d02d9
RJ
1085 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
1086 ;; This replacement does the same thing, except for using $PREFIX/bin
1087 ;; instead.
1088 (replace 'install
1089 (lambda* (#:key outputs #:allow-other-keys)
1090 (let* ((out (assoc-ref outputs "out"))
1091 (bin (string-append out "/bin")))
1092 (install-file "sparql-query" bin)
96272e28
MW
1093 (symlink (string-append bin "/sparql-query")
1094 (string-append bin "/sparql-update")))
1095 #t))
b92d02d9
RJ
1096 (replace 'check
1097 (lambda* (#:key make-flags #:allow-other-keys)
96272e28
MW
1098 (apply invoke "make" `(,@make-flags "scan-test"))
1099 (invoke "./scan-test"))))))
b92d02d9
RJ
1100 (home-page "https://github.com/tialaramex/sparql-query/")
1101 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
1102 (description "Sparql-query is a command-line tool for accessing SPARQL
36a4366d 1103endpoints over HTTP. It has been intentionally designed to @code{feel} similar to
b92d02d9
RJ
1104tools for interrogating SQL databases. For example, you can enter a query over
1105several lines, using a semi-colon at the end of a line to indicate the end of
1106your query. It also supports readline so that you can more easily recall and
1107edit previous queries, even across sessions. It can be used non-interactively,
1108for example from a shell script.")
1109 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
1110 ;; others (like sparql-query.c) contain a GPLv2+ license header.
ba8b9f8d 1111 (license (list license:gpl3+))))
b92d02d9 1112
cabe8f18
CB
1113(define-public sqitch
1114 (package
1115 (name "sqitch")
1116 (version "0.9999")
1117 (source
1118 (origin
1119 (method url-fetch)
1120 (uri (string-append
1121 "mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-"
1122 version
1123 ".tar.gz"))
1124 (sha256
1125 (base32
1126 "1cvj8grs3bzc4g7dw1zc26g4biv1frav18sq0fkvi2kk0q1aigzm"))))
1127 (build-system perl-build-system)
1128 (arguments
1129 '(#:phases
1130 (modify-phases %standard-phases
1131 (add-before 'check 'set-check-environment
1132 (lambda _
1133 (setenv "TZ" "UTC")
1134 (setenv "HOME" "/tmp")
1135 #t))
1136 (add-after 'install 'wrap-program
1137 (lambda* (#:key outputs #:allow-other-keys)
1138 (let* ((out (assoc-ref outputs "out"))
1139 (path (getenv "PERL5LIB")))
1140 (wrap-program (string-append out "/bin/sqitch")
1141 `("PERL5LIB" ":" prefix
1142 (,(string-append out "/lib/perl5/site_perl"
1143 ":"
1144 path)))))
1145 #t)))))
1146 (native-inputs
1147 `(("perl-capture-tiny" ,perl-capture-tiny)
1148 ("perl-io-pager" ,perl-io-pager)
1149 ("perl-module-build" ,perl-module-build)
1150 ("perl-module-runtime" ,perl-module-runtime)
1151 ("perl-path-class" ,perl-path-class)
1152 ("perl-test-deep" ,perl-test-deep)
1153 ("perl-test-dir" ,perl-test-dir)
1154 ("perl-test-exception" ,perl-test-exception)
1155 ("perl-test-file" ,perl-test-file)
1156 ("perl-test-file-contents" ,perl-test-file-contents)
1157 ("perl-test-mockmodule" ,perl-test-mockmodule)
1158 ("perl-test-nowarnings" ,perl-test-nowarnings)
1159 ("perl-test-warn" ,perl-test-warn)))
1160 (inputs
1161 `(("perl-class-xsaccessor" ,perl-class-xsaccessor)
1162 ("perl-clone" ,perl-clone)
1163 ("perl-config-gitlike" ,perl-config-gitlike)
1164 ("perl-datetime" ,perl-datetime)
1165 ("perl-datetime-timezone" ,perl-datetime-timezone)
1166 ("perl-dbd-pg" ,perl-dbd-pg)
1167 ("perl-dbi" ,perl-dbi)
1168 ("perl-devel-stacktrace" ,perl-devel-stacktrace)
1169 ("perl-encode-locale" ,perl-encode-locale)
1170 ("perl-file-homedir" ,perl-file-homedir)
1171 ("perl-hash-merge" ,perl-hash-merge)
1172 ("perl-ipc-run3" ,perl-ipc-run3)
1173 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
1174 ("perl-libintl-perl" ,perl-libintl-perl)
1175 ("perl-list-moreutils" ,perl-list-moreutils)
1176 ("perl-moo" ,perl-moo)
1177 ("perl-mysql-config" ,perl-mysql-config)
1178 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1179 ("perl-path-class" ,perl-path-class)
1180 ("perl-perlio-utf8_strict" ,perl-perlio-utf8_strict)
1181 ("perl-string-formatter" ,perl-string-formatter)
1182 ("perl-string-shellquote" ,perl-string-shellquote)
1183 ("perl-sub-exporter" ,perl-sub-exporter)
1184 ("perl-template-tiny" ,perl-template-tiny)
1185 ("perl-template-toolkit" ,perl-template-toolkit)
1186 ("perl-throwable" ,perl-throwable)
1187 ("perl-try-tiny" ,perl-try-tiny)
1188 ("perl-type-tiny" ,perl-type-tiny)
1189 ("perl-type-tiny-xs" ,perl-type-tiny-xs)
1190 ("perl-uri" ,perl-uri)
1191 ("perl-uri-db" ,perl-uri-db)))
1192 (home-page "https://sqitch.org/")
1193 (synopsis "Database change management tool")
1194 (description
1195 "Sqitch is a standalone change management system for database schemas,
1196which uses SQL to describe changes.")
1197 (license license:x11)))
1198
311f06c9
TGR
1199(define-public sqlcrush
1200 ;; Unfortunately, there is no proper upstream release and may never be.
1201 (let ((commit "b5f6868f189566a26eecc78d0f0659813c1aa98a")
1202 (revision "1"))
1203 (package
1204 (name "sqlcrush")
1205 (version (git-version "0.1.5" revision commit))
1206 (source (origin
1207 (method git-fetch)
1208 (uri (git-reference
1209 (url "https://github.com/coffeeandscripts/sqlcrush.git")
1210 (commit commit)))
1211 (file-name (git-file-name name version))
1212 (sha256
1213 (base32
1214 "0x3wy40r93p0jv3nbwj9a77wa4ff697d13r0wffmm7q9h3mzsww8"))))
1215 (build-system python-build-system)
1216 (inputs
1217 `(("python-cryptography" ,python-cryptography)
1218 ("python-psycopg2" ,python-psycopg2)
1219 ("python-pymysql" ,python-pymysql)
1220 ("python-sqlalchemy" ,python-sqlalchemy)))
1221 (home-page "https://github.com/coffeeandscripts/sqlcrush")
1222 (synopsis "Text console-based database viewer and editor")
1223 (description
1224 "SQLcrush lets you view and edit a database directly from the text
1225console through an ncurses interface. You can explore each table's structure,
1226browse and edit the contents, add and delete entries, all while tracking your
1227changes.")
1228 (license license:gpl3+)))) ; no headers, see README.md
1229
db60b1d9
LC
1230(define-public tdb
1231 (package
1232 (name "tdb")
5e7e193b 1233 (version "1.4.0")
db60b1d9
LC
1234 (source (origin
1235 (method url-fetch)
ca473fc2 1236 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
db60b1d9
LC
1237 version ".tar.gz"))
1238 (sha256
1239 (base32
5e7e193b 1240 "0d9d2f1c83gmmq30bkfs50yb8399mr9xjjzscma4kyq0ajf75861"))))
db60b1d9
LC
1241 (build-system gnu-build-system)
1242 (arguments
6ccb7814
EF
1243 '(#:phases
1244 (modify-phases %standard-phases
1245 (replace 'configure
1246 (lambda* (#:key outputs #:allow-other-keys)
1247 (let ((out (assoc-ref outputs "out")))
1248 ;; The 'configure' script is a wrapper for Waf and
1249 ;; doesn't recognize things like '--enable-fast-install'.
96272e28
MW
1250 (invoke "./configure"
1251 (string-append "--prefix=" out))))))))
db60b1d9
LC
1252 (native-inputs
1253 `(;; TODO: Build the documentation.
1254 ;; ("docbook-xsl" ,docbook-xsl)
1255 ;; ("libxml2" ,libxml2)
1256 ;; ("libxslt" ,libxslt)
97dcedbd
MB
1257 ("python" ,python) ;for the Waf build system
1258 ("which" ,which)))
1abd0904 1259 (home-page "https://tdb.samba.org/")
35b9e423 1260 (synopsis "Trivial database")
db60b1d9
LC
1261 (description
1262 "TDB is a Trivial Database. In concept, it is very much like GDBM,
1263and BSD's DB except that it allows multiple simultaneous writers and uses
1264locking internally to keep writers from trampling on each other. TDB is also
1265extremely small.")
ba8b9f8d 1266 (license license:lgpl3+)))
274da61d
LC
1267
1268(define-public perl-dbi
1269 (package
1270 (name "perl-dbi")
da93d424 1271 (version "1.642")
274da61d
LC
1272 (source (origin
1273 (method url-fetch)
1274 (uri (string-append
1275 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
1276 version ".tar.gz"))
1277 (sha256
1278 (base32
da93d424 1279 "0pbzqazrx7pnw4nbyaf27in4b6yddkirbd2ws7mnqa2n7812a81z"))))
274da61d
LC
1280 (build-system perl-build-system)
1281 (synopsis "Database independent interface for Perl")
1282 (description "This package provides an database interface for Perl.")
9aba9b12 1283 (home-page "https://metacpan.org/release/DBI")
2f3108ad 1284 (license license:perl-license)))
274da61d 1285
feae3395
EB
1286(define-public perl-dbix-class
1287 (package
1288 (name "perl-dbix-class")
435897c0 1289 (version "0.082841")
feae3395
EB
1290 (source
1291 (origin
1292 (method url-fetch)
1293 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1294 "DBIx-Class-" version ".tar.gz"))
1295 (sha256
1296 (base32
435897c0 1297 "1gf3hgv8f9rnr8bl4ljgsqk4aliphmvljhsk4282kvdc4mcgh1fp"))))
feae3395
EB
1298 (build-system perl-build-system)
1299 (native-inputs
1300 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
1301 ("perl-file-temp" ,perl-file-temp)
2f837cf7 1302 ("perl-module-install" ,perl-module-install)
feae3395
EB
1303 ("perl-package-stash" ,perl-package-stash)
1304 ("perl-test-deep" ,perl-test-deep)
1305 ("perl-test-exception" ,perl-test-exception)
1306 ("perl-test-warn" ,perl-test-warn)))
1307 (propagated-inputs
1308 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1309 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1310 ("perl-class-inspector" ,perl-class-inspector)
1311 ("perl-config-any" ,perl-config-any)
1312 ("perl-context-preserve" ,perl-context-preserve)
1313 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
1314 ("perl-data-page" ,perl-data-page)
1315 ("perl-dbi" ,perl-dbi)
1316 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
1317 ("perl-hash-merge" ,perl-hash-merge)
1318 ("perl-module-find" ,perl-module-find)
1319 ("perl-moo" ,perl-moo)
1320 ("perl-mro-compat" ,perl-mro-compat)
1321 ("perl-namespace-clean" ,perl-namespace-clean)
1322 ("perl-path-class" ,perl-path-class)
1323 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
1324 ("perl-scope-guard" ,perl-scope-guard)
1325 ("perl-sql-abstract" ,perl-sql-abstract)
1326 ("perl-sub-name" ,perl-sub-name)
1327 ("perl-text-balanced" ,perl-text-balanced)
1328 ("perl-try-tiny" ,perl-try-tiny)))
9aba9b12 1329 (home-page "https://metacpan.org/release/DBIx-Class")
feae3395
EB
1330 (synopsis "Extensible and flexible object <-> relational mapper")
1331 (description "An SQL to OO mapper with an object API inspired by
1332Class::DBI (with a compatibility layer as a springboard for porting) and a
1333resultset API that allows abstract encapsulation of database operations. It
1334aims to make representing queries in your code as perl-ish as possible while
1335still providing access to as many of the capabilities of the database as
1336possible, including retrieving related records from multiple tables in a
1337single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
1338\"ORDER BY\" and \"HAVING\" support.")
2f3108ad 1339 (license license:perl-license)))
e61fd0f0 1340
4e4039e5
EB
1341(define-public perl-dbix-class-cursor-cached
1342 (package
1343 (name "perl-dbix-class-cursor-cached")
180cb81b 1344 (version "1.001004")
4e4039e5
EB
1345 (source
1346 (origin
1347 (method url-fetch)
1348 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
1349 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
1350 (sha256
1351 (base32
180cb81b 1352 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
4e4039e5
EB
1353 (build-system perl-build-system)
1354 (native-inputs
1355 `(("perl-cache-cache" ,perl-cache-cache)
2f837cf7
MB
1356 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1357 ("perl-module-install" ,perl-module-install)))
4e4039e5
EB
1358 (propagated-inputs
1359 `(("perl-carp-clan" ,perl-carp-clan)
1360 ("perl-dbix-class" ,perl-dbix-class)))
9aba9b12 1361 (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached")
4e4039e5
EB
1362 (synopsis "Cursor with built-in caching support")
1363 (description "DBIx::Class::Cursor::Cached provides a cursor class with
1364built-in caching support.")
2f3108ad 1365 (license license:perl-license)))
4e4039e5 1366
e61fd0f0
EB
1367(define-public perl-dbix-class-introspectablem2m
1368 (package
1369 (name "perl-dbix-class-introspectablem2m")
7a462b80 1370 (version "0.001002")
e61fd0f0
EB
1371 (source
1372 (origin
1373 (method url-fetch)
68a9d6df 1374 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
e61fd0f0
EB
1375 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
1376 (sha256
1377 (base32
7a462b80 1378 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
e61fd0f0 1379 (build-system perl-build-system)
2f837cf7
MB
1380 (native-inputs
1381 `(("perl-module-install" ,perl-module-install)))
e61fd0f0
EB
1382 (propagated-inputs
1383 `(("perl-dbix-class" ,perl-dbix-class)))
9aba9b12 1384 (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M")
e61fd0f0
EB
1385 (synopsis "Introspect many-to-many relationships")
1386 (description "Because the many-to-many relationships are not real
1387relationships, they can not be introspected with DBIx::Class. Many-to-many
1388relationships are actually just a collection of convenience methods installed
1389to bridge two relationships. This DBIx::Class component can be used to store
1390all relevant information about these non-relationships so they can later be
1391introspected and examined.")
2f3108ad 1392 (license license:perl-license)))
708155df
EB
1393
1394(define-public perl-dbix-class-schema-loader
1395 (package
1396 (name "perl-dbix-class-schema-loader")
1672e7e7 1397 (version "0.07049")
708155df
EB
1398 (source
1399 (origin
1400 (method url-fetch)
1401 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1402 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
1403 (sha256
1404 (base32
1672e7e7 1405 "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8"))))
708155df
EB
1406 (build-system perl-build-system)
1407 (native-inputs
1408 `(("perl-config-any" ,perl-config-any)
1409 ("perl-config-general" ,perl-config-general)
1410 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1411 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
2f837cf7 1412 ("perl-module-install" ,perl-module-install)
708155df
EB
1413 ("perl-moose" ,perl-moose)
1414 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
1415 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
1416 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1417 ("perl-test-deep" ,perl-test-deep)
1418 ("perl-test-differences" ,perl-test-differences)
1419 ("perl-test-exception" ,perl-test-exception)
1420 ("perl-test-pod" ,perl-test-pod)
1421 ("perl-test-warn" ,perl-test-warn)))
1422 (propagated-inputs
1423 `(("perl-class-unload" ,perl-class-unload)
1424 ("perl-class-inspector" ,perl-class-inspector)
1425 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1426 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1427 ("perl-carp-clan" ,perl-carp-clan)
1428 ("perl-data-dump" ,perl-data-dump)
1429 ("perl-dbix-class" ,perl-dbix-class)
1430 ("perl-hash-merge" ,perl-hash-merge)
1431 ("perl-list-moreutils" ,perl-list-moreutils)
1432 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
1433 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
1434 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
1435 ("perl-namespace-clean" ,perl-namespace-clean)
1436 ("perl-mro-compat" ,perl-mro-compat)
1437 ("perl-scope-guard" ,perl-scope-guard)
1438 ("perl-string-camelcase" ,perl-string-camelcase)
1439 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
1440 ("perl-sub-name" ,perl-sub-name)
1441 ("perl-try-tiny" ,perl-try-tiny)))
1442 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
9aba9b12 1443 (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader")
708155df
EB
1444 (synopsis "Create a DBIx::Class::Schema based on a database")
1445 (description "DBIx::Class::Schema::Loader automates the definition of a
1446DBIx::Class::Schema by scanning database table definitions and setting up the
1447columns, primary keys, unique constraints and relationships.")
2f3108ad 1448 (license license:perl-license)))
274da61d 1449
186eb132
EB
1450(define-public perl-dbd-pg
1451 (package
1452 (name "perl-dbd-pg")
8c078dde 1453 (version "3.7.4")
186eb132
EB
1454 (source
1455 (origin
1456 (method url-fetch)
1457 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
1458 "DBD-Pg-" version ".tar.gz"))
1459 (sha256
1460 (base32
8c078dde 1461 "0gkqlvbmzbdm0g4k328nlkjdg3wrjm5i2n9jxj1i8sqxkm79rylz"))))
186eb132
EB
1462 (build-system perl-build-system)
1463 (native-inputs
1464 `(("perl-dbi" ,perl-dbi)))
1465 (propagated-inputs
1466 `(("perl-dbi" ,perl-dbi)
1467 ("postgresql" ,postgresql)))
9aba9b12 1468 (home-page "https://metacpan.org/release/DBD-Pg")
186eb132 1469 (synopsis "DBI PostgreSQL interface")
f33e71fc
LC
1470 (description "This package provides a PostgreSQL driver for the Perl5
1471@dfn{Database Interface} (DBI).")
2f3108ad 1472 (license license:perl-license)))
186eb132 1473
4b7857a4
RW
1474(define-public perl-dbd-mysql
1475 (package
1476 (name "perl-dbd-mysql")
49596a54 1477 (version "4.050")
4b7857a4
RW
1478 (source
1479 (origin
1480 (method url-fetch)
49596a54 1481 (uri (string-append "mirror://cpan/authors/id/D/DV/DVEEDEN/"
4b7857a4
RW
1482 "DBD-mysql-" version ".tar.gz"))
1483 (sha256
49596a54 1484 (base32 "0y4djb048i09dk19av7mzfb3khr72vw11p3ayw2p82jsy4gm8j2g"))))
4b7857a4 1485 (build-system perl-build-system)
702a87f2
TGR
1486 (arguments
1487 `(#:phases
1488 (modify-phases %standard-phases
1489 (add-before 'configure 'skip-library-detection
1490 ;; Avoid depencies on perl-devel-checklib, openssl, and zlib. They
1491 ;; are really only needed for the test suite; their absence does not
1492 ;; affect the build or the end result.
1493 (lambda _
1494 (substitute* "Makefile.PL"
1495 (("use Devel::CheckLib;" match)
1496 (string-append "# " match))
1497 (("assert_lib")
1498 "print"))
1499 #t)))
1500 ;; Tests require running MySQL server.
1501 #:tests? #f))
4b7857a4
RW
1502 (propagated-inputs
1503 `(("perl-dbi" ,perl-dbi)
9c6fb330 1504 ("mysql" ,mariadb)))
9aba9b12 1505 (home-page "https://metacpan.org/release/DBD-mysql")
4b7857a4
RW
1506 (synopsis "DBI MySQL interface")
1507 (description "This package provides a MySQL driver for the Perl5
1508@dfn{Database Interface} (DBI).")
2f3108ad 1509 (license license:perl-license)))
4b7857a4 1510
274da61d
LC
1511(define-public perl-dbd-sqlite
1512 (package
1513 (name "perl-dbd-sqlite")
d49bdbca 1514 (version "1.62")
274da61d
LC
1515 (source (origin
1516 (method url-fetch)
1517 (uri (string-append
1518 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
1519 version ".tar.gz"))
1520 (sha256
1521 (base32
d49bdbca 1522 "0p78ri1q6xpc1i98i6mlriv8n66iz8r5r11dlsknjm4y58rfz0mx"))))
274da61d
LC
1523 (build-system perl-build-system)
1524 (inputs `(("sqlite" ,sqlite)))
1525 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
1526 (synopsis "SQlite interface for Perl")
1527 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
1528the entire thing in the distribution. So in order to get a fast transaction
1529capable RDBMS working for your Perl project you simply have to install this
1530module, and nothing else.")
2f3108ad 1531 (license license:perl-license)
9aba9b12 1532 (home-page "https://metacpan.org/release/DBD-SQLite")))
14e84b2d 1533
55916fa2
CB
1534(define-public perl-mysql-config
1535 (package
1536 (name "perl-mysql-config")
1537 (version "1.04")
1538 (source
1539 (origin
1540 (method url-fetch)
1541 (uri (string-append
1542 "mirror://cpan/authors/id/D/DA/DARREN/MySQL-Config-"
1543 version
1544 ".tar.gz"))
1545 (sha256
1546 (base32
1547 "1svn7ccw2gc4cazvc58j84rxhnc9vs01zpird0l8460598j475qr"))))
1548 (build-system perl-build-system)
1549 (home-page "https://metacpan.org/release/MySQL-Config")
1550 (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files")
1551 (description
1552 "@code{MySQL::Config} emulates the @code{load_defaults} function from
1553libmysqlclient. It will fill an aray with long options, ready to be parsed by
1554@code{Getopt::Long}.")
1555 (license license:perl-license)))
1556
dd90952e
EB
1557(define-public perl-sql-abstract
1558 (package
1559 (name "perl-sql-abstract")
2f813be3 1560 (version "1.86")
dd90952e
EB
1561 (source
1562 (origin
1563 (method url-fetch)
439980b7 1564 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
dd90952e
EB
1565 "SQL-Abstract-" version ".tar.gz"))
1566 (sha256
2f813be3 1567 (base32 "1pwcm8hwxcgidyyrak37lx69d85q728jxsb0b14jz93gbvdgg9z7"))))
dd90952e
EB
1568 (build-system perl-build-system)
1569 (native-inputs
9dab5017
MB
1570 `(("perl-module-install" ,perl-module-install)
1571 ("perl-test-deep" ,perl-test-deep)
dd90952e
EB
1572 ("perl-test-exception" ,perl-test-exception)
1573 ("perl-test-warn" ,perl-test-warn)))
1574 (propagated-inputs
1575 `(("perl-hash-merge" ,perl-hash-merge)
1576 ("perl-moo" ,perl-moo)
1577 ("perl-mro-compat" ,perl-mro-compat)
1578 ("perl-text-balanced" ,perl-text-balanced)))
9aba9b12 1579 (home-page "https://metacpan.org/release/SQL-Abstract")
dd90952e
EB
1580 (synopsis "Generate SQL from Perl data structures")
1581 (description "This module was inspired by the excellent DBIx::Abstract.
1582While based on the concepts used by DBIx::Abstract, the concepts used have
1583been modified to make the SQL easier to generate from Perl data structures.
1584The underlying idea is for this module to do what you mean, based on the data
1585structures you provide it, so that you don't have to modify your code every
e881752c 1586time your data changes.")
2f3108ad 1587 (license license:perl-license)))
14e84b2d 1588
b4dcb026
EB
1589(define-public perl-sql-splitstatement
1590 (package
1591 (name "perl-sql-splitstatement")
1592 (version "1.00020")
1593 (source
1594 (origin
1595 (method url-fetch)
1596 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
1597 "SQL-SplitStatement-" version ".tar.gz"))
1598 (sha256
1599 (base32
1600 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
1601 (build-system perl-build-system)
1602 (native-inputs
1603 `(("perl-test-exception" ,perl-test-exception)))
1604 (propagated-inputs
1605 `(("perl-class-accessor" ,perl-class-accessor)
1606 ("perl-list-moreutils" ,perl-list-moreutils)
1607 ("perl-regexp-common" ,perl-regexp-common)
1608 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
9aba9b12 1609 (home-page "https://metacpan.org/release/SQL-SplitStatement")
b4dcb026
EB
1610 (synopsis "Split SQL code into atomic statements")
1611 (description "This module tries to split any SQL code, even including
1612non-standard extensions, into the atomic statements it is composed of.")
2f3108ad 1613 (license license:perl-license)))
b4dcb026 1614
718c89c1
EB
1615(define-public perl-sql-tokenizer
1616 (package
1617 (name "perl-sql-tokenizer")
1618 (version "0.24")
1619 (source
1620 (origin
1621 (method url-fetch)
1622 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
1623 "SQL-Tokenizer-" version ".tar.gz"))
1624 (sha256
1625 (base32
1626 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
1627 (build-system perl-build-system)
9aba9b12 1628 (home-page "https://metacpan.org/release/SQL-Tokenizer")
718c89c1
EB
1629 (synopsis "SQL tokenizer")
1630 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
1631claim to be a parser or query verifier. It just creates sane tokens from a
1632valid SQL query.")
2f3108ad 1633 (license license:perl-license)))
718c89c1 1634
14e84b2d
JD
1635(define-public unixodbc
1636 (package
1637 (name "unixodbc")
8327ffcc 1638 (version "2.3.7")
14e84b2d
JD
1639 (source (origin
1640 (method url-fetch)
e881752c 1641 (uri
14e84b2d 1642 (string-append
3fef0a2f
EF
1643 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
1644 version ".tar.gz"))
14e84b2d 1645 (sha256
8327ffcc 1646 (base32 "0xry3sg497wly8f7715a7gwkn2k36bcap0mvzjw74jj53yx6kwa5"))))
14e84b2d
JD
1647 (build-system gnu-build-system)
1648 (synopsis "Data source abstraction library")
1649 (description "Unixodbc is a library providing an API with which to access
1650data sources. Data sources include SQL Servers and any software with an ODBC
1651Driver.")
ba8b9f8d 1652 (license license:lgpl2.1+)
14e84b2d
JD
1653 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
1654 (home-page "http://www.unixodbc.org")))
b4a9c924
EB
1655
1656(define-public unqlite
1657 (package
1658 (name "unqlite")
1659 (version "1.1.6")
1660 (source (origin
1661 (method url-fetch)
1662 ;; Contains bug fixes against the official release, and has an
1663 ;; autotooled build system.
1664 (uri (string-append "https://github.com/aidin36/tocc/releases/"
1665 "download/v1.0.0/"
1666 "unqlite-unofficial-" version ".tar.gz"))
1667 (sha256
1668 (base32
1669 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
1670 (build-system gnu-build-system)
1671 (arguments `(#:tests? #f)) ;No check target
1672 (home-page "http://www.unqlite.org")
1673 (synopsis "In-memory key/value and document store")
1674 (description
1675 "UnQLite is an in-process software library which implements a
1676self-contained, serverless, zero-configuration, transactional NoSQL
1677database engine. UnQLite is a document store database similar to
1678MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
69b4ffcf 1679similar to BerkeleyDB, LevelDB, etc.")
ba8b9f8d 1680 (license license:bsd-2)))
463f6766
DT
1681
1682(define-public redis
1683 (package
1684 (name "redis")
793a66e5 1685 (version "4.0.10")
463f6766
DT
1686 (source (origin
1687 (method url-fetch)
1688 (uri (string-append "http://download.redis.io/releases/redis-"
1689 version".tar.gz"))
1690 (sha256
1691 (base32
793a66e5 1692 "194cydhv3hf4v95ifvjvsqrs4jn3ffrkg5lvxj5d3y04lwsp9dhx"))))
463f6766
DT
1693 (build-system gnu-build-system)
1694 (arguments
1695 '(#:tests? #f ; tests related to master/slave and replication fail
1696 #:phases (modify-phases %standard-phases
1697 (delete 'configure))
1698 #:make-flags `("CC=gcc"
1699 "MALLOC=libc"
b25f060f 1700 "LDFLAGS=-ldl"
463f6766
DT
1701 ,(string-append "PREFIX="
1702 (assoc-ref %outputs "out")))))
1703 (synopsis "Key-value cache and store")
1704 (description "Redis is an advanced key-value cache and store. Redis
1705supports many data structures including strings, hashes, lists, sets, sorted
1706sets, bitmaps and hyperloglogs.")
1707 (home-page "http://redis.io/")
ba8b9f8d 1708 (license license:bsd-3)))
a65e2a02 1709
1710(define-public kyotocabinet
1711 (package
1712 (name "kyotocabinet")
245e7a68 1713 (version "1.2.77")
a65e2a02 1714 (source (origin
1715 (method url-fetch)
1716 (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
1717 name "-" version ".tar.gz"))
1718 (sha256
1719 (base32
245e7a68 1720 "1rlx4307adbzd842b4npq6cwlw8h010ingxaz3qz1ijc70lr72an"))))
a65e2a02 1721 (build-system gnu-build-system)
1722 (arguments
1723 `(#:configure-flags
1724 (list
9d59023e 1725 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
a65e2a02 1726 (string-append "LDFLAGS=-Wl,-rpath="
1727 (assoc-ref %outputs "out") "/lib"))))
1728 (inputs `(("zlib" ,zlib)))
1729 (home-page "http://fallabs.com/kyotocabinet/")
1730 (synopsis
1731 "Kyoto Cabinet is a modern implementation of the DBM database")
1732 (description
1733 "Kyoto Cabinet is a standalone file-based database that supports Hash
1734and B+ Tree data storage models. It is a fast key-value lightweight
1735database and supports many programming languages. It is a NoSQL database.")
ba8b9f8d 1736 (license license:gpl3+)))
6242b314 1737
bdc11dc4 1738(define-public tokyocabinet
1739 (package
1740 (name "tokyocabinet")
1741 (version "1.4.48")
1742 (source
1743 (origin
1744 (method url-fetch)
1745 (uri (string-append "http://fallabs.com/tokyocabinet/"
1746 name "-" version ".tar.gz"))
1747 (sha256
1748 (base32
1749 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
1750 (build-system gnu-build-system)
1751 (arguments
1752 `(#:configure-flags
1753 (list "--enable-pthread" "--enable-off64" "--enable-fastest"
1754 (string-append "LDFLAGS=-Wl,-rpath="
1755 (assoc-ref %outputs "out") "/lib"))))
1756 (inputs
1757 `(("zlib" ,zlib)))
1758 (home-page "http://fallabs.com/tokyocabinet/")
1759 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
1760 (description
1761 "Tokyo Cabinet is a library of routines for managing a database.
1762The database is a simple data file containing records, each is a pair of a
1763key and a value. Every key and value is serial bytes with variable length.
1764Both binary data and character string can be used as a key and a value.
1765There is neither concept of data tables nor data types. Records are
1766organized in hash table, B+ tree, or fixed-length array.")
1767 (license license:lgpl2.1+)))
1768
6242b314
SB
1769(define-public wiredtiger
1770 (package
1771 (name "wiredtiger")
81e95821 1772 (version "2.9.1")
6242b314
SB
1773 (source (origin
1774 (method url-fetch)
1775 (uri (string-append
1776 "http://source.wiredtiger.com/releases/wiredtiger-"
1777 version ".tar.bz2"))
1778 (sha256
1779 (base32
81e95821 1780 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
6242b314
SB
1781 (build-system gnu-build-system)
1782 (arguments
a469c695 1783 '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib")
6242b314
SB
1784 #:phases
1785 (modify-phases %standard-phases
1786 (add-before 'check 'disable-test/fops
1787 (lambda _
1788 ;; XXX: timed out after 3600 seconds of silence
1789 (substitute* "Makefile"
1790 (("test/fops") ""))
1791 #t)))))
1792 (inputs
1793 `(("lz4" ,lz4)
3faa422d
CB
1794 ("zlib" ,zlib)
1795 ("snappy" ,snappy)))
6242b314
SB
1796 (home-page "http://source.wiredtiger.com/")
1797 (synopsis "NoSQL data engine")
1798 (description
1799 "WiredTiger is an extensible platform for data management. It supports
1800row-oriented storage (where all columns of a row are stored together),
1801column-oriented storage (where columns are stored in groups, allowing for
1802more efficient access and storage of column subsets) and log-structured merge
1803trees (LSM), for sustained throughput under random insert workloads.")
ba8b9f8d 1804 (license license:gpl3) ; or GPL-2
6242b314 1805 ;; configure.ac: WiredTiger requires a 64-bit build.
092b7b3e 1806 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
90c2ee88 1807
4680fef7
AB
1808(define-public wiredtiger-3
1809 (package
1810 (inherit wiredtiger)
1811 (name "wiredtiger")
1812 (version "3.1.0")
1813 (source (origin
1814 (method url-fetch)
1815 (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-"
1816 version ".tar.bz2"))
1817 (sha256
1818 (base32
1819 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx"))))))
1820
16973071
KB
1821(define-public guile-wiredtiger
1822 (package
1823 (name "guile-wiredtiger")
b1e6b938 1824 (version "0.7.0")
16973071
KB
1825 (source (origin
1826 (method git-fetch)
1827 (uri (git-reference
1828 (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
b1e6b938 1829 (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b")))
16973071
KB
1830 (file-name (string-append name "-" version "-checkout"))
1831 (sha256
1832 (base32
b1e6b938 1833 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595"))))
16973071
KB
1834 (build-system gnu-build-system)
1835 (arguments
3926a099 1836 '(#:parallel-tests? #f ;; tests can't be run in parallel, yet.
16973071
KB
1837 #:configure-flags
1838 (list (string-append "--with-libwiredtiger-prefix="
1839 (assoc-ref %build-inputs "wiredtiger")))
189be331 1840 #:make-flags '("GUILE_AUTO_COMPILE=0")))
16973071
KB
1841 (native-inputs
1842 `(("autoconf" ,autoconf)
1843 ("automake" ,automake)
1844 ("pkg-config" ,pkg-config)))
1845 (inputs
b1e6b938 1846 `(("wiredtiger" ,wiredtiger-3)
16973071
KB
1847 ("guile" ,guile-2.2)))
1848 (propagated-inputs
b1e6b938 1849 `(("guile-bytestructures" ,guile-bytestructures)))
3926a099 1850 (synopsis "WiredTiger bindings for GNU Guile")
16973071
KB
1851 (description
1852 "This package provides Guile bindings to the WiredTiger ``NoSQL''
b1e6b938 1853database.")
16973071
KB
1854 (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger")
1855 (license license:gpl3+)))
1856
90c2ee88
DM
1857(define-public perl-db-file
1858 (package
1859 (name "perl-db-file")
2fc569a0 1860 (version "1.843")
90c2ee88
DM
1861 (source
1862 (origin
1863 (method url-fetch)
1864 (uri (string-append
1865 "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
1866 version
1867 ".tar.gz"))
1868 (sha256
1869 (base32
2fc569a0 1870 "0sildz1i3fmh949w1scpjsyjx0cbmfw0yna3y70mc6vbwp8y696y"))))
90c2ee88
DM
1871 (build-system perl-build-system)
1872 (inputs `(("bdb" ,bdb)))
1873 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
1874 (arguments
1875 `(#:phases (modify-phases %standard-phases
1876 (add-before
1877 'configure 'modify-config.in
1878 (lambda* (#:key inputs #:allow-other-keys)
1879 (substitute* "config.in"
1880 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
1881 #t)))))
9aba9b12 1882 (home-page "https://metacpan.org/release/DB_File")
90c2ee88
DM
1883 (synopsis
1884 "Perl5 access to Berkeley DB version 1.x")
1885 (description
1886 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
2f3108ad 1887 (license license:perl-license)))
0e1b262e
DC
1888
1889(define-public lmdb
1890 (package
1891 (name "lmdb")
49158947 1892 (version "0.9.23")
f167b432
TGR
1893 (source
1894 (origin
1895 (method git-fetch)
1896 (uri (git-reference
1897 (url "https://github.com/LMDB/lmdb.git")
1898 (commit (string-append "LMDB_" version))))
1899 (file-name (git-file-name name version))
1900 (sha256
49158947 1901 (base32 "0ag7l5180ajvm73y59m7sn3p52xm8m972d08cshxhpwgwa4v35k6"))))
0e1b262e
DC
1902 (build-system gnu-build-system)
1903 (arguments
1904 `(#:test-target "test"
1905 #:phases
1906 (modify-phases %standard-phases
1907 (replace 'configure
1908 (lambda* (#:key outputs #:allow-other-keys)
f167b432 1909 (chdir "libraries/liblmdb")
0e1b262e
DC
1910 (substitute* "Makefile"
1911 (("/usr/local") (assoc-ref outputs "out")))
1912 #t)))))
1913 (home-page "https://symas.com/products/lightning-memory-mapped-database")
fda852ff
TGR
1914 (synopsis "Lightning Memory-Mapped Database library")
1915 (description
1916 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
1917transactional database. Unlike more complex relational databases, LMDB handles
1918only key-value pairs (stored as arbitrary byte arrays) and relies on the
1919underlying operating system for caching and locking, keeping the code small and
1920simple.
1921The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
1922disk-based databases with high read performance that scales linearly over
1923multiple cores. The size of each database is limited only by the size of the
1924virtual address space — not physical RAM.")
0e1b262e 1925 (license license:openldap2.8)))
fe71eee0
JN
1926
1927(define-public libpqxx
1928 (package
1929 (name "libpqxx")
1930 (version "4.0.1")
1931 (source (origin
1932 (method url-fetch)
1933 (uri (string-append
1934 "http://pqxx.org/download/software/libpqxx/"
1935 name "-" version ".tar.gz"))
1936 (sha256
1937 (base32
1938 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
1939 (build-system gnu-build-system)
1940 (native-inputs
1941 `(("python" ,python-2)))
1942 (inputs `(("postgresql" ,postgresql)))
1943 (arguments
5ac097e2
MB
1944 `(#:tests? #f ; # FAIL: 1
1945 #:phases
1946 (modify-phases %standard-phases
1947 (add-before 'configure 'fix-sed-command
1948 (lambda _
1949 ;; Newer sed versions error out if double brackets are not used.
1950 (substitute* "configure"
1951 (("\\[:space:\\]") "[[:space:]]"))
1952 #t)))))
fe71eee0
JN
1953 (synopsis "C++ connector for PostgreSQL")
1954 (description
1955 "Libpqxx is a C++ library to enable user programs to communicate with the
1956PostgreSQL database back-end. The database back-end can be local or it may be
1957on another machine, accessed via TCP/IP.")
1958 (home-page "http://pqxx.org/")
1959 (license license:bsd-3)))
4d98bfaf
EF
1960
1961(define-public python-peewee
1962 (package
1963 (name "python-peewee")
afd84536 1964 (version "2.10.2")
4d98bfaf
EF
1965 (source
1966 (origin
1967 (method url-fetch)
1968 (uri (pypi-uri "peewee" version))
1969 (sha256
1970 (base32
afd84536 1971 "10f2mrd5hw6rjklrzaix2lsxlgc8vx3xak54arcy6yd791zhchi3"))))
4d98bfaf
EF
1972 (build-system python-build-system)
1973 (arguments
1974 `(#:tests? #f)) ; Fails to import test data
1975 (native-inputs
1976 `(("python-cython" ,python-cython)))
1977 (home-page "https://github.com/coleifer/peewee/")
1978 (synopsis "Small object-relational mapping utility")
1979 (description
1980 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
1981handles converting between pythonic values and those used by databases, so you
1982can use Python types in your code without having to worry. It has built-in
1983support for sqlite, mysql and postgresql. If you already have a database, you
1984can autogenerate peewee models using @code{pwiz}, a model generator.")
1985 (license license:expat)))
1986
1987(define-public python2-peewee
1988 (package-with-python2 python-peewee))
62ea44fc
AP
1989
1990(define-public sqlcipher
1991 (package
1992 (name "sqlcipher")
682c2918 1993 (version "3.4.2")
62ea44fc
AP
1994 (source
1995 (origin
1996 (method url-fetch)
1997 (uri (string-append "https://github.com/sqlcipher/" name
1998 "/archive/v" version ".tar.gz"))
1999 (sha256
682c2918 2000 (base32 "1nxarwbci8jx99f1d0y1ivxcv25s78l1p7q6qy28lkpkcx8pm2b9"))
62ea44fc
AP
2001 (file-name (string-append name "-" version ".tar.gz"))))
2002 (build-system gnu-build-system)
2003 (inputs
2004 `(("libcrypto" ,openssl)
2005 ("libtcl8.6" ,tcl))) ; required for running the tests
2006 (native-inputs
2007 `(("tcl" ,tcl)))
2008 (arguments
2009 '(#:configure-flags
2010 '("--enable-tempstore=yes"
2011 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
2012 "LDFLAGS=-lcrypto -ltcl8.6"
2013 "--disable-tcl")
2014 ;; tests cannot be run from the Makefile
2015 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
2016 #:test-target "testfixture"
2017 #:phases
2018 (modify-phases %standard-phases
2019 (add-before 'check 'build-test-runner
2020 (assoc-ref %standard-phases 'check))
2021 (replace 'check
2022 (lambda _
96272e28 2023 (invoke "./testfixture" "test/crypto.test"))))))
62ea44fc
AP
2024 (home-page "https://www.zetetic.net/sqlcipher/")
2025 (synopsis
2026 "Library providing transparent encryption of SQLite database files")
2027 (description "SQLCipher is an implementation of SQLite, extended to
2028provide transparent 256-bit AES encryption of database files. Pages are
2029encrypted before being written to disk and are decrypted when read back. It’s
2030well suited for protecting embedded application databases and for mobile
2031development.")
2032 ;; The source files
2033 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
2034 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
2035 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
2036 ;; source files are in the public domain.
2037 (license (list license:public-domain license:bsd-3))))
98d403bb
DM
2038
2039(define-public python-pyodbc-c
2040 (package
2041 (name "python-pyodbc-c")
c6b6a74e 2042 (version "3.1.4")
98d403bb
DM
2043 (source
2044 (origin
2045 (method url-fetch)
2046 (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
2047 "archive.tar.gz?ref=v" version))
2048 (sha256
2049 (base32
c6b6a74e 2050 "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
98d403bb
DM
2051 (file-name (string-append name "-" version ".tar.gz"))))
2052 (build-system python-build-system)
2053 (inputs
2054 `(("unixodbc" ,unixodbc)))
2055 (arguments
2056 `(;; No unit tests exist.
2057 #:tests? #f))
2058 (home-page "https://github.com/mkleehammer/pyodbc")
2059 (synopsis "Python ODBC Library")
2060 (description "@code{python-pyodbc-c} provides a Python DB-API driver
2061for ODBC.")
2062 (license (license:x11-style "file://LICENSE.TXT"))))
2063
2064(define-public python2-pyodbc-c
2065 (package-with-python2 python-pyodbc-c))
d39a84e8 2066
41916bea
DM
2067(define-public python-pyodbc
2068 (package
2069 (name "python-pyodbc")
ba18ea5f 2070 (version "4.0.26")
41916bea
DM
2071 (source
2072 (origin
2073 (method url-fetch)
2074 (uri (pypi-uri "pyodbc" version))
2075 (sha256
ba18ea5f 2076 (base32 "1qrxnf7ji5hml7z4y669k4wmk3iz2pcsr05bnn1n912asash09z5"))
41916bea
DM
2077 (file-name (string-append name "-" version ".tar.gz"))))
2078 (build-system python-build-system)
2079 (inputs
2080 `(("unixodbc" ,unixodbc)))
2081 (arguments
2082 `(;; No unit tests exist.
2083 #:tests? #f))
2084 (home-page "https://github.com/mkleehammer/pyodbc")
2085 (synopsis "Python ODBC Library")
2086 (description "@code{python-pyodbc} provides a Python DB-API driver
2087for ODBC.")
2088 (license (license:x11-style "file:///LICENSE.TXT"))))
2089
2090(define-public python2-pyodbc
2091 (package-with-python2 python-pyodbc))
2092
d39a84e8
AI
2093(define-public mdbtools
2094 (package
2095 (name "mdbtools")
2096 (version "0.7.1")
2097 (source
2098 (origin
f1f1cebd
RW
2099 (method git-fetch)
2100 (uri (git-reference
2101 (url "https://github.com/brianb/mdbtools.git")
2102 (commit version)))
2103 (file-name (git-file-name name version))
d39a84e8
AI
2104 (sha256
2105 (base32
f1f1cebd 2106 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
d39a84e8
AI
2107 (build-system gnu-build-system)
2108 (inputs
2109 `(("glib" ,glib)))
2110 (native-inputs
2111 `(("autoconf" ,autoconf)
2112 ("automake" ,automake)
2113 ("libtool" ,libtool)
2114 ("pkg-config" ,pkg-config)
2115 ("txt2man" ,txt2man)
2116 ("which" ,which)))
d39a84e8
AI
2117 (home-page "http://mdbtools.sourceforge.net/")
2118 (synopsis "Read Microsoft Access databases")
2119 (description "MDB Tools is a set of tools and applications to read the
2120proprietary MDB file format used in Microsoft's Access database package. This
2121includes programs to export schema and data from Microsoft's Access database
2122file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
2123etc., and an SQL engine for performing simple SQL queries.")
2124 (license (list license:lgpl2.0
2125 license:gpl2+))))
07041d95
TGR
2126
2127(define-public python-lmdb
2128 (package
2129 (name "python-lmdb")
3b295d3f 2130 (version "0.94")
07041d95
TGR
2131 (source (origin
2132 (method url-fetch)
2133 (uri (pypi-uri "lmdb" version))
2134 (sha256
2135 (base32
3b295d3f 2136 "1zh38gvkqw1jm5105if6rr7ccbgyxr7k2rm5ygb9ab3bq82pyaww"))
07041d95
TGR
2137 (modules '((guix build utils)))
2138 (snippet
2139 ;; Delete bundled lmdb source files.
6cbee49d
MW
2140 '(begin
2141 (for-each delete-file (list "lib/lmdb.h"
2142 "lib/mdb.c"
2143 "lib/midl.c"
2144 "lib/midl.h"))
2145 #t))))
07041d95
TGR
2146 (build-system python-build-system)
2147 (inputs
2148 `(("lmdb" ,lmdb)))
2149 (arguments
2150 `(#:phases
2151 (modify-phases %standard-phases
2152 (add-before 'build 'use-system-lmdb
2153 (lambda* (#:key inputs #:allow-other-keys)
2154 (let ((lmdb (assoc-ref inputs "lmdb")))
2155 (setenv "LMDB_FORCE_SYSTEM" "set")
2156 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
2157 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
2158 #t))))
2159 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
2160 #:tests? #f))
2161 (home-page "https://github.com/dw/py-lmdb")
2162 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
2163 (description
2164 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
2165Memory-Mapped Database} (LMDB), a high-performance key-value store.")
2166 (license
2167 (list license:openldap2.8
2168 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
2169 ;; but not actually needed on platforms currently supported by Guix.
2170 license:bsd-3))))
2171
2172(define-public python2-lmdb
2173 (package-with-python2 python-lmdb))
da1f7a9e
BW
2174
2175(define-public python-orator
2176 (package
2177 (name "python-orator")
2178 (version "0.9.7")
2179 (source (origin
2180 (method url-fetch)
2181 (uri (pypi-uri "orator" version))
2182 (sha256
2183 (base32
2184 "14r58z64fdp76ixnvmi4lni762b405ynmsx6chr1qihs3yl9zn6c"))))
2185 (build-system python-build-system)
2186 (arguments
2187 `(#:phases
2188 (modify-phases %standard-phases
2189 (add-after 'unpack 'loosen-dependencies
2190 ;; Tests are not actually run since they are not included with the
2191 ;; distributed package, but dependencies are checked.
2192 (lambda _
2193 (substitute* "setup.py"
2194 ((",<.*'") "'")
2195 (("flexmock==0.9.7") "flexmock")
2196 ;; The pytest-mock package is out of date, so we remove minimum
2197 ;; version requirement.
2198 (("pytest-mock.*'") "pytest-mock'"))
2199 #t)))))
2200 (native-inputs
2201 `(("python-pytest-mock" ,python-pytest-mock)
928da609 2202 ("python-pytest" ,python-pytest)
da1f7a9e
BW
2203 ("python-flexmock" ,python-flexmock)))
2204 (propagated-inputs
2205 `(("python-backpack" ,python-backpack)
2206 ("python-blinker" ,python-blinker)
2207 ("python-cleo" ,python-cleo)
2208 ("python-faker" ,python-faker)
2209 ("python-inflection" ,python-inflection)
2210 ("python-lazy-object-proxy" ,python-lazy-object-proxy)
2211 ("python-pendulum" ,python-pendulum)
2212 ("python-pyaml" ,python-pyaml)
2213 ("python-pygments" ,python-pygments)
2214 ("python-simplejson" ,python-simplejson)
2215 ("python-six" ,python-six)
2216 ("python-wrapt" ,python-wrapt)))
2217 (home-page "https://orator-orm.com/")
2218 (synopsis "ActiveRecord ORM for Python")
2219 (description
2220 "Orator provides a simple ActiveRecord-like Object Relational Mapping
2221implementation for Python.")
2222 (license license:expat)
2223 (properties `((python2-variant . ,(delay python2-orator))))))
2224
2225(define-public python2-orator
2226 (package-with-python2 (strip-python2-variant python-orator)))
61ce0998
RJ
2227
2228(define-public virtuoso-ose
2229 (package
2230 (name "virtuoso-ose")
e63da346 2231 (version "7.2.5")
61ce0998
RJ
2232 (source
2233 (origin
2234 (method url-fetch)
2235 (uri (string-append
2236 "https://github.com/openlink/virtuoso-opensource/releases/"
2237 "download/v" version "/virtuoso-opensource-" version ".tar.gz"))
2238 (sha256
e63da346 2239 (base32 "0r1xakclkfi69pzh8z2k16z3x0m49pxp764icj0ad4w4bb97fr42"))))
61ce0998
RJ
2240 (build-system gnu-build-system)
2241 (arguments
6d09a7b5
RJ
2242 `(#:tests? #f ; Tests require a network connection.
2243 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
2244 ;; This indicates that the internal zlib code may still be used.
2245 #:configure-flags '("--without-internal-zlib"
2246 "--with-readline")))
61ce0998
RJ
2247 (inputs
2248 `(("openssl" ,openssl)
6d09a7b5
RJ
2249 ("net-tools" ,net-tools)
2250 ("readline" ,readline)
2251 ("zlib" ,zlib)))
61ce0998
RJ
2252 (home-page "http://vos.openlinksw.com/owiki/wiki/VOS/")
2253 (synopsis "Multi-model database system")
2254 (description "Virtuoso is a scalable cross-platform server that combines
2255relational, graph, and document data management with web application server
2256and web services platform functionality.")
48b68c61
EF
2257 ;; configure: error: ... can only be build on 64bit platforms
2258 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))
61ce0998 2259 (license license:gpl2)))
74248d22 2260
a8714bf6
RW
2261(define-public python-ccm
2262 (package
2263 (name "python-ccm")
2264 (version "2.1.6")
2265 (source
2266 (origin
2267 (method url-fetch)
2268 (uri (pypi-uri "ccm" version))
2269 (sha256
2270 (base32
2271 "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n"))))
2272 (build-system python-build-system)
2273 (propagated-inputs
2274 `(("python-pyyaml" ,python-pyyaml)
2275 ;; Not listed in setup.py, but used in ccmlib/node.py for full
2276 ;; functionality
2277 ("python-psutil" ,python-psutil)
2278 ("python-six" ,python-six)))
2279 (home-page "https://github.com/pcmanus/ccm")
2280 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
2281localhost")
2282 (description "Cassandra Cluster Manager is a development tool for testing
2283local Cassandra clusters. It creates, launches and removes Cassandra clusters
2284on localhost.")
2285 (license license:asl2.0)))
2286
2287(define-public python2-ccm
2288 (package-with-python2 python-ccm))
2289
2290(define-public python2-pysqlite
2291 (package
2292 (name "python2-pysqlite")
2293 (version "2.8.3")
2294 (source
2295 (origin
2296 (method url-fetch)
2297 (uri (pypi-uri "pysqlite" version))
2298 (sha256
2299 (base32
2300 "1424gwq9sil2ffmnizk60q36vydkv8rxs6m7xs987kz8cdc37lqp"))))
2301 (build-system python-build-system)
2302 (inputs
2303 `(("sqlite" ,sqlite)))
2304 (arguments
2305 `(#:python ,python-2 ; incompatible with Python 3
2306 #:tests? #f)) ; no test target
2307 (home-page "https://github.com/ghaering/pysqlite")
2308 (synopsis "SQLite bindings for Python")
2309 (description
2310 "Pysqlite provides SQLite bindings for Python that comply to the
2311Database API 2.0T.")
2312 (license license:zlib)))
2313
2314(define-public python-sqlalchemy
2315 (package
2316 (name "python-sqlalchemy")
1f2f358b 2317 (version "1.3.3")
a8714bf6
RW
2318 (source
2319 (origin
2320 (method url-fetch)
aeec4a8f 2321 (uri (pypi-uri "SQLAlchemy" version))
a8714bf6 2322 (sha256
1f2f358b 2323 (base32 "06c3lcv7nijsgqsjaaa4djrwlzgh9f910zlqxkmgq22h6jl4rici"))))
a8714bf6
RW
2324 (build-system python-build-system)
2325 (native-inputs
6d04f694 2326 `(("python-cython" ,python-cython) ; for C extensions
a8714bf6 2327 ("python-pytest" ,python-pytest)
6d04f694 2328 ("python-mock" ,python-mock))) ; for tests
a8714bf6
RW
2329 (arguments
2330 `(#:phases
2331 (modify-phases %standard-phases
2332 (replace 'check
9871a896 2333 (lambda _ (invoke "py.test"))))))
5cfe650b 2334 (home-page "https://www.sqlalchemy.org")
a8714bf6
RW
2335 (synopsis "Database abstraction library")
2336 (description
2337 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
2338gives application developers the full power and flexibility of SQL. It
2339provides a full suite of well known enterprise-level persistence patterns,
2340designed for efficient and high-performing database access, adapted into a
2341simple and Pythonic domain language.")
2342 (license license:x11)))
2343
2344(define-public python2-sqlalchemy
2345 (package-with-python2 python-sqlalchemy))
2346
2347(define-public python-sqlalchemy-utils
2348 (package
2349 (name "python-sqlalchemy-utils")
53ae35e4 2350 (version "0.32.21")
a8714bf6
RW
2351 (source
2352 (origin
2353 (method url-fetch)
2354 (uri (pypi-uri "SQLAlchemy-Utils" version))
2355 (sha256
2356 (base32
53ae35e4 2357 "1myn71dn8j74xglyh46f12sh8ywb7j0j732rzwq70kvwwnq32m73"))))
a8714bf6
RW
2358 (build-system python-build-system)
2359 (arguments
2360 '(#:tests? #f)) ; FIXME: Many tests require a running database server.
2361 ;; #:phases
2362 ;; (modify-phases %standard-phases
2363 ;; (replace 'check
2364 ;; (lambda _
2365 ;; (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
2366 (propagated-inputs
2367 `(("python-six" ,python-six)
2368 ("python-sqlalchemy" ,python-sqlalchemy)))
2369 (native-inputs
2370 `(("python-dateutil" ,python-dateutil)
2371 ("python-flexmock" ,python-flexmock)
2372 ("python-psycopg2" ,python-psycopg2)
2373 ("python-pytest" ,python-pytest)
2374 ("python-pytz" ,python-pytz)))
2375 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
2376 (synopsis "Various utility functions for SQLAlchemy")
2377 (description
2378 "SQLAlchemy-utils provides various utility functions and custom data types
2379for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
2380
2381You might also want to install the following optional dependencies:
2382@enumerate
2383@item @code{python-passlib}
2384@item @code{python-babel}
2385@item @code{python-cryptography}
2386@item @code{python-pytz}
2387@item @code{python-psycopg2}
2388@item @code{python-furl}
2389@item @code{python-flask-babel}
2390@end enumerate
2391")
2392 (license license:bsd-3)))
2393
2394(define-public python2-sqlalchemy-utils
2395 (package-with-python2 python-sqlalchemy-utils))
2396
2397(define-public python-alembic
2398 (package
2399 (name "python-alembic")
c92d056a 2400 (version "1.0.2")
a8714bf6
RW
2401 (source
2402 (origin
2403 (method url-fetch)
2404 (uri (pypi-uri "alembic" version))
2405 (sha256
2406 (base32
c92d056a 2407 "0asqz9mwc4w8bsar1icv3ik9jslxrj3gv3yxgmhc6nc6r9qbkg04"))))
a8714bf6
RW
2408 (build-system python-build-system)
2409 (native-inputs
2410 `(("python-mock" ,python-mock)
2411 ("python-pytest-cov" ,python-pytest-cov)))
2412 (propagated-inputs
2413 `(("python-dateutil" ,python-dateutil)
2414 ("python-sqlalchemy" ,python-sqlalchemy)
2415 ("python-mako" ,python-mako)
2416 ("python-editor" ,python-editor)))
a7f27da7 2417 (home-page "https://bitbucket.org/zzzeek/alembic")
a8714bf6
RW
2418 (synopsis
2419 "Database migration tool for SQLAlchemy")
2420 (description
2421 "Alembic is a lightweight database migration tool for usage with the
2422SQLAlchemy Database Toolkit for Python.")
2423 (license license:expat)))
2424
2425(define-public python2-alembic
2426 (package-with-python2 python-alembic))
2427
2428(define-public python-pickleshare
2429 (package
2430 (name "python-pickleshare")
f825faa5 2431 (version "0.7.5")
a8714bf6
RW
2432 (source
2433 (origin
2434 (method url-fetch)
ed519b3c 2435 (uri (pypi-uri "pickleshare" version))
a8714bf6 2436 (sha256
f825faa5 2437 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
a8714bf6 2438 (build-system python-build-system)
ff856cfd
MB
2439 (arguments
2440 `(#:phases (modify-phases %standard-phases
2441 (replace 'check
2442 (lambda _
2443 (invoke "pytest"))))))
2444 (native-inputs
2445 `(("python-pytest" ,python-pytest)))
a8714bf6
RW
2446 (home-page "https://github.com/vivainio/pickleshare")
2447 (synopsis "Tiny key value database with concurrency support")
2448 (description
2449 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
2450Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
2451shelve, many processes can access the database simultaneously. Changing a
2452value in database is immediately visible to other processes accessing the same
2453database. Concurrency is possible because the values are stored in separate
2454files. Hence the “database” is a directory where all files are governed by
2455PickleShare.")
ed519b3c 2456 (properties `((python2-variant . ,(delay python2-pickleshare))))
a8714bf6
RW
2457 (license license:expat)))
2458
2459(define-public python2-pickleshare
ed519b3c
MB
2460 (let ((pickleshare (package-with-python2
2461 (strip-python2-variant python-pickleshare))))
2462 (package (inherit pickleshare)
2463 (propagated-inputs `(("python2-pathlib2" ,python2-pathlib2)
2464 ,@(package-propagated-inputs pickleshare))))))
a8714bf6
RW
2465
2466(define-public python-apsw
2467 (package
2468 (name "python-apsw")
2dd12924 2469 (version "3.20.1-r1")
a8714bf6
RW
2470 (source
2471 (origin
2472 (method url-fetch)
2dd12924
MB
2473 (uri (string-append "https://github.com/rogerbinns/apsw/archive/"
2474 version ".tar.gz"))
f5c847eb 2475 (file-name (string-append "apsw-" version ".tar.gz"))
a8714bf6
RW
2476 (sha256
2477 (base32
2dd12924 2478 "00ai7m2pqi26qaflhz314d8k5i3syw7xzr145fhfl0crhyh6adz2"))))
a8714bf6
RW
2479 (build-system python-build-system)
2480 (inputs
c553b08b 2481 `(("sqlite" ,sqlite)))
a8714bf6
RW
2482 (arguments
2483 `(#:phases
2484 (modify-phases %standard-phases
2485 (replace 'build
2486 (lambda _
c553b08b
EF
2487 (invoke "python" "setup.py" "build" "--enable-all-extensions")
2488 #t))
a8714bf6
RW
2489 (add-after 'build 'build-test-helper
2490 (lambda _
c553b08b
EF
2491 (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext"
2492 "-I." "-Isqlite3" "src/testextension.c")
2493 #t))
a8714bf6
RW
2494 (delete 'check)
2495 (add-after 'install 'check
2496 (lambda* (#:key inputs outputs #:allow-other-keys)
2497 (add-installed-pythonpath inputs outputs)
c553b08b
EF
2498 (invoke "python" "setup.py" "test")
2499 #t)))))
a8714bf6
RW
2500 (home-page "https://github.com/rogerbinns/apsw/")
2501 (synopsis "Another Python SQLite Wrapper")
2502 (description "APSW is a Python wrapper for the SQLite
2503embedded relational database engine. In contrast to other wrappers such as
2504pysqlite it focuses on being a minimal layer over SQLite attempting just to
2505translate the complete SQLite API into Python.")
2506 (license license:zlib)))
2507
2508(define-public python2-apsw
2509 (package-with-python2 python-apsw))
2510
2511(define-public python2-neo4j-driver
2512 (package
2513 (name "python2-neo4j-driver")
2514 ;; NOTE: When upgrading to 1.5.0, please add a python3 variant.
2515 (version "1.4.0")
2516 (source (origin
2517 (method url-fetch)
2518 (uri (pypi-uri "neo4j-driver" version))
2519 (sha256
2520 (base32
2521 "011r1vh182p8mm83d8dz9rfnc3l7rf7fd00cyrbyfzi71jmc4g98"))))
2522 (build-system python-build-system)
2523 (arguments
2524 `(#:python ,python-2))
2525 (home-page "https://neo4j.com/developer/python/")
2526 (synopsis "Neo4j driver code written in Python")
2527 (description "This package provides the Neo4j Python driver that connects
2528to the database using Neo4j's binary protocol. It aims to be minimal, while
2529being idiomatic to Python.")
2530 (license license:asl2.0)))
2531
2532(define-public python2-py2neo
2533 (package
2534 (name "python2-py2neo")
2535 (version "3.1.2")
2536 (source (origin
2537 (method url-fetch)
2538 (uri (pypi-uri "py2neo" version))
2539 (sha256
2540 (base32
2541 "1f1q95vqcvlc3nsc33p841swnjdcjazddlq2dzi3qfnjqjrajxw1"))))
2542 (build-system python-build-system)
2543 (arguments
2544 `(#:python ,python-2))
2545 (home-page "http://py2neo.org")
2546 (synopsis "Library and toolkit for working with Neo4j in Python")
2547 (description "This package provides a client library and toolkit for
2548working with Neo4j from within Python applications and from the command
2549line. The core library has no external dependencies and has been carefully
2550designed to be easy and intuitive to use.")
2551 (license license:asl2.0)))
2552
2553(define-public python-psycopg2
2554 (package
2555 (name "python-psycopg2")
72b7de49 2556 (version "2.7.7")
a8714bf6
RW
2557 (source
2558 (origin
2559 (method url-fetch)
2560 (uri (pypi-uri "psycopg2" version))
2561 (sha256
72b7de49 2562 (base32 "0zjbabb4qjx9dm07imhf8y5a9rpa06d5zah80myiimgdi83nslpl"))))
a8714bf6
RW
2563 (build-system python-build-system)
2564 (arguments
2565 ;; Tests would require a postgresql database "psycopg2_test"
2566 ;; and a running postgresql database management service.
2567 `(#:tests? #f)) ; TODO re-enable after providing a test-db.
2568 (inputs
2569 `(("postgresql" ,postgresql))) ; libpq
2570 (home-page "http://initd.org/psycopg/")
2571 (synopsis "Python PostgreSQL adapter")
2572 (description
19601e89
BW
2573 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
25742.0.")
a8714bf6
RW
2575 (license license:lgpl3+)))
2576
2577(define-public python2-psycopg2
2578 (package-with-python2 python-psycopg2))
2579
2580(define-public python-sadisplay
2581 (package
2582 (name "python-sadisplay")
bcdc5cae 2583 (version "0.4.8")
a8714bf6
RW
2584 (source
2585 (origin
2586 (method url-fetch)
2587 (uri (pypi-uri "sadisplay" version))
2588 (sha256
2589 (base32
bcdc5cae 2590 "01d9lxhmgpb68gy8rd6zj6fcwp84n2qq210n1qsk3qbsir79bzh4"))))
a8714bf6
RW
2591 (build-system python-build-system)
2592 (propagated-inputs
2593 `(("python-sqlalchemy" ,python-sqlalchemy)))
2594 (native-inputs
bcdc5cae 2595 ;; For tests.
a8714bf6
RW
2596 `(("python-nose" ,python-nose)))
2597 (home-page "https://bitbucket.org/estin/sadisplay")
2598 (synopsis "SQLAlchemy schema displayer")
2599 (description "This package provides a program to build Entity
2600Relationship diagrams from a SQLAlchemy model (or directly from the
2601database).")
2602 (license license:bsd-3)))
2603
2604(define-public python2-sadisplay
2605 (package-with-python2 python-sadisplay))
2606
2607(define-public python-mysqlclient
2608 (package
2609 (name "python-mysqlclient")
28635e52 2610 (version "1.3.13")
a8714bf6
RW
2611 (source
2612 (origin
2613 (method url-fetch)
2614 (uri (pypi-uri "mysqlclient" version))
2615 (sha256
2616 (base32
28635e52 2617 "0kv4a1icwdav8jpl7qvnr931lw5h3v22ids6lwq6qpi1hjzf33pz"))))
a8714bf6
RW
2618 (build-system python-build-system)
2619 (native-inputs
f94051e6 2620 `(("nose" ,python-nose)
a8714bf6
RW
2621 ("mock" ,python-mock)
2622 ("py.test" ,python-pytest)))
2623 (inputs
f94051e6 2624 `(("mysql" ,mariadb)
a8714bf6
RW
2625 ("libz" ,zlib)
2626 ("openssl" ,openssl)))
2627 (home-page "https://github.com/PyMySQL/mysqlclient-python")
2628 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
2629 (description "MySQLdb is an interface to the popular MySQL database server
2630for Python. The design goals are:
2631@enumerate
2632@item Compliance with Python database API version 2.0 [PEP-0249],
2633@item Thread-safety,
2634@item Thread-friendliness (threads will not block each other).
2635@end enumerate")
2636 (license license:gpl2)))
2637
2638(define-public python2-mysqlclient
2639 (package-with-python2 python-mysqlclient))
2640
2641(define-public python-hiredis
2642 (package
2643 (name "python-hiredis")
2644 (version "0.2.0")
2645 (source
2646 (origin
2647 (method url-fetch)
2648 (uri (pypi-uri "hiredis" version))
2649 (sha256
2650 (base32
2651 "1dfm2k9l9zar9nw9fwmm74zrgraxdxs04vx9li56fjcf289qx5fa"))))
2652 (build-system python-build-system)
2653 (arguments
2654 ;; no tests
2655 `(#:tests? #f))
2656 (home-page "https://github.com/redis/hiredis-py")
2657 (synopsis "Python extension that wraps protocol parsing code in hiredis")
2658 (description "Python-hiredis is a python extension that wraps protocol
2659parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
2660 (license license:bsd-3)))
2661
2662(define-public python2-hiredis
2663 (package-with-python2 python-hiredis))
2664
2665(define-public python-fakeredis
2666 (package
2667 (name "python-fakeredis")
2668 (version "0.8.2")
2669 (source
2670 (origin
2671 (method url-fetch)
2672 (uri (pypi-uri "fakeredis" version))
2673 (sha256
2674 (base32
2675 "0zncahj3byyasyfx9i7k991ph0n0lq8v3a21pqri5qxn9564bk9r"))))
2676 (build-system python-build-system)
2677 (arguments
2678 ;; no tests
2679 `(#:tests? #f))
2680 (home-page "https://github.com/jamesls/fakeredis")
2681 (synopsis "Fake implementation of redis API for testing purposes")
a4764ff0
TGR
2682 (description
2683 "Fakeredis is a pure-Python implementation of the redis-py Python client
2684that simulates talking to a redis server. It was created for a single purpose:
2685to write unit tests.
2686
2687Setting up redis is not hard, but one often wants to write unit tests that don't
2688talk to an external server such as redis. This module can be used as a
2689reasonable substitute.")
a8714bf6
RW
2690 (license license:bsd-3)))
2691
2692(define-public python2-fakeredis
2693 (package-with-python2 python-fakeredis))
2694
2695(define-public python-redis
2696 (package
2697 (name "python-redis")
a263a976 2698 (version "3.2.1")
a8714bf6
RW
2699 (source
2700 (origin
2701 (method url-fetch)
2702 (uri (pypi-uri "redis" version))
2703 (sha256
a263a976 2704 (base32 "0wwj8il4c3aff15xwwcjfci367zxsakq05ps1a2il6yavp91i94c"))))
a8714bf6 2705 (build-system python-build-system)
a263a976 2706 ;; Tests require a running Redis server.
a8714bf6
RW
2707 (arguments '(#:tests? #f))
2708 ;; As long as we are not running test, we do not need this input :-)
2709 ;;(native-inputs
2710 ;; `(("python-pytest" ,python-pytest)))
2711 (home-page "https://github.com/andymccurdy/redis-py")
2712 (synopsis "Redis Python client")
2713 (description
2714 "This package provides a Python interface to the Redis key-value store.")
2715 (license license:expat)))
2716
2717(define-public python2-redis
2718 (package-with-python2 python-redis))
2719
2720(define-public python-rq
2721 (package
2722 (name "python-rq")
865c76ea 2723 (version "0.13.0")
a8714bf6
RW
2724 (source
2725 (origin
2726 (method url-fetch)
2727 (uri (pypi-uri "rq" version))
2728 (sha256
865c76ea 2729 (base32 "0xvapd2bxnyq480i48bdkddzlqmv2axbsq85rlfy8k3al8zxxxrf"))))
a8714bf6
RW
2730 (build-system python-build-system)
2731 (propagated-inputs
2732 `(("python-click" ,python-click)
2733 ("python-redis" ,python-redis)))
2734 (home-page "http://python-rq.org/")
2735 (synopsis "Simple job queues for Python")
2736 (description
2737 "RQ (Redis Queue) is a simple Python library for queueing jobs and
2738processing them in the background with workers. It is backed by Redis and it
2739is designed to have a low barrier to entry.")
2740 (license license:bsd-2)))
2741
2742(define-public python2-rq
2743 (package-with-python2 python-rq))
2744
2745(define-public python-trollius-redis
2746 (package
2747 (name "python-trollius-redis")
2748 (version "0.1.4")
2749 (source
2750 (origin
2751 (method url-fetch)
2752 (uri (pypi-uri "trollius_redis" version))
2753 (sha256
2754 (base32
2755 "0k3vypszmgmaipgw9xscvgm79h2zd6p6ci8gdp5sxl6g5kbqr9fy"))))
2756 (build-system python-build-system)
2757 ;; TODO: Tests require packaging 'hiredis'.
2758 (arguments '(#:tests? #f))
2759 (home-page "https://github.com/benjolitz/trollius-redis")
2760 (synopsis "Port of asyncio-redis to trollius")
2761 (description "@code{trollius-redis} is a Redis client for Python
2762 trollius. It is an asynchronious IO (PEP 3156) implementation of the
2763 Redis protocol.")
2764 (license license:bsd-2)))
2765
2766(define-public python2-trollius-redis
2767 (package-with-python2 python-trollius-redis))
2768
2769(define-public python-sqlparse
2770 (package
2771 (name "python-sqlparse")
2772 (version "0.2.4")
2773 (source (origin
2774 (method url-fetch)
2775 (uri (pypi-uri "sqlparse" version))
2776 (sha256
2777 (base32
2778 "1v3xh0bkfhb262dbndgzhivpnhdwavdzz8jjhx9vx0xbrx2880nf"))))
2779 (build-system python-build-system)
2780 (arguments
2781 `(#:phases
2782 (modify-phases %standard-phases
2783 (replace 'check
96272e28 2784 (lambda _ (invoke "py.test"))))))
a8714bf6
RW
2785 (native-inputs
2786 `(("python-pytest" ,python-pytest)))
2787 (home-page "https://github.com/andialbrecht/sqlparse")
2788 (synopsis "Non-validating SQL parser")
2789 (description "Sqlparse is a non-validating SQL parser for Python. It
2790provides support for parsing, splitting and formatting SQL statements.")
2791 (license license:bsd-3)))
2792
2793(define-public python2-sqlparse
2794 (package-with-python2 python-sqlparse))
2795
2796(define-public python-sql
2797 (package
2798 (name "python-sql")
909404b5 2799 (version "1.0.0")
a8714bf6
RW
2800 (source
2801 (origin
2802 (method url-fetch)
2803 (uri (pypi-uri "python-sql" version))
2804 (sha256
909404b5 2805 (base32 "05ni936y0ia9xmryl7mlhbj9i80nnvq1bi4zxhb96rv7yvpb3fqb"))))
a8714bf6
RW
2806 (build-system python-build-system)
2807 (home-page "https://python-sql.tryton.org/")
2808 (synopsis "Library to write SQL queries in a pythonic way")
2809 (description "@code{python-sql} is a library to write SQL queries, that
2810transforms idiomatic python function calls to well-formed SQL queries.")
2811 (license license:bsd-3)))
2812
2813(define-public python2-sql
2814 (package-with-python2 python-sql))
33c88fcb
CB
2815
2816(define-public mongo-tools
2817 (package
2818 (name "mongo-tools")
2819 (version "3.4.0")
2820 (source
2821 (origin (method git-fetch)
2822 (uri (git-reference
2823 (url "https://github.com/mongodb/mongo-tools")
2824 (commit (string-append "r" version))))
2825 (file-name (git-file-name name version))
2826 (sha256
2827 (base32
9b32bf6e 2828 "1bcsz5cvj39a7nsxsfqmz9igrw33j6yli9kffigqyscs52amw7x1"))))
33c88fcb
CB
2829 (build-system go-build-system)
2830 (arguments
9b32bf6e
CB
2831 `(#:import-path "github.com/mongodb/mongo-tools"
2832 #:modules ((srfi srfi-1)
2833 (guix build go-build-system)
2834 (guix build utils))
e3900a4d 2835 #:install-source? #f
33c88fcb 2836 #:phases
9b32bf6e
CB
2837 (let ((all-tools
2838 '("bsondump" "mongodump" "mongoexport" "mongofiles"
2839 "mongoimport" "mongooplog" "mongorestore"
2840 "mongostat" "mongotop")))
2841 (modify-phases %standard-phases
2842 (add-after 'unpack 'delete-bundled-source-code
2843 (lambda _
2844 (delete-file-recursively
2845 "src/github.com/mongodb/mongo-tools/vendor")
2846 #t))
fe596965
CB
2847 (add-after 'delete-bundled-source-code 'patch-source
2848 (lambda _
2849 ;; Remove a redundant argument that causes compilation to fail.
2850 (substitute*
2851 "src/github.com/mongodb/mongo-tools/mongorestore/filepath.go"
2852 (("skipping restore of system.profile collection\", db)")
2853 "skipping restore of system.profile collection\")"))
2854 #t))
9b32bf6e
CB
2855 (replace 'build
2856 (lambda _
96272e28
MW
2857 (for-each (lambda (tool)
2858 (let ((command
2859 `("go" "build"
2860 ;; This is where the tests expect to find the
2861 ;; executables
2862 "-o" ,(string-append
2863 "src/github.com/mongodb/mongo-tools/bin/"
2864 tool)
2865 "-v"
2866 "-tags=\"ssl sasl\""
2867 "-ldflags"
2868 "-extldflags=-Wl,-z,now,-z,relro"
2869 ,(string-append
2870 "src/github.com/mongodb/mongo-tools/"
2871 tool "/main/" tool ".go"))))
2872 (simple-format #t "build: running ~A\n"
2873 (string-join command))
2874 (apply invoke command)))
2875 all-tools)
2876 #t))
9b32bf6e
CB
2877 (replace 'check
2878 (lambda _
2879 (with-directory-excursion "src"
96272e28
MW
2880 (for-each (lambda (tool)
2881 (invoke
2882 "go" "test" "-v"
2883 (string-append "github.com/mongodb/mongo-tools/"
2884 tool)))
2885 all-tools))
2886 #t))
9b32bf6e
CB
2887 (replace 'install
2888 (lambda* (#:key outputs #:allow-other-keys)
2889 (for-each (lambda (tool)
2890 (install-file
96272e28
MW
2891 (string-append "src/github.com/mongodb/mongo-tools/bin/"
2892 tool)
9b32bf6e
CB
2893 (string-append (assoc-ref outputs "out")
2894 "/bin")))
96272e28
MW
2895 all-tools)
2896 #t))))))
33c88fcb
CB
2897 (native-inputs
2898 `(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
2899 ("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)
2900 ("go-golang.org-x-crypto-ssh-terminal" ,go-golang.org-x-crypto-ssh-terminal)
2901 ("go-gopkg.in-mgo.v2" ,go-gopkg.in-mgo.v2)
2902 ("go-gopkg.in-tomb.v2" ,go-gopkg.in-tomb.v2)
9b32bf6e
CB
2903 ("go-github.com-nsf-termbox-go" ,go-github.com-nsf-termbox-go)
2904 ("go-github.com-smartystreets-goconvey" ,go-github.com-smartystreets-goconvey)))
33c88fcb
CB
2905 (home-page "https://github.com/mongodb/mongo-tools")
2906 (synopsis "Various tools for interacting with MongoDB and BSON")
2907 (description
2908 "This package includes a collection of tools related to MongoDB.
2909@table @code
2910@item bsondump
2911Display BSON files in a human-readable format
2912@item mongoimport
2913Convert data from JSON, TSV or CSV and insert them into a collection
2914@item mongoexport
2915Write an existing collection to CSV or JSON format
2916@item mongodump/mongorestore
2917Dump MongoDB backups to disk in the BSON format
2918@item mongorestore
2919Read MongoDB backups in the BSON format, and restore them to a live database
2920@item mongostat
2921Monitor live MongoDB servers, replica sets, or sharded clusters
2922@item mongofiles
2923Read, write, delete, or update files in GridFS
2924@item mongooplog
2925Replay oplog entries between MongoDB servers
2926@item mongotop
2927Monitor read/write activity on a mongo server
2928@end table")
2929 (license license:asl2.0)))
dae7661a
LF
2930
2931(define-public apache-arrow
2932 (package
2933 (name "apache-arrow")
e58d3a59 2934 (version "0.10.0")
dae7661a
LF
2935 (source
2936 (origin
2937 (method git-fetch)
2938 (uri (git-reference
2939 (url "https://github.com/apache/arrow")
2940 (commit (string-append "apache-arrow-" version))))
2941 (file-name (git-file-name name version))
2942 (sha256
e58d3a59
RW
2943 (base32
2944 "04xkp922b8qrrnpvv9ixxnvk7151n1plzx6aqdff6frn9651zvxs"))))
dae7661a
LF
2945 (build-system cmake-build-system)
2946 (arguments
2947 `(#:tests? #f
2948 #:phases
2949 (modify-phases %standard-phases
2950 (add-before 'configure 'enter-source-directory
2951 (lambda _ (chdir "cpp") #t))
2952 (add-after 'unpack 'set-env
2953 (lambda _
2954 (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
2955 (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
2956 (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
2957 (setenv "JEMALLOC_HOME" (assoc-ref %build-inputs "jemalloc"))
2958 (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson"))
2959 #t)))
3def739d 2960 #:build-type "Release"
dae7661a 2961 #:configure-flags
3def739d 2962 (list "-DARROW_PYTHON=ON"
dae7661a
LF
2963
2964 ;; Install to PREFIX/lib (the default is
2965 ;; PREFIX/lib64).
2966 (string-append "-DCMAKE_INSTALL_LIBDIR="
2967 (assoc-ref %outputs "out")
2968 "/lib")
2969
2970 ;; XXX These Guix package offer static
2971 ;; libraries that are not position independent,
2972 ;; and ld fails to link them into the arrow .so
2973 "-DARROW_WITH_SNAPPY=OFF"
2974 "-DARROW_WITH_ZLIB=OFF"
2975 "-DARROW_WITH_ZSTD=OFF"
2976 "-DARROW_WITH_LZ4=OFF"
2977
2978 ;; Building the tests forces on all the
2979 ;; optional features and the use of static
2980 ;; libraries.
2981 "-DARROW_BUILD_TESTS=OFF"
2982 "-DARROW_BUILD_STATIC=OFF")))
2983 (inputs
2984 `(("boost" ,boost)
2985 ("rapidjson" ,rapidjson)
2986 ("brotli" ,google-brotli)
2987 ("flatbuffers" ,flatbuffers)
e58d3a59 2988 ("jemalloc" ,jemalloc)
dae7661a
LF
2989 ("python-3" ,python)
2990 ("python-numpy" ,python-numpy)))
2991 (home-page "https://arrow.apache.org/")
2992 (synopsis "Columnar in-memory analytics")
2993 (description "Apache Arrow is a columnar in-memory analytics layer
2994designed to accelerate big data. It houses a set of canonical in-memory
2995representations of flat and hierarchical data along with multiple
2996language-bindings for structure manipulation. It also provides IPC and common
2997algorithm implementations.")
2998 (license license:asl2.0)))
5e5ac710
LF
2999
3000(define-public python-pyarrow
3001 (package
3002 (name "python-pyarrow")
0fa926c2 3003 (version "0.10.0")
5e5ac710
LF
3004 (source
3005 (origin
3006 (method git-fetch)
3007 (uri (git-reference
3008 (url "https://github.com/apache/arrow")
3009 (commit (string-append "apache-arrow-" version))))
3010 (file-name (git-file-name name version))
3011 (sha256
0fa926c2
RW
3012 (base32
3013 "04xkp922b8qrrnpvv9ixxnvk7151n1plzx6aqdff6frn9651zvxs"))))
5e5ac710
LF
3014 (build-system python-build-system)
3015 (arguments
0fa926c2 3016 '(#:tests? #f ; XXX There are no tests in the "python" directory
5e5ac710
LF
3017 #:phases
3018 (modify-phases %standard-phases
0fa926c2 3019 (delete 'build) ; XXX the build is performed again during the install phase
5e5ac710
LF
3020 (add-after 'unpack 'enter-source-directory
3021 (lambda _ (chdir "python") #t))
3022 (add-after 'unpack 'set-env
3023 (lambda _
3024 (setenv "ARROW_HOME" (assoc-ref %build-inputs "apache-arrow"))
3025 #t)))))
3026 (propagated-inputs
3027 `(("apache-arrow" ,apache-arrow)
3028 ("python-numpy" ,python-numpy)
3029 ("python-pandas" ,python-pandas)
3030 ("python-six" ,python-six)))
3031 (native-inputs
3032 `(("cmake" ,cmake)
3033 ("python-cython" ,python-cython)
3034 ("python-pytest" ,python-pytest)
0fa926c2 3035 ("python-pytest-runner" ,python-pytest-runner)
5e5ac710
LF
3036 ("python-setuptools-scm" ,python-setuptools-scm)))
3037 (home-page "https://arrow.apache.org/docs/python/")
3038 (synopsis "Python bindings for Apache Arrow")
3039 (description "This library provides a Pythonic API wrapper for the reference
3040Arrow C++ implementation, along with tools for interoperability with pandas,
3041NumPy, and other traditional Python scientific computing packages.")
3042 (license license:asl2.0)))
3043
3044(define-public python2-pyarrow
3045 (package-with-python2 python-pyarrow))