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