You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

325 lines
14 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <>
;;; Copyright © 2012 Andreas Enge <>
;;; Copyright © 2013 Cyril Roelandt <>
;;; Copyright © 2014 David Thompson <>
;;; Copyright © 2014 Mark H Weaver <>
;;; This file is part of GNU Guix.
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; GNU General Public License for more details.
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <>.
(define-module (gnu packages databases)
#:use-module (gnu packages)
#:use-module (gnu packages perl)
#:use-module (gnu packages linux)
#:use-module (gnu packages openssl)
#:use-module (gnu packages compression)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages readline)
#:use-module (gnu packages emacs)
#:use-module (gnu packages check)
#:use-module (gnu packages algebra)
#:use-module (gnu packages curl)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages python)
#:use-module ((guix licenses)
#:select (gpl2 gpl3+ lgpl3+ x11-style bsd-style
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system perl)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match))
(define-public bdb
(name "bdb")
(version "5.3.21")
(source (origin
(method url-fetch)
(uri (string-append "" version
(sha256 (base32
(build-system gnu-build-system)
(outputs '("out" ; programs, libraries, headers
"doc")) ; 94 MiB of HTML docs
'(#:tests? #f ; no check target available
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(doc (assoc-ref outputs "doc")))
;; '--docdir' is not honored, so we need to patch.
(substitute* "dist/"
(string-append "docdir = " doc "/share/doc/bdb")))
(system* "./dist/configure"
(string-append "--prefix=" out)
(string-append "CONFIG_SHELL=" (which "bash"))
(string-append "SHELL=" (which "bash"))
;; The compatibility mode is needed by some packages,
;; notably iproute2.
(synopsis "db, the Berkeley database")
"Berkeley DB is an embeddable database allowing developers the choice of
SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
(license (bsd-style "file://LICENSE"
"See LICENSE in the distribution."))
(define-public mysql
(name "mysql")
(version "5.1.73")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(build-system gnu-build-system)
`(("procps" ,procps)
("openssl" ,openssl)
("perl" ,perl)
("zlib" ,zlib)
("ncurses" ,ncurses)))
'(#:modules ((guix build gnu-build-system)
(guix build utils)
(ice-9 ftw)) ; for "rm -rf"
#:phases (alist-cons-after
'install 'clean-up
(lambda* (#:key outputs #:allow-other-keys)
;; Remove the 112 MiB of tests that get installed.
(let ((out (assoc-ref outputs "out")))
(define (rm-rf dir)
(file-system-fold (const #t) ; enter?
(lambda (file stat result) ; leaf
(delete-file file))
(const #t) ; down
(lambda (dir stat result) ; up
(rmdir dir))
(const #t)
(lambda (file stat errno result)
(format (current-error-port)
"error: ~a: ~a~%"
file (strerror errno)))
(string-append out "/" dir)))
(rm-rf "mysql-test")
(rm-rf "sql-bench")
;; Compress the 14 MiB Info file.
(system* "gzip" "--best"
(string-append out "/share/info/")))))
(home-page "")
(synopsis "Fast, easy to use, and popular database")
"MySQL is a fast, reliable, and easy to use relational database
management system that supports the standardized Structured Query
(license gpl2)))
(define-public postgresql
(name "postgresql")
(version "9.3.5")
(source (origin
(method url-fetch)
(uri (string-append ""
version "/postgresql-" version ".tar.gz"))
(build-system gnu-build-system)
`(("readline" ,readline)
("zlib" ,zlib)))
(home-page "")
(synopsis "Powerful object-relational database system")
"PostgreSQL is a powerful object-relational database system. It is fully
ACID compliant, has full support for foreign keys, joins, views, triggers, and
stored procedures (in multiple languages). It includes most SQL:2008 data
TIMESTAMP. It also supports storage of binary large objects, including
pictures, sounds, or video.")
(license (x11-style "file://COPYRIGHT"))))
(define-public recutils
(name "recutils")
(version "1.7")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnu/recutils/recutils-"
version ".tar.gz"))
(build-system gnu-build-system)
;; Running tests in parallel leads to test failures and crashes in
;; torture/utils.
(arguments '(#:parallel-tests? #f))
(native-inputs `(("emacs" ,emacs)
("bc" ,bc)))
;; TODO: Add more optional inputs.
;; FIXME: Our Bash doesn't have development headers (need for the 'readrec'
;; built-in command), but it's not clear how to get them installed.
;; See <>.
(inputs `(("curl" ,curl)
("libgcrypt" ,libgcrypt)
("check" ,check)))
(synopsis "Manipulate plain text files as databases")
"GNU Recutils is a set of tools and libraries for creating and
manipulating text-based, human-editable databases. Despite being text-based,
databases created with Recutils carry all of the expected features such as
unique fields, primary keys, time stamps and more. Many different field
types are supported, as is encryption.")
(license gpl3+)
(home-page "")))
(define-public sqlite
(name "sqlite")
(version "")
(source (origin
(method url-fetch)
;; TODO: Download from once this bug :
;; has been fixed.
(uri (let ((numeric-version
(match (string-split version #\.)
((first-digit other-digits ...)
(string-append first-digit
(map (cut string-pad <> 2 #\0)
6 #\0))))))
"mirror://sourceforge/sqlite.mirror/SQLite%20" version
"/sqlite-autoconf-" numeric-version ".tar.gz")))
(list (search-patch "sqlite-large-page-size-fix.patch")))))
(build-system gnu-build-system)
(home-page "")
(synopsis "The SQLite database management system")
"SQLite is a software library that implements a self-contained, serverless,
zero-configuration, transactional SQL database engine. SQLite is the most
widely deployed SQL database engine in the world. The source code for SQLite is
in the public domain.")
(license public-domain)))
(define-public tdb
(name "tdb")
(version "1.3.0")
(source (origin
(method url-fetch)
(uri (string-append ""
version ".tar.gz"))
(build-system gnu-build-system)
'(#:phases (alist-replace
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
;; The 'configure' script is a wrapper for Waf and
;; doesn't recognize things like '--enable-fast-install'.
(zero? (system* "./configure"
(string-append "--prefix=" out)))))
`(;; TODO: Build the documentation.
;; ("docbook-xsl" ,docbook-xsl)
;; ("libxml2" ,libxml2)
;; ("libxslt" ,libxslt)
("python" ,python-2))) ;for the Waf build system
(home-page "")
(synopsis "TDB, the trivial database")
"TDB is a Trivial Database. In concept, it is very much like GDBM,
and BSD's DB except that it allows multiple simultaneous writers and uses
locking internally to keep writers from trampling on each other. TDB is also
extremely small.")
(license lgpl3+)))
(define-public perl-dbi
(name "perl-dbi")
(version "1.631")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(build-system perl-build-system)
(synopsis "Database independent interface for Perl")
(description "This package provides an database interface for Perl.")
(home-page "")
(license (package-license perl))))
(define-public perl-dbd-sqlite
(name "perl-dbd-sqlite")
(version "1.42")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(build-system perl-build-system)
(inputs `(("sqlite" ,sqlite)))
(propagated-inputs `(("perl-dbi" ,perl-dbi)))
(synopsis "SQlite interface for Perl")
(description "DBD::SQLite is a Perl DBI driver for SQLite, that includes
the entire thing in the distribution. So in order to get a fast transaction
capable RDBMS working for your Perl project you simply have to install this
module, and nothing else.")
(license (package-license perl))
(home-page "")))