gnu: Move Sphinx and friends to (gnu packages sphinx).
[guix.git] / gnu / packages / databases.scm
blob8a6e3ab00caf08c80c630372dfc5ae02d4b5eb0c
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 Efraim Flashner <efraim@flashner.co.il>
14 ;;; Copyright © 2016, 2017 ng0 <ng0@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 Marius Bakke <mbakke@fastmail.com>
21 ;;; Copyright © 2017, 2018 Julien Lepiller <julien@lepiller.eu>
22 ;;; Copyright © 2017 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 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 ;;;
37 ;;; This file is part of GNU Guix.
38 ;;;
39 ;;; GNU Guix is free software; you can redistribute it and/or modify it
40 ;;; under the terms of the GNU General Public License as published by
41 ;;; the Free Software Foundation; either version 3 of the License, or (at
42 ;;; your option) any later version.
43 ;;;
44 ;;; GNU Guix is distributed in the hope that it will be useful, but
45 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
46 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
47 ;;; GNU General Public License for more details.
48 ;;;
49 ;;; You should have received a copy of the GNU General Public License
50 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
52 (define-module (gnu packages databases)
53   #:use-module (gnu packages)
54   #:use-module (gnu packages admin)
55   #:use-module (gnu packages algebra)
56   #:use-module (gnu packages autotools)
57   #:use-module (gnu packages avahi)
58   #:use-module (gnu packages base)
59   #:use-module (gnu packages bash)
60   #:use-module (gnu packages bison)
61   #:use-module (gnu packages boost)
62   #:use-module (gnu packages check)
63   #:use-module (gnu packages cmake)
64   #:use-module (gnu packages compression)
65   #:use-module (gnu packages crypto)
66   #:use-module (gnu packages curl)
67   #:use-module (gnu packages cyrus-sasl)
68   #:use-module (gnu packages dbm)
69   #:use-module (gnu packages emacs)
70   #:use-module (gnu packages flex)
71   #:use-module (gnu packages gettext)
72   #:use-module (gnu packages glib)
73   #:use-module (gnu packages gnupg)
74   #:use-module (gnu packages guile)
75   #:use-module (gnu packages time)
76   #:use-module (gnu packages golang)
77   #:use-module (gnu packages jemalloc)
78   #:use-module (gnu packages language)
79   #:use-module (gnu packages libevent)
80   #:use-module (gnu packages linux)
81   #:use-module (gnu packages man)
82   #:use-module (gnu packages ncurses)
83   #:use-module (gnu packages parallel)
84   #:use-module (gnu packages pcre)
85   #:use-module (gnu packages perl)
86   #:use-module (gnu packages perl-check)
87   #:use-module (gnu packages perl-web)
88   #:use-module (gnu packages pkg-config)
89   #:use-module (gnu packages popt)
90   #:use-module (gnu packages python)
91   #:use-module (gnu packages python-crypto)
92   #:use-module (gnu packages python-xyz)
93   #:use-module (gnu packages rdf)
94   #:use-module (gnu packages readline)
95   #:use-module (gnu packages ruby)
96   #:use-module (gnu packages serialization)
97   #:use-module (gnu packages sphinx)
98   #:use-module (gnu packages sqlite)
99   #:use-module (gnu packages tcl)
100   #:use-module (gnu packages terminals)
101   #:use-module (gnu packages textutils)
102   #:use-module (gnu packages tls)
103   #:use-module (gnu packages valgrind)
104   #:use-module (gnu packages web)
105   #:use-module (gnu packages xml)
106   #:use-module ((guix licenses) #:prefix license:)
107   #:use-module (guix packages)
108   #:use-module (guix download)
109   #:use-module (guix bzr-download)
110   #:use-module (guix git-download)
111   #:use-module (guix build-system gnu)
112   #:use-module (guix build-system go)
113   #:use-module (guix build-system perl)
114   #:use-module (guix build-system python)
115   #:use-module (guix build-system ruby)
116   #:use-module (guix build-system cmake)
117   #:use-module (guix build-system scons)
118   #:use-module ((guix build utils) #:hide (which))
119   #:use-module (guix utils)
120   #:use-module (srfi srfi-1)
121   #:use-module (srfi srfi-26)
122   #:use-module (ice-9 match))
124 (define-public 4store
125   (package
126     (name "4store")
127     (version "1.1.6")
128     (source (origin
129       (method url-fetch)
130       (uri (string-append "https://github.com/4store/4store/archive/v"
131                           version ".tar.gz"))
132       (file-name (string-append name "-" version ".tar.gz"))
133       (sha256
134        (base32 "004fmcf1w75zhc1x3zc6kc97j4jqn2v5nhk6yb3z3cpfrhzi9j50"))
135       (patches (search-patches "4store-unset-preprocessor-directive.patch"
136                                "4store-fix-buildsystem.patch"))))
137     (build-system gnu-build-system)
138     (native-inputs
139      `(("perl" ,perl)
140        ("python" ,python-2)
141        ("autoconf" ,autoconf)
142        ("automake" ,automake)
143        ("gettext" ,gettext-minimal)
144        ("libtool" ,libtool)
145        ("pcre" ,pcre "bin")                       ;for 'pcre-config'
146        ("pkg-config" ,pkg-config)))
147     (inputs
148      `(("glib" ,glib)
149        ("rasqal" ,rasqal)
150        ("libxml2" ,libxml2)
151        ("raptor2" ,raptor2)
152        ("readline" ,readline)
153        ("avahi" ,avahi)
154        ("cyrus-sasl" ,cyrus-sasl)
155        ("openssl" ,openssl)
156        ("util-linux" ,util-linux)))
157     (arguments
158      `(#:phases
159        (modify-phases %standard-phases
160          (add-after 'unpack 'generate-configure
161            (lambda _
162              (invoke "sh" "autogen.sh"))))))
163     ;; http://www.4store.org has been down for a while now.
164     (home-page "https://github.com/4store/4store")
165     (synopsis "Clustered RDF storage and query engine")
166     (description "4store is a RDF/SPARQL store written in C, supporting
167 either single machines or networked clusters.")
168     (license license:gpl3+)))
170 (define-public go-gopkg.in-mgo.v2
171   (package
172     (name "go-gopkg.in-mgo.v2")
173     (version "2016.08.01")
174     (source (origin
175               (method git-fetch)
176               (uri (git-reference
177                     (url "https://github.com/go-mgo/mgo")
178                     (commit (string-append "r" version))))
179               (file-name (git-file-name name version))
180               (sha256
181                (base32
182                 "0rwbi1z63w43b0z9srm8m7iz1fdwx7bq7n2mz862d6liiaqa59jd"))))
183     (build-system go-build-system)
184     (arguments
185      `(#:import-path "gopkg.in/mgo.v2"
186        ;; TODO: The tests fail as MongoDB fails to start
187        ;; Error parsing command line: unrecognised option '--chunkSize'
188        #:tests? #f
189        #:phases
190        (modify-phases %standard-phases
191          (delete 'reset-gzip-timestamps)
192          (add-before 'check 'start-mongodb
193            (lambda* (#:key tests? #:allow-other-keys)
194              (when tests?
195                (with-directory-excursion "src/gopkg.in/mgo.v2"
196                  (invoke "make" "startdb")))
197              #t))
198          (add-after 'check 'stop'mongodb
199            (lambda* (#:key tests? #:allow-other-keys)
200              (when tests?
201                (with-directory-excursion "src/gopkg.in/mgo.v2"
202                  (invoke "make" "stopdb")))
203              #t)))))
204     (native-inputs
205      `(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
206        ("mongodb" ,mongodb)
207        ("daemontools" ,daemontools)))
208     (synopsis "@code{mgo} offers a rich MongoDB driver for Go.")
209     (description
210      "@code{mgo} (pronounced as mango) is a MongoDB driver for the Go language.
211 It implements a rich selection of features under a simple API following
212 standard Go idioms.")
213     (home-page "http://labix.org/mgo")
214     (license license:bsd-2)))
216 (define-public es-dump-restore
217   (package
218     (name "es-dump-restore")
219     (version "2.1.0")
220     (source
221      (origin
222        (method url-fetch)
223        (uri (rubygems-uri "es_dump_restore" version))
224        (sha256
225         (base32
226          "020yk7f1hw48clmf5501z3xv9shsdchyymcv0y2cci2c1xvr1mim"))))
227     (build-system ruby-build-system)
228     (arguments
229      '(#:tests? #f)) ;; No testsuite.
230     (propagated-inputs
231      `(("ruby-httpclient" ,ruby-httpclient)
232        ("ruby-multi-json" ,ruby-multi-json)
233        ("ruby-progress_bar" ,ruby-progress_bar)
234        ("ruby-rubyzip" ,ruby-rubyzip)
235        ("ruby-thor" ,ruby-thor)))
236     (synopsis "Utility for dumping and restoring ElasticSearch indexes")
237     (description
238      "This package provides a utility for dumping the contents of an
239 ElasticSearch index to a compressed file and restoring the dumpfile back to an
240 ElasticSearch server")
241     (home-page "https://github.com/patientslikeme/es_dump_restore")
242     (license license:expat)))
244 (define-public leveldb
245   (package
246     (name "leveldb")
247     (version "1.22")
248     (source (origin
249               (method git-fetch)
250               (uri (git-reference
251                     (url "https://github.com/google/leveldb")
252                     (commit version)))
253               (file-name (git-file-name name version))
254               (sha256
255                (base32
256                 "0qrnhiyq7r4wa1a4wi82zgns35smj94mcjsc7kfs1k6ia9ys79z7"))))
257     (build-system cmake-build-system)
258     (arguments
259      `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON" "-DLEVELDB_BUILD_TESTS=ON")))
260     (inputs
261      `(("snappy" ,snappy)))
262     (home-page "http://leveldb.org/")
263     (synopsis "Fast key-value storage library")
264     (description
265      "LevelDB is a fast key-value storage library that provides an ordered
266 mapping from string keys to string values.")
267     (license license:bsd-3)))
269 (define-public memcached
270   (package
271     (name "memcached")
272     (version "1.5.14")
273     (source
274      (origin
275        (method url-fetch)
276        (uri (string-append
277              "https://memcached.org/files/memcached-" version ".tar.gz"))
278        (sha256
279         (base32 "1agj198rm5kc64z8qxck65kdzvw30pdfxalygipnryw0lwlxynww"))))
280     (build-system gnu-build-system)
281     (inputs
282      `(("libevent" ,libevent)
283        ("cyrus-sasl" ,cyrus-sasl)))
284     (home-page "https://memcached.org/")
285     (synopsis "In-memory caching service")
286     (description "Memcached is an in-memory key-value store.  It has a small
287 and generic API, and was originally intended for use with dynamic web
288 applications.")
289     (license license:bsd-3)))
291 (define-public libmemcached
292   (package
293     (name "libmemcached")
294     (version "1.0.18")
295     ;; We build from the sources since we want to build the extra HTML
296     ;; documentation which is not included with the release.
297     (source (origin
298               (method bzr-fetch)
299               (uri (bzr-reference
300                     (url "lp:libmemcached/1.0")
301                     (revision (string-append "tag:" version))))
302               (file-name (string-append name "-" version "-checkout"))
303               (sha256
304                (base32
305                 "1842s4dxdh21gdr46q4dgxigidcs6dkqnbnqjwb9l8r0bqx5nb10"))))
306     (build-system gnu-build-system)
307     (native-inputs
308      `(("memcached" ,memcached)
309        ("libtool" ,libtool)
310        ("autoconf" ,autoconf)
311        ("automake" ,automake)
312        ("bison" ,bison)
313        ("flex" ,flex)
314        ("perl" ,perl)
315        ("python-sphinx" ,python-sphinx))) ;to build the HTML doc.
316     (inputs
317      `(("libevent" ,libevent)
318        ("cyrus-sasl" ,cyrus-sasl)))
319     (outputs '("out" "doc"))
320     (arguments
321      '(#:phases
322        (modify-phases %standard-phases
323          (add-before 'bootstrap 'fix-configure.ac
324            ;; Move the AC_CONFIG_AUX_DIR macro use under AC_INIT, otherwise we
325            ;; get the error ``configure: error: cannot find install-sh,
326            ;; install.sh, or shtool in "." "./.." "./../.."`` (see:
327            ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19539 and
328            ;; https://bugs.launchpad.net/libmemcached/+bug/1803922).
329            (lambda _
330              (delete-file "bootstrap.sh") ;not useful in the context of Guix
331              (substitute* "configure.ac"
332                (("^AC_CONFIG_AUX_DIR\\(\\[build-aux\\]\\).*") "")
333                (("(^AC_INIT.*)" anchor)
334                 (string-append anchor "AC_CONFIG_AUX_DIR([build-aux])\n")))
335              #t))
336          (add-before 'bootstrap 'disable-failing-tests
337            ;; See: https://bugs.launchpad.net/libmemcached/+bug/1803926
338            (lambda _
339              ;; Mark some heavily failing test suites as expected to fail.
340              (substitute* "Makefile.am"
341                (("(XFAIL_TESTS =[^\n]*)" xfail_tests)
342                 (string-append xfail_tests " tests/testudp"
343                                " tests/libmemcached-1.0/testapp"
344                                " tests/libmemcached-1.0/testsocket")))
345              ;; Disable two tests of the unittest test suite.
346              (substitute* "libtest/unittest.cc"
347                ((".*echo_fubar_BINARY \\},.*") "")
348                ((".*application_doesnotexist_BINARY \\},.*") ""))
349              #t))
350          (add-after 'disable-dns-tests 'build-and-install-html-doc
351            (lambda* (#:key outputs #:allow-other-keys)
352              (let ((html (string-append (assoc-ref outputs "doc")
353                                         "/share/doc/libmemcached/html/")))
354                (invoke "make" "install-html")
355                ;; Cleanup useless files.
356                (for-each delete-file-recursively
357                          (map (lambda (x) (string-append html x))
358                               '("_sources" ".doctrees" ".buildinfo"))))
359              #t)))))
360     (home-page "https://libmemcached.org/")
361     (synopsis "C++ library for memcached")
362     (description "libMemcached is a library to use memcached in C/C++
363 applications.  It comes with a complete reference guide and documentation of
364 the API, and provides features such as:
365 @itemize
366 @item Asynchronous and synchronous transport support
367 @item Consistent hashing and distribution
368 @item Tunable hashing algorithm to match keys
369 @item Access to large object support
370 @item Local replication
371 @end itemize")
372     (license license:bsd-3)))
374 (define-public python-pylibmc
375   (package
376     (name "python-pylibmc")
377     (version "1.6.0")
378     (source
379      (origin
380        (method url-fetch)
381        (uri (pypi-uri "pylibmc" version))
382        (sha256
383         (base32
384          "1n6nvvhl0g52gpzzwdj1my6049xljkfwyxxygnwda9smrbj7pyay"))))
385     (build-system python-build-system)
386     (arguments
387      '(#:phases
388        (modify-phases %standard-phases
389          (add-before 'check 'start-memcached-daemon
390            ;; The test suite requires a memcached server.
391            (lambda _
392              (invoke "memcached" "-d"))))))
393     (native-inputs
394      `(("memcached" ,memcached)
395        ("python-nose" ,python-nose)))
396     (inputs
397      `(("libmemcached" ,libmemcached)
398        ("zlib" ,zlib)
399        ("cyrus-sasl" ,cyrus-sasl)))
400     (home-page
401      "http://sendapatch.se/projects/pylibmc/")
402     (synopsis
403      "Python client for memcached")
404     (description
405      "@code{pylibmc} is a client in Python for memcached.  It is a wrapper
406 around TangentOrg’s libmemcached library, and can be used as a drop-in
407 replacement for the code@{python-memcached} library.")
408     (license license:bsd-3)))
410 (define-public python2-pylibmc
411   (package-with-python2 python-pylibmc))
413 (define-public mongodb
414   (package
415     (name "mongodb")
416     (version "3.4.10")
417     (source (origin
418               (method url-fetch)
419               (uri (string-append "https://github.com/mongodb/mongo/archive/r"
420                                   version ".tar.gz"))
421               (file-name (string-append name "-" version ".tar.gz"))
422               (sha256
423                (base32 "0676lvkljj7a5hdhv78dbykqnqrj9lbn9799mi84b8vbnzsq961r"))
424               (modules '((guix build utils)))
425               (snippet
426                '(begin
427                   (for-each (lambda (dir)
428                               (delete-file-recursively
429                                 (string-append "src/third_party/" dir)))
430                             '("pcre-8.41" "scons-2.5.0" "snappy-1.1.3"
431                               "valgrind-3.11.0" "wiredtiger"
432                               "yaml-cpp-0.5.3" "zlib-1.2.8"))
433                   #t))
434               (patches
435                (list
436                 (search-patch "mongodb-support-unknown-linux-distributions.patch")))))
437     (build-system scons-build-system)
438     (inputs
439      `(("openssl" ,openssl)
440        ("pcre" ,pcre)
441         ,@(match (%current-system)
442             ((or "x86_64-linux" "aarch64-linux" "mips64el-linux")
443              `(("wiredtiger" ,wiredtiger)))
444             (_ `()))
445        ("yaml-cpp" ,yaml-cpp)
446        ("zlib" ,zlib)
447        ("snappy" ,snappy)))
448     (native-inputs
449      `(("valgrind" ,valgrind)
450        ("perl" ,perl)
451        ("python" ,python-2)
452        ("python2-pymongo" ,python2-pymongo)
453        ("python2-pyyaml" ,python2-pyyaml)
454        ("tzdata" ,tzdata)))
455     (arguments
456      `(#:scons ,scons-python2
457        #:phases
458        (let ((common-options
459               `(;; "--use-system-tcmalloc" TODO: Missing gperftools
460                 "--use-system-pcre"
461                 ;; wiredtiger is 64-bit only
462                 ,,(if (any (cute string-prefix? <> (or (%current-target-system)
463                                                        (%current-system)))
464                            '("i686-linux" "armhf-linux"))
465                     ``"--wiredtiger=off"
466                     ``"--use-system-wiredtiger")
467                 ;; TODO
468                 ;; build/opt/mongo/db/fts/unicode/string.o failed: Error 1
469                 ;; --use-system-boost
470                 "--use-system-snappy"
471                 "--use-system-zlib"
472                 "--use-system-valgrind"
473                 ;; "--use-system-stemmer" TODO: Missing relevant package
474                 "--use-system-yaml"
475                 "--disable-warnings-as-errors"
476                 ,(format #f "--jobs=~a" (parallel-job-count))
477                 "--ssl")))
478          (modify-phases %standard-phases
479            (add-after 'unpack 'scons-propagate-environment
480              (lambda _
481                ;; Modify the SConstruct file to arrange for
482                ;; environment variables to be propagated.
483                (substitute* "SConstruct"
484                  (("^env = Environment\\(")
485                   "env = Environment(ENV=os.environ, "))
486                #t))
487            (add-after 'unpack 'create-version-file
488              (lambda _
489                (call-with-output-file "version.json"
490                  (lambda (port)
491                    (display ,(simple-format #f "{
492     \"version\": \"~A\"
493 }" version) port)))
494                #t))
495            (replace 'build
496              (lambda _
497                (apply invoke `("scons"
498                                ,@common-options
499                                "mongod" "mongo" "mongos"))))
500            (replace 'check
501              (lambda* (#:key tests? inputs #:allow-other-keys)
502                (setenv "TZDIR"
503                        (string-append (assoc-ref inputs "tzdata")
504                                       "/share/zoneinfo"))
505                (when tests?
506                  ;; Note that with the tests, especially the unittests, the
507                  ;; build can take up to ~45GB of space, as many tests are
508                  ;; individual executable files, with some being hundreds of
509                  ;; megabytes in size.
510                  (apply invoke `("scons" ,@common-options "dbtest" "unittests"))
511                  (substitute* "build/unittests.txt"
512                    ;; TODO: Don't run the async_stream_test, as it hangs
513                    (("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
514                     "")
515                    ;; TODO: This test fails
516                    ;; Expected 0UL != disks.size() (0 != 0) @src/mongo/util/procparser_test.cpp:476
517                    (("^build\\/opt\\/mongo\\/util\\/procparser\\_test\n$")
518                     ""))
519                  (invoke "python" "buildscripts/resmoke.py"
520                          "--suites=dbtest,unittests"
521                          (format #f  "--jobs=~a" (parallel-job-count))))
522                #t))
523            (replace 'install
524              (lambda* (#:key outputs #:allow-other-keys)
525                (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
526                  (install-file "mongod" bin)
527                  (install-file "mongos" bin)
528                  (install-file "mongo" bin))
529                #t))))))
530     (home-page "https://www.mongodb.org/")
531     (synopsis "High performance and high availability document database")
532     (description
533      "Mongo is a high-performance, high availability, schema-free
534 document-oriented database.  A key goal of MongoDB is to bridge the gap
535 between key/value stores (which are fast and highly scalable) and traditional
536 RDBMS systems (which are deep in functionality).")
537     (license (list license:agpl3
538                    ;; Some parts are licensed under the Apache License
539                    license:asl2.0))))
541 ;; XXX When updating, check whether boost-for-mysql is still needed.
542 ;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
543 (define-public mysql
544   (package
545     (name "mysql")
546     (version "5.7.23")
547     (source (origin
548              (method url-fetch)
549              (uri (list (string-append
550                           "https://dev.mysql.com/get/Downloads/MySQL-"
551                           (version-major+minor version) "/"
552                           name "-" version ".tar.gz")
553                         (string-append
554                           "https://downloads.mysql.com/archives/get/file/"
555                           name "-" version ".tar.gz")))
556              (sha256
557               (base32
558                "0rbc3xsc11lq2dm0ip6gxa16c06hi74scb97x5cw7yhbabaz4c07"))))
559     (build-system cmake-build-system)
560     (arguments
561      `(#:configure-flags
562        '("-DBUILD_CONFIG=mysql_release"
563          "-DWITH_SSL=system"
564          "-DWITH_ZLIB=system"
565          "-DDEFAULT_CHARSET=utf8"
566          "-DDEFAULT_COLLATION=utf8_general_ci"
567          "-DMYSQL_DATADIR=/var/lib/mysql"
568          "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
569          "-DINSTALL_INFODIR=share/mysql/docs"
570          "-DINSTALL_MANDIR=share/man"
571          "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
572          "-DINSTALL_SCRIPTDIR=bin"
573          "-DINSTALL_INCLUDEDIR=include/mysql"
574          "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
575          "-DINSTALL_SUPPORTFILESDIR=share/mysql"
576          "-DINSTALL_MYSQLSHAREDIR=share/mysql"
577          "-DINSTALL_DOCDIR=share/mysql/docs"
578          "-DINSTALL_SHAREDIR=share/mysql"
579          ;; Get rid of test data.
580          "-DINSTALL_MYSQLTESTDIR="
581          "-DINSTALL_SQLBENCHDIR=")
582        #:phases (modify-phases %standard-phases
583                   (add-after
584                    'install 'remove-extra-binaries
585                    (lambda* (#:key outputs #:allow-other-keys)
586                      (let ((out (assoc-ref outputs "out")))
587                        ;; Remove the 3 *_embedded files, which weigh in at
588                        ;; 14 MiB each.
589                        (for-each delete-file
590                                  (find-files (string-append out "/bin")
591                                              "_embedded$"))
592                        #t))))))
593     (native-inputs
594      `(("bison" ,bison)
595        ("perl" ,perl)))
596     (inputs
597      `(("boost" ,boost-for-mysql)
598        ("libaio" ,libaio)
599        ("ncurses" ,ncurses)
600        ("openssl" ,openssl)
601        ("zlib" ,zlib)))
602     (home-page "https://www.mysql.com/")
603     (synopsis "Fast, easy to use, and popular database")
604     (description
605      "MySQL is a fast, reliable, and easy to use relational database
606 management system that supports the standardized Structured Query
607 Language.")
608     (license license:gpl2)))
610 (define-public mariadb
611   (package
612     (name "mariadb")
613     (version "10.1.38")
614     (source (origin
615               (method url-fetch)
616               (uri (string-append "https://downloads.mariadb.org/f/"
617                                   name "-" version "/source/"
618                                   name "-" version ".tar.gz"))
619               (sha256
620                (base32
621                 "0zq77w3ff9q781fn8cv46vy1v4ggb8vjarjvk51k653x4gyg9wfa"))
622               (patches (search-patches "mariadb-client-test-32bit.patch"))
623               (modules '((guix build utils)))
624               (snippet
625                '(begin
626                   ;; Delete bundled snappy and xz.
627                   (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
628                   (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
629                     ;; This file checks that the bundled sources are present and
630                     ;; declares build procedures for them.
631                     (("^include\\(TokuThirdParty\\)") ""))
632                   (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
633                     ;; Don't attempt to use the procedures we just removed.
634                     ((" build_lzma build_snappy") ""))
636                   ;; Preserve CMakeLists.txt for these.
637                   (for-each (lambda (file)
638                               (unless (string-suffix? "CMakeLists.txt" file)
639                                 (delete-file file)))
640                             (append (find-files "extra/yassl")
641                                     (find-files "pcre") (find-files "zlib")))
642                   #t))))
643     (build-system cmake-build-system)
644     (arguments
645      `(#:configure-flags
646        '("-DBUILD_CONFIG=mysql_release"
647          ;; Linking with libarchive fails, like this:
649          ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
650          ;; relocation R_X86_64_32 against `.bss' can not be used when
651          ;; making a shared object; recompile with -fPIC
653          ;; For now, disable the features that that use libarchive (xtrabackup).
654          "-DWITH_LIBARCHIVE=OFF"
656          ;; Ensure the system libraries are used.
657          "-DWITH_JEMALLOC=yes"
658          "-DWITH_PCRE=system"
659          "-DWITH_SSL=system"
660          "-DWITH_ZLIB=system"
662          "-DDEFAULT_CHARSET=utf8"
663          "-DDEFAULT_COLLATION=utf8_general_ci"
664          "-DMYSQL_DATADIR=/var/lib/mysql"
665          "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
666          "-DINSTALL_INFODIR=share/mysql/docs"
667          "-DINSTALL_MANDIR=share/man"
668          "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
669          "-DINSTALL_SCRIPTDIR=bin"
670          "-DINSTALL_INCLUDEDIR=include/mysql"
671          "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
672          "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
673          "-DINSTALL_MYSQLSHAREDIR=share/mysql"
674          "-DINSTALL_DOCDIR=share/mysql/docs"
675          "-DINSTALL_SHAREDIR=share")
676        #:phases
677        (modify-phases %standard-phases
678          (add-after 'unpack 'fix-pcre-detection
679            (lambda _
680              ;; The bundled PCRE in MariaDB has a patch that was upstreamed
681              ;; in version 8.34.  Unfortunately the upstream patch behaves
682              ;; slightly differently and the build system fails to detect it.
683              ;; See <https://bugs.exim.org/show_bug.cgi?id=2173>.
684              ;; XXX: Consider patching PCRE instead.
685              (substitute* "cmake/pcre.cmake"
686                ((" OR NOT PCRE_STACK_SIZE_OK") ""))
687              #t))
688          (add-after 'unpack 'adjust-tests
689            (lambda _
690              (let ((disabled-tests
691                     '(;; These fail because root@hostname == root@localhost in
692                       ;; the build environment, causing a user count mismatch.
693                       ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
694                       "main.join_cache"
695                       "main.explain_non_select"
696                       "main.stat_tables_innodb"
697                       "roles.acl_statistics"
699                       ;; This file contains a time bomb which makes it fail after
700                       ;; 2030-12-31.  See <https://bugs.gnu.org/34351> for details.
701                       "main.mysqldump"
703                       ;; XXX: Fails sporadically.
704                       "innodb_fts.crash_recovery"
706                       ;; FIXME: This test fails on i686:
707                       ;; -myisampack: Can't create/write to file (Errcode: 17 "File exists")
708                       ;; +myisampack: Can't create/write to file (Errcode: 17 "File exists)
709                       ;; When running "myisampack --join=foo/t3 foo/t1 foo/t2"
710                       ;; (all three tables must exist and be identical)
711                       ;; in a loop it produces the same error around 1/240 times.
712                       ;; montywi on #maria suggested removing the real_end check in
713                       ;; "strings/my_vsnprintf.c" on line 503, yet it still does not
714                       ;; reach the ending quote occasionally.  Disable it for now.
715                       "main.myisampack"
716                       ;; FIXME: This test fails on armhf-linux:
717                       "mroonga/storage.index_read_multiple_double"))
719                    ;; This file contains a list of known-flaky tests for this
720                    ;; release.  Append our own items.
721                    (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
722                (for-each (lambda (test)
723                            (format unstable-tests "~a : ~a\n"
724                                    test "Disabled in Guix"))
725                          disabled-tests)
726                (close-port unstable-tests)
728                (substitute* "mysql-test/mysql-test-run.pl"
729                  (("/bin/ls") (which "ls"))
730                  (("/bin/sh") (which "sh")))
731                #t)))
732          (add-before 'configure 'disable-plugins
733            (lambda _
734              (let ((disable-plugin (lambda (name)
735                                      (call-with-output-file
736                                          (string-append "plugin/" name
737                                                         "/CMakeLists.txt")
738                                        (lambda (port)
739                                          (format port "\n")))))
740                    (disabled-plugins '(;; XXX: Causes a test failure.
741                                        "disks")))
742                (for-each disable-plugin disabled-plugins)
743                #t)))
744          (replace 'check
745            (lambda* (#:key (tests? #t) #:allow-other-keys)
746              (if tests?
747                  (with-directory-excursion "mysql-test"
748                    (invoke "./mtr" "--verbose"
749                            "--retry=3"
750                            "--testcase-timeout=40"
751                            "--suite-timeout=600"
752                            "--parallel" (number->string (parallel-job-count))
753                            "--skip-test-list=unstable-tests"))
754                  (format #t "test suite not run~%"))
755              #t))
756          (add-after
757           'install 'post-install
758           (lambda* (#:key outputs #:allow-other-keys)
759             (let* ((out     (assoc-ref outputs "out"))
760                    (test    (assoc-ref outputs "test")))
761               (substitute* (string-append out "/bin/mysql_install_db")
762                 (("basedir=\"\"")
763                  (string-append "basedir=\"" out "\"")))
764               ;; Remove unneeded files for testing.
765               (with-directory-excursion out
766                 (for-each delete-file-recursively
767                           '("data" "mysql-test" "sql-bench"
768                             "share/man/man1/mysql-test-run.pl.1"))
769                 ;; Delete huge and unnecessary executables.
770                 (for-each delete-file (find-files "bin" "(test|embedded)"))
771                 ;; And static libraries.
772                 (for-each delete-file (find-files "lib" "\\.a$")))
773               #t))))))
774     (native-inputs
775      `(("bison" ,bison)
776        ("perl" ,perl)))
777     (inputs
778      `(("jemalloc" ,jemalloc)
779        ("libaio" ,libaio)
780        ("libxml2" ,libxml2)
781        ("ncurses" ,ncurses)
782        ("pcre" ,pcre)
783        ("snappy" ,snappy)
784        ("xz" ,xz)
785        ("zlib" ,zlib)))
786     (propagated-inputs
787      ;; mariadb.pc says -lssl -lcrypto, so propagate it.
788      `(("openssl" ,openssl)))
789     ;; The test suite is very resource intensive and can take more than three
790     ;; hours on a x86_64 system.  Give slow and busy machines some leeway.
791     (properties '((timeout . 64800)))        ;18 hours
792     (home-page "https://mariadb.org/")
793     (synopsis "SQL database server")
794     (description
795      "MariaDB is a multi-user and multi-threaded SQL database server, designed
796 as a drop-in replacement of MySQL.")
797     (license license:gpl2)))
799 ;; Don't forget to update the other postgresql packages when upgrading this one.
800 (define-public postgresql
801   (package
802     (name "postgresql")
803     (version "10.7")
804     (replacement postgresql-10.8)
805     (source (origin
806               (method url-fetch)
807               (uri (string-append "https://ftp.postgresql.org/pub/source/v"
808                                   version "/postgresql-" version ".tar.bz2"))
809               (sha256
810                (base32
811                 "1piyfcrcqscjhnnwn91kdvr764s7d0qz4lgygf9bl6qc71ji1vdz"))
812               (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))
813     (build-system gnu-build-system)
814     (arguments
815      `(#:configure-flags '("--with-uuid=e2fs" "--with-openssl")
816        #:phases
817        (modify-phases %standard-phases
818          (add-before 'configure 'patch-/bin/sh
819                      (lambda _
820                        ;; Refer to the actual shell.
821                        (substitute* '("src/bin/pg_ctl/pg_ctl.c"
822                                       "src/bin/psql/command.c")
823                          (("/bin/sh") (which "sh")))
824                        #t))
825          (add-after 'build 'build-contrib
826            (lambda _
827              (invoke "make" "-C" "contrib")))
828          (add-after 'install 'install-contrib
829            (lambda _
830              (invoke "make" "-C" "contrib" "install"))))))
831     (inputs
832      `(("readline" ,readline)
833        ("libuuid" ,util-linux)
834        ("openssl" ,openssl)
835        ("zlib" ,zlib)))
836     (home-page "https://www.postgresql.org/")
837     (synopsis "Powerful object-relational database system")
838     (description
839      "PostgreSQL is a powerful object-relational database system.  It is fully
840 ACID compliant, has full support for foreign keys, joins, views, triggers, and
841 stored procedures (in multiple languages).  It includes most SQL:2008 data
842 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
843 TIMESTAMP.  It also supports storage of binary large objects, including
844 pictures, sounds, or video.")
845     (license (license:x11-style "file://COPYRIGHT"))))
847 ;; This release fixes CVE-2019-10129 and CVE-2019-10130.  See
848 ;; <https://www.postgresql.org/about/news/1939/> for details.
849 ;; TODO: Remove this in the next rebuild cycle.
850 (define-public postgresql-10.8
851   (package
852     (inherit postgresql)
853     (version "10.8")
854     (source (origin
855               (method url-fetch)
856               (uri (string-append "https://ftp.postgresql.org/pub/source/v"
857                                   version "/postgresql-" version ".tar.bz2"))
858               (sha256
859                (base32
860                 "0pfdmy4w95b49w9rkn8dwvzmi2brpqfvbxd04y0k0s0xvymc565i"))
861               (patches (search-patches "postgresql-disable-resolve_symlinks.patch"))))))
863 (define-public postgresql-9.6
864   (package
865     (inherit postgresql)
866     (name "postgresql")
867     (version "9.6.13")
868     (source (origin
869               (method url-fetch)
870               (uri (string-append "https://ftp.postgresql.org/pub/source/v"
871                                   version "/postgresql-" version ".tar.bz2"))
872               (sha256
873                (base32
874                 "197964wb5pc5fx81a6mh9hlcrr9sgr3nqlpmljv6asi9aq0d5gpc"))))))
876 (define-public python-pymysql
877   (package
878     (name "python-pymysql")
879     (version "0.9.3")
880     (source
881      (origin
882        (method url-fetch)
883        (uri (pypi-uri "PyMySQL" version))
884        (sha256
885         (base32 "1ry8lxgdc1p3k7gbw20r405jqi5lvhi5wk83kxdbiv8xv3f5kh6q"))))
886     (build-system python-build-system)
887     (native-inputs
888      `(("python-unittest2" ,python-unittest2)))
889     (inputs
890      `(("python-cryptography" ,python-cryptography)))
891     (arguments
892      `(#:tests? #f))                    ; tests expect a running MySQL
893     (home-page "https://github.com/PyMySQL/PyMySQL/")
894     (synopsis "Pure-Python MySQL driver")
895     (description
896      "PyMySQL is a pure-Python MySQL client library, based on PEP 249.
897 Most public APIs are compatible with @command{mysqlclient} and MySQLdb.")
898     (license license:expat)))
900 (define-public python2-pymysql
901   (package-with-python2 python-pymysql))
903 (define-public qdbm
904   (package
905     (name "qdbm")
906     (version "1.8.78")
907     (source
908       (origin
909        (method url-fetch)
910        (uri (string-append "http://fallabs.com/" name "/"
911                            name "-" version ".tar.gz"))
912        (sha256
913         (base32
914          "0gmpvhn02pkq280ffmn4da1g4mdr1xxz7l80b7y4n7km1mrzwrml"))))
915     (build-system gnu-build-system)
916     (arguments
917      `( #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
918                                                (assoc-ref %outputs "out")
919                                                "/lib"))))
920     (home-page "http://fallabs.com/qdbm")
921     (synopsis "Key-value database")
922     (description "QDBM is a library of routines for managing a
923 database.  The database is a simple data file containing key-value
924 pairs.  Every key and value is serial bytes with variable length.
925 Binary data as well as character strings can be used as a key or a
926 value.  There is no concept of data tables or data types.  Records are
927 organized in a hash table or B+ tree.")
928     (license license:lgpl2.1+)))
930 (define-public recutils
931   (package
932     (name "recutils")
933     (version "1.8")
934     (source (origin
935               (method url-fetch)
936               (uri (string-append "mirror://gnu/recutils/recutils-"
937                                   version ".tar.gz"))
938               (sha256
939                (base32
940                 "14xiln4immfsw8isnvwvq0h23f6z0wilpgsc4qzabnrzb5lsx3nz"))))
941     (build-system gnu-build-system)
943     (arguments '(#:configure-flags
944                  (list (string-append "--with-bash-headers="
945                                       (assoc-ref %build-inputs "bash:include")
946                                       "/include/bash"))))
948     (native-inputs `(("emacs" ,emacs-minimal)
949                      ("bc" ,bc)
950                      ("bash:include" ,bash "include")
951                      ("check" ,check)
952                      ("libuuid" ,util-linux)
953                      ("pkg-config" ,pkg-config)))
955     ;; TODO: Add more optional inputs.
956     (inputs `(("curl" ,curl)
957               ("libgcrypt" ,libgcrypt)))
958     (synopsis "Manipulate plain text files as databases")
959     (description
960      "GNU Recutils is a set of tools and libraries for creating and
961 manipulating text-based, human-editable databases.  Despite being text-based,
962 databases created with Recutils carry all of the expected features such as
963 unique fields, primary keys, time stamps and more.  Many different field
964 types are supported, as is encryption.")
965     (license license:gpl3+)
966     (home-page "https://www.gnu.org/software/recutils/")))
968 (define-public rocksdb
969   (package
970     (name "rocksdb")
971     (version "5.18.3")
972     (source (origin
973               (method git-fetch)
974               (uri (git-reference
975                     (url "https://github.com/facebook/rocksdb")
976                     (commit (string-append "v" version))))
977               (file-name (git-file-name name version))
978               (sha256
979                (base32
980                 "1v2slmmr1dsgf8z0qcfg1y9x1al96859rg48b66p9nsawczd5zv9"))
981               (modules '((guix build utils)))
982               (snippet
983                '(begin
984                   ;; TODO: unbundle gtest.
985                   (delete-file "build_tools/gnu_parallel")
986                   (substitute* "Makefile"
987                     (("build_tools/gnu_parallel") "parallel"))
988                   #t))))
989     (build-system gnu-build-system)
990     (arguments
991      `(#:make-flags (list "CC=gcc" "V=1"
992                           ;; Ceph requires that RTTI is enabled.
993                           "USE_RTTI=1"
994                           (string-append "INSTALL_PATH="
995                                          (assoc-ref %outputs "out"))
997                           ;; Running the full test suite takes hours and require
998                           ;; a lot of disk space.  Instead we only run a subset
999                           ;; (see .travis.yml and Makefile).
1000                           "ROCKSDBTESTS_END=db_tailing_iter_test")
1001        #:test-target "check_some"
1002        ;; Many tests fail on 32-bit platforms. There are multiple reports about
1003        ;; this upstream, but it's not going to be supported any time soon.
1004        #:tests? (let ((system ,(or (%current-target-system)
1005                                    (%current-system))))
1006                   (or (string-prefix? "x86_64-linux" system)
1007                       (string-prefix? "aarch64-linux" system)))
1008        #:phases
1009        (modify-phases %standard-phases
1010          (add-after 'unpack 'patch-Makefile
1011            (lambda _
1012              (substitute* "Makefile"
1013                ;; Don't depend on the static library when installing.
1014                (("install: install-static")
1015                 "install: install-shared")
1016                (("#!/bin/sh") (string-append "#!" (which "sh"))))
1017              #t))
1018          (delete 'configure)
1019          ;; The default target is only needed for tests and built on demand.
1020          (delete 'build)
1021          (add-before 'check 'disable-optimizations
1022            (lambda _
1023              ;; Prevent the build from passing '-march=native' to the compiler.
1024              (setenv "PORTABLE" "1")
1025              #t))
1026          (add-before 'check 'disable-failing-tests
1027            (lambda _
1028              (substitute* "Makefile"
1029                ;; These tests reliably fail due to "Too many open files".
1030                (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\")
1031                (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\"))
1032              #t))
1033          (add-after 'check 'build
1034            ;; The default build target is a debug build for tests. The
1035            ;; install target depends on the "shared_lib" release target
1036            ;; so we build it here for clarity.
1037            (lambda* (#:key (make-flags '()) parallel-build? #:allow-other-keys)
1038                (apply invoke "make" "shared_lib"
1039                       `(,@(if parallel-build?
1040                               `("-j" ,(number->string (parallel-job-count)))
1041                               '())
1042                         ,@make-flags)))))))
1043     (native-inputs
1044      `(("parallel" ,parallel)
1045        ("perl" ,perl)
1046        ("procps" ,procps)
1047        ("python" ,python-2)
1048        ("which" ,which)))
1049     (inputs
1050      `(("bzip2" ,bzip2)
1051        ("gflags" ,gflags)
1052        ("jemalloc" ,jemalloc)
1053        ("lz4" ,lz4)
1054        ("snappy" ,snappy)
1055        ("zlib" ,zlib)))
1056     (home-page "http://rocksdb.org/")
1057     (synopsis "Persistent key-value store for fast storage")
1058     (description
1059      "RocksDB is a library that forms the core building block for a fast
1060 key-value server, especially suited for storing data on flash drives.  It
1061 has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
1062 between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
1063 (RAF) and @dfn{Space-Amplification-Factor} (SAF).  It has multi-threaded
1064 compactions, making it specially suitable for storing multiple terabytes of
1065 data in a single database.  RocksDB is partially based on @code{LevelDB}.")
1066     ;; RocksDB is dual licensed under GPL2 and ASL 2.0.  Some header
1067     ;; files carry the 3-clause BSD license.
1068     (license (list license:gpl2 license:asl2.0 license:bsd-3))))
1070 (define-public sparql-query
1071   (package
1072     (name "sparql-query")
1073     (version "1.1")
1074     (source (origin
1075               (method url-fetch)
1076               (uri (string-append "https://github.com/tialaramex/"
1077                                   name "/archive/" version ".tar.gz"))
1078               (sha256
1079                (base32 "0yq3k20472rv8npcc420q9ab6idy584g5y0q501d360k5q0ggr8w"))
1080               (file-name (string-append name "-" version ".tar.gz"))))
1081     (build-system gnu-build-system)
1082     (inputs
1083      `(("readline" ,readline)
1084        ("ncurses" ,ncurses)
1085        ("glib" ,glib)
1086        ("libxml2" ,libxml2)
1087        ("curl" ,curl)))
1088     (native-inputs
1089      `(("pkg-config" ,pkg-config)))
1090     (arguments
1091      `(#:make-flags '("CC=gcc")
1092        #:phases
1093        (modify-phases %standard-phases
1094          (delete 'configure)
1095          ;; The Makefile uses git to obtain versioning information. This phase
1096          ;; substitutes the git invocation with the package version.
1097          (add-after 'unpack 'remove-git-dependency
1098            (lambda _
1099              (substitute* "Makefile"
1100                (("^gitrev :=.*$")
1101                 (string-append "gitrev = \"v" ,version "\"")))
1102              #t))
1103          ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
1104          ;; This replacement does the same thing, except for using $PREFIX/bin
1105          ;; instead.
1106          (replace 'install
1107            (lambda* (#:key outputs #:allow-other-keys)
1108              (let* ((out (assoc-ref outputs "out"))
1109                     (bin (string-append out "/bin")))
1110                (install-file "sparql-query" bin)
1111                (symlink (string-append bin "/sparql-query")
1112                         (string-append bin "/sparql-update")))
1113              #t))
1114          (replace 'check
1115            (lambda* (#:key make-flags #:allow-other-keys)
1116              (apply invoke "make" `(,@make-flags "scan-test"))
1117              (invoke "./scan-test"))))))
1118     (home-page "https://github.com/tialaramex/sparql-query/")
1119     (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
1120     (description "Sparql-query is a command-line tool for accessing SPARQL
1121 endpoints over HTTP.  It has been intentionally designed to @code{feel} similar to
1122 tools for interrogating SQL databases.  For example, you can enter a query over
1123 several lines, using a semi-colon at the end of a line to indicate the end of
1124 your query.  It also supports readline so that you can more easily recall and
1125 edit previous queries, even across sessions.  It can be used non-interactively,
1126 for example from a shell script.")
1127     ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
1128     ;; others (like sparql-query.c) contain a GPLv2+ license header.
1129     (license (list license:gpl3+))))
1131 (define-public sqitch
1132   (package
1133     (name "sqitch")
1134     (version "0.9999")
1135     (source
1136      (origin
1137        (method url-fetch)
1138        (uri (string-append
1139              "mirror://cpan/authors/id/D/DW/DWHEELER/App-Sqitch-"
1140              version
1141              ".tar.gz"))
1142        (sha256
1143         (base32
1144          "1cvj8grs3bzc4g7dw1zc26g4biv1frav18sq0fkvi2kk0q1aigzm"))))
1145     (build-system perl-build-system)
1146     (arguments
1147      '(#:phases
1148        (modify-phases %standard-phases
1149          (add-before 'check 'set-check-environment
1150            (lambda _
1151              (setenv "TZ" "UTC")
1152              (setenv "HOME" "/tmp")
1153              #t))
1154          (add-after 'install 'wrap-program
1155            (lambda* (#:key outputs #:allow-other-keys)
1156              (let* ((out (assoc-ref outputs "out"))
1157                     (path (getenv "PERL5LIB")))
1158                (wrap-program (string-append out "/bin/sqitch")
1159                  `("PERL5LIB" ":" prefix
1160                    (,(string-append out "/lib/perl5/site_perl"
1161                                     ":"
1162                                     path)))))
1163              #t)))))
1164     (native-inputs
1165      `(("perl-capture-tiny" ,perl-capture-tiny)
1166        ("perl-io-pager" ,perl-io-pager)
1167        ("perl-module-build" ,perl-module-build)
1168        ("perl-module-runtime" ,perl-module-runtime)
1169        ("perl-path-class" ,perl-path-class)
1170        ("perl-test-deep" ,perl-test-deep)
1171        ("perl-test-dir" ,perl-test-dir)
1172        ("perl-test-exception" ,perl-test-exception)
1173        ("perl-test-file" ,perl-test-file)
1174        ("perl-test-file-contents" ,perl-test-file-contents)
1175        ("perl-test-mockmodule" ,perl-test-mockmodule)
1176        ("perl-test-nowarnings" ,perl-test-nowarnings)
1177        ("perl-test-warn" ,perl-test-warn)))
1178     (inputs
1179      `(("perl-class-xsaccessor" ,perl-class-xsaccessor)
1180        ("perl-clone" ,perl-clone)
1181        ("perl-config-gitlike" ,perl-config-gitlike)
1182        ("perl-datetime" ,perl-datetime)
1183        ("perl-datetime-timezone" ,perl-datetime-timezone)
1184        ("perl-dbd-pg" ,perl-dbd-pg)
1185        ("perl-dbi" ,perl-dbi)
1186        ("perl-devel-stacktrace" ,perl-devel-stacktrace)
1187        ("perl-encode-locale" ,perl-encode-locale)
1188        ("perl-file-homedir" ,perl-file-homedir)
1189        ("perl-hash-merge" ,perl-hash-merge)
1190        ("perl-ipc-run3" ,perl-ipc-run3)
1191        ("perl-ipc-system-simple" ,perl-ipc-system-simple)
1192        ("perl-libintl-perl" ,perl-libintl-perl)
1193        ("perl-list-moreutils" ,perl-list-moreutils)
1194        ("perl-moo" ,perl-moo)
1195        ("perl-mysql-config" ,perl-mysql-config)
1196        ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1197        ("perl-path-class" ,perl-path-class)
1198        ("perl-perlio-utf8_strict" ,perl-perlio-utf8_strict)
1199        ("perl-string-formatter" ,perl-string-formatter)
1200        ("perl-string-shellquote" ,perl-string-shellquote)
1201        ("perl-sub-exporter" ,perl-sub-exporter)
1202        ("perl-template-tiny" ,perl-template-tiny)
1203        ("perl-template-toolkit" ,perl-template-toolkit)
1204        ("perl-throwable" ,perl-throwable)
1205        ("perl-try-tiny" ,perl-try-tiny)
1206        ("perl-type-tiny" ,perl-type-tiny)
1207        ("perl-type-tiny-xs" ,perl-type-tiny-xs)
1208        ("perl-uri" ,perl-uri)
1209        ("perl-uri-db" ,perl-uri-db)))
1210     (home-page "https://sqitch.org/")
1211     (synopsis "Database change management tool")
1212     (description
1213      "Sqitch is a standalone change management system for database schemas,
1214 which uses SQL to describe changes.")
1215     (license license:x11)))
1217 (define-public sqlcrush
1218   ;; Unfortunately, there is no proper upstream release and may never be.
1219   (let ((commit "b5f6868f189566a26eecc78d0f0659813c1aa98a")
1220         (revision "1"))
1221     (package
1222       (name "sqlcrush")
1223       (version (git-version "0.1.5" revision commit))
1224       (source (origin
1225                 (method git-fetch)
1226                 (uri (git-reference
1227                       (url "https://github.com/coffeeandscripts/sqlcrush.git")
1228                       (commit commit)))
1229                 (file-name (git-file-name name version))
1230                 (sha256
1231                  (base32
1232                   "0x3wy40r93p0jv3nbwj9a77wa4ff697d13r0wffmm7q9h3mzsww8"))))
1233       (build-system python-build-system)
1234       (inputs
1235        `(("python-cryptography" ,python-cryptography)
1236          ("python-psycopg2" ,python-psycopg2)
1237          ("python-pymysql" ,python-pymysql)
1238          ("python-sqlalchemy" ,python-sqlalchemy)))
1239       (home-page "https://github.com/coffeeandscripts/sqlcrush")
1240       (synopsis "Text console-based database viewer and editor")
1241       (description
1242        "SQLcrush lets you view and edit a database directly from the text
1243 console through an ncurses interface.  You can explore each table's structure,
1244 browse and edit the contents, add and delete entries, all while tracking your
1245 changes.")
1246       (license license:gpl3+)))) ; no headers, see README.md
1248 (define-public tdb
1249   (package
1250     (name "tdb")
1251     (version "1.4.0")
1252     (source (origin
1253               (method url-fetch)
1254               (uri (string-append "https://www.samba.org/ftp/tdb/tdb-"
1255                                   version ".tar.gz"))
1256               (sha256
1257                (base32
1258                 "0d9d2f1c83gmmq30bkfs50yb8399mr9xjjzscma4kyq0ajf75861"))))
1259     (build-system gnu-build-system)
1260     (arguments
1261      '(#:phases
1262        (modify-phases %standard-phases
1263          (replace 'configure
1264            (lambda* (#:key outputs #:allow-other-keys)
1265              (let ((out (assoc-ref outputs "out")))
1266                ;; The 'configure' script is a wrapper for Waf and
1267                ;; doesn't recognize things like '--enable-fast-install'.
1268                (invoke "./configure"
1269                        (string-append "--prefix=" out))))))))
1270     (native-inputs
1271      `(;; TODO: Build the documentation.
1272        ;; ("docbook-xsl" ,docbook-xsl)
1273        ;; ("libxml2" ,libxml2)
1274        ;; ("libxslt" ,libxslt)
1275        ("python" ,python)                         ;for the Waf build system
1276        ("which" ,which)))
1277     (home-page "https://tdb.samba.org/")
1278     (synopsis "Trivial database")
1279     (description
1280      "TDB is a Trivial Database.  In concept, it is very much like GDBM,
1281 and BSD's DB except that it allows multiple simultaneous writers and uses
1282 locking internally to keep writers from trampling on each other.  TDB is also
1283 extremely small.")
1284     (license license:lgpl3+)))
1286 (define-public perl-dbi
1287   (package
1288     (name "perl-dbi")
1289     (version "1.642")
1290     (source (origin
1291               (method url-fetch)
1292               (uri (string-append
1293                     "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
1294                     version ".tar.gz"))
1295               (sha256
1296                (base32
1297                 "0pbzqazrx7pnw4nbyaf27in4b6yddkirbd2ws7mnqa2n7812a81z"))))
1298     (build-system perl-build-system)
1299     (synopsis "Database independent interface for Perl")
1300     (description "This package provides an database interface for Perl.")
1301     (home-page "https://metacpan.org/release/DBI")
1302     (license license:perl-license)))
1304 (define-public perl-dbix-class
1305   (package
1306     (name "perl-dbix-class")
1307     (version "0.082841")
1308     (source
1309      (origin
1310        (method url-fetch)
1311        (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/"
1312                            "DBIx-Class-" version ".tar.gz"))
1313        (sha256
1314         (base32
1315          "1gf3hgv8f9rnr8bl4ljgsqk4aliphmvljhsk4282kvdc4mcgh1fp"))))
1316     (build-system perl-build-system)
1317     (native-inputs
1318      `(("perl-dbd-sqlite" ,perl-dbd-sqlite)
1319        ("perl-file-temp" ,perl-file-temp)
1320        ("perl-module-install" ,perl-module-install)
1321        ("perl-package-stash" ,perl-package-stash)
1322        ("perl-test-deep" ,perl-test-deep)
1323        ("perl-test-exception" ,perl-test-exception)
1324        ("perl-test-warn" ,perl-test-warn)))
1325     (propagated-inputs
1326      `(("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1327        ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1328        ("perl-class-inspector" ,perl-class-inspector)
1329        ("perl-config-any" ,perl-config-any)
1330        ("perl-context-preserve" ,perl-context-preserve)
1331        ("perl-data-dumper-concise" ,perl-data-dumper-concise)
1332        ("perl-data-page" ,perl-data-page)
1333        ("perl-dbi" ,perl-dbi)
1334        ("perl-devel-globaldestruction" ,perl-devel-globaldestruction)
1335        ("perl-hash-merge" ,perl-hash-merge)
1336        ("perl-module-find" ,perl-module-find)
1337        ("perl-moo" ,perl-moo)
1338        ("perl-mro-compat" ,perl-mro-compat)
1339        ("perl-namespace-clean" ,perl-namespace-clean)
1340        ("perl-path-class" ,perl-path-class)
1341        ("perl-scalar-list-utils" ,perl-scalar-list-utils)
1342        ("perl-scope-guard" ,perl-scope-guard)
1343        ("perl-sql-abstract" ,perl-sql-abstract)
1344        ("perl-sub-name" ,perl-sub-name)
1345        ("perl-text-balanced" ,perl-text-balanced)
1346        ("perl-try-tiny" ,perl-try-tiny)))
1347     (home-page "https://metacpan.org/release/DBIx-Class")
1348     (synopsis "Extensible and flexible object <-> relational mapper")
1349     (description "An SQL to OO mapper with an object API inspired by
1350 Class::DBI (with a compatibility layer as a springboard for porting) and a
1351 resultset API that allows abstract encapsulation of database operations.  It
1352 aims to make representing queries in your code as perl-ish as possible while
1353 still providing access to as many of the capabilities of the database as
1354 possible, including retrieving related records from multiple tables in a
1355 single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\",
1356 \"ORDER BY\" and \"HAVING\" support.")
1357     (license license:perl-license)))
1359 (define-public perl-dbix-class-cursor-cached
1360   (package
1361     (name "perl-dbix-class-cursor-cached")
1362     (version "1.001004")
1363     (source
1364      (origin
1365        (method url-fetch)
1366        (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/"
1367                            "DBIx-Class-Cursor-Cached-" version ".tar.gz"))
1368        (sha256
1369         (base32
1370          "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p"))))
1371     (build-system perl-build-system)
1372     (native-inputs
1373      `(("perl-cache-cache" ,perl-cache-cache)
1374        ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1375        ("perl-module-install" ,perl-module-install)))
1376     (propagated-inputs
1377      `(("perl-carp-clan" ,perl-carp-clan)
1378        ("perl-dbix-class" ,perl-dbix-class)))
1379     (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached")
1380     (synopsis "Cursor with built-in caching support")
1381     (description "DBIx::Class::Cursor::Cached provides a cursor class with
1382 built-in caching support.")
1383     (license license:perl-license)))
1385 (define-public perl-dbix-class-introspectablem2m
1386   (package
1387     (name "perl-dbix-class-introspectablem2m")
1388     (version "0.001002")
1389     (source
1390      (origin
1391        (method url-fetch)
1392        (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1393                            "DBIx-Class-IntrospectableM2M-" version ".tar.gz"))
1394        (sha256
1395         (base32
1396          "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6"))))
1397     (build-system perl-build-system)
1398     (native-inputs
1399      `(("perl-module-install" ,perl-module-install)))
1400     (propagated-inputs
1401      `(("perl-dbix-class" ,perl-dbix-class)))
1402     (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M")
1403     (synopsis "Introspect many-to-many relationships")
1404     (description "Because the many-to-many relationships are not real
1405 relationships, they can not be introspected with DBIx::Class.  Many-to-many
1406 relationships are actually just a collection of convenience methods installed
1407 to bridge two relationships.  This DBIx::Class component can be used to store
1408 all relevant information about these non-relationships so they can later be
1409 introspected and examined.")
1410     (license license:perl-license)))
1412 (define-public perl-dbix-class-schema-loader
1413   (package
1414     (name "perl-dbix-class-schema-loader")
1415     (version "0.07049")
1416     (source
1417      (origin
1418        (method url-fetch)
1419        (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1420                            "DBIx-Class-Schema-Loader-" version ".tar.gz"))
1421        (sha256
1422         (base32
1423          "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8"))))
1424     (build-system perl-build-system)
1425     (native-inputs
1426      `(("perl-config-any" ,perl-config-any)
1427        ("perl-config-general" ,perl-config-general)
1428        ("perl-dbd-sqlite" ,perl-dbd-sqlite)
1429        ("perl-dbix-class-introspectablem2m" ,perl-dbix-class-introspectablem2m)
1430        ("perl-module-install" ,perl-module-install)
1431        ("perl-moose" ,perl-moose)
1432        ("perl-moosex-markasmethods" ,perl-moosex-markasmethods)
1433        ("perl-moosex-nonmoose" ,perl-moosex-nonmoose)
1434        ("perl-namespace-autoclean" ,perl-namespace-autoclean)
1435        ("perl-test-deep" ,perl-test-deep)
1436        ("perl-test-differences" ,perl-test-differences)
1437        ("perl-test-exception" ,perl-test-exception)
1438        ("perl-test-pod" ,perl-test-pod)
1439        ("perl-test-warn" ,perl-test-warn)))
1440     (propagated-inputs
1441      `(("perl-class-unload" ,perl-class-unload)
1442        ("perl-class-inspector" ,perl-class-inspector)
1443        ("perl-class-accessor-grouped" ,perl-class-accessor-grouped)
1444        ("perl-class-c3-componentised" ,perl-class-c3-componentised)
1445        ("perl-carp-clan" ,perl-carp-clan)
1446        ("perl-data-dump" ,perl-data-dump)
1447        ("perl-dbix-class" ,perl-dbix-class)
1448        ("perl-hash-merge" ,perl-hash-merge)
1449        ("perl-list-moreutils" ,perl-list-moreutils)
1450        ("perl-lingua-en-inflect-phrase" ,perl-lingua-en-inflect-phrase)
1451        ("perl-lingua-en-inflect-number" ,perl-lingua-en-inflect-number)
1452        ("perl-lingua-en-tagger" ,perl-lingua-en-tagger)
1453        ("perl-namespace-clean" ,perl-namespace-clean)
1454        ("perl-mro-compat" ,perl-mro-compat)
1455        ("perl-scope-guard" ,perl-scope-guard)
1456        ("perl-string-camelcase" ,perl-string-camelcase)
1457        ("perl-string-toidentifier-en" ,perl-string-toidentifier-en)
1458        ("perl-sub-name" ,perl-sub-name)
1459        ("perl-try-tiny" ,perl-try-tiny)))
1460     (arguments `(#:tests? #f))          ;TODO: t/20invocations.t fails
1461     (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader")
1462     (synopsis "Create a DBIx::Class::Schema based on a database")
1463     (description "DBIx::Class::Schema::Loader automates the definition of a
1464 DBIx::Class::Schema by scanning database table definitions and setting up the
1465 columns, primary keys, unique constraints and relationships.")
1466     (license license:perl-license)))
1468 (define-public perl-dbd-pg
1469   (package
1470     (name "perl-dbd-pg")
1471     (version "3.7.4")
1472     (source
1473      (origin
1474        (method url-fetch)
1475        (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/"
1476                            "DBD-Pg-" version ".tar.gz"))
1477        (sha256
1478         (base32
1479          "0gkqlvbmzbdm0g4k328nlkjdg3wrjm5i2n9jxj1i8sqxkm79rylz"))))
1480     (build-system perl-build-system)
1481     (native-inputs
1482      `(("perl-dbi" ,perl-dbi)))
1483     (propagated-inputs
1484      `(("perl-dbi" ,perl-dbi)
1485        ("postgresql" ,postgresql)))
1486     (home-page "https://metacpan.org/release/DBD-Pg")
1487     (synopsis "DBI PostgreSQL interface")
1488     (description "This package provides a PostgreSQL driver for the Perl5
1489 @dfn{Database Interface} (DBI).")
1490     (license license:perl-license)))
1492 (define-public perl-dbd-mysql
1493   (package
1494     (name "perl-dbd-mysql")
1495     (version "4.050")
1496     (source
1497      (origin
1498        (method url-fetch)
1499        (uri (string-append "mirror://cpan/authors/id/D/DV/DVEEDEN/"
1500                            "DBD-mysql-" version ".tar.gz"))
1501        (sha256
1502         (base32 "0y4djb048i09dk19av7mzfb3khr72vw11p3ayw2p82jsy4gm8j2g"))))
1503     (build-system perl-build-system)
1504     (arguments
1505      `(#:phases
1506        (modify-phases %standard-phases
1507          (add-before 'configure 'skip-library-detection
1508            ;; Avoid depencies on perl-devel-checklib, openssl, and zlib.  They
1509            ;; are really only needed for the test suite; their absence does not
1510            ;; affect the build or the end result.
1511            (lambda _
1512              (substitute* "Makefile.PL"
1513                (("use Devel::CheckLib;" match)
1514                 (string-append "# " match))
1515                (("assert_lib")
1516                 "print"))
1517              #t)))
1518        ;; Tests require running MySQL server.
1519        #:tests? #f))
1520     (propagated-inputs
1521      `(("perl-dbi" ,perl-dbi)
1522        ("mysql" ,mariadb)))
1523     (home-page "https://metacpan.org/release/DBD-mysql")
1524     (synopsis "DBI MySQL interface")
1525     (description "This package provides a MySQL driver for the Perl5
1526 @dfn{Database Interface} (DBI).")
1527     (license license:perl-license)))
1529 (define-public perl-dbd-sqlite
1530   (package
1531     (name "perl-dbd-sqlite")
1532     (version "1.62")
1533     (source (origin
1534               (method url-fetch)
1535               (uri (string-append
1536                     "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
1537                     version ".tar.gz"))
1538               (sha256
1539                (base32
1540                 "0p78ri1q6xpc1i98i6mlriv8n66iz8r5r11dlsknjm4y58rfz0mx"))))
1541     (build-system perl-build-system)
1542     (inputs `(("sqlite" ,sqlite)))
1543     (propagated-inputs `(("perl-dbi" ,perl-dbi)))
1544     (synopsis "SQlite interface for Perl")
1545     (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
1546 the entire thing in the distribution.  So in order to get a fast transaction
1547 capable RDBMS working for your Perl project you simply have to install this
1548 module, and nothing else.")
1549     (license license:perl-license)
1550     (home-page "https://metacpan.org/release/DBD-SQLite")))
1552 (define-public perl-mysql-config
1553   (package
1554     (name "perl-mysql-config")
1555     (version "1.04")
1556     (source
1557      (origin
1558        (method url-fetch)
1559        (uri (string-append
1560              "mirror://cpan/authors/id/D/DA/DARREN/MySQL-Config-"
1561              version
1562              ".tar.gz"))
1563        (sha256
1564         (base32
1565          "1svn7ccw2gc4cazvc58j84rxhnc9vs01zpird0l8460598j475qr"))))
1566     (build-system perl-build-system)
1567     (home-page "https://metacpan.org/release/MySQL-Config")
1568     (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files")
1569     (description
1570      "@code{MySQL::Config} emulates the @code{load_defaults} function from
1571 libmysqlclient.  It will fill an aray with long options, ready to be parsed by
1572 @code{Getopt::Long}.")
1573     (license license:perl-license)))
1575 (define-public perl-sql-abstract
1576   (package
1577     (name "perl-sql-abstract")
1578     (version "1.86")
1579     (source
1580      (origin
1581        (method url-fetch)
1582        (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/"
1583                            "SQL-Abstract-" version ".tar.gz"))
1584        (sha256
1585         (base32 "1pwcm8hwxcgidyyrak37lx69d85q728jxsb0b14jz93gbvdgg9z7"))))
1586     (build-system perl-build-system)
1587     (native-inputs
1588      `(("perl-module-install" ,perl-module-install)
1589        ("perl-test-deep" ,perl-test-deep)
1590        ("perl-test-exception" ,perl-test-exception)
1591        ("perl-test-warn" ,perl-test-warn)))
1592     (propagated-inputs
1593      `(("perl-hash-merge" ,perl-hash-merge)
1594        ("perl-moo" ,perl-moo)
1595        ("perl-mro-compat" ,perl-mro-compat)
1596        ("perl-text-balanced" ,perl-text-balanced)))
1597     (home-page "https://metacpan.org/release/SQL-Abstract")
1598     (synopsis "Generate SQL from Perl data structures")
1599     (description "This module was inspired by the excellent DBIx::Abstract.
1600 While based on the concepts used by DBIx::Abstract, the concepts used have
1601 been modified to make the SQL easier to generate from Perl data structures.
1602 The underlying idea is for this module to do what you mean, based on the data
1603 structures you provide it, so that you don't have to modify your code every
1604 time your data changes.")
1605     (license license:perl-license)))
1607 (define-public perl-sql-splitstatement
1608   (package
1609     (name "perl-sql-splitstatement")
1610     (version "1.00020")
1611     (source
1612      (origin
1613        (method url-fetch)
1614        (uri (string-append "mirror://cpan/authors/id/E/EM/EMAZEP/"
1615                            "SQL-SplitStatement-" version ".tar.gz"))
1616        (sha256
1617         (base32
1618          "0bqg45k4c9qkb2ypynlwhpvzsl4ssfagmsalys18s5c79ps30z7p"))))
1619     (build-system perl-build-system)
1620     (native-inputs
1621      `(("perl-test-exception" ,perl-test-exception)))
1622     (propagated-inputs
1623      `(("perl-class-accessor" ,perl-class-accessor)
1624        ("perl-list-moreutils" ,perl-list-moreutils)
1625        ("perl-regexp-common" ,perl-regexp-common)
1626        ("perl-sql-tokenizer" ,perl-sql-tokenizer)))
1627     (home-page "https://metacpan.org/release/SQL-SplitStatement")
1628     (synopsis "Split SQL code into atomic statements")
1629     (description "This module tries to split any SQL code, even including
1630 non-standard extensions, into the atomic statements it is composed of.")
1631     (license license:perl-license)))
1633 (define-public perl-sql-tokenizer
1634   (package
1635     (name "perl-sql-tokenizer")
1636     (version "0.24")
1637     (source
1638      (origin
1639        (method url-fetch)
1640        (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/"
1641                            "SQL-Tokenizer-" version ".tar.gz"))
1642        (sha256
1643         (base32
1644          "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s"))))
1645     (build-system perl-build-system)
1646     (home-page "https://metacpan.org/release/SQL-Tokenizer")
1647     (synopsis "SQL tokenizer")
1648     (description "SQL::Tokenizer is a tokenizer for SQL queries.  It does not
1649 claim to be a parser or query verifier.  It just creates sane tokens from a
1650 valid SQL query.")
1651     (license license:perl-license)))
1653 (define-public unixodbc
1654   (package
1655    (name "unixodbc")
1656    (version "2.3.7")
1657    (source (origin
1658             (method url-fetch)
1659             (uri
1660              (string-append
1661               "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-"
1662               version ".tar.gz"))
1663             (sha256
1664              (base32 "0xry3sg497wly8f7715a7gwkn2k36bcap0mvzjw74jj53yx6kwa5"))))
1665    (build-system gnu-build-system)
1666    (synopsis "Data source abstraction library")
1667    (description "Unixodbc is a library providing an API with which to access
1668 data sources.  Data sources include SQL Servers and any software with an ODBC
1669 Driver.")
1670    (license license:lgpl2.1+)
1671    ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
1672    (home-page "http://www.unixodbc.org")))
1674 (define-public unqlite
1675   (package
1676     (name "unqlite")
1677     (version "1.1.6")
1678     (source (origin
1679               (method url-fetch)
1680               ;; Contains bug fixes against the official release, and has an
1681               ;; autotooled build system.
1682               (uri (string-append "https://github.com/aidin36/tocc/releases/"
1683                                   "download/v1.0.0/"
1684                                   "unqlite-unofficial-" version ".tar.gz"))
1685               (sha256
1686                (base32
1687                 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s"))))
1688     (build-system gnu-build-system)
1689     (arguments `(#:tests? #f))          ;No check target
1690     (home-page "http://www.unqlite.org")
1691     (synopsis "In-memory key/value and document store")
1692     (description
1693      "UnQLite is an in-process software library which implements a
1694 self-contained, serverless, zero-configuration, transactional NoSQL
1695 database engine.  UnQLite is a document store database similar to
1696 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
1697 similar to BerkeleyDB, LevelDB, etc.")
1698     (license license:bsd-2)))
1700 (define-public redis
1701   (package
1702     (name "redis")
1703     (version "4.0.10")
1704     (source (origin
1705               (method url-fetch)
1706               (uri (string-append "http://download.redis.io/releases/redis-"
1707                                   version".tar.gz"))
1708               (sha256
1709                (base32
1710                 "194cydhv3hf4v95ifvjvsqrs4jn3ffrkg5lvxj5d3y04lwsp9dhx"))))
1711     (build-system gnu-build-system)
1712     (arguments
1713      '(#:tests? #f ; tests related to master/slave and replication fail
1714        #:phases (modify-phases %standard-phases
1715                   (delete 'configure))
1716        #:make-flags `("CC=gcc"
1717                       "MALLOC=libc"
1718                       "LDFLAGS=-ldl"
1719                       ,(string-append "PREFIX="
1720                                       (assoc-ref %outputs "out")))))
1721     (synopsis "Key-value cache and store")
1722     (description "Redis is an advanced key-value cache and store.  Redis
1723 supports many data structures including strings, hashes, lists, sets, sorted
1724 sets, bitmaps and hyperloglogs.")
1725     (home-page "http://redis.io/")
1726     (license license:bsd-3)))
1728 (define-public kyotocabinet
1729   (package
1730     (name "kyotocabinet")
1731     (version "1.2.77")
1732     (source (origin
1733               (method url-fetch)
1734               (uri (string-append "http://fallabs.com/kyotocabinet/pkg/"
1735                                   name "-" version ".tar.gz"))
1736               (sha256
1737                (base32
1738                 "1rlx4307adbzd842b4npq6cwlw8h010ingxaz3qz1ijc70lr72an"))))
1739     (build-system gnu-build-system)
1740     (arguments
1741      `(#:configure-flags
1742        (list
1743         "--disable-opt" ;"-march=native". XXX this also turns off -O0.
1744         (string-append "LDFLAGS=-Wl,-rpath="
1745                        (assoc-ref %outputs "out") "/lib"))))
1746     (inputs `(("zlib" ,zlib)))
1747     (home-page "http://fallabs.com/kyotocabinet/")
1748     (synopsis
1749      "Kyoto Cabinet is a modern implementation of the DBM database")
1750     (description
1751      "Kyoto Cabinet is a standalone file-based database that supports Hash
1752 and B+ Tree data storage models.  It is a fast key-value lightweight
1753 database and supports many programming languages.  It is a NoSQL database.")
1754     (license license:gpl3+)))
1756 (define-public tokyocabinet
1757   (package
1758     (name "tokyocabinet")
1759     (version "1.4.48")
1760     (source
1761      (origin
1762        (method url-fetch)
1763        (uri (string-append "http://fallabs.com/tokyocabinet/"
1764                            name "-" version ".tar.gz"))
1765        (sha256
1766         (base32
1767          "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0"))))
1768     (build-system gnu-build-system)
1769     (arguments
1770      `(#:configure-flags
1771        (list "--enable-pthread" "--enable-off64" "--enable-fastest"
1772         (string-append "LDFLAGS=-Wl,-rpath="
1773                        (assoc-ref %outputs "out") "/lib"))))
1774     (inputs
1775      `(("zlib" ,zlib)))
1776     (home-page "http://fallabs.com/tokyocabinet/")
1777     (synopsis "Tokyo Cabinet is a modern implementation of the DBM database")
1778     (description
1779      "Tokyo Cabinet is a library of routines for managing a database.
1780 The database is a simple data file containing records, each is a pair of a
1781 key and a value.  Every key and value is serial bytes with variable length.
1782 Both binary data and character string can be used as a key and a value.
1783 There is neither concept of data tables nor data types.  Records are
1784 organized in hash table, B+ tree, or fixed-length array.")
1785     (license license:lgpl2.1+)))
1787 (define-public wiredtiger
1788   (package
1789     (name "wiredtiger")
1790     (version "2.9.1")
1791     (source (origin
1792               (method url-fetch)
1793               (uri (string-append
1794                     "http://source.wiredtiger.com/releases/wiredtiger-"
1795                     version ".tar.bz2"))
1796               (sha256
1797                (base32
1798                 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s"))))
1799     (build-system gnu-build-system)
1800     (arguments
1801      '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib")
1802        #:phases
1803        (modify-phases %standard-phases
1804          (add-before 'check 'disable-test/fops
1805            (lambda _
1806              ;; XXX: timed out after 3600 seconds of silence
1807              (substitute* "Makefile"
1808                (("test/fops") ""))
1809              #t)))))
1810     (inputs
1811      `(("lz4" ,lz4)
1812        ("zlib" ,zlib)
1813        ("snappy" ,snappy)))
1814     (home-page "http://source.wiredtiger.com/")
1815     (synopsis "NoSQL data engine")
1816     (description
1817      "WiredTiger is an extensible platform for data management.  It supports
1818 row-oriented storage (where all columns of a row are stored together),
1819 column-oriented storage (where columns are stored in groups, allowing for
1820 more efficient access and storage of column subsets) and log-structured merge
1821 trees (LSM), for sustained throughput under random insert workloads.")
1822     (license license:gpl3) ; or GPL-2
1823     ;; configure.ac: WiredTiger requires a 64-bit build.
1824     (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))))
1826 (define-public wiredtiger-3
1827   (package
1828     (inherit wiredtiger)
1829     (name "wiredtiger")
1830     (version "3.1.0")
1831     (source (origin
1832               (method url-fetch)
1833               (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-"
1834                                   version ".tar.bz2"))
1835               (sha256
1836                (base32
1837                 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx"))))))
1839 (define-public guile-wiredtiger
1840   (package
1841     (name "guile-wiredtiger")
1842     (version "0.7.0")
1843     (source (origin
1844               (method git-fetch)
1845               (uri (git-reference
1846                     (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
1847                     (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b")))
1848               (file-name (string-append name "-" version "-checkout"))
1849               (sha256
1850                (base32
1851                 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595"))))
1852     (build-system gnu-build-system)
1853     (arguments
1854      '(#:parallel-tests? #f  ;; tests can't be run in parallel, yet.
1855        #:configure-flags
1856        (list (string-append "--with-libwiredtiger-prefix="
1857                             (assoc-ref %build-inputs "wiredtiger")))
1858        #:make-flags '("GUILE_AUTO_COMPILE=0")))
1859     (native-inputs
1860      `(("autoconf" ,autoconf)
1861        ("automake" ,automake)
1862        ("pkg-config" ,pkg-config)))
1863     (inputs
1864      `(("wiredtiger" ,wiredtiger-3)
1865        ("guile" ,guile-2.2)))
1866     (propagated-inputs
1867      `(("guile-bytestructures" ,guile-bytestructures)))
1868     (synopsis "WiredTiger bindings for GNU Guile")
1869     (description
1870      "This package provides Guile bindings to the WiredTiger ``NoSQL''
1871 database.")
1872     (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger")
1873     (license license:gpl3+)))
1875 (define-public perl-db-file
1876  (package
1877   (name "perl-db-file")
1878   (version "1.843")
1879   (source
1880     (origin
1881       (method url-fetch)
1882       (uri (string-append
1883              "mirror://cpan/authors/id/P/PM/PMQS/DB_File-"
1884              version
1885              ".tar.gz"))
1886       (sha256
1887         (base32
1888           "0sildz1i3fmh949w1scpjsyjx0cbmfw0yna3y70mc6vbwp8y696y"))))
1889   (build-system perl-build-system)
1890   (inputs `(("bdb" ,bdb)))
1891   (native-inputs `(("perl-test-pod" ,perl-test-pod)))
1892   (arguments
1893      `(#:phases (modify-phases %standard-phases
1894                   (add-before
1895                    'configure 'modify-config.in
1896                    (lambda* (#:key inputs #:allow-other-keys)
1897                      (substitute* "config.in"
1898                        (("/usr/local/BerkeleyDB") (assoc-ref inputs "bdb")))
1899                      #t)))))
1900   (home-page "https://metacpan.org/release/DB_File")
1901   (synopsis
1902     "Perl5 access to Berkeley DB version 1.x")
1903   (description
1904     "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.")
1905   (license license:perl-license)))
1907 (define-public lmdb
1908   (package
1909     (name "lmdb")
1910     (version "0.9.23")
1911     (source
1912      (origin
1913        (method git-fetch)
1914        (uri (git-reference
1915              (url "https://github.com/LMDB/lmdb.git")
1916              (commit (string-append "LMDB_" version))))
1917        (file-name (git-file-name name version))
1918        (sha256
1919         (base32 "0ag7l5180ajvm73y59m7sn3p52xm8m972d08cshxhpwgwa4v35k6"))))
1920     (build-system gnu-build-system)
1921     (arguments
1922      `(#:test-target "test"
1923        #:phases
1924        (modify-phases %standard-phases
1925          (replace 'configure
1926            (lambda* (#:key outputs #:allow-other-keys)
1927              (chdir "libraries/liblmdb")
1928              (substitute* "Makefile"
1929                (("/usr/local") (assoc-ref outputs "out")))
1930             #t)))))
1931     (home-page "https://symas.com/products/lightning-memory-mapped-database")
1932     (synopsis "Lightning Memory-Mapped Database library")
1933     (description
1934      "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance
1935 transactional database.  Unlike more complex relational databases, LMDB handles
1936 only key-value pairs (stored as arbitrary byte arrays) and relies on the
1937 underlying operating system for caching and locking, keeping the code small and
1938 simple.
1939 The use of ‘zero-copy’ memory-mapped files combines the persistence of classic
1940 disk-based databases with high read performance that scales linearly over
1941 multiple cores.  The size of each database is limited only by the size of the
1942 virtual address space — not physical RAM.")
1943     (license license:openldap2.8)))
1945 (define-public libpqxx
1946   (package
1947     (name "libpqxx")
1948     (version "4.0.1")
1949     (source (origin
1950               (method url-fetch)
1951               (uri (string-append
1952                     "http://pqxx.org/download/software/libpqxx/"
1953                     name "-" version ".tar.gz"))
1954               (sha256
1955                (base32
1956                 "0f6wxspp6rx12fkasanb0z2g2gc8dhcfwnxagx8wwqbpg6ifsz09"))))
1957     (build-system gnu-build-system)
1958     (native-inputs
1959      `(("python" ,python-2)))
1960     (inputs `(("postgresql" ,postgresql)))
1961     (arguments
1962      `(#:tests? #f   ; # FAIL:  1
1963        #:phases
1964        (modify-phases %standard-phases
1965          (add-before 'configure 'fix-sed-command
1966            (lambda _
1967              ;; Newer sed versions error out if double brackets are not used.
1968              (substitute* "configure"
1969                (("\\[:space:\\]") "[[:space:]]"))
1970              #t)))))
1971     (synopsis "C++ connector for PostgreSQL")
1972     (description
1973      "Libpqxx is a C++ library to enable user programs to communicate with the
1974 PostgreSQL database back-end.  The database back-end can be local or it may be
1975 on another machine, accessed via TCP/IP.")
1976     (home-page "http://pqxx.org/")
1977     (license license:bsd-3)))
1979 (define-public python-peewee
1980   (package
1981     (name "python-peewee")
1982     (version "2.10.2")
1983       (source
1984         (origin
1985         (method url-fetch)
1986         (uri (pypi-uri "peewee" version))
1987         (sha256
1988          (base32
1989           "10f2mrd5hw6rjklrzaix2lsxlgc8vx3xak54arcy6yd791zhchi3"))))
1990     (build-system python-build-system)
1991     (arguments
1992      `(#:tests? #f)) ; Fails to import test data
1993     (native-inputs
1994      `(("python-cython" ,python-cython)))
1995     (home-page "https://github.com/coleifer/peewee/")
1996     (synopsis "Small object-relational mapping utility")
1997     (description
1998      "Peewee is a simple and small ORM (object-relation mapping) tool.  Peewee
1999 handles converting between pythonic values and those used by databases, so you
2000 can use Python types in your code without having to worry.  It has built-in
2001 support for sqlite, mysql and postgresql.  If you already have a database, you
2002 can autogenerate peewee models using @code{pwiz}, a model generator.")
2003     (license license:expat)))
2005 (define-public python2-peewee
2006   (package-with-python2 python-peewee))
2008 (define-public sqlcipher
2009   (package
2010     (name "sqlcipher")
2011     (version "3.4.2")
2012     (source
2013      (origin
2014        (method url-fetch)
2015        (uri (string-append "https://github.com/sqlcipher/" name
2016                            "/archive/v" version ".tar.gz"))
2017        (sha256
2018         (base32 "1nxarwbci8jx99f1d0y1ivxcv25s78l1p7q6qy28lkpkcx8pm2b9"))
2019        (file-name (string-append name "-" version ".tar.gz"))))
2020     (build-system gnu-build-system)
2021     (inputs
2022      `(("libcrypto" ,openssl)
2023        ("libtcl8.6" ,tcl))) ; required for running the tests
2024     (native-inputs
2025      `(("tcl" ,tcl)))
2026     (arguments
2027      '(#:configure-flags
2028        '("--enable-tempstore=yes"
2029          "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
2030          "LDFLAGS=-lcrypto -ltcl8.6"
2031          "--disable-tcl")
2032        ;; tests cannot be run from the Makefile
2033        ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172>
2034        #:test-target "testfixture"
2035        #:phases
2036        (modify-phases %standard-phases
2037          (add-before 'check 'build-test-runner
2038            (assoc-ref %standard-phases 'check))
2039          (replace 'check
2040            (lambda _
2041              (invoke "./testfixture" "test/crypto.test"))))))
2042     (home-page "https://www.zetetic.net/sqlcipher/")
2043     (synopsis
2044      "Library providing transparent encryption of SQLite database files")
2045     (description "SQLCipher is an implementation of SQLite, extended to
2046 provide transparent 256-bit AES encryption of database files.  Pages are
2047 encrypted before being written to disk and are decrypted when read back.  It’s
2048 well suited for protecting embedded application databases and for mobile
2049 development.")
2050     ;; The source files
2051     ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c},
2052     ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl,
2053     ;; test/crypto.test are licensed under a 3-clause BSD license. All other
2054     ;; source files are in the public domain.
2055     (license (list license:public-domain license:bsd-3))))
2057 (define-public python-pyodbc-c
2058   (package
2059     (name "python-pyodbc-c")
2060     (version "3.1.4")
2061     (source
2062      (origin
2063        (method url-fetch)
2064        (uri (string-append "https://gitlab.com/daym/pyodbc-c/repository/"
2065                            "archive.tar.gz?ref=v" version))
2066        (sha256
2067         (base32
2068          "05aq2297k779xidmxcwkrrxjvj1bh2q7d9a1rcjv6zr15y764ga9"))
2069        (file-name (string-append name "-" version ".tar.gz"))))
2070     (build-system python-build-system)
2071     (inputs
2072      `(("unixodbc" ,unixodbc)))
2073     (arguments
2074      `(;; No unit tests exist.
2075        #:tests? #f))
2076     (home-page "https://github.com/mkleehammer/pyodbc")
2077     (synopsis "Python ODBC Library")
2078     (description "@code{python-pyodbc-c} provides a Python DB-API driver
2079 for ODBC.")
2080     (license (license:x11-style "file://LICENSE.TXT"))))
2082 (define-public python2-pyodbc-c
2083   (package-with-python2 python-pyodbc-c))
2085 (define-public python-pyodbc
2086   (package
2087     (name "python-pyodbc")
2088     (version "4.0.26")
2089     (source
2090      (origin
2091        (method url-fetch)
2092        (uri (pypi-uri "pyodbc" version))
2093        (sha256
2094         (base32 "1qrxnf7ji5hml7z4y669k4wmk3iz2pcsr05bnn1n912asash09z5"))
2095        (file-name (string-append name "-" version ".tar.gz"))))
2096     (build-system python-build-system)
2097     (inputs
2098      `(("unixodbc" ,unixodbc)))
2099     (arguments
2100      `(;; No unit tests exist.
2101        #:tests? #f))
2102     (home-page "https://github.com/mkleehammer/pyodbc")
2103     (synopsis "Python ODBC Library")
2104     (description "@code{python-pyodbc} provides a Python DB-API driver
2105 for ODBC.")
2106     (license (license:x11-style "file:///LICENSE.TXT"))))
2108 (define-public python2-pyodbc
2109   (package-with-python2 python-pyodbc))
2111 (define-public mdbtools
2112   (package
2113     (name "mdbtools")
2114     (version "0.7.1")
2115     (source
2116      (origin
2117        (method git-fetch)
2118        (uri (git-reference
2119              (url "https://github.com/brianb/mdbtools.git")
2120              (commit version)))
2121        (file-name (git-file-name name version))
2122        (sha256
2123         (base32
2124          "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l"))))
2125     (build-system gnu-build-system)
2126     (inputs
2127      `(("glib" ,glib)))
2128     (native-inputs
2129      `(("autoconf" ,autoconf)
2130        ("automake" ,automake)
2131        ("libtool" ,libtool)
2132        ("pkg-config" ,pkg-config)
2133        ("txt2man" ,txt2man)
2134        ("which" ,which)))
2135     (home-page "http://mdbtools.sourceforge.net/")
2136     (synopsis "Read Microsoft Access databases")
2137     (description "MDB Tools is a set of tools and applications to read the
2138 proprietary MDB file format used in Microsoft's Access database package.  This
2139 includes programs to export schema and data from Microsoft's Access database
2140 file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL,
2141 etc., and an SQL engine for performing simple SQL queries.")
2142     (license (list license:lgpl2.0
2143                    license:gpl2+))))
2145 (define-public python-lmdb
2146   (package
2147     (name "python-lmdb")
2148     (version "0.94")
2149     (source (origin
2150               (method url-fetch)
2151               (uri (pypi-uri "lmdb" version))
2152               (sha256
2153                (base32
2154                 "1zh38gvkqw1jm5105if6rr7ccbgyxr7k2rm5ygb9ab3bq82pyaww"))
2155               (modules '((guix build utils)))
2156               (snippet
2157                ;; Delete bundled lmdb source files.
2158                '(begin
2159                   (for-each delete-file (list "lib/lmdb.h"
2160                                               "lib/mdb.c"
2161                                               "lib/midl.c"
2162                                               "lib/midl.h"))
2163                   #t))))
2164     (build-system python-build-system)
2165     (inputs
2166      `(("lmdb" ,lmdb)))
2167     (arguments
2168      `(#:phases
2169        (modify-phases %standard-phases
2170          (add-before 'build 'use-system-lmdb
2171            (lambda* (#:key inputs #:allow-other-keys)
2172              (let ((lmdb (assoc-ref inputs "lmdb")))
2173                (setenv "LMDB_FORCE_SYSTEM" "set")
2174                (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include"))
2175                (setenv "LMDB_LIBDIR" (string-append lmdb "/lib"))
2176                #t))))
2177        ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’.
2178        #:tests? #f))
2179     (home-page "https://github.com/dw/py-lmdb")
2180     (synopsis "Python binding for the ‘Lightning’ database (LMDB)")
2181     (description
2182      "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning
2183 Memory-Mapped Database} (LMDB), a high-performance key-value store.")
2184     (license
2185      (list license:openldap2.8
2186            ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3,
2187            ;; but not actually needed on platforms currently supported by Guix.
2188            license:bsd-3))))
2190 (define-public python2-lmdb
2191   (package-with-python2 python-lmdb))
2193 (define-public python-orator
2194   (package
2195     (name "python-orator")
2196     (version "0.9.7")
2197     (source (origin
2198               (method url-fetch)
2199               (uri (pypi-uri "orator" version))
2200               (sha256
2201                (base32
2202                 "14r58z64fdp76ixnvmi4lni762b405ynmsx6chr1qihs3yl9zn6c"))))
2203     (build-system python-build-system)
2204     (arguments
2205      `(#:phases
2206        (modify-phases %standard-phases
2207          (add-after 'unpack 'loosen-dependencies
2208            ;; Tests are not actually run since they are not included with the
2209            ;; distributed package, but dependencies are checked.
2210            (lambda _
2211              (substitute* "setup.py"
2212                ((",<.*'") "'")
2213                (("flexmock==0.9.7") "flexmock")
2214                ;; The pytest-mock package is out of date, so we remove minimum
2215                ;; version requirement.
2216                (("pytest-mock.*'") "pytest-mock'"))
2217              #t)))))
2218     (native-inputs
2219      `(("python-pytest-mock" ,python-pytest-mock)
2220        ("python-pytest" ,python-pytest)
2221        ("python-flexmock" ,python-flexmock)))
2222     (propagated-inputs
2223      `(("python-backpack" ,python-backpack)
2224        ("python-blinker" ,python-blinker)
2225        ("python-cleo" ,python-cleo)
2226        ("python-faker" ,python-faker)
2227        ("python-inflection" ,python-inflection)
2228        ("python-lazy-object-proxy" ,python-lazy-object-proxy)
2229        ("python-pendulum" ,python-pendulum)
2230        ("python-pyaml" ,python-pyaml)
2231        ("python-pygments" ,python-pygments)
2232        ("python-simplejson" ,python-simplejson)
2233        ("python-six" ,python-six)
2234        ("python-wrapt" ,python-wrapt)))
2235     (home-page "https://orator-orm.com/")
2236     (synopsis "ActiveRecord ORM for Python")
2237     (description
2238      "Orator provides a simple ActiveRecord-like Object Relational Mapping
2239 implementation for Python.")
2240     (license license:expat)
2241     (properties `((python2-variant . ,(delay python2-orator))))))
2243 (define-public python2-orator
2244   (package-with-python2 (strip-python2-variant python-orator)))
2246 (define-public virtuoso-ose
2247   (package
2248     (name "virtuoso-ose")
2249     (version "7.2.5")
2250     (source
2251      (origin
2252        (method url-fetch)
2253        (uri (string-append
2254              "https://github.com/openlink/virtuoso-opensource/releases/"
2255              "download/v" version "/virtuoso-opensource-" version ".tar.gz"))
2256        (sha256
2257         (base32 "0r1xakclkfi69pzh8z2k16z3x0m49pxp764icj0ad4w4bb97fr42"))))
2258     (build-system gnu-build-system)
2259     (arguments
2260      `(#:tests? #f ; Tests require a network connection.
2261        ;; TODO: Removing the libsrc/zlib source directory breaks the build.
2262        ;; This indicates that the internal zlib code may still be used.
2263        #:configure-flags '("--without-internal-zlib"
2264                            "--with-readline")))
2265     (inputs
2266      `(("openssl" ,openssl)
2267        ("net-tools" ,net-tools)
2268        ("readline" ,readline)
2269        ("zlib" ,zlib)))
2270     (home-page "http://vos.openlinksw.com/owiki/wiki/VOS/")
2271     (synopsis "Multi-model database system")
2272     (description "Virtuoso is a scalable cross-platform server that combines
2273 relational, graph, and document data management with web application server
2274 and web services platform functionality.")
2275     ;; configure: error: ... can only be build on 64bit platforms
2276     (supported-systems '("x86_64-linux" "mips64el-linux" "aarch64-linux"))
2277     (license license:gpl2)))
2279 (define-public python-ccm
2280   (package
2281     (name "python-ccm")
2282     (version "2.1.6")
2283     (source
2284      (origin
2285        (method url-fetch)
2286        (uri (pypi-uri "ccm" version))
2287        (sha256
2288         (base32
2289          "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n"))))
2290     (build-system python-build-system)
2291     (propagated-inputs
2292      `(("python-pyyaml" ,python-pyyaml)
2293        ;; Not listed in setup.py, but used in ccmlib/node.py for full
2294        ;; functionality
2295        ("python-psutil" ,python-psutil)
2296        ("python-six" ,python-six)))
2297     (home-page "https://github.com/pcmanus/ccm")
2298     (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on
2299 localhost")
2300     (description "Cassandra Cluster Manager is a development tool for testing
2301 local Cassandra clusters. It creates, launches and removes Cassandra clusters
2302 on localhost.")
2303     (license license:asl2.0)))
2305 (define-public python2-ccm
2306   (package-with-python2 python-ccm))
2308 (define-public python2-pysqlite
2309   (package
2310     (name "python2-pysqlite")
2311     (version "2.8.3")
2312     (source
2313      (origin
2314       (method url-fetch)
2315       (uri (pypi-uri "pysqlite" version))
2316       (sha256
2317        (base32
2318         "1424gwq9sil2ffmnizk60q36vydkv8rxs6m7xs987kz8cdc37lqp"))))
2319     (build-system python-build-system)
2320     (inputs
2321      `(("sqlite" ,sqlite)))
2322     (arguments
2323      `(#:python ,python-2 ; incompatible with Python 3
2324        #:tests? #f)) ; no test target
2325     (home-page "https://github.com/ghaering/pysqlite")
2326     (synopsis "SQLite bindings for Python")
2327     (description
2328      "Pysqlite provides SQLite bindings for Python that comply to the
2329 Database API 2.0T.")
2330     (license license:zlib)))
2332 (define-public python-sqlalchemy
2333   (package
2334     (name "python-sqlalchemy")
2335     (version "1.3.3")
2336     (source
2337      (origin
2338       (method url-fetch)
2339       (uri (pypi-uri "SQLAlchemy" version))
2340       (sha256
2341        (base32 "06c3lcv7nijsgqsjaaa4djrwlzgh9f910zlqxkmgq22h6jl4rici"))))
2342     (build-system python-build-system)
2343     (native-inputs
2344      `(("python-cython" ,python-cython) ; for C extensions
2345        ("python-pytest" ,python-pytest)
2346        ("python-mock"   ,python-mock))) ; for tests
2347     (arguments
2348      `(#:phases
2349        (modify-phases %standard-phases
2350          (replace 'check
2351            (lambda _ (invoke "py.test"))))))
2352     (home-page "https://www.sqlalchemy.org")
2353     (synopsis "Database abstraction library")
2354     (description
2355      "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
2356 gives application developers the full power and flexibility of SQL.  It
2357 provides a full suite of well known enterprise-level persistence patterns,
2358 designed for efficient and high-performing database access, adapted into a
2359 simple and Pythonic domain language.")
2360     (license license:x11)))
2362 (define-public python2-sqlalchemy
2363   (package-with-python2 python-sqlalchemy))
2365 (define-public python-sqlalchemy-utils
2366   (package
2367     (name "python-sqlalchemy-utils")
2368     (version "0.32.21")
2369     (source
2370       (origin
2371         (method url-fetch)
2372         (uri (pypi-uri "SQLAlchemy-Utils" version))
2373         (sha256
2374          (base32
2375           "1myn71dn8j74xglyh46f12sh8ywb7j0j732rzwq70kvwwnq32m73"))))
2376     (build-system python-build-system)
2377     (arguments
2378      '(#:tests? #f)) ; FIXME: Many tests require a running database server.
2379        ;; #:phases
2380        ;; (modify-phases %standard-phases
2381        ;;   (replace 'check
2382        ;;     (lambda _
2383        ;;       (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
2384     (propagated-inputs
2385      `(("python-six" ,python-six)
2386        ("python-sqlalchemy" ,python-sqlalchemy)))
2387     (native-inputs
2388      `(("python-dateutil" ,python-dateutil)
2389        ("python-flexmock" ,python-flexmock)
2390        ("python-psycopg2" ,python-psycopg2)
2391        ("python-pytest" ,python-pytest)
2392        ("python-pytz" ,python-pytz)))
2393     (home-page "https://github.com/kvesteri/sqlalchemy-utils")
2394     (synopsis "Various utility functions for SQLAlchemy")
2395     (description
2396      "SQLAlchemy-utils provides various utility functions and custom data types
2397 for SQLAlchemy.  SQLAlchemy is an SQL database abstraction library for Python.
2399 You might also want to install the following optional dependencies:
2400 @enumerate
2401 @item @code{python-passlib}
2402 @item @code{python-babel}
2403 @item @code{python-cryptography}
2404 @item @code{python-pytz}
2405 @item @code{python-psycopg2}
2406 @item @code{python-furl}
2407 @item @code{python-flask-babel}
2408 @end enumerate
2410     (license license:bsd-3)))
2412 (define-public python2-sqlalchemy-utils
2413   (package-with-python2 python-sqlalchemy-utils))
2415 (define-public python-alembic
2416   (package
2417     (name "python-alembic")
2418     (version "1.0.2")
2419     (source
2420      (origin
2421        (method url-fetch)
2422        (uri (pypi-uri "alembic" version))
2423        (sha256
2424         (base32
2425          "0asqz9mwc4w8bsar1icv3ik9jslxrj3gv3yxgmhc6nc6r9qbkg04"))))
2426     (build-system python-build-system)
2427     (native-inputs
2428      `(("python-mock" ,python-mock)
2429        ("python-pytest-cov" ,python-pytest-cov)))
2430     (propagated-inputs
2431      `(("python-dateutil" ,python-dateutil)
2432        ("python-sqlalchemy" ,python-sqlalchemy)
2433        ("python-mako" ,python-mako)
2434        ("python-editor" ,python-editor)))
2435     (home-page "https://bitbucket.org/zzzeek/alembic")
2436     (synopsis
2437      "Database migration tool for SQLAlchemy")
2438     (description
2439      "Alembic is a lightweight database migration tool for usage with the
2440 SQLAlchemy Database Toolkit for Python.")
2441     (license license:expat)))
2443 (define-public python2-alembic
2444   (package-with-python2 python-alembic))
2446 (define-public python-pickleshare
2447   (package
2448     (name "python-pickleshare")
2449     (version "0.7.5")
2450     (source
2451      (origin
2452        (method url-fetch)
2453        (uri (pypi-uri "pickleshare" version))
2454        (sha256
2455         (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47"))))
2456     (build-system python-build-system)
2457     (arguments
2458      `(#:phases (modify-phases %standard-phases
2459                   (replace 'check
2460                     (lambda _
2461                       (invoke "pytest"))))))
2462     (native-inputs
2463      `(("python-pytest" ,python-pytest)))
2464     (home-page "https://github.com/vivainio/pickleshare")
2465     (synopsis "Tiny key value database with concurrency support")
2466     (description
2467      "PickleShare is a small ‘shelve’-like datastore with concurrency support.
2468 Like shelve, a PickleShareDB object acts like a normal dictionary.  Unlike
2469 shelve, many processes can access the database simultaneously.  Changing a
2470 value in database is immediately visible to other processes accessing the same
2471 database.  Concurrency is possible because the values are stored in separate
2472 files.  Hence the “database” is a directory where all files are governed by
2473 PickleShare.")
2474     (properties `((python2-variant . ,(delay python2-pickleshare))))
2475     (license license:expat)))
2477 (define-public python2-pickleshare
2478   (let ((pickleshare (package-with-python2
2479                       (strip-python2-variant python-pickleshare))))
2480     (package (inherit pickleshare)
2481       (propagated-inputs `(("python2-pathlib2" ,python2-pathlib2)
2482                            ,@(package-propagated-inputs pickleshare))))))
2484 (define-public python-apsw
2485   (package
2486     (name "python-apsw")
2487     (version "3.20.1-r1")
2488     (source
2489       (origin
2490         (method url-fetch)
2491         (uri (string-append "https://github.com/rogerbinns/apsw/archive/"
2492                             version ".tar.gz"))
2493         (file-name (string-append "apsw-" version ".tar.gz"))
2494         (sha256
2495           (base32
2496            "00ai7m2pqi26qaflhz314d8k5i3syw7xzr145fhfl0crhyh6adz2"))))
2497     (build-system python-build-system)
2498     (inputs
2499      `(("sqlite" ,sqlite)))
2500     (arguments
2501      `(#:phases
2502        (modify-phases %standard-phases
2503          (replace 'build
2504            (lambda _
2505              (invoke "python" "setup.py" "build" "--enable-all-extensions")
2506              #t))
2507          (add-after 'build 'build-test-helper
2508            (lambda _
2509              (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext"
2510                      "-I." "-Isqlite3" "src/testextension.c")
2511              #t))
2512          (delete 'check)
2513          (add-after 'install 'check
2514            (lambda* (#:key inputs outputs #:allow-other-keys)
2515              (add-installed-pythonpath inputs outputs)
2516              (invoke "python" "setup.py" "test")
2517              #t)))))
2518     (home-page "https://github.com/rogerbinns/apsw/")
2519     (synopsis "Another Python SQLite Wrapper")
2520     (description "APSW is a Python wrapper for the SQLite
2521 embedded relational database engine.  In contrast to other wrappers such as
2522 pysqlite it focuses on being a minimal layer over SQLite attempting just to
2523 translate the complete SQLite API into Python.")
2524     (license license:zlib)))
2526 (define-public python2-apsw
2527   (package-with-python2 python-apsw))
2529 (define-public python2-neo4j-driver
2530   (package
2531     (name "python2-neo4j-driver")
2532     ;; NOTE: When upgrading to 1.5.0, please add a python3 variant.
2533     (version "1.4.0")
2534     (source (origin
2535               (method url-fetch)
2536               (uri (pypi-uri "neo4j-driver" version))
2537               (sha256
2538                (base32
2539                 "011r1vh182p8mm83d8dz9rfnc3l7rf7fd00cyrbyfzi71jmc4g98"))))
2540     (build-system python-build-system)
2541     (arguments
2542      `(#:python ,python-2))
2543     (home-page "https://neo4j.com/developer/python/")
2544     (synopsis "Neo4j driver code written in Python")
2545     (description "This package provides the Neo4j Python driver that connects
2546 to the database using Neo4j's binary protocol.  It aims to be minimal, while
2547 being idiomatic to Python.")
2548     (license license:asl2.0)))
2550 (define-public python2-py2neo
2551   (package
2552     (name "python2-py2neo")
2553     (version "3.1.2")
2554     (source (origin
2555               (method url-fetch)
2556               (uri (pypi-uri "py2neo" version))
2557               (sha256
2558                (base32
2559                 "1f1q95vqcvlc3nsc33p841swnjdcjazddlq2dzi3qfnjqjrajxw1"))))
2560     (build-system python-build-system)
2561     (arguments
2562      `(#:python ,python-2))
2563     (home-page "http://py2neo.org")
2564     (synopsis "Library and toolkit for working with Neo4j in Python")
2565     (description "This package provides a client library and toolkit for
2566 working with Neo4j from within Python applications and from the command
2567 line.  The core library has no external dependencies and has been carefully
2568 designed to be easy and intuitive to use.")
2569     (license license:asl2.0)))
2571 (define-public python-psycopg2
2572   (package
2573     (name "python-psycopg2")
2574     (version "2.7.7")
2575     (source
2576      (origin
2577        (method url-fetch)
2578        (uri (pypi-uri "psycopg2" version))
2579        (sha256
2580         (base32 "0zjbabb4qjx9dm07imhf8y5a9rpa06d5zah80myiimgdi83nslpl"))))
2581     (build-system python-build-system)
2582     (arguments
2583      ;; Tests would require a postgresql database "psycopg2_test"
2584      ;; and a running postgresql database management service.
2585      `(#:tests? #f)) ; TODO re-enable after providing a test-db.
2586     (inputs
2587      `(("postgresql" ,postgresql))) ; libpq
2588     (home-page "http://initd.org/psycopg/")
2589     (synopsis "Python PostgreSQL adapter")
2590     (description
2591      "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API
2592 2.0.")
2593     (license license:lgpl3+)))
2595 (define-public python2-psycopg2
2596   (package-with-python2 python-psycopg2))
2598 (define-public python-sadisplay
2599   (package
2600     (name "python-sadisplay")
2601     (version "0.4.8")
2602     (source
2603       (origin
2604         (method url-fetch)
2605         (uri (pypi-uri "sadisplay" version))
2606       (sha256
2607         (base32
2608           "01d9lxhmgpb68gy8rd6zj6fcwp84n2qq210n1qsk3qbsir79bzh4"))))
2609     (build-system python-build-system)
2610     (propagated-inputs
2611       `(("python-sqlalchemy" ,python-sqlalchemy)))
2612     (native-inputs
2613      ;; For tests.
2614       `(("python-nose" ,python-nose)))
2615     (home-page "https://bitbucket.org/estin/sadisplay")
2616     (synopsis "SQLAlchemy schema displayer")
2617     (description "This package provides a program to build Entity
2618 Relationship diagrams from a SQLAlchemy model (or directly from the
2619 database).")
2620     (license license:bsd-3)))
2622 (define-public python2-sadisplay
2623   (package-with-python2 python-sadisplay))
2625 (define-public python-mysqlclient
2626   (package
2627     (name "python-mysqlclient")
2628     (version "1.3.13")
2629     (source
2630      (origin
2631        (method url-fetch)
2632        (uri (pypi-uri "mysqlclient" version))
2633        (sha256
2634         (base32
2635          "0kv4a1icwdav8jpl7qvnr931lw5h3v22ids6lwq6qpi1hjzf33pz"))))
2636     (build-system python-build-system)
2637     (native-inputs
2638      `(("nose" ,python-nose)
2639        ("mock" ,python-mock)
2640        ("py.test" ,python-pytest)))
2641     (inputs
2642      `(("mysql" ,mariadb)
2643        ("libz" ,zlib)
2644        ("openssl" ,openssl)))
2645     (home-page "https://github.com/PyMySQL/mysqlclient-python")
2646     (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
2647     (description "MySQLdb is an interface to the popular MySQL database server
2648 for Python.  The design goals are:
2649 @enumerate
2650 @item Compliance with Python database API version 2.0 [PEP-0249],
2651 @item Thread-safety,
2652 @item Thread-friendliness (threads will not block each other).
2653 @end enumerate")
2654     (license license:gpl2)))
2656 (define-public python2-mysqlclient
2657   (package-with-python2 python-mysqlclient))
2659 (define-public python-hiredis
2660   (package
2661     (name "python-hiredis")
2662     (version "0.2.0")
2663     (source
2664      (origin
2665        (method url-fetch)
2666        (uri (pypi-uri "hiredis" version))
2667        (sha256
2668         (base32
2669          "1dfm2k9l9zar9nw9fwmm74zrgraxdxs04vx9li56fjcf289qx5fa"))))
2670     (build-system python-build-system)
2671     (arguments
2672      ;; no tests
2673      `(#:tests? #f))
2674     (home-page "https://github.com/redis/hiredis-py")
2675     (synopsis "Python extension that wraps protocol parsing code in hiredis")
2676     (description "Python-hiredis is a python extension that wraps protocol
2677 parsing code in hiredis.  It primarily speeds up parsing of multi bulk replies.")
2678     (license license:bsd-3)))
2680 (define-public python2-hiredis
2681   (package-with-python2 python-hiredis))
2683 (define-public python-fakeredis
2684   (package
2685     (name "python-fakeredis")
2686     (version "0.8.2")
2687     (source
2688      (origin
2689        (method url-fetch)
2690        (uri (pypi-uri "fakeredis" version))
2691        (sha256
2692         (base32
2693          "0zncahj3byyasyfx9i7k991ph0n0lq8v3a21pqri5qxn9564bk9r"))))
2694     (build-system python-build-system)
2695     (arguments
2696      ;; no tests
2697      `(#:tests? #f))
2698     (home-page "https://github.com/jamesls/fakeredis")
2699     (synopsis "Fake implementation of redis API for testing purposes")
2700     (description
2701      "Fakeredis is a pure-Python implementation of the redis-py Python client
2702 that simulates talking to a redis server.  It was created for a single purpose:
2703 to write unit tests.
2705 Setting up redis is not hard, but one often wants to write unit tests that don't
2706 talk to an external server such as redis.  This module can be used as a
2707 reasonable substitute.")
2708     (license license:bsd-3)))
2710 (define-public python2-fakeredis
2711   (package-with-python2 python-fakeredis))
2713 (define-public python-redis
2714   (package
2715     (name "python-redis")
2716     (version "3.2.1")
2717     (source
2718      (origin
2719        (method url-fetch)
2720        (uri (pypi-uri "redis" version))
2721        (sha256
2722         (base32 "0wwj8il4c3aff15xwwcjfci367zxsakq05ps1a2il6yavp91i94c"))))
2723     (build-system python-build-system)
2724     ;; Tests require a running Redis server.
2725     (arguments '(#:tests? #f))
2726     ;; As long as we are not running test, we do not need this input :-)
2727     ;;(native-inputs
2728     ;; `(("python-pytest" ,python-pytest)))
2729     (home-page "https://github.com/andymccurdy/redis-py")
2730     (synopsis "Redis Python client")
2731     (description
2732      "This package provides a Python interface to the Redis key-value store.")
2733     (license license:expat)))
2735 (define-public python2-redis
2736   (package-with-python2 python-redis))
2738 (define-public python-rq
2739   (package
2740     (name "python-rq")
2741     (version "0.13.0")
2742     (source
2743      (origin
2744        (method url-fetch)
2745        (uri (pypi-uri "rq" version))
2746        (sha256
2747         (base32 "0xvapd2bxnyq480i48bdkddzlqmv2axbsq85rlfy8k3al8zxxxrf"))))
2748     (build-system python-build-system)
2749     (propagated-inputs
2750      `(("python-click" ,python-click)
2751        ("python-redis" ,python-redis)))
2752     (home-page "http://python-rq.org/")
2753     (synopsis "Simple job queues for Python")
2754     (description
2755      "RQ (Redis Queue) is a simple Python library for queueing jobs and
2756 processing them in the background with workers.  It is backed by Redis and it
2757 is designed to have a low barrier to entry.")
2758     (license license:bsd-2)))
2760 (define-public python2-rq
2761   (package-with-python2 python-rq))
2763 (define-public python-trollius-redis
2764   (package
2765     (name "python-trollius-redis")
2766     (version "0.1.4")
2767     (source
2768       (origin
2769         (method url-fetch)
2770         (uri (pypi-uri "trollius_redis" version))
2771         (sha256
2772          (base32
2773           "0k3vypszmgmaipgw9xscvgm79h2zd6p6ci8gdp5sxl6g5kbqr9fy"))))
2774     (build-system python-build-system)
2775     ;; TODO: Tests require packaging 'hiredis'.
2776     (arguments '(#:tests? #f))
2777     (home-page "https://github.com/benjolitz/trollius-redis")
2778     (synopsis "Port of asyncio-redis to trollius")
2779     (description "@code{trollius-redis} is a Redis client for Python
2780   trollius.  It is an asynchronous IO (PEP 3156) implementation of the
2781   Redis protocol.")
2782     (license license:bsd-2)))
2784 (define-public python2-trollius-redis
2785   (package-with-python2 python-trollius-redis))
2787 (define-public python-sqlparse
2788   (package
2789     (name "python-sqlparse")
2790     (version "0.2.4")
2791     (source (origin
2792               (method url-fetch)
2793               (uri (pypi-uri "sqlparse" version))
2794               (sha256
2795                (base32
2796                 "1v3xh0bkfhb262dbndgzhivpnhdwavdzz8jjhx9vx0xbrx2880nf"))))
2797     (build-system python-build-system)
2798     (arguments
2799      `(#:phases
2800        (modify-phases %standard-phases
2801          (replace 'check
2802            (lambda _ (invoke "py.test"))))))
2803     (native-inputs
2804      `(("python-pytest" ,python-pytest)))
2805     (home-page "https://github.com/andialbrecht/sqlparse")
2806     (synopsis "Non-validating SQL parser")
2807     (description "Sqlparse is a non-validating SQL parser for Python.  It
2808 provides support for parsing, splitting and formatting SQL statements.")
2809     (license license:bsd-3)))
2811 (define-public python2-sqlparse
2812   (package-with-python2 python-sqlparse))
2814 (define-public python-sql
2815   (package
2816     (name "python-sql")
2817     (version "1.0.0")
2818     (source
2819      (origin
2820        (method url-fetch)
2821        (uri (pypi-uri "python-sql" version))
2822        (sha256
2823         (base32 "05ni936y0ia9xmryl7mlhbj9i80nnvq1bi4zxhb96rv7yvpb3fqb"))))
2824     (build-system python-build-system)
2825     (home-page "https://python-sql.tryton.org/")
2826     (synopsis "Library to write SQL queries in a pythonic way")
2827     (description "@code{python-sql} is a library to write SQL queries, that
2828 transforms idiomatic python function calls to well-formed SQL queries.")
2829     (license license:bsd-3)))
2831 (define-public python2-sql
2832   (package-with-python2 python-sql))
2834 (define-public mongo-tools
2835   (package
2836     (name "mongo-tools")
2837     (version "3.4.0")
2838     (source
2839      (origin (method git-fetch)
2840              (uri (git-reference
2841                    (url "https://github.com/mongodb/mongo-tools")
2842                    (commit (string-append "r" version))))
2843              (file-name (git-file-name name version))
2844              (sha256
2845               (base32
2846                "1bcsz5cvj39a7nsxsfqmz9igrw33j6yli9kffigqyscs52amw7x1"))))
2847     (build-system go-build-system)
2848     (arguments
2849      `(#:import-path "github.com/mongodb/mongo-tools"
2850        #:modules ((srfi srfi-1)
2851                   (guix build go-build-system)
2852                   (guix build utils))
2853        #:install-source? #f
2854        #:phases
2855        (let ((all-tools
2856               '("bsondump" "mongodump" "mongoexport" "mongofiles"
2857                 "mongoimport" "mongooplog" "mongorestore"
2858                 "mongostat" "mongotop")))
2859          (modify-phases %standard-phases
2860            (add-after 'unpack 'delete-bundled-source-code
2861              (lambda _
2862                (delete-file-recursively
2863                 "src/github.com/mongodb/mongo-tools/vendor")
2864                #t))
2865            (add-after 'delete-bundled-source-code 'patch-source
2866              (lambda _
2867                ;; Remove a redundant argument that causes compilation to fail.
2868                (substitute*
2869                    "src/github.com/mongodb/mongo-tools/mongorestore/filepath.go"
2870                  (("skipping restore of system.profile collection\", db)")
2871                   "skipping restore of system.profile collection\")"))
2872                #t))
2873            (replace 'build
2874              (lambda _
2875                (for-each (lambda (tool)
2876                            (let ((command
2877                                   `("go" "build"
2878                                     ;; This is where the tests expect to find the
2879                                     ;; executables
2880                                     "-o" ,(string-append
2881                                            "src/github.com/mongodb/mongo-tools/bin/"
2882                                            tool)
2883                                     "-v"
2884                                     "-tags=\"ssl sasl\""
2885                                     "-ldflags"
2886                                     "-extldflags=-Wl,-z,now,-z,relro"
2887                                     ,(string-append
2888                                       "src/github.com/mongodb/mongo-tools/"
2889                                       tool "/main/" tool ".go"))))
2890                              (simple-format #t "build: running ~A\n"
2891                                             (string-join command))
2892                              (apply invoke command)))
2893                          all-tools)
2894                #t))
2895            (replace 'check
2896              (lambda _
2897                (with-directory-excursion "src"
2898                  (for-each (lambda (tool)
2899                              (invoke
2900                               "go" "test" "-v"
2901                               (string-append "github.com/mongodb/mongo-tools/"
2902                                              tool)))
2903                            all-tools))
2904                #t))
2905            (replace 'install
2906              (lambda* (#:key outputs #:allow-other-keys)
2907                (for-each (lambda (tool)
2908                            (install-file
2909                             (string-append "src/github.com/mongodb/mongo-tools/bin/"
2910                                            tool)
2911                             (string-append (assoc-ref outputs "out")
2912                                            "/bin")))
2913                          all-tools)
2914                #t))))))
2915     (native-inputs
2916      `(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
2917        ("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)
2918        ("go-golang.org-x-crypto-ssh-terminal" ,go-golang.org-x-crypto-ssh-terminal)
2919        ("go-gopkg.in-mgo.v2" ,go-gopkg.in-mgo.v2)
2920        ("go-gopkg.in-tomb.v2" ,go-gopkg.in-tomb.v2)
2921        ("go-github.com-nsf-termbox-go" ,go-github.com-nsf-termbox-go)
2922        ("go-github.com-smartystreets-goconvey" ,go-github.com-smartystreets-goconvey)))
2923     (home-page "https://github.com/mongodb/mongo-tools")
2924     (synopsis "Various tools for interacting with MongoDB and BSON")
2925     (description
2926      "This package includes a collection of tools related to MongoDB.
2927 @table @code
2928 @item bsondump
2929 Display BSON files in a human-readable format
2930 @item mongoimport
2931 Convert data from JSON, TSV or CSV and insert them into a collection
2932 @item mongoexport
2933 Write an existing collection to CSV or JSON format
2934 @item mongodump/mongorestore
2935 Dump MongoDB backups to disk in the BSON format
2936 @item mongorestore
2937 Read MongoDB backups in the BSON format, and restore them to a live database
2938 @item mongostat
2939 Monitor live MongoDB servers, replica sets, or sharded clusters
2940 @item mongofiles
2941 Read, write, delete, or update files in GridFS
2942 @item mongooplog
2943 Replay oplog entries between MongoDB servers
2944 @item mongotop
2945 Monitor read/write activity on a mongo server
2946 @end table")
2947     (license license:asl2.0)))
2949 (define-public apache-arrow
2950   (package
2951     (name "apache-arrow")
2952     (version "0.10.0")
2953     (source
2954       (origin
2955         (method git-fetch)
2956         (uri (git-reference
2957                (url "https://github.com/apache/arrow")
2958                (commit (string-append "apache-arrow-" version))))
2959         (file-name (git-file-name name version))
2960         (sha256
2961          (base32
2962           "04xkp922b8qrrnpvv9ixxnvk7151n1plzx6aqdff6frn9651zvxs"))))
2963     (build-system cmake-build-system)
2964     (arguments
2965      `(#:tests? #f
2966        #:phases
2967        (modify-phases %standard-phases
2968          (add-before 'configure 'enter-source-directory
2969            (lambda _ (chdir "cpp") #t))
2970          (add-after 'unpack 'set-env
2971            (lambda _
2972              (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost"))
2973              (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli"))
2974              (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers"))
2975              (setenv "JEMALLOC_HOME" (assoc-ref %build-inputs "jemalloc"))
2976              (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson"))
2977              #t)))
2978        #:build-type "Release"
2979        #:configure-flags
2980        (list "-DARROW_PYTHON=ON"
2982              ;; Install to PREFIX/lib (the default is
2983              ;; PREFIX/lib64).
2984              (string-append "-DCMAKE_INSTALL_LIBDIR="
2985                             (assoc-ref %outputs "out")
2986                             "/lib")
2988              ;; XXX These Guix package offer static
2989              ;; libraries that are not position independent,
2990              ;; and ld fails to link them into the arrow .so
2991              "-DARROW_WITH_SNAPPY=OFF"
2992              "-DARROW_WITH_ZLIB=OFF"
2993              "-DARROW_WITH_ZSTD=OFF"
2994              "-DARROW_WITH_LZ4=OFF"
2996              ;; Building the tests forces on all the
2997              ;; optional features and the use of static
2998              ;; libraries.
2999              "-DARROW_BUILD_TESTS=OFF"
3000              "-DARROW_BUILD_STATIC=OFF")))
3001     (inputs
3002      `(("boost" ,boost)
3003        ("rapidjson" ,rapidjson)
3004        ("brotli" ,google-brotli)
3005        ("flatbuffers" ,flatbuffers)
3006        ("jemalloc" ,jemalloc)
3007        ("python-3" ,python)
3008        ("python-numpy" ,python-numpy)))
3009     (home-page "https://arrow.apache.org/")
3010     (synopsis "Columnar in-memory analytics")
3011     (description "Apache Arrow is a columnar in-memory analytics layer
3012 designed to accelerate big data. It houses a set of canonical in-memory
3013 representations of flat and hierarchical data along with multiple
3014 language-bindings for structure manipulation. It also provides IPC and common
3015 algorithm implementations.")
3016     (license license:asl2.0)))
3018 (define-public python-pyarrow
3019   (package
3020     (name "python-pyarrow")
3021     (version "0.10.0")
3022     (source
3023       (origin
3024        (method git-fetch)
3025        (uri (git-reference
3026              (url "https://github.com/apache/arrow")
3027              (commit (string-append "apache-arrow-" version))))
3028        (file-name (git-file-name name version))
3029        (sha256
3030         (base32
3031          "04xkp922b8qrrnpvv9ixxnvk7151n1plzx6aqdff6frn9651zvxs"))))
3032     (build-system python-build-system)
3033     (arguments
3034      '(#:tests? #f ; XXX There are no tests in the "python" directory
3035        #:phases
3036        (modify-phases %standard-phases
3037          (delete 'build) ; XXX the build is performed again during the install phase
3038          (add-after 'unpack 'enter-source-directory
3039            (lambda _ (chdir "python") #t))
3040          (add-after 'unpack 'set-env
3041            (lambda _
3042              (setenv "ARROW_HOME" (assoc-ref %build-inputs "apache-arrow"))
3043              #t)))))
3044     (propagated-inputs
3045      `(("apache-arrow" ,apache-arrow)
3046        ("python-numpy" ,python-numpy)
3047        ("python-pandas" ,python-pandas)
3048        ("python-six" ,python-six)))
3049     (native-inputs
3050      `(("cmake" ,cmake)
3051        ("python-cython" ,python-cython)
3052        ("python-pytest" ,python-pytest)
3053        ("python-pytest-runner" ,python-pytest-runner)
3054        ("python-setuptools-scm" ,python-setuptools-scm)))
3055     (home-page "https://arrow.apache.org/docs/python/")
3056     (synopsis "Python bindings for Apache Arrow")
3057     (description "This library provides a Pythonic API wrapper for the reference
3058 Arrow C++ implementation, along with tools for interoperability with pandas,
3059 NumPy, and other traditional Python scientific computing packages.")
3060     (license license:asl2.0)))
3062 (define-public python2-pyarrow
3063   (package-with-python2 python-pyarrow))