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