Commit | Line | Data |
---|---|---|
5f96f303 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> | |
3 | ;;; Copyright © 2012 Andreas Enge <andreas@enge.fr> | |
4 | ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> | |
5 | ;;; Copyright © 2014 David Thompson <davet@gnu.org> | |
6 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> | |
7 | ;;; | |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
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. | |
14 | ;;; | |
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. | |
19 | ;;; | |
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/>. | |
22 | ||
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) | |
db60b1d9 | 36 | #:use-module (gnu packages python) |
5f96f303 | 37 | #:use-module ((guix licenses) |
db60b1d9 | 38 | #:select (gpl2 gpl3+ lgpl3+ x11-style bsd-style |
5f96f303 LC |
39 | public-domain)) |
40 | #:use-module (guix packages) | |
41 | #:use-module (guix download) | |
42 | #:use-module (guix build-system gnu) | |
43 | #:use-module (srfi srfi-26) | |
44 | #:use-module (ice-9 match)) | |
45 | ||
46 | (define-public bdb | |
47 | (package | |
48 | (name "bdb") | |
49 | (version "5.3.21") | |
50 | (source (origin | |
51 | (method url-fetch) | |
52 | (uri (string-append "http://download.oracle.com/berkeley-db/db-" version | |
53 | ".tar.gz")) | |
54 | (sha256 (base32 | |
55 | "1f2g2612lf8djbwbwhxsvmffmf9d7693kh2l20195pqp0f9jmnfx")))) | |
56 | (build-system gnu-build-system) | |
57 | (outputs '("out" ; programs, libraries, headers | |
58 | "doc")) ; 94 MiB of HTML docs | |
59 | (arguments | |
60 | '(#:tests? #f ; no check target available | |
61 | #:phases | |
62 | (alist-replace | |
63 | 'configure | |
64 | (lambda* (#:key outputs #:allow-other-keys) | |
65 | (let ((out (assoc-ref outputs "out")) | |
66 | (doc (assoc-ref outputs "doc"))) | |
67 | ;; '--docdir' is not honored, so we need to patch. | |
68 | (substitute* "dist/Makefile.in" | |
69 | (("docdir[[:blank:]]*=.*") | |
70 | (string-append "docdir = " doc "/share/doc/bdb"))) | |
71 | ||
72 | (zero? | |
73 | (system* "./dist/configure" | |
74 | (string-append "--prefix=" out) | |
75 | (string-append "CONFIG_SHELL=" (which "bash")) | |
76 | (string-append "SHELL=" (which "bash")) | |
77 | ||
78 | ;; The compatibility mode is needed by some packages, | |
79 | ;; notably iproute2. | |
80 | "--enable-compat185")))) | |
81 | %standard-phases))) | |
82 | (synopsis "db, the Berkeley database") | |
83 | (description | |
84 | "Berkeley DB is an embeddable database allowing developers the choice of | |
85 | SQL, Key/Value, XML/XQuery or Java Object storage for their data model.") | |
86 | (license (bsd-style "file://LICENSE" | |
87 | "See LICENSE in the distribution.")) | |
88 | (home-page | |
89 | "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html"))) | |
90 | ||
91 | (define-public mysql | |
92 | (package | |
93 | (name "mysql") | |
94 | (version "5.1.73") | |
95 | (source (origin | |
96 | (method url-fetch) | |
97 | (uri (string-append | |
98 | "http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-" | |
99 | version ".tar.gz")) | |
100 | (sha256 | |
101 | (base32 | |
102 | "1dfwi4ck0vq6sdci6gz0031s7zz5lc3pddqlgm0292s00l9y5sq5")))) | |
103 | (build-system gnu-build-system) | |
104 | (inputs | |
105 | `(("procps" ,procps) | |
106 | ("openssl" ,openssl) | |
107 | ("perl" ,perl) | |
108 | ("zlib" ,zlib) | |
109 | ("ncurses" ,ncurses))) | |
110 | (arguments | |
111 | '(#:modules ((guix build gnu-build-system) | |
112 | (guix build utils) | |
113 | (ice-9 ftw)) ; for "rm -rf" | |
114 | #:phases (alist-cons-after | |
115 | 'install 'clean-up | |
116 | (lambda* (#:key outputs #:allow-other-keys) | |
117 | ;; Remove the 112 MiB of tests that get installed. | |
118 | (let ((out (assoc-ref outputs "out"))) | |
119 | (define (rm-rf dir) | |
120 | (file-system-fold (const #t) ; enter? | |
121 | (lambda (file stat result) ; leaf | |
122 | (delete-file file)) | |
123 | (const #t) ; down | |
124 | (lambda (dir stat result) ; up | |
125 | (rmdir dir)) | |
126 | (const #t) | |
127 | (lambda (file stat errno result) | |
128 | (format (current-error-port) | |
129 | "error: ~a: ~a~%" | |
130 | file (strerror errno))) | |
131 | #t | |
132 | (string-append out "/" dir))) | |
133 | (rm-rf "mysql-test") | |
134 | (rm-rf "sql-bench") | |
135 | ||
136 | ;; Compress the 14 MiB Info file. | |
137 | (zero? | |
138 | (system* "gzip" "--best" | |
139 | (string-append out "/share/info/mysql.info"))))) | |
140 | %standard-phases))) | |
141 | (home-page "http://www.mysql.com/") | |
142 | (synopsis "A fast, easy to use, and popular database") | |
143 | (description | |
144 | "MySQL is a fast, reliable, and easy to use relational database | |
145 | management system that supports the standardized Structured Query | |
146 | Language.") | |
147 | (license gpl2))) | |
148 | ||
149 | (define-public postgresql | |
150 | (package | |
151 | (name "postgresql") | |
152 | (version "9.3.5") | |
153 | (source (origin | |
154 | (method url-fetch) | |
155 | (uri (string-append "http://ftp.postgresql.org/pub/source/v" | |
156 | version "/postgresql-" version ".tar.gz")) | |
157 | (sha256 | |
158 | (base32 | |
159 | "08kga00izykgvnx7hn995wc4zjqslspapaa8z63045p1ya14mr4g")))) | |
160 | (build-system gnu-build-system) | |
161 | (inputs | |
162 | `(("readline" ,readline) | |
163 | ("zlib" ,zlib))) | |
164 | (home-page "http://www.postgresql.org/") | |
165 | (synopsis "Powerful object-relational database system") | |
166 | (description | |
167 | "PostgreSQL is a powerful object-relational database system. It is fully | |
168 | ACID compliant, has full support for foreign keys, joins, views, triggers, and | |
169 | stored procedures (in multiple languages). It includes most SQL:2008 data | |
170 | types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and | |
171 | TIMESTAMP. It also supports storage of binary large objects, including | |
172 | pictures, sounds, or video.") | |
173 | (license (x11-style "file://COPYRIGHT")))) | |
174 | ||
175 | (define-public recutils | |
176 | (package | |
177 | (name "recutils") | |
178 | (version "1.7") | |
179 | (source (origin | |
180 | (method url-fetch) | |
181 | (uri (string-append "mirror://gnu/recutils/recutils-" | |
182 | version ".tar.gz")) | |
183 | (sha256 | |
184 | (base32 | |
185 | "0cdwa4094x3yx7vn98xykvnlp9rngvd58d19vs3vh5hrvggccg93")))) | |
186 | (build-system gnu-build-system) | |
187 | ||
188 | ;; Running tests in parallel leads to test failures and crashes in | |
189 | ;; torture/utils. | |
190 | (arguments '(#:parallel-tests? #f)) | |
191 | ||
192 | (native-inputs `(("emacs" ,emacs) | |
193 | ("bc" ,bc))) | |
194 | ||
195 | ;; TODO: Add more optional inputs. | |
196 | ;; FIXME: Our Bash doesn't have development headers (need for the 'readrec' | |
197 | ;; built-in command), but it's not clear how to get them installed. | |
198 | ;; See <https://lists.gnu.org/archive/html/bug-bash/2014-03/msg00125.html>. | |
199 | (inputs `(("curl" ,curl) | |
200 | ("libgcrypt" ,libgcrypt) | |
201 | ("check" ,check))) | |
202 | (synopsis "Manipulate plain text files as databases") | |
203 | (description | |
204 | "GNU Recutils is a set of tools and libraries for creating and | |
205 | manipulating text-based, human-editable databases. Despite being text-based, | |
206 | databases created with Recutils carry all of the expected features such as | |
207 | unique fields, primary keys, time stamps and more. Many different field types | |
208 | are supported, as is encryption.") | |
209 | (license gpl3+) | |
210 | (home-page "http://www.gnu.org/software/recutils/"))) | |
211 | ||
212 | (define-public sqlite | |
213 | (package | |
214 | (name "sqlite") | |
215 | (version "3.8.4.3") | |
216 | (source (origin | |
217 | (method url-fetch) | |
218 | ;; TODO: Download from sqlite.org once this bug : | |
219 | ;; http://lists.gnu.org/archive/html/bug-guile/2013-01/msg00027.html | |
220 | ;; has been fixed. | |
221 | (uri (let ((numeric-version | |
222 | (match (string-split version #\.) | |
223 | ((first-digit other-digits ...) | |
224 | (string-append first-digit | |
225 | (string-pad-right | |
226 | (string-concatenate | |
227 | (map (cut string-pad <> 2 #\0) | |
228 | other-digits)) | |
229 | 6 #\0)))))) | |
230 | (string-append | |
231 | "mirror://sourceforge/sqlite.mirror/SQLite%20" version | |
232 | "/sqlite-autoconf-" numeric-version ".tar.gz"))) | |
233 | (sha256 | |
234 | (base32 | |
235 | "0rcdsk5sz34w8vy0g5yhfms4saiq81i872jxx5m5sjij7bi9bsg0")) | |
236 | (patches | |
237 | (list (search-patch "sqlite-large-page-size-fix.patch"))))) | |
238 | (build-system gnu-build-system) | |
239 | (home-page "http://www.sqlite.org/") | |
240 | (synopsis "The SQLite database management system") | |
241 | (description | |
242 | "SQLite is a software library that implements a self-contained, serverless, | |
243 | zero-configuration, transactional SQL database engine. SQLite is the most | |
244 | widely deployed SQL database engine in the world. The source code for SQLite is | |
245 | in the public domain.") | |
246 | (license public-domain))) | |
db60b1d9 LC |
247 | |
248 | (define-public tdb | |
249 | (package | |
250 | (name "tdb") | |
251 | (version "1.3.0") | |
252 | (source (origin | |
253 | (method url-fetch) | |
254 | (uri (string-append "http://samba.org/ftp/tdb/tdb-" | |
255 | version ".tar.gz")) | |
256 | (sha256 | |
257 | (base32 | |
258 | "085sd2kii72fr0c4pdc7c7m0xk34nc66wnjp21c83dss826y9gh4")))) | |
259 | (build-system gnu-build-system) | |
260 | (arguments | |
261 | '(#:phases (alist-replace | |
262 | 'configure | |
263 | (lambda* (#:key outputs #:allow-other-keys) | |
264 | (let ((out (assoc-ref outputs "out"))) | |
265 | ;; The 'configure' script is a wrapper for Waf and | |
266 | ;; doesn't recognize things like '--enable-fast-install'. | |
267 | (zero? (system* "./configure" | |
268 | (string-append "--prefix=" out))))) | |
269 | %standard-phases))) | |
270 | (native-inputs | |
271 | `(;; TODO: Build the documentation. | |
272 | ;; ("docbook-xsl" ,docbook-xsl) | |
273 | ;; ("libxml2" ,libxml2) | |
274 | ;; ("libxslt" ,libxslt) | |
275 | ("python" ,python-2))) ;for the Waf build system | |
276 | (home-page "http://tdb.samba.org/") | |
277 | (synopsis "TDB, the trivial database") | |
278 | (description | |
279 | "TDB is a Trivial Database. In concept, it is very much like GDBM, | |
280 | and BSD's DB except that it allows multiple simultaneous writers and uses | |
281 | locking internally to keep writers from trampling on each other. TDB is also | |
282 | extremely small.") | |
283 | (license lgpl3+))) |