Commit | Line | Data |
---|---|---|
255d1bbe | 1 | ;;; GNU Guix --- Functional package management for GNU |
95161056 | 2 | ;;; Copyright © 2012, 2013, 2014, 2016, 2020 Ludovic Courtès <ludo@gnu.org> |
255d1bbe | 3 | ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> |
b5910528 | 4 | ;;; Copyright © 2016, 2017, 2018, 2020, 2021 Efraim Flashner <efraim@flashner.co.il> |
255d1bbe RW |
5 | ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com> |
6 | ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org> | |
04496dc5 | 7 | ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> |
4cc2d2aa | 8 | ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net> |
0d7888ac | 9 | ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> |
255d1bbe RW |
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) | |
0d7888ac | 28 | #:use-module (gnu packages autotools) |
255d1bbe RW |
29 | #:use-module ((guix licenses) #:prefix license:) |
30 | #:use-module (guix packages) | |
31 | #:use-module (guix download) | |
32 | #:use-module (guix build-system gnu) | |
b5910528 EF |
33 | #:use-module (guix utils) |
34 | #:use-module (ice-9 match)) | |
255d1bbe RW |
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 | ||
883fe9bb | 41 | (define-public bdb-4.8 |
255d1bbe RW |
42 | (package |
43 | (name "bdb") | |
883fe9bb CD |
44 | (version "4.8.30") |
45 | (license (license:non-copyleft "file://LICENSE" | |
46 | "See LICENSE in the distribution.")) | |
255d1bbe | 47 | (source (origin |
883fe9bb | 48 | (method url-fetch) |
a9d57e1c | 49 | (uri (string-append "https://download.oracle.com/berkeley-db/db-" |
883fe9bb CD |
50 | version ".tar.gz")) |
51 | (sha256 | |
52 | (base32 | |
04496dc5 JK |
53 | "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0")) |
54 | (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch")))) | |
255d1bbe RW |
55 | (build-system gnu-build-system) |
56 | (outputs '("out" ; programs, libraries, headers | |
57 | "doc")) ; 94 MiB of HTML docs | |
58 | (arguments | |
883fe9bb | 59 | `(#:tests? #f ; no check target available |
255d1bbe RW |
60 | #:disallowed-references ("doc") |
61 | #:phases | |
62 | (modify-phases %standard-phases | |
0d7888ac MD |
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 | '()) | |
255d1bbe | 76 | (replace 'configure |
63539587 | 77 | (lambda* (#:key target outputs #:allow-other-keys) |
255d1bbe RW |
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 | ||
883fe9bb CD |
85 | (chdir "build_unix") |
86 | (invoke "../dist/configure" | |
255d1bbe RW |
87 | (string-append "--prefix=" out) |
88 | (string-append "CONFIG_SHELL=" (which "bash")) | |
89 | (string-append "SHELL=" (which "bash")) | |
90 | ||
b5910528 EF |
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 | (_ '())) | |
4cc2d2aa | 102 | |
63539587 MO |
103 | ,@(if (%current-target-system) ; cross building |
104 | '((string-append "--host=" target)) | |
105 | '()) | |
106 | ||
255d1bbe RW |
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"))))))) | |
0d7888ac MD |
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 | '())) | |
255d1bbe RW |
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. | |
255d1bbe RW |
130 | (home-page |
131 | "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html"))) | |
132 | ||
133 | (define-public bdb-5.3 | |
883fe9bb | 134 | (package (inherit bdb-4.8) |
255d1bbe RW |
135 | (name "bdb") |
136 | (version "5.3.28") | |
255d1bbe RW |
137 | (source (origin |
138 | (method url-fetch) | |
a9d57e1c | 139 | (uri (string-append "https://download.oracle.com/berkeley-db/db-" |
255d1bbe RW |
140 | version ".tar.gz")) |
141 | (sha256 | |
142 | (base32 | |
04496dc5 JK |
143 | "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0")) |
144 | (patch-flags '("-p0")) | |
145 | (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch")))))) | |
255d1bbe | 146 | |
883fe9bb CD |
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) | |
a9d57e1c | 153 | (uri (string-append "https://download.oracle.com/berkeley-db/db-" |
883fe9bb CD |
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)))) | |
255d1bbe | 161 | |
883fe9bb | 162 | (define-public bdb bdb-6) |
255d1bbe RW |
163 | |
164 | (define-public gdbm | |
165 | (package | |
166 | (name "gdbm") | |
f94a0ce6 | 167 | (version "1.20") |
255d1bbe RW |
168 | (source (origin |
169 | (method url-fetch) | |
170 | (uri (string-append "mirror://gnu/gdbm/gdbm-" | |
171 | version ".tar.gz")) | |
172 | (sha256 | |
173 | (base32 | |
f94a0ce6 | 174 | "14m22j0zndd42yc0ps0bcnnjj2iq7agnp66sl882lj5k91bc1sis")))) |
defcbeae MB |
175 | (arguments `(#:configure-flags '("--enable-libgdbm-compat" |
176 | "--disable-static"))) | |
255d1bbe | 177 | (build-system gnu-build-system) |
3918d6c4 | 178 | (home-page "https://www.gnu.org.ua/software/gdbm") |
255d1bbe RW |
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+))) |