dbm.scm 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. ;;; 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. (define-module (gnu packages dbm)
  26. #:use-module (gnu packages)
  27. #:use-module (gnu packages autotools)
  28. #:use-module ((guix licenses) #:prefix license:)
  29. #:use-module (guix packages)
  30. #:use-module (guix download)
  31. #:use-module (guix build-system gnu)
  32. #:use-module (guix utils))
  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. (define-public bdb-4.8
  38. (package
  39. (name "bdb")
  40. (version "4.8.30")
  41. (license (license:non-copyleft "file://LICENSE"
  42. "See LICENSE in the distribution."))
  43. (source (origin
  44. (method url-fetch)
  45. (uri (string-append "https://download.oracle.com/berkeley-db/db-"
  46. version ".tar.gz"))
  47. (sha256
  48. (base32
  49. "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0"))
  50. (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch"))))
  51. (build-system gnu-build-system)
  52. (outputs '("out" ; programs, libraries, headers
  53. "doc")) ; 94 MiB of HTML docs
  54. (arguments
  55. `(#:tests? #f ; no check target available
  56. #:disallowed-references ("doc")
  57. #:phases
  58. (modify-phases %standard-phases
  59. ;; The configure script is too old to recognise aarch64 and
  60. ;; powerpc64le as valid architectures. The trick below works
  61. ;; for "--build", but not for "--host", so update config.sub.
  62. ,@(if (and (%current-target-system)
  63. (or (target-ppc64le? (%current-target-system))
  64. (target-aarch64? (%current-target-system))))
  65. `((add-after 'unpack 'update-config.sub
  66. (lambda* (#:key native-inputs #:allow-other-keys)
  67. (delete-file "dist/config.sub")
  68. (symlink
  69. (search-input-file native-inputs "/bin/config.sub")
  70. "dist/config.sub"))))
  71. '())
  72. (replace 'configure
  73. (lambda* (#:key target outputs #:allow-other-keys)
  74. (let ((out (assoc-ref outputs "out"))
  75. (doc (assoc-ref outputs "doc")))
  76. ;; '--docdir' is not honored, so we need to patch.
  77. (substitute* "dist/Makefile.in"
  78. (("docdir[[:blank:]]*=.*")
  79. (string-append "docdir = " doc "/share/doc/bdb")))
  80. (chdir "build_unix")
  81. (invoke "../dist/configure"
  82. (string-append "--prefix=" out)
  83. (string-append "CONFIG_SHELL=" (which "bash"))
  84. (string-append "SHELL=" (which "bash"))
  85. ;; Bdb doesn't recognize aarch64 as an architecture.
  86. ,@(if (string=? "aarch64-linux" (%current-system))
  87. '("--build=aarch64-unknown-linux-gnu")
  88. '())
  89. ;; Bdb doesn't recognize powerpc64le as an architecture.
  90. ,@(if (string=? "powerpc64le-linux" (%current-system))
  91. '("--build=powerpc64le-unknown-linux-gnu")
  92. '())
  93. ,@(if (%current-target-system) ; cross building
  94. '((string-append "--host=" target))
  95. '())
  96. ;; Remove 7 MiB of .a files.
  97. "--disable-static"
  98. ;; The compatibility mode is needed by some packages,
  99. ;; notably iproute2.
  100. "--enable-compat185"
  101. ;; The following flag is needed so that the inclusion
  102. ;; of db_cxx.h into C++ files works; it leads to
  103. ;; HAVE_CXX_STDHEADERS being defined in db_cxx.h.
  104. "--enable-cxx")))))))
  105. (native-inputs
  106. (if (and (%current-target-system)
  107. (or (target-ppc64le? (%current-target-system))
  108. (target-aarch64? (%current-target-system))))
  109. `(("config" ,config)) ; for config.sub
  110. '()))
  111. (synopsis "Berkeley database")
  112. (description
  113. "Berkeley DB is an embeddable database allowing developers the choice of
  114. SQL, Key/Value, XML/XQuery or Java Object storage for their data model.")
  115. ;; Starting with version 6, BDB is distributed under AGPL3. Many individual
  116. ;; files are covered by the 3-clause BSD license.
  117. (home-page
  118. "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html")))
  119. (define-public bdb-5.3
  120. (package (inherit bdb-4.8)
  121. (name "bdb")
  122. (version "5.3.28")
  123. (source (origin
  124. (method url-fetch)
  125. (uri (string-append "https://download.oracle.com/berkeley-db/db-"
  126. version ".tar.gz"))
  127. (sha256
  128. (base32
  129. "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"))
  130. (patch-flags '("-p0"))
  131. (patches (search-patches "bdb-5.3-atomics-on-gcc-9.patch"))))))
  132. (define-public bdb-6
  133. (package (inherit bdb-4.8)
  134. (name "bdb")
  135. (version "6.2.32")
  136. (source (origin
  137. (method url-fetch)
  138. (uri (string-append "https://download.oracle.com/berkeley-db/db-"
  139. version ".tar.gz"))
  140. (sha256
  141. (base32
  142. "1yx8wzhch5wwh016nh0kfxvknjkafv6ybkqh6nh7lxx50jqf5id9"))))
  143. ;; Starting with version 6, BDB is distributed under AGPL3. Many individual
  144. ;; files are covered by the 3-clause BSD license.
  145. (license (list license:agpl3+ license:bsd-3))))
  146. (define-public bdb bdb-6)
  147. (define-public gdbm
  148. (package
  149. (name "gdbm")
  150. (version "1.20")
  151. (source (origin
  152. (method url-fetch)
  153. (uri (string-append "mirror://gnu/gdbm/gdbm-"
  154. version ".tar.gz"))
  155. (sha256
  156. (base32
  157. "14m22j0zndd42yc0ps0bcnnjj2iq7agnp66sl882lj5k91bc1sis"))))
  158. (arguments `(#:configure-flags '("--enable-libgdbm-compat"
  159. "--disable-static")))
  160. (build-system gnu-build-system)
  161. (home-page "https://www.gnu.org.ua/software/gdbm")
  162. (synopsis
  163. "Hash library of database functions compatible with traditional dbm")
  164. (description
  165. "GDBM is a library for manipulating hashed databases. It is used to
  166. store key/value pairs in a file in a manner similar to the Unix dbm library
  167. and provides interfaces to the traditional file format.")
  168. (license license:gpl3+)))