Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228 lines
9.7 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015, 2016, 2019 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2016, 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
  4. ;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
  5. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  20. (define-module (gnu packages datastructures)
  21. #:use-module (gnu packages)
  22. #:use-module (gnu packages documentation)
  23. #:use-module (gnu packages perl)
  24. #:use-module ((guix licenses) #:prefix license:)
  25. #:use-module (guix packages)
  26. #:use-module (guix download)
  27. #:use-module (guix git-download)
  28. #:use-module (guix build-system cmake)
  29. #:use-module (guix build-system gnu))
  30. (define-public gdsl
  31. (package
  32. (name "gdsl")
  33. (version "1.8")
  34. (source (origin
  35. (method url-fetch)
  36. (uri (string-append "http://download.gna.org/gdsl/"
  37. "gdsl-" version ".tar.gz"))
  38. (sha256
  39. (base32
  40. "1v64jvlnj8jfpphphgjgb36p0kv50kwfyqncf0y12f16v8ydyiaw"))))
  41. (build-system gnu-build-system)
  42. (home-page "http://home.gna.org/gdsl/")
  43. (synopsis "Generic data structures library")
  44. (description "The Generic Data Structures Library (GDSL) is a collection
  45. of routines for generic data structures manipulation. It is a re-entrant
  46. library fully written from scratch in pure ANSI C. It is designed to offer
  47. for C programmers common data structures with powerful algorithms, and hidden
  48. implementation. Available structures are lists, queues, stacks, hash tables,
  49. binary trees, binary search trees, red-black trees, 2D arrays, permutations
  50. and heaps.")
  51. (license license:gpl2+)))
  52. (define-public marisa
  53. (package
  54. (name "marisa")
  55. (version "0.2.5")
  56. (source
  57. (origin
  58. (method url-fetch)
  59. (uri (string-append "https://github.com/s-yata/marisa-trie"
  60. "/releases/download/v" version "/" name "-"
  61. version ".tar.gz"))
  62. (sha256
  63. (base32 "19ifrcmnbr9whaaf4ly3s9ndyiq9sjqhnfkrxbz9zsb44w2n36hf"))))
  64. (build-system gnu-build-system)
  65. (home-page "https://github.com/s-yata/marisa-trie")
  66. (synopsis "Trie data structure C++ library")
  67. (description "Matching Algorithm with Recursively Implemented
  68. StorAge (MARISA) is a static and space-efficient trie data structure C++
  69. library.")
  70. ;; Dual-licensed, according to docs/readme.en.html (source files lack
  71. ;; copyright/license headers.)
  72. (license (list license:bsd-2 license:lgpl2.1+))))
  73. (define-public sparsehash
  74. (package
  75. (name "sparsehash")
  76. (version "2.0.3")
  77. (source (origin
  78. (method url-fetch)
  79. (uri (string-append "https://github.com/sparsehash/sparsehash/"
  80. "archive/sparsehash-" version ".tar.gz"))
  81. (sha256
  82. (base32
  83. "133szz0ldwch0kd91l0sa57qsnl020njn622szd9cxrjqyjqds85"))))
  84. (build-system gnu-build-system)
  85. (synopsis "Memory-efficient hashtable implementations")
  86. (description
  87. "This library contains several hash-map implementations, similar in API
  88. to SGI's @code{hash_map} class, but with different performance
  89. characteristics. @code{sparse_hash_map} uses very little space overhead, 1-2
  90. bits per entry. @code{dense_hash_map} is very fast, particularly on lookup.
  91. @code{sparse_hash_set} and @code{dense_hash_set} are the set versions of these
  92. routines. All these implementation use a hashtable with internal quadratic
  93. probing. This method is space-efficient -- there is no pointer overhead --
  94. and time-efficient for good hash functions.")
  95. (home-page "https://github.com/sparsehash/sparsehash")
  96. (license license:bsd-3)))
  97. (define-public ssdeep
  98. (package
  99. (name "ssdeep")
  100. (version "2.13")
  101. (source (origin
  102. (method url-fetch)
  103. (uri (string-append "mirror://sourceforge/ssdeep/"
  104. name "-" version "/"
  105. name "-" version ".tar.gz"))
  106. (sha256
  107. (base32
  108. "1igqy0j7jrklb8fdlrm6ald4cyl1fda5ipfl8crzyl6bax2ajk3f"))))
  109. (build-system gnu-build-system)
  110. (home-page "http://ssdeep.sourceforge.net")
  111. (synopsis "Context-triggered piecewise hashing algorithm")
  112. (description "ssdeep computes and matches context triggered piecewise
  113. hashes (CTPH), also called fuzzy checksums. It can identify similar files
  114. that have sequences of identical bytes in the same order, even though bytes
  115. in between these sequences may be different in both content and length.")
  116. (license license:gpl2+)))
  117. (define-public liburcu
  118. (package
  119. (name "liburcu")
  120. (version "0.10.2")
  121. (source (origin
  122. (method url-fetch)
  123. (uri (string-append "https://www.lttng.org/files/urcu/"
  124. "userspace-rcu-" version ".tar.bz2"))
  125. (sha256
  126. (base32
  127. "1k31faqz9plx5dwxq8g1fnczxda1is4s1x4ph0gjrq3gmy6qixmk"))))
  128. (build-system gnu-build-system)
  129. (native-inputs
  130. `(("perl" ,perl))) ; for tests
  131. (home-page "https://liburcu.org/")
  132. (synopsis "User-space RCU data synchronisation library")
  133. (description "liburcu is a user-space @dfn{Read-Copy-Update} (RCU) data
  134. synchronisation library. It provides read-side access that scales linearly
  135. with the number of cores. liburcu-cds provides efficient data structures
  136. based on RCU and lock-free algorithms. These structures include hash tables,
  137. queues, stacks, and doubly-linked lists.")
  138. (license license:lgpl2.1+)))
  139. (define-public uthash
  140. (package
  141. (name "uthash")
  142. (version "2.0.2")
  143. (source
  144. (origin
  145. (method git-fetch)
  146. (uri (git-reference
  147. (url "https://github.com/troydhanson/uthash.git")
  148. (commit (string-append "v" version))))
  149. (file-name (git-file-name name version))
  150. (sha256
  151. (base32
  152. "0kslz8k6lssh7fl7ayzwlj62p0asxs3dq03357ls5ywjad238gqg"))))
  153. (build-system gnu-build-system)
  154. (native-inputs
  155. `(("perl" ,perl)))
  156. (arguments
  157. `(#:make-flags
  158. (list "CC=gcc")
  159. #:phases
  160. (modify-phases %standard-phases
  161. (delete 'configure) ; nothing to configure
  162. (delete 'build) ; nothing to build
  163. (replace 'check
  164. (lambda* (#:key make-flags #:allow-other-keys)
  165. (with-directory-excursion "tests"
  166. (apply invoke "make" make-flags))))
  167. (replace 'install
  168. ;; There is no top-level Makefile to do this for us.
  169. (lambda* (#:key outputs #:allow-other-keys)
  170. (let* ((out (assoc-ref outputs "out"))
  171. (doc (string-append out "/share/doc/" ,name))
  172. (include (string-append out "/include")))
  173. ;; Don't install HTML files: they're just the below .txt files
  174. ;; dolled up, can be stale, and regeneration requires asciidoc.
  175. (for-each (λ (file) (install-file file doc))
  176. (find-files "doc" "\\.txt$"))
  177. (for-each (λ (file) (install-file file include))
  178. (find-files "src" "\\.h$"))
  179. #t))))))
  180. (home-page "https://troydhanson.github.io/uthash/")
  181. (synopsis
  182. "Hash tables, lists, and other data structures implemented as C macros")
  183. (description
  184. "uthash implements a hash table and a few other basic data structures
  185. as C preprocessor macros. It aims to be minimalistic and efficient: it's
  186. around 1,000 lines of code which, being macros, inline automatically.
  187. Unlike function calls with fixed prototypes, macros operate on untyped
  188. arguments. Thus, they are able to work with any type of structure and key.
  189. Any C structure can be stored in a hash table by adding @code{UT_hash_handle}
  190. to the structure and choosing one or more fields to act as the key.")
  191. (license license:bsd-2)))
  192. (define-public sdsl-lite
  193. (package
  194. (name "sdsl-lite")
  195. (version "2.1.1")
  196. (source (origin
  197. (method url-fetch)
  198. (uri (string-append "https://github.com/simongog/sdsl-lite/"
  199. "releases/download/v" version "/"
  200. "sdsl-lite-" version
  201. ".tar.gz.offline.install.gz"))
  202. (sha256
  203. (base32
  204. "1v86ivv3mmdy802i9xkjpxb4cggj3s27wb19ja4sw1klnivjj69g"))))
  205. (build-system cmake-build-system)
  206. (native-inputs
  207. `(("doxygen" ,doxygen)))
  208. (home-page "https://github.com/simongog/sdsl-lite")
  209. (synopsis "Succinct data structure library")
  210. (description "The Succinct Data Structure Library (SDSL) is a powerful and
  211. flexible C++11 library implementing succinct data structures. In total, the
  212. library contains the highlights of 40 research publications. Succinct data
  213. structures can represent an object (such as a bitvector or a tree) in space
  214. close to the information-theoretic lower bound of the object while supporting
  215. operations of the original object efficiently. The theoretical time
  216. complexity of an operation performed on the classical data structure and the
  217. equivalent succinct data structure are (most of the time) identical.")
  218. (license license:gpl3+)))