Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / dbm.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2016, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
6 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
8 ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages dbm)
26 #:use-module (gnu packages)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix utils))
32
33 ;;; Commentary:
34 ;;;
35 ;;; This module has been separated from (gnu packages databases) to reduce the
36 ;;; number of module references for core packages.
37
38 (define-public bdb-4.8
39 (package
40 (name "bdb")
41 (version "4.8.30")
42 (license (license:non-copyleft "file://LICENSE"
43 "See LICENSE in the distribution."))
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "https://download.oracle.com/berkeley-db/db-"
47 version ".tar.gz"))
48 (sha256
49 (base32
50 "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0"))
51 (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch"))))
52 (build-system gnu-build-system)
53 (outputs '("out" ; programs, libraries, headers
54 "doc")) ; 94 MiB of HTML docs
55 (arguments
56 `(#:tests? #f ; no check target available
57 #:disallowed-references ("doc")
58 #:phases
59 (modify-phases %standard-phases
60 (replace 'configure
61 (lambda* (#:key target outputs #:allow-other-keys)
62 (let ((out (assoc-ref outputs "out"))
63 (doc (assoc-ref outputs "doc")))
64 ;; '--docdir' is not honored, so we need to patch.
65 (substitute* "dist/Makefile.in"
66 (("docdir[[:blank:]]*=.*")
67 (string-append "docdir = " doc "/share/doc/bdb")))
68
69 (chdir "build_unix")
70 (invoke "../dist/configure"
71 (string-append "--prefix=" out)
72 (string-append "CONFIG_SHELL=" (which "bash"))
73 (string-append "SHELL=" (which "bash"))
74
75 ;; Bdb doesn't recognize aarch64 as an architecture.
76 ,@(if (string=? "aarch64-linux" (%current-system))
77 '("--build=aarch64-unknown-linux-gnu")
78 '())
79
80 ;; Bdb doesn't recognize powerpc64le as an architecture.
81 ,@(if (string=? "powerpc64le-linux" (%current-system))
82 '("--build=powerpc64le-unknown-linux-gnu")
83 '())
84
85 ,@(if (%current-target-system) ; cross building
86 '((string-append "--host=" target))
87 '())
88
89 ;; Remove 7 MiB of .a files.
90 "--disable-static"
91
92 ;; The compatibility mode is needed by some packages,
93 ;; notably iproute2.
94 "--enable-compat185"
95
96 ;; The following flag is needed so that the inclusion
97 ;; of db_cxx.h into C++ files works; it leads to
98 ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h.
99 "--enable-cxx")))))))
100 (synopsis "Berkeley database")
101 (description
102 "Berkeley DB is an embeddable database allowing developers the choice of
103 SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
104 ;; Starting with version 6, BDB is distributed under AGPL3. Many individual
105 ;; files are covered by the 3-clause BSD license.
106 (home-page
107 "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html")))
108
109 (define-public bdb-5.3
110 (package (inherit bdb-4.8)
111 (name "bdb")
112 (version "5.3.28")
113 (source (origin
114 (method url-fetch)
115 (uri (string-append "https://download.oracle.com/berkeley-db/db-"
116 version ".tar.gz"))
117 (sha256
118 (base32
119 "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))
120 (patch-flags '("-p0"))
121 (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch"))))))
122
123 (define-public bdb-6
124 (package (inherit bdb-4.8)
125 (name "bdb")
126 (version "6.2.32")
127 (source (origin
128 (method url-fetch)
129 (uri (string-append "https://download.oracle.com/berkeley-db/db-"
130 version ".tar.gz"))
131 (sha256
132 (base32
133 "1yx8wzhch5wwh016nh0kfxvknjkafv6ybkqh6nh7lxx50jqf5id9"))))
134 ;; Starting with version 6, BDB is distributed under AGPL3. Many individual
135 ;; files are covered by the 3-clause BSD license.
136 (license (list license:agpl3+ license:bsd-3))))
137
138 (define-public bdb bdb-6)
139
140 (define-public gdbm
141 (package
142 (name "gdbm")
143 (version "1.19")
144 (source (origin
145 (method url-fetch)
146 (uri (string-append "mirror://gnu/gdbm/gdbm-"
147 version ".tar.gz"))
148 (sha256
149 (base32
150 "1g342f0xhh8xbc8p9vrr34clhxz57589k50dibhp5f9284hi5v9p"))))
151 (arguments `(#:configure-flags '("--enable-libgdbm-compat"
152 "--disable-static")))
153 (build-system gnu-build-system)
154 (home-page "http://www.gnu.org.ua/software/gdbm")
155 (synopsis
156 "Hash library of database functions compatible with traditional dbm")
157 (description
158 "GDBM is a library for manipulating hashed databases. It is used to
159 store key/value pairs in a file in a manner similar to the Unix dbm library
160 and provides interfaces to the traditional file format.")
161 (license license:gpl3+)))