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.

173 lines
7.4 KiB

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