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.

280 lines
12 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015, 2016, 2018, 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. ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
  6. ;;;
  7. ;;; This file is part of GNU Guix.
  8. ;;;
  9. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  10. ;;; under the terms of the GNU General Public License as published by
  11. ;;; the Free Software Foundation; either version 3 of the License, or (at
  12. ;;; your option) any later version.
  13. ;;;
  14. ;;; GNU Guix is distributed in the hope that it will be useful, but
  15. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ;;; GNU General Public License for more details.
  18. ;;;
  19. ;;; You should have received a copy of the GNU General Public License
  20. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  21. (define-module (gnu packages datastructures)
  22. #:use-module (gnu packages)
  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 git-fetch)
  79. (uri (git-reference
  80. (url "https://github.com/sparsehash/sparsehash.git")
  81. (commit (string-append name "-" version))))
  82. (file-name (git-file-name name version))
  83. (sha256
  84. (base32
  85. "0m3f0cnpnpf6aak52wn8xbrrdw8p0yhq8csgc8nlvf9zp8c402na"))))
  86. (build-system gnu-build-system)
  87. (synopsis "Memory-efficient hashtable implementations")
  88. (description
  89. "This library contains several hash-map implementations, similar in API
  90. to SGI's @code{hash_map} class, but with different performance
  91. characteristics. @code{sparse_hash_map} uses very little space overhead, 1-2
  92. bits per entry. @code{dense_hash_map} is very fast, particularly on lookup.
  93. @code{sparse_hash_set} and @code{dense_hash_set} are the set versions of these
  94. routines. All these implementation use a hashtable with internal quadratic
  95. probing. This method is space-efficient -- there is no pointer overhead --
  96. and time-efficient for good hash functions.")
  97. (home-page "https://github.com/sparsehash/sparsehash")
  98. (license license:bsd-3)))
  99. (define-public ssdeep
  100. (package
  101. (name "ssdeep")
  102. (version "2.13")
  103. (source (origin
  104. (method url-fetch)
  105. (uri (string-append "mirror://sourceforge/ssdeep/"
  106. name "-" version "/"
  107. name "-" version ".tar.gz"))
  108. (sha256
  109. (base32
  110. "1igqy0j7jrklb8fdlrm6ald4cyl1fda5ipfl8crzyl6bax2ajk3f"))))
  111. (build-system gnu-build-system)
  112. (home-page "https://ssdeep-project.github.io")
  113. (synopsis "Context-triggered piecewise hashing algorithm")
  114. (description "ssdeep computes and matches context triggered piecewise
  115. hashes (CTPH), also called fuzzy checksums. It can identify similar files
  116. that have sequences of identical bytes in the same order, even though bytes
  117. in between these sequences may be different in both content and length.")
  118. (license license:gpl2+)))
  119. (define-public liburcu
  120. (package
  121. (name "liburcu")
  122. (version "0.11.1")
  123. (source (origin
  124. (method url-fetch)
  125. (uri (string-append "https://www.lttng.org/files/urcu/"
  126. "userspace-rcu-" version ".tar.bz2"))
  127. (sha256
  128. (base32
  129. "0l1kxgzch4m8fxiz2hc8fwg56hrvzzspp7n0svnl7i7iycdrgfcj"))))
  130. (build-system gnu-build-system)
  131. (native-inputs
  132. `(("perl" ,perl))) ; for tests
  133. (home-page "https://liburcu.org/")
  134. (synopsis "User-space RCU data synchronisation library")
  135. (description "liburcu is a user-space @dfn{Read-Copy-Update} (RCU) data
  136. synchronisation library. It provides read-side access that scales linearly
  137. with the number of cores. liburcu-cds provides efficient data structures
  138. based on RCU and lock-free algorithms. These structures include hash tables,
  139. queues, stacks, and doubly-linked lists.")
  140. (license license:lgpl2.1+)))
  141. (define-public uthash
  142. (package
  143. (name "uthash")
  144. (version "2.0.2")
  145. (source
  146. (origin
  147. (method git-fetch)
  148. (uri (git-reference
  149. (url "https://github.com/troydhanson/uthash.git")
  150. (commit (string-append "v" version))))
  151. (file-name (git-file-name name version))
  152. (sha256
  153. (base32
  154. "0kslz8k6lssh7fl7ayzwlj62p0asxs3dq03357ls5ywjad238gqg"))))
  155. (build-system gnu-build-system)
  156. (native-inputs
  157. `(("perl" ,perl)))
  158. (arguments
  159. `(#:make-flags
  160. (list "CC=gcc")
  161. #:phases
  162. (modify-phases %standard-phases
  163. (delete 'configure) ; nothing to configure
  164. (delete 'build) ; nothing to build
  165. (replace 'check
  166. (lambda* (#:key make-flags #:allow-other-keys)
  167. (with-directory-excursion "tests"
  168. (apply invoke "make" make-flags))))
  169. (replace 'install
  170. ;; There is no top-level Makefile to do this for us.
  171. (lambda* (#:key outputs #:allow-other-keys)
  172. (let* ((out (assoc-ref outputs "out"))
  173. (doc (string-append out "/share/doc/" ,name))
  174. (include (string-append out "/include")))
  175. ;; Don't install HTML files: they're just the below .txt files
  176. ;; dolled up, can be stale, and regeneration requires asciidoc.
  177. (for-each (λ (file) (install-file file doc))
  178. (find-files "doc" "\\.txt$"))
  179. (for-each (λ (file) (install-file file include))
  180. (find-files "src" "\\.h$"))
  181. #t))))))
  182. (home-page "https://troydhanson.github.io/uthash/")
  183. (synopsis
  184. "Hash tables, lists, and other data structures implemented as C macros")
  185. (description
  186. "uthash implements a hash table and a few other basic data structures
  187. as C preprocessor macros. It aims to be minimalistic and efficient: it's
  188. around 1,000 lines of code which, being macros, inline automatically.
  189. Unlike function calls with fixed prototypes, macros operate on untyped
  190. arguments. Thus, they are able to work with any type of structure and key.
  191. Any C structure can be stored in a hash table by adding @code{UT_hash_handle}
  192. to the structure and choosing one or more fields to act as the key.")
  193. (license license:bsd-2)))
  194. (define-public sdsl-lite
  195. (package
  196. (name "sdsl-lite")
  197. (version "2.1.1")
  198. (source (origin
  199. (method url-fetch)
  200. (uri (string-append "https://github.com/simongog/sdsl-lite/"
  201. "releases/download/v" version "/"
  202. "sdsl-lite-" version
  203. ".tar.gz.offline.install.gz"))
  204. (sha256
  205. (base32
  206. "1v86ivv3mmdy802i9xkjpxb4cggj3s27wb19ja4sw1klnivjj69g"))
  207. (modules '((guix build utils)))
  208. (snippet
  209. '(begin
  210. (delete-file-recursively "external") #t))
  211. (patches
  212. (list (origin
  213. (method url-fetch)
  214. (uri "https://salsa.debian.org/science-team/libsdsl/raw/debian/2.1.1+dfsg-2/debian/patches/0001-Patch-cmake-files.patch")
  215. (file-name "sdsl-lite-dont-use-bundled-libraries.patch")
  216. (sha256
  217. (base32
  218. "0m542xpys54bni29zibgrfpgpd0zgyny4h131virxsanixsbz52z")))))))
  219. (build-system cmake-build-system)
  220. (arguments
  221. '(#:phases
  222. (modify-phases %standard-phases
  223. (add-after 'install 'install-static-library
  224. (lambda* (#:key outputs #:allow-other-keys)
  225. (let ((out (assoc-ref outputs "out")))
  226. (copy-file "lib/libsdsl_static.a"
  227. (string-append out "/lib/libsdsl.a")))
  228. #t)))))
  229. (native-inputs
  230. `(("libdivsufsort" ,libdivsufsort)))
  231. (home-page "https://github.com/simongog/sdsl-lite")
  232. (synopsis "Succinct data structure library")
  233. (description "The Succinct Data Structure Library (SDSL) is a powerful and
  234. flexible C++11 library implementing succinct data structures. In total, the
  235. library contains the highlights of 40 research publications. Succinct data
  236. structures can represent an object (such as a bitvector or a tree) in space
  237. close to the information-theoretic lower bound of the object while supporting
  238. operations of the original object efficiently. The theoretical time
  239. complexity of an operation performed on the classical data structure and the
  240. equivalent succinct data structure are (most of the time) identical.")
  241. (license license:gpl3+)))
  242. (define-public libdivsufsort
  243. (package
  244. (name "libdivsufsort")
  245. (version "2.0.1")
  246. (source (origin
  247. (method git-fetch)
  248. (uri (git-reference
  249. (url "https://github.com/y-256/libdivsufsort.git")
  250. (commit version)))
  251. (file-name (git-file-name name version))
  252. (sha256
  253. (base32
  254. "0fgdz9fzihlvjjrxy01md1bv9vh12rkgkwbm90b1hj5xpbaqp7z2"))))
  255. (build-system cmake-build-system)
  256. (arguments
  257. '(#:tests? #f ; there are no tests
  258. #:configure-flags
  259. ;; Needed for rapmap and sailfish.
  260. '("-DBUILD_DIVSUFSORT64=ON")))
  261. (home-page "https://github.com/y-256/libdivsufsort")
  262. (synopsis "Lightweight suffix-sorting library")
  263. (description "libdivsufsort is a software library that implements a
  264. lightweight suffix array construction algorithm. This library provides a
  265. simple and an efficient C API to construct a suffix array and a
  266. Burrows-Wheeler transformed string from a given string over a constant-size
  267. alphabet. The algorithm runs in O(n log n) worst-case time using only 5n+O(1)
  268. bytes of memory space, where n is the length of the string.")
  269. (license license:expat)))