dbm.scm 6.7 KB

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