| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 |
|
| 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 |
|
| 37 | (define-public python-lzo
|
| 38 | (package
|
| 39 | (name "python-lzo")
|
| 40 | (version "1.12")
|
| 41 | (source
|
| 42 | (origin
|
| 43 | (method url-fetch)
|
| 44 | (uri (pypi-uri "python-lzo" version))
|
| 45 | (sha256
|
| 46 | (base32
|
| 47 | "0iakqgd51n1cd7r3lpdylm2rgbmd16y74cra9kcapwg84mlf9a4p"))))
|
| 48 | (build-system python-build-system)
|
| 49 | (arguments
|
| 50 | `(#:test-target "check"
|
| 51 | #:phases
|
| 52 | (modify-phases %standard-phases
|
| 53 | (add-after 'unpack 'patch-setuppy
|
| 54 | (lambda _
|
| 55 | (substitute* "setup.py"
|
| 56 | (("include_dirs.append\\(.*\\)")
|
| 57 | (string-append "include_dirs.append('"
|
| 58 | (assoc-ref %build-inputs "lzo")
|
| 59 | "/include/lzo"
|
| 60 | "')")))
|
| 61 | #t)))))
|
| 62 | (inputs
|
| 63 | `(("lzo" ,lzo)))
|
| 64 | (home-page "https://github.com/jd-boyd/python-lzo")
|
| 65 | (synopsis "Python bindings for the LZO data compression library")
|
| 66 | (description
|
| 67 | "Python-LZO provides Python bindings for LZO, i.e. you can access
|
| 68 | the LZO library from your Python scripts thereby compressing ordinary
|
| 69 | Python strings.")
|
| 70 | (license license:gpl2+)))
|
| 71 |
|
| 72 | (define-public python2-lzo
|
| 73 | (package-with-python2 python-lzo))
|
| 74 |
|
| 75 | (define-public python-lz4
|
| 76 | (package
|
| 77 | (name "python-lz4")
|
| 78 | (version "0.10.1")
|
| 79 | (source
|
| 80 | (origin
|
| 81 | (method url-fetch)
|
| 82 | (uri (pypi-uri "lz4" version))
|
| 83 | (sha256
|
| 84 | (base32
|
| 85 | "0ghv1xbaq693kgww1x9c22bplz479ls9szjsaa4ig778ls834hm0"))))
|
| 86 | (build-system python-build-system)
|
| 87 | (native-inputs
|
| 88 | `(("python-nose" ,python-nose)
|
| 89 | ("python-setuptools-scm" ,python-setuptools-scm)))
|
| 90 | (home-page "https://github.com/python-lz4/python-lz4")
|
| 91 | (synopsis "LZ4 bindings for Python")
|
| 92 | (description
|
| 93 | "This package provides python bindings for the lz4 compression library
|
| 94 | by Yann Collet. The project contains bindings for the LZ4 block format and
|
| 95 | the LZ4 frame format.")
|
| 96 | (license license:bsd-3)))
|
| 97 |
|
| 98 | (define-public python2-lz4
|
| 99 | (package-with-python2 python-lz4))
|
| 100 |
|
| 101 | (define-public python-lzstring
|
| 102 | (package
|
| 103 | (name "python-lzstring")
|
| 104 | (version "1.0.4")
|
| 105 | (source
|
| 106 | (origin
|
| 107 | (method url-fetch)
|
| 108 | (uri (pypi-uri "lzstring" version))
|
| 109 | (sha256
|
| 110 | (base32
|
| 111 | "18ly9pppy2yspxzw7k1b23wk77k7m44rz2g0271bqgqrk3jn3yhs"))))
|
| 112 | (build-system python-build-system)
|
| 113 | (propagated-inputs
|
| 114 | `(("python-future" ,python-future)))
|
| 115 | (home-page "https://github.com/gkovacs/lz-string-python")
|
| 116 | (synopsis "String compression")
|
| 117 | (description "Lz-string is a string compressor library for Python.")
|
| 118 | (license license:expat)))
|
| 119 |
|
| 120 | (define-public python2-lzstring
|
| 121 | (package-with-python2 python-lzstring))
|
| 122 |
|
| 123 | (define-public bitshuffle
|
| 124 | (package
|
| 125 | (name "bitshuffle")
|
| 126 | (version "0.3.5")
|
| 127 | (source (origin
|
| 128 | (method url-fetch)
|
| 129 | (uri (pypi-uri "bitshuffle" version))
|
| 130 | (sha256
|
| 131 | (base32
|
| 132 | "1823x61kyax4dc2hjmc1xraskxi1193y8lvxd03vqv029jrj8cjy"))
|
| 133 | (modules '((guix build utils)))
|
| 134 | (snippet
|
| 135 | '(begin
|
| 136 | |
| 137 | (delete-file "bitshuffle/h5.c")
|
| 138 | (delete-file "bitshuffle/ext.c")
|
| 139 | #t))))
|
| 140 | (build-system python-build-system)
|
| 141 | (arguments
|
| 142 | `(#:tests? #f |
| 143 | #:phases
|
| 144 | (modify-phases %standard-phases
|
| 145 | (add-after 'unpack 'fix-neon-detection
|
| 146 | |
| 147 | |
| 148 | (lambda _
|
| 149 | (substitute* "src/bitshuffle_core.c"
|
| 150 | (("#define USEARMNEON")
|
| 151 | "#ifdef __aarch64__\n#define USEARMNEON\n#endif"))
|
| 152 | #t))
|
| 153 | (add-after 'unpack 'dont-build-native
|
| 154 | (lambda _
|
| 155 | (substitute* "setup.py"
|
| 156 | (("'-march=native', ") ""))
|
| 157 | #t)))))
|
| 158 | (inputs
|
| 159 | `(("numpy" ,python-numpy)
|
| 160 | ("h5py" ,python-h5py)
|
| 161 | ("hdf5" ,hdf5)))
|
| 162 | (native-inputs
|
| 163 | `(("cython" ,python-cython)))
|
| 164 | (home-page "https://github.com/kiyo-masui/bitshuffle")
|
| 165 | (synopsis "Filter for improving compression of typed binary data")
|
| 166 | (description "Bitshuffle is an algorithm that rearranges typed, binary data
|
| 167 | for improving compression, as well as a python/C package that implements this
|
| 168 | algorithm within the Numpy framework.")
|
| 169 | (license license:expat)))
|
| 170 |
|
| 171 | (define-public bitshuffle-for-snappy
|
| 172 | (package
|
| 173 | (inherit bitshuffle)
|
| 174 | (name "bitshuffle-for-snappy")
|
| 175 | (build-system gnu-build-system)
|
| 176 | (arguments
|
| 177 | (substitute-keyword-arguments (package-arguments bitshuffle)
|
| 178 | ((#:tests? _ #f) #f)
|
| 179 | ((#:phases phases)
|
| 180 | `(modify-phases %standard-phases
|
| 181 | (replace 'configure
|
| 182 | (lambda* (#:key outputs #:allow-other-keys)
|
| 183 | (with-output-to-file "Makefile"
|
| 184 | (lambda _
|
| 185 | (format #t "\
|
| 186 | libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o
|
| 187 | \tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^
|
| 188 |
|
| 189 | %.o: %.c
|
| 190 | \tgcc -O3 -ffast-math -std=c99 -fPIC -Isrc -Ilz4 -c $< -o $@
|
| 191 |
|
| 192 | PREFIX:=~a
|
| 193 | LIBDIR:=$(PREFIX)/lib
|
| 194 | INCLUDEDIR:=$(PREFIX)/include
|
| 195 |
|
| 196 | install: libbitshuffle.so
|
| 197 | \tinstall -dm755 $(LIBDIR)
|
| 198 | \tinstall -dm755 $(INCLUDEDIR)
|
| 199 | \tinstall -m755 libbitshuffle.so $(LIBDIR)
|
| 200 | \tinstall -m644 src/bitshuffle.h $(INCLUDEDIR)
|
| 201 | \tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR)
|
| 202 | \tinstall -m644 src/iochain.h $(INCLUDEDIR)
|
| 203 | \tinstall -m644 lz4/lz4.h $(INCLUDEDIR)
|
| 204 | " (assoc-ref outputs "out"))))
|
| 205 | #t))))))
|
| 206 | (inputs '())
|
| 207 | (native-inputs '())))
|