gnu: mongodb: Update to 3.4.24 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / databases.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2013, 2017 Cyril Roelandt <tipecaml@gmail.com>
5 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
8 ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
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>
13 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
14 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
15 ;;; Copyright © 2016, 2017, 2018 Roel Janssen <roel@gnu.org>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
18 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
19 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
20 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
21 ;;; Copyright © 2017, 2018 Julien Lepiller <julien@lepiller.eu>
22 ;;; Copyright © 2017, 2020 Thomas Danckaert <post@thomasdanckaert.be>
23 ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
24 ;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
25 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
26 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
27 ;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
28 ;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
29 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
30 ;;; Copyright © 2017, 2018 Pierre Langlois <pierre.langlois@gmx.com>
31 ;;; Copyright © 2015, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
32 ;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
33 ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
34 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
35 ;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
36 ;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
37 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
38 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
39 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
40 ;;; Copyright © 2019, 2021 Guillaume Le Vaillant <glv@posteo.net>
41 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
42 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
43 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
44 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
45 ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
46 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
47 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
48 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
49 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
50 ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
51 ;;;
52 ;;; This file is part of GNU Guix.
53 ;;;
54 ;;; GNU Guix is free software; you can redistribute it and/or modify it
55 ;;; under the terms of the GNU General Public License as published by
56 ;;; the Free Software Foundation; either version 3 of the License, or (at
57 ;;; your option) any later version.
58 ;;;
59 ;;; GNU Guix is distributed in the hope that it will be useful, but
60 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
61 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62 ;;; GNU General Public License for more details.
63 ;;;
64 ;;; You should have received a copy of the GNU General Public License
65 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
66
67 (define-module (gnu packages databases)
68 #:use-module (gnu packages)
69 #:use-module (gnu packages admin)
70 #:use-module (gnu packages algebra)
71 #:use-module (gnu packages autotools)
72 #:use-module (gnu packages avahi)
73 #:use-module (gnu packages base)
74 #:use-module (gnu packages bash)
75 #:use-module (gnu packages bison)
76 #:use-module (gnu packages boost)
77 #:use-module (gnu packages check)
78 #:use-module (gnu packages cmake)
79 #:use-module (gnu packages compression)
80 #:use-module (gnu packages crypto)
81 #:use-module (gnu packages curl)
82 #:use-module (gnu packages cyrus-sasl)
83 #:use-module (gnu packages dbm)
84 #:use-module (gnu packages emacs)
85 #:use-module (gnu packages flex)
86 #:use-module (gnu packages gcc)
87 #:use-module (gnu packages gettext)
88 #:use-module (gnu packages glib)
89 #:use-module (gnu packages gnupg)
90 #:use-module (gnu packages golang)
91 #:use-module (gnu packages guile)
92 #:use-module (gnu packages icu4c)
93 #:use-module (gnu packages jemalloc)
94 #:use-module (gnu packages language)
95 #:use-module (gnu packages libedit)
96 #:use-module (gnu packages libevent)
97 #:use-module (gnu packages linux)
98 #:use-module (gnu packages lisp)
99 #:use-module (gnu packages lisp-xyz)
100 #:use-module (gnu packages logging)
101 #:use-module (gnu packages man)
102 #:use-module (gnu packages maths)
103 #:use-module (gnu packages multiprecision)
104 #:use-module (gnu packages ncurses)
105 #:use-module (gnu packages onc-rpc)
106 #:use-module (gnu packages parallel)
107 #:use-module (gnu packages pcre)
108 #:use-module (gnu packages perl)
109 #:use-module (gnu packages perl-check)
110 #:use-module (gnu packages perl-web)
111 #:use-module (gnu packages pkg-config)
112 #:use-module (gnu packages popt)
113 #:use-module (gnu packages protobuf)
114 #:use-module (gnu packages python)
115 #:use-module (gnu packages python-crypto)
116 #:use-module (gnu packages python-science)
117 #:use-module (gnu packages python-web)
118 #:use-module (gnu packages python-xyz)
119 #:use-module (gnu packages rdf)
120 #:use-module (gnu packages readline)
121 #:use-module (gnu packages regex)
122 #:use-module (gnu packages rpc)
123 #:use-module (gnu packages ruby)
124 #:use-module (gnu packages serialization)
125 #:use-module (gnu packages sphinx)
126 #:use-module (gnu packages sqlite)
127 #:use-module (gnu packages tcl)
128 #:use-module (gnu packages terminals)
129 #:use-module (gnu packages textutils)
130 #:use-module (gnu packages time)
131 #:use-module (gnu packages tls)
132 #:use-module (gnu packages valgrind)
133 #:use-module (gnu packages web)
134 #:use-module (gnu packages xml)
135 #:use-module ((guix licenses) #:prefix license:)
136 #:use-module (guix packages)
137 #:use-module (guix download)
138 #:use-module (guix bzr-download)
139 #:use-module (guix git-download)
140 #:use-module (guix hg-download)
141 #:use-module (guix build-system emacs)
142 #:use-module (guix build-system gnu)
143 #:use-module (guix build-system go)
144 #:use-module (guix build-system perl)
145 #:use-module (guix build-system python)
146 #:use-module (guix build-system ruby)
147 #:use-module (guix build-system cmake)
148 #:use-module (guix build-system scons)
149 #:use-module (guix build-system trivial)
150 #:use-module (guix utils)
151 #:use-module (srfi srfi-1)
152 #:use-module (srfi srfi-26)
153 #:use-module (ice-9 match))
154
155 (define-public 4store
156 (package
157 (name "4store")
158 (version "1.1.6")
159 (source (origin
160 (method git-fetch)
161 (uri (git-reference
162 (url "https://github.com/4store/4store")
163 (commit (string-append "v" version))))
164 (file-name (git-file-name name version))
165 (sha256
166 (base32 "1kzdfmwpzy64cgqlkcz5v4klwx99w0jk7afckyf7yqbqb4rydmpk"))
167 (patches (search-patches "4store-unset-preprocessor-directive.patch"
168 "4store-fix-buildsystem.patch"))))
169 (build-system gnu-build-system)
170 (native-inputs
171 `(("perl" ,perl)
172 ("python" ,python-2)
173 ("autoconf" ,autoconf)
174 ("automake" ,automake)
175 ("gettext" ,gettext-minimal)
176 ("libtool" ,libtool)
177 ("pcre" ,pcre "bin") ;for 'pcre-config'
178 ("pkg-config" ,pkg-config)))
179 (inputs
180 `(("glib" ,glib)
181 ("rasqal" ,rasqal)
182 ("libxml2" ,libxml2)
183 ("raptor2" ,raptor2)
184 ("readline" ,readline)
185 ("avahi" ,avahi)
186 ("cyrus-sasl" ,cyrus-sasl)
187 ("openssl" ,openssl)
188 ("util-linux" ,util-linux "lib")))
189 ;; http://www.4store.org has been down for a while now.
190 (home-page "https://github.com/4store/4store")
191 (synopsis "Clustered RDF storage and query engine")
192 (description "4store is a RDF/SPARQL store written in C, supporting
193 either single machines or networked clusters.")
194 (license license:gpl3+)))
195
196 (define-public go-gopkg.in-mgo.v2
197 (package
198 (name "go-gopkg.in-mgo.v2")
199 (version "2016.08.01")
200 (source (origin
201 (method git-fetch)
202 (uri (git-reference
203 (url "https://github.com/go-mgo/mgo")
204 (commit (string-append "r" version))))
205 (file-name (git-file-name name version))
206 (sha256
207 (base32
208 "0rwbi1z63w43b0z9srm8m7iz1fdwx7bq7n2mz862d6liiaqa59jd"))))
209 (build-system go-build-system)
210 (arguments
211 `(#:import-path "gopkg.in/mgo.v2"
212 ;; TODO: The tests fail as MongoDB fails to start
213 ;; Error parsing command line: unrecognised option '--chunkSize'
214 #:tests? #f
215 #:phases
216 (modify-phases %standard-phases
217 (delete 'reset-gzip-timestamps)
218 (add-before 'check 'start-mongodb
219 (lambda* (#:key tests? #:allow-other-keys)
220 (when tests?
221 (with-directory-excursion "src/gopkg.in/mgo.v2"
222 (invoke "make" "startdb")))
223 #t))
224 (add-after 'check 'stop'mongodb
225 (lambda* (#:key tests? #:allow-other-keys)
226 (when tests?
227 (with-directory-excursion "src/gopkg.in/mgo.v2"
228 (invoke "make" "stopdb")))
229 #t)))))
230 (native-inputs
231 `(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
232 ("mongodb" ,mongodb)
233 ("daemontools" ,daemontools)))
234 (synopsis "@code{mgo} offers a rich MongoDB driver for Go.")
235 (description
236 "@code{mgo} (pronounced as mango) is a MongoDB driver for the Go language.
237 It implements a rich selection of features under a simple API following
238 standard Go idioms.")
239 (home-page "https://labix.org/mgo")
240 (license license:bsd-2)))
241
242 (define-public ephemeralpg
243 (package
244 (name "ephemeralpg")
245 (version "3.1")
246 (source
247 (origin
248 (method url-fetch)
249 (uri (string-append
250 "https://eradman.com/ephemeralpg/code/ephemeralpg-"
251 version ".tar.gz"))
252 (sha256
253 (base32 "1ap22ki8yz6agd0qybcjgs4b9izw1rwwcgpxn3jah2ccfyax34s6"))))
254 (build-system gnu-build-system)
255 (arguments
256 `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
257 (string-append "PREFIX=" %output))
258 #:phases
259 (modify-phases %standard-phases
260 (delete 'configure) ; no configure script
261 (add-after 'install 'wrap
262 (lambda* (#:key inputs outputs #:allow-other-keys)
263 (let ((out (assoc-ref outputs "out")))
264 (wrap-program (string-append out "/bin/pg_tmp")
265 `("PATH" ":" prefix
266 (,(string-append (assoc-ref inputs "util-linux")
267 "/bin")
268 ,(string-append (assoc-ref inputs "postgresql")
269 "/bin")
270 ;; For getsocket.
271 ,(string-append out "/bin")))))
272 #t)))
273 #:test-target "test"))
274 (inputs
275 `(("postgresql" ,postgresql)
276 ("util-linux" ,util-linux)))
277 (native-inputs
278 ;; For tests.
279 `(("ruby" ,ruby)
280 ("which" ,which)))
281 (home-page "https://eradman.com/ephemeralpg/")
282 (synopsis "Run temporary PostgreSQL databases")
283 (description
284 "@code{pg_tmp} creates temporary PostgreSQL databases, suitable for tasks
285 like running software test suites. Temporary databases created with
286 @code{pg_tmp} have a limited shared memory footprint and are automatically
287 garbage-collected after a configurable number of seconds (the default is
288 60).")
289 (license license:isc)))
290
291 (define-public es-dump-restore
292 (package
293 (name "es-dump-restore")
294 (version "2.1.0")
295 (source
296 (origin
297 (method url-fetch)
298 (uri (rubygems-uri "es_dump_restore" version))
299 (sha256
300 (base32
301 "020yk7f1hw48clmf5501z3xv9shsdchyymcv0y2cci2c1xvr1mim"))))
302 (build-system ruby-build-system)
303 (arguments
304 '(#:tests? #f)) ;; No testsuite.
305 (propagated-inputs
306 `(("ruby-httpclient" ,ruby-httpclient)
307 ("ruby-multi-json" ,ruby-multi-json)
308 ("ruby-progress_bar" ,ruby-progress_bar)
309 ("ruby-rubyzip" ,ruby-rubyzip)
310 ("ruby-thor" ,ruby-thor)))
311 (synopsis "Utility for dumping and restoring ElasticSearch indexes")
312 (description
313 "This package provides a utility for dumping the contents of an
314 ElasticSearch index to a compressed file and restoring the dumpfile back to an
315 ElasticSearch server")
316 (home-page "https://github.com/patientslikeme/es_dump_restore")
317 (license license:expat)))
318
319 (define-public firebird
320 (package
321 (name "firebird")
322 (version "3.0.7")
323 (source
324 (let ((revision "33374-0"))
325 (origin
326 (method url-fetch)
327 (uri (string-append "https://github.com/FirebirdSQL/"
328 "firebird/releases/download/R"
329 (string-replace-substring version "." "_") "/"
330 "Firebird-" version "." revision ".tar.bz2"))
331 (sha256
332 (base32 "0xpy1bncz36c6n28y7kllm1dkrdkn4vb4gw2n43f2351mznmrf5c"))
333 (modules '((guix build utils)))
334 (snippet
335 `(begin
336 (for-each
337 delete-file-recursively
338 (list "extern/btyacc/test" ; TODO: package and remove entirely
339 "extern/editline"
340 "extern/icu"
341 "extern/libtommath"
342 "extern/zlib"
343 "src/include/firebird/impl/boost"
344
345 ;; Missing licence.
346 "builds/install/arch-specific/solaris"
347 "extern/SfIO"
348 "src/msgs/templates.sql"
349
350 ;; Generated files missing sources.
351 "doc/Firebird-3-QuickStart.pdf"
352 (string-append "doc/Firebird-" ,version
353 "-ReleaseNotes.pdf")
354 "doc/README.SecureRemotePassword.html"))
355 #t)))))
356 (build-system gnu-build-system)
357 (outputs (list "debug" "out"))
358 (arguments
359 `(#:configure-flags
360 (let ((out (assoc-ref %outputs "out")))
361 (list (string-append "--with-fbsbin=" out "/sbin")
362 (string-append "--with-fbdoc=" out "/share/doc/"
363 ,name "-" ,version)
364 (string-append "--with-fbconf=" out "/lib/firebird")
365 (string-append "--with-fbintl=" out "/lib/firebird/intl")
366 (string-append "--with-fbmisc=" out "/lib/firebird/misc")
367 (string-append "--with-fbmsg=" out "/lib/firebird")
368 (string-append "--with-fbplugins=" out "/lib/firebird/plugins")
369 (string-append "--with-fbudf=" out "/lib/firebird/UDF")
370 "--with-fbglock=/run/firebird"
371 "--with-fblog=/var/log/firebird"
372 "--with-fbhelp=/var/lib/firebird/system"
373 "--with-fbsecure-db=/var/lib/firebird/secure"
374 "--without-fbsample"
375 "--without-fbsample-db"
376 "--with-system-editline"))
377 #:make-flags
378 (list (string-append "CC=" ,(cc-for-target))
379 ;; The plugins/ can't find libfbclient otherwise.
380 (string-append "LDFLAGS=-Wl,-rpath="
381 (assoc-ref %outputs "out") "/lib"))
382 #:tests? #f ; no test suite
383 #:modules ((guix build gnu-build-system)
384 (guix build utils)
385 (srfi srfi-26))
386 #:phases
387 (modify-phases %standard-phases
388 (add-after 'unpack 'use-system-boost
389 (lambda _
390 (substitute* "src/include/firebird/Message.h"
391 (("\"\\./impl/boost/preprocessor/seq/for_each_i\\.hpp\"")
392 "<boost/preprocessor/seq/for_each_i.hpp>")
393 (("FB_BOOST_") "BOOST_"))
394 #t))
395 (add-after 'unpack 'patch-installation
396 (lambda _
397 (substitute*
398 "builds/install/arch-specific/linux/makeInstallImage.sh.in"
399 (("/bin/sh") (which "bash"))
400 ;; Remove shell script helpers from $PATH.
401 (("(addLibs|cp) .*\\.sh .*@FB_SBINDIR@") ":")
402 ;; Put files where Guix users expect them.
403 (("(License\\.txt.*)@FB_CONFDIR" match)
404 (string-append match "@FB_DOCDIR@"))
405 (("@FB_CONFDIR@(.*License\\.txt.*)" match)
406 (string-append "@FB_DOCDIR@" match))
407 (("(cp .*/doc/.*)@FB_CONFDIR@(.*)" _ head tail)
408 (string-append head "@FB_DOCDIR@" tail "\n")))
409 (substitute*
410 (list "builds/install/posix-common/changeServerMode.sh.in"
411 "builds/install/posix-common/install.sh.in")
412 ;; Skip phases that (could) cause problems in Guix.
413 (("check(InstallUser|IfServerRunning|Libraries)|addFirebirdUser")
414 ":")
415 ;; Skip phases that are merely pointless on Guix.
416 (("buildUninstallFile|installInitdScript|startFirebird") ":")
417 ;; Omit randomly generated password with bonus timestamp.
418 (("setDBAPassword") ":"))
419
420 ;; These promote proprietary workflows not relevant on Guix.
421 (for-each delete-file-recursively
422 (find-files "doc" "README\\.(build\\.msvc|NT|Win)"))
423 #t))
424 (add-after 'configure 'delete-init-scripts
425 (lambda _
426 (delete-file-recursively "gen/install/misc")
427 #t))
428 (add-before 'build 'set-build-environment-variables
429 (lambda _
430 ;; ‘isql’ needs to run & find libfbclient.so during the build.
431 ;; This doubles as a rudimentary test in lieu of a test suite.
432 (setenv "LD_LIBRARY_PATH"
433 (string-append (assoc-ref %build-inputs "icu4c") "/lib"))
434 #t))
435 (add-before 'install 'keep-embedded-debug-symbols
436 (lambda _
437 ;; Let the gnu-build-system separate & deal with them later.
438 ;; XXX Upstream would use ‘--strip-unneeded’, shaving a whole
439 ;; megabyte off Guix's 7.7M libEngine12.so, for example.
440 (substitute* "gen/Makefile.install"
441 (("readelf") "false"))
442 #t))
443 (add-after 'install 'prune-undesirable-files
444 (lambda* (#:key outputs #:allow-other-keys)
445 (let ((out (assoc-ref outputs "out")))
446 (with-directory-excursion out
447 ;; Remove example binaries.
448 (for-each delete-file-recursively
449 (find-files "." "example"))
450 ;; Delete (now-)empty directories.
451 (for-each rmdir
452 (list "include/firebird/impl"
453 "lib/firebird/plugins/udr"))
454 #t)))))))
455 (inputs
456 `(("boost" ,boost)
457 ("editline" ,editline)
458 ("icu4c" ,icu4c-67)
459 ("libtommath" ,libtommath)
460 ("ncurses" ,ncurses)
461 ("zlib" ,zlib)))
462 (home-page "https://www.firebirdsql.org")
463 (synopsis "Relational database with many ANSI SQL standard features")
464 (description
465 "Firebird is an SQL @acronym{RDBMS, relational database management system}
466 with rich support for ANSI SQL (e.g., @code{INSERT...RETURNING}) including
467 @acronym{UDFs, user-defined functions} and PSQL stored procedures, cursors, and
468 triggers. Transactions provide full ACID-compliant referential integrity.
469
470 The database requires very little manual maintenance once set up, making it
471 ideal for small business or embedded use.
472
473 When installed as a traditional local or remote (network) database server,
474 Firebird can grow to terabyte scale with proper tuning---although PostgreSQL
475 may be a better choice for such very large environments.
476
477 Firebird can also be embedded into stand-alone applications that don't want or
478 need a full client & server. Used in this manner, it offers richer SQL support
479 than SQLite as well as the option to seamlessly migrate to a client/server
480 database later.")
481 (properties
482 `((lint-hidden-cve . ("CVE-2017-6369"))))
483 (license
484 ;; See doc/license/README.license.usage.txt for rationale & details.
485 (list license:bsd-3 ; src/common/sha2/
486 license:bsd-4 ; src/common/enc.cpp
487 license:gpl2+ ; builds/posix/make.defaults
488 (license:non-copyleft "file:///builds/install/misc/IPLicense.txt"
489 "InterBase Public License v1.0")
490 (license:non-copyleft "file:///builds/install/misc/IDPLicense.txt"
491 "Initial Developer's Public License v1.0")
492 license:lgpl2.1 ; exception for OSI-compatible licences
493 license:mpl1.1 ; examples/interfaces/0{6,8}*.cpp
494 license:public-domain)))) ; including files without explicit licence
495
496 (define-public leveldb
497 (package
498 (name "leveldb")
499 (version "1.22")
500 (source (origin
501 (method git-fetch)
502 (uri (git-reference
503 (url "https://github.com/google/leveldb")
504 (commit version)))
505 (file-name (git-file-name name version))
506 (sha256
507 (base32
508 "0qrnhiyq7r4wa1a4wi82zgns35smj94mcjsc7kfs1k6ia9ys79z7"))))
509 (build-system cmake-build-system)
510 (arguments
511 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON" "-DLEVELDB_BUILD_TESTS=ON")))
512 (inputs
513 `(("snappy" ,snappy)))
514 (home-page "https://github.com/google/leveldb")
515 (synopsis "Fast key-value storage library")
516 (description
517 "LevelDB is a fast key-value storage library that provides an ordered
518 mapping from string keys to string values.")
519 (license license:bsd-3)))
520
521 (define-public memcached
522 (package
523 (name "memcached")
524 (version "1.6.9")
525 (source
526 (origin
527 (method url-fetch)
528 (uri (string-append
529 "https://memcached.org/files/memcached-" version ".tar.gz"))
530 (sha256
531 (base32 "1lcjy1b9krnb2gk72qd1fvivlfiyfvknfi3wngyvyk9ifzijr9nm"))))
532 (build-system gnu-build-system)
533 (inputs
534 `(("libevent" ,libevent)
535 ("cyrus-sasl" ,cyrus-sasl)))
536 (home-page "https://memcached.org/")
537 (synopsis "In-memory caching service")
538 (description "Memcached is an in-memory key-value store. It has a small
539 and generic API, and was originally intended for use with dynamic web
540 applications.")
541 (license license:bsd-3)))
542
543 (define-public libmemcached
544 (package
545 (name "libmemcached")
546 (version "1.0.18")
547 ;; We build from the sources since we want to build the extra HTML
548 ;; documentation which is not included with the release.
549 (source (origin
550 (method bzr-fetch)
551 (uri (bzr-reference
552 (url "lp:libmemcached/1.0")
553 (revision (string-append "tag:" version))))
554 (file-name (string-append name "-" version "-checkout"))
555 (sha256
556 (base32
557 "1842s4dxdh21gdr46q4dgxigidcs6dkqnbnqjwb9l8r0bqx5nb10"))
558 (patches
559 (search-patches "libmemcached-build-with-gcc7.patch"))))
560 (build-system gnu-build-system)
561 (native-inputs
562 `(("memcached" ,memcached)
563 ("libtool" ,libtool)
564 ("autoconf" ,autoconf)
565 ("automake" ,automake)
566 ("bison" ,bison)
567 ("flex" ,flex)
568 ("perl" ,perl)
569 ("python-sphinx" ,python-sphinx))) ;to build the HTML doc.
570 (inputs
571 `(("libevent" ,libevent)
572 ("cyrus-sasl" ,cyrus-sasl)))
573 (outputs '("out" "doc"))
574 (arguments
575 '(#:phases
576 (modify-phases %standard-phases
577 (add-before 'bootstrap 'fix-configure.ac
578 ;; Move the AC_CONFIG_AUX_DIR macro use under AC_INIT, otherwise we
579 ;; get the error ``configure: error: cannot find install-sh,
580 ;; install.sh, or shtool in "." "./.." "./../.."`` (see:
581 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19539 and
582 ;; https://bugs.launchpad.net/libmemcached/+bug/1803922).
583 (lambda _
584 (delete-file "bootstrap.sh") ;not useful in the context of Guix
585 (substitute* "configure.ac"
586 (("^AC_CONFIG_AUX_DIR\\(\\[build-aux\\]\\).*") "")
587 (("(^AC_INIT.*)" anchor)
588 (string-append anchor "AC_CONFIG_AUX_DIR([build-aux])\n")))
589 #t))
590 (add-before 'bootstrap 'disable-failing-tests
591 ;; See: https://bugs.launchpad.net/libmemcached/+bug/1803926
592 (lambda _
593 ;; Mark some heavily failing test suites as expected to fail.
594 (substitute* "Makefile.am"
595 (("(XFAIL_TESTS =[^\n]*)" xfail_tests)
596 (string-append xfail_tests " tests/testudp"
597 " tests/libmemcached-1.0/testapp"
598 " tests/libmemcached-1.0/testsocket")))
599 ;; Disable two tests of the unittest test suite.
600 (substitute* "libtest/unittest.cc"
601 ((".*echo_fubar_BINARY \\},.*") "")
602 ((".*application_doesnotexist_BINARY \\},.*") ""))
603 #t))
604 (add-after 'disable-dns-tests 'build-and-install-html-doc
605 (lambda* (#:key outputs #:allow-other-keys)
606 (let ((html (string-append (assoc-ref outputs "doc")
607 "/share/doc/libmemcached/html/")))
608 (invoke "make" "install-html")
609 ;; Cleanup useless files.
610 (for-each delete-file-recursively
611 (map (lambda (x) (string-append html x))
612 '("_sources" ".doctrees" ".buildinfo"))))
613 #t)))))
614 (home-page "https://libmemcached.org/")
615 (synopsis "C++ library for memcached")
616 (description "libMemcached is a library to use memcached in C/C++
617 applications. It comes with a complete reference guide and documentation of
618 the API, and provides features such as:
619 @itemize
620 @item Asynchronous and synchronous transport support
621 @item Consistent hashing and distribution
622 @item Tunable hashing algorithm to match keys
623 @item Access to large object support
624 @item Local replication
625 @end itemize")
626 (license license:bsd-3)))
627
628 (define-public python-pylibmc
629 (package
630 (name "python-pylibmc")
631 (version "1.6.1")
632 (source
633 (origin
634 (method url-fetch)
635 (uri (pypi-uri "pylibmc" version))
636 (sha256
637 (base32 "1sg7d9j0v6g3xg3finf4l1hb72c13vcyyi6rqrc9shbx903d93ca"))))
638 (build-system python-build-system)
639 (arguments
640 '(#:phases
641 (modify-phases %standard-phases
642 (add-before 'check 'start-memcached-daemon
643 ;; The test suite requires a memcached server.
644 (lambda _
645 (invoke "memcached" "-d"))))))
646 (native-inputs
647 `(("memcached" ,memcached)
648 ("python-nose" ,python-nose)))
649 (inputs
650 `(("libmemcached" ,libmemcached)
651 ("zlib" ,zlib)
652 ("cyrus-sasl" ,cyrus-sasl)))
653 (home-page "http://sendapatch.se/projects/pylibmc/")
654 (synopsis "Python client for memcached")
655 (description
656 "@code{pylibmc} is a client in Python for memcached. It is a wrapper
657 around TangentOrg’s libmemcached library, and can be used as a drop-in
658 replacement for the code@{python-memcached} library.")
659 (license license:bsd-3)))
660
661 (define-public python2-pylibmc
662 (package-with-python2 python-pylibmc))
663
664 (define-public mongodb
665 (package
666 (name "mongodb")
667 (version "3.4.24")
668 (source (origin
669 (method url-fetch)
670 (uri (string-append "https://github.com/mongodb/mongo/archive/r"
671 version ".tar.gz"))
672 (file-name (string-append name "-" version ".tar.gz"))
673 (sha256
674 (base32 "0y1669sqj8wyf0y0njhxs4qhn1qzjhrs2h2qllya5samxrlrjhkg"))
675 (modules '((guix build utils)))
676 (snippet
677 '(begin
678 (for-each (lambda (dir)
679 (delete-file-recursively
680 (string-append "src/third_party/" dir)))
681 '("pcre-8.42" "scons-2.5.0" "snappy-1.1.3"
682 "valgrind-3.11.0" "wiredtiger"
683 "yaml-cpp-0.6.2" "zlib-1.2.11"))
684 #t))))
685 (build-system scons-build-system)
686 (inputs
687 `(("openssl" ,openssl-1.0)
688 ("pcre" ,pcre)
689 ,@(match (%current-system)
690 ((or "x86_64-linux" "aarch64-linux" "mips64el-linux")
691 `(("wiredtiger" ,wiredtiger)))
692 (_ `()))
693 ("yaml-cpp" ,yaml-cpp)
694 ("zlib" ,zlib)
695 ("snappy" ,snappy)))
696 (native-inputs
697 `(("valgrind" ,valgrind)
698 ("perl" ,perl)
699 ("python" ,python-2)
700 ("python2-pymongo" ,python2-pymongo)
701 ("python2-pyyaml" ,python2-pyyaml)
702 ("tzdata" ,tzdata-for-tests)))
703 (arguments
704 `(#:scons ,scons-python2
705 #:phases
706 (let ((common-options
707 `(;; "--use-system-tcmalloc" TODO: Missing gperftools
708 "--use-system-pcre"
709 ;; wiredtiger is 64-bit only
710 ,,(if (any (cute string-prefix? <> (or (%current-target-system)
711 (%current-system)))
712 '("i686-linux" "armhf-linux"))
713 ``"--wiredtiger=off"
714 ``"--use-system-wiredtiger")
715 ;; TODO
716 ;; build/opt/mongo/db/fts/unicode/string.o failed: Error 1
717 ;; --use-system-boost
718 "--use-system-snappy"
719 "--use-system-zlib"
720 "--use-system-valgrind"
721 ;; "--use-system-stemmer" TODO: Missing relevant package
722 "--use-system-yaml"
723 "--disable-warnings-as-errors"
724 ,(format #f "--jobs=~a" (parallel-job-count))
725 "--ssl")))
726 (modify-phases %standard-phases
727 (add-after 'unpack 'patch
728 (lambda _
729 ;; Remove use of GNU extensions in parse_number_test.cpp, to
730 ;; allow compiling with GCC 7 or later
731 ;; https://jira.mongodb.org/browse/SERVER-28063
732 (substitute* "src/mongo/base/parse_number_test.cpp"
733 (("0xabcab\\.defdefP-10")
734 "687.16784283419838"))
735 #t))
736 (add-after 'unpack 'scons-propagate-environment
737 (lambda _
738 ;; Modify the SConstruct file to arrange for
739 ;; environment variables to be propagated.
740 (substitute* "SConstruct"
741 (("^env = Environment\\(")
742 "env = Environment(ENV=os.environ, "))
743 #t))
744 (add-after 'unpack 'create-version-file
745 (lambda _
746 (call-with-output-file "version.json"
747 (lambda (port)
748 (display ,(simple-format #f "{
749 \"version\": \"~A\"
750 }" version) port)))
751 #t))
752 (replace 'build
753 (lambda _
754 (apply invoke `("scons"
755 ,@common-options
756 "mongod" "mongo" "mongos"))))
757 (replace 'check
758 (lambda* (#:key tests? inputs #:allow-other-keys)
759 (setenv "TZDIR"
760 (string-append (assoc-ref inputs "tzdata")
761 "/share/zoneinfo"))
762 (when tests?
763 ;; Note that with the tests, especially the unittests, the
764 ;; build can take up to ~45GB of space, as many tests are
765 ;; individual executable files, with some being hundreds of
766 ;; megabytes in size.
767 (apply invoke `("scons" ,@common-options "dbtest" "unittests"))
768 (substitute* "build/unittests.txt"
769 ;; TODO: Don't run the async_stream_test, as it hangs
770 (("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
771 "")
772 ;; TODO: This test fails
773 ;; Expected 0UL != disks.size() (0 != 0) @src/mongo/util/procparser_test.cpp:476
774 (("^build\\/opt\\/mongo\\/util\\/procparser\\_test\n$")
775 ""))
776 (invoke "python" "buildscripts/resmoke.py"
777 "--suites=dbtest,unittests"
778 (format #f "--jobs=~a" (parallel-job-count))))
779 #t))
780 (replace 'install
781 (lambda* (#:key outputs #:allow-other-keys)
782 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
783 (install-file "mongod" bin)
784 (install-file "mongos" bin)
785 (install-file "mongo" bin))
786 #t))))))
787 (home-page "https://www.mongodb.org/")
788 (synopsis "High performance and high availability document database")
789 (description
790 "Mongo is a high-performance, high availability, schema-free
791 document-oriented database. A key goal of MongoDB is to bridge the gap
792 between key/value stores (which are fast and highly scalable) and traditional
793 RDBMS systems (which are deep in functionality).")
794 (license (list license:agpl3
795 ;; Some parts are licensed under the Apache License
796 license:asl2.0))))
797
798 (define-public mycli
799 (package
800 (name "mycli")
801 (version "1.22.2")
802 (source
803 (origin
804 (method url-fetch)
805 (uri (pypi-uri "mycli" version))
806 (sha256
807 (base32 "1lq2x95553vdmhw13cxcgsd2g2i32izhsb7hxd4m1iwf9b3msbpv"))))
808 (build-system python-build-system)
809 (arguments
810 `(#:tests? #f)) ; tests expect a running MySQL
811 (propagated-inputs
812 `(("python-cli-helpers" ,python-cli-helpers)
813 ("python-click" ,python-click)
814 ("python-configobj" ,python-configobj)
815 ("python-cryptography" ,python-cryptography)
816 ("python-prompt-toolkit" ,python-prompt-toolkit)
817 ("python-pygments" ,python-pygments)
818 ("python-pymysql" ,python-pymysql)
819 ("python-sqlparse" ,python-sqlparse)))
820 (home-page "http://mycli.net")
821 (synopsis
822 "Terminal Client for MySQL with AutoCompletion and Syntax Highlighting")
823 (description
824 "MyCLI is a command line interface for MySQL, MariaDB, and Percona with
825 auto-completion and syntax highlighting.")
826 (license license:bsd-3)))
827
828 ;; XXX When updating, check whether boost-for-mysql is still needed.
829 ;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
830 (define-public mysql
831 (package
832 (name "mysql")
833 (version "5.7.33")
834 (source (origin
835 (method url-fetch)
836 (uri (list (string-append
837 "https://dev.mysql.com/get/Downloads/MySQL-"
838 (version-major+minor version) "/"
839 name "-" version ".tar.gz")
840 (string-append
841 "https://downloads.mysql.com/archives/get/file/"
842 name "-" version ".tar.gz")))
843 (sha256
844 (base32
845 "1bb343mf7n0qg2qz497gxjsqprygrjz1q1pbz76hgqxnsy08sfxd"))))
846 (build-system cmake-build-system)
847 (arguments
848 `(#:configure-flags
849 '("-DBUILD_CONFIG=mysql_release"
850 "-DWITH_SSL=system"
851 "-DWITH_ZLIB=system"
852 "-DDEFAULT_CHARSET=utf8"
853 "-DDEFAULT_COLLATION=utf8_general_ci"
854 "-DMYSQL_DATADIR=/var/lib/mysql"
855 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
856 "-DINSTALL_INFODIR=share/mysql/docs"
857 "-DINSTALL_MANDIR=share/man"
858 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
859 "-DINSTALL_SCRIPTDIR=bin"
860 "-DINSTALL_INCLUDEDIR=include/mysql"
861 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
862 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
863 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
864 "-DINSTALL_DOCDIR=share/mysql/docs"
865 "-DINSTALL_SHAREDIR=share/mysql"
866 ;; Get rid of test data.
867 "-DINSTALL_MYSQLTESTDIR="
868 "-DINSTALL_SQLBENCHDIR=")
869 #:phases (modify-phases %standard-phases
870 (add-after
871 'install 'remove-extra-binaries
872 (lambda* (#:key outputs #:allow-other-keys)
873 (let ((out (assoc-ref outputs "out")))
874 ;; Remove the 3 *_embedded files, which weigh in at
875 ;; 14 MiB each.
876 (for-each delete-file
877 (find-files (string-append out "/bin")
878 "_embedded$"))
879 #t))))))
880 (native-inputs
881 `(("bison" ,bison)
882 ("perl" ,perl)
883 ("pkg-config" ,pkg-config)))
884 (inputs
885 `(("boost" ,boost-for-mysql)
886 ("libaio" ,libaio)
887 ("libtirpc" ,libtirpc)
888 ("ncurses" ,ncurses)
889 ("openssl" ,openssl)
890 ("rpcsvc-proto" ,rpcsvc-proto) ; rpcgen
891 ("zlib" ,zlib)))
892 (home-page "https://www.mysql.com/")
893 (synopsis "Fast, easy to use, and popular database")
894 (description
895 "MySQL is a fast, reliable, and easy to use relational database
896 management system that supports the standardized Structured Query
897 Language.")
898 (license license:gpl2)))
899
900 (define-public mariadb
901 (package
902 (name "mariadb")
903 (version "10.5.8")
904 (source (origin
905 (method url-fetch)
906 (uri (string-append "https://downloads.mariadb.com/MariaDB"
907 "/mariadb-" version "/source/mariadb-"
908 version ".tar.gz"))
909 (sha256
910 (base32
911 "1s3vfm73911cddjhgpcbkya6nz7ag2zygg56qqzwscn5ybv28j7b"))
912 (modules '((guix build utils)))
913 (snippet
914 '(begin
915 ;; Delete bundled snappy and xz.
916 (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
917 (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
918 ;; This file checks that the bundled sources are present and
919 ;; declares build procedures for them.
920 (("^include\\(TokuThirdParty\\)") ""))
921 (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
922 ;; Don't attempt to use the procedures we just removed.
923 ((" build_lzma build_snappy") ""))
924
925 ;; Preserve CMakeLists.txt for these.
926 (for-each (lambda (file)
927 (unless (string-suffix? "CMakeLists.txt" file)
928 (delete-file file)))
929 (append (find-files "extra/wolfssl")
930 (find-files "zlib")))
931 #t))))
932 (build-system cmake-build-system)
933 (outputs '("out" "lib" "dev"))
934 (arguments
935 `(#:configure-flags
936 (list
937 "-DBUILD_CONFIG=mysql_release"
938 ;; Linking with libarchive fails, like this:
939
940 ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
941 ;; relocation R_X86_64_32 against `.bss' can not be used when
942 ;; making a shared object; recompile with -fPIC
943
944 ;; For now, disable the features that that use libarchive (xtrabackup).
945 "-DWITH_LIBARCHIVE=OFF"
946
947 ;; Disable the TokuDB engine, because its test suite frequently fails,
948 ;; and loading it crashes the server: <https://bugs.gnu.org/35521>.
949 "-DTOKUDB_OK=OFF"
950
951 ;; Ensure the system libraries are used.
952 "-DWITH_JEMALLOC=yes"
953 "-DWITH_PCRE=system"
954 "-DWITH_SSL=system"
955 "-DWITH_ZLIB=system"
956
957 "-DDEFAULT_CHARSET=utf8"
958 "-DDEFAULT_COLLATION=utf8_general_ci"
959 "-DMYSQL_DATADIR=/var/lib/mysql"
960 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
961
962 ;; Do not install the benchmark suite.
963 "-DINSTALL_SQLBENCHDIR=false"
964
965 (string-append "-DCMAKE_INSTALL_PREFIX=" (assoc-ref %outputs "lib"))
966 (string-append "-DCMAKE_INSTALL_RPATH=" (assoc-ref %outputs "lib")
967 "/lib")
968 (string-append "-DINSTALL_INFODIR=" (assoc-ref %outputs "out")
969 "/share/mysql/docs")
970 (string-append "-DINSTALL_MANDIR=" (assoc-ref %outputs "out")
971 "/share/man")
972 (string-append "-DINSTALL_SCRIPTDIR=" (assoc-ref %outputs "out") "/bin")
973 (string-append "-DINSTALL_BINDIR=" (assoc-ref %outputs "out") "/bin")
974 "-DCMAKE_INSTALL_LIBDIR=lib"
975 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
976 (string-append "-DINSTALL_INCLUDEDIR=" (assoc-ref %outputs "dev")
977 "/include/mysql")
978 (string-append "-DINSTALL_DOCREADMEDIR=" (assoc-ref %outputs "out")
979 "/share/mysql/docs")
980 (string-append "-DINSTALL_DOCDIR=" (assoc-ref %outputs "out")
981 "/share/mysql/docs")
982 (string-append "-DINSTALL_SUPPORTFILESDIR=" (assoc-ref %outputs "out")
983 "/share/mysql/support-files")
984 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
985 "-DINSTALL_SHAREDIR=share")
986 #:phases
987 (modify-phases %standard-phases
988 (add-after 'unpack 'adjust-output-references
989 (lambda _
990 ;; The build system invariably prepends $CMAKE_INSTALL_PREFIX
991 ;; to other variables such as $INSTALL_INCLUDEDIR, which does
992 ;; not work when the latter uses an absolute file name.
993 (substitute* "libmariadb/mariadb_config/mariadb_config.c.in"
994 (("%s/@INSTALL_INCLUDEDIR@")
995 (string-append "@INSTALL_INCLUDEDIR@"))
996 ;; As of 10.5.8, the mariadb_config program tries to be
997 ;; clever and computes the installation directory relative
998 ;; to /proc/self/exe when running on Linux. Make it fall
999 ;; back to the old behaviour.
1000 (("defined\\(__linux__\\)")
1001 "0"))
1002 (substitute* "libmariadb/mariadb_config/libmariadb.pc.in"
1003 (("\\$\\{prefix\\}/@INSTALL_INCLUDEDIR@")
1004 "@INSTALL_INCLUDEDIR@"))
1005 (substitute* "support-files/mariadb.pc.in"
1006 (("^(include|bin|script|doc|man)dir=\\$\\{prefix\\}/" _ dir)
1007 (string-append dir "dir=")))
1008 (substitute* "include/CMakeLists.txt"
1009 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_INCLUDEDIR\\}")
1010 "${INSTALL_INCLUDEDIR}"))
1011 (substitute* "cmake/mariadb_connector_c.cmake"
1012 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_BINDIR\\}")
1013 "${INSTALL_BINDIR}"))
1014 #t))
1015 (add-after 'unpack 'adjust-tests
1016 (lambda _
1017 (let ((disabled-tests
1018 '(;; These fail because root@hostname == root@localhost in
1019 ;; the build environment, causing a user count mismatch.
1020 ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
1021 "funcs_1.is_columns_mysql"
1022 "main.join_cache"
1023 "main.explain_non_select"
1024 "main.stat_tables"
1025 "main.stat_tables_innodb"
1026 "main.upgrade_MDEV-19650"
1027 "roles.acl_statistics"
1028
1029 ;; FIXME: This test checks various table encodings and
1030 ;; fails because Guix defaults to UTF8 instead of the
1031 ;; upstream default latin1_swedish_ci. It's not easily
1032 ;; substitutable because several encodings are tested.
1033 "main.sp2"
1034
1035 ;; XXX: This test occasionally fails on i686-linux:
1036 ;; <https://jira.mariadb.org/browse/MDEV-24458>
1037 ,@(if (string-prefix? "i686" (%current-system))
1038 '("main.myisampack")
1039 '())
1040
1041 ;; This file contains a time bomb which makes it fail after
1042 ;; 2030-12-31. See <https://bugs.gnu.org/34351> for details.
1043 "main.mysqldump"))
1044
1045 ;; This file contains a list of known-flaky tests for this
1046 ;; release. Append our own items.
1047 (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
1048 (for-each (lambda (test)
1049 (format unstable-tests "~a : ~a\n"
1050 test "Disabled in Guix"))
1051 disabled-tests)
1052 (close-port unstable-tests)
1053
1054 ;; XXX: These fail because they expect a latin1 charset and
1055 ;; collation. See <https://jira.mariadb.org/browse/MDEV-21264>.
1056 (substitute* '("mysql-test/main/gis_notembedded.result"
1057 "mysql-test/main/system_mysql_db.result")
1058 (("latin1_swedish_ci") "utf8_general_ci")
1059 (("\tlatin1") "\tutf8"))
1060
1061 (substitute* "mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test"
1062 (("/bin/bash")
1063 (which "bash")))
1064
1065 (substitute* "mysql-test/mysql-test-run.pl"
1066 (("/bin/ls") (which "ls"))
1067 (("/bin/sh") (which "sh")))
1068 #t)))
1069 (add-before 'configure 'disable-plugins
1070 (lambda _
1071 (let ((disable-plugin (lambda (name)
1072 (call-with-output-file
1073 (string-append "plugin/" name
1074 "/CMakeLists.txt")
1075 (lambda (port)
1076 (format port "\n")))))
1077 (disabled-plugins '(;; XXX: Causes a test failure.
1078 "disks")))
1079 (for-each disable-plugin disabled-plugins)
1080 #t)))
1081 (replace 'check
1082 (lambda* (#:key (tests? #t) #:allow-other-keys)
1083 (if tests?
1084 (with-directory-excursion "mysql-test"
1085 (invoke "./mtr" "--verbose"
1086 "--retry=3"
1087 "--testcase-timeout=40"
1088 "--suite-timeout=600"
1089 "--parallel" (number->string (parallel-job-count))
1090 ;; Skip the replication tests: they are very I/O
1091 ;; intensive and frequently causes indeterministic
1092 ;; failures even on powerful hardware.
1093 "--skip-rpl"
1094 "--skip-test-list=unstable-tests"))
1095 (format #t "test suite not run~%"))
1096 #t))
1097 (add-after
1098 'install 'post-install
1099 (lambda* (#:key inputs outputs #:allow-other-keys)
1100 (let* ((out (assoc-ref outputs "out"))
1101 (dev (assoc-ref outputs "dev"))
1102 (lib (assoc-ref outputs "lib"))
1103 (openssl (assoc-ref inputs "openssl")))
1104 (substitute* (list (string-append out "/bin/mariadb-install-db")
1105 (string-append out "/bin/mysql_install_db"))
1106 (("basedir=\"\"")
1107 (string-append "basedir=\"" out "\""))
1108 (("\\$basedir/share/mysql")
1109 (string-append lib "/share/mysql")))
1110
1111 (with-directory-excursion lib
1112 ;; Remove tests.
1113 (delete-file-recursively "mysql-test")
1114 ;; Remove static libraries.
1115 (for-each delete-file (find-files "lib" "\\.a$")))
1116
1117 (with-directory-excursion out
1118 (delete-file "share/man/man1/mysql-test-run.pl.1")
1119 ;; Delete huge and unnecessary executables.
1120 (for-each delete-file (find-files "bin" "test$")))
1121 (mkdir-p (string-append dev "/share"))
1122 (mkdir-p (string-append dev "/bin"))
1123 (rename-file (string-append lib "/bin/mariadbd")
1124 (string-append out "/bin/mariadbd"))
1125 (rename-file (string-append lib "/bin/mysqld")
1126 (string-append out "/bin/mysqld"))
1127 (mkdir-p (string-append dev "/lib"))
1128 (rename-file (string-append lib "/lib/pkgconfig")
1129 (string-append dev "/lib/pkgconfig"))
1130 (rename-file (string-append lib "/bin/mariadb_config")
1131 (string-append dev "/bin/mariadb_config"))
1132 (rename-file (string-append out "/bin/mysql_config")
1133 (string-append dev "/bin/mysql_config"))
1134
1135 ;; Embed an absolute reference to OpenSSL in mysql_config
1136 ;; and the pkg-config file to avoid propagation.
1137 ;; XXX: how to do this for mariadb_config.c.in?
1138 (substitute* (list (string-append dev "/bin/mysql_config")
1139 (string-append dev "/lib/pkgconfig/mariadb.pc"))
1140 (("-lssl -lcrypto" all)
1141 (string-append "-L" openssl "/lib " all)))
1142
1143 #t))))))
1144 (native-inputs
1145 `(("bison" ,bison)
1146 ("perl" ,perl)))
1147 (inputs
1148 `(("jemalloc" ,jemalloc)
1149 ("libaio" ,libaio)
1150 ("libxml2" ,libxml2)
1151 ("ncurses" ,ncurses)
1152 ("openssl" ,openssl)
1153 ("pam" ,linux-pam)
1154 ("pcre2" ,pcre2)
1155 ("xz" ,xz)
1156 ("zlib" ,zlib)))
1157 ;; The test suite is very resource intensive and can take more than three
1158 ;; hours on a x86_64 system. Give slow and busy machines some leeway.
1159 (properties '((timeout . 64800))) ;18 hours
1160 (home-page "https://mariadb.org/")
1161 (synopsis "SQL database server")
1162 (description
1163 "MariaDB is a multi-user and multi-threaded SQL database server, designed
1164 as a drop-in replacement of MySQL.")
1165 (license license:gpl2)))
1166
1167 (define-public mariadb-connector-c
1168 (package
1169 (name "mariadb-connector-c")
1170 (version "3.1.12")
1171 (source
1172 (origin
1173 (method url-fetch)
1174 (uri (string-append
1175 "https://downloads.mariadb.org/f/connector-c-" version
1176 "/mariadb-connector-c-" version "-src.tar.gz"
1177 "/from/https%3A//mirrors.ukfast.co.uk/sites/mariadb/?serve"))
1178 (file-name (string-append name "-" version ".tar.gz"))
1179 (sha256
1180 (base32 "0qzyahr8x9l1xz0l79wz3iahxz7648n1azc5yr7kx0dl113y2nig"))))
1181 (inputs
1182 `(("openssl" ,openssl)))
1183 (build-system cmake-build-system)
1184 (arguments
1185 '(#:tests? #f)) ; no tests
1186 (home-page "https://mariadb.com/kb/en/mariadb-connector-c/")
1187 (synopsis "Client library to connect to MySQL or MariaDB")
1188 (description "The MariaDB Connector/C is used to connect applications
1189 developed in C/C++ to MariaDB and MySQL databases.")
1190 (license license:lgpl2.1+)))
1191
1192 ;; Don't forget to update the other postgresql packages when upgrading this one.
1193 (define-public postgresql-13
1194 (package
1195 (name "postgresql")
1196 (replacement postgresql-13.2)
1197 (version "13.1")
1198 (source (origin
1199 (method url-fetch)
1200 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1201 version "/postgresql-" version ".tar.bz2"))
1202 (sha256
1203 (base32
1204 "07z6zwr58dckaa97yl9ml240z83d1lhgaxw9aq49i8lsp21mqd0j"))
1205 (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))
1206 (build-system gnu-build-system)
1207 (arguments
1208 `(#:configure-flags '("--with-uuid=e2fs" "--with-openssl"
1209 ;; PostgreSQL installs its own Makefile (should it?).
1210 ;; Prevent it from retaining needless references to
1211 ;; the build tools in order to save size.
1212 "MKDIR_P=mkdir -p" "INSTALL_BIN=install -c"
1213 "LD=ld" "TAR=tar")
1214 #:phases
1215 (modify-phases %standard-phases
1216 (add-before 'configure 'patch-/bin/sh
1217 (lambda _
1218 ;; Refer to the actual shell.
1219 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
1220 "src/bin/psql/command.c")
1221 (("/bin/sh") (which "sh")))
1222 #t))
1223 (add-after 'build 'build-contrib
1224 (lambda _
1225 (invoke "make" "-C" "contrib")))
1226 (add-after 'install 'install-contrib
1227 (lambda _
1228 (invoke "make" "-C" "contrib" "install"))))))
1229 (inputs
1230 `(("readline" ,readline)
1231 ("libuuid" ,util-linux "lib")
1232 ("openssl" ,openssl)
1233 ("zlib" ,zlib)))
1234 (home-page "https://www.postgresql.org/")
1235 (synopsis "Powerful object-relational database system")
1236 (description
1237 "PostgreSQL is a powerful object-relational database system. It is fully
1238 ACID compliant, has full support for foreign keys, joins, views, triggers, and
1239 stored procedures (in multiple languages). It includes most SQL:2008 data
1240 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
1241 TIMESTAMP. It also supports storage of binary large objects, including
1242 pictures, sounds, or video.")
1243 (license (license:x11-style "file://COPYRIGHT"))))
1244
1245 (define-public postgresql-13.2
1246 (package
1247 (inherit postgresql-13)
1248 (name "postgresql")
1249 (version "13.2")
1250 (source (origin
1251 (method url-fetch)
1252 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1253 version "/postgresql-" version ".tar.bz2"))
1254 (sha256
1255 (base32
1256 "1z5d847jnajcfr3wa6jn52a8xjhamvwzmz18xlm5nvxqip8grmsz"))
1257 (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))))
1258
1259 (define-public postgresql-11
1260 (package
1261 (inherit postgresql-13)
1262 (name "postgresql")
1263 (version "11.11")
1264 (source (origin
1265 (inherit (package-source postgresql-13))
1266 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1267 version "/postgresql-" version ".tar.bz2"))
1268 (sha256
1269 (base32
1270 "0v0qk298nxmpzpgsxcsxma328hdkyzd7fwjs0zsn6zavl5zpnq20"))))))
1271
1272 (define-public postgresql-10
1273 (package
1274 (inherit postgresql-11)
1275 (version "10.16")
1276 (source (origin
1277 (inherit (package-source postgresql-11))
1278 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1279 version "/postgresql-" version ".tar.bz2"))
1280 (sha256
1281 (base32
1282 "1cvv8qw0gkkczqhiwx6ns7w88dwkvdz4cvb2d4ff14363f5p2p53"))))))
1283
1284 (define-public postgresql-9.6
1285 (package
1286 (inherit postgresql-10)
1287 (version "9.6.21")
1288 (source (origin
1289 (inherit (package-source postgresql-10))
1290 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1291 version "/postgresql-" version ".tar.bz2"))
1292 (sha256
1293 (base32
1294 "0d0ngpadf1i7c0i2psaxcbmiwx8334ibcsn283n9fp4853pyl3wk"))))))
1295
1296 (define-public postgresql postgresql-13)
1297
1298 (define-public pgloader
1299 (package
1300 (name "pgloader")
1301 (version "3.6.2")
1302 (source
1303 (origin
1304 (method git-fetch)
1305 (uri (git-reference
1306 (url "https://github.com/dimitri/pgloader")
1307 (commit (string-append "v" version))))
1308 (sha256
1309 (base32 "06i1jd2za3ih5caj2b4vzlzags5j65vv8dfdbz0ggdrp40wfd5lh"))
1310 (file-name (git-file-name name version))))
1311 (build-system gnu-build-system)
1312 (arguments
1313 ;; NOTE: (Sharlatan-20210119T211511+0000) Tests are disabled due to being
1314 ;; dependent on Quicklisp, main build target is `pgloader-standalone' which
1315 ;; does not require Quicklisp workarounds. There is no `install' target
1316 ;; configured in Makefile.
1317 `(#:tests? #f
1318 #:strip-binaries? #f
1319 #:make-flags
1320 (list "pgloader-standalone" "BUILDAPP_SBCL=buildapp")
1321 #:phases
1322 (modify-phases %standard-phases
1323 (delete 'configure)
1324 (add-after 'unpack 'set-home
1325 (lambda _
1326 (setenv "HOME" "/tmp")
1327 #t))
1328 (add-after 'unpack 'patch-Makefile
1329 (lambda _
1330 (substitute* "Makefile"
1331 (("--sbcl.*") "--sbcl $(CL) --asdf-path . \\\n"))
1332 #t))
1333 (replace 'install
1334 (lambda* (#:key outputs #:allow-other-keys)
1335 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
1336 (mkdir-p bin)
1337 (install-file "build/bin/pgloader" bin))
1338 #t)))))
1339 (native-inputs
1340 `(("buildapp" ,buildapp)
1341 ("sbcl" ,sbcl)))
1342 (inputs
1343 `(("alexandria" ,sbcl-alexandria)
1344 ("cl-abnf" ,sbcl-cl-abnf)
1345 ("cl-base64" ,sbcl-cl-base64)
1346 ("cl-csv" ,sbcl-cl-csv)
1347 ("cl-fad" ,sbcl-cl-fad)
1348 ("cl-log" ,sbcl-cl-log)
1349 ("cl-markdown" ,sbcl-cl-markdown)
1350 ("cl-mustache" ,sbcl-cl-mustache)
1351 ("cl-ppcre" ,sbcl-cl-ppcre)
1352 ("cl-sqlite" ,sbcl-cl-sqlite)
1353 ("closer-mop" ,sbcl-closer-mop)
1354 ("command-line-arguments" ,sbcl-command-line-arguments)
1355 ("db3" ,sbcl-db3)
1356 ("drakma" ,sbcl-drakma)
1357 ("esrap" ,sbcl-esrap)
1358 ("flexi-streams" ,sbcl-flexi-streams)
1359 ("ixf" ,sbcl-ixf)
1360 ("local-time" ,sbcl-local-time)
1361 ("lparallel" ,sbcl-lparallel)
1362 ("metabang-bind" ,sbcl-metabang-bind)
1363 ("mssql" ,sbcl-mssql)
1364 ("postmodern" ,sbcl-postmodern)
1365 ("py-configparser" ,sbcl-py-configparser)
1366 ("qmynd" ,sbcl-qmynd)
1367 ("quri" ,sbcl-quri)
1368 ("split-sequence" ,sbcl-split-sequence)
1369 ("trivial-backtrace" ,sbcl-trivial-backtrace)
1370 ("usocket" ,sbcl-usocket)
1371 ("uuid" ,sbcl-uuid)
1372 ("yason" ,sbcl-yason)
1373 ("zs3" ,sbcl-zs3)))
1374 (home-page "https://pgloader.io/")
1375 (synopsis "Tool to migrate data to PostgreSQL")
1376 (description
1377 "@code{pgloader} is a program that can load data or migrate databases from
1378 CSV, DB3, iXF, SQLite, MS-SQL or MySQL to PostgreSQL.")
1379 (license (license:x11-style "file://LICENSE"))))
1380
1381 (define-public python-pymysql
1382 (package
1383 (name "python-pymysql")
1384 (version "0.9.3")
1385 (source
1386 (origin
1387 (method url-fetch)
1388 (uri (pypi-uri "PyMySQL" version))
1389 (sha256
1390 (base32 "1ry8lxgdc1p3k7gbw20r405jqi5lvhi5wk83kxdbiv8xv3f5kh6q"))))
1391 (build-system python-build-system)
1392 (native-inputs
1393 `(("python-unittest2" ,python-unittest2)))
1394 (inputs
1395 `(("python-cryptography" ,python-cryptography)))
1396 (arguments
1397 `(#:tests? #f)) ; tests expect a running MySQL
1398 (home-page "https://github.com/PyMySQL/PyMySQL/")
1399 (synopsis "Pure-Python MySQL driver")
1400 (description
1401 "PyMySQL is a pure-Python MySQL client library, based on PEP 249.
1402 Most public APIs are compatible with @command{mysqlclient} and MySQLdb.")
1403 (license license:expat)))
1404
1405 (define-public python2-pymysql
1406 (package-with-python2 python-pymysql))
1407
1408 (define-public qdbm
1409 (package
1410 (name "qdbm")
1411 (version "1.8.78")
1412 (source
1413 (origin
1414 (method url-fetch)
1415 (uri (string-append "http://fallabs.com/" name "/"
1416 name "-" version ".tar.gz"))
1417 (sha256
1418 (base32
1419 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
1420 (build-system gnu-build-system)
1421 (arguments
1422 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1423 (assoc-ref %outputs "out")
1424 "/lib"))
1425 #:make-flags (list "CFLAGS=-fPIC")))
1426 (home-page "https://fallabs.com/qdbm/")
1427 (synopsis "Key-value database")
1428 (description "QDBM is a library of routines for managing a
1429 database. The database is a simple data file containing key-value
1430 pairs. Every key and value is serial bytes with variable length.
1431 Binary data as well as character strings can be used as a key or a
1432 value. There is no concept of data tables or data types. Records are
1433 organized in a hash table or B+ tree.")
1434 (license license:lgpl2.1+)))
1435
1436 (define-public recutils
1437 (package
1438 (name "recutils")
1439 (version "1.8")
1440 (source (origin
1441 (method url-fetch)
1442 (uri (string-append "mirror://gnu/recutils/recutils-"
1443 version ".tar.gz"))
1444 (sha256
1445 (base32
1446 "14xiln4immfsw8isnvwvq0h23f6z0wilpgsc4qzabnrzb5lsx3nz"))))
1447 (build-system gnu-build-system)
1448
1449 (arguments '(#:configure-flags
1450 (list (string-append "--with-bash-headers="
1451 (assoc-ref %build-inputs "bash:include")
1452 "/include/bash"))))
1453
1454 (native-inputs `(("bc" ,bc)
1455 ("bash:include" ,bash "include")
1456 ("check" ,check-0.14)
1457 ("pkg-config" ,pkg-config)))
1458
1459 ;; TODO: Add more optional inputs.
1460 (inputs `(("curl" ,curl)
1461 ("libgcrypt" ,libgcrypt)
1462 ("libuuid" ,util-linux "lib")))
1463 (synopsis "Manipulate plain text files as databases")
1464 (description
1465 "GNU Recutils is a set of tools and libraries for creating and
1466 manipulating text-based, human-editable databases. Despite being text-based,
1467 databases created with Recutils carry all of the expected features such as
1468 unique fields, primary keys, time stamps and more. Many different field
1469 types are supported, as is encryption.")
1470 (license license:gpl3+)
1471 (home-page "https://www.gnu.org/software/recutils/")))
1472
1473 (define-public emacs-recutils
1474 (package
1475 (inherit recutils)
1476 (name "emacs-recutils")
1477 (build-system emacs-build-system)
1478 (arguments
1479 '(#:phases
1480 (modify-phases %standard-phases
1481 (add-after 'unpack 'change-directory
1482 (lambda _
1483 (chdir "etc")
1484 #t)))))
1485 (native-inputs '())
1486 (inputs '())
1487 (synopsis "Emacs mode for working with recutils database files")
1488 (description "This package provides an Emacs major mode @code{rec-mode}
1489 for working with GNU Recutils text-based, human-editable databases. It
1490 supports editing, navigation, and querying of recutils database files
1491 including field and record folding.")))
1492
1493 (define-public rocksdb
1494 (package
1495 (name "rocksdb")
1496 (version "6.11.4")
1497 (source (origin
1498 (method git-fetch)
1499 (uri (git-reference
1500 (url "https://github.com/facebook/rocksdb")
1501 (commit (string-append "v" version))))
1502 (file-name (git-file-name name version))
1503 (sha256
1504 (base32
1505 "0n19p9cd13jg0lnibrzwkxs4xlrhyj3knypkd2ic41arbds0bdnl"))
1506 (modules '((guix build utils)))
1507 (snippet
1508 '(begin
1509 ;; TODO: unbundle gtest.
1510 (delete-file "build_tools/gnu_parallel")
1511 (substitute* "Makefile"
1512 (("build_tools/gnu_parallel") "parallel"))
1513 #t))))
1514 (build-system gnu-build-system)
1515 (arguments
1516 `(#:make-flags (list "CC=gcc" "V=1"
1517 ;; Ceph requires that RTTI is enabled.
1518 "USE_RTTI=1"
1519 "date=1970-01-01" ; build reproducibly
1520 (string-append "INSTALL_PATH="
1521 (assoc-ref %outputs "out"))
1522
1523 ;; Running the full test suite takes hours and require
1524 ;; a lot of disk space. Instead we only run a subset
1525 ;; (see .travis.yml and Makefile).
1526 "ROCKSDBTESTS_END=db_tailing_iter_test")
1527 #:test-target "check_some"
1528 ;; Many tests fail on 32-bit platforms. There are multiple reports about
1529 ;; this upstream, but it's not going to be supported any time soon.
1530 #:tests? (let ((system ,(or (%current-target-system)
1531 (%current-system))))
1532 (or (string-prefix? "x86_64-linux" system)
1533 (string-prefix? "aarch64-linux" system)))
1534 #:phases
1535 (modify-phases %standard-phases
1536 (add-after 'unpack 'patch-Makefile
1537 (lambda _
1538 (substitute* "Makefile"
1539 ;; Don't depend on the static library when installing.
1540 (("install: install-static")
1541 "install: install-shared")
1542 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1543 #t))
1544 (delete 'configure)
1545 ;; The default target is only needed for tests and built on demand.
1546 (delete 'build)
1547 (add-before 'check 'disable-optimizations
1548 (lambda _
1549 ;; Prevent the build from passing '-march=native' to the compiler.
1550 (setenv "PORTABLE" "1")
1551 #t))
1552 (add-before 'check 'disable-failing-tests
1553 (lambda _
1554 (substitute* "Makefile"
1555 ;; These tests reliably fail due to "Too many open files".
1556 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
1557 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
1558 #t))
1559 (add-after 'check 'build
1560 ;; The default build target is a debug build for tests. The
1561 ;; install target depends on the "shared_lib" release target
1562 ;; so we build it here for clarity.
1563 (lambda* (#:key (make-flags '()) parallel-build? #:allow-other-keys)
1564 (apply invoke "make" "shared_lib"
1565 `(,@(if parallel-build?
1566 `("-j" ,(number->string (parallel-job-count)))
1567 '())
1568 ,@make-flags)))))))
1569 (native-inputs
1570 `(("parallel" ,parallel)
1571 ("perl" ,perl)
1572 ("procps" ,procps)
1573 ("python" ,python-2)
1574 ("which" ,which)))
1575 (inputs
1576 `(("bzip2" ,bzip2)
1577 ("gflags" ,gflags)
1578 ("jemalloc" ,jemalloc)
1579 ("lz4" ,lz4)
1580 ("snappy" ,snappy)
1581 ("zlib" ,zlib)))
1582 (home-page "https://rocksdb.org/")
1583 (synopsis "Persistent key-value store for fast storage")
1584 (description
1585 "RocksDB is a library that forms the core building block for a fast
1586 key-value server, especially suited for storing data on flash drives. It
1587 has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
1588 between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
1589 (RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
1590 compactions, making it specially suitable for storing multiple terabytes of
1591 data in a single database. RocksDB is partially based on @code{LevelDB}.")
1592 ;; RocksDB is dual licensed under GPL2 and ASL 2.0. Some header
1593 ;; files carry the 3-clause BSD license.
1594 (license (list license:gpl2 license:asl2.0 license:bsd-3))))
1595
1596 (define-public sparql-query
1597 (package
1598 (name "sparql-query")
1599 (version "1.1")
1600 (source (origin
1601 (method git-fetch)
1602 (uri (git-reference
1603 (url "https://github.com/tialaramex/sparql-query")
1604 (commit version)))
1605 (sha256
1606 (base32 "0a84a89idpjhj9w2y3fmvzv7ldps1cva1kxvfmh897k02kaniwxk"))
1607 (file-name (git-file-name name version))))
1608 (build-system gnu-build-system)
1609 (inputs
1610 `(("curl" ,curl)
1611 ("glib" ,glib)
1612 ("libxml2" ,libxml2)
1613 ("ncurses" ,ncurses)
1614 ("readline" ,readline)))
1615 (native-inputs
1616 `(("pkg-config" ,pkg-config)))
1617 (arguments
1618 `(#:make-flags '("CC=gcc")
1619 #:phases
1620 (modify-phases %standard-phases
1621 (delete 'configure)
1622 ;; The Makefile uses git to obtain versioning information. This phase
1623 ;; substitutes the git invocation with the package version.
1624 (add-after 'unpack 'remove-git-dependency
1625 (lambda _
1626 (substitute* "Makefile"
1627 (("^gitrev :=.*$")
1628 (string-append "gitrev = \"v" ,version "\"")))
1629 #t))
1630 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
1631 ;; This replacement does the same thing, except for using $PREFIX/bin
1632 ;; instead.
1633 (replace 'install
1634 (lambda* (#:key outputs #:allow-other-keys)
1635 (let* ((out (assoc-ref outputs "out"))
1636 (bin (string-append out "/bin")))
1637 (install-file "sparql-query" bin)
1638 (symlink (string-append bin "/sparql-query")
1639 (string-append bin "/sparql-update")))
1640 #t))
1641 (replace 'check
1642 (lambda* (#:key make-flags #:allow-other-keys)
1643 (apply invoke "make" `(,@make-flags "scan-test"))
1644 (invoke "./scan-test"))))))
1645 (home-page "https://github.com/tialaramex/sparql-query/")
1646 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
1647 (description "Sparql-query is a command-line tool for accessing SPARQL
1648 endpoints over HTTP. It has been intentionally designed to @code{feel} similar to
1649 tools for interrogating SQL databases. For example, you can enter a query over
1650 several lines, using a semi-colon at the end of a line to indicate the end of
1651 your query. It also supports readline so that you can more easily recall and
1652 edit previous queries, even across sessions. It can be used non-interactively,
1653 for example from a shell script.")
1654 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
1655 ;; others (like sparql-query.c) contain a GPLv2+ license header.
1656 (license (list license:gpl3+))))
1657
1658 (define-public sqitch
1659 (package
1660 (name "sqitch")
1661 (version "1.1.0")
1662 (source
1663 (origin
1664 (method url-fetch)
1665 (uri (string-append
1666 "mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-v"
1667 version ".tar.gz"))
1668 (sha256
1669 (base32 "1ayiwg9kh3w0nbacbcln7h944z94vq5vnnd5diz86033bpbnq57f"))))
1670 (build-system perl-build-system)
1671 (arguments
1672 '(#:phases
1673 (modify-phases %standard-phases
1674 (add-before 'check 'set-check-environment
1675 (lambda _
1676 (setenv "TZ" "UTC")
1677 (setenv "HOME" "/tmp")
1678 #t))
1679 (add-after 'install 'wrap-program
1680 (lambda* (#:key outputs #:allow-other-keys)
1681 (let* ((out (assoc-ref outputs "out"))
1682 (path (getenv "PERL5LIB")))
1683 (wrap-program (string-append out "/bin/sqitch")
1684 `("PERL5LIB" ":" prefix
1685 (,(string-append out "/lib/perl5/site_perl"
1686 ":"
1687 path)))))
1688 #t)))))
1689 (native-inputs
1690 `(("perl-capture-tiny" ,perl-capture-tiny)
1691 ("perl-io-pager" ,perl-io-pager)
1692 ("perl-module-build" ,perl-module-build)
1693 ("perl-module-runtime" ,perl-module-runtime)
1694 ("perl-path-class" ,perl-path-class)
1695 ("perl-test-deep" ,perl-test-deep)
1696 ("perl-test-dir" ,perl-test-dir)
1697 ("perl-test-exception" ,perl-test-exception)
1698 ("perl-test-file" ,perl-test-file)
1699 ("perl-test-file-contents" ,perl-test-file-contents)
1700 ("perl-test-mockmodule" ,perl-test-mockmodule)
1701 ("perl-test-mockobject" ,perl-test-mockobject)
1702 ("perl-test-nowarnings" ,perl-test-nowarnings)
1703 ("perl-test-warn" ,perl-test-warn)))
1704 (inputs
1705 `(("perl-class-xsaccessor" ,perl-class-xsaccessor)
1706 ("perl-clone" ,perl-clone)
1707 ("perl-config-gitlike" ,perl-config-gitlike)
1708 ("perl-datetime" ,perl-datetime)
1709 ("perl-datetime-timezone" ,perl-datetime-timezone)
1710 ("perl-dbd-mysql" ,perl-dbd-mysql)
1711 ("perl-dbd-pg" ,perl-dbd-pg)
1712 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1713 ("perl-dbi" ,perl-dbi)
1714 ("perl-devel-stacktrace" ,perl-devel-stacktrace)
1715 ("perl-encode-locale" ,perl-encode-locale)
1716 ("perl-hash-merge" ,perl-hash-merge)
1717 ("perl-ipc-run3" ,perl-ipc-run3)
1718 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
1719 ("perl-libintl-perl" ,perl-libintl-perl)
1720 ("perl-list-moreutils" ,perl-list-moreutils)
1721 ("perl-moo" ,perl-moo)
1722 ("perl-mysql-config" ,perl-mysql-config)
1723 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1724 ("perl-path-class" ,perl-path-class)
1725 ("perl-perlio-utf8_strict" ,perl-perlio-utf8_strict)
1726 ("perl-string-formatter" ,perl-string-formatter)
1727 ("perl-string-shellquote" ,perl-string-shellquote)
1728 ("perl-sub-exporter" ,perl-sub-exporter)
1729 ("perl-template-tiny" ,perl-template-tiny)
1730 ("perl-template-toolkit" ,perl-template-toolkit)
1731 ("perl-throwable" ,perl-throwable)
1732 ("perl-try-tiny" ,perl-try-tiny)
1733 ("perl-type-tiny" ,perl-type-tiny)
1734 ("perl-type-tiny-xs" ,perl-type-tiny-xs)
1735 ("perl-uri" ,perl-uri)
1736 ("perl-uri-db" ,perl-uri-db)))
1737 (home-page "https://sqitch.org/")
1738 (synopsis "Database change management tool")
1739 (description
1740 "Sqitch is a standalone change management system for database schemas,
1741 which uses SQL to describe changes.")
1742 (license license:x11)))
1743
1744 (define-public sqlcrush
1745 ;; Unfortunately, there is no proper upstream release and may never be.
1746 (let ((commit "b5f6868f189566a26eecc78d0f0659813c1aa98a")
1747 (revision "1"))
1748 (package
1749 (name "sqlcrush")
1750 (version (git-version "0.1.5" revision commit))
1751 (source (origin
1752 (method git-fetch)
1753 (uri (git-reference
1754 (url "https://github.com/coffeeandscripts/sqlcrush")
1755 (commit commit)))
1756 (file-name (git-file-name name version))
1757 (sha256
1758 (base32
1759 "0x3wy40r93p0jv3nbwj9a77wa4ff697d13r0wffmm7q9h3mzsww8"))))
1760 (build-system python-build-system)
1761 (inputs
1762 `(("python-cryptography" ,python-cryptography)
1763 ("python-psycopg2" ,python-psycopg2)
1764 ("python-pymysql" ,python-pymysql)
1765 ("python-sqlalchemy" ,python-sqlalchemy)))
1766 (home-page "https://github.com/coffeeandscripts/sqlcrush")
1767 (synopsis "Text console-based database viewer and editor")
1768 (description
1769 "SQLcrush lets you view and edit a database directly from the text
1770 console through an ncurses interface. You can explore each table's structure,
1771 browse and edit the contents, add and delete entries, all while tracking your
1772 changes.")
1773 (license license:gpl3+)))) ; no headers, see README.md
1774
1775 (define-public tdb
1776 (package
1777 (name "tdb")
1778 (version "1.4.3")
1779 (source (origin
1780 (method url-fetch)
1781 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
1782 version ".tar.gz"))
1783 (sha256
1784 (base32
1785 "06waz0k50c7v3chd08mzp2rv7w4k4q9isbxx3vhlfpx1vy9q61f8"))))
1786 (build-system gnu-build-system)
1787 (arguments
1788 '(#:phases
1789 (modify-phases %standard-phases
1790 (replace 'configure
1791 (lambda* (#:key outputs #:allow-other-keys)
1792 (let ((out (assoc-ref outputs "out")))
1793 ;; The 'configure' script is a wrapper for Waf and
1794 ;; doesn't recognize things like '--enable-fast-install'.
1795 (invoke "./configure"
1796 (string-append "--prefix=" out))))))))
1797 (native-inputs
1798 `(;; TODO: Build the documentation.
1799 ;; ("docbook-xsl" ,docbook-xsl)
1800 ;; ("libxml2" ,libxml2)
1801 ;; ("libxslt" ,libxslt)
1802 ("python" ,python) ;for the Waf build system
1803 ("which" ,which)))
1804 (home-page "https://tdb.samba.org/")
1805 (synopsis "Trivial database")
1806 (description
1807 "TDB is a Trivial Database. In concept, it is very much like GDBM,
1808 and BSD's DB except that it allows multiple simultaneous writers and uses
1809 locking internally to keep writers from trampling on each other. TDB is also
1810 extremely small.")
1811 (license license:lgpl3+)))
1812
1813 (define-public perl-dbi
1814 (package
1815 (name "perl-dbi")
1816 (version "1.643")
1817 (source (origin
1818 (method url-fetch)
1819 (uri (string-append
1820 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
1821 version ".tar.gz"))
1822 (sha256
1823 (base32
1824 "1yinx39960y241vf2sknxj0dfz82a5m9gvklq5rw78k0nlyrjawa"))))
1825 (build-system perl-build-system)
1826 (synopsis "Database independent interface for Perl")
1827 (description "This package provides an database interface for Perl.")
1828 (home-page "https://metacpan.org/release/DBI")
1829 (license license:perl-license)))
1830
1831 (define-public perl-dbix-class
1832 (package
1833 (name "perl-dbix-class")
1834 (version "0.082842")
1835 (source
1836 (origin
1837 (method url-fetch)
1838 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1839 "DBIx-Class-" version ".tar.gz"))
1840 (sha256
1841 (base32 "1rh7idjjbibc1zmiaaarask434lh0lx7f2xyfwmy37k9fa0xcpmh"))))
1842 (build-system perl-build-system)
1843 (native-inputs
1844 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
1845 ("perl-file-temp" ,perl-file-temp)
1846 ("perl-module-install" ,perl-module-install)
1847 ("perl-package-stash" ,perl-package-stash)
1848 ("perl-test-deep" ,perl-test-deep)
1849 ("perl-test-exception" ,perl-test-exception)
1850 ("perl-test-warn" ,perl-test-warn)))
1851 (propagated-inputs
1852 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1853 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1854 ("perl-class-inspector" ,perl-class-inspector)
1855 ("perl-config-any" ,perl-config-any)
1856 ("perl-context-preserve" ,perl-context-preserve)
1857 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
1858 ("perl-data-page" ,perl-data-page)
1859 ("perl-dbi" ,perl-dbi)
1860 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
1861 ("perl-hash-merge" ,perl-hash-merge)
1862 ("perl-module-find" ,perl-module-find)
1863 ("perl-moo" ,perl-moo)
1864 ("perl-mro-compat" ,perl-mro-compat)
1865 ("perl-namespace-clean" ,perl-namespace-clean)
1866 ("perl-path-class" ,perl-path-class)
1867 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
1868 ("perl-scope-guard" ,perl-scope-guard)
1869 ("perl-sql-abstract-classic" ,perl-sql-abstract-classic)
1870 ("perl-sub-name" ,perl-sub-name)
1871 ("perl-text-balanced" ,perl-text-balanced)
1872 ("perl-try-tiny" ,perl-try-tiny)))
1873 (home-page "https://metacpan.org/release/DBIx-Class")
1874 (synopsis "Extensible and flexible object <-> relational mapper")
1875 (description "An SQL to OO mapper with an object API inspired by
1876 Class::DBI (with a compatibility layer as a springboard for porting) and a
1877 resultset API that allows abstract encapsulation of database operations. It
1878 aims to make representing queries in your code as perl-ish as possible while
1879 still providing access to as many of the capabilities of the database as
1880 possible, including retrieving related records from multiple tables in a
1881 single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
1882 \"ORDER BY\" and \"HAVING\" support.")
1883 (license license:perl-license)))
1884
1885 (define-public perl-dbix-class-cursor-cached
1886 (package
1887 (name "perl-dbix-class-cursor-cached")
1888 (version "1.001004")
1889 (source
1890 (origin
1891 (method url-fetch)
1892 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
1893 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
1894 (sha256
1895 (base32
1896 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
1897 (build-system perl-build-system)
1898 (native-inputs
1899 `(("perl-cache-cache" ,perl-cache-cache)
1900 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1901 ("perl-module-install" ,perl-module-install)))
1902 (propagated-inputs
1903 `(("perl-carp-clan" ,perl-carp-clan)
1904 ("perl-dbix-class" ,perl-dbix-class)))
1905 (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached")
1906 (synopsis "Cursor with built-in caching support")
1907 (description "DBIx::Class::Cursor::Cached provides a cursor class with
1908 built-in caching support.")
1909 (license license:perl-license)))
1910
1911 (define-public perl-dbix-class-introspectablem2m
1912 (package
1913 (name "perl-dbix-class-introspectablem2m")
1914 (version "0.001002")
1915 (source
1916 (origin
1917 (method url-fetch)
1918 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1919 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
1920 (sha256
1921 (base32
1922 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
1923 (build-system perl-build-system)
1924 (native-inputs
1925 `(("perl-module-install" ,perl-module-install)))
1926 (propagated-inputs
1927 `(("perl-dbix-class" ,perl-dbix-class)))
1928 (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M")
1929 (synopsis "Introspect many-to-many relationships")
1930 (description "Because the many-to-many relationships are not real
1931 relationships, they can not be introspected with DBIx::Class. Many-to-many
1932 relationships are actually just a collection of convenience methods installed
1933 to bridge two relationships. This DBIx::Class component can be used to store
1934 all relevant information about these non-relationships so they can later be
1935 introspected and examined.")
1936 (license license:perl-license)))
1937
1938 (define-public perl-dbix-class-schema-loader
1939 (package
1940 (name "perl-dbix-class-schema-loader")
1941 (version "0.07049")
1942 (source
1943 (origin
1944 (method url-fetch)
1945 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1946 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
1947 (sha256
1948 (base32
1949 "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8"))))
1950 (build-system perl-build-system)
1951 (native-inputs
1952 `(("perl-config-any" ,perl-config-any)
1953 ("perl-config-general" ,perl-config-general)
1954 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1955 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
1956 ("perl-module-install" ,perl-module-install)
1957 ("perl-moose" ,perl-moose)
1958 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
1959 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
1960 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1961 ("perl-test-deep" ,perl-test-deep)
1962 ("perl-test-differences" ,perl-test-differences)
1963 ("perl-test-exception" ,perl-test-exception)
1964 ("perl-test-pod" ,perl-test-pod)
1965 ("perl-test-warn" ,perl-test-warn)))
1966 (propagated-inputs
1967 `(("perl-class-unload" ,perl-class-unload)
1968 ("perl-class-inspector" ,perl-class-inspector)
1969 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1970 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1971 ("perl-carp-clan" ,perl-carp-clan)
1972 ("perl-data-dump" ,perl-data-dump)
1973 ("perl-dbix-class" ,perl-dbix-class)
1974 ("perl-hash-merge" ,perl-hash-merge)
1975 ("perl-list-moreutils" ,perl-list-moreutils)
1976 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
1977 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
1978 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
1979 ("perl-namespace-clean" ,perl-namespace-clean)
1980 ("perl-mro-compat" ,perl-mro-compat)
1981 ("perl-scope-guard" ,perl-scope-guard)
1982 ("perl-string-camelcase" ,perl-string-camelcase)
1983 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
1984 ("perl-sub-name" ,perl-sub-name)
1985 ("perl-try-tiny" ,perl-try-tiny)))
1986 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
1987 (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader")
1988 (synopsis "Create a DBIx::Class::Schema based on a database")
1989 (description "DBIx::Class::Schema::Loader automates the definition of a
1990 DBIx::Class::Schema by scanning database table definitions and setting up the
1991 columns, primary keys, unique constraints and relationships.")
1992 (license license:perl-license)))
1993
1994 (define-public perl-dbd-pg
1995 (package
1996 (name "perl-dbd-pg")
1997 (version "3.7.4")
1998 (source
1999 (origin
2000 (method url-fetch)
2001 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
2002 "DBD-Pg-" version ".tar.gz"))
2003 (sha256
2004 (base32
2005 "0gkqlvbmzbdm0g4k328nlkjdg3wrjm5i2n9jxj1i8sqxkm79rylz"))))
2006 (build-system perl-build-system)
2007 (native-inputs
2008 `(("perl-dbi" ,perl-dbi)))
2009 (propagated-inputs
2010 `(("perl-dbi" ,perl-dbi)
2011 ("postgresql" ,postgresql)))
2012 (home-page "https://metacpan.org/release/DBD-Pg")
2013 (synopsis "DBI PostgreSQL interface")
2014 (description "This package provides a PostgreSQL driver for the Perl5
2015 @dfn{Database Interface} (DBI).")
2016 (license license:perl-license)))
2017
2018 (define-public perl-dbd-mysql
2019 (package
2020 (name "perl-dbd-mysql")
2021 (version "4.050")
2022 (source
2023 (origin
2024 (method url-fetch)
2025 (uri (string-append "mirror://cpan/authors/id/D/DV/DVEEDEN/"
2026 "DBD-mysql-" version ".tar.gz"))
2027 (sha256
2028 (base32 "0y4djb048i09dk19av7mzfb3khr72vw11p3ayw2p82jsy4gm8j2g"))))
2029 (build-system perl-build-system)
2030 (arguments
2031 `(#:phases
2032 (modify-phases %standard-phases
2033 (add-before 'configure 'skip-library-detection
2034 ;; Avoid depencies on perl-devel-checklib, openssl, and zlib. They
2035 ;; are really only needed for the test suite; their absence does not
2036 ;; affect the build or the end result.
2037 (lambda _
2038 (substitute* "Makefile.PL"
2039 (("use Devel::CheckLib;" match)
2040 (string-append "# " match))
2041 (("assert_lib")
2042 "print"))
2043 #t)))
2044 ;; Tests require running MySQL server.
2045 #:tests? #f))
2046 (propagated-inputs
2047 `(("perl-dbi" ,perl-dbi)
2048 ("mysql" ,mariadb "lib")
2049 ("mysql-dev" ,mariadb "dev")))
2050 (home-page "https://metacpan.org/release/DBD-mysql")
2051 (synopsis "DBI MySQL interface")
2052 (description "This package provides a MySQL driver for the Perl5
2053 @dfn{Database Interface} (DBI).")
2054 (license license:perl-license)))
2055
2056 (define-public perl-dbd-sqlite
2057 (package
2058 (name "perl-dbd-sqlite")
2059 (version "1.66")
2060 (source (origin
2061 (method url-fetch)
2062 (uri (string-append
2063 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
2064 version ".tar.gz"))
2065 (sha256
2066 (base32
2067 "1zljln5nh61gj3k22a1fv2vhx5l83waizmarwkh77hk6kzzmvrw9"))))
2068 (build-system perl-build-system)
2069 (inputs `(("sqlite" ,sqlite)))
2070 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
2071 (synopsis "SQlite interface for Perl")
2072 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
2073 the entire thing in the distribution. So in order to get a fast transaction
2074 capable RDBMS working for your Perl project you simply have to install this
2075 module, and nothing else.")
2076 (license license:perl-license)
2077 (home-page "https://metacpan.org/release/DBD-SQLite")))
2078
2079 (define-public perl-mysql-config
2080 (package
2081 (name "perl-mysql-config")
2082 (version "1.04")
2083 (source
2084 (origin
2085 (method url-fetch)
2086 (uri (string-append
2087 "mirror://cpan/authors/id/D/DA/DARREN/MySQL-Config-"
2088 version
2089 ".tar.gz"))
2090 (sha256
2091 (base32
2092 "1svn7ccw2gc4cazvc58j84rxhnc9vs01zpird0l8460598j475qr"))))
2093 (build-system perl-build-system)
2094 (home-page "https://metacpan.org/release/MySQL-Config")
2095 (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files")
2096 (description
2097 "@code{MySQL::Config} emulates the @code{load_defaults} function from
2098 libmysqlclient. It will fill an array with long options, ready to be parsed by
2099 @code{Getopt::Long}.")
2100 (license license:perl-license)))
2101
2102 (define-public perl-sql-abstract
2103 (package
2104 (name "perl-sql-abstract")
2105 (version "1.87")
2106 (source
2107 (origin
2108 (method url-fetch)
2109 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
2110 "SQL-Abstract-" version ".tar.gz"))
2111 (sha256
2112 (base32 "0jhw91b23wc9bkfwcgvka4x5ddxk58m9bcp5ay7a3vx77nla09p9"))))
2113 (build-system perl-build-system)
2114 (native-inputs
2115 `(("perl-module-install" ,perl-module-install)
2116 ("perl-test-deep" ,perl-test-deep)
2117 ("perl-test-exception" ,perl-test-exception)
2118 ("perl-test-warn" ,perl-test-warn)))
2119 (propagated-inputs
2120 `(("perl-hash-merge" ,perl-hash-merge)
2121 ("perl-moo" ,perl-moo)
2122 ("perl-mro-compat" ,perl-mro-compat)
2123 ("perl-text-balanced" ,perl-text-balanced)))
2124 (home-page "https://metacpan.org/release/SQL-Abstract")
2125 (synopsis "Generate SQL from Perl data structures")
2126 (description "This module was inspired by the excellent DBIx::Abstract.
2127 While based on the concepts used by DBIx::Abstract, the concepts used have
2128 been modified to make the SQL easier to generate from Perl data structures.
2129 The underlying idea is for this module to do what you mean, based on the data
2130 structures you provide it, so that you don't have to modify your code every
2131 time your data changes.")
2132 (license license:perl-license)))
2133
2134 (define-public perl-sql-abstract-classic
2135 (package
2136 (name "perl-sql-abstract-classic")
2137 (version "1.91")
2138 (source
2139 (origin
2140 (method url-fetch)
2141 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
2142 "SQL-Abstract-Classic-" version ".tar.gz"))
2143 (sha256
2144 (base32 "0a7g13hs3kdxrjn43sfli09mgsi9d6w0dfw6hlk268av17yisgaf"))))
2145 (build-system perl-build-system)
2146 (native-inputs
2147 `(("perl-test-deep" ,perl-test-deep)
2148 ("perl-test-exception" ,perl-test-exception)
2149 ("perl-test-warn" ,perl-test-warn)))
2150 (propagated-inputs
2151 `(("perl-mro-compat" ,perl-mro-compat)
2152 ("perl-sql-abstract" ,perl-sql-abstract)))
2153 (home-page "https://metacpan.org/release/SQL-Abstract-Classic")
2154 (synopsis "Generate SQL from Perl data structures")
2155 (description
2156 "This module is nearly identical to @code{SQL::Abstract} 1.81, and exists
2157 to preserve the ability of users to opt into the new way of doing things in
2158 later versions according to their own schedules.
2159
2160 It is an abstract SQL generation module based on the concepts used by
2161 @code{DBIx::Abstract}, with several important differences, especially when it
2162 comes to @code{WHERE} clauses. These concepts were modified to make the SQL
2163 easier to generate from Perl data structures.
2164
2165 The underlying idea is for this module to do what you mean, based on the data
2166 structures you provide it. You shouldn't have to modify your code every time
2167 your data changes, as this module figures it out.")
2168 (license license:perl-license)))
2169
2170 (define-public perl-sql-splitstatement
2171 (package
2172 (name "perl-sql-splitstatement")
2173 (version "1.00020")
2174 (source
2175 (origin
2176 (method url-fetch)
2177 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
2178 "SQL-SplitStatement-" version ".tar.gz"))
2179 (sha256
2180 (base32
2181 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
2182 (build-system perl-build-system)
2183 (native-inputs
2184 `(("perl-test-exception" ,perl-test-exception)))
2185 (propagated-inputs
2186 `(("perl-class-accessor" ,perl-class-accessor)
2187 ("perl-list-moreutils" ,perl-list-moreutils)
2188 ("perl-regexp-common" ,perl-regexp-common)
2189 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
2190 (home-page "https://metacpan.org/release/SQL-SplitStatement")
2191 (synopsis "Split SQL code into atomic statements")
2192 (description "This module tries to split any SQL code, even including
2193 non-standard extensions, into the atomic statements it is composed of.")
2194 (license license:perl-license)))
2195
2196 (define-public perl-sql-tokenizer
2197 (package
2198 (name "perl-sql-tokenizer")
2199 (version "0.24")
2200 (source
2201 (origin
2202 (method url-fetch)
2203 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
2204 "SQL-Tokenizer-" version ".tar.gz"))
2205 (sha256
2206 (base32
2207 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
2208 (build-system perl-build-system)
2209 (home-page "https://metacpan.org/release/SQL-Tokenizer")
2210 (synopsis "SQL tokenizer")
2211 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
2212 claim to be a parser or query verifier. It just creates sane tokens from a
2213 valid SQL query.")
2214 (license license:perl-license)))
2215
2216 (define-public unixodbc
2217 (package
2218 (name "unixodbc")
2219 (version "2.3.9")
2220 (source (origin
2221 (method url-fetch)
2222 (uri
2223 (string-append
2224 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
2225 version ".tar.gz"))
2226 (sha256
2227 (base32 "01xj65d02i3yjy7p9z08y9jakcs5szmz4rask868n7387nn3x0sj"))))
2228 (build-system gnu-build-system)
2229 (synopsis "Data source abstraction library")
2230 (description "Unixodbc is a library providing an API with which to access
2231 data sources. Data sources include SQL Servers and any software with an ODBC
2232 Driver.")
2233 (license license:lgpl2.1+)
2234 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
2235 (home-page "http://www.unixodbc.org")))
2236
2237 (define-public unqlite
2238 (package
2239 (name "unqlite")
2240 (version "1.1.6")
2241 (source (origin
2242 (method url-fetch)
2243 ;; Contains bug fixes against the official release, and has an
2244 ;; autotooled build system.
2245 (uri (string-append "https://github.com/aidin36/tocc/releases/"
2246 "download/v1.0.0/"
2247 "unqlite-unofficial-" version ".tar.gz"))
2248 (sha256
2249 (base32
2250 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
2251 (build-system gnu-build-system)
2252 (arguments `(#:tests? #f)) ;No check target
2253 (home-page "https://www.unqlite.org")
2254 (synopsis "In-memory key/value and document store")
2255 (description
2256 "UnQLite is an in-process software library which implements a
2257 self-contained, serverless, zero-configuration, transactional NoSQL
2258 database engine. UnQLite is a document store database similar to
2259 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
2260 similar to BerkeleyDB, LevelDB, etc.")
2261 (license license:bsd-2)))
2262
2263 (define-public redis
2264 (package
2265 (name "redis")
2266 (version "6.0.11")
2267 (source (origin
2268 (method url-fetch)
2269 (uri (string-append "http://download.redis.io/releases/redis-"
2270 version".tar.gz"))
2271 (sha256
2272 (base32
2273 "0prwqap452m581nyc3cz642d1z3x9nd81896hlqdm3z8238z49y9"))
2274 (modules '((guix build utils)))
2275 (snippet
2276 ;; Delete bundled jemalloc, as the package will use the libc one
2277 '(begin (delete-file-recursively "deps/jemalloc")
2278 #t))))
2279 (build-system gnu-build-system)
2280 (native-inputs
2281 `(("procps" ,procps) ; for tests
2282 ("tcl" ,tcl))) ; for tests
2283 (arguments
2284 '(#:phases
2285 (modify-phases %standard-phases
2286 (delete 'configure)
2287 (add-after 'unpack 'use-correct-tclsh
2288 (lambda* (#:key inputs #:allow-other-keys)
2289 (substitute* "runtest"
2290 (("^TCLSH=.*")
2291 (string-append "TCLSH="
2292 (assoc-ref inputs "tcl")
2293 "/bin/tclsh")))
2294 #t))
2295 (add-after 'unpack 'adjust-tests
2296 (lambda _
2297 ;; Disable failing tests
2298 (substitute* "tests/test_helper.tcl"
2299 ((" integration/replication[^-]") "")
2300 ((" integration/replication-4") "")
2301 ((" integration/replication-psync") ""))
2302 #t)))
2303 #:make-flags `("CC=gcc"
2304 "MALLOC=libc"
2305 "LDFLAGS=-ldl"
2306 ,(string-append "PREFIX="
2307 (assoc-ref %outputs "out")))))
2308 (synopsis "Key-value cache and store")
2309 (description "Redis is an advanced key-value cache and store. Redis
2310 supports many data structures including strings, hashes, lists, sets, sorted
2311 sets, bitmaps and hyperloglogs.")
2312 (home-page "https://redis.io/")
2313 (license license:bsd-3)))
2314
2315 (define-public kyotocabinet
2316 (package
2317 (name "kyotocabinet")
2318 (version "1.2.79")
2319 (source (origin
2320 (method url-fetch)
2321 (uri (string-append "https://fallabs.com/kyotocabinet/pkg/"
2322 "kyotocabinet-" version ".tar.gz"))
2323 (sha256
2324 (base32
2325 "079ymsahlrijswgwfr2la9yw5h57l752cprhp5dz31iamsj1vyv7"))))
2326 (build-system gnu-build-system)
2327 (arguments
2328 `(#:configure-flags
2329 (list
2330 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
2331 (string-append "LDFLAGS=-Wl,-rpath="
2332 (assoc-ref %outputs "out") "/lib"))))
2333 (inputs `(("zlib" ,zlib)))
2334 (home-page "https://fallabs.com/kyotocabinet/")
2335 (synopsis
2336 "Kyoto Cabinet is a modern implementation of the DBM database")
2337 (description
2338 "Kyoto Cabinet is a standalone file-based database that supports Hash
2339 and B+ Tree data storage models. It is a fast key-value lightweight
2340 database and supports many programming languages. It is a NoSQL database.")
2341 (license license:gpl3+)))
2342
2343 (define-public tokyocabinet
2344 (package
2345 (name "tokyocabinet")
2346 (version "1.4.48")
2347 (source
2348 (origin
2349 (method url-fetch)
2350 (uri (string-append "http://fallabs.com/tokyocabinet/"
2351 name "-" version ".tar.gz"))
2352 (sha256
2353 (base32
2354 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
2355 (build-system gnu-build-system)
2356 (arguments
2357 `(#:configure-flags
2358 (list "--enable-pthread" "--enable-off64" "--enable-fastest"
2359 (string-append "LDFLAGS=-Wl,-rpath="
2360 (assoc-ref %outputs "out") "/lib"))))
2361 (inputs
2362 `(("zlib" ,zlib)))
2363 (home-page "http://fallabs.com/tokyocabinet/")
2364 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
2365 (description
2366 "Tokyo Cabinet is a library of routines for managing a database.
2367 The database is a simple data file containing records, each is a pair of a
2368 key and a value. Every key and value is serial bytes with variable length.
2369 Both binary data and character string can be used as a key and a value.
2370 There is neither concept of data tables nor data types. Records are
2371 organized in hash table, B+ tree, or fixed-length array.")
2372 (license license:lgpl2.1+)))
2373
2374 (define-public wiredtiger
2375 (package
2376 (name "wiredtiger")
2377 (version "2.9.1")
2378 (source (origin
2379 (method url-fetch)
2380 (uri (string-append
2381 "http://source.wiredtiger.com/releases/wiredtiger-"
2382 version ".tar.bz2"))
2383 (sha256
2384 (base32
2385 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
2386 (build-system gnu-build-system)
2387 (arguments
2388 '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib")
2389 #:phases
2390 (modify-phases %standard-phases
2391 (add-before 'check 'disable-test/fops
2392 (lambda _
2393 ;; XXX: timed out after 3600 seconds of silence
2394 (substitute* "Makefile"
2395 (("test/fops") ""))
2396 #t)))))
2397 (inputs
2398 `(("lz4" ,lz4)
2399 ("zlib" ,zlib)
2400 ("snappy" ,snappy)))
2401 (home-page "http://source.wiredtiger.com/")
2402 (synopsis "NoSQL data engine")
2403 (description
2404 "WiredTiger is an extensible platform for data management. It supports
2405 row-oriented storage (where all columns of a row are stored together),
2406 column-oriented storage (where columns are stored in groups, allowing for
2407 more efficient access and storage of column subsets) and log-structured merge
2408 trees (LSM), for sustained throughput under random insert workloads.")
2409 (license license:gpl3) ; or GPL-2
2410 ;; configure.ac: WiredTiger requires a 64-bit build.
2411 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
2412
2413 (define-public wiredtiger-3
2414 (package
2415 (inherit wiredtiger)
2416 (name "wiredtiger")
2417 (version "3.1.0")
2418 (source (origin
2419 (method url-fetch)
2420 (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-"
2421 version ".tar.bz2"))
2422 (sha256
2423 (base32
2424 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx"))))))
2425
2426 (define-public guile-wiredtiger
2427 (package
2428 (name "guile-wiredtiger")
2429 (version "0.7.0")
2430 (source (origin
2431 (method git-fetch)
2432 (uri (git-reference
2433 (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
2434 (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b")))
2435 (file-name (string-append name "-" version "-checkout"))
2436 (sha256
2437 (base32
2438 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595"))))
2439 (build-system gnu-build-system)
2440 (arguments
2441 '(#:parallel-tests? #f ;; tests can't be run in parallel, yet.
2442 #:configure-flags
2443 (list (string-append "--with-libwiredtiger-prefix="
2444 (assoc-ref %build-inputs "wiredtiger")))
2445 #:make-flags '("GUILE_AUTO_COMPILE=0")))
2446 (native-inputs
2447 `(("autoconf" ,autoconf)
2448 ("automake" ,automake)
2449 ("pkg-config" ,pkg-config)))
2450 (inputs
2451 `(("wiredtiger" ,wiredtiger-3)
2452 ("guile" ,guile-2.2)))
2453 (propagated-inputs
2454 `(("guile-bytestructures" ,guile-bytestructures)))
2455 (synopsis "WiredTiger bindings for GNU Guile")
2456 (description
2457 "This package provides Guile bindings to the WiredTiger ``NoSQL''
2458 database.")
2459 (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger")
2460 (license license:gpl3+)))
2461
2462 (define-public perl-db-file
2463 (package
2464 (name "perl-db-file")
2465 (version "1.855")
2466 (source
2467 (origin
2468 (method url-fetch)
2469 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
2470 version ".tar.gz"))
2471 (sha256
2472 (base32 "0q599h7g4jkzks5dxf1zifx9k7l9vif26r2dlgkzxkg6bfif5zyr"))))
2473 (build-system perl-build-system)
2474 (inputs `(("bdb" ,bdb)))
2475 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
2476 (arguments
2477 `(#:phases (modify-phases %standard-phases
2478 (add-before
2479 'configure 'modify-config.in
2480 (lambda* (#:key inputs #:allow-other-keys)
2481 (substitute* "config.in"
2482 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
2483 #t)))))
2484 (home-page "https://metacpan.org/release/DB_File")
2485 (synopsis "Perl5 access to Berkeley DB version 1.x")
2486 (description
2487 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
2488 (license license:perl-license)))
2489
2490 (define-public lmdb
2491 (package
2492 (name "lmdb")
2493 (version "0.9.28")
2494 (source
2495 (origin
2496 (method git-fetch)
2497 (uri (git-reference
2498 (url "https://git.openldap.org/openldap/openldap.git")
2499 (commit (string-append "LMDB_" version))))
2500 (file-name (git-file-name name version))
2501 (sha256
2502 (base32 "012a8bs49cswsnzw7k4piis5b6dn4by85w7a7mai9i04xcjyy9as"))))
2503 (build-system gnu-build-system)
2504 (arguments
2505 `(#:test-target "test"
2506 #:phases
2507 (modify-phases %standard-phases
2508 (replace 'configure
2509 (lambda* (#:key outputs #:allow-other-keys)
2510 (chdir "libraries/liblmdb")
2511 (substitute* "Makefile"
2512 (("/usr/local") (assoc-ref outputs "out")))
2513 #t))
2514 (add-after 'install 'create-pkg-config-file
2515 (lambda* (#:key outputs #:allow-other-keys)
2516 (let ((out (assoc-ref outputs "out")))
2517 (mkdir-p (string-append out "/lib/pkgconfig"))
2518 (with-output-to-file (string-append out "/lib/pkgconfig/liblmdb.pc")
2519 (lambda _
2520 (format #t "prefix=~a~@
2521 exec_prefix=~a~@
2522 libdir=~a/lib~@
2523 includedir=~a/include~@
2524 ~@
2525 Name: liblmdb~@
2526 Version: ~a~@
2527 Description: Lightning Memory-Mapped Database library~@
2528 Libs: -L${libdir} -llmdb~@
2529 Cflags: -I${includedir}~%"
2530 out out out out ,version)))
2531 #t))))))
2532 (home-page "https://symas.com/lmdb/")
2533 (synopsis "Lightning Memory-Mapped Database library")
2534 (description
2535 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
2536 transactional database. Unlike more complex relational databases, LMDB handles
2537 only key-value pairs (stored as arbitrary byte arrays) and relies on the
2538 underlying operating system for caching and locking, keeping the code small and
2539 simple.
2540 The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
2541 disk-based databases with high read performance that scales linearly over
2542 multiple cores. The size of each database is limited only by the size of the
2543 virtual address space — not physical RAM.")
2544 (license license:openldap2.8)))
2545
2546 (define-public lmdbxx
2547 (package
2548 (name "lmdbxx")
2549 (version "0.9.14.0")
2550 (source
2551 (origin
2552 (method git-fetch)
2553 (uri (git-reference
2554 (url "https://github.com/drycpp/lmdbxx")
2555 (commit version)))
2556 (file-name (git-file-name name version))
2557 (sha256
2558 (base32 "1jmb9wg2iqag6ps3z71bh72ymbcjrb6clwlkgrqf1sy80qwvlsn6"))))
2559 (arguments
2560 `(#:make-flags
2561 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
2562 #:phases
2563 (modify-phases %standard-phases
2564 (delete 'configure))))
2565 (build-system gnu-build-system)
2566 (inputs `(("lmdb" ,lmdb)))
2567 (home-page "http://lmdbxx.sourceforge.net")
2568 (synopsis "C++11 wrapper for the LMDB embedded B+ tree database library")
2569 (description "@code{lmdbxx} is a comprehensive @code{C++} wrapper for the
2570 @code{LMDB} embedded database library, offering both an error-checked
2571 procedural interface and an object-oriented resource interface with RAII
2572 semantics.")
2573 (license license:unlicense)))
2574
2575 (define-public libpqxx
2576 (package
2577 (name "libpqxx")
2578 (version "4.0.1")
2579 (source (origin
2580 (method url-fetch)
2581 (uri (string-append
2582 "http://pqxx.org/download/software/libpqxx/"
2583 name "-" version ".tar.gz"))
2584 (sha256
2585 (base32
2586 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
2587 (build-system gnu-build-system)
2588 (native-inputs
2589 `(("python" ,python-2)))
2590 (inputs `(("postgresql" ,postgresql)))
2591 (arguments
2592 `(#:tests? #f ; # FAIL: 1
2593 #:phases
2594 (modify-phases %standard-phases
2595 (add-before 'configure 'fix-sed-command
2596 (lambda _
2597 ;; Newer sed versions error out if double brackets are not used.
2598 (substitute* "configure"
2599 (("\\[:space:\\]") "[[:space:]]"))
2600 #t)))))
2601 (synopsis "C++ connector for PostgreSQL")
2602 (description
2603 "Libpqxx is a C++ library to enable user programs to communicate with the
2604 PostgreSQL database back-end. The database back-end can be local or it may be
2605 on another machine, accessed via TCP/IP.")
2606 (home-page "http://pqxx.org/")
2607 (license license:bsd-3)))
2608
2609 (define-public python-peewee
2610 (package
2611 (name "python-peewee")
2612 (version "3.14.0")
2613 (source
2614 (origin
2615 (method url-fetch)
2616 (uri (pypi-uri "peewee" version))
2617 (sha256
2618 (base32 "1yl49gxrg0c2x3n3r60z3lixw9am8b61s0477l9vjabhhx1yziar"))))
2619 (build-system python-build-system)
2620 (arguments
2621 `(#:tests? #f)) ; fails to import test data
2622 (inputs
2623 `(("sqlite" ,sqlite)))
2624 (native-inputs
2625 `(("python-cython" ,python-cython)))
2626 (home-page "https://github.com/coleifer/peewee/")
2627 (synopsis "Small object-relational mapping utility")
2628 (description
2629 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
2630 handles converting between pythonic values and those used by databases, so you
2631 can use Python types in your code without having to worry. It has built-in
2632 support for sqlite, mysql and postgresql. If you already have a database, you
2633 can autogenerate peewee models using @code{pwiz}, a model generator.")
2634 (license license:expat)))
2635
2636 (define-public python2-peewee
2637 (package-with-python2 python-peewee))
2638
2639 (define-public python-tortoise-orm
2640 (package
2641 (name "python-tortoise-orm")
2642 (version "0.16.21")
2643 (source
2644 (origin
2645 (method url-fetch)
2646 (uri (pypi-uri "tortoise-orm" version))
2647 (sha256
2648 (base32
2649 "1dallk0q8q4v37klm0v3rppf2w8sjkqmypc1w8r9rraqxg1ylacp"))))
2650 (build-system python-build-system)
2651 (arguments
2652 `(#:tests? #f ; Pypi does not have tests and Git snapshot depends on
2653 ; poetry.
2654 #:phases (modify-phases %standard-phases
2655 (add-after 'unpack 'relax-version-requirements
2656 (lambda _
2657 (substitute* "setup.py"
2658 (("pypika>=0\\.44\\.0,<0\\.45\\.0") "pypika")
2659 (("aiosqlite>=0.16.0,<0.17.0") "aiosqlite"))
2660 #t)))))
2661 (native-inputs
2662 `(("python-asynctest" ,python-asynctest)
2663 ("python-nose2" ,python-nose2)))
2664 (propagated-inputs
2665 `(("python-aiosqlite" ,python-aiosqlite)
2666 ("python-pypika" ,python-pypika)
2667 ("python-ciso8601" ,python-ciso8601)
2668 ("python-typing-extensions"
2669 ,python-typing-extensions)))
2670 (home-page
2671 "https://github.com/tortoise/tortoise-orm")
2672 (synopsis
2673 "Easy async ORM for python, built with relations in mind")
2674 (description
2675 "Tortoise ORM is an easy-to-use asyncio ORM (Object Relational Mapper)
2676 inspired by Django. Tortoise ORM was build with relations in mind and
2677 admiration for the excellent and popular Django ORM. It’s engraved in its
2678 design that you are working not with just tables, you work with relational
2679 data.")
2680 (license license:asl2.0)))
2681
2682 (define-public sqlcipher
2683 (package
2684 (name "sqlcipher")
2685 (version "3.4.2")
2686 (source
2687 (origin
2688 (method url-fetch)
2689 (uri (string-append "https://github.com/sqlcipher/" name
2690 "/archive/v" version ".tar.gz"))
2691 (sha256
2692 (base32 "1nxarwbci8jx99f1d0y1ivxcv25s78l1p7q6qy28lkpkcx8pm2b9"))
2693 (file-name (string-append name "-" version ".tar.gz"))))
2694 (build-system gnu-build-system)
2695 (inputs
2696 `(("libcrypto" ,openssl)
2697 ("libtcl8.6" ,tcl))) ; required for running the tests
2698 (native-inputs
2699 `(("tcl" ,tcl)))
2700 (arguments
2701 '(#:configure-flags
2702 '("--enable-tempstore=yes"
2703 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
2704 "LDFLAGS=-lcrypto -ltcl8.6"
2705 "--disable-tcl")
2706 ;; tests cannot be run from the Makefile
2707 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
2708 #:test-target "testfixture"
2709 #:phases
2710 (modify-phases %standard-phases
2711 (add-before 'check 'build-test-runner
2712 (assoc-ref %standard-phases 'check))
2713 (replace 'check
2714 (lambda _
2715 (invoke "./testfixture" "test/crypto.test"))))))
2716 (home-page "https://www.zetetic.net/sqlcipher/")
2717 (synopsis
2718 "Library providing transparent encryption of SQLite database files")
2719 (description "SQLCipher is an implementation of SQLite, extended to
2720 provide transparent 256-bit AES encryption of database files. Pages are
2721 encrypted before being written to disk and are decrypted when read back. It’s
2722 well suited for protecting embedded application databases and for mobile
2723 development.")
2724 ;; The source files
2725 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
2726 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
2727 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
2728 ;; source files are in the public domain.
2729 (license (list license:public-domain license:bsd-3))))
2730
2731 (define-public python-pyodbc-c
2732 (package
2733 (name "python-pyodbc-c")
2734 (version "3.1.4")
2735 (source
2736 (origin
2737 (method url-fetch)
2738 (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
2739 "archive.tar.gz?ref=v" version))
2740 (sha256
2741 (base32
2742 "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
2743 (file-name (string-append name "-" version ".tar.gz"))))
2744 (build-system python-build-system)
2745 (inputs
2746 `(("unixodbc" ,unixodbc)))
2747 (arguments
2748 `(;; No unit tests exist.
2749 #:tests? #f))
2750 (home-page "https://github.com/mkleehammer/pyodbc")
2751 (synopsis "Python ODBC Library")
2752 (description "@code{python-pyodbc-c} provides a Python DB-API driver
2753 for ODBC.")
2754 (license (license:x11-style "file://LICENSE.TXT"))))
2755
2756 (define-public python2-pyodbc-c
2757 (package-with-python2 python-pyodbc-c))
2758
2759 (define-public python-pyodbc
2760 (package
2761 (name "python-pyodbc")
2762 (version "4.0.30")
2763 (source
2764 (origin
2765 (method url-fetch)
2766 (uri (pypi-uri "pyodbc" version))
2767 (sha256
2768 (base32 "0skjpraar6hcwsy82612bpj8nw016ncyvvq88j5syrikxgp5saw5"))
2769 (file-name (string-append name "-" version ".tar.gz"))))
2770 (build-system python-build-system)
2771 (inputs
2772 `(("unixodbc" ,unixodbc)))
2773 (arguments
2774 `(#:tests? #f)) ; no unit tests exist
2775 (home-page "https://github.com/mkleehammer/pyodbc")
2776 (synopsis "Python ODBC Library")
2777 (description "@code{python-pyodbc} provides a Python DB-API driver
2778 for ODBC.")
2779 (license (license:x11-style "file:///LICENSE.TXT"))))
2780
2781 (define-public python2-pyodbc
2782 (package-with-python2 python-pyodbc))
2783
2784 (define-public mdbtools
2785 (package
2786 (name "mdbtools")
2787 (version "0.7.1")
2788 (source
2789 (origin
2790 (method git-fetch)
2791 (uri (git-reference
2792 (url "https://github.com/brianb/mdbtools")
2793 (commit version)))
2794 (file-name (git-file-name name version))
2795 (sha256
2796 (base32
2797 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
2798 (build-system gnu-build-system)
2799 (inputs
2800 `(("glib" ,glib)))
2801 (native-inputs
2802 `(("autoconf" ,autoconf)
2803 ("automake" ,automake)
2804 ("libtool" ,libtool)
2805 ("pkg-config" ,pkg-config)
2806 ("txt2man" ,txt2man)
2807 ("which" ,which)))
2808 (home-page "http://mdbtools.sourceforge.net/")
2809 (synopsis "Read Microsoft Access databases")
2810 (description "MDB Tools is a set of tools and applications to read the
2811 proprietary MDB file format used in Microsoft's Access database package. This
2812 includes programs to export schema and data from Microsoft's Access database
2813 file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
2814 etc., and an SQL engine for performing simple SQL queries.")
2815 (license (list license:lgpl2.0
2816 license:gpl2+))))
2817
2818 (define-public python-lmdb
2819 (package
2820 (name "python-lmdb")
2821 (version "1.0.0")
2822 (source (origin
2823 (method url-fetch)
2824 (uri (pypi-uri "lmdb" version))
2825 (sha256
2826 (base32
2827 "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1"))
2828 (modules '((guix build utils)))
2829 (snippet
2830 ;; Delete bundled lmdb source files.
2831 '(begin
2832 (for-each delete-file (list "lib/lmdb.h"
2833 "lib/mdb.c"
2834 "lib/midl.c"
2835 "lib/midl.h"))
2836 #t))))
2837 (build-system python-build-system)
2838 (inputs
2839 `(("lmdb" ,lmdb)))
2840 (arguments
2841 `(#:phases
2842 (modify-phases %standard-phases
2843 (add-before 'build 'use-system-lmdb
2844 (lambda* (#:key inputs #:allow-other-keys)
2845 (let ((lmdb (assoc-ref inputs "lmdb")))
2846 (setenv "LMDB_PURE" "set") ; don't apply env-copy-txn.patch
2847 (setenv "LMDB_FORCE_SYSTEM" "set")
2848 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
2849 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
2850 #t))))
2851 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
2852 #:tests? #f))
2853 (home-page "https://github.com/dw/py-lmdb")
2854 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
2855 (description
2856 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
2857 Memory-Mapped Database} (LMDB), a high-performance key-value store.")
2858 (license
2859 (list license:openldap2.8
2860 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
2861 ;; but not actually needed on platforms currently supported by Guix.
2862 license:bsd-3))))
2863
2864 (define-public python-orator
2865 (package
2866 (name "python-orator")
2867 (version "0.9.9")
2868 (source (origin
2869 (method url-fetch)
2870 (uri (pypi-uri "orator" version))
2871 (sha256
2872 (base32
2873 "0mbgybz63ryhr9p1f4glnls5c57jp6il3dw0kf97f3pj80687rvg"))))
2874 (build-system python-build-system)
2875 ;; FIXME: Tests are not distributed with PyPI, and the repository
2876 ;; does not contain setup.py. How to test?
2877 (arguments '(#:tests? #f))
2878 (propagated-inputs
2879 `(("python-backpack" ,python-backpack)
2880 ("python-blinker" ,python-blinker)
2881 ("python-cleo" ,python-cleo)
2882 ("python-faker" ,python-faker)
2883 ("python-inflection" ,python-inflection)
2884 ("python-lazy-object-proxy" ,python-lazy-object-proxy)
2885 ("python-pendulum" ,python-pendulum)
2886 ("python-pyaml" ,python-pyaml)
2887 ("python-pygments" ,python-pygments)
2888 ("python-pyyaml" ,python-pyyaml)
2889 ("python-simplejson" ,python-simplejson)
2890 ("python-six" ,python-six)
2891 ("python-wrapt" ,python-wrapt)))
2892 (home-page "https://orator-orm.com/")
2893 (synopsis "ActiveRecord ORM for Python")
2894 (description
2895 "Orator provides a simple ActiveRecord-like Object Relational Mapping
2896 implementation for Python.")
2897 (license license:expat)
2898 (properties `((python2-variant . ,(delay python2-orator))))))
2899
2900 (define-public python2-orator
2901 (package-with-python2 (strip-python2-variant python-orator)))
2902
2903 (define-public virtuoso-ose
2904 (package
2905 (name "virtuoso-ose")
2906 (version "7.2.5")
2907 (source
2908 (origin
2909 (method url-fetch)
2910 (uri (string-append
2911 "https://github.com/openlink/virtuoso-opensource/releases/"
2912 "download/v" version "/virtuoso-opensource-" version ".tar.gz"))
2913 (sha256
2914 (base32 "0r1xakclkfi69pzh8z2k16z3x0m49pxp764icj0ad4w4bb97fr42"))))
2915 (build-system gnu-build-system)
2916 (arguments
2917 `(#:tests? #f ; Tests require a network connection.
2918 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
2919 ;; This indicates that the internal zlib code may still be used.
2920 #:configure-flags '("--without-internal-zlib"
2921 "--with-readline"
2922 "--enable-static=no")
2923 #:phases
2924 (modify-phases %standard-phases
2925 ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in
2926 ;; the build output. The following phase removes it.
2927 (add-after 'install 'remove-static-libs
2928 (lambda* (#:key outputs #:allow-other-keys)
2929 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2930 (for-each (lambda (file)
2931 (delete-file (string-append lib "/" file)))
2932 '("libvirtuoso-t.a"
2933 "libvirtuoso-t.la"))))))))
2934 (inputs
2935 `(("openssl" ,openssl-1.0)
2936 ("net-tools" ,net-tools)
2937 ("readline" ,readline)
2938 ("zlib" ,zlib)))
2939 (home-page "http://vos.openlinksw.com/owiki/wiki/VOS/")
2940 (synopsis "Multi-model database system")
2941 (description "Virtuoso is a scalable cross-platform server that combines
2942 relational, graph, and document data management with web application server
2943 and web services platform functionality.")
2944 ;; configure: error: ... can only be build on 64bit platforms
2945 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))
2946 (license license:gpl2)))
2947
2948 (define-public python-ccm
2949 (package
2950 (name "python-ccm")
2951 (version "2.1.6")
2952 (source
2953 (origin
2954 (method url-fetch)
2955 (uri (pypi-uri "ccm" version))
2956 (sha256
2957 (base32
2958 "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n"))))
2959 (build-system python-build-system)
2960 (propagated-inputs
2961 `(("python-pyyaml" ,python-pyyaml)
2962 ;; Not listed in setup.py, but used in ccmlib/node.py for full
2963 ;; functionality
2964 ("python-psutil" ,python-psutil)
2965 ("python-six" ,python-six)))
2966 (home-page "https://github.com/pcmanus/ccm")
2967 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
2968 localhost")
2969 (description "Cassandra Cluster Manager is a development tool for testing
2970 local Cassandra clusters. It creates, launches and removes Cassandra clusters
2971 on localhost.")
2972 (license license:asl2.0)))
2973
2974 (define-public python2-ccm
2975 (package-with-python2 python-ccm))
2976
2977 (define-public python2-pysqlite
2978 (package
2979 (name "python2-pysqlite")
2980 (version "2.8.3")
2981 (source
2982 (origin
2983 (method url-fetch)
2984 (uri (pypi-uri "pysqlite" version))
2985 (sha256
2986 (base32
2987 "1424gwq9sil2ffmnizk60q36vydkv8rxs6m7xs987kz8cdc37lqp"))))
2988 (build-system python-build-system)
2989 (inputs
2990 `(("sqlite" ,sqlite)))
2991 (arguments
2992 `(#:python ,python-2 ; incompatible with Python 3
2993 #:tests? #f)) ; no test target
2994 (home-page "https://github.com/ghaering/pysqlite")
2995 (synopsis "SQLite bindings for Python")
2996 (description
2997 "Pysqlite provides SQLite bindings for Python that comply to the
2998 Database API 2.0T.")
2999 (license license:zlib)))
3000
3001 (define-public python-sqlalchemy
3002 (package
3003 (name "python-sqlalchemy")
3004 (version "1.3.20")
3005 (source
3006 (origin
3007 (method url-fetch)
3008 (uri (pypi-uri "SQLAlchemy" version))
3009 (sha256
3010 (base32 "18b9am7bsqc4nj3d2h5r93i002apczxfvpfpcqbd6f0385zmrwnj"))))
3011 (build-system python-build-system)
3012 (native-inputs
3013 `(("python-cython" ,python-cython) ; for C extensions
3014 ("python-pytest" ,python-pytest)
3015 ("python-mock" ,python-mock))) ; for tests
3016 (arguments
3017 `(#:phases
3018 (modify-phases %standard-phases
3019 (replace 'check
3020 (lambda _ (invoke "py.test"))))))
3021 (home-page "https://www.sqlalchemy.org")
3022 (synopsis "Database abstraction library")
3023 (description
3024 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
3025 gives application developers the full power and flexibility of SQL. It
3026 provides a full suite of well known enterprise-level persistence patterns,
3027 designed for efficient and high-performing database access, adapted into a
3028 simple and Pythonic domain language.")
3029 (license license:x11)))
3030
3031 (define-public python2-sqlalchemy
3032 (package-with-python2 python-sqlalchemy))
3033
3034 (define-public python-sqlalchemy-utils
3035 (package
3036 (name "python-sqlalchemy-utils")
3037 (version "0.32.21")
3038 (source
3039 (origin
3040 (method url-fetch)
3041 (uri (pypi-uri "SQLAlchemy-Utils" version))
3042 (sha256
3043 (base32
3044 "1myn71dn8j74xglyh46f12sh8ywb7j0j732rzwq70kvwwnq32m73"))))
3045 (build-system python-build-system)
3046 (arguments
3047 '(#:tests? #f)) ; FIXME: Many tests require a running database server.
3048 ;; #:phases
3049 ;; (modify-phases %standard-phases
3050 ;; (replace 'check
3051 ;; (lambda _
3052 ;; (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
3053 (propagated-inputs
3054 `(("python-six" ,python-six)
3055 ("python-sqlalchemy" ,python-sqlalchemy)))
3056 (native-inputs
3057 `(("python-dateutil" ,python-dateutil)
3058 ("python-flexmock" ,python-flexmock)
3059 ("python-psycopg2" ,python-psycopg2)
3060 ("python-pytest" ,python-pytest)
3061 ("python-pytz" ,python-pytz)))
3062 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
3063 (synopsis "Various utility functions for SQLAlchemy")
3064 (description
3065 "SQLAlchemy-utils provides various utility functions and custom data types
3066 for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
3067
3068 You might also want to install the following optional dependencies:
3069 @enumerate
3070 @item @code{python-passlib}
3071 @item @code{python-babel}
3072 @item @code{python-cryptography}
3073 @item @code{python-pytz}
3074 @item @code{python-psycopg2}
3075 @item @code{python-furl}
3076 @item @code{python-flask-babel}
3077 @end enumerate
3078 ")
3079 (license license:bsd-3)))
3080
3081 (define-public python2-sqlalchemy-utils
3082 (package-with-python2 python-sqlalchemy-utils))
3083
3084 (define-public python-alchemy-mock
3085 (package
3086 (name "python-alchemy-mock")
3087 (version "0.4.3")
3088 (home-page "https://github.com/miki725/alchemy-mock")
3089 (source (origin
3090 (method url-fetch)
3091 (uri (pypi-uri "alchemy-mock" version))
3092 (sha256
3093 (base32
3094 "0ylxygl3bcdapzz529n8wgk7vx9gjwb3ism564ypkpd7dbsw653r"))))
3095 (build-system python-build-system)
3096 (arguments
3097 '(#:phases (modify-phases %standard-phases
3098 (replace 'check
3099 (lambda _
3100 ;; Create pytest.ini that adds doctest options to
3101 ;; prevent test failure. Taken from tox.ini.
3102 (call-with-output-file "pytest.ini"
3103 (lambda (port)
3104 (format port "[pytest]
3105 doctest_optionflags=IGNORE_EXCEPTION_DETAIL
3106 ")))
3107 (invoke "pytest" "-vv" "--doctest-modules"
3108 "alchemy_mock/"))))))
3109 (native-inputs
3110 `(("python-mock" ,python-mock)
3111 ("python-pytest" ,python-pytest)))
3112 (propagated-inputs
3113 `(("python-six" ,python-six)
3114 ("python-sqlalchemy" ,python-sqlalchemy)))
3115 (synopsis "Mock helpers for SQLAlchemy")
3116 (description
3117 "This package provides mock helpers for SQLAlchemy that makes it easy
3118 to mock an SQLAlchemy session while preserving the ability to do asserts.
3119
3120 Normally Normally SQLAlchemy's expressions cannot be easily compared as
3121 comparison on binary expression produces yet another binary expression, but
3122 this library provides functions to facilitate such comparisons.")
3123 (license license:expat)))
3124
3125 (define-public python-alembic
3126 (package
3127 (name "python-alembic")
3128 (version "1.4.3")
3129 (source
3130 (origin
3131 (method url-fetch)
3132 (uri (pypi-uri "alembic" version))
3133 (sha256
3134 (base32 "0if2dgb088clk738p26bwk50735h6jpd2kacdgc5capv2hiz6d2k"))))
3135 (build-system python-build-system)
3136 (arguments
3137 '(#:phases (modify-phases %standard-phases
3138 (replace 'check
3139 (lambda _
3140 (invoke "pytest" "-vv"))))))
3141 (native-inputs
3142 `(("python-mock" ,python-mock)
3143 ("python-pytest-cov" ,python-pytest-cov)))
3144 (propagated-inputs
3145 `(("python-dateutil" ,python-dateutil)
3146 ("python-sqlalchemy" ,python-sqlalchemy)
3147 ("python-mako" ,python-mako)
3148 ("python-editor" ,python-editor)))
3149 (home-page "https://bitbucket.org/zzzeek/alembic")
3150 (synopsis "Database migration tool for SQLAlchemy")
3151 (description
3152 "Alembic is a lightweight database migration tool for usage with the
3153 SQLAlchemy Database Toolkit for Python.")
3154 (license license:expat)))
3155
3156 (define-public python2-alembic
3157 (package-with-python2 python-alembic))
3158
3159 (define-public python-pickleshare
3160 (package
3161 (name "python-pickleshare")
3162 (version "0.7.5")
3163 (source
3164 (origin
3165 (method url-fetch)
3166 (uri (pypi-uri "pickleshare" version))
3167 (sha256
3168 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
3169 (build-system python-build-system)
3170 (arguments
3171 `(#:phases (modify-phases %standard-phases
3172 (replace 'check
3173 (lambda _
3174 (invoke "pytest"))))))
3175 (native-inputs
3176 `(("python-pytest" ,python-pytest)))
3177 (home-page "https://github.com/vivainio/pickleshare")
3178 (synopsis "Tiny key value database with concurrency support")
3179 (description
3180 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
3181 Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
3182 shelve, many processes can access the database simultaneously. Changing a
3183 value in database is immediately visible to other processes accessing the same
3184 database. Concurrency is possible because the values are stored in separate
3185 files. Hence the “database” is a directory where all files are governed by
3186 PickleShare.")
3187 (properties `((python2-variant . ,(delay python2-pickleshare))))
3188 (license license:expat)))
3189
3190 (define-public python2-pickleshare
3191 (let ((pickleshare (package-with-python2
3192 (strip-python2-variant python-pickleshare))))
3193 (package (inherit pickleshare)
3194 (propagated-inputs `(("python2-pathlib2" ,python2-pathlib2)
3195 ,@(package-propagated-inputs pickleshare))))))
3196
3197 (define-public python-apsw
3198 (package
3199 (name "python-apsw")
3200 (version "3.31.1-r1")
3201 (source
3202 (origin
3203 (method url-fetch)
3204 (uri (string-append "https://github.com/rogerbinns/apsw/releases"
3205 "/download/" version "/apsw-" version ".zip"))
3206 (sha256
3207 (base32
3208 "1gap5lr6c7bp134nzvfwr693i6d0fqyaysg3ms2cayjldv616yfx"))))
3209 (build-system python-build-system)
3210 (native-inputs
3211 `(("unzip" ,unzip)))
3212 (inputs
3213 `(("sqlite" ,sqlite)))
3214 (arguments
3215 `(#:phases
3216 (modify-phases %standard-phases
3217 (replace 'build
3218 (lambda _
3219 (invoke "python" "setup.py" "build" "--enable-all-extensions")
3220 #t))
3221 (add-after 'build 'build-test-helper
3222 (lambda _
3223 (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext"
3224 "-I." "-Isqlite3" "src/testextension.c")
3225 #t))
3226 (replace 'check
3227 (lambda* (#:key inputs outputs #:allow-other-keys)
3228 (add-installed-pythonpath inputs outputs)
3229 (invoke "python" "setup.py" "test")
3230 #t)))))
3231 (home-page "https://github.com/rogerbinns/apsw/")
3232 (synopsis "Another Python SQLite Wrapper")
3233 (description "APSW is a Python wrapper for the SQLite
3234 embedded relational database engine. In contrast to other wrappers such as
3235 pysqlite it focuses on being a minimal layer over SQLite attempting just to
3236 translate the complete SQLite API into Python.")
3237 (license license:zlib)))
3238
3239 (define-public python2-apsw
3240 (package-with-python2 python-apsw))
3241
3242 (define-public python-aiosqlite
3243 (package
3244 (name "python-aiosqlite")
3245 (version "0.17.0")
3246 (source
3247 (origin
3248 (method url-fetch)
3249 (uri (pypi-uri "aiosqlite" version))
3250 (sha256
3251 (base32
3252 "0lgfpbkcd730hbgj3zlrbx2y8fzvdns2zj3s4r4l31n49g1arrph"))))
3253 (build-system python-build-system)
3254 (arguments
3255 '(#:phases (modify-phases %standard-phases
3256 (replace 'check
3257 (lambda* (#:key tests? #:allow-other-keys)
3258 (if tests?
3259 (invoke "python" "-m" "unittest" "aiosqlite.tests")
3260 (format #t "test suite not run~%"))
3261 #t)))))
3262 (propagated-inputs
3263 `(("python-typing-extensions" ,python-typing-extensions)))
3264 (native-inputs
3265 `(("python-aiounittest" ,python-aiounittest)))
3266 (home-page "https://github.com/jreese/aiosqlite")
3267 (synopsis
3268 "Asyncio bridge for sqlite3")
3269 (description
3270 "The package aiosqlite replicates the standard sqlite3 module, but with
3271 async versions of all the standard connection and cursor methods, and context
3272 managers for automatically closing connections.")
3273 (license license:expat)))
3274
3275 (define-public python2-neo4j-driver
3276 (package
3277 (name "python2-neo4j-driver")
3278 ;; NOTE: When upgrading to 1.5.0, please add a python3 variant.
3279 (version "1.4.0")
3280 (source (origin
3281 (method url-fetch)
3282 (uri (pypi-uri "neo4j-driver" version))
3283 (sha256
3284 (base32
3285 "011r1vh182p8mm83d8dz9rfnc3l7rf7fd00cyrbyfzi71jmc4g98"))))
3286 (build-system python-build-system)
3287 (arguments
3288 `(#:python ,python-2))
3289 (home-page "https://neo4j.com/developer/python/")
3290 (synopsis "Neo4j driver code written in Python")
3291 (description "This package provides the Neo4j Python driver that connects
3292 to the database using Neo4j's binary protocol. It aims to be minimal, while
3293 being idiomatic to Python.")
3294 (license license:asl2.0)))
3295
3296 (define-public python2-py2neo
3297 (package
3298 (name "python2-py2neo")
3299 (version "3.1.2")
3300 (source (origin
3301 (method url-fetch)
3302 (uri (pypi-uri "py2neo" version))
3303 (sha256
3304 (base32
3305 "1f1q95vqcvlc3nsc33p841swnjdcjazddlq2dzi3qfnjqjrajxw1"))))
3306 (build-system python-build-system)
3307 (arguments
3308 `(#:python ,python-2))
3309 (home-page "https://py2neo.org")
3310 (synopsis "Library and toolkit for working with Neo4j in Python")
3311 (description "This package provides a client library and toolkit for
3312 working with Neo4j from within Python applications and from the command
3313 line. The core library has no external dependencies and has been carefully
3314 designed to be easy and intuitive to use.")
3315 (license license:asl2.0)))
3316
3317 (define-public python-psycopg2
3318 (package
3319 (name "python-psycopg2")
3320 (version "2.8.6")
3321 (source
3322 (origin
3323 (method url-fetch)
3324 (uri (pypi-uri "psycopg2" version))
3325 (sha256
3326 (base32 "0hzmk6b1hb5riqkljr5xics6p4zbvmis6knbczb7zhq7273zc8zv"))))
3327 (build-system python-build-system)
3328 (arguments
3329 ;; Tests would require a postgresql database "psycopg2_test"
3330 ;; and a running postgresql database management service.
3331 `(#:tests? #f)) ; TODO re-enable after providing a test-db.
3332 (inputs
3333 `(("postgresql" ,postgresql))) ; libpq
3334 (home-page "http://initd.org/psycopg/")
3335 (synopsis "Python PostgreSQL adapter")
3336 (description
3337 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
3338 2.0.")
3339 (license license:lgpl3+)))
3340
3341 (define-public python2-psycopg2
3342 (package-with-python2 python-psycopg2))
3343
3344 (define-public python-sadisplay
3345 (package
3346 (name "python-sadisplay")
3347 (version "0.4.8")
3348 (source
3349 (origin
3350 (method url-fetch)
3351 (uri (pypi-uri "sadisplay" version))
3352 (sha256
3353 (base32
3354 "01d9lxhmgpb68gy8rd6zj6fcwp84n2qq210n1qsk3qbsir79bzh4"))))
3355 (build-system python-build-system)
3356 (propagated-inputs
3357 `(("python-sqlalchemy" ,python-sqlalchemy)))
3358 (native-inputs
3359 ;; For tests.
3360 `(("python-nose" ,python-nose)))
3361 (home-page "https://bitbucket.org/estin/sadisplay")
3362 (synopsis "SQLAlchemy schema displayer")
3363 (description "This package provides a program to build Entity
3364 Relationship diagrams from a SQLAlchemy model (or directly from the
3365 database).")
3366 (license license:bsd-3)))
3367
3368 (define-public python2-sadisplay
3369 (package-with-python2 python-sadisplay))
3370
3371 (define-public yoyo-migrations
3372 (package
3373 (name "yoyo-migrations")
3374 (version "7.2.0")
3375 (source
3376 (origin
3377 ;; We use the upstream repository, as the tests are not included in the
3378 ;; PyPI releases.
3379 (method hg-fetch)
3380 (uri (hg-reference
3381 (url "https://hg.sr.ht/~olly/yoyo")
3382 (changeset (string-append "v" version "-release"))))
3383 (file-name (string-append name "-" version "-checkout"))
3384 (sha256
3385 (base32 "0q2z9bgdj3wyix7yvqsayfs21grp5av8ilh411lgmjhigszkvhcq"))))
3386 (build-system python-build-system)
3387 (arguments
3388 ;; XXX: Tests require a connection to some pgsql database and psycopg
3389 ;; fails to connect to it.
3390 '(#:tests? #f))
3391 (propagated-inputs
3392 `(("python-sqlparse" ,python-sqlparse)
3393 ("python-tabulate" ,python-tabulate)))
3394 (home-page "https://ollycope.com/software/yoyo/latest/")
3395 (synopsis "Database migrations with SQL")
3396 (description
3397 "Yoyo is a database schema migration tool. Migrations are written as SQL
3398 files or Python scripts that define a list of migration steps.")
3399 (license license:asl2.0)))
3400
3401 (define-public python-mysqlclient
3402 (package
3403 (name "python-mysqlclient")
3404 (version "2.0.1")
3405 (source
3406 (origin
3407 (method url-fetch)
3408 (uri (pypi-uri "mysqlclient" version))
3409 (sha256
3410 (base32
3411 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
3412 (build-system python-build-system)
3413 (arguments '(#:tests? #f)) ;XXX: requires a live database
3414 (inputs
3415 `(("mysql-dev" ,mariadb "dev")))
3416 (home-page "https://github.com/PyMySQL/mysqlclient-python")
3417 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
3418 (description "MySQLdb is an interface to the popular MySQL database server
3419 for Python. The design goals are:
3420 @enumerate
3421 @item Compliance with Python database API version 2.0 [PEP-0249],
3422 @item Thread-safety,
3423 @item Thread-friendliness (threads will not block each other).
3424 @end enumerate")
3425 (license license:gpl2)))
3426
3427 (define-public python-hiredis
3428 (package
3429 (name "python-hiredis")
3430 (version "0.2.0")
3431 (source
3432 (origin
3433 (method url-fetch)
3434 (uri (pypi-uri "hiredis" version))
3435 (sha256
3436 (base32
3437 "1dfm2k9l9zar9nw9fwmm74zrgraxdxs04vx9li56fjcf289qx5fa"))))
3438 (build-system python-build-system)
3439 (arguments
3440 ;; no tests
3441 `(#:tests? #f))
3442 (home-page "https://github.com/redis/hiredis-py")
3443 (synopsis "Python extension that wraps protocol parsing code in hiredis")
3444 (description "Python-hiredis is a python extension that wraps protocol
3445 parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
3446 (license license:bsd-3)))
3447
3448 (define-public python2-hiredis
3449 (package-with-python2 python-hiredis))
3450
3451 (define-public python-fakeredis
3452 (package
3453 (name "python-fakeredis")
3454 (version "1.2.1")
3455 (source
3456 (origin
3457 (method url-fetch)
3458 (uri (pypi-uri "fakeredis" version))
3459 (sha256
3460 (base32
3461 "1s12mn4q4hz7402139khn9fx56kibj7nn0d6w81hn0zs07b90wpc"))))
3462 (build-system python-build-system)
3463 (arguments
3464 ;; no tests
3465 `(#:tests? #f))
3466 (propagated-inputs
3467 `(("python-sortedcontainers" ,python-sortedcontainers)))
3468 (home-page "https://github.com/jamesls/fakeredis")
3469 (synopsis "Fake implementation of redis API for testing purposes")
3470 (description
3471 "Fakeredis is a pure-Python implementation of the redis-py Python client
3472 that simulates talking to a redis server. It was created for a single purpose:
3473 to write unit tests.
3474
3475 Setting up redis is not hard, but one often wants to write unit tests that don't
3476 talk to an external server such as redis. This module can be used as a
3477 reasonable substitute.")
3478 (license license:bsd-3)))
3479
3480 (define-public python2-fakeredis
3481 (package-with-python2 python-fakeredis))
3482
3483 (define-public python-redis
3484 (package
3485 (name "python-redis")
3486 (version "3.5.3")
3487 (source
3488 (origin
3489 (method url-fetch)
3490 (uri (pypi-uri "redis" version))
3491 (sha256
3492 (base32 "18h5b87g15x3j6pb1h2q27ri37p2qpvc9n2wgn5yl3b6m3y0qzhf"))))
3493 (build-system python-build-system)
3494 ;; Tests require a running Redis server.
3495 (arguments '(#:tests? #f))
3496 ;; As long as we are not running test, we do not need this input :-)
3497 ;;(native-inputs
3498 ;; `(("python-pytest" ,python-pytest)))
3499 (home-page "https://github.com/andymccurdy/redis-py")
3500 (synopsis "Redis Python client")
3501 (description
3502 "This package provides a Python interface to the Redis key-value store.")
3503 (license license:expat)))
3504
3505 (define-public python2-redis
3506 (package-with-python2 python-redis))
3507
3508 (define-public python-rq
3509 (package
3510 (name "python-rq")
3511 (version "1.5.2")
3512 (source
3513 (origin
3514 (method git-fetch)
3515 (uri (git-reference
3516 (url "https://github.com/rq/rq")
3517 (commit (string-append "v" version))))
3518 (file-name (git-file-name name version))
3519 (sha256
3520 (base32 "0ikqmpq0g1qiqwd7ar1286l4hqjb6aj2wr844gihhb8ijzwhp8va"))))
3521 (build-system python-build-system)
3522 (arguments
3523 '(#:phases (modify-phases %standard-phases
3524 (add-before 'check 'start-redis
3525 (lambda _
3526 (invoke "redis-server" "--daemonize" "yes")))
3527 (replace 'check
3528 (lambda* (#:key outputs #:allow-other-keys)
3529 (let ((out (assoc-ref outputs "out")))
3530 ;; Drop test that needs the SDK for Sentry.io.
3531 (delete-file "tests/test_sentry.py")
3532 ;; Ensure 'rq' and 'rqworker' ends up on PATH.
3533 (setenv "PATH" (string-append out "/bin:"
3534 (getenv "PATH")))
3535 (invoke "pytest" "-vv")))))))
3536 (native-inputs
3537 `(("python-mock" ,python-mock)
3538 ("python-pytest" ,python-pytest)
3539 ("redis" ,redis)))
3540 (propagated-inputs
3541 `(("python-click" ,python-click)
3542 ("python-redis" ,python-redis)))
3543 (home-page "https://python-rq.org/")
3544 (synopsis "Simple job queues for Python")
3545 (description
3546 "RQ (Redis Queue) is a simple Python library for queueing jobs and
3547 processing them in the background with workers. It is backed by Redis and it
3548 is designed to have a low barrier to entry.")
3549 (license license:bsd-2)))
3550
3551 (define-public python2-rq
3552 (package-with-python2 python-rq))
3553
3554 (define-public python-rq-scheduler
3555 (package
3556 (name "python-rq-scheduler")
3557 (version "0.10.0")
3558 (home-page "https://github.com/rq/rq-scheduler")
3559 (source (origin
3560 (method git-fetch)
3561 (uri (git-reference
3562 (url home-page)
3563 (commit (string-append "v" version))))
3564 (file-name (git-file-name name version))
3565 (sha256
3566 (base32
3567 "0xg6yazqs5kbr2ayvhvljs1h5vgx5k5dds613fmhswln7gglf9hk"))))
3568 (build-system python-build-system)
3569 (arguments
3570 '(#:phases (modify-phases %standard-phases
3571 (add-before 'check 'start-redis
3572 (lambda _
3573 (invoke "redis-server" "--daemonize" "yes")))
3574 (replace 'check
3575 (lambda _
3576 (substitute* "run_tests.py"
3577 (("/usr/bin/env")
3578 (which "env")))
3579 (invoke "./run_tests.py"))))))
3580 (native-inputs
3581 `(("redis" ,redis)
3582 ("which" ,which)))
3583 (propagated-inputs
3584 `(("python-croniter" ,python-croniter)
3585 ("python-rq" ,python-rq)))
3586 (synopsis "Job scheduling capabilities for RQ (Redis Queue)")
3587 (description
3588 "This package provides job scheduling capabilities to @code{python-rq}
3589 (Redis Queue).")
3590 (license license:expat)))
3591
3592 (define-public python-trollius-redis
3593 (package
3594 (name "python-trollius-redis")
3595 (version "0.1.4")
3596 (source
3597 (origin
3598 (method url-fetch)
3599 (uri (pypi-uri "trollius_redis" version))
3600 (sha256
3601 (base32
3602 "0k3vypszmgmaipgw9xscvgm79h2zd6p6ci8gdp5sxl6g5kbqr9fy"))))
3603 (build-system python-build-system)
3604 ;; TODO: Tests require packaging 'hiredis'.
3605 (arguments '(#:tests? #f))
3606 (home-page "https://github.com/benjolitz/trollius-redis")
3607 (synopsis "Port of asyncio-redis to trollius")
3608 (description "@code{trollius-redis} is a Redis client for Python
3609 trollius. It is an asynchronous IO (PEP 3156) implementation of the
3610 Redis protocol.")
3611 (license license:bsd-2)))
3612
3613 (define-public python2-trollius-redis
3614 (package-with-python2 python-trollius-redis))
3615
3616 (define-public python-sqlparse
3617 (package
3618 (name "python-sqlparse")
3619 (version "0.3.1")
3620 (source (origin
3621 (method url-fetch)
3622 (uri (pypi-uri "sqlparse" version))
3623 (sha256
3624 (base32
3625 "0j652a6z7bdf6c77aczfn8m8b2nsr1bcqq48wzghf8vi6wvj0qp1"))))
3626 (build-system python-build-system)
3627 (arguments
3628 `(#:phases
3629 (modify-phases %standard-phases
3630 (replace 'check
3631 (lambda _ (invoke "py.test"))))))
3632 (native-inputs
3633 `(("python-pytest" ,python-pytest)))
3634 (home-page "https://github.com/andialbrecht/sqlparse")
3635 (synopsis "Non-validating SQL parser")
3636 (description "Sqlparse is a non-validating SQL parser for Python. It
3637 provides support for parsing, splitting and formatting SQL statements.")
3638 (license license:bsd-3)))
3639
3640 (define-public python2-sqlparse
3641 (package-with-python2 python-sqlparse))
3642
3643 (define-public python-sql
3644 (package
3645 (name "python-sql")
3646 (version "1.0.0")
3647 (source
3648 (origin
3649 (method url-fetch)
3650 (uri (pypi-uri "python-sql" version))
3651 (sha256
3652 (base32 "05ni936y0ia9xmryl7mlhbj9i80nnvq1bi4zxhb96rv7yvpb3fqb"))))
3653 (build-system python-build-system)
3654 (home-page "https://python-sql.tryton.org/")
3655 (synopsis "Library to write SQL queries in a pythonic way")
3656 (description "@code{python-sql} is a library to write SQL queries, that
3657 transforms idiomatic python function calls to well-formed SQL queries.")
3658 (license license:bsd-3)))
3659
3660 (define-public python2-sql
3661 (package-with-python2 python-sql))
3662
3663 (define-public python-pypika
3664 (package
3665 (name "python-pypika")
3666 (version "0.47.6")
3667 (source
3668 (origin (method git-fetch)
3669 (uri (git-reference
3670 (url "https://github.com/kayak/pypika")
3671 (commit (string-append "v" version))))
3672 (file-name (git-file-name name version))
3673 (sha256
3674 (base32
3675 "001pg36sw9a36zdd1kccbymcxndphjcjbbrsy6ri7ng8h4dgz549"))))
3676 (build-system python-build-system)
3677 (native-inputs
3678 `(("python-parameterized" ,python-parameterized)))
3679 (home-page "https://github.com/kayak/pypika")
3680 (synopsis "SQL query builder API for Python")
3681 (description
3682 "PyPika is a python SQL query builder that exposes the full richness of
3683 the SQL language using a syntax that reflects the resulting query.")
3684 (license license:asl2.0)))
3685
3686 (define-public mongo-tools
3687 (package
3688 (name "mongo-tools")
3689 (version "3.4.0")
3690 (source
3691 (origin (method git-fetch)
3692 (uri (git-reference
3693 (url "https://github.com/mongodb/mongo-tools")
3694 (commit (string-append "r" version))))
3695 (file-name (git-file-name name version))
3696 (sha256
3697 (base32
3698 "1bcsz5cvj39a7nsxsfqmz9igrw33j6yli9kffigqyscs52amw7x1"))))
3699 (build-system go-build-system)
3700 (arguments
3701 `(#:import-path "github.com/mongodb/mongo-tools"
3702 #:modules ((srfi srfi-1)
3703 (guix build go-build-system)
3704 (guix build utils))
3705 #:install-source? #f
3706 #:phases
3707 (let ((all-tools
3708 '("bsondump" "mongodump" "mongoexport" "mongofiles"
3709 "mongoimport" "mongooplog" "mongorestore"
3710 "mongostat" "mongotop")))
3711 (modify-phases %standard-phases
3712 (add-after 'unpack 'delete-bundled-source-code
3713 (lambda _
3714 (delete-file-recursively
3715 "src/github.com/mongodb/mongo-tools/vendor")
3716 #t))
3717 (add-after 'delete-bundled-source-code 'patch-source
3718 (lambda _
3719 ;; Remove a redundant argument that causes compilation to fail.
3720 (substitute*
3721 "src/github.com/mongodb/mongo-tools/mongorestore/filepath.go"
3722 (("skipping restore of system.profile collection\", db)")
3723 "skipping restore of system.profile collection\")"))
3724 #t))
3725 (replace 'build
3726 (lambda _
3727 (for-each (lambda (tool)
3728 (let ((command
3729 `("go" "build"
3730 ;; This is where the tests expect to find the
3731 ;; executables
3732 "-o" ,(string-append
3733 "src/github.com/mongodb/mongo-tools/bin/"
3734 tool)
3735 "-v"
3736 "-tags=\"ssl sasl\""
3737 "-ldflags"
3738 "-extldflags=-Wl,-z,now,-z,relro"
3739 ,(string-append
3740 "src/github.com/mongodb/mongo-tools/"
3741 tool "/main/" tool ".go"))))
3742 (simple-format #t "build: running ~A\n"
3743 (string-join command))
3744 (apply invoke command)))
3745 all-tools)
3746 #t))
3747 (replace 'check
3748 (lambda _
3749 (with-directory-excursion "src"
3750 (for-each (lambda (tool)
3751 (invoke
3752 "go" "test" "-v"
3753 (string-append "github.com/mongodb/mongo-tools/"
3754 tool)))
3755 all-tools))
3756 #t))
3757 (replace 'install
3758 (lambda* (#:key outputs #:allow-other-keys)
3759 (for-each (lambda (tool)
3760 (install-file
3761 (string-append "src/github.com/mongodb/mongo-tools/bin/"
3762 tool)
3763 (string-append (assoc-ref outputs "out")
3764 "/bin")))
3765 all-tools)
3766 #t))))))
3767 (native-inputs
3768 `(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
3769 ("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)
3770 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
3771 ("go-gopkg.in-mgo.v2" ,go-gopkg.in-mgo.v2)
3772 ("go-gopkg.in-tomb.v2" ,go-gopkg.in-tomb.v2)
3773 ("go-github.com-nsf-termbox-go" ,go-github.com-nsf-termbox-go)
3774 ("go-github.com-smartystreets-goconvey" ,go-github.com-smartystreets-goconvey)))
3775 (home-page "https://github.com/mongodb/mongo-tools")
3776 (synopsis "Various tools for interacting with MongoDB and BSON")
3777 (description
3778 "This package includes a collection of tools related to MongoDB.
3779 @table @code
3780 @item bsondump
3781 Display BSON files in a human-readable format
3782 @item mongoimport
3783 Convert data from JSON, TSV or CSV and insert them into a collection
3784 @item mongoexport
3785 Write an existing collection to CSV or JSON format
3786 @item mongodump/mongorestore
3787 Dump MongoDB backups to disk in the BSON format
3788 @item mongorestore
3789 Read MongoDB backups in the BSON format, and restore them to a live database
3790 @item mongostat
3791 Monitor live MongoDB servers, replica sets, or sharded clusters
3792 @item mongofiles
3793 Read, write, delete, or update files in GridFS
3794 @item mongooplog
3795 Replay oplog entries between MongoDB servers
3796 @item mongotop
3797 Monitor read/write activity on a mongo server
3798 @end table")
3799 (license license:asl2.0)))
3800
3801 ;; There are many wrappers for this in other languages. When touching, please
3802 ;; be sure to ensure all dependencies continue to build.
3803 (define-public apache-arrow
3804 (package
3805 (name "apache-arrow")
3806 (version "3.0.0")
3807 (source
3808 (origin
3809 (method git-fetch)
3810 (uri (git-reference
3811 (url "https://github.com/apache/arrow")
3812 (commit (string-append "apache-arrow-" version))))
3813 (file-name (git-file-name name version))
3814 (sha256
3815 (base32
3816 "03ngddh3r1g6f9aja2jlfksgvgyzmxmfy4bxvzjrcv5fvl5x8ii0"))))
3817 (build-system cmake-build-system)
3818 (arguments
3819 `(#:tests? #f
3820 #:phases
3821 (modify-phases %standard-phases
3822 (add-before 'configure 'enter-source-directory
3823 (lambda _ (chdir "cpp") #t))
3824 (add-after 'unpack 'set-env
3825 (lambda _
3826 (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
3827 (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
3828 (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
3829 (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson"))
3830 #t)))
3831 #:build-type "Release"
3832 #:configure-flags
3833 (list "-DARROW_PYTHON=ON"
3834 "-DARROW_GLOG=ON"
3835 ;; Parquet options
3836 "-DARROW_PARQUET=ON"
3837 "-DPARQUET_BUILD_EXECUTABLES=ON"
3838 ;; The maintainers disallow using system versions of
3839 ;; jemalloc:
3840 ;; https://issues.apache.org/jira/browse/ARROW-3507. This
3841 ;; is unfortunate because jemalloc increases performance:
3842 ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/.
3843 "-DARROW_JEMALLOC=OFF"
3844
3845 ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global
3846 ;; option that instructs the build system how to resolve
3847 ;; each dependency. SYSTEM = Finding the dependency in
3848 ;; system paths using CMake's built-in find_package
3849 ;; function, or using pkg-config for packages that do not
3850 ;; have this feature
3851 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
3852
3853 ;; Split output into its component packages.
3854 (string-append "-DCMAKE_INSTALL_PREFIX="
3855 (assoc-ref %outputs "lib"))
3856 (string-append "-DCMAKE_INSTALL_RPATH="
3857 (assoc-ref %outputs "lib")
3858 "/lib")
3859 (string-append "-DCMAKE_INSTALL_BINDIR="
3860 (assoc-ref %outputs "out")
3861 "/bin")
3862 (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
3863 (assoc-ref %outputs "include")
3864 "/share/include")
3865
3866
3867 "-DARROW_WITH_SNAPPY=ON"
3868 "-DARROW_WITH_ZLIB=ON"
3869 "-DARROW_WITH_ZSTD=ON"
3870 "-DARROW_WITH_LZ4=ON"
3871 "-DARROW_COMPUTE=ON"
3872 "-DARROW_CSV=ON"
3873 "-DARROW_DATASET=ON"
3874 "-DARROW_FILESYSTEM=ON"
3875 "-DARROW_HDFS=ON"
3876 "-DARROW_JSON=ON"
3877 ;; Arrow Python C++ integration library (required for
3878 ;; building pyarrow). This library must be built against
3879 ;; the same Python version for which you are building
3880 ;; pyarrow. NumPy must also be installed. Enabling this
3881 ;; option also enables ARROW_COMPUTE, ARROW_CSV,
3882 ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and
3883 ;; ARROW_JSON.
3884 "-DARROW_PYTHON=ON"
3885
3886 ;; Building the tests forces on all the
3887 ;; optional features and the use of static
3888 ;; libraries.
3889 "-DARROW_BUILD_TESTS=OFF"
3890 "-DBENCHMARK_ENABLE_GTEST_TESTS=OFF"
3891 ;;"-DBENCHMARK_ENABLE_TESTING=OFF"
3892 "-DARROW_BUILD_STATIC=OFF")))
3893 (inputs
3894 `(("apache-thrift" ,apache-thrift "lib")
3895 ("boost" ,boost)
3896 ("brotli" ,google-brotli)
3897 ("bzip2" ,bzip2)
3898 ("double-conversion" ,double-conversion)
3899 ("gflags" ,gflags)
3900 ("glog" ,glog)
3901 ("grpc" ,grpc)
3902 ("lz4" ,lz4)
3903 ("protobuf" ,protobuf)
3904 ("python-3" ,python)
3905 ("python-numpy" ,python-numpy)
3906 ("rapidjson" ,rapidjson)
3907 ("re2" ,re2)
3908 ("snappy" ,snappy)
3909 ("utf8proc" ,utf8proc)
3910 ("zlib" ,zlib)
3911 ("zstd" ,zstd "lib")))
3912 (native-inputs
3913 `(("pkg-config" ,pkg-config)))
3914 (outputs '("out" "lib" "include"))
3915 (home-page "https://arrow.apache.org/")
3916 (synopsis "Columnar in-memory analytics")
3917 (description "Apache Arrow is a columnar in-memory analytics layer
3918 designed to accelerate big data. It houses a set of canonical in-memory
3919 representations of flat and hierarchical data along with multiple
3920 language-bindings for structure manipulation. It also provides IPC and common
3921 algorithm implementations.")
3922 (license license:asl2.0)))
3923
3924 (define-public python-pyarrow
3925 (package
3926 (inherit apache-arrow)
3927 (name "python-pyarrow")
3928 (build-system python-build-system)
3929 (arguments
3930 '(#:tests? #f ; XXX There are no tests in the "python" directory
3931 #:phases
3932 (modify-phases %standard-phases
3933 (delete 'build) ; XXX the build is performed again during the install phase
3934 (add-after 'unpack 'enter-source-directory
3935 (lambda _ (chdir "python") #t))
3936 (add-after 'unpack 'make-git-checkout-writable
3937 (lambda _
3938 (for-each make-file-writable (find-files "."))
3939 #t)))))
3940 (propagated-inputs
3941 `(("apache-arrow" ,apache-arrow "lib")
3942 ("python-numpy" ,python-numpy)
3943 ("python-pandas" ,python-pandas)
3944 ("python-six" ,python-six)))
3945 (native-inputs
3946 `(("cmake" ,cmake-minimal)
3947 ("pkg-config" ,pkg-config)
3948 ("python-cython" ,python-cython)
3949 ("python-pytest" ,python-pytest)
3950 ("python-pytest-runner" ,python-pytest-runner)
3951 ("python-setuptools-scm" ,python-setuptools-scm)))
3952 (outputs '("out"))
3953 (home-page "https://arrow.apache.org/docs/python/")
3954 (synopsis "Python bindings for Apache Arrow")
3955 (description
3956 "This library provides a Pythonic API wrapper for the reference Arrow C++
3957 implementation, along with tools for interoperability with pandas, NumPy, and
3958 other traditional Python scientific computing packages.")
3959 (license license:asl2.0)))
3960
3961 (define-public python-crate
3962 (package
3963 (name "python-crate")
3964 (version "0.23.2")
3965 (source (origin
3966 (method url-fetch)
3967 (uri (pypi-uri "crate" version))
3968 (sha256
3969 (base32
3970 "0ngmlvi320c5gsxab0s7qgq0ck4jdlcwvb6lbjhnfprafdp56vvx"))))
3971 (build-system python-build-system)
3972 (propagated-inputs
3973 `(("python-urllib3" ,python-urllib3)))
3974 (home-page "https://github.com/crate/crate-python")
3975 (synopsis "CrateDB Python client")
3976 (description
3977 "This package provides a Python client library for CrateDB.
3978 It implements the Python DB API 2.0 specification and includes support for
3979 SQLAlchemy.")
3980 (license license:asl2.0)))
3981
3982 (define-public libdbi
3983 (package
3984 (name "libdbi")
3985 (version "0.9.0")
3986 (source (origin
3987 (method url-fetch)
3988 (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-"
3989 version "/libdbi-" version ".tar.gz"))
3990 (sha256
3991 (base32
3992 "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
3993 (build-system gnu-build-system)
3994 (synopsis "Database independent abstraction layer in C")
3995 (description
3996 "This library implements a database independent abstraction layer in C,
3997 similar to the DBI/DBD layer in Perl. Writing one generic set of code,
3998 programmers can leverage the power of multiple databases and multiple
3999 simultaneous database connections by using this framework.")
4000 (home-page "http://libdbi.sourceforge.net/")
4001 (license license:lgpl2.1+)))
4002
4003 (define-public libdbi-drivers
4004 (package
4005 (name "libdbi-drivers")
4006 (version "0.9.0")
4007 (source (origin
4008 (method url-fetch)
4009 (uri (string-append "mirror://sourceforge/libdbi-drivers/"
4010 "libdbi-drivers/libdbi-drivers-" version
4011 "/libdbi-drivers-" version ".tar.gz"))
4012 (sha256
4013 (base32
4014 "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
4015 (build-system gnu-build-system)
4016 (native-inputs
4017 `(;; For tests.
4018 ("inetutils" ,inetutils)
4019 ("glibc-locales" ,glibc-locales)
4020 ("mariadb" ,mariadb)))
4021 (inputs
4022 `(("libdbi" ,libdbi)
4023 ("mariadb:dev" ,mariadb "dev")
4024 ("mariadb:lib" ,mariadb "lib")
4025 ("postgresql" ,postgresql)
4026 ("sqlite" ,sqlite)))
4027 (arguments
4028 `(#:configure-flags
4029 (let ((libdbi (assoc-ref %build-inputs "libdbi"))
4030 (mysql:inc (assoc-ref %build-inputs "mariadb:dev"))
4031 (mysql:lib (assoc-ref %build-inputs "mariadb:lib"))
4032 (postgresql (assoc-ref %build-inputs "postgresql"))
4033 (sqlite (assoc-ref %build-inputs "sqlite")))
4034 (list "--disable-docs"
4035 (string-append "--with-dbi-incdir=" libdbi "/include")
4036 (string-append "--with-dbi-libdir=" libdbi "/lib")
4037 "--with-mysql"
4038 (string-append "--with-mysql-incdir=" mysql:inc "/include/mysql")
4039 (string-append "--with-mysql-libdir=" mysql:lib "/lib")
4040 "--with-pgsql"
4041 (string-append "--with-pgsql-incdir=" postgresql "/include")
4042 (string-append "--with-pgsql-libdir=" postgresql "/lib")
4043 "--with-sqlite3"
4044 (string-append "--with-sqlite-incdir=" sqlite "/include")
4045 (string-append "--with-sqlite-libdir=" sqlite "/lib")))
4046 #:tests? #f ; FIXME: Find why the tests get stuck forever.
4047 #:phases
4048 (modify-phases %standard-phases
4049 (add-after 'unpack 'fix-tests
4050 (lambda* (#:key inputs #:allow-other-keys)
4051 (substitute* "tests/test_mysql.sh"
4052 (("^MYMYSQLD=.*")
4053 (string-append "MYMYSQLD="
4054 (assoc-ref inputs "mariadb")
4055 "/bin/mysqld")))
4056 #t))
4057 (add-after 'install 'remove-empty-directories
4058 (lambda* (#:key outputs #:allow-other-keys)
4059 (let ((var (string-append (assoc-ref outputs "out") "/var")))
4060 (delete-file-recursively var))
4061 #t)))))
4062 (synopsis "Database drivers for the libdbi framework")
4063 (description
4064 "The @code{libdbi-drivers} library provides the database specific drivers
4065 for the @code{libdbi} framework.
4066
4067 The drivers officially supported by @code{libdbi} are:
4068 @itemize
4069 @item MySQL,
4070 @item PostgreSQL,
4071 @item SQLite.
4072 @end itemize")
4073 (home-page "http://libdbi-drivers.sourceforge.net/")
4074 (license license:lgpl2.1+)))
4075
4076 (define-public soci
4077 (package
4078 (name "soci")
4079 (version "4.0.1")
4080 (source (origin
4081 (method git-fetch)
4082 (uri (git-reference
4083 (url "https://github.com/SOCI/soci/")
4084 (commit version)))
4085 (file-name (git-file-name name version))
4086 (sha256
4087 (base32
4088 "14x2gjblkgpflv75wl144cyjp1sis5rbxnr9r2gj3yw16v2av0bp"))))
4089 (build-system cmake-build-system)
4090 (inputs
4091 `(("firebird" ,firebird)
4092 ("postgresql" ,postgresql)
4093 ("sqlite" ,sqlite)
4094 ("odbc" ,unixodbc)
4095 ("boost" ,boost)
4096 ("mariadb:dev" ,mariadb "dev")))
4097 (arguments
4098 `(#:configure-flags
4099 ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs it.
4100 (list "-DCMAKE_CXX_STANDARD=17"
4101 "-DSOCI_LIBDIR=lib")
4102 #:tests? #f)) ; may require running database management systems
4103 (synopsis "C++ Database Access Library")
4104 (description
4105 "SOCI is an abstraction layer for several database backends, including
4106 PostreSQL, SQLite, ODBC and MySQL.")
4107 (home-page "http://soci.sourceforge.net/")
4108 (license license:boost1.0)))
4109
4110 (define-public freetds
4111 (package
4112 (name "freetds")
4113 (version "1.2.18")
4114 (source
4115 (origin
4116 (method url-fetch)
4117 (uri (string-append "https://www.freetds.org/files/stable/"
4118 "freetds-" version ".tar.gz"))
4119 (sha256
4120 (base32 "1hspvwxwdd1apadsy2b40dpjik8kfwcvdamvhpg3lnm15n02fb50"))))
4121 (build-system gnu-build-system)
4122 (arguments
4123 ;; NOTE: (Sharlatan-20210110213908+0000) some tests require DB connection,
4124 ;; disabled for now.
4125 `(#:tests? #f))
4126 (home-page "https://www.freetds.org/")
4127 (synopsis "Client libraries for MS SQL and Sybase servers")
4128 (description
4129 "FreeTDS is an implementation of the Tabular DataStream protocol, used for
4130 connecting to MS SQL and Sybase servers over TCP/IP.")
4131 (license license:lgpl2.0+)))