projects/guix·blob version-1.4.0 · refs

581 lines · 19.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <[email protected]>
3;;; Copyright © 2017, 2019, 2021, 2022 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2017 Nikita <[email protected]>
5;;; Copyright © 2017 Julien Lepiller <[email protected]>
6;;; Copyright © 2018-2020, 2022 Efraim Flashner <[email protected]>
7;;; Copyright © 2020 Nicolas Goaziou <[email protected]>
8;;; Copyright © 2020, 2022 Marius Bakke <[email protected]>
9;;; Copyright © 2021 Brendan Tildesley <[email protected]>
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages python-compression)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix utils)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix gexp)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system python)
34 #:use-module (guix build-system pyproject)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages libffi)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages maths)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages python-build)
43 #:use-module (gnu packages python-check)
44 #:use-module (gnu packages python-crypto)
45 #:use-module (gnu packages python-xyz)
46 #:use-module (gnu packages sphinx))
47
48(define-public python-multivolumefile
49 (package
50 (name "python-multivolumefile")
51 (version "0.2.3")
52 (source
53 (origin
54 (method url-fetch)
55 (uri (pypi-uri "multivolumefile" version))
56 (sha256
57 (base32
58 "1mh9sz50s1p8ik83a455pqd57syprad7xhfmk28yb5mwmw58sr50"))))
59 (build-system pyproject-build-system)
60 (native-inputs
61 (list python-setuptools-scm
62 python-coverage
63 python-coveralls
64 python-hypothesis
65 python-pyannotate
66 python-pytest
67 python-pytest-cov))
68 (home-page "https://github.com/miurahr/multivolume")
69 (synopsis "Treat multiple files as one")
70 (description "MultiVolumefile is a Python library that provides a
71file-object abstraction, making it possible to use multiple files as if they
72were a single file.")
73 (license license:lgpl2.1+)))
74
75(define-public python-pybcj
76 (package
77 (name "python-pybcj")
78 (version "1.0.1")
79 (source (origin
80 (method url-fetch)
81 (uri (pypi-uri "pybcj" version))
82 (sha256
83 (base32
84 "1hvm3c3mb20z25kmbzyyn6pr5inx50z0ignl8b0bggxaik82ws4b"))))
85 (build-system pyproject-build-system)
86 (propagated-inputs (list python-importlib-metadata))
87 (native-inputs
88 (list python-coverage
89 python-hypothesis
90 python-pytest
91 python-pytest-cov
92 python-setuptools-scm))
93 (home-page "https://codeberg.org/miurahr/pybcj")
94 (synopsis "BCJ filter library")
95 (description "In data compression, BCJ, short for Branch-Call-Jump, refers
96to a technique that improves the compression of machine code of executable
97binaries by replacing relative branch addresses with absolute ones. This
98allows a LZMA compressor to identify duplicate targets and archive higher
99compression rate. BCJ is used in the 7-zip compression utility as the default
100filter for executable binaries.
101
102pybcj provides Python bindings to a BCJ implementation in C.")
103 (license license:lgpl2.1+)))
104
105(define-public python-bcj-cffi
106 (package
107 (name "python-bcj-cffi")
108 (version "0.5.0")
109 (source
110 (origin
111 (method url-fetch)
112 (uri (pypi-uri "bcj-cffi" version))
113 (sha256
114 (base32
115 "1jcczrb8zgg6w7v76w1wpz3nw75fghk3xwxkn09ll7kck7sdf68d"))))
116 (build-system python-build-system)
117 (propagated-inputs
118 (list python-cffi python-toml python-setuptools-scm))
119 (native-inputs
120 (list python-setuptools python-coverage python-pytest
121 python-pytest-cov))
122 (home-page "https://github.com/miurahr/bcj-cffi")
123 (synopsis "Branch / Call /Jump CFFI library in Python")
124 (description "This package provides an implementation of the Branch / Call /
125Jump conversion filter by CFFI for Python.")
126 (license license:lgpl2.1+)))
127
128(define-public python-brotlicffi
129 (package
130 (name "python-brotlicffi")
131 (version "1.0.9.2")
132 (source (origin
133 (method url-fetch)
134 (uri (pypi-uri "brotlicffi" version))
135 (sha256
136 (base32
137 "15kxgdiqcg0cm6h5xq3vkbhw7674673hcx3n2yicd3wx29l8l90c"))
138 (snippet
139 #~(begin
140 (use-modules (guix build utils))
141 (delete-file-recursively "libbrotli")))))
142 (build-system pyproject-build-system)
143 (arguments
144 (list
145 #:phases
146 #~(modify-phases %standard-phases
147 (add-after 'unpack 'use-shared-brotli
148 (lambda _
149 (setenv "USE_SHARED_BROTLI" "1"))))))
150 (propagated-inputs (list python-cffi))
151 (inputs (list brotli))
152 (home-page "https://github.com/python-hyper/brotlicffi")
153 (synopsis "Python CFFI bindings to the Brotli library")
154 (description "This package provides Python CFFI bindings to the Brotli
155library.")
156 (license license:expat)))
157
158(define-public python-inflate64
159 (package
160 (name "python-inflate64")
161 (version "0.3.1")
162 (source (origin
163 (method url-fetch)
164 (uri (pypi-uri "inflate64" version))
165 (sha256
166 (base32
167 "0767j35gkwaykl1iq9qn8rc25j1ggv56x3d1vzjpk89bzpzdhbdm"))))
168 (build-system pyproject-build-system)
169 (propagated-inputs (list python-importlib-metadata))
170 (native-inputs
171 (list python-pyannotate
172 python-pytest
173 python-setuptools-scm))
174 (home-page "https://pypi.org/project/inflate64/")
175 (synopsis "deflate64 compression/decompression library")
176 (description "The @code{inflate64} package provides @code{Deflater} and
177@code{Inflater} classes to compress and decompress with the Enhanced Deflate
178compression algorithm.")
179 (license license:lgpl2.1+)))
180
181(define-public python-isal
182 (package
183 (name "python-isal")
184 (version "0.11.1")
185 (source
186 (origin
187 (method url-fetch)
188 (uri (pypi-uri "isal" version))
189 (sha256
190 (base32 "1bxj7r24p974pqfgym485s90ydhzji9q7zyfg3sf8fycm9ya01wd"))
191 ;; Remove bundles isa-l source code
192 (modules '((guix build utils)))
193 (snippet
194 '(delete-file-recursively "src/isal/isa-l"))))
195 (build-system python-build-system)
196 (arguments
197 `(#:phases
198 (modify-phases %standard-phases
199 (add-after 'unpack 'use-dynamic-linking
200 (lambda _ (setenv "PYTHON_ISAL_LINK_DYNAMIC" "1"))))))
201 (inputs (list isa-l))
202 (native-inputs (list python-cython))
203 (home-page "https://github.com/pycompression/python-isal")
204 (synopsis "Python bindings for the ISA-L compression library")
205 (description
206 "This package aims to provide faster zlib and gzip compatible compression
207and decompression by implementing Python bindings for the ISA-L library.")
208 (license license:expat)))
209
210(define-public python-pyppmd
211 (package
212 (name "python-pyppmd")
213 (version "1.0.0")
214 (source (origin
215 (method url-fetch)
216 (uri (pypi-uri "pyppmd" version))
217 (sha256
218 (base32
219 "03w4x26mar0ha73c3v39psn1i0k6xrzwmaxfsxysic73jz99np07"))))
220 (build-system pyproject-build-system)
221 (native-inputs
222 (list python-coverage
223 python-hypothesis
224 python-pytest
225 python-pytest-benchmark
226 python-pytest-cov
227 python-pytest-timeout
228 python-setuptools-scm))
229 (home-page "https://github.com/miurahr/pyppmd")
230 (synopsis "PPMd compression/decompression library")
231 (description "Pyppmd provides classes and functions for compressing and
232decompressing text data, using the @dfn{Prediction by partial matching} (PPM)
233compression algorithm variation H and I.2. It provides an API similar to
234Python's zlib/bz2/lzma modules.")
235 (license license:lgpl2.1+)))
236
237(define-public python-ppmd-cffi
238 (package
239 (name "python-ppmd-cffi")
240 (version "0.5.0")
241 (source
242 (origin
243 (method url-fetch)
244 (uri (pypi-uri "ppmd-cffi" version))
245 (sha256
246 (base32
247 "0vprpl29fkflqx0m6anfpx7q7i4cw0d0qxcdm91k4pl82dcad81g"))))
248 (build-system python-build-system)
249 (propagated-inputs
250 (list python-cffi))
251 (native-inputs
252 (list python-hypothesis
253 python-setuptools-scm
254 python-coverage
255 python-pytest
256 python-pytest-cov))
257 (home-page "https://github.com/miurahr/ppmd")
258 (synopsis "Prediction by Partial Matching compression library")
259 (description "PPMd is a compression algorithm library using the Prediction
260by Partial Matching statistical technique. It is used in RAR and 7-Zip as one of
261several possible methods.")
262 (license license:lgpl2.1+)))
263
264(define-public python-py7zr
265 (package
266 (name "python-py7zr")
267 (version "0.20.2")
268 (source
269 (origin
270 (method url-fetch)
271 (uri (pypi-uri "py7zr" version))
272 (sha256
273 (base32
274 "0lwniinfr3rb10n0c203a09vz06vxnnj637yqn8ipdlml89gj7kr"))))
275 (build-system pyproject-build-system)
276 (propagated-inputs
277 (list python-brotli
278 python-brotlicffi
279 python-importlib-metadata
280 python-inflate64
281 python-multivolumefile
282 python-psutil
283 python-pybcj
284 python-pycryptodomex
285 python-pyppmd
286 python-pyzstd
287 python-texttable))
288 (native-inputs
289 (list python-setuptools
290 python-setuptools-scm
291 python-coverage
292 python-coveralls
293 python-libarchive-c
294 python-py-cpuinfo
295 python-pyannotate
296 python-pytest
297 python-pytest-benchmark
298 python-pytest-cov
299 python-pytest-remotedata
300 python-pytest-timeout))
301 (home-page "https://github.com/miurahr/py7zr")
302 (synopsis "7-zip in Python")
303 (description "This package provides py7zr, which implements 7-zip
304archive compression, decompression, encryption and decryption in
305Python.")
306 (license license:lgpl2.1+)))
307
308(define-public python-lzo
309 (package
310 (name "python-lzo")
311 (version "1.14")
312 (source
313 (origin
314 (method url-fetch)
315 (uri (pypi-uri "python-lzo" version))
316 (sha256
317 (base32 "0315nq6r39n51n8qqamb7xv0ib0qrh76q7g3a1977172mbndijw3"))))
318 (build-system python-build-system)
319 (arguments
320 (list
321 #:test-target "check"
322 #:phases
323 #~(modify-phases %standard-phases
324 (add-after 'unpack 'patch-setuppy
325 (lambda _
326 (substitute* "setup.py"
327 (("include_dirs.append\\(.*\\)")
328 (string-append "include_dirs.append('"
329 #$(this-package-input "lzo")
330 "/include/lzo"
331 "')"))))))))
332 (inputs
333 (list lzo))
334 (home-page "https://github.com/jd-boyd/python-lzo")
335 (synopsis "Python bindings for the LZO data compression library")
336 (description
337 "Python-LZO provides Python bindings for LZO, i.e. you can access
338the LZO library from your Python scripts thereby compressing ordinary
339Python strings.")
340 (license license:gpl2+)))
341
342(define-public python-lz4
343 (package
344 (name "python-lz4")
345 (version "4.0.2")
346 (source
347 (origin
348 (method url-fetch)
349 (uri (pypi-uri "lz4" version))
350 (sha256
351 (base32
352 "16vj2bnhhdkcz2a2ai2mx2kf9ngx1cjr18636yp1514kq9r72fq8"))
353 (modules '((guix build utils)))
354 (snippet
355 '(begin
356 ;; Remove bundled copy of lz4.
357 (delete-file-recursively "lz4libs")
358 #t))))
359 (build-system python-build-system)
360 (arguments
361 (list #:phases
362 #~(modify-phases %standard-phases
363 (replace 'check
364 (lambda* (#:key tests? #:allow-other-keys)
365 (when tests?
366 ;; Taken from tox.ini (excludes experimental tests).
367 (invoke "pytest" "-vv" "tests/block" "tests/frame")))))))
368 (native-inputs
369 (list pkg-config python-pytest python-pkgconfig python-setuptools-scm
370 ;; For tests.
371 python-psutil))
372 (inputs
373 (list lz4))
374 (home-page "https://github.com/python-lz4/python-lz4")
375 (synopsis "LZ4 bindings for Python")
376 (description
377 "This package provides python bindings for the lz4 compression library
378by Yann Collet. The project contains bindings for the LZ4 block format and
379the LZ4 frame format.")
380 (license license:bsd-3)))
381
382(define-public python-lzstring
383 (package
384 (name "python-lzstring")
385 (version "1.0.4")
386 (source
387 (origin
388 (method url-fetch)
389 (uri (pypi-uri "lzstring" version))
390 (sha256
391 (base32
392 "18ly9pppy2yspxzw7k1b23wk77k7m44rz2g0271bqgqrk3jn3yhs"))))
393 (build-system python-build-system)
394 (propagated-inputs
395 (list python-future))
396 (home-page "https://github.com/gkovacs/lz-string-python")
397 (synopsis "String compression")
398 (description "Lz-string is a string compressor library for Python.")
399 (license license:expat)))
400
401(define-public bitshuffle
402 (package
403 (name "bitshuffle")
404 (version "0.3.5")
405 (source (origin
406 (method url-fetch)
407 (uri (pypi-uri "bitshuffle" version))
408 (sha256
409 (base32
410 "1823x61kyax4dc2hjmc1xraskxi1193y8lvxd03vqv029jrj8cjy"))
411 (modules '((guix build utils)))
412 (snippet
413 '(begin
414 ;; Remove generated Cython files.
415 (delete-file "bitshuffle/h5.c")
416 (delete-file "bitshuffle/ext.c")
417 #t))))
418 (build-system python-build-system)
419 (arguments
420 `(#:tests? #f ; fail: https://github.com/h5py/h5py/issues/769
421 #:phases
422 (modify-phases %standard-phases
423 (add-after 'unpack 'fix-neon-detection
424 ;; Neon is only for aarch64 ATM
425 ;; see: https://github.com/kiyo-masui/bitshuffle/pull/73
426 (lambda _
427 (substitute* "src/bitshuffle_core.c"
428 (("#define USEARMNEON")
429 "#ifdef __aarch64__\n#define USEARMNEON\n#endif"))
430 #t))
431 (add-after 'unpack 'dont-build-native
432 (lambda _
433 (substitute* "setup.py"
434 (("'-march=native', ") ""))
435 #t)))))
436 (inputs
437 `(("numpy" ,python-numpy)
438 ("h5py" ,python-h5py)
439 ("hdf5" ,hdf5)))
440 (native-inputs
441 `(("cython" ,python-cython)))
442 (home-page "https://github.com/kiyo-masui/bitshuffle")
443 (synopsis "Filter for improving compression of typed binary data")
444 (description "Bitshuffle is an algorithm that rearranges typed, binary data
445for improving compression, as well as a python/C package that implements this
446algorithm within the Numpy framework.")
447 (license license:expat)))
448
449(define-public bitshuffle-for-snappy
450 (package/inherit bitshuffle
451 (name "bitshuffle-for-snappy")
452 (build-system gnu-build-system)
453 (arguments
454 (substitute-keyword-arguments (package-arguments bitshuffle)
455 ((#:tests? _ #f) #f)
456 ((#:phases phases)
457 `(modify-phases %standard-phases
458 (replace 'configure
459 (lambda* (#:key outputs #:allow-other-keys)
460 (with-output-to-file "Makefile"
461 (lambda _
462 (format #t "\
463libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o
464\tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^
465
466%.o: %.c
467\tgcc -O3 -ffast-math -std=c99 -fPIC -Isrc -Ilz4 -c $< -o $@
468
469PREFIX:=~a
470LIBDIR:=$(PREFIX)/lib
471INCLUDEDIR:=$(PREFIX)/include
472
473install: libbitshuffle.so
474\tinstall -dm755 $(LIBDIR)
475\tinstall -dm755 $(INCLUDEDIR)
476\tinstall -m755 libbitshuffle.so $(LIBDIR)
477\tinstall -m644 src/bitshuffle.h $(INCLUDEDIR)
478\tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR)
479\tinstall -m644 src/iochain.h $(INCLUDEDIR)
480\tinstall -m644 lz4/lz4.h $(INCLUDEDIR)
481" (assoc-ref outputs "out"))))
482 #t))))))
483 (inputs '())
484 (native-inputs '())))
485
486(define-public python-zipp
487 (package
488 (name "python-zipp")
489 (version "1.0.0")
490 (source
491 (origin
492 (method url-fetch)
493 (uri (pypi-uri "zipp" version))
494 (sha256
495 (base32
496 "0v3qayhqv7vyzydpydwcp51bqciw8p2ajddw68x5k8zppc0vx3yk"))))
497 (build-system python-build-system)
498 (propagated-inputs
499 (list python-more-itertools))
500 (native-inputs
501 (list python-setuptools-scm))
502 (home-page "https://github.com/jaraco/zipp")
503 (synopsis
504 "Backport of pathlib-compatible object wrapper for zip files")
505 (description
506 "This package provides a @code{pathlib}-compatible @code{Zipfile} object
507wrapper. It provides a backport of the @code{Path} object.")
508 (license license:expat)))
509
510(define-public python-zopfli
511 (package
512 (name "python-zopfli")
513 (version "0.2.1")
514 (source
515 (origin
516 (method url-fetch)
517 (uri (pypi-uri "zopfli" version ".zip"))
518 (sha256
519 (base32 "1ipjkcgdbplsrhr31ypk48px8cax4cm9gcjj7yrcrhg20ql3s9p5"))))
520 (build-system python-build-system)
521 (arguments
522 (list
523 #:phases #~(modify-phases %standard-phases
524 (add-after 'unpack 'use-system-zopfli
525 (lambda _
526 (setenv "USE_SYSTEM_ZOPFLI" "1")))
527 (add-before 'build 'set-version
528 (lambda _
529 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))
530 (replace 'check
531 (lambda* (#:key tests? #:allow-other-keys)
532 (when tests?
533 (invoke "pytest" "-vv")))))))
534 (native-inputs (list unzip python-pytest python-setuptools-scm))
535 (inputs (list zopfli))
536 (home-page "https://github.com/fonttools/py-zopfli")
537 (synopsis "Python bindings for Zopfli")
538 (description "@code{pyzopfli} is a straight forward wrapper around the
539@code{ZlibCompress} method of the the @code{zopfli} library.")
540 (license license:asl2.0)))
541
542(define-public python-zstandard
543 (package
544 (name "python-zstandard")
545 (version "0.19.0")
546 (source
547 (origin
548 (method url-fetch)
549 (uri (pypi-uri "zstandard" version))
550 (sha256
551 (base32 "0qvqhs121spk7yc1l20samflxx47waxv3xm55ksxpn1djk6jzl9i"))))
552 (build-system python-build-system)
553 (propagated-inputs
554 (list python-cffi))
555 (native-inputs
556 (list python-hypothesis))
557 (home-page "https://github.com/indygreg/python-zstandard")
558 (synopsis "Zstandard bindings for Python")
559 (description "This project provides Python bindings for interfacing with
560the Zstandard compression library. A C extension and CFFI interface are
561provided.")
562 (license license:bsd-3)))
563
564(define-public python-pyzstd
565 (package
566 (name "python-pyzstd")
567 (version "0.15.3")
568 (source
569 (origin
570 (method url-fetch)
571 (uri (pypi-uri "pyzstd" version))
572 (sha256
573 (base32
574 "0wkli2i4my79l43b996bdga0fac8s8nfd1zjyzl46lwmsfsxlkmc"))))
575 (build-system python-build-system)
576 (home-page "https://github.com/animalize/pyzstd")
577 (synopsis "Zstandard bindings for Python")
578 (description "This package provides Python bindings to the
579Zstandard (zstd)
580compression library. The API is similar to Python's bz2/lzma/zlib module.")
581 (license license:bsd-3)))