1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2013, 2017 Cyril Roelandt <tipecaml@gmail.com>
5 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
8 ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
10 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
11 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
14 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
15 ;;; Copyright © 2016, 2017, 2018 Roel Janssen <roel@gnu.org>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
18 ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
19 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
20 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
21 ;;; Copyright © 2017, 2018 Julien Lepiller <julien@lepiller.eu>
22 ;;; Copyright © 2017, 2020 Thomas Danckaert <post@thomasdanckaert.be>
23 ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
24 ;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
25 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
26 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
27 ;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
28 ;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
29 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
30 ;;; Copyright © 2017, 2018 Pierre Langlois <pierre.langlois@gmx.com>
31 ;;; Copyright © 2015, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
32 ;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
33 ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
34 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
35 ;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
36 ;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
37 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
38 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
39 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
40 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
41 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
42 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
43 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
44 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
45 ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
46 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
47 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
48 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
50 ;;; This file is part of GNU Guix.
52 ;;; GNU Guix is free software; you can redistribute it and/or modify it
53 ;;; under the terms of the GNU General Public License as published by
54 ;;; the Free Software Foundation; either version 3 of the License, or (at
55 ;;; your option) any later version.
57 ;;; GNU Guix is distributed in the hope that it will be useful, but
58 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
59 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60 ;;; GNU General Public License for more details.
62 ;;; You should have received a copy of the GNU General Public License
63 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
65 (define-module (gnu packages databases)
66 #:use-module (gnu packages)
67 #:use-module (gnu packages admin)
68 #:use-module (gnu packages algebra)
69 #:use-module (gnu packages autotools)
70 #:use-module (gnu packages avahi)
71 #:use-module (gnu packages base)
72 #:use-module (gnu packages bash)
73 #:use-module (gnu packages bison)
74 #:use-module (gnu packages boost)
75 #:use-module (gnu packages check)
76 #:use-module (gnu packages cmake)
77 #:use-module (gnu packages compression)
78 #:use-module (gnu packages crypto)
79 #:use-module (gnu packages curl)
80 #:use-module (gnu packages cyrus-sasl)
81 #:use-module (gnu packages dbm)
82 #:use-module (gnu packages emacs)
83 #:use-module (gnu packages flex)
84 #:use-module (gnu packages gcc)
85 #:use-module (gnu packages gettext)
86 #:use-module (gnu packages glib)
87 #:use-module (gnu packages gnupg)
88 #:use-module (gnu packages guile)
89 #:use-module (gnu packages time)
90 #:use-module (gnu packages golang)
91 #:use-module (gnu packages icu4c)
92 #:use-module (gnu packages jemalloc)
93 #:use-module (gnu packages language)
94 #:use-module (gnu packages libedit)
95 #:use-module (gnu packages libevent)
96 #:use-module (gnu packages linux)
97 #:use-module (gnu packages logging)
98 #:use-module (gnu packages man)
99 #:use-module (gnu packages maths)
100 #:use-module (gnu packages multiprecision)
101 #:use-module (gnu packages ncurses)
102 #:use-module (gnu packages onc-rpc)
103 #:use-module (gnu packages parallel)
104 #:use-module (gnu packages pcre)
105 #:use-module (gnu packages perl)
106 #:use-module (gnu packages perl-check)
107 #:use-module (gnu packages perl-web)
108 #:use-module (gnu packages pkg-config)
109 #:use-module (gnu packages popt)
110 #:use-module (gnu packages protobuf)
111 #:use-module (gnu packages python)
112 #:use-module (gnu packages python-crypto)
113 #:use-module (gnu packages python-web)
114 #:use-module (gnu packages python-science)
115 #:use-module (gnu packages python-xyz)
116 #:use-module (gnu packages rdf)
117 #:use-module (gnu packages readline)
118 #:use-module (gnu packages regex)
119 #:use-module (gnu packages rpc)
120 #:use-module (gnu packages ruby)
121 #:use-module (gnu packages serialization)
122 #:use-module (gnu packages sphinx)
123 #:use-module (gnu packages sqlite)
124 #:use-module (gnu packages tcl)
125 #:use-module (gnu packages terminals)
126 #:use-module (gnu packages textutils)
127 #:use-module (gnu packages tls)
128 #:use-module (gnu packages valgrind)
129 #:use-module (gnu packages web)
130 #:use-module (gnu packages xml)
131 #:use-module ((guix licenses) #:prefix license:)
132 #:use-module (guix packages)
133 #:use-module (guix download)
134 #:use-module (guix bzr-download)
135 #:use-module (guix git-download)
136 #:use-module (guix hg-download)
137 #:use-module (guix build-system emacs)
138 #:use-module (guix build-system gnu)
139 #:use-module (guix build-system go)
140 #:use-module (guix build-system perl)
141 #:use-module (guix build-system python)
142 #:use-module (guix build-system ruby)
143 #:use-module (guix build-system cmake)
144 #:use-module (guix build-system scons)
145 #:use-module (guix build-system trivial)
146 #:use-module (guix utils)
147 #:use-module (srfi srfi-1)
148 #:use-module (srfi srfi-26)
149 #:use-module (ice-9 match))
151 (define-public 4store
158 (url "https://github.com/4store/4store")
159 (commit (string-append "v" version))))
160 (file-name (git-file-name name version))
162 (base32 "1kzdfmwpzy64cgqlkcz5v4klwx99w0jk7afckyf7yqbqb4rydmpk"))
163 (patches (search-patches "4store-unset-preprocessor-directive.patch"
164 "4store-fix-buildsystem.patch"))))
165 (build-system gnu-build-system)
169 ("autoconf" ,autoconf)
170 ("automake" ,automake)
171 ("gettext" ,gettext-minimal)
173 ("pcre" ,pcre "bin") ;for 'pcre-config'
174 ("pkg-config" ,pkg-config)))
180 ("readline" ,readline)
182 ("cyrus-sasl" ,cyrus-sasl)
184 ("util-linux" ,util-linux "lib")))
185 ;; http://www.4store.org has been down for a while now.
186 (home-page "https://github.com/4store/4store")
187 (synopsis "Clustered RDF storage and query engine")
188 (description "4store is a RDF/SPARQL store written in C, supporting
189 either single machines or networked clusters.")
190 (license license:gpl3+)))
192 (define-public go-gopkg.in-mgo.v2
194 (name "go-gopkg.in-mgo.v2")
195 (version "2016.08.01")
199 (url "https://github.com/go-mgo/mgo")
200 (commit (string-append "r" version))))
201 (file-name (git-file-name name version))
204 "0rwbi1z63w43b0z9srm8m7iz1fdwx7bq7n2mz862d6liiaqa59jd"))))
205 (build-system go-build-system)
207 `(#:import-path "gopkg.in/mgo.v2"
208 ;; TODO: The tests fail as MongoDB fails to start
209 ;; Error parsing command line: unrecognised option '--chunkSize'
212 (modify-phases %standard-phases
213 (delete 'reset-gzip-timestamps)
214 (add-before 'check 'start-mongodb
215 (lambda* (#:key tests? #:allow-other-keys)
217 (with-directory-excursion "src/gopkg.in/mgo.v2"
218 (invoke "make" "startdb")))
220 (add-after 'check 'stop'mongodb
221 (lambda* (#:key tests? #:allow-other-keys)
223 (with-directory-excursion "src/gopkg.in/mgo.v2"
224 (invoke "make" "stopdb")))
227 `(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
229 ("daemontools" ,daemontools)))
230 (synopsis "@code{mgo} offers a rich MongoDB driver for Go.")
232 "@code{mgo} (pronounced as mango) is a MongoDB driver for the Go language.
233 It implements a rich selection of features under a simple API following
234 standard Go idioms.")
235 (home-page "https://labix.org/mgo")
236 (license license:bsd-2)))
238 (define-public ephemeralpg
246 "https://eradman.com/ephemeralpg/code/ephemeralpg-"
249 (base32 "1ap22ki8yz6agd0qybcjgs4b9izw1rwwcgpxn3jah2ccfyax34s6"))))
250 (build-system gnu-build-system)
252 `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
253 (string-append "PREFIX=" %output))
255 (modify-phases %standard-phases
256 (delete 'configure) ; no configure script
257 (add-after 'install 'wrap
258 (lambda* (#:key inputs outputs #:allow-other-keys)
259 (let ((out (assoc-ref outputs "out")))
260 (wrap-program (string-append out "/bin/pg_tmp")
262 (,(string-append (assoc-ref inputs "util-linux")
264 ,(string-append (assoc-ref inputs "postgresql")
267 ,(string-append out "/bin")))))
269 #:test-target "test"))
271 `(("postgresql" ,postgresql)
272 ("util-linux" ,util-linux)))
277 (home-page "https://eradman.com/ephemeralpg/")
278 (synopsis "Run temporary PostgreSQL databases")
280 "@code{pg_tmp} creates temporary PostgreSQL databases, suitable for tasks
281 like running software test suites. Temporary databases created with
282 @code{pg_tmp} have a limited shared memory footprint and are automatically
283 garbage-collected after a configurable number of seconds (the default is
285 (license license:isc)))
287 (define-public es-dump-restore
289 (name "es-dump-restore")
294 (uri (rubygems-uri "es_dump_restore" version))
297 "020yk7f1hw48clmf5501z3xv9shsdchyymcv0y2cci2c1xvr1mim"))))
298 (build-system ruby-build-system)
300 '(#:tests? #f)) ;; No testsuite.
302 `(("ruby-httpclient" ,ruby-httpclient)
303 ("ruby-multi-json" ,ruby-multi-json)
304 ("ruby-progress_bar" ,ruby-progress_bar)
305 ("ruby-rubyzip" ,ruby-rubyzip)
306 ("ruby-thor" ,ruby-thor)))
307 (synopsis "Utility for dumping and restoring ElasticSearch indexes")
309 "This package provides a utility for dumping the contents of an
310 ElasticSearch index to a compressed file and restoring the dumpfile back to an
311 ElasticSearch server")
312 (home-page "https://github.com/patientslikeme/es_dump_restore")
313 (license license:expat)))
315 (define-public firebird
320 (let ((revision "33374-0"))
323 (uri (string-append "https://github.com/FirebirdSQL/"
324 "firebird/releases/download/R"
325 (string-replace-substring version "." "_") "/"
326 "Firebird-" version "." revision ".tar.bz2"))
328 (base32 "0xpy1bncz36c6n28y7kllm1dkrdkn4vb4gw2n43f2351mznmrf5c"))
329 (modules '((guix build utils)))
333 delete-file-recursively
334 (list "extern/btyacc/test" ; TODO: package and remove entirely
339 "src/include/firebird/impl/boost"
342 "builds/install/arch-specific/solaris"
344 "src/msgs/templates.sql"
346 ;; Generated files missing sources.
347 "doc/Firebird-3-QuickStart.pdf"
348 (string-append "doc/Firebird-" ,version
350 "doc/README.SecureRemotePassword.html"))
352 (build-system gnu-build-system)
353 (outputs (list "debug" "out"))
356 (let ((out (assoc-ref %outputs "out")))
357 (list (string-append "--with-fbsbin=" out "/sbin")
358 (string-append "--with-fbdoc=" out "/share/doc/"
360 (string-append "--with-fbconf=" out "/lib/firebird")
361 (string-append "--with-fbintl=" out "/lib/firebird/intl")
362 (string-append "--with-fbmisc=" out "/lib/firebird/misc")
363 (string-append "--with-fbmsg=" out "/lib/firebird")
364 (string-append "--with-fbplugins=" out "/lib/firebird/plugins")
365 (string-append "--with-fbudf=" out "/lib/firebird/UDF")
366 "--with-fbglock=/run/firebird"
367 "--with-fblog=/var/log/firebird"
368 "--with-fbhelp=/var/lib/firebird/system"
369 "--with-fbsecure-db=/var/lib/firebird/secure"
371 "--without-fbsample-db"
372 "--with-system-editline"))
374 (list (string-append "CC=" ,(cc-for-target))
375 ;; The plugins/ can't find libfbclient otherwise.
376 (string-append "LDFLAGS=-Wl,-rpath="
377 (assoc-ref %outputs "out") "/lib"))
378 #:tests? #f ; no test suite
379 #:modules ((guix build gnu-build-system)
383 (modify-phases %standard-phases
384 (add-after 'unpack 'use-system-boost
386 (substitute* "src/include/firebird/Message.h"
387 (("\"\\./impl/boost/preprocessor/seq/for_each_i\\.hpp\"")
388 "<boost/preprocessor/seq/for_each_i.hpp>")
389 (("FB_BOOST_") "BOOST_"))
391 (add-after 'unpack 'patch-installation
394 "builds/install/arch-specific/linux/makeInstallImage.sh.in"
395 (("/bin/sh") (which "bash"))
396 ;; Remove shell script helpers from $PATH.
397 (("(addLibs|cp) .*\\.sh .*@FB_SBINDIR@") ":")
398 ;; Put files where Guix users expect them.
399 (("(License\\.txt.*)@FB_CONFDIR" match)
400 (string-append match "@FB_DOCDIR@"))
401 (("@FB_CONFDIR@(.*License\\.txt.*)" match)
402 (string-append "@FB_DOCDIR@" match))
403 (("(cp .*/doc/.*)@FB_CONFDIR@(.*)" _ head tail)
404 (string-append head "@FB_DOCDIR@" tail "\n")))
406 (list "builds/install/posix-common/changeServerMode.sh.in"
407 "builds/install/posix-common/install.sh.in")
408 ;; Skip phases that (could) cause problems in Guix.
409 (("check(InstallUser|IfServerRunning|Libraries)|addFirebirdUser")
411 ;; Skip phases that are merely pointless on Guix.
412 (("buildUninstallFile|installInitdScript|startFirebird") ":")
413 ;; Omit randomly generated password with bonus timestamp.
414 (("setDBAPassword") ":"))
416 ;; These promote proprietary workflows not relevant on Guix.
417 (for-each delete-file-recursively
418 (find-files "doc" "README\\.(build\\.msvc|NT|Win)"))
420 (add-after 'configure 'delete-init-scripts
422 (delete-file-recursively "gen/install/misc")
424 (add-before 'build 'set-build-environment-variables
426 ;; ‘isql’ needs to run & find libfbclient.so during the build.
427 ;; This doubles as a rudimentary test in lieu of a test suite.
428 (setenv "LD_LIBRARY_PATH"
429 (string-append (assoc-ref %build-inputs "icu4c") "/lib"))
431 (add-before 'install 'keep-embedded-debug-symbols
433 ;; Let the gnu-build-system separate & deal with them later.
434 ;; XXX Upstream would use ‘--strip-unneeded’, shaving a whole
435 ;; megabyte off Guix's 7.7M libEngine12.so, for example.
436 (substitute* "gen/Makefile.install"
437 (("readelf") "false"))
439 (add-after 'install 'prune-undesirable-files
440 (lambda* (#:key outputs #:allow-other-keys)
441 (let ((out (assoc-ref outputs "out")))
442 (with-directory-excursion out
443 ;; Remove example binaries.
444 (for-each delete-file-recursively
445 (find-files "." "example"))
446 ;; Delete (now-)empty directories.
448 (list "include/firebird/impl"
449 "lib/firebird/plugins/udr"))
453 ("editline" ,editline)
455 ("libtommath" ,libtommath)
458 (home-page "https://www.firebirdsql.org")
459 (synopsis "Relational database with many ANSI SQL standard features")
461 "Firebird is an SQL @acronym{RDBMS, relational database management system}
462 with rich support for ANSI SQL (e.g., @code{INSERT...RETURNING}) including
463 @acronym{UDFs, user-defined functions} and PSQL stored procedures, cursors, and
464 triggers. Transactions provide full ACID-compliant referential integrity.
466 The database requires very little manual maintenance once set up, making it
467 ideal for small business or embedded use.
469 When installed as a traditional local or remote (network) database server,
470 Firebird can grow to terabyte scale with proper tuning---although PostgreSQL
471 may be a better choice for such very large environments.
473 Firebird can also be embedded into stand-alone applications that don't want or
474 need a full client & server. Used in this manner, it offers richer SQL support
475 than SQLite as well as the option to seamlessly migrate to a client/server
478 `((lint-hidden-cve . ("CVE-2017-6369"))))
480 ;; See doc/license/README.license.usage.txt for rationale & details.
481 (list license:bsd-3 ; src/common/sha2/
482 license:bsd-4 ; src/common/enc.cpp
483 license:gpl2+ ; builds/posix/make.defaults
484 (license:non-copyleft "file:///builds/install/misc/IPLicense.txt"
485 "InterBase Public License v1.0")
486 (license:non-copyleft "file:///builds/install/misc/IDPLicense.txt"
487 "Initial Developer's Public License v1.0")
488 license:lgpl2.1 ; exception for OSI-compatible licences
489 license:mpl1.1 ; examples/interfaces/0{6,8}*.cpp
490 license:public-domain)))) ; including files without explicit licence
492 (define-public leveldb
499 (url "https://github.com/google/leveldb")
501 (file-name (git-file-name name version))
504 "0qrnhiyq7r4wa1a4wi82zgns35smj94mcjsc7kfs1k6ia9ys79z7"))))
505 (build-system cmake-build-system)
507 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON" "-DLEVELDB_BUILD_TESTS=ON")))
509 `(("snappy" ,snappy)))
510 (home-page "https://github.com/google/leveldb")
511 (synopsis "Fast key-value storage library")
513 "LevelDB is a fast key-value storage library that provides an ordered
514 mapping from string keys to string values.")
515 (license license:bsd-3)))
517 (define-public memcached
525 "https://memcached.org/files/memcached-" version ".tar.gz"))
527 (base32 "1lcjy1b9krnb2gk72qd1fvivlfiyfvknfi3wngyvyk9ifzijr9nm"))))
528 (build-system gnu-build-system)
530 `(("libevent" ,libevent)
531 ("cyrus-sasl" ,cyrus-sasl)))
532 (home-page "https://memcached.org/")
533 (synopsis "In-memory caching service")
534 (description "Memcached is an in-memory key-value store. It has a small
535 and generic API, and was originally intended for use with dynamic web
537 (license license:bsd-3)))
539 (define-public libmemcached
541 (name "libmemcached")
543 ;; We build from the sources since we want to build the extra HTML
544 ;; documentation which is not included with the release.
548 (url "lp:libmemcached/1.0")
549 (revision (string-append "tag:" version))))
550 (file-name (string-append name "-" version "-checkout"))
553 "1842s4dxdh21gdr46q4dgxigidcs6dkqnbnqjwb9l8r0bqx5nb10"))
555 (search-patches "libmemcached-build-with-gcc7.patch"))))
556 (build-system gnu-build-system)
558 `(("memcached" ,memcached)
560 ("autoconf" ,autoconf)
561 ("automake" ,automake)
565 ("python-sphinx" ,python-sphinx))) ;to build the HTML doc.
567 `(("libevent" ,libevent)
568 ("cyrus-sasl" ,cyrus-sasl)))
569 (outputs '("out" "doc"))
572 (modify-phases %standard-phases
573 (add-before 'bootstrap 'fix-configure.ac
574 ;; Move the AC_CONFIG_AUX_DIR macro use under AC_INIT, otherwise we
575 ;; get the error ``configure: error: cannot find install-sh,
576 ;; install.sh, or shtool in "." "./.." "./../.."`` (see:
577 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19539 and
578 ;; https://bugs.launchpad.net/libmemcached/+bug/1803922).
580 (delete-file "bootstrap.sh") ;not useful in the context of Guix
581 (substitute* "configure.ac"
582 (("^AC_CONFIG_AUX_DIR\\(\\[build-aux\\]\\).*") "")
583 (("(^AC_INIT.*)" anchor)
584 (string-append anchor "AC_CONFIG_AUX_DIR([build-aux])\n")))
586 (add-before 'bootstrap 'disable-failing-tests
587 ;; See: https://bugs.launchpad.net/libmemcached/+bug/1803926
589 ;; Mark some heavily failing test suites as expected to fail.
590 (substitute* "Makefile.am"
591 (("(XFAIL_TESTS =[^\n]*)" xfail_tests)
592 (string-append xfail_tests " tests/testudp"
593 " tests/libmemcached-1.0/testapp"
594 " tests/libmemcached-1.0/testsocket")))
595 ;; Disable two tests of the unittest test suite.
596 (substitute* "libtest/unittest.cc"
597 ((".*echo_fubar_BINARY \\},.*") "")
598 ((".*application_doesnotexist_BINARY \\},.*") ""))
600 (add-after 'disable-dns-tests 'build-and-install-html-doc
601 (lambda* (#:key outputs #:allow-other-keys)
602 (let ((html (string-append (assoc-ref outputs "doc")
603 "/share/doc/libmemcached/html/")))
604 (invoke "make" "install-html")
605 ;; Cleanup useless files.
606 (for-each delete-file-recursively
607 (map (lambda (x) (string-append html x))
608 '("_sources" ".doctrees" ".buildinfo"))))
610 (home-page "https://libmemcached.org/")
611 (synopsis "C++ library for memcached")
612 (description "libMemcached is a library to use memcached in C/C++
613 applications. It comes with a complete reference guide and documentation of
614 the API, and provides features such as:
616 @item Asynchronous and synchronous transport support
617 @item Consistent hashing and distribution
618 @item Tunable hashing algorithm to match keys
619 @item Access to large object support
620 @item Local replication
622 (license license:bsd-3)))
624 (define-public python-pylibmc
626 (name "python-pylibmc")
631 (uri (pypi-uri "pylibmc" version))
633 (base32 "1sg7d9j0v6g3xg3finf4l1hb72c13vcyyi6rqrc9shbx903d93ca"))))
634 (build-system python-build-system)
637 (modify-phases %standard-phases
638 (add-before 'check 'start-memcached-daemon
639 ;; The test suite requires a memcached server.
641 (invoke "memcached" "-d"))))))
643 `(("memcached" ,memcached)
644 ("python-nose" ,python-nose)))
646 `(("libmemcached" ,libmemcached)
648 ("cyrus-sasl" ,cyrus-sasl)))
649 (home-page "http://sendapatch.se/projects/pylibmc/")
650 (synopsis "Python client for memcached")
652 "@code{pylibmc} is a client in Python for memcached. It is a wrapper
653 around TangentOrg’s libmemcached library, and can be used as a drop-in
654 replacement for the code@{python-memcached} library.")
655 (license license:bsd-3)))
657 (define-public python2-pylibmc
658 (package-with-python2 python-pylibmc))
660 (define-public mongodb
666 (uri (string-append "https://github.com/mongodb/mongo/archive/r"
668 (file-name (string-append name "-" version ".tar.gz"))
670 (base32 "0676lvkljj7a5hdhv78dbykqnqrj9lbn9799mi84b8vbnzsq961r"))
671 (modules '((guix build utils)))
674 (for-each (lambda (dir)
675 (delete-file-recursively
676 (string-append "src/third_party/" dir)))
677 '("pcre-8.41" "scons-2.5.0" "snappy-1.1.3"
678 "valgrind-3.11.0" "wiredtiger"
679 "yaml-cpp-0.5.3" "zlib-1.2.8"))
683 (search-patch "mongodb-support-unknown-linux-distributions.patch")))))
684 (build-system scons-build-system)
686 `(("openssl" ,openssl-1.0)
688 ,@(match (%current-system)
689 ((or "x86_64-linux" "aarch64-linux" "mips64el-linux")
690 `(("wiredtiger" ,wiredtiger)))
692 ("yaml-cpp" ,yaml-cpp)
696 `(("valgrind" ,valgrind)
699 ("python2-pymongo" ,python2-pymongo)
700 ("python2-pyyaml" ,python2-pyyaml)
701 ("tzdata" ,tzdata-for-tests)))
703 `(#:scons ,scons-python2
705 (let ((common-options
706 `(;; "--use-system-tcmalloc" TODO: Missing gperftools
708 ;; wiredtiger is 64-bit only
709 ,,(if (any (cute string-prefix? <> (or (%current-target-system)
711 '("i686-linux" "armhf-linux"))
713 ``"--use-system-wiredtiger")
715 ;; build/opt/mongo/db/fts/unicode/string.o failed: Error 1
716 ;; --use-system-boost
717 "--use-system-snappy"
719 "--use-system-valgrind"
720 ;; "--use-system-stemmer" TODO: Missing relevant package
722 "--disable-warnings-as-errors"
723 ,(format #f "--jobs=~a" (parallel-job-count))
725 (modify-phases %standard-phases
726 (add-after 'unpack 'patch
728 ;; Remove use of GNU extensions in parse_number_test.cpp, to
729 ;; allow compiling with GCC 7 or later
730 ;; https://jira.mongodb.org/browse/SERVER-28063
731 (substitute* "src/mongo/base/parse_number_test.cpp"
732 (("0xabcab\\.defdefP-10")
733 "687.16784283419838"))
735 (add-after 'unpack 'scons-propagate-environment
737 ;; Modify the SConstruct file to arrange for
738 ;; environment variables to be propagated.
739 (substitute* "SConstruct"
740 (("^env = Environment\\(")
741 "env = Environment(ENV=os.environ, "))
743 (add-after 'unpack 'create-version-file
745 (call-with-output-file "version.json"
747 (display ,(simple-format #f "{
753 (apply invoke `("scons"
755 "mongod" "mongo" "mongos"))))
757 (lambda* (#:key tests? inputs #:allow-other-keys)
759 (string-append (assoc-ref inputs "tzdata")
762 ;; Note that with the tests, especially the unittests, the
763 ;; build can take up to ~45GB of space, as many tests are
764 ;; individual executable files, with some being hundreds of
765 ;; megabytes in size.
766 (apply invoke `("scons" ,@common-options "dbtest" "unittests"))
767 (substitute* "build/unittests.txt"
768 ;; TODO: Don't run the async_stream_test, as it hangs
769 (("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
771 ;; TODO: This test fails
772 ;; Expected 0UL != disks.size() (0 != 0) @src/mongo/util/procparser_test.cpp:476
773 (("^build\\/opt\\/mongo\\/util\\/procparser\\_test\n$")
775 (invoke "python" "buildscripts/resmoke.py"
776 "--suites=dbtest,unittests"
777 (format #f "--jobs=~a" (parallel-job-count))))
780 (lambda* (#:key outputs #:allow-other-keys)
781 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
782 (install-file "mongod" bin)
783 (install-file "mongos" bin)
784 (install-file "mongo" bin))
786 (home-page "https://www.mongodb.org/")
787 (synopsis "High performance and high availability document database")
789 "Mongo is a high-performance, high availability, schema-free
790 document-oriented database. A key goal of MongoDB is to bridge the gap
791 between key/value stores (which are fast and highly scalable) and traditional
792 RDBMS systems (which are deep in functionality).")
793 (license (list license:agpl3
794 ;; Some parts are licensed under the Apache License
804 (uri (pypi-uri "mycli" version))
806 (base32 "1lq2x95553vdmhw13cxcgsd2g2i32izhsb7hxd4m1iwf9b3msbpv"))))
807 (build-system python-build-system)
809 `(#:tests? #f)) ; tests expect a running MySQL
811 `(("python-cli-helpers" ,python-cli-helpers)
812 ("python-click" ,python-click)
813 ("python-configobj" ,python-configobj)
814 ("python-cryptography" ,python-cryptography)
815 ("python-prompt-toolkit" ,python-prompt-toolkit)
816 ("python-pygments" ,python-pygments)
817 ("python-pymysql" ,python-pymysql)
818 ("python-sqlparse" ,python-sqlparse)))
819 (home-page "http://mycli.net")
821 "Terminal Client for MySQL with AutoCompletion and Syntax Highlighting")
823 "MyCLI is a command line interface for MySQL, MariaDB, and Percona with
824 auto-completion and syntax highlighting.")
825 (license license:bsd-3)))
827 ;; XXX When updating, check whether boost-for-mysql is still needed.
828 ;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
835 (uri (list (string-append
836 "https://dev.mysql.com/get/Downloads/MySQL-"
837 (version-major+minor version) "/"
838 name "-" version ".tar.gz")
840 "https://downloads.mysql.com/archives/get/file/"
841 name "-" version ".tar.gz")))
844 "1fhv16zr46pxm1j8vb8x8mh3nwzglg01arz8gnazbmjqldr5idpq"))))
845 (build-system cmake-build-system)
848 '("-DBUILD_CONFIG=mysql_release"
851 "-DDEFAULT_CHARSET=utf8"
852 "-DDEFAULT_COLLATION=utf8_general_ci"
853 "-DMYSQL_DATADIR=/var/lib/mysql"
854 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
855 "-DINSTALL_INFODIR=share/mysql/docs"
856 "-DINSTALL_MANDIR=share/man"
857 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
858 "-DINSTALL_SCRIPTDIR=bin"
859 "-DINSTALL_INCLUDEDIR=include/mysql"
860 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
861 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
862 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
863 "-DINSTALL_DOCDIR=share/mysql/docs"
864 "-DINSTALL_SHAREDIR=share/mysql"
865 ;; Get rid of test data.
866 "-DINSTALL_MYSQLTESTDIR="
867 "-DINSTALL_SQLBENCHDIR=")
868 #:phases (modify-phases %standard-phases
870 'install 'remove-extra-binaries
871 (lambda* (#:key outputs #:allow-other-keys)
872 (let ((out (assoc-ref outputs "out")))
873 ;; Remove the 3 *_embedded files, which weigh in at
875 (for-each delete-file
876 (find-files (string-append out "/bin")
882 ("pkg-config" ,pkg-config)))
884 `(("boost" ,boost-for-mysql)
886 ("libtirpc" ,libtirpc)
889 ("rpcsvc-proto" ,rpcsvc-proto) ; rpcgen
891 (home-page "https://www.mysql.com/")
892 (synopsis "Fast, easy to use, and popular database")
894 "MySQL is a fast, reliable, and easy to use relational database
895 management system that supports the standardized Structured Query
897 (license license:gpl2)))
899 (define-public mariadb
905 (uri (string-append "https://downloads.mariadb.com/MariaDB"
906 "/mariadb-" version "/source/mariadb-"
910 "1i257h0zdypdfj5wkg6ck9pxlkph0jvjs92k22pjr6gnx5lxs1gz"))
911 (modules '((guix build utils)))
914 ;; Delete bundled snappy and xz.
915 (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
916 (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
917 ;; This file checks that the bundled sources are present and
918 ;; declares build procedures for them.
919 (("^include\\(TokuThirdParty\\)") ""))
920 (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
921 ;; Don't attempt to use the procedures we just removed.
922 ((" build_lzma build_snappy") ""))
924 ;; Preserve CMakeLists.txt for these.
925 (for-each (lambda (file)
926 (unless (string-suffix? "CMakeLists.txt" file)
928 (append (find-files "extra/wolfssl")
929 (find-files "zlib")))
931 (build-system cmake-build-system)
932 (outputs '("out" "lib" "dev"))
936 "-DBUILD_CONFIG=mysql_release"
937 ;; Linking with libarchive fails, like this:
939 ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
940 ;; relocation R_X86_64_32 against `.bss' can not be used when
941 ;; making a shared object; recompile with -fPIC
943 ;; For now, disable the features that that use libarchive (xtrabackup).
944 "-DWITH_LIBARCHIVE=OFF"
946 ;; Disable the TokuDB engine, because its test suite frequently fails,
947 ;; and loading it crashes the server: <https://bugs.gnu.org/35521>.
950 ;; Ensure the system libraries are used.
951 "-DWITH_JEMALLOC=yes"
956 "-DDEFAULT_CHARSET=utf8"
957 "-DDEFAULT_COLLATION=utf8_general_ci"
958 "-DMYSQL_DATADIR=/var/lib/mysql"
959 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
960 (string-append "-DCMAKE_INSTALL_PREFIX=" (assoc-ref %outputs "lib"))
961 (string-append "-DCMAKE_INSTALL_RPATH=" (assoc-ref %outputs "lib")
963 (string-append "-DINSTALL_INFODIR=" (assoc-ref %outputs "out")
965 (string-append "-DINSTALL_MANDIR=" (assoc-ref %outputs "out")
967 (string-append "-DINSTALL_SCRIPTDIR=" (assoc-ref %outputs "out") "/bin")
968 (string-append "-DINSTALL_BINDIR=" (assoc-ref %outputs "out") "/bin")
969 "-DCMAKE_INSTALL_LIBDIR=lib"
970 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
971 (string-append "-DINSTALL_INCLUDEDIR=" (assoc-ref %outputs "dev")
973 (string-append "-DINSTALL_DOCREADMEDIR=" (assoc-ref %outputs "out")
975 (string-append "-DINSTALL_DOCDIR=" (assoc-ref %outputs "out")
977 (string-append "-DINSTALL_SUPPORTFILESDIR=" (assoc-ref %outputs "out")
978 "/share/mysql/support-files")
979 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
980 "-DINSTALL_SHAREDIR=share")
982 (modify-phases %standard-phases
983 (add-after 'unpack 'adjust-output-references
985 ;; The build system invariably prepends $CMAKE_INSTALL_PREFIX
986 ;; to other variables such as $INSTALL_INCLUDEDIR, which does
987 ;; not work when the latter uses an absolute file name.
988 (substitute* "libmariadb/mariadb_config/mariadb_config.c.in"
989 (("@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@")
990 "@INSTALL_INCLUDEDIR@"))
991 (substitute* "libmariadb/mariadb_config/libmariadb.pc.in"
992 (("\\$\\{prefix\\}/@INSTALL_INCLUDEDIR@")
993 "@INSTALL_INCLUDEDIR@"))
994 (substitute* "include/CMakeLists.txt"
995 (("\\\\\\$\\{CMAKE_INSTALL_PREFIX\\}/\\$\\{INSTALL_INCLUDEDIR\\}")
996 "${INSTALL_INCLUDEDIR}"))
998 (add-after 'unpack 'adjust-tests
1000 (let ((disabled-tests
1001 '(;; These fail because root@hostname == root@localhost in
1002 ;; the build environment, causing a user count mismatch.
1003 ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
1004 "funcs_1.is_columns_mysql"
1006 "main.explain_non_select"
1008 "main.stat_tables_innodb"
1009 "roles.acl_statistics"
1011 ;; This file contains a time bomb which makes it fail after
1012 ;; 2030-12-31. See <https://bugs.gnu.org/34351> for details.
1015 ;; This file contains a list of known-flaky tests for this
1016 ;; release. Append our own items.
1017 (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
1018 (for-each (lambda (test)
1019 (format unstable-tests "~a : ~a\n"
1020 test "Disabled in Guix"))
1022 (close-port unstable-tests)
1024 ;; XXX: These fail because they expect a latin1 charset and
1025 ;; collation. See <https://jira.mariadb.org/browse/MDEV-21264>.
1026 (substitute* '("mysql-test/main/gis_notembedded.result"
1027 "mysql-test/main/system_mysql_db.result")
1028 (("latin1_swedish_ci") "utf8_general_ci")
1029 (("\tlatin1") "\tutf8"))
1031 (substitute* "mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test"
1035 (substitute* "mysql-test/mysql-test-run.pl"
1036 (("/bin/ls") (which "ls"))
1037 (("/bin/sh") (which "sh")))
1039 (add-before 'configure 'disable-plugins
1041 (let ((disable-plugin (lambda (name)
1042 (call-with-output-file
1043 (string-append "plugin/" name
1046 (format port "\n")))))
1047 (disabled-plugins '(;; XXX: Causes a test failure.
1049 (for-each disable-plugin disabled-plugins)
1052 (lambda* (#:key (tests? #t) #:allow-other-keys)
1054 (with-directory-excursion "mysql-test"
1055 (invoke "./mtr" "--verbose"
1057 "--testcase-timeout=40"
1058 "--suite-timeout=600"
1059 "--parallel" (number->string (parallel-job-count))
1060 ;; Skip the replication tests: they are very I/O
1061 ;; intensive and frequently causes indeterministic
1062 ;; failures even on powerful hardware.
1064 "--skip-test-list=unstable-tests"))
1065 (format #t "test suite not run~%"))
1068 'install 'post-install
1069 (lambda* (#:key inputs outputs #:allow-other-keys)
1070 (let* ((out (assoc-ref outputs "out"))
1071 (dev (assoc-ref outputs "dev"))
1072 (lib (assoc-ref outputs "lib"))
1073 (openssl (assoc-ref inputs "openssl")))
1074 (substitute* (list (string-append out "/bin/mariadb-install-db")
1075 (string-append out "/bin/mysql_install_db"))
1077 (string-append "basedir=\"" out "\""))
1078 (("\\$basedir/share/mysql")
1079 (string-append lib "/share/mysql")))
1081 ;; Remove unneeded files for testing.
1082 (with-directory-excursion lib
1083 (for-each delete-file-recursively
1084 '("mysql-test" "sql-bench"))
1085 ;; And static libraries.
1086 (for-each delete-file (find-files "lib" "\\.a$")))
1087 (with-directory-excursion out
1088 (delete-file "share/man/man1/mysql-test-run.pl.1")
1089 ;; Delete huge and unnecessary executables.
1090 (for-each delete-file (find-files "bin" "test$")))
1091 (mkdir-p (string-append dev "/share"))
1092 (mkdir-p (string-append dev "/bin"))
1093 (rename-file (string-append lib "/bin/mariadbd")
1094 (string-append out "/bin/mariadbd"))
1095 (rename-file (string-append lib "/bin/mysqld")
1096 (string-append out "/bin/mysqld"))
1097 (mkdir-p (string-append dev "/lib"))
1098 (rename-file (string-append lib "/lib/pkgconfig")
1099 (string-append dev "/lib/pkgconfig"))
1100 (rename-file (string-append lib "/bin/mariadb_config")
1101 (string-append dev "/bin/mariadb_config"))
1102 (rename-file (string-append out "/bin/mysql_config")
1103 (string-append dev "/bin/mysql_config"))
1105 ;; Embed an absolute reference to OpenSSL in mysql_config
1106 ;; and the pkg-config file to avoid propagation.
1107 ;; XXX: how to do this for mariadb_config.c.in?
1108 (substitute* (list (string-append dev "/bin/mysql_config")
1109 (string-append dev "/lib/pkgconfig/mariadb.pc"))
1110 (("-lssl -lcrypto" all)
1111 (string-append "-L" openssl "/lib " all)))
1118 `(("jemalloc" ,jemalloc)
1120 ("libxml2" ,libxml2)
1121 ("ncurses" ,ncurses)
1122 ("openssl" ,openssl)
1127 ;; The test suite is very resource intensive and can take more than three
1128 ;; hours on a x86_64 system. Give slow and busy machines some leeway.
1129 (properties '((timeout . 64800))) ;18 hours
1130 (home-page "https://mariadb.org/")
1131 (synopsis "SQL database server")
1133 "MariaDB is a multi-user and multi-threaded SQL database server, designed
1134 as a drop-in replacement of MySQL.")
1135 (license license:gpl2)))
1137 (define-public mariadb-connector-c
1139 (name "mariadb-connector-c")
1145 "https://downloads.mariadb.org/f/connector-c-" version
1146 "/mariadb-connector-c-" version "-src.tar.gz"
1147 "/from/https%3A//mirrors.ukfast.co.uk/sites/mariadb/?serve"))
1149 (base32 "03svzahdf7czjlm695c11r4bfd04qdqgx8r1vkpr1zlkjhwnqvry"))))
1151 `(("openssl" ,openssl)))
1152 (build-system cmake-build-system)
1154 '(#:tests? #f)) ; no tests
1155 (home-page "https://mariadb.com/kb/en/mariadb-connector-c/")
1156 (synopsis "Client library to connect to MySQL or MariaDB")
1157 (description "The MariaDB Connector/C is used to connect applications
1158 developed in C/C++ to MariaDB and MySQL databases.")
1159 (license license:lgpl2.1+)))
1161 ;; Don't forget to update the other postgresql packages when upgrading this one.
1162 (define-public postgresql
1168 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1169 version "/postgresql-" version ".tar.bz2"))
1172 "1qal0yp7a90yzya7hl56gsmw5fvacplrdhpn7h9gnbyr1i2iyw2d"))
1173 (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))
1174 (build-system gnu-build-system)
1176 `(#:configure-flags '("--with-uuid=e2fs" "--with-openssl")
1178 (modify-phases %standard-phases
1179 (add-before 'configure 'patch-/bin/sh
1181 ;; Refer to the actual shell.
1182 (substitute* '("src/bin/pg_ctl/pg_ctl.c"
1183 "src/bin/psql/command.c")
1184 (("/bin/sh") (which "sh")))
1186 (add-after 'build 'build-contrib
1188 (invoke "make" "-C" "contrib")))
1189 (add-after 'install 'install-contrib
1191 (invoke "make" "-C" "contrib" "install"))))))
1193 `(("readline" ,readline)
1194 ("libuuid" ,util-linux "lib")
1195 ("openssl" ,openssl)
1197 (home-page "https://www.postgresql.org/")
1198 (synopsis "Powerful object-relational database system")
1200 "PostgreSQL is a powerful object-relational database system. It is fully
1201 ACID compliant, has full support for foreign keys, joins, views, triggers, and
1202 stored procedures (in multiple languages). It includes most SQL:2008 data
1203 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
1204 TIMESTAMP. It also supports storage of binary large objects, including
1205 pictures, sounds, or video.")
1206 (license (license:x11-style "file://COPYRIGHT"))))
1208 (define-public postgresql-10 postgresql)
1210 (define-public postgresql-13
1212 (inherit postgresql)
1215 (inherit (package-source postgresql))
1216 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1217 version "/postgresql-" version ".tar.bz2"))
1220 "07z6zwr58dckaa97yl9ml240z83d1lhgaxw9aq49i8lsp21mqd0j"))))))
1222 (define-public postgresql-11
1224 (inherit postgresql)
1229 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1230 version "/postgresql-" version ".tar.bz2"))
1233 "0w1iq488kpzfgfnlw4k32lz5by695mpnkq461jrgsr99z5zlz4j9"))))))
1235 (define-public postgresql-9.6
1237 (inherit postgresql)
1242 (uri (string-append "https://ftp.postgresql.org/pub/source/v"
1243 version "/postgresql-" version ".tar.bz2"))
1246 "1rr2dgv4ams8r2lp13w85c77rkmzpb88fjlc28mvlw6zq2fblv2w"))))))
1248 (define-public python-pymysql
1250 (name "python-pymysql")
1255 (uri (pypi-uri "PyMySQL" version))
1257 (base32 "1ry8lxgdc1p3k7gbw20r405jqi5lvhi5wk83kxdbiv8xv3f5kh6q"))))
1258 (build-system python-build-system)
1260 `(("python-unittest2" ,python-unittest2)))
1262 `(("python-cryptography" ,python-cryptography)))
1264 `(#:tests? #f)) ; tests expect a running MySQL
1265 (home-page "https://github.com/PyMySQL/PyMySQL/")
1266 (synopsis "Pure-Python MySQL driver")
1268 "PyMySQL is a pure-Python MySQL client library, based on PEP 249.
1269 Most public APIs are compatible with @command{mysqlclient} and MySQLdb.")
1270 (license license:expat)))
1272 (define-public python2-pymysql
1273 (package-with-python2 python-pymysql))
1282 (uri (string-append "http://fallabs.com/" name "/"
1283 name "-" version ".tar.gz"))
1286 "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
1287 (build-system gnu-build-system)
1289 `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1290 (assoc-ref %outputs "out")
1292 #:make-flags (list "CFLAGS=-fPIC")))
1293 (home-page "https://fallabs.com/qdbm/")
1294 (synopsis "Key-value database")
1295 (description "QDBM is a library of routines for managing a
1296 database. The database is a simple data file containing key-value
1297 pairs. Every key and value is serial bytes with variable length.
1298 Binary data as well as character strings can be used as a key or a
1299 value. There is no concept of data tables or data types. Records are
1300 organized in a hash table or B+ tree.")
1301 (license license:lgpl2.1+)))
1303 (define-public recutils
1309 (uri (string-append "mirror://gnu/recutils/recutils-"
1313 "14xiln4immfsw8isnvwvq0h23f6z0wilpgsc4qzabnrzb5lsx3nz"))))
1314 (build-system gnu-build-system)
1316 (arguments '(#:configure-flags
1317 (list (string-append "--with-bash-headers="
1318 (assoc-ref %build-inputs "bash:include")
1321 (native-inputs `(("bc" ,bc)
1322 ("bash:include" ,bash "include")
1323 ("check" ,check-0.14)
1324 ("pkg-config" ,pkg-config)))
1326 ;; TODO: Add more optional inputs.
1327 (inputs `(("curl" ,curl)
1328 ("libgcrypt" ,libgcrypt)
1329 ("libuuid" ,util-linux "lib")))
1330 (synopsis "Manipulate plain text files as databases")
1332 "GNU Recutils is a set of tools and libraries for creating and
1333 manipulating text-based, human-editable databases. Despite being text-based,
1334 databases created with Recutils carry all of the expected features such as
1335 unique fields, primary keys, time stamps and more. Many different field
1336 types are supported, as is encryption.")
1337 (license license:gpl3+)
1338 (home-page "https://www.gnu.org/software/recutils/")))
1340 (define-public emacs-recutils
1343 (name "emacs-recutils")
1344 (build-system emacs-build-system)
1347 (modify-phases %standard-phases
1348 (add-after 'unpack 'change-directory
1354 (synopsis "Emacs mode for working with recutils database files")
1355 (description "This package provides an Emacs major mode @code{rec-mode}
1356 for working with GNU Recutils text-based, human-editable databases. It
1357 supports editing, navigation, and querying of recutils database files
1358 including field and record folding.")))
1360 (define-public rocksdb
1367 (url "https://github.com/facebook/rocksdb")
1368 (commit (string-append "v" version))))
1369 (file-name (git-file-name name version))
1372 "0n19p9cd13jg0lnibrzwkxs4xlrhyj3knypkd2ic41arbds0bdnl"))
1373 (modules '((guix build utils)))
1376 ;; TODO: unbundle gtest.
1377 (delete-file "build_tools/gnu_parallel")
1378 (substitute* "Makefile"
1379 (("build_tools/gnu_parallel") "parallel"))
1381 (build-system gnu-build-system)
1383 `(#:make-flags (list "CC=gcc" "V=1"
1384 ;; Ceph requires that RTTI is enabled.
1386 "date=1970-01-01" ; build reproducibly
1387 (string-append "INSTALL_PATH="
1388 (assoc-ref %outputs "out"))
1390 ;; Running the full test suite takes hours and require
1391 ;; a lot of disk space. Instead we only run a subset
1392 ;; (see .travis.yml and Makefile).
1393 "ROCKSDBTESTS_END=db_tailing_iter_test")
1394 #:test-target "check_some"
1395 ;; Many tests fail on 32-bit platforms. There are multiple reports about
1396 ;; this upstream, but it's not going to be supported any time soon.
1397 #:tests? (let ((system ,(or (%current-target-system)
1398 (%current-system))))
1399 (or (string-prefix? "x86_64-linux" system)
1400 (string-prefix? "aarch64-linux" system)))
1402 (modify-phases %standard-phases
1403 (add-after 'unpack 'patch-Makefile
1405 (substitute* "Makefile"
1406 ;; Don't depend on the static library when installing.
1407 (("install: install-static")
1408 "install: install-shared")
1409 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1412 ;; The default target is only needed for tests and built on demand.
1414 (add-before 'check 'disable-optimizations
1416 ;; Prevent the build from passing '-march=native' to the compiler.
1417 (setenv "PORTABLE" "1")
1419 (add-before 'check 'disable-failing-tests
1421 (substitute* "Makefile"
1422 ;; These tests reliably fail due to "Too many open files".
1423 (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
1424 (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
1426 (add-after 'check 'build
1427 ;; The default build target is a debug build for tests. The
1428 ;; install target depends on the "shared_lib" release target
1429 ;; so we build it here for clarity.
1430 (lambda* (#:key (make-flags '()) parallel-build? #:allow-other-keys)
1431 (apply invoke "make" "shared_lib"
1432 `(,@(if parallel-build?
1433 `("-j" ,(number->string (parallel-job-count)))
1437 `(("parallel" ,parallel)
1440 ("python" ,python-2)
1445 ("jemalloc" ,jemalloc)
1449 (home-page "https://rocksdb.org/")
1450 (synopsis "Persistent key-value store for fast storage")
1452 "RocksDB is a library that forms the core building block for a fast
1453 key-value server, especially suited for storing data on flash drives. It
1454 has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
1455 between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
1456 (RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
1457 compactions, making it specially suitable for storing multiple terabytes of
1458 data in a single database. RocksDB is partially based on @code{LevelDB}.")
1459 ;; RocksDB is dual licensed under GPL2 and ASL 2.0. Some header
1460 ;; files carry the 3-clause BSD license.
1461 (license (list license:gpl2 license:asl2.0 license:bsd-3))))
1463 (define-public sparql-query
1465 (name "sparql-query")
1470 (url "https://github.com/tialaramex/sparql-query")
1473 (base32 "0a84a89idpjhj9w2y3fmvzv7ldps1cva1kxvfmh897k02kaniwxk"))
1474 (file-name (git-file-name name version))))
1475 (build-system gnu-build-system)
1479 ("libxml2" ,libxml2)
1480 ("ncurses" ,ncurses)
1481 ("readline" ,readline)))
1483 `(("pkg-config" ,pkg-config)))
1485 `(#:make-flags '("CC=gcc")
1487 (modify-phases %standard-phases
1489 ;; The Makefile uses git to obtain versioning information. This phase
1490 ;; substitutes the git invocation with the package version.
1491 (add-after 'unpack 'remove-git-dependency
1493 (substitute* "Makefile"
1495 (string-append "gitrev = \"v" ,version "\"")))
1497 ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
1498 ;; This replacement does the same thing, except for using $PREFIX/bin
1501 (lambda* (#:key outputs #:allow-other-keys)
1502 (let* ((out (assoc-ref outputs "out"))
1503 (bin (string-append out "/bin")))
1504 (install-file "sparql-query" bin)
1505 (symlink (string-append bin "/sparql-query")
1506 (string-append bin "/sparql-update")))
1509 (lambda* (#:key make-flags #:allow-other-keys)
1510 (apply invoke "make" `(,@make-flags "scan-test"))
1511 (invoke "./scan-test"))))))
1512 (home-page "https://github.com/tialaramex/sparql-query/")
1513 (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
1514 (description "Sparql-query is a command-line tool for accessing SPARQL
1515 endpoints over HTTP. It has been intentionally designed to @code{feel} similar to
1516 tools for interrogating SQL databases. For example, you can enter a query over
1517 several lines, using a semi-colon at the end of a line to indicate the end of
1518 your query. It also supports readline so that you can more easily recall and
1519 edit previous queries, even across sessions. It can be used non-interactively,
1520 for example from a shell script.")
1521 ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
1522 ;; others (like sparql-query.c) contain a GPLv2+ license header.
1523 (license (list license:gpl3+))))
1525 (define-public sqitch
1533 "mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-v"
1536 (base32 "1ayiwg9kh3w0nbacbcln7h944z94vq5vnnd5diz86033bpbnq57f"))))
1537 (build-system perl-build-system)
1540 (modify-phases %standard-phases
1541 (add-before 'check 'set-check-environment
1544 (setenv "HOME" "/tmp")
1546 (add-after 'install 'wrap-program
1547 (lambda* (#:key outputs #:allow-other-keys)
1548 (let* ((out (assoc-ref outputs "out"))
1549 (path (getenv "PERL5LIB")))
1550 (wrap-program (string-append out "/bin/sqitch")
1551 `("PERL5LIB" ":" prefix
1552 (,(string-append out "/lib/perl5/site_perl"
1557 `(("perl-capture-tiny" ,perl-capture-tiny)
1558 ("perl-io-pager" ,perl-io-pager)
1559 ("perl-module-build" ,perl-module-build)
1560 ("perl-module-runtime" ,perl-module-runtime)
1561 ("perl-path-class" ,perl-path-class)
1562 ("perl-test-deep" ,perl-test-deep)
1563 ("perl-test-dir" ,perl-test-dir)
1564 ("perl-test-exception" ,perl-test-exception)
1565 ("perl-test-file" ,perl-test-file)
1566 ("perl-test-file-contents" ,perl-test-file-contents)
1567 ("perl-test-mockmodule" ,perl-test-mockmodule)
1568 ("perl-test-mockobject" ,perl-test-mockobject)
1569 ("perl-test-nowarnings" ,perl-test-nowarnings)
1570 ("perl-test-warn" ,perl-test-warn)))
1572 `(("perl-class-xsaccessor" ,perl-class-xsaccessor)
1573 ("perl-clone" ,perl-clone)
1574 ("perl-config-gitlike" ,perl-config-gitlike)
1575 ("perl-datetime" ,perl-datetime)
1576 ("perl-datetime-timezone" ,perl-datetime-timezone)
1577 ("perl-dbd-mysql" ,perl-dbd-mysql)
1578 ("perl-dbd-pg" ,perl-dbd-pg)
1579 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1580 ("perl-dbi" ,perl-dbi)
1581 ("perl-devel-stacktrace" ,perl-devel-stacktrace)
1582 ("perl-encode-locale" ,perl-encode-locale)
1583 ("perl-hash-merge" ,perl-hash-merge)
1584 ("perl-ipc-run3" ,perl-ipc-run3)
1585 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
1586 ("perl-libintl-perl" ,perl-libintl-perl)
1587 ("perl-list-moreutils" ,perl-list-moreutils)
1588 ("perl-moo" ,perl-moo)
1589 ("perl-mysql-config" ,perl-mysql-config)
1590 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1591 ("perl-path-class" ,perl-path-class)
1592 ("perl-perlio-utf8_strict" ,perl-perlio-utf8_strict)
1593 ("perl-string-formatter" ,perl-string-formatter)
1594 ("perl-string-shellquote" ,perl-string-shellquote)
1595 ("perl-sub-exporter" ,perl-sub-exporter)
1596 ("perl-template-tiny" ,perl-template-tiny)
1597 ("perl-template-toolkit" ,perl-template-toolkit)
1598 ("perl-throwable" ,perl-throwable)
1599 ("perl-try-tiny" ,perl-try-tiny)
1600 ("perl-type-tiny" ,perl-type-tiny)
1601 ("perl-type-tiny-xs" ,perl-type-tiny-xs)
1602 ("perl-uri" ,perl-uri)
1603 ("perl-uri-db" ,perl-uri-db)))
1604 (home-page "https://sqitch.org/")
1605 (synopsis "Database change management tool")
1607 "Sqitch is a standalone change management system for database schemas,
1608 which uses SQL to describe changes.")
1609 (license license:x11)))
1611 (define-public sqlcrush
1612 ;; Unfortunately, there is no proper upstream release and may never be.
1613 (let ((commit "b5f6868f189566a26eecc78d0f0659813c1aa98a")
1617 (version (git-version "0.1.5" revision commit))
1621 (url "https://github.com/coffeeandscripts/sqlcrush")
1623 (file-name (git-file-name name version))
1626 "0x3wy40r93p0jv3nbwj9a77wa4ff697d13r0wffmm7q9h3mzsww8"))))
1627 (build-system python-build-system)
1629 `(("python-cryptography" ,python-cryptography)
1630 ("python-psycopg2" ,python-psycopg2)
1631 ("python-pymysql" ,python-pymysql)
1632 ("python-sqlalchemy" ,python-sqlalchemy)))
1633 (home-page "https://github.com/coffeeandscripts/sqlcrush")
1634 (synopsis "Text console-based database viewer and editor")
1636 "SQLcrush lets you view and edit a database directly from the text
1637 console through an ncurses interface. You can explore each table's structure,
1638 browse and edit the contents, add and delete entries, all while tracking your
1640 (license license:gpl3+)))) ; no headers, see README.md
1648 (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
1652 "06waz0k50c7v3chd08mzp2rv7w4k4q9isbxx3vhlfpx1vy9q61f8"))))
1653 (build-system gnu-build-system)
1656 (modify-phases %standard-phases
1658 (lambda* (#:key outputs #:allow-other-keys)
1659 (let ((out (assoc-ref outputs "out")))
1660 ;; The 'configure' script is a wrapper for Waf and
1661 ;; doesn't recognize things like '--enable-fast-install'.
1662 (invoke "./configure"
1663 (string-append "--prefix=" out))))))))
1665 `(;; TODO: Build the documentation.
1666 ;; ("docbook-xsl" ,docbook-xsl)
1667 ;; ("libxml2" ,libxml2)
1668 ;; ("libxslt" ,libxslt)
1669 ("python" ,python) ;for the Waf build system
1671 (home-page "https://tdb.samba.org/")
1672 (synopsis "Trivial database")
1674 "TDB is a Trivial Database. In concept, it is very much like GDBM,
1675 and BSD's DB except that it allows multiple simultaneous writers and uses
1676 locking internally to keep writers from trampling on each other. TDB is also
1678 (license license:lgpl3+)))
1680 (define-public perl-dbi
1687 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
1691 "1yinx39960y241vf2sknxj0dfz82a5m9gvklq5rw78k0nlyrjawa"))))
1692 (build-system perl-build-system)
1693 (synopsis "Database independent interface for Perl")
1694 (description "This package provides an database interface for Perl.")
1695 (home-page "https://metacpan.org/release/DBI")
1696 (license license:perl-license)))
1698 (define-public perl-dbix-class
1700 (name "perl-dbix-class")
1701 (version "0.082842")
1705 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1706 "DBIx-Class-" version ".tar.gz"))
1708 (base32 "1rh7idjjbibc1zmiaaarask434lh0lx7f2xyfwmy37k9fa0xcpmh"))))
1709 (build-system perl-build-system)
1711 `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
1712 ("perl-file-temp" ,perl-file-temp)
1713 ("perl-module-install" ,perl-module-install)
1714 ("perl-package-stash" ,perl-package-stash)
1715 ("perl-test-deep" ,perl-test-deep)
1716 ("perl-test-exception" ,perl-test-exception)
1717 ("perl-test-warn" ,perl-test-warn)))
1719 `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1720 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1721 ("perl-class-inspector" ,perl-class-inspector)
1722 ("perl-config-any" ,perl-config-any)
1723 ("perl-context-preserve" ,perl-context-preserve)
1724 ("perl-data-dumper-concise" ,perl-data-dumper-concise)
1725 ("perl-data-page" ,perl-data-page)
1726 ("perl-dbi" ,perl-dbi)
1727 ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
1728 ("perl-hash-merge" ,perl-hash-merge)
1729 ("perl-module-find" ,perl-module-find)
1730 ("perl-moo" ,perl-moo)
1731 ("perl-mro-compat" ,perl-mro-compat)
1732 ("perl-namespace-clean" ,perl-namespace-clean)
1733 ("perl-path-class" ,perl-path-class)
1734 ("perl-scalar-list-utils" ,perl-scalar-list-utils)
1735 ("perl-scope-guard" ,perl-scope-guard)
1736 ("perl-sql-abstract-classic" ,perl-sql-abstract-classic)
1737 ("perl-sub-name" ,perl-sub-name)
1738 ("perl-text-balanced" ,perl-text-balanced)
1739 ("perl-try-tiny" ,perl-try-tiny)))
1740 (home-page "https://metacpan.org/release/DBIx-Class")
1741 (synopsis "Extensible and flexible object <-> relational mapper")
1742 (description "An SQL to OO mapper with an object API inspired by
1743 Class::DBI (with a compatibility layer as a springboard for porting) and a
1744 resultset API that allows abstract encapsulation of database operations. It
1745 aims to make representing queries in your code as perl-ish as possible while
1746 still providing access to as many of the capabilities of the database as
1747 possible, including retrieving related records from multiple tables in a
1748 single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
1749 \"ORDER BY\" and \"HAVING\" support.")
1750 (license license:perl-license)))
1752 (define-public perl-dbix-class-cursor-cached
1754 (name "perl-dbix-class-cursor-cached")
1755 (version "1.001004")
1759 (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
1760 "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
1763 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
1764 (build-system perl-build-system)
1766 `(("perl-cache-cache" ,perl-cache-cache)
1767 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1768 ("perl-module-install" ,perl-module-install)))
1770 `(("perl-carp-clan" ,perl-carp-clan)
1771 ("perl-dbix-class" ,perl-dbix-class)))
1772 (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached")
1773 (synopsis "Cursor with built-in caching support")
1774 (description "DBIx::Class::Cursor::Cached provides a cursor class with
1775 built-in caching support.")
1776 (license license:perl-license)))
1778 (define-public perl-dbix-class-introspectablem2m
1780 (name "perl-dbix-class-introspectablem2m")
1781 (version "0.001002")
1785 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1786 "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
1789 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
1790 (build-system perl-build-system)
1792 `(("perl-module-install" ,perl-module-install)))
1794 `(("perl-dbix-class" ,perl-dbix-class)))
1795 (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M")
1796 (synopsis "Introspect many-to-many relationships")
1797 (description "Because the many-to-many relationships are not real
1798 relationships, they can not be introspected with DBIx::Class. Many-to-many
1799 relationships are actually just a collection of convenience methods installed
1800 to bridge two relationships. This DBIx::Class component can be used to store
1801 all relevant information about these non-relationships so they can later be
1802 introspected and examined.")
1803 (license license:perl-license)))
1805 (define-public perl-dbix-class-schema-loader
1807 (name "perl-dbix-class-schema-loader")
1812 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1813 "DBIx-Class-Schema-Loader-" version ".tar.gz"))
1816 "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8"))))
1817 (build-system perl-build-system)
1819 `(("perl-config-any" ,perl-config-any)
1820 ("perl-config-general" ,perl-config-general)
1821 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1822 ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
1823 ("perl-module-install" ,perl-module-install)
1824 ("perl-moose" ,perl-moose)
1825 ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
1826 ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
1827 ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1828 ("perl-test-deep" ,perl-test-deep)
1829 ("perl-test-differences" ,perl-test-differences)
1830 ("perl-test-exception" ,perl-test-exception)
1831 ("perl-test-pod" ,perl-test-pod)
1832 ("perl-test-warn" ,perl-test-warn)))
1834 `(("perl-class-unload" ,perl-class-unload)
1835 ("perl-class-inspector" ,perl-class-inspector)
1836 ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1837 ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1838 ("perl-carp-clan" ,perl-carp-clan)
1839 ("perl-data-dump" ,perl-data-dump)
1840 ("perl-dbix-class" ,perl-dbix-class)
1841 ("perl-hash-merge" ,perl-hash-merge)
1842 ("perl-list-moreutils" ,perl-list-moreutils)
1843 ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
1844 ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
1845 ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
1846 ("perl-namespace-clean" ,perl-namespace-clean)
1847 ("perl-mro-compat" ,perl-mro-compat)
1848 ("perl-scope-guard" ,perl-scope-guard)
1849 ("perl-string-camelcase" ,perl-string-camelcase)
1850 ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
1851 ("perl-sub-name" ,perl-sub-name)
1852 ("perl-try-tiny" ,perl-try-tiny)))
1853 (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails
1854 (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader")
1855 (synopsis "Create a DBIx::Class::Schema based on a database")
1856 (description "DBIx::Class::Schema::Loader automates the definition of a
1857 DBIx::Class::Schema by scanning database table definitions and setting up the
1858 columns, primary keys, unique constraints and relationships.")
1859 (license license:perl-license)))
1861 (define-public perl-dbd-pg
1863 (name "perl-dbd-pg")
1868 (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
1869 "DBD-Pg-" version ".tar.gz"))
1872 "0gkqlvbmzbdm0g4k328nlkjdg3wrjm5i2n9jxj1i8sqxkm79rylz"))))
1873 (build-system perl-build-system)
1875 `(("perl-dbi" ,perl-dbi)))
1877 `(("perl-dbi" ,perl-dbi)
1878 ("postgresql" ,postgresql)))
1879 (home-page "https://metacpan.org/release/DBD-Pg")
1880 (synopsis "DBI PostgreSQL interface")
1881 (description "This package provides a PostgreSQL driver for the Perl5
1882 @dfn{Database Interface} (DBI).")
1883 (license license:perl-license)))
1885 (define-public perl-dbd-mysql
1887 (name "perl-dbd-mysql")
1892 (uri (string-append "mirror://cpan/authors/id/D/DV/DVEEDEN/"
1893 "DBD-mysql-" version ".tar.gz"))
1895 (base32 "0y4djb048i09dk19av7mzfb3khr72vw11p3ayw2p82jsy4gm8j2g"))))
1896 (build-system perl-build-system)
1899 (modify-phases %standard-phases
1900 (add-before 'configure 'skip-library-detection
1901 ;; Avoid depencies on perl-devel-checklib, openssl, and zlib. They
1902 ;; are really only needed for the test suite; their absence does not
1903 ;; affect the build or the end result.
1905 (substitute* "Makefile.PL"
1906 (("use Devel::CheckLib;" match)
1907 (string-append "# " match))
1911 ;; Tests require running MySQL server.
1914 `(("perl-dbi" ,perl-dbi)
1915 ("mysql" ,mariadb "lib")
1916 ("mysql-dev" ,mariadb "dev")))
1917 (home-page "https://metacpan.org/release/DBD-mysql")
1918 (synopsis "DBI MySQL interface")
1919 (description "This package provides a MySQL driver for the Perl5
1920 @dfn{Database Interface} (DBI).")
1921 (license license:perl-license)))
1923 (define-public perl-dbd-sqlite
1925 (name "perl-dbd-sqlite")
1930 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
1934 "1zljln5nh61gj3k22a1fv2vhx5l83waizmarwkh77hk6kzzmvrw9"))))
1935 (build-system perl-build-system)
1936 (inputs `(("sqlite" ,sqlite)))
1937 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
1938 (synopsis "SQlite interface for Perl")
1939 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
1940 the entire thing in the distribution. So in order to get a fast transaction
1941 capable RDBMS working for your Perl project you simply have to install this
1942 module, and nothing else.")
1943 (license license:perl-license)
1944 (home-page "https://metacpan.org/release/DBD-SQLite")))
1946 (define-public perl-mysql-config
1948 (name "perl-mysql-config")
1954 "mirror://cpan/authors/id/D/DA/DARREN/MySQL-Config-"
1959 "1svn7ccw2gc4cazvc58j84rxhnc9vs01zpird0l8460598j475qr"))))
1960 (build-system perl-build-system)
1961 (home-page "https://metacpan.org/release/MySQL-Config")
1962 (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files")
1964 "@code{MySQL::Config} emulates the @code{load_defaults} function from
1965 libmysqlclient. It will fill an array with long options, ready to be parsed by
1966 @code{Getopt::Long}.")
1967 (license license:perl-license)))
1969 (define-public perl-sql-abstract
1971 (name "perl-sql-abstract")
1976 (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1977 "SQL-Abstract-" version ".tar.gz"))
1979 (base32 "0jhw91b23wc9bkfwcgvka4x5ddxk58m9bcp5ay7a3vx77nla09p9"))))
1980 (build-system perl-build-system)
1982 `(("perl-module-install" ,perl-module-install)
1983 ("perl-test-deep" ,perl-test-deep)
1984 ("perl-test-exception" ,perl-test-exception)
1985 ("perl-test-warn" ,perl-test-warn)))
1987 `(("perl-hash-merge" ,perl-hash-merge)
1988 ("perl-moo" ,perl-moo)
1989 ("perl-mro-compat" ,perl-mro-compat)
1990 ("perl-text-balanced" ,perl-text-balanced)))
1991 (home-page "https://metacpan.org/release/SQL-Abstract")
1992 (synopsis "Generate SQL from Perl data structures")
1993 (description "This module was inspired by the excellent DBIx::Abstract.
1994 While based on the concepts used by DBIx::Abstract, the concepts used have
1995 been modified to make the SQL easier to generate from Perl data structures.
1996 The underlying idea is for this module to do what you mean, based on the data
1997 structures you provide it, so that you don't have to modify your code every
1998 time your data changes.")
1999 (license license:perl-license)))
2001 (define-public perl-sql-abstract-classic
2003 (name "perl-sql-abstract-classic")
2008 (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
2009 "SQL-Abstract-Classic-" version ".tar.gz"))
2011 (base32 "0a7g13hs3kdxrjn43sfli09mgsi9d6w0dfw6hlk268av17yisgaf"))))
2012 (build-system perl-build-system)
2014 `(("perl-test-deep" ,perl-test-deep)
2015 ("perl-test-exception" ,perl-test-exception)
2016 ("perl-test-warn" ,perl-test-warn)))
2018 `(("perl-mro-compat" ,perl-mro-compat)
2019 ("perl-sql-abstract" ,perl-sql-abstract)))
2020 (home-page "https://metacpan.org/release/SQL-Abstract-Classic")
2021 (synopsis "Generate SQL from Perl data structures")
2023 "This module is nearly identical to @code{SQL::Abstract} 1.81, and exists
2024 to preserve the ability of users to opt into the new way of doing things in
2025 later versions according to their own schedules.
2027 It is an abstract SQL generation module based on the concepts used by
2028 @code{DBIx::Abstract}, with several important differences, especially when it
2029 comes to @code{WHERE} clauses. These concepts were modified to make the SQL
2030 easier to generate from Perl data structures.
2032 The underlying idea is for this module to do what you mean, based on the data
2033 structures you provide it. You shouldn't have to modify your code every time
2034 your data changes, as this module figures it out.")
2035 (license license:perl-license)))
2037 (define-public perl-sql-splitstatement
2039 (name "perl-sql-splitstatement")
2044 (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
2045 "SQL-SplitStatement-" version ".tar.gz"))
2048 "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
2049 (build-system perl-build-system)
2051 `(("perl-test-exception" ,perl-test-exception)))
2053 `(("perl-class-accessor" ,perl-class-accessor)
2054 ("perl-list-moreutils" ,perl-list-moreutils)
2055 ("perl-regexp-common" ,perl-regexp-common)
2056 ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
2057 (home-page "https://metacpan.org/release/SQL-SplitStatement")
2058 (synopsis "Split SQL code into atomic statements")
2059 (description "This module tries to split any SQL code, even including
2060 non-standard extensions, into the atomic statements it is composed of.")
2061 (license license:perl-license)))
2063 (define-public perl-sql-tokenizer
2065 (name "perl-sql-tokenizer")
2070 (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
2071 "SQL-Tokenizer-" version ".tar.gz"))
2074 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
2075 (build-system perl-build-system)
2076 (home-page "https://metacpan.org/release/SQL-Tokenizer")
2077 (synopsis "SQL tokenizer")
2078 (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not
2079 claim to be a parser or query verifier. It just creates sane tokens from a
2081 (license license:perl-license)))
2083 (define-public unixodbc
2091 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
2094 (base32 "01xj65d02i3yjy7p9z08y9jakcs5szmz4rask868n7387nn3x0sj"))))
2095 (build-system gnu-build-system)
2096 (synopsis "Data source abstraction library")
2097 (description "Unixodbc is a library providing an API with which to access
2098 data sources. Data sources include SQL Servers and any software with an ODBC
2100 (license license:lgpl2.1+)
2101 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
2102 (home-page "http://www.unixodbc.org")))
2104 (define-public unqlite
2110 ;; Contains bug fixes against the official release, and has an
2111 ;; autotooled build system.
2112 (uri (string-append "https://github.com/aidin36/tocc/releases/"
2114 "unqlite-unofficial-" version ".tar.gz"))
2117 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
2118 (build-system gnu-build-system)
2119 (arguments `(#:tests? #f)) ;No check target
2120 (home-page "https://www.unqlite.org")
2121 (synopsis "In-memory key/value and document store")
2123 "UnQLite is an in-process software library which implements a
2124 self-contained, serverless, zero-configuration, transactional NoSQL
2125 database engine. UnQLite is a document store database similar to
2126 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
2127 similar to BerkeleyDB, LevelDB, etc.")
2128 (license license:bsd-2)))
2130 (define-public redis
2136 (uri (string-append "http://download.redis.io/releases/redis-"
2140 "1pc6gyiylrcazlc559dp5mxqj733pk9qabnirw4ry3k23kwdqayw"))
2141 (modules '((guix build utils)))
2143 ;; Delete bundled jemalloc, as the package will use the libc one
2144 '(begin (delete-file-recursively "deps/jemalloc")
2146 (build-system gnu-build-system)
2148 `(("procps" ,procps) ; for tests
2149 ("tcl" ,tcl))) ; for tests
2152 (modify-phases %standard-phases
2154 (add-after 'unpack 'use-correct-tclsh
2155 (lambda* (#:key inputs #:allow-other-keys)
2156 (substitute* "runtest"
2158 (string-append "TCLSH="
2159 (assoc-ref inputs "tcl")
2162 (add-after 'unpack 'adjust-tests
2164 ;; Disable failing tests
2165 (substitute* "tests/test_helper.tcl"
2166 ((" integration/replication[^-]") "")
2167 ((" integration/replication-4") "")
2168 ((" integration/replication-psync") ""))
2170 #:make-flags `("CC=gcc"
2173 ,(string-append "PREFIX="
2174 (assoc-ref %outputs "out")))))
2175 (synopsis "Key-value cache and store")
2176 (description "Redis is an advanced key-value cache and store. Redis
2177 supports many data structures including strings, hashes, lists, sets, sorted
2178 sets, bitmaps and hyperloglogs.")
2179 (home-page "https://redis.io/")
2180 (license license:bsd-3)))
2182 (define-public kyotocabinet
2184 (name "kyotocabinet")
2188 (uri (string-append "https://fallabs.com/kyotocabinet/pkg/"
2189 "kyotocabinet-" version ".tar.gz"))
2192 "1bxkf9kmcavq9rqridb8mvmrk3hj4447ffi24m2admsbm61n6k29"))))
2193 (build-system gnu-build-system)
2197 "--disable-opt" ;"-march=native". XXX this also turns off -O0.
2198 (string-append "LDFLAGS=-Wl,-rpath="
2199 (assoc-ref %outputs "out") "/lib"))))
2200 (inputs `(("zlib" ,zlib)))
2201 (home-page "https://fallabs.com/kyotocabinet/")
2203 "Kyoto Cabinet is a modern implementation of the DBM database")
2205 "Kyoto Cabinet is a standalone file-based database that supports Hash
2206 and B+ Tree data storage models. It is a fast key-value lightweight
2207 database and supports many programming languages. It is a NoSQL database.")
2208 (license license:gpl3+)))
2210 (define-public tokyocabinet
2212 (name "tokyocabinet")
2217 (uri (string-append "http://fallabs.com/tokyocabinet/"
2218 name "-" version ".tar.gz"))
2221 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
2222 (build-system gnu-build-system)
2225 (list "--enable-pthread" "--enable-off64" "--enable-fastest"
2226 (string-append "LDFLAGS=-Wl,-rpath="
2227 (assoc-ref %outputs "out") "/lib"))))
2230 (home-page "http://fallabs.com/tokyocabinet/")
2231 (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
2233 "Tokyo Cabinet is a library of routines for managing a database.
2234 The database is a simple data file containing records, each is a pair of a
2235 key and a value. Every key and value is serial bytes with variable length.
2236 Both binary data and character string can be used as a key and a value.
2237 There is neither concept of data tables nor data types. Records are
2238 organized in hash table, B+ tree, or fixed-length array.")
2239 (license license:lgpl2.1+)))
2241 (define-public wiredtiger
2248 "http://source.wiredtiger.com/releases/wiredtiger-"
2249 version ".tar.bz2"))
2252 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
2253 (build-system gnu-build-system)
2255 '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib")
2257 (modify-phases %standard-phases
2258 (add-before 'check 'disable-test/fops
2260 ;; XXX: timed out after 3600 seconds of silence
2261 (substitute* "Makefile"
2267 ("snappy" ,snappy)))
2268 (home-page "http://source.wiredtiger.com/")
2269 (synopsis "NoSQL data engine")
2271 "WiredTiger is an extensible platform for data management. It supports
2272 row-oriented storage (where all columns of a row are stored together),
2273 column-oriented storage (where columns are stored in groups, allowing for
2274 more efficient access and storage of column subsets) and log-structured merge
2275 trees (LSM), for sustained throughput under random insert workloads.")
2276 (license license:gpl3) ; or GPL-2
2277 ;; configure.ac: WiredTiger requires a 64-bit build.
2278 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
2280 (define-public wiredtiger-3
2282 (inherit wiredtiger)
2287 (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-"
2288 version ".tar.bz2"))
2291 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx"))))))
2293 (define-public guile-wiredtiger
2295 (name "guile-wiredtiger")
2300 (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
2301 (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b")))
2302 (file-name (string-append name "-" version "-checkout"))
2305 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595"))))
2306 (build-system gnu-build-system)
2308 '(#:parallel-tests? #f ;; tests can't be run in parallel, yet.
2310 (list (string-append "--with-libwiredtiger-prefix="
2311 (assoc-ref %build-inputs "wiredtiger")))
2312 #:make-flags '("GUILE_AUTO_COMPILE=0")))
2314 `(("autoconf" ,autoconf)
2315 ("automake" ,automake)
2316 ("pkg-config" ,pkg-config)))
2318 `(("wiredtiger" ,wiredtiger-3)
2319 ("guile" ,guile-2.2)))
2321 `(("guile-bytestructures" ,guile-bytestructures)))
2322 (synopsis "WiredTiger bindings for GNU Guile")
2324 "This package provides Guile bindings to the WiredTiger ``NoSQL''
2326 (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger")
2327 (license license:gpl3+)))
2329 (define-public perl-db-file
2331 (name "perl-db-file")
2336 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
2339 (base32 "0q599h7g4jkzks5dxf1zifx9k7l9vif26r2dlgkzxkg6bfif5zyr"))))
2340 (build-system perl-build-system)
2341 (inputs `(("bdb" ,bdb)))
2342 (native-inputs `(("perl-test-pod" ,perl-test-pod)))
2344 `(#:phases (modify-phases %standard-phases
2346 'configure 'modify-config.in
2347 (lambda* (#:key inputs #:allow-other-keys)
2348 (substitute* "config.in"
2349 (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
2351 (home-page "https://metacpan.org/release/DB_File")
2352 (synopsis "Perl5 access to Berkeley DB version 1.x")
2354 "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
2355 (license license:perl-license)))
2365 (url "https://git.openldap.org/openldap/openldap.git")
2366 (commit (string-append "LMDB_" version))))
2367 (file-name (git-file-name name version))
2369 (base32 "09xqqm8yjsf1gv4gd4llal48sms76hfhxadx6rik1j2g5v3d3f1k"))))
2370 (build-system gnu-build-system)
2372 `(#:test-target "test"
2374 (modify-phases %standard-phases
2376 (lambda* (#:key outputs #:allow-other-keys)
2377 (chdir "libraries/liblmdb")
2378 (substitute* "Makefile"
2379 (("/usr/local") (assoc-ref outputs "out")))
2381 (add-after 'install 'create-pkg-config-file
2382 (lambda* (#:key outputs #:allow-other-keys)
2383 (let ((out (assoc-ref outputs "out")))
2384 (mkdir-p (string-append out "/lib/pkgconfig"))
2385 (with-output-to-file (string-append out "/lib/pkgconfig/liblmdb.pc")
2387 (format #t "prefix=~a~@
2390 includedir=~a/include~@
2394 Description: Lightning Memory-Mapped Database library~@
2395 Libs: -L${libdir} -llmdb~@
2396 Cflags: -I${includedir}~%"
2397 out out out out ,version)))
2399 (home-page "https://symas.com/lmdb/")
2400 (synopsis "Lightning Memory-Mapped Database library")
2402 "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
2403 transactional database. Unlike more complex relational databases, LMDB handles
2404 only key-value pairs (stored as arbitrary byte arrays) and relies on the
2405 underlying operating system for caching and locking, keeping the code small and
2407 The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
2408 disk-based databases with high read performance that scales linearly over
2409 multiple cores. The size of each database is limited only by the size of the
2410 virtual address space — not physical RAM.")
2411 (license license:openldap2.8)))
2413 (define-public lmdbxx
2416 (version "0.9.14.0")
2421 (url "https://github.com/drycpp/lmdbxx")
2423 (file-name (git-file-name name version))
2425 (base32 "1jmb9wg2iqag6ps3z71bh72ymbcjrb6clwlkgrqf1sy80qwvlsn6"))))
2428 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
2430 (modify-phases %standard-phases
2431 (delete 'configure))))
2432 (build-system gnu-build-system)
2433 (inputs `(("lmdb" ,lmdb)))
2434 (home-page "http://lmdbxx.sourceforge.net")
2435 (synopsis "C++11 wrapper for the LMDB embedded B+ tree database library")
2436 (description "@code{lmdbxx} is a comprehensive @code{C++} wrapper for the
2437 @code{LMDB} embedded database library, offering both an error-checked
2438 procedural interface and an object-oriented resource interface with RAII
2440 (license license:unlicense)))
2442 (define-public libpqxx
2449 "http://pqxx.org/download/software/libpqxx/"
2450 name "-" version ".tar.gz"))
2453 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
2454 (build-system gnu-build-system)
2456 `(("python" ,python-2)))
2457 (inputs `(("postgresql" ,postgresql)))
2459 `(#:tests? #f ; # FAIL: 1
2461 (modify-phases %standard-phases
2462 (add-before 'configure 'fix-sed-command
2464 ;; Newer sed versions error out if double brackets are not used.
2465 (substitute* "configure"
2466 (("\\[:space:\\]") "[[:space:]]"))
2468 (synopsis "C++ connector for PostgreSQL")
2470 "Libpqxx is a C++ library to enable user programs to communicate with the
2471 PostgreSQL database back-end. The database back-end can be local or it may be
2472 on another machine, accessed via TCP/IP.")
2473 (home-page "http://pqxx.org/")
2474 (license license:bsd-3)))
2476 (define-public python-peewee
2478 (name "python-peewee")
2483 (uri (pypi-uri "peewee" version))
2485 (base32 "1yl49gxrg0c2x3n3r60z3lixw9am8b61s0477l9vjabhhx1yziar"))))
2486 (build-system python-build-system)
2488 `(#:tests? #f)) ; fails to import test data
2490 `(("sqlite" ,sqlite)))
2492 `(("python-cython" ,python-cython)))
2493 (home-page "https://github.com/coleifer/peewee/")
2494 (synopsis "Small object-relational mapping utility")
2496 "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee
2497 handles converting between pythonic values and those used by databases, so you
2498 can use Python types in your code without having to worry. It has built-in
2499 support for sqlite, mysql and postgresql. If you already have a database, you
2500 can autogenerate peewee models using @code{pwiz}, a model generator.")
2501 (license license:expat)))
2503 (define-public python2-peewee
2504 (package-with-python2 python-peewee))
2506 (define-public python-tortoise-orm
2508 (name "python-tortoise-orm")
2513 (uri (pypi-uri "tortoise-orm" version))
2516 "0wr7p4v0b16ypm9fcpwpl99kf491m6w3jkd13xcsgq13fy73fbqc"))))
2517 (build-system python-build-system)
2518 ;; Disable tests for now. They pull in a lot of dependencies.
2519 (arguments `(#:tests? #f))
2521 `(("python-asynctest" ,python-asynctest)
2522 ("python-nose2" ,python-nose2)))
2524 `(("python-aiosqlite" ,python-aiosqlite)
2525 ("python-pypika" ,python-pypika)
2526 ("python-ciso8601" ,python-ciso8601)
2527 ("python-typing-extensions"
2528 ,python-typing-extensions)))
2530 "https://github.com/tortoise/tortoise-orm")
2532 "Easy async ORM for python, built with relations in mind")
2534 "Tortoise ORM is an easy-to-use asyncio ORM (Object Relational Mapper)
2535 inspired by Django. Tortoise ORM was build with relations in mind and
2536 admiration for the excellent and popular Django ORM. It’s engraved in its
2537 design that you are working not with just tables, you work with relational
2539 (license license:asl2.0)))
2541 (define-public sqlcipher
2548 (uri (string-append "https://github.com/sqlcipher/" name
2549 "/archive/v" version ".tar.gz"))
2551 (base32 "1nxarwbci8jx99f1d0y1ivxcv25s78l1p7q6qy28lkpkcx8pm2b9"))
2552 (file-name (string-append name "-" version ".tar.gz"))))
2553 (build-system gnu-build-system)
2555 `(("libcrypto" ,openssl)
2556 ("libtcl8.6" ,tcl))) ; required for running the tests
2561 '("--enable-tempstore=yes"
2562 "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
2563 "LDFLAGS=-lcrypto -ltcl8.6"
2565 ;; tests cannot be run from the Makefile
2566 ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
2567 #:test-target "testfixture"
2569 (modify-phases %standard-phases
2570 (add-before 'check 'build-test-runner
2571 (assoc-ref %standard-phases 'check))
2574 (invoke "./testfixture" "test/crypto.test"))))))
2575 (home-page "https://www.zetetic.net/sqlcipher/")
2577 "Library providing transparent encryption of SQLite database files")
2578 (description "SQLCipher is an implementation of SQLite, extended to
2579 provide transparent 256-bit AES encryption of database files. Pages are
2580 encrypted before being written to disk and are decrypted when read back. It’s
2581 well suited for protecting embedded application databases and for mobile
2584 ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
2585 ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
2586 ;; test/crypto.test are licensed under a 3-clause BSD license. All other
2587 ;; source files are in the public domain.
2588 (license (list license:public-domain license:bsd-3))))
2590 (define-public python-pyodbc-c
2592 (name "python-pyodbc-c")
2597 (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
2598 "archive.tar.gz?ref=v" version))
2601 "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
2602 (file-name (string-append name "-" version ".tar.gz"))))
2603 (build-system python-build-system)
2605 `(("unixodbc" ,unixodbc)))
2607 `(;; No unit tests exist.
2609 (home-page "https://github.com/mkleehammer/pyodbc")
2610 (synopsis "Python ODBC Library")
2611 (description "@code{python-pyodbc-c} provides a Python DB-API driver
2613 (license (license:x11-style "file://LICENSE.TXT"))))
2615 (define-public python2-pyodbc-c
2616 (package-with-python2 python-pyodbc-c))
2618 (define-public python-pyodbc
2620 (name "python-pyodbc")
2625 (uri (pypi-uri "pyodbc" version))
2627 (base32 "0skjpraar6hcwsy82612bpj8nw016ncyvvq88j5syrikxgp5saw5"))
2628 (file-name (string-append name "-" version ".tar.gz"))))
2629 (build-system python-build-system)
2631 `(("unixodbc" ,unixodbc)))
2633 `(#:tests? #f)) ; no unit tests exist
2634 (home-page "https://github.com/mkleehammer/pyodbc")
2635 (synopsis "Python ODBC Library")
2636 (description "@code{python-pyodbc} provides a Python DB-API driver
2638 (license (license:x11-style "file:///LICENSE.TXT"))))
2640 (define-public python2-pyodbc
2641 (package-with-python2 python-pyodbc))
2643 (define-public mdbtools
2651 (url "https://github.com/brianb/mdbtools")
2653 (file-name (git-file-name name version))
2656 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
2657 (build-system gnu-build-system)
2661 `(("autoconf" ,autoconf)
2662 ("automake" ,automake)
2663 ("libtool" ,libtool)
2664 ("pkg-config" ,pkg-config)
2665 ("txt2man" ,txt2man)
2667 (home-page "http://mdbtools.sourceforge.net/")
2668 (synopsis "Read Microsoft Access databases")
2669 (description "MDB Tools is a set of tools and applications to read the
2670 proprietary MDB file format used in Microsoft's Access database package. This
2671 includes programs to export schema and data from Microsoft's Access database
2672 file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
2673 etc., and an SQL engine for performing simple SQL queries.")
2674 (license (list license:lgpl2.0
2677 (define-public python-lmdb
2679 (name "python-lmdb")
2683 (uri (pypi-uri "lmdb" version))
2686 "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1"))
2687 (modules '((guix build utils)))
2689 ;; Delete bundled lmdb source files.
2691 (for-each delete-file (list "lib/lmdb.h"
2696 (build-system python-build-system)
2701 (modify-phases %standard-phases
2702 (add-before 'build 'use-system-lmdb
2703 (lambda* (#:key inputs #:allow-other-keys)
2704 (let ((lmdb (assoc-ref inputs "lmdb")))
2705 (setenv "LMDB_PURE" "set") ; don't apply env-copy-txn.patch
2706 (setenv "LMDB_FORCE_SYSTEM" "set")
2707 (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
2708 (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
2710 ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
2712 (home-page "https://github.com/dw/py-lmdb")
2713 (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
2715 "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
2716 Memory-Mapped Database} (LMDB), a high-performance key-value store.")
2718 (list license:openldap2.8
2719 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
2720 ;; but not actually needed on platforms currently supported by Guix.
2723 (define-public python-orator
2725 (name "python-orator")
2729 (uri (pypi-uri "orator" version))
2732 "0mbgybz63ryhr9p1f4glnls5c57jp6il3dw0kf97f3pj80687rvg"))))
2733 (build-system python-build-system)
2734 ;; FIXME: Tests are not distributed with PyPI, and the repository
2735 ;; does not contain setup.py. How to test?
2736 (arguments '(#:tests? #f))
2738 `(("python-backpack" ,python-backpack)
2739 ("python-blinker" ,python-blinker)
2740 ("python-cleo" ,python-cleo)
2741 ("python-faker" ,python-faker)
2742 ("python-inflection" ,python-inflection)
2743 ("python-lazy-object-proxy" ,python-lazy-object-proxy)
2744 ("python-pendulum" ,python-pendulum)
2745 ("python-pyaml" ,python-pyaml)
2746 ("python-pygments" ,python-pygments)
2747 ("python-pyyaml" ,python-pyyaml)
2748 ("python-simplejson" ,python-simplejson)
2749 ("python-six" ,python-six)
2750 ("python-wrapt" ,python-wrapt)))
2751 (home-page "https://orator-orm.com/")
2752 (synopsis "ActiveRecord ORM for Python")
2754 "Orator provides a simple ActiveRecord-like Object Relational Mapping
2755 implementation for Python.")
2756 (license license:expat)
2757 (properties `((python2-variant . ,(delay python2-orator))))))
2759 (define-public python2-orator
2760 (package-with-python2 (strip-python2-variant python-orator)))
2762 (define-public virtuoso-ose
2764 (name "virtuoso-ose")
2770 "https://github.com/openlink/virtuoso-opensource/releases/"
2771 "download/v" version "/virtuoso-opensource-" version ".tar.gz"))
2773 (base32 "0r1xakclkfi69pzh8z2k16z3x0m49pxp764icj0ad4w4bb97fr42"))))
2774 (build-system gnu-build-system)
2776 `(#:tests? #f ; Tests require a network connection.
2777 ;; TODO: Removing the libsrc/zlib source directory breaks the build.
2778 ;; This indicates that the internal zlib code may still be used.
2779 #:configure-flags '("--without-internal-zlib"
2781 "--enable-static=no")
2783 (modify-phases %standard-phases
2784 ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in
2785 ;; the build output. The following phase removes it.
2786 (add-after 'install 'remove-static-libs
2787 (lambda* (#:key outputs #:allow-other-keys)
2788 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
2789 (for-each (lambda (file)
2790 (delete-file (string-append lib "/" file)))
2792 "libvirtuoso-t.la"))))))))
2794 `(("openssl" ,openssl-1.0)
2795 ("net-tools" ,net-tools)
2796 ("readline" ,readline)
2798 (home-page "http://vos.openlinksw.com/owiki/wiki/VOS/")
2799 (synopsis "Multi-model database system")
2800 (description "Virtuoso is a scalable cross-platform server that combines
2801 relational, graph, and document data management with web application server
2802 and web services platform functionality.")
2803 ;; configure: error: ... can only be build on 64bit platforms
2804 (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))
2805 (license license:gpl2)))
2807 (define-public python-ccm
2814 (uri (pypi-uri "ccm" version))
2817 "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n"))))
2818 (build-system python-build-system)
2820 `(("python-pyyaml" ,python-pyyaml)
2821 ;; Not listed in setup.py, but used in ccmlib/node.py for full
2823 ("python-psutil" ,python-psutil)
2824 ("python-six" ,python-six)))
2825 (home-page "https://github.com/pcmanus/ccm")
2826 (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
2828 (description "Cassandra Cluster Manager is a development tool for testing
2829 local Cassandra clusters. It creates, launches and removes Cassandra clusters
2831 (license license:asl2.0)))
2833 (define-public python2-ccm
2834 (package-with-python2 python-ccm))
2836 (define-public python2-pysqlite
2838 (name "python2-pysqlite")
2843 (uri (pypi-uri "pysqlite" version))
2846 "1424gwq9sil2ffmnizk60q36vydkv8rxs6m7xs987kz8cdc37lqp"))))
2847 (build-system python-build-system)
2849 `(("sqlite" ,sqlite)))
2851 `(#:python ,python-2 ; incompatible with Python 3
2852 #:tests? #f)) ; no test target
2853 (home-page "https://github.com/ghaering/pysqlite")
2854 (synopsis "SQLite bindings for Python")
2856 "Pysqlite provides SQLite bindings for Python that comply to the
2857 Database API 2.0T.")
2858 (license license:zlib)))
2860 (define-public python-sqlalchemy
2862 (name "python-sqlalchemy")
2867 (uri (pypi-uri "SQLAlchemy" version))
2869 (base32 "18b9am7bsqc4nj3d2h5r93i002apczxfvpfpcqbd6f0385zmrwnj"))))
2870 (build-system python-build-system)
2872 `(("python-cython" ,python-cython) ; for C extensions
2873 ("python-pytest" ,python-pytest)
2874 ("python-mock" ,python-mock))) ; for tests
2877 (modify-phases %standard-phases
2879 (lambda _ (invoke "py.test"))))))
2880 (home-page "https://www.sqlalchemy.org")
2881 (synopsis "Database abstraction library")
2883 "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
2884 gives application developers the full power and flexibility of SQL. It
2885 provides a full suite of well known enterprise-level persistence patterns,
2886 designed for efficient and high-performing database access, adapted into a
2887 simple and Pythonic domain language.")
2888 (license license:x11)))
2890 (define-public python2-sqlalchemy
2891 (package-with-python2 python-sqlalchemy))
2893 (define-public python-sqlalchemy-utils
2895 (name "python-sqlalchemy-utils")
2900 (uri (pypi-uri "SQLAlchemy-Utils" version))
2903 "1myn71dn8j74xglyh46f12sh8ywb7j0j732rzwq70kvwwnq32m73"))))
2904 (build-system python-build-system)
2906 '(#:tests? #f)) ; FIXME: Many tests require a running database server.
2908 ;; (modify-phases %standard-phases
2911 ;; (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
2913 `(("python-six" ,python-six)
2914 ("python-sqlalchemy" ,python-sqlalchemy)))
2916 `(("python-dateutil" ,python-dateutil)
2917 ("python-flexmock" ,python-flexmock)
2918 ("python-psycopg2" ,python-psycopg2)
2919 ("python-pytest" ,python-pytest)
2920 ("python-pytz" ,python-pytz)))
2921 (home-page "https://github.com/kvesteri/sqlalchemy-utils")
2922 (synopsis "Various utility functions for SQLAlchemy")
2924 "SQLAlchemy-utils provides various utility functions and custom data types
2925 for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python.
2927 You might also want to install the following optional dependencies:
2929 @item @code{python-passlib}
2930 @item @code{python-babel}
2931 @item @code{python-cryptography}
2932 @item @code{python-pytz}
2933 @item @code{python-psycopg2}
2934 @item @code{python-furl}
2935 @item @code{python-flask-babel}
2938 (license license:bsd-3)))
2940 (define-public python2-sqlalchemy-utils
2941 (package-with-python2 python-sqlalchemy-utils))
2943 (define-public python-alchemy-mock
2945 (name "python-alchemy-mock")
2947 (home-page "https://github.com/miki725/alchemy-mock")
2950 (uri (pypi-uri "alchemy-mock" version))
2953 "0ylxygl3bcdapzz529n8wgk7vx9gjwb3ism564ypkpd7dbsw653r"))))
2954 (build-system python-build-system)
2956 '(#:phases (modify-phases %standard-phases
2959 ;; Create pytest.ini that adds doctest options to
2960 ;; prevent test failure. Taken from tox.ini.
2961 (call-with-output-file "pytest.ini"
2963 (format port "[pytest]
2964 doctest_optionflags=IGNORE_EXCEPTION_DETAIL
2966 (invoke "pytest" "-vv" "--doctest-modules"
2967 "alchemy_mock/"))))))
2969 `(("python-mock" ,python-mock)
2970 ("python-pytest" ,python-pytest)))
2972 `(("python-six" ,python-six)
2973 ("python-sqlalchemy" ,python-sqlalchemy)))
2974 (synopsis "Mock helpers for SQLAlchemy")
2976 "This package provides mock helpers for SQLAlchemy that makes it easy
2977 to mock an SQLAlchemy session while preserving the ability to do asserts.
2979 Normally Normally SQLAlchemy's expressions cannot be easily compared as
2980 comparison on binary expression produces yet another binary expression, but
2981 this library provides functions to facilitate such comparisons.")
2982 (license license:expat)))
2984 (define-public python-alembic
2986 (name "python-alembic")
2991 (uri (pypi-uri "alembic" version))
2993 (base32 "0if2dgb088clk738p26bwk50735h6jpd2kacdgc5capv2hiz6d2k"))))
2994 (build-system python-build-system)
2996 '(#:phases (modify-phases %standard-phases
2999 (invoke "pytest" "-vv"))))))
3001 `(("python-mock" ,python-mock)
3002 ("python-pytest-cov" ,python-pytest-cov)))
3004 `(("python-dateutil" ,python-dateutil)
3005 ("python-sqlalchemy" ,python-sqlalchemy)
3006 ("python-mako" ,python-mako)
3007 ("python-editor" ,python-editor)))
3008 (home-page "https://bitbucket.org/zzzeek/alembic")
3009 (synopsis "Database migration tool for SQLAlchemy")
3011 "Alembic is a lightweight database migration tool for usage with the
3012 SQLAlchemy Database Toolkit for Python.")
3013 (license license:expat)))
3015 (define-public python2-alembic
3016 (package-with-python2 python-alembic))
3018 (define-public python-pickleshare
3020 (name "python-pickleshare")
3025 (uri (pypi-uri "pickleshare" version))
3027 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
3028 (build-system python-build-system)
3030 `(#:phases (modify-phases %standard-phases
3033 (invoke "pytest"))))))
3035 `(("python-pytest" ,python-pytest)))
3036 (home-page "https://github.com/vivainio/pickleshare")
3037 (synopsis "Tiny key value database with concurrency support")
3039 "PickleShare is a small ‘shelve’-like datastore with concurrency support.
3040 Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
3041 shelve, many processes can access the database simultaneously. Changing a
3042 value in database is immediately visible to other processes accessing the same
3043 database. Concurrency is possible because the values are stored in separate
3044 files. Hence the “database” is a directory where all files are governed by
3046 (properties `((python2-variant . ,(delay python2-pickleshare))))
3047 (license license:expat)))
3049 (define-public python2-pickleshare
3050 (let ((pickleshare (package-with-python2
3051 (strip-python2-variant python-pickleshare))))
3052 (package (inherit pickleshare)
3053 (propagated-inputs `(("python2-pathlib2" ,python2-pathlib2)
3054 ,@(package-propagated-inputs pickleshare))))))
3056 (define-public python-apsw
3058 (name "python-apsw")
3059 (version "3.31.1-r1")
3063 (uri (string-append "https://github.com/rogerbinns/apsw/releases"
3064 "/download/" version "/apsw-" version ".zip"))
3067 "1gap5lr6c7bp134nzvfwr693i6d0fqyaysg3ms2cayjldv616yfx"))))
3068 (build-system python-build-system)
3070 `(("unzip" ,unzip)))
3072 `(("sqlite" ,sqlite)))
3075 (modify-phases %standard-phases
3078 (invoke "python" "setup.py" "build" "--enable-all-extensions")
3080 (add-after 'build 'build-test-helper
3082 (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext"
3083 "-I." "-Isqlite3" "src/testextension.c")
3086 (lambda* (#:key inputs outputs #:allow-other-keys)
3087 (add-installed-pythonpath inputs outputs)
3088 (invoke "python" "setup.py" "test")
3090 (home-page "https://github.com/rogerbinns/apsw/")
3091 (synopsis "Another Python SQLite Wrapper")
3092 (description "APSW is a Python wrapper for the SQLite
3093 embedded relational database engine. In contrast to other wrappers such as
3094 pysqlite it focuses on being a minimal layer over SQLite attempting just to
3095 translate the complete SQLite API into Python.")
3096 (license license:zlib)))
3098 (define-public python2-apsw
3099 (package-with-python2 python-apsw))
3101 (define-public python-aiosqlite
3103 (name "python-aiosqlite")
3108 (uri (pypi-uri "aiosqlite" version))
3111 "1w8248yz85xyzvvh4jaxnc59fqil45aka6h82kn1rcih4rjxbnn1"))))
3112 (build-system python-build-system)
3114 `(("python-aiounittest" ,python-aiounittest)))
3115 (home-page "https://github.com/jreese/aiosqlite")
3117 "Asyncio bridge for sqlite3")
3119 "The package aiosqlite replicates the standard sqlite3 module, but with
3120 async versions of all the standard connection and cursor methods, and context
3121 managers for automatically closing connections.")
3122 (license license:expat)))
3124 (define-public python2-neo4j-driver
3126 (name "python2-neo4j-driver")
3127 ;; NOTE: When upgrading to 1.5.0, please add a python3 variant.
3131 (uri (pypi-uri "neo4j-driver" version))
3134 "011r1vh182p8mm83d8dz9rfnc3l7rf7fd00cyrbyfzi71jmc4g98"))))
3135 (build-system python-build-system)
3137 `(#:python ,python-2))
3138 (home-page "https://neo4j.com/developer/python/")
3139 (synopsis "Neo4j driver code written in Python")
3140 (description "This package provides the Neo4j Python driver that connects
3141 to the database using Neo4j's binary protocol. It aims to be minimal, while
3142 being idiomatic to Python.")
3143 (license license:asl2.0)))
3145 (define-public python2-py2neo
3147 (name "python2-py2neo")
3151 (uri (pypi-uri "py2neo" version))
3154 "1f1q95vqcvlc3nsc33p841swnjdcjazddlq2dzi3qfnjqjrajxw1"))))
3155 (build-system python-build-system)
3157 `(#:python ,python-2))
3158 (home-page "https://py2neo.org")
3159 (synopsis "Library and toolkit for working with Neo4j in Python")
3160 (description "This package provides a client library and toolkit for
3161 working with Neo4j from within Python applications and from the command
3162 line. The core library has no external dependencies and has been carefully
3163 designed to be easy and intuitive to use.")
3164 (license license:asl2.0)))
3166 (define-public python-psycopg2
3168 (name "python-psycopg2")
3173 (uri (pypi-uri "psycopg2" version))
3175 (base32 "0hzmk6b1hb5riqkljr5xics6p4zbvmis6knbczb7zhq7273zc8zv"))))
3176 (build-system python-build-system)
3178 ;; Tests would require a postgresql database "psycopg2_test"
3179 ;; and a running postgresql database management service.
3180 `(#:tests? #f)) ; TODO re-enable after providing a test-db.
3182 `(("postgresql" ,postgresql))) ; libpq
3183 (home-page "http://initd.org/psycopg/")
3184 (synopsis "Python PostgreSQL adapter")
3186 "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
3188 (license license:lgpl3+)))
3190 (define-public python2-psycopg2
3191 (package-with-python2 python-psycopg2))
3193 (define-public python-sadisplay
3195 (name "python-sadisplay")
3200 (uri (pypi-uri "sadisplay" version))
3203 "01d9lxhmgpb68gy8rd6zj6fcwp84n2qq210n1qsk3qbsir79bzh4"))))
3204 (build-system python-build-system)
3206 `(("python-sqlalchemy" ,python-sqlalchemy)))
3209 `(("python-nose" ,python-nose)))
3210 (home-page "https://bitbucket.org/estin/sadisplay")
3211 (synopsis "SQLAlchemy schema displayer")
3212 (description "This package provides a program to build Entity
3213 Relationship diagrams from a SQLAlchemy model (or directly from the
3215 (license license:bsd-3)))
3217 (define-public python2-sadisplay
3218 (package-with-python2 python-sadisplay))
3220 (define-public yoyo-migrations
3222 (name "yoyo-migrations")
3226 ;; We use the upstream repository, as the tests are not included in the
3230 (url "https://hg.sr.ht/~olly/yoyo")
3231 (changeset (string-append "v" version "-release"))))
3232 (file-name (string-append name "-" version "-checkout"))
3234 (base32 "0q2z9bgdj3wyix7yvqsayfs21grp5av8ilh411lgmjhigszkvhcq"))))
3235 (build-system python-build-system)
3237 ;; XXX: Tests require a connection to some pgsql database and psycopg
3238 ;; fails to connect to it.
3241 `(("python-sqlparse" ,python-sqlparse)
3242 ("python-tabulate" ,python-tabulate)))
3243 (home-page "https://ollycope.com/software/yoyo/latest/")
3244 (synopsis "Database migrations with SQL")
3246 "Yoyo is a database schema migration tool. Migrations are written as SQL
3247 files or Python scripts that define a list of migration steps.")
3248 (license license:asl2.0)))
3250 (define-public python-mysqlclient
3252 (name "python-mysqlclient")
3257 (uri (pypi-uri "mysqlclient" version))
3260 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
3261 (build-system python-build-system)
3262 (arguments '(#:tests? #f)) ;XXX: requires a live database
3264 `(("mysql-dev" ,mariadb "dev")))
3265 (home-page "https://github.com/PyMySQL/mysqlclient-python")
3266 (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
3267 (description "MySQLdb is an interface to the popular MySQL database server
3268 for Python. The design goals are:
3270 @item Compliance with Python database API version 2.0 [PEP-0249],
3271 @item Thread-safety,
3272 @item Thread-friendliness (threads will not block each other).
3274 (license license:gpl2)))
3276 (define-public python-hiredis
3278 (name "python-hiredis")
3283 (uri (pypi-uri "hiredis" version))
3286 "1dfm2k9l9zar9nw9fwmm74zrgraxdxs04vx9li56fjcf289qx5fa"))))
3287 (build-system python-build-system)
3291 (home-page "https://github.com/redis/hiredis-py")
3292 (synopsis "Python extension that wraps protocol parsing code in hiredis")
3293 (description "Python-hiredis is a python extension that wraps protocol
3294 parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.")
3295 (license license:bsd-3)))
3297 (define-public python2-hiredis
3298 (package-with-python2 python-hiredis))
3300 (define-public python-fakeredis
3302 (name "python-fakeredis")
3307 (uri (pypi-uri "fakeredis" version))
3310 "1s12mn4q4hz7402139khn9fx56kibj7nn0d6w81hn0zs07b90wpc"))))
3311 (build-system python-build-system)
3316 `(("python-sortedcontainers" ,python-sortedcontainers)))
3317 (home-page "https://github.com/jamesls/fakeredis")
3318 (synopsis "Fake implementation of redis API for testing purposes")
3320 "Fakeredis is a pure-Python implementation of the redis-py Python client
3321 that simulates talking to a redis server. It was created for a single purpose:
3322 to write unit tests.
3324 Setting up redis is not hard, but one often wants to write unit tests that don't
3325 talk to an external server such as redis. This module can be used as a
3326 reasonable substitute.")
3327 (license license:bsd-3)))
3329 (define-public python2-fakeredis
3330 (package-with-python2 python-fakeredis))
3332 (define-public python-redis
3334 (name "python-redis")
3339 (uri (pypi-uri "redis" version))
3341 (base32 "18h5b87g15x3j6pb1h2q27ri37p2qpvc9n2wgn5yl3b6m3y0qzhf"))))
3342 (build-system python-build-system)
3343 ;; Tests require a running Redis server.
3344 (arguments '(#:tests? #f))
3345 ;; As long as we are not running test, we do not need this input :-)
3347 ;; `(("python-pytest" ,python-pytest)))
3348 (home-page "https://github.com/andymccurdy/redis-py")
3349 (synopsis "Redis Python client")
3351 "This package provides a Python interface to the Redis key-value store.")
3352 (license license:expat)))
3354 (define-public python2-redis
3355 (package-with-python2 python-redis))
3357 (define-public python-rq
3365 (url "https://github.com/rq/rq")
3366 (commit (string-append "v" version))))
3367 (file-name (git-file-name name version))
3369 (base32 "0ikqmpq0g1qiqwd7ar1286l4hqjb6aj2wr844gihhb8ijzwhp8va"))))
3370 (build-system python-build-system)
3372 '(#:phases (modify-phases %standard-phases
3373 (add-before 'check 'start-redis
3375 (invoke "redis-server" "--daemonize" "yes")))
3377 (lambda* (#:key outputs #:allow-other-keys)
3378 (let ((out (assoc-ref outputs "out")))
3379 ;; Drop test that needs the SDK for Sentry.io.
3380 (delete-file "tests/test_sentry.py")
3381 ;; Ensure 'rq' and 'rqworker' ends up on PATH.
3382 (setenv "PATH" (string-append out "/bin:"
3384 (invoke "pytest" "-vv")))))))
3386 `(("python-mock" ,python-mock)
3387 ("python-pytest" ,python-pytest)
3390 `(("python-click" ,python-click)
3391 ("python-redis" ,python-redis)))
3392 (home-page "https://python-rq.org/")
3393 (synopsis "Simple job queues for Python")
3395 "RQ (Redis Queue) is a simple Python library for queueing jobs and
3396 processing them in the background with workers. It is backed by Redis and it
3397 is designed to have a low barrier to entry.")
3398 (license license:bsd-2)))
3400 (define-public python2-rq
3401 (package-with-python2 python-rq))
3403 (define-public python-rq-scheduler
3405 (name "python-rq-scheduler")
3407 (home-page "https://github.com/rq/rq-scheduler")
3412 (commit (string-append "v" version))))
3413 (file-name (git-file-name name version))
3416 "0xg6yazqs5kbr2ayvhvljs1h5vgx5k5dds613fmhswln7gglf9hk"))))
3417 (build-system python-build-system)
3419 '(#:phases (modify-phases %standard-phases
3420 (add-before 'check 'start-redis
3422 (invoke "redis-server" "--daemonize" "yes")))
3425 (substitute* "run_tests.py"
3428 (invoke "./run_tests.py"))))))
3433 `(("python-croniter" ,python-croniter)
3434 ("python-rq" ,python-rq)))
3435 (synopsis "Job scheduling capabilities for RQ (Redis Queue)")
3437 "This package provides job scheduling capabilities to @code{python-rq}
3439 (license license:expat)))
3441 (define-public python-trollius-redis
3443 (name "python-trollius-redis")
3448 (uri (pypi-uri "trollius_redis" version))
3451 "0k3vypszmgmaipgw9xscvgm79h2zd6p6ci8gdp5sxl6g5kbqr9fy"))))
3452 (build-system python-build-system)
3453 ;; TODO: Tests require packaging 'hiredis'.
3454 (arguments '(#:tests? #f))
3455 (home-page "https://github.com/benjolitz/trollius-redis")
3456 (synopsis "Port of asyncio-redis to trollius")
3457 (description "@code{trollius-redis} is a Redis client for Python
3458 trollius. It is an asynchronous IO (PEP 3156) implementation of the
3460 (license license:bsd-2)))
3462 (define-public python2-trollius-redis
3463 (package-with-python2 python-trollius-redis))
3465 (define-public python-sqlparse
3467 (name "python-sqlparse")
3471 (uri (pypi-uri "sqlparse" version))
3474 "0j652a6z7bdf6c77aczfn8m8b2nsr1bcqq48wzghf8vi6wvj0qp1"))))
3475 (build-system python-build-system)
3478 (modify-phases %standard-phases
3480 (lambda _ (invoke "py.test"))))))
3482 `(("python-pytest" ,python-pytest)))
3483 (home-page "https://github.com/andialbrecht/sqlparse")
3484 (synopsis "Non-validating SQL parser")
3485 (description "Sqlparse is a non-validating SQL parser for Python. It
3486 provides support for parsing, splitting and formatting SQL statements.")
3487 (license license:bsd-3)))
3489 (define-public python2-sqlparse
3490 (package-with-python2 python-sqlparse))
3492 (define-public python-sql
3499 (uri (pypi-uri "python-sql" version))
3501 (base32 "05ni936y0ia9xmryl7mlhbj9i80nnvq1bi4zxhb96rv7yvpb3fqb"))))
3502 (build-system python-build-system)
3503 (home-page "https://python-sql.tryton.org/")
3504 (synopsis "Library to write SQL queries in a pythonic way")
3505 (description "@code{python-sql} is a library to write SQL queries, that
3506 transforms idiomatic python function calls to well-formed SQL queries.")
3507 (license license:bsd-3)))
3509 (define-public python2-sql
3510 (package-with-python2 python-sql))
3512 (define-public python-pypika
3514 (name "python-pypika")
3517 (origin (method git-fetch)
3519 (url "https://github.com/kayak/pypika")
3520 (commit (string-append "v" version))))
3521 (file-name (git-file-name name version))
3524 "0mpddrw9z1pzcc40j3pzhd583hlgjx96aa8ak6m9zzhpm4bv3ard"))))
3525 (build-system python-build-system)
3527 `(("python-parameterized" ,python-parameterized)))
3528 (home-page "https://github.com/kayak/pypika")
3529 (synopsis "SQL query builder API for Python")
3531 "PyPika is a python SQL query builder that exposes the full richness of
3532 the SQL language using a syntax that reflects the resulting query.")
3533 (license license:asl2.0)))
3535 (define-public mongo-tools
3537 (name "mongo-tools")
3540 (origin (method git-fetch)
3542 (url "https://github.com/mongodb/mongo-tools")
3543 (commit (string-append "r" version))))
3544 (file-name (git-file-name name version))
3547 "1bcsz5cvj39a7nsxsfqmz9igrw33j6yli9kffigqyscs52amw7x1"))))
3548 (build-system go-build-system)
3550 `(#:import-path "github.com/mongodb/mongo-tools"
3551 #:modules ((srfi srfi-1)
3552 (guix build go-build-system)
3554 #:install-source? #f
3557 '("bsondump" "mongodump" "mongoexport" "mongofiles"
3558 "mongoimport" "mongooplog" "mongorestore"
3559 "mongostat" "mongotop")))
3560 (modify-phases %standard-phases
3561 (add-after 'unpack 'delete-bundled-source-code
3563 (delete-file-recursively
3564 "src/github.com/mongodb/mongo-tools/vendor")
3566 (add-after 'delete-bundled-source-code 'patch-source
3568 ;; Remove a redundant argument that causes compilation to fail.
3570 "src/github.com/mongodb/mongo-tools/mongorestore/filepath.go"
3571 (("skipping restore of system.profile collection\", db)")
3572 "skipping restore of system.profile collection\")"))
3576 (for-each (lambda (tool)
3579 ;; This is where the tests expect to find the
3581 "-o" ,(string-append
3582 "src/github.com/mongodb/mongo-tools/bin/"
3585 "-tags=\"ssl sasl\""
3587 "-extldflags=-Wl,-z,now,-z,relro"
3589 "src/github.com/mongodb/mongo-tools/"
3590 tool "/main/" tool ".go"))))
3591 (simple-format #t "build: running ~A\n"
3592 (string-join command))
3593 (apply invoke command)))
3598 (with-directory-excursion "src"
3599 (for-each (lambda (tool)
3602 (string-append "github.com/mongodb/mongo-tools/"
3607 (lambda* (#:key outputs #:allow-other-keys)
3608 (for-each (lambda (tool)
3610 (string-append "src/github.com/mongodb/mongo-tools/bin/"
3612 (string-append (assoc-ref outputs "out")
3617 `(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
3618 ("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)
3619 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
3620 ("go-gopkg.in-mgo.v2" ,go-gopkg.in-mgo.v2)
3621 ("go-gopkg.in-tomb.v2" ,go-gopkg.in-tomb.v2)
3622 ("go-github.com-nsf-termbox-go" ,go-github.com-nsf-termbox-go)
3623 ("go-github.com-smartystreets-goconvey" ,go-github.com-smartystreets-goconvey)))
3624 (home-page "https://github.com/mongodb/mongo-tools")
3625 (synopsis "Various tools for interacting with MongoDB and BSON")
3627 "This package includes a collection of tools related to MongoDB.
3630 Display BSON files in a human-readable format
3632 Convert data from JSON, TSV or CSV and insert them into a collection
3634 Write an existing collection to CSV or JSON format
3635 @item mongodump/mongorestore
3636 Dump MongoDB backups to disk in the BSON format
3638 Read MongoDB backups in the BSON format, and restore them to a live database
3640 Monitor live MongoDB servers, replica sets, or sharded clusters
3642 Read, write, delete, or update files in GridFS
3644 Replay oplog entries between MongoDB servers
3646 Monitor read/write activity on a mongo server
3648 (license license:asl2.0)))
3650 ;; There are many wrappers for this in other languages. When touching, please
3651 ;; be sure to ensure all dependencies continue to build.
3652 (define-public apache-arrow
3654 (name "apache-arrow")
3660 (url "https://github.com/apache/arrow")
3661 (commit (string-append "apache-arrow-" version))))
3662 (file-name (git-file-name name version))
3665 "02r6yx3yhywzikd3b0vfkjgddhfiriyx2vpm3jf5880wq59x798a"))))
3666 (build-system cmake-build-system)
3670 (modify-phases %standard-phases
3671 (add-before 'configure 'enter-source-directory
3672 (lambda _ (chdir "cpp") #t))
3673 (add-after 'unpack 'set-env
3675 (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
3676 (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
3677 (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
3678 (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson"))
3680 #:build-type "Release"
3682 (list "-DARROW_PYTHON=ON"
3685 "-DARROW_PARQUET=ON"
3686 "-DPARQUET_BUILD_EXECUTABLES=ON"
3687 ;; The maintainers disallow using system versions of
3689 ;; https://issues.apache.org/jira/browse/ARROW-3507. This
3690 ;; is unfortunate because jemalloc increases performance:
3691 ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/.
3692 "-DARROW_JEMALLOC=OFF"
3694 ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global
3695 ;; option that instructs the build system how to resolve
3696 ;; each dependency. SYSTEM = Finding the dependency in
3697 ;; system paths using CMake's built-in find_package
3698 ;; function, or using pkg-config for packages that do not
3699 ;; have this feature
3700 "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
3702 ;; Split output into its component packages.
3703 (string-append "-DCMAKE_INSTALL_PREFIX="
3704 (assoc-ref %outputs "lib"))
3705 (string-append "-DCMAKE_INSTALL_RPATH="
3706 (assoc-ref %outputs "lib")
3708 (string-append "-DCMAKE_INSTALL_BINDIR="
3709 (assoc-ref %outputs "out")
3711 (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
3712 (assoc-ref %outputs "include")
3716 "-DARROW_WITH_SNAPPY=ON"
3717 "-DARROW_WITH_ZLIB=ON"
3718 "-DARROW_WITH_ZSTD=ON"
3719 "-DARROW_WITH_LZ4=ON"
3720 "-DARROW_COMPUTE=ON"
3722 "-DARROW_DATASET=ON"
3723 "-DARROW_FILESYSTEM=ON"
3726 ;; Arrow Python C++ integration library (required for
3727 ;; building pyarrow). This library must be built against
3728 ;; the same Python version for which you are building
3729 ;; pyarrow. NumPy must also be installed. Enabling this
3730 ;; option also enables ARROW_COMPUTE, ARROW_CSV,
3731 ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and
3735 ;; Building the tests forces on all the
3736 ;; optional features and the use of static
3738 "-DARROW_BUILD_TESTS=OFF"
3739 "-DBENCHMARK_ENABLE_GTEST_TESTS=OFF"
3740 ;;"-DBENCHMARK_ENABLE_TESTING=OFF"
3741 "-DARROW_BUILD_STATIC=OFF")))
3744 ("brotli" ,google-brotli)
3745 ("double-conversion" ,double-conversion)
3749 ("apache-thrift" ,apache-thrift "lib")
3750 ("protobuf" ,protobuf)
3751 ("rapidjson" ,rapidjson)
3755 ("zstd" ,zstd "lib")
3758 ("python-3" ,python)
3759 ("python-numpy" ,python-numpy)))
3761 `(("pkg-config" ,pkg-config)))
3762 (outputs '("out" "lib" "include"))
3763 (home-page "https://arrow.apache.org/")
3764 (synopsis "Columnar in-memory analytics")
3765 (description "Apache Arrow is a columnar in-memory analytics layer
3766 designed to accelerate big data. It houses a set of canonical in-memory
3767 representations of flat and hierarchical data along with multiple
3768 language-bindings for structure manipulation. It also provides IPC and common
3769 algorithm implementations.")
3770 (license license:asl2.0)))
3772 (define-public python-pyarrow
3774 (inherit apache-arrow)
3775 (name "python-pyarrow")
3776 (build-system python-build-system)
3778 '(#:tests? #f ; XXX There are no tests in the "python" directory
3780 (modify-phases %standard-phases
3781 (delete 'build) ; XXX the build is performed again during the install phase
3782 (add-after 'unpack 'enter-source-directory
3783 (lambda _ (chdir "python") #t))
3784 (add-after 'unpack 'make-git-checkout-writable
3786 (for-each make-file-writable (find-files "."))
3789 `(("apache-arrow" ,apache-arrow "lib")
3790 ("python-numpy" ,python-numpy)
3791 ("python-pandas" ,python-pandas)
3792 ("python-six" ,python-six)))
3794 `(("cmake" ,cmake-minimal)
3795 ("pkg-config" ,pkg-config)
3796 ("python-cython" ,python-cython)
3797 ("python-pytest" ,python-pytest)
3798 ("python-pytest-runner" ,python-pytest-runner)
3799 ("python-setuptools-scm" ,python-setuptools-scm)))
3801 (home-page "https://arrow.apache.org/docs/python/")
3802 (synopsis "Python bindings for Apache Arrow")
3804 "This library provides a Pythonic API wrapper for the reference Arrow C++
3805 implementation, along with tools for interoperability with pandas, NumPy, and
3806 other traditional Python scientific computing packages.")
3807 (license license:asl2.0)))
3809 (define-public python-crate
3811 (name "python-crate")
3815 (uri (pypi-uri "crate" version))
3818 "0ngmlvi320c5gsxab0s7qgq0ck4jdlcwvb6lbjhnfprafdp56vvx"))))
3819 (build-system python-build-system)
3821 `(("python-urllib3" ,python-urllib3)))
3822 (home-page "https://github.com/crate/crate-python")
3823 (synopsis "CrateDB Python client")
3825 "This package provides a Python client library for CrateDB.
3826 It implements the Python DB API 2.0 specification and includes support for
3828 (license license:asl2.0)))
3830 (define-public libdbi
3836 (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-"
3837 version "/libdbi-" version ".tar.gz"))
3840 "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys"))))
3841 (build-system gnu-build-system)
3842 (synopsis "Database independent abstraction layer in C")
3844 "This library implements a database independent abstraction layer in C,
3845 similar to the DBI/DBD layer in Perl. Writing one generic set of code,
3846 programmers can leverage the power of multiple databases and multiple
3847 simultaneous database connections by using this framework.")
3848 (home-page "http://libdbi.sourceforge.net/")
3849 (license license:lgpl2.1+)))
3851 (define-public libdbi-drivers
3853 (name "libdbi-drivers")
3857 (uri (string-append "mirror://sourceforge/libdbi-drivers/"
3858 "libdbi-drivers/libdbi-drivers-" version
3859 "/libdbi-drivers-" version ".tar.gz"))
3862 "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"))))
3863 (build-system gnu-build-system)
3866 ("inetutils" ,inetutils)
3867 ("glibc-locales" ,glibc-locales)
3868 ("mariadb" ,mariadb)))
3870 `(("libdbi" ,libdbi)
3871 ("mariadb:dev" ,mariadb "dev")
3872 ("mariadb:lib" ,mariadb "lib")
3873 ("postgresql" ,postgresql)
3874 ("sqlite" ,sqlite)))
3877 (let ((libdbi (assoc-ref %build-inputs "libdbi"))
3878 (mysql:inc (assoc-ref %build-inputs "mariadb:dev"))
3879 (mysql:lib (assoc-ref %build-inputs "mariadb:lib"))
3880 (postgresql (assoc-ref %build-inputs "postgresql"))
3881 (sqlite (assoc-ref %build-inputs "sqlite")))
3882 (list "--disable-docs"
3883 (string-append "--with-dbi-incdir=" libdbi "/include")
3884 (string-append "--with-dbi-libdir=" libdbi "/lib")
3886 (string-append "--with-mysql-incdir=" mysql:inc "/include/mysql")
3887 (string-append "--with-mysql-libdir=" mysql:lib "/lib")
3889 (string-append "--with-pgsql-incdir=" postgresql "/include")
3890 (string-append "--with-pgsql-libdir=" postgresql "/lib")
3892 (string-append "--with-sqlite-incdir=" sqlite "/include")
3893 (string-append "--with-sqlite-libdir=" sqlite "/lib")))
3895 (modify-phases %standard-phases
3896 (add-after 'unpack 'fix-tests
3897 (lambda* (#:key inputs #:allow-other-keys)
3898 (substitute* "tests/test_mysql.sh"
3900 (string-append "MYMYSQLD="
3901 (assoc-ref inputs "mariadb")
3904 (add-after 'install 'remove-empty-directories
3905 (lambda* (#:key outputs #:allow-other-keys)
3906 (let ((var (string-append (assoc-ref outputs "out") "/var")))
3907 (delete-file-recursively var))
3909 (synopsis "Database drivers for the libdbi framework")
3911 "The @code{libdbi-drivers} library provides the database specific drivers
3912 for the @code{libdbi} framework.
3914 The drivers officially supported by @code{libdbi} are:
3920 (home-page "http://libdbi-drivers.sourceforge.net/")
3921 (license license:lgpl2.1+)))
3930 (url "https://github.com/SOCI/soci/")
3932 (file-name (git-file-name name version))
3935 "14x2gjblkgpflv75wl144cyjp1sis5rbxnr9r2gj3yw16v2av0bp"))))
3936 (build-system cmake-build-system)
3938 `(("firebird" ,firebird)
3939 ("postgresql" ,postgresql)
3943 ("mariadb:dev" ,mariadb "dev")))
3946 ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs it.
3947 (list "-DCMAKE_CXX_STANDARD=17"
3948 "-DSOCI_LIBDIR=lib")
3949 #:tests? #f)) ; may require running database management systems
3950 (synopsis "C++ Database Access Library")
3952 "SOCI is an abstraction layer for several database backends, including
3953 PostreSQL, SQLite, ODBC and MySQL.")
3954 (home-page "http://soci.sourceforge.net/")
3955 (license license:boost1.0)))