1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2012, 2014 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
5 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages databases)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages perl)
26 #:use-module (gnu packages linux)
27 #:use-module (gnu packages openssl)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages ncurses)
30 #:use-module (gnu packages readline)
31 #:use-module (gnu packages emacs)
32 #:use-module (gnu packages check)
33 #:use-module (gnu packages algebra)
34 #:use-module (gnu packages curl)
35 #:use-module (gnu packages gnupg)
36 #:use-module (gnu packages python)
37 #:use-module ((guix licenses)
38 #:select (gpl2 gpl3+ lgpl2.1+ lgpl3+ x11-style bsd-style
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system perl)
44 #:use-module (srfi srfi-26)
45 #:use-module (ice-9 match))
53 (uri (string-append "http://download.oracle.com/berkeley-db/db-" version
56 "1f2g2612lf8djbwbwhxsvmffmf9d7693kh2l20195pqp0f9jmnfx"))))
57 (build-system gnu-build-system)
58 (outputs '("out" ; programs, libraries, headers
59 "doc")) ; 94 MiB of HTML docs
61 '(#:tests? #f ; no check target available
65 (lambda* (#:key outputs #:allow-other-keys)
66 (let ((out (assoc-ref outputs "out"))
67 (doc (assoc-ref outputs "doc")))
68 ;; '--docdir' is not honored, so we need to patch.
69 (substitute* "dist/Makefile.in"
70 (("docdir[[:blank:]]*=.*")
71 (string-append "docdir = " doc "/share/doc/bdb")))
74 (system* "./dist/configure"
75 (string-append "--prefix=" out)
76 (string-append "CONFIG_SHELL=" (which "bash"))
77 (string-append "SHELL=" (which "bash"))
79 ;; The compatibility mode is needed by some packages,
81 "--enable-compat185"))))
83 (synopsis "Berkeley database")
85 "Berkeley DB is an embeddable database allowing developers the choice of
86 SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
87 (license (bsd-style "file://LICENSE"
88 "See LICENSE in the distribution."))
90 "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html")))
99 "http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-"
103 "1dfwi4ck0vq6sdci6gz0031s7zz5lc3pddqlgm0292s00l9y5sq5"))))
104 (build-system gnu-build-system)
110 ("ncurses" ,ncurses)))
112 '(#:modules ((guix build gnu-build-system)
114 (ice-9 ftw)) ; for "rm -rf"
115 #:phases (alist-cons-after
117 (lambda* (#:key outputs #:allow-other-keys)
118 ;; Remove the 112 MiB of tests that get installed.
119 (let ((out (assoc-ref outputs "out")))
121 (file-system-fold (const #t) ; enter?
122 (lambda (file stat result) ; leaf
125 (lambda (dir stat result) ; up
128 (lambda (file stat errno result)
129 (format (current-error-port)
131 file (strerror errno)))
133 (string-append out "/" dir)))
137 ;; Compress the 14 MiB Info file.
139 (system* "gzip" "--best"
140 (string-append out "/share/info/mysql.info")))))
142 (home-page "http://www.mysql.com/")
143 (synopsis "Fast, easy to use, and popular database")
145 "MySQL is a fast, reliable, and easy to use relational database
146 management system that supports the standardized Structured Query
150 (define-public postgresql
156 (uri (string-append "http://ftp.postgresql.org/pub/source/v"
157 version "/postgresql-" version ".tar.gz"))
160 "08kga00izykgvnx7hn995wc4zjqslspapaa8z63045p1ya14mr4g"))))
161 (build-system gnu-build-system)
163 `(("readline" ,readline)
165 (home-page "http://www.postgresql.org/")
166 (synopsis "Powerful object-relational database system")
168 "PostgreSQL is a powerful object-relational database system. It is fully
169 ACID compliant, has full support for foreign keys, joins, views, triggers, and
170 stored procedures (in multiple languages). It includes most SQL:2008 data
171 types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and
172 TIMESTAMP. It also supports storage of binary large objects, including
173 pictures, sounds, or video.")
174 (license (x11-style "file://COPYRIGHT"))))
176 (define-public recutils
182 (uri (string-append "mirror://gnu/recutils/recutils-"
186 "0cdwa4094x3yx7vn98xykvnlp9rngvd58d19vs3vh5hrvggccg93"))))
187 (build-system gnu-build-system)
189 ;; Running tests in parallel leads to test failures and crashes in
191 (arguments '(#:parallel-tests? #f))
193 (native-inputs `(("emacs" ,emacs)
196 ;; TODO: Add more optional inputs.
197 ;; FIXME: Our Bash doesn't have development headers (need for the 'readrec'
198 ;; built-in command), but it's not clear how to get them installed.
199 ;; See <https://lists.gnu.org/archive/html/bug-bash/2014-03/msg00125.html>.
200 (inputs `(("curl" ,curl)
201 ("libgcrypt" ,libgcrypt)
203 (synopsis "Manipulate plain text files as databases")
205 "GNU Recutils is a set of tools and libraries for creating and
206 manipulating text-based, human-editable databases. Despite being text-based,
207 databases created with Recutils carry all of the expected features such as
208 unique fields, primary keys, time stamps and more. Many different field
209 types are supported, as is encryption.")
211 (home-page "http://www.gnu.org/software/recutils/")))
213 (define-public sqlite
219 ;; TODO: Download from sqlite.org once this bug :
220 ;; http://lists.gnu.org/archive/html/bug-guile/2013-01/msg00027.html
222 (uri (let ((numeric-version
223 (match (string-split version #\.)
224 ((first-digit other-digits ...)
225 (string-append first-digit
228 (map (cut string-pad <> 2 #\0)
232 "mirror://sourceforge/sqlite.mirror/SQLite%20" version
233 "/sqlite-autoconf-" numeric-version ".tar.gz")))
236 "04dl53iv5q0srv4jcgjfzsrdzkq6dg1sgmlmpw9lrd4xrmj6jmvl"))))
237 (build-system gnu-build-system)
238 (inputs `(("readline" ,readline)))
241 ;; Add -DSQLITE_SECURE_DELETE and -DSQLITE_ENABLE_UNLOCK_NOTIFY to
242 ;; CFLAGS. GNU Icecat will refuse to use the system SQLite unless these
243 ;; options are enabled.
244 '("CFLAGS=-O2 -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_UNLOCK_NOTIFY")))
245 (home-page "http://www.sqlite.org/")
246 (synopsis "The SQLite database management system")
248 "SQLite is a software library that implements a self-contained, serverless,
249 zero-configuration, transactional SQL database engine. SQLite is the most
250 widely deployed SQL database engine in the world. The source code for SQLite
251 is in the public domain.")
252 (license public-domain)))
260 (uri (string-append "http://samba.org/ftp/tdb/tdb-"
264 "085sd2kii72fr0c4pdc7c7m0xk34nc66wnjp21c83dss826y9gh4"))))
265 (build-system gnu-build-system)
267 '(#:phases (alist-replace
269 (lambda* (#:key outputs #:allow-other-keys)
270 (let ((out (assoc-ref outputs "out")))
271 ;; The 'configure' script is a wrapper for Waf and
272 ;; doesn't recognize things like '--enable-fast-install'.
273 (zero? (system* "./configure"
274 (string-append "--prefix=" out)))))
277 `(;; TODO: Build the documentation.
278 ;; ("docbook-xsl" ,docbook-xsl)
279 ;; ("libxml2" ,libxml2)
280 ;; ("libxslt" ,libxslt)
281 ("python" ,python-2))) ;for the Waf build system
282 (home-page "http://tdb.samba.org/")
283 (synopsis "Trivial database")
285 "TDB is a Trivial Database. In concept, it is very much like GDBM,
286 and BSD's DB except that it allows multiple simultaneous writers and uses
287 locking internally to keep writers from trampling on each other. TDB is also
291 (define-public perl-dbi
298 "mirror://cpan/authors/id/T/TI/TIMB/DBI-"
302 "04fmrnchhwi7jx4niaiv93vmi343hdm3xj04w9zr2m9hhqh782np"))))
303 (build-system perl-build-system)
304 (synopsis "Database independent interface for Perl")
305 (description "This package provides an database interface for Perl.")
306 (home-page "http://search.cpan.org/~timb/DBI-1.631/DBI.pm")
307 (license (package-license perl))))
309 (define-public perl-dbd-sqlite
311 (name "perl-dbd-sqlite")
316 "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-"
320 "14x9cjsc8dz8ad1nad0bqiq9cbk1rjfb8h5y0rpk3pdl38y6afxb"))))
321 (build-system perl-build-system)
322 (inputs `(("sqlite" ,sqlite)))
323 (propagated-inputs `(("perl-dbi" ,perl-dbi)))
324 (synopsis "SQlite interface for Perl")
325 (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
326 the entire thing in the distribution. So in order to get a fast transaction
327 capable RDBMS working for your Perl project you simply have to install this
328 module, and nothing else.")
329 (license (package-license perl))
330 (home-page "http://search.cpan.org/~ishigaki/DBD-SQLite/lib/DBD/SQLite.pm")))
333 (define-public unixodbc
341 "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-" version ".tar.gz"))
343 (base32 "16jw5fq7wgfky6ak1h2j2pqx99jivsdl4q8aq6immpr55xs5jd4w"))))
344 (build-system gnu-build-system)
345 (synopsis "Data source abstraction library")
346 (description "Unixodbc is a library providing an API with which to access
347 data sources. Data sources include SQL Servers and any software with an ODBC
350 ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL"
351 (home-page "http://www.unixodbc.org")))