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