gnu: emacs-helm: Update to 3.8.7.
[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, 2021 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 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages dbm)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages autotools)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix utils)
34 #:use-module (ice-9 match))
35
36 ;;; Commentary:
37 ;;;
38 ;;; This module has been separated from (gnu packages databases) to reduce the
39 ;;; number of module references for core packages.
40
41 (define-public bdb-4.8
42 (package
43 (name "bdb")
44 (version "4.8.30")
45 (license (license:non-copyleft "file://LICENSE"
46 "See LICENSE in the distribution."))
47 (source (origin
48 (method url-fetch)
49 (uri (string-append "https://download.oracle.com/berkeley-db/db-"
50 version ".tar.gz"))
51 (sha256
52 (base32
53 "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0"))
54 (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch"))))
55 (build-system gnu-build-system)
56 (outputs '("out" ; programs, libraries, headers
57 "doc")) ; 94 MiB of HTML docs
58 (arguments
59 `(#:tests? #f ; no check target available
60 #:disallowed-references ("doc")
61 #:phases
62 (modify-phases %standard-phases
63 ;; The configure script is too old to recognise aarch64 and
64 ;; powerpc64le as valid architectures. The trick below works
65 ;; for "--build", but not for "--host", so update config.sub.
66 ,@(if (and (%current-target-system)
67 (or (target-ppc64le? (%current-target-system))
68 (target-aarch64? (%current-target-system))))
69 `((add-after 'unpack 'update-config.sub
70 (lambda* (#:key native-inputs #:allow-other-keys)
71 (delete-file "dist/config.sub")
72 (symlink
73 (search-input-file native-inputs "/bin/config.sub")
74 "dist/config.sub"))))
75 '())
76 (replace 'configure
77 (lambda* (#:key target outputs #:allow-other-keys)
78 (let ((out (assoc-ref outputs "out"))
79 (doc (assoc-ref outputs "doc")))
80 ;; '--docdir' is not honored, so we need to patch.
81 (substitute* "dist/Makefile.in"
82 (("docdir[[:blank:]]*=.*")
83 (string-append "docdir = " doc "/share/doc/bdb")))
84
85 (chdir "build_unix")
86 (invoke "../dist/configure"
87 (string-append "--prefix=" out)
88 (string-append "CONFIG_SHELL=" (which "bash"))
89 (string-append "SHELL=" (which "bash"))
90
91 ;; Bdb's config script doesn't recognize very many
92 ;; architectures, and is a dependant on the 'config'
93 ;; package, so we manually define the build target.
94 ,@(match (%current-system)
95 ("aarch64-linux"
96 '("--build=aarch64-unknown-linux-gnu"))
97 ("powerpc64le-linux"
98 '("--build=powerpc64le-unknown-linux-gnu"))
99 ("riscv64-linux"
100 '("--build=riscv64-unknown-linux-gnu"))
101 (_ '()))
102
103 ,@(if (%current-target-system) ; cross building
104 '((string-append "--host=" target))
105 '())
106
107 ;; Remove 7 MiB of .a files.
108 "--disable-static"
109
110 ;; The compatibility mode is needed by some packages,
111 ;; notably iproute2.
112 "--enable-compat185"
113
114 ;; The following flag is needed so that the inclusion
115 ;; of db_cxx.h into C++ files works; it leads to
116 ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h.
117 "--enable-cxx")))))))
118 (native-inputs
119 (if (and (%current-target-system)
120 (or (target-ppc64le? (%current-target-system))
121 (target-aarch64? (%current-target-system))))
122 `(("config" ,config)) ; for config.sub
123 '()))
124 (synopsis "Berkeley database")
125 (description
126 "Berkeley DB is an embeddable database allowing developers the choice of
127 SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
128 ;; Starting with version 6, BDB is distributed under AGPL3. Many individual
129 ;; files are covered by the 3-clause BSD license.
130 (home-page
131 "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html")))
132
133 (define-public bdb-5.3
134 (package (inherit bdb-4.8)
135 (name "bdb")
136 (version "5.3.28")
137 (source (origin
138 (method url-fetch)
139 (uri (string-append "https://download.oracle.com/berkeley-db/db-"
140 version ".tar.gz"))
141 (sha256
142 (base32
143 "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))
144 (patch-flags '("-p0"))
145 (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch"))))))
146
147 (define-public bdb-6
148 (package (inherit bdb-4.8)
149 (name "bdb")
150 (version "6.2.32")
151 (source (origin
152 (method url-fetch)
153 (uri (string-append "https://download.oracle.com/berkeley-db/db-"
154 version ".tar.gz"))
155 (sha256
156 (base32
157 "1yx8wzhch5wwh016nh0kfxvknjkafv6ybkqh6nh7lxx50jqf5id9"))))
158 ;; Starting with version 6, BDB is distributed under AGPL3. Many individual
159 ;; files are covered by the 3-clause BSD license.
160 (license (list license:agpl3+ license:bsd-3))))
161
162 (define-public bdb bdb-6)
163
164 (define-public gdbm
165 (package
166 (name "gdbm")
167 (version "1.20")
168 (source (origin
169 (method url-fetch)
170 (uri (string-append "mirror://gnu/gdbm/gdbm-"
171 version ".tar.gz"))
172 (sha256
173 (base32
174 "14m22j0zndd42yc0ps0bcnnjj2iq7agnp66sl882lj5k91bc1sis"))))
175 (arguments `(#:configure-flags '("--enable-libgdbm-compat"
176 "--disable-static")))
177 (build-system gnu-build-system)
178 (home-page "https://www.gnu.org.ua/software/gdbm")
179 (synopsis
180 "Hash library of database functions compatible with traditional dbm")
181 (description
182 "GDBM is a library for manipulating hashed databases. It is used to
183 store key/value pairs in a file in a manner similar to the Unix dbm library
184 and provides interfaces to the traditional file format.")
185 (license license:gpl3+)))