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>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages python-compression)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix utils)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system python)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages check)
33 #:use-module (gnu packages maths)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages python-xyz)
36 #:use-module (gnu packages sphinx))
38 (define-public python-lzo
45 (uri (pypi-uri "python-lzo" version))
48 "0iakqgd51n1cd7r3lpdylm2rgbmd16y74cra9kcapwg84mlf9a4p"))))
49 (build-system python-build-system)
51 `(#:test-target "check"
53 (modify-phases %standard-phases
54 (add-after 'unpack 'patch-setuppy
56 (substitute* "setup.py"
57 (("include_dirs.append\\(.*\\)")
58 (string-append "include_dirs.append('"
59 (assoc-ref %build-inputs "lzo")
65 (home-page "https://github.com/jd-boyd/python-lzo")
66 (synopsis "Python bindings for the LZO data compression library")
68 "Python-LZO provides Python bindings for LZO, i.e. you can access
69 the LZO library from your Python scripts thereby compressing ordinary
71 (license license:gpl2+)))
73 (define-public python2-lzo
74 (package-with-python2 python-lzo))
76 (define-public python-lz4
83 (uri (pypi-uri "lz4" version))
86 "0ghv1xbaq693kgww1x9c22bplz479ls9szjsaa4ig778ls834hm0"))))
87 (build-system python-build-system)
89 `(("python-nose" ,python-nose)
90 ("python-setuptools-scm" ,python-setuptools-scm)))
91 (home-page "https://github.com/python-lz4/python-lz4")
92 (synopsis "LZ4 bindings for Python")
94 "This package provides python bindings for the lz4 compression library
95 by Yann Collet. The project contains bindings for the LZ4 block format and
96 the LZ4 frame format.")
97 (license license:bsd-3)))
99 (define-public python2-lz4
100 (package-with-python2 python-lz4))
102 (define-public python-lzstring
104 (name "python-lzstring")
109 (uri (pypi-uri "lzstring" version))
112 "18ly9pppy2yspxzw7k1b23wk77k7m44rz2g0271bqgqrk3jn3yhs"))))
113 (build-system python-build-system)
115 `(("python-future" ,python-future)))
116 (home-page "https://github.com/gkovacs/lz-string-python")
117 (synopsis "String compression")
118 (description "Lz-string is a string compressor library for Python.")
119 (license license:expat)))
121 (define-public python2-lzstring
122 (package-with-python2 python-lzstring))
124 (define-public bitshuffle
130 (uri (pypi-uri "bitshuffle" version))
133 "1823x61kyax4dc2hjmc1xraskxi1193y8lvxd03vqv029jrj8cjy"))
134 (modules '((guix build utils)))
137 ;; Remove generated Cython files.
138 (delete-file "bitshuffle/h5.c")
139 (delete-file "bitshuffle/ext.c")
141 (build-system python-build-system)
143 `(#:tests? #f ; fail: https://github.com/h5py/h5py/issues/769
145 (modify-phases %standard-phases
146 (add-after 'unpack 'fix-neon-detection
147 ;; Neon is only for aarch64 ATM
148 ;; see: https://github.com/kiyo-masui/bitshuffle/pull/73
150 (substitute* "src/bitshuffle_core.c"
151 (("#define USEARMNEON")
152 "#ifdef __aarch64__\n#define USEARMNEON\n#endif"))
154 (add-after 'unpack 'dont-build-native
156 (substitute* "setup.py"
157 (("'-march=native', ") ""))
160 `(("numpy" ,python-numpy)
161 ("h5py" ,python-h5py)
164 `(("cython" ,python-cython)))
165 (home-page "https://github.com/kiyo-masui/bitshuffle")
166 (synopsis "Filter for improving compression of typed binary data")
167 (description "Bitshuffle is an algorithm that rearranges typed, binary data
168 for improving compression, as well as a python/C package that implements this
169 algorithm within the Numpy framework.")
170 (license license:expat)))
172 (define-public bitshuffle-for-snappy
175 (name "bitshuffle-for-snappy")
176 (build-system gnu-build-system)
178 (substitute-keyword-arguments (package-arguments bitshuffle)
181 `(modify-phases %standard-phases
183 (lambda* (#:key outputs #:allow-other-keys)
184 (with-output-to-file "Makefile"
187 libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o
188 \tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^
191 \tgcc -O3 -ffast-math -std=c99 -fPIC -Isrc -Ilz4 -c $< -o $@
194 LIBDIR:=$(PREFIX)/lib
195 INCLUDEDIR:=$(PREFIX)/include
197 install: libbitshuffle.so
198 \tinstall -dm755 $(LIBDIR)
199 \tinstall -dm755 $(INCLUDEDIR)
200 \tinstall -m755 libbitshuffle.so $(LIBDIR)
201 \tinstall -m644 src/bitshuffle.h $(INCLUDEDIR)
202 \tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR)
203 \tinstall -m644 src/iochain.h $(INCLUDEDIR)
204 \tinstall -m644 lz4/lz4.h $(INCLUDEDIR)
205 " (assoc-ref outputs "out"))))
208 (native-inputs '())))
210 (define-public python-zipp
217 (uri (pypi-uri "zipp" version))
220 "1hsv4zwy1pwnbrr63wjjkpwrmnk36ngbkkqw01bj5hcwh1z3m56a"))))
221 (build-system python-build-system)
223 `(("python-contextlib2" ,python-contextlib2)
224 ("python-pathlib2" ,python-pathlib2)
225 ("python-rst.linker" ,python-rst.linker)))
227 `(("python-setuptools-scm" ,python-setuptools-scm)
228 ("python-sphinx" ,python-sphinx)
229 ("python-unittest2" ,python-unittest2)))
230 (home-page "https://github.com/jaraco/zipp")
232 "Backport of pathlib-compatible object wrapper for zip files")
234 "This package provides a @code{pathlib}-compatible @code{Zipfile} object
235 wrapper. It provides a backport of the @code{Path} object.")
236 (license license:expat)))