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