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