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