gnu: evince: Enable introspection.
[jackhill/guix/guix.git] / gnu / packages / python-compression.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
3 ;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2017 ng0 <ng0@n0.is>
5 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
6 ;;; Copyright © 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages python-compression)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix utils)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system python)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages check)
34 #:use-module (gnu packages maths)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages python-xyz)
37 #:use-module (gnu packages sphinx))
38
39 (define-public python-lzo
40 (package
41 (name "python-lzo")
42 (version "1.12")
43 (source
44 (origin
45 (method url-fetch)
46 (uri (pypi-uri "python-lzo" version))
47 (sha256
48 (base32
49 "0iakqgd51n1cd7r3lpdylm2rgbmd16y74cra9kcapwg84mlf9a4p"))))
50 (build-system python-build-system)
51 (arguments
52 `(#:test-target "check"
53 #:phases
54 (modify-phases %standard-phases
55 (add-after 'unpack 'patch-setuppy
56 (lambda _
57 (substitute* "setup.py"
58 (("include_dirs.append\\(.*\\)")
59 (string-append "include_dirs.append('"
60 (assoc-ref %build-inputs "lzo")
61 "/include/lzo"
62 "')")))
63 #t)))))
64 (inputs
65 `(("lzo" ,lzo)))
66 (home-page "https://github.com/jd-boyd/python-lzo")
67 (synopsis "Python bindings for the LZO data compression library")
68 (description
69 "Python-LZO provides Python bindings for LZO, i.e. you can access
70 the LZO library from your Python scripts thereby compressing ordinary
71 Python strings.")
72 (license license:gpl2+)))
73
74 (define-public python2-lzo
75 (package-with-python2 python-lzo))
76
77 (define-public python-lz4
78 (package
79 (name "python-lz4")
80 (version "0.10.1")
81 (source
82 (origin
83 (method url-fetch)
84 (uri (pypi-uri "lz4" version))
85 (sha256
86 (base32
87 "0ghv1xbaq693kgww1x9c22bplz479ls9szjsaa4ig778ls834hm0"))))
88 (build-system python-build-system)
89 (native-inputs
90 `(("python-nose" ,python-nose)
91 ("python-setuptools-scm" ,python-setuptools-scm)))
92 (home-page "https://github.com/python-lz4/python-lz4")
93 (synopsis "LZ4 bindings for Python")
94 (description
95 "This package provides python bindings for the lz4 compression library
96 by Yann Collet. The project contains bindings for the LZ4 block format and
97 the LZ4 frame format.")
98 (license license:bsd-3)))
99
100 (define-public python2-lz4
101 (package-with-python2 python-lz4))
102
103 (define-public python-lzstring
104 (package
105 (name "python-lzstring")
106 (version "1.0.4")
107 (source
108 (origin
109 (method url-fetch)
110 (uri (pypi-uri "lzstring" version))
111 (sha256
112 (base32
113 "18ly9pppy2yspxzw7k1b23wk77k7m44rz2g0271bqgqrk3jn3yhs"))))
114 (build-system python-build-system)
115 (propagated-inputs
116 `(("python-future" ,python-future)))
117 (home-page "https://github.com/gkovacs/lz-string-python")
118 (synopsis "String compression")
119 (description "Lz-string is a string compressor library for Python.")
120 (license license:expat)))
121
122 (define-public python2-lzstring
123 (package-with-python2 python-lzstring))
124
125 (define-public bitshuffle
126 (package
127 (name "bitshuffle")
128 (version "0.3.5")
129 (source (origin
130 (method url-fetch)
131 (uri (pypi-uri "bitshuffle" version))
132 (sha256
133 (base32
134 "1823x61kyax4dc2hjmc1xraskxi1193y8lvxd03vqv029jrj8cjy"))
135 (modules '((guix build utils)))
136 (snippet
137 '(begin
138 ;; Remove generated Cython files.
139 (delete-file "bitshuffle/h5.c")
140 (delete-file "bitshuffle/ext.c")
141 #t))))
142 (build-system python-build-system)
143 (arguments
144 `(#:tests? #f ; fail: https://github.com/h5py/h5py/issues/769
145 #:phases
146 (modify-phases %standard-phases
147 (add-after 'unpack 'fix-neon-detection
148 ;; Neon is only for aarch64 ATM
149 ;; see: https://github.com/kiyo-masui/bitshuffle/pull/73
150 (lambda _
151 (substitute* "src/bitshuffle_core.c"
152 (("#define USEARMNEON")
153 "#ifdef __aarch64__\n#define USEARMNEON\n#endif"))
154 #t))
155 (add-after 'unpack 'dont-build-native
156 (lambda _
157 (substitute* "setup.py"
158 (("'-march=native', ") ""))
159 #t)))))
160 (inputs
161 `(("numpy" ,python-numpy)
162 ("h5py" ,python-h5py)
163 ("hdf5" ,hdf5)))
164 (native-inputs
165 `(("cython" ,python-cython)))
166 (home-page "https://github.com/kiyo-masui/bitshuffle")
167 (synopsis "Filter for improving compression of typed binary data")
168 (description "Bitshuffle is an algorithm that rearranges typed, binary data
169 for improving compression, as well as a python/C package that implements this
170 algorithm within the Numpy framework.")
171 (license license:expat)))
172
173 (define-public bitshuffle-for-snappy
174 (package
175 (inherit bitshuffle)
176 (name "bitshuffle-for-snappy")
177 (build-system gnu-build-system)
178 (arguments
179 (substitute-keyword-arguments (package-arguments bitshuffle)
180 ((#:tests? _ #f) #f)
181 ((#:phases phases)
182 `(modify-phases %standard-phases
183 (replace 'configure
184 (lambda* (#:key outputs #:allow-other-keys)
185 (with-output-to-file "Makefile"
186 (lambda _
187 (format #t "\
188 libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o
189 \tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^
190
191 %.o: %.c
192 \tgcc -O3 -ffast-math -std=c99 -fPIC -Isrc -Ilz4 -c $< -o $@
193
194 PREFIX:=~a
195 LIBDIR:=$(PREFIX)/lib
196 INCLUDEDIR:=$(PREFIX)/include
197
198 install: libbitshuffle.so
199 \tinstall -dm755 $(LIBDIR)
200 \tinstall -dm755 $(INCLUDEDIR)
201 \tinstall -m755 libbitshuffle.so $(LIBDIR)
202 \tinstall -m644 src/bitshuffle.h $(INCLUDEDIR)
203 \tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR)
204 \tinstall -m644 src/iochain.h $(INCLUDEDIR)
205 \tinstall -m644 lz4/lz4.h $(INCLUDEDIR)
206 " (assoc-ref outputs "out"))))
207 #t))))))
208 (inputs '())
209 (native-inputs '())))
210
211 (define-public python-zipp
212 (package
213 (name "python-zipp")
214 (version "0.5.1")
215 (source
216 (origin
217 (method url-fetch)
218 (uri (pypi-uri "zipp" version))
219 (sha256
220 (base32
221 "1hsv4zwy1pwnbrr63wjjkpwrmnk36ngbkkqw01bj5hcwh1z3m56a"))))
222 (build-system python-build-system)
223 (propagated-inputs
224 `(("python-contextlib2" ,python-contextlib2)
225 ("python-pathlib2" ,python-pathlib2)
226 ("python-rst.linker" ,python-rst.linker)))
227 (native-inputs
228 `(("python-setuptools-scm" ,python-setuptools-scm)
229 ("python-sphinx" ,python-sphinx)
230 ("python-unittest2" ,python-unittest2)))
231 (home-page "https://github.com/jaraco/zipp")
232 (synopsis
233 "Backport of pathlib-compatible object wrapper for zip files")
234 (description
235 "This package provides a @code{pathlib}-compatible @code{Zipfile} object
236 wrapper. It provides a backport of the @code{Path} object.")
237 (license license:expat)))
238
239 (define-public python-zstandard
240 (package
241 (name "python-zstandard")
242 (version "0.13.0")
243 (source
244 (origin
245 (method url-fetch)
246 (uri (pypi-uri "zstandard" version))
247 (sha256
248 (base32 "0q9msi00s93iqm8vzd839r7yc51gz54z90h5bckqyjdxa6vxijz5"))))
249 (build-system python-build-system)
250 (native-inputs
251 `(("python-hypothesis" ,python-hypothesis)))
252 (home-page "https://github.com/indygreg/python-zstandard")
253 (synopsis "Zstandard bindings for Python")
254 (description "This project provides Python bindings for interfacing with
255 the Zstandard compression library. A C extension and CFFI interface are
256 provided.")
257 (license license:bsd-3)))