projects/guix·blob java-team · refs

158 lines · 6.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017, 2019, 2020 Tobias Geerinckx-Rice <[email protected]>
3;;; Copyright © 2021 Ryan Prior <[email protected]>
4;;; Copyright © 2021, 2022 Ricardo Wurmus <[email protected]>
5;;; Copyright © 2026 Nguyễn Gia Phong <[email protected]>
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
22(define-module (gnu packages digest)
23 #:use-module (guix gexp)
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 gnu)
29 #:use-module (guix build-system pyproject)
30 #:use-module (guix build-system trivial)
31 #:use-module (guix utils)
32 #:use-module (gnu packages check)
33 #:use-module (gnu packages python-build)
34 #:use-module (gnu packages python-xyz)
35 #:use-module (ice-9 match))
36
37(define-public python-tdigest
38 (package
39 (name "python-tdigest")
40 (version "0.6.0.1")
41 (source
42 (origin
43 (method git-fetch)
44 (uri (git-reference
45 (url "https://github.com/CamDavidsonPilon/tdigest")
46 (commit (string-append "v" version))))
47 (file-name (git-file-name name version))
48 (sha256
49 (base32 "1fqpjw27fc1xfx72c2rjbnmi290f4c262rwm0c2fifsxpwyy54w7"))))
50 (build-system pyproject-build-system)
51 (propagated-inputs (list python-accumulation-tree python-pyudorandom))
52 (native-inputs (list python-numpy
53 python-pytest
54 python-pytest-timeout
55 python-setuptools))
56 (home-page "https://github.com/CamDavidsonPilon/tdigest")
57 (synopsis "Python implementation of the t-digest data structure")
58 (description
59 "This Python package implements @url{https://github.com/tdunning/t-digest,
60Ted Dunning's t-digest data structure}, which is designed around computing
61accurate estimates such as percentiles, quantiles and trimmed means
62from streaming or distributed data. Two t-digests can be added,
63making the data structure ideal for map-reduce settings, and can be serialized
64into much less than 10 kB, instead of storing the entire list of data.")
65 (license license:expat)))
66
67(define-public wyhash
68 (package
69 (name "wyhash")
70 (version "5")
71 (source (origin
72 (method git-fetch)
73 (uri (git-reference
74 (url "https://github.com/wangyi-fudan/wyhash")
75 (commit (string-append "wyhash_v" version))))
76 (file-name (git-file-name name version))
77 (sha256
78 (base32 "03ljs5iw9zrm3bydwggjvpwrcwmsd75h3dv1j4am4hw3h22cjdjc"))))
79 (build-system trivial-build-system) ;; source-only package
80 (arguments
81 `(#:modules ((guix build utils))
82 #:builder
83 (begin
84 (use-modules (guix build utils))
85 (let* ((out (string-append (assoc-ref %outputs "out")))
86 (include (string-append out "/include"))
87 (doc (string-append out "/share/doc/" ,name "-" ,version))
88 (source (assoc-ref %build-inputs "source")))
89 (with-directory-excursion source
90 (install-file "wyhash.h" include)
91 (install-file "LICENSE" doc)
92 (install-file "README.md" doc))
93 #t))))
94 (home-page "https://github.com/wangyi-fudan/wyhash")
95 (synopsis "Embeddable hash function and random number generator")
96 (description "This package provides a portable hash function and random
97number generator suitable for use in data structures. Provided by default in
98Zig, V, and Nim programming language standard libraries.")
99 (license license:unlicense)))
100
101(define-public xxhash
102 (package
103 (name "xxhash")
104 (version "0.8.3")
105 (source
106 (origin
107 (method git-fetch)
108 (uri (git-reference
109 (url "https://github.com/Cyan4973/xxHash")
110 (commit (string-append "v" version))))
111 (file-name (git-file-name name version))
112 (sha256
113 (base32 "017py6m7rs7pr2f8j1xfyg0bc4b0biv12k8zylyg9ildry22iac7"))))
114 (build-system gnu-build-system)
115 (arguments
116 (list #:make-flags
117 #~(list #$(string-append "CC=" (cc-for-target))
118 "XXH_FORCE_MEMORY_ACCESS=1" ; improved performance with GCC
119 (string-append "prefix=" (assoc-ref %outputs "out")))
120 #:phases
121 #~(modify-phases %standard-phases
122 (delete 'configure)))) ; no configure script
123 (home-page "https://cyan4973.github.io/xxHash/")
124 (synopsis "Extremely fast hash algorithm")
125 (description
126 "xxHash is an extremely fast non-cryptographic hash algorithm. It works
127at speeds close to RAM limits, and comes in both 32- and 64-bit flavours.
128The code is highly portable, and hashes of the same length are identical on all
129platforms (both big and little endian).")
130 (license (list license:bsd-2 ; xxhash library (xxhash.[ch])
131 license:gpl2+)))) ; xxhsum.c
132
133(define-public python-xxhash
134 (package
135 (name "python-xxhash")
136 (version "3.5.0")
137 (source
138 (origin
139 (method url-fetch)
140 (uri (pypi-uri "xxhash" version))
141 (sha256
142 (base32 "0pxlc37x0rrw3vl8yhf638wqcpfg9jfsh8ifvkwcpjaiz7fwmwl4"))))
143 (build-system pyproject-build-system)
144 (arguments
145 (list
146 #:test-backend #~'unittest
147 #:phases
148 #~(modify-phases %standard-phases
149 (add-before 'check 'build-extensions
150 (lambda _
151 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
152 (native-inputs
153 (list python-setuptools))
154 (home-page "https://github.com/ifduyue/python-xxhash")
155 (synopsis "Python binding for xxHash")
156 (description "This package provides Python bindings for the xxHash hash
157algorithm.")
158 (license license:bsd-3)))