gnu: lz4: Update to 1.7.5.
[jackhill/guix/guix.git] / gnu / packages / compression.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
7 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
8 ;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name>
9 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
10 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
12 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
13 ;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2016 David Craven <david@craven.ch>
15 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
16 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages compression)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix utils)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system perl)
42 #:use-module (guix build-system python)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages assembly)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages backup)
47 #:use-module (gnu packages base)
48 #:use-module (gnu packages check)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages valgrind)
53 #:use-module (ice-9 match)
54 #:use-module ((srfi srfi-1) #:select (last)))
55
56 (define-public zlib
57 (package
58 (name "zlib")
59 (version "1.2.11")
60 (source
61 (origin
62 (method url-fetch)
63 (uri (list (string-append "http://zlib.net/zlib-"
64 version ".tar.gz")
65 (string-append "mirror://sourceforge/libpng/zlib/"
66 version "/zlib-" version ".tar.gz")))
67 (sha256
68 (base32
69 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
70 (build-system gnu-build-system)
71 (arguments
72 `(#:phases
73 (modify-phases %standard-phases
74 (replace 'configure
75 (lambda* (#:key outputs #:allow-other-keys)
76 ;; Zlib's home-made `configure' fails when passed
77 ;; extra flags like `--enable-fast-install', so we need to
78 ;; invoke it with just what it understand.
79 (let ((out (assoc-ref outputs "out")))
80 ;; 'configure' doesn't understand '--host'.
81 ,@(if (%current-target-system)
82 `((setenv "CHOST" ,(%current-target-system)))
83 '())
84 (zero?
85 (system* "./configure"
86 (string-append "--prefix=" out)))))))))
87 (home-page "http://zlib.net/")
88 (synopsis "Compression library")
89 (description
90 "zlib is designed to be a free, general-purpose, legally unencumbered --
91 that is, not covered by any patents -- lossless data-compression library for
92 use on virtually any computer hardware and operating system. The zlib data
93 format is itself portable across platforms. Unlike the LZW compression method
94 used in Unix compress(1) and in the GIF image format, the compression method
95 currently used in zlib essentially never expands the data. (LZW can double or
96 triple the file size in extreme cases.) zlib's memory footprint is also
97 independent of the input data and can be reduced, if necessary, at some cost
98 in compression.")
99 (license license:zlib)))
100
101 (define-public minizip
102 (package
103 (name "minizip")
104 (version (package-version zlib))
105 (source (package-source zlib))
106 (build-system gnu-build-system)
107 (arguments
108 `(#:phases
109 (modify-phases %standard-phases
110 (add-after 'unpack 'enter-source
111 (lambda _ (chdir "contrib/minizip") #t))
112 (add-before 'configure 'autoreconf
113 (lambda _
114 (zero? (system* "autoreconf" "-vif")))))))
115 (native-inputs
116 `(("autoconf" ,autoconf)
117 ("automake" ,automake)
118 ("libtool" ,libtool)))
119 (propagated-inputs `(("zlib" ,zlib)))
120 (home-page (package-home-page zlib))
121 (synopsis "Zip Compression library")
122 (description
123 "Minizip is a minimalistic library that supports compressing,
124 extracting and viewing ZIP archives. This version is extracted from
125 the @code{zlib} source.")
126 (license (package-license zlib))))
127
128 (define-public fastjar
129 (package
130 (name "fastjar")
131 (version "0.98")
132 (source (origin
133 (method url-fetch)
134 (uri (string-append "mirror://savannah/fastjar/fastjar-"
135 version ".tar.gz"))
136 (sha256
137 (base32
138 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
139 (build-system gnu-build-system)
140 (inputs `(("zlib" ,zlib)))
141 (home-page "http://savannah.nongnu.org/projects/fastjar")
142 (synopsis "Replacement for Sun's 'jar' utility")
143 (description
144 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
145 utility. Instead of being written in Java, FastJar is written in C.")
146 (license license:gpl2+)))
147
148 (define-public libtar
149 (package
150 (name "libtar")
151 (version "1.2.20")
152 (source (origin
153 (method url-fetch)
154 (uri (list
155 (string-append
156 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
157 version ".tar.gz")
158 (string-append
159 "mirror://debian/pool/main/libt/libtar/libtar_"
160 version ".orig.tar.gz")))
161 (sha256
162 (base32
163 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
164 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
165 (build-system gnu-build-system)
166 (arguments
167 `(#:tests? #f ;no "check" target
168 #:phases
169 (modify-phases %standard-phases
170 (add-after 'unpack 'autoconf
171 (lambda _ (zero? (system* "sh" "autoreconf" "-vfi")))))))
172 (native-inputs
173 `(("autoconf" ,autoconf)
174 ("automake" ,automake)
175 ("libtool" ,libtool)))
176 (inputs
177 `(("zlib" ,zlib)))
178 (synopsis "C library for manipulating POSIX tar files")
179 (description
180 "libtar is a C library for manipulating POSIX tar files. It handles
181 adding and extracting files to/from a tar archive.")
182 (home-page "https://repo.or.cz/libtar.git")
183 (license license:bsd-3)))
184
185 (define-public gzip
186 (package
187 (name "gzip")
188 (version "1.8")
189 (source (origin
190 (method url-fetch)
191 (uri (string-append "mirror://gnu/gzip/gzip-"
192 version ".tar.xz"))
193 (sha256
194 (base32
195 "1lxv3p4iyx7833mlihkn5wfwmz4cys5nybwpz3dfawag8kn6f5zz"))))
196 (build-system gnu-build-system)
197 (synopsis "General file (de)compression (using lzw)")
198 (arguments
199 ;; FIXME: The test suite wants `less', and optionally Perl.
200 '(#:tests? #f))
201 (description
202 "GNU Gzip provides data compression and decompression utilities; the
203 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
204 file; as a result, it is often used in conjunction with \"tar\", resulting in
205 \".tar.gz\" or \".tgz\", etc.")
206 (license license:gpl3+)
207 (home-page "https://www.gnu.org/software/gzip/")))
208
209 (define-public bzip2
210 (let ((build-shared-lib
211 ;; Build a shared library.
212 '(lambda* (#:key inputs #:allow-other-keys)
213 (patch-makefile-SHELL "Makefile-libbz2_so")
214 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
215 (install-shared-lib
216 '(lambda* (#:key outputs #:allow-other-keys)
217 (let* ((out (assoc-ref outputs "out"))
218 (libdir (string-append out "/lib")))
219 (for-each (lambda (file)
220 (let ((base (basename file)))
221 (format #t "installing `~a' to `~a'~%"
222 base libdir)
223 (copy-file file
224 (string-append libdir "/" base))))
225 (find-files "." "^libbz2\\.so")))))
226 (set-cross-environment
227 '(lambda* (#:key target #:allow-other-keys)
228 (substitute* (find-files "." "Makefile")
229 (("CC=.*$")
230 (string-append "CC = " target "-gcc\n"))
231 (("AR=.*$")
232 (string-append "AR = " target "-ar\n"))
233 (("RANLIB=.*$")
234 (string-append "RANLIB = " target "-ranlib\n"))
235 (("^all:(.*)test" _ prerequisites)
236 ;; Remove 'all' -> 'test' dependency.
237 (string-append "all:" prerequisites "\n"))))))
238 (package
239 (name "bzip2")
240 (version "1.0.6")
241 (source (origin
242 (method url-fetch)
243 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
244 version ".tar.gz"))
245 (sha256
246 (base32
247 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
248 (build-system gnu-build-system)
249 (arguments
250 `(#:modules ((guix build gnu-build-system)
251 (guix build utils)
252 (srfi srfi-1))
253 #:phases
254 ,(if (%current-target-system)
255
256 ;; Cross-compilation: use the cross tools.
257 `(alist-cons-before
258 'build 'build-shared-lib ,build-shared-lib
259 (alist-cons-after
260 'install 'install-shared-lib ,install-shared-lib
261 (alist-replace 'configure ,set-cross-environment
262 %standard-phases)))
263
264 ;; Native compilation: build the shared library.
265 `(alist-cons-before
266 'build 'build-shared-lib ,build-shared-lib
267 (alist-cons-after
268 'install 'install-shared-lib ,install-shared-lib
269 (alist-delete 'configure %standard-phases))))
270
271 #:make-flags (list (string-append "PREFIX="
272 (assoc-ref %outputs "out")))
273
274 ;; Don't attempt to run the tests when cross-compiling.
275 ,@(if (%current-target-system)
276 '(#:tests? #f)
277 '())))
278 (synopsis "High-quality data compression program")
279 (description
280 "bzip2 is a freely available, patent free (see below), high-quality data
281 compressor. It typically compresses files to within 10% to 15% of the best
282 available techniques (the PPM family of statistical compressors), whilst
283 being around twice as fast at compression and six times faster at
284 decompression.")
285 (license (license:non-copyleft "file://LICENSE"
286 "See LICENSE in the distribution."))
287 (home-page "http://www.bzip.org/"))))
288
289 (define-public lbzip2
290 (package
291 (name "lbzip2")
292 (version "2.5")
293 (source (origin
294 (method url-fetch)
295 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
296 version ".tar.gz"))
297 (sha256
298 (base32
299 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))))
300 (build-system gnu-build-system)
301 (synopsis "Parallel bzip2 compression utility")
302 (description
303 "lbzip2 is a multi-threaded compression utility with support for the
304 bzip2 compressed file format. lbzip2 can process standard bz2 files in
305 parallel. It uses POSIX threading model (pthreads), which allows it to take
306 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
307 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
308 compatible with bzip2 – both at file format and command line level.")
309 (home-page "http://www.lbzip2.org/")
310 (license license:gpl3+)))
311
312 (define-public pbzip2
313 (package
314 (name "pbzip2")
315 (version "1.1.12")
316 (source (origin
317 (method url-fetch)
318 (uri (string-append "https://launchpad.net/pbzip2/"
319 (version-major+minor version) "/" version
320 "/+download/" name "-" version ".tar.gz"))
321 (sha256
322 (base32
323 "1vk6065dv3a47p86vmp8hv3n1ygd9hraz0gq89gvzlx7lmcb6fsp"))))
324 (build-system gnu-build-system)
325 (inputs
326 `(("bzip2" ,bzip2)))
327 (arguments
328 `(#:tests? #f ; no tests
329 #:phases (modify-phases %standard-phases
330 (delete 'configure))
331 #:make-flags (list (string-append "PREFIX=" %output))))
332 (home-page "http://compression.ca/pbzip2/")
333 (synopsis "Parallel bzip2 implementation")
334 (description
335 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
336 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
337 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
338 compressed with pbzip2 can be decompressed with bzip2).")
339 (license (license:non-copyleft "file://COPYING"
340 "See COPYING in the distribution."))))
341
342 (define-public xz
343 (package
344 (name "xz")
345 (version "5.2.2")
346 (source (origin
347 (method url-fetch)
348 (uri (list (string-append "http://tukaani.org/xz/xz-" version
349 ".tar.gz")
350 (string-append "http://multiprecision.org/guix/xz-"
351 version ".tar.gz")))
352 (sha256
353 (base32
354 "18h2k4jndhzjs8ln3a54qdnfv59y6spxiwh9gpaqniph6iflvpvk"))))
355 (build-system gnu-build-system)
356 (synopsis "General-purpose data compression")
357 (description
358 "XZ Utils is free general-purpose data compression software with high
359 compression ratio. XZ Utils were written for POSIX-like systems, but also
360 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
361
362 The core of the XZ Utils compression code is based on LZMA SDK, but it has
363 been modified quite a lot to be suitable for XZ Utils. The primary
364 compression algorithm is currently LZMA2, which is used inside the .xz
365 container format. With typical files, XZ Utils create 30 % smaller output
366 than gzip and 15 % smaller output than bzip2.")
367 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
368 (home-page "http://tukaani.org/xz/")))
369
370 (define-public lzo
371 (package
372 (name "lzo")
373 (version "2.09")
374 (source
375 (origin
376 (method url-fetch)
377 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
378 version ".tar.gz"))
379 (sha256
380 (base32
381 "0k5kpj3jnsjfxqqkblpfpx0mqcy86zs5fhjhgh2kq1hksg7ag57j"))))
382 (build-system gnu-build-system)
383 (arguments '(#:configure-flags '("--enable-shared")))
384 (home-page "http://www.oberhumer.com/opensource/lzo")
385 (synopsis
386 "Data compression library suitable for real-time data de-/compression")
387 (description
388 "LZO is a data compression library which is suitable for data
389 de-/compression in real-time. This means it favours speed over
390 compression ratio.
391
392 LZO is written in ANSI C. Both the source code and the compressed data
393 format are designed to be portable across platforms.")
394 (license license:gpl2+)))
395
396 (define-public python-lzo
397 (package
398 (name "python-lzo")
399 (version "1.11")
400 (source
401 (origin
402 (method url-fetch)
403 (uri (pypi-uri "python-lzo" version))
404 (sha256
405 (base32
406 "11p3ifg14p086byhhin6azx5svlkg8dzw2b5abixik97xd6fm81q"))))
407 (build-system python-build-system)
408 (arguments
409 `(#:test-target "check"
410 #:phases
411 (modify-phases %standard-phases
412 (add-after 'unpack 'patch-setuppy
413 (lambda _
414 (substitute* "setup.py"
415 (("include_dirs.append\\(.*\\)")
416 (string-append "include_dirs.append('"
417 (assoc-ref %build-inputs "lzo")
418 "/include/lzo"
419 "')")))
420 #t)))))
421 (inputs
422 `(("lzo" ,lzo)))
423 (home-page "https://github.com/jd-boyd/python-lzo")
424 (synopsis "Python bindings for the LZO data compression library")
425 (description
426 "Python-LZO provides Python bindings for LZO, i.e. you can access
427 the LZO library from your Python scripts thereby compressing ordinary
428 Python strings.")
429 (license license:gpl2+)))
430
431 (define-public python2-lzo
432 (package-with-python2 python-lzo))
433
434 (define-public lzop
435 (package
436 (name "lzop")
437 (version "1.03")
438 (source
439 (origin
440 (method url-fetch)
441 (uri (string-append "http://www.lzop.org/download/lzop-"
442 version ".tar.gz"))
443 (sha256
444 (base32
445 "1jdjvc4yjndf7ihmlcsyln2rbnbaxa86q4jskmkmm7ylfy65nhn1"))))
446 (build-system gnu-build-system)
447 (inputs `(("lzo" ,lzo)))
448 (home-page "http://www.lzop.org/")
449 (synopsis "Compress or expand files")
450 (description
451 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
452 LZO data compression library for compression services, and its main advantages
453 over gzip are much higher compression and decompression speed (at the cost of
454 some compression ratio).")
455 (license license:gpl2+)))
456
457 (define-public lzip
458 (package
459 (name "lzip")
460 (version "1.16")
461 (source (origin
462 (method url-fetch)
463 (uri (string-append "mirror://savannah/lzip/lzip-"
464 version ".tar.gz"))
465 (sha256
466 (base32
467 "0l9724rw1l3hg2ldr3n7ihqich4m9nc6y7l302bvdj4jmxdw530j"))))
468 (build-system gnu-build-system)
469 (home-page "http://www.nongnu.org/lzip/lzip.html")
470 (synopsis "Lossless data compressor based on the LZMA algorithm")
471 (description
472 "Lzip is a lossless data compressor with a user interface similar to the
473 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
474 more than bzip2, which makes it well suited for software distribution and data
475 archiving. Lzip is a clean implementation of the LZMA algorithm.")
476 (license license:gpl3+)))
477
478 (define-public sharutils
479 (package
480 (name "sharutils")
481 (version "4.15.2")
482 (source
483 (origin
484 (method url-fetch)
485 (uri (string-append "mirror://gnu/sharutils/sharutils-"
486 version ".tar.xz"))
487 (sha256
488 (base32
489 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))))
490 (build-system gnu-build-system)
491 (inputs
492 `(("which" ,which)))
493 (arguments
494 `(#:phases
495 (alist-cons-after
496 'patch-source-shebangs 'unpatch-source-shebang
497 ;; revert the patch-shebang phase on a script which is
498 ;; in fact test data
499 (lambda _
500 (substitute* "tests/shar-1.ok"
501 (((which "sh")) "/bin/sh")))
502 %standard-phases)))
503 (home-page "https://www.gnu.org/software/sharutils/")
504 (synopsis "Archives in shell scripts, uuencode/uudecode")
505 (description
506 "GNU sharutils is a package for creating and manipulating shell
507 archives that can be readily emailed. A shell archive is a file that can be
508 processed by a Bourne-type shell to unpack the original collection of files.
509 This package is mostly for compatibility and historical interest.")
510 (license license:gpl3+)))
511
512 (define-public sfarklib
513 (package
514 (name "sfarklib")
515 (version "2.24")
516 (source (origin
517 (method url-fetch)
518 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
519 version ".tar.gz"))
520 (file-name (string-append name "-" version ".tar.gz"))
521 (sha256
522 (base32
523 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
524 (build-system gnu-build-system)
525 (arguments
526 `(#:tests? #f ;no "check" target
527 #:phases
528 (modify-phases %standard-phases
529 (replace 'configure
530 (lambda* (#:key outputs #:allow-other-keys)
531 (substitute* "Makefile"
532 (("/usr/local") (assoc-ref outputs "out")))
533 #t)))))
534 (inputs
535 `(("zlib" ,zlib)))
536 (home-page "https://github.com/raboof/sfArkLib")
537 (synopsis "Library for SoundFont decompression")
538 (description
539 "SfArkLib is a C++ library for decompressing SoundFont files compressed
540 with the sfArk algorithm.")
541 (license license:gpl3+)))
542
543 (define-public sfarkxtc
544 (let ((commit "b5e0a2ba3921f019d74d4b92bd31c36dd19d2cf1"))
545 (package
546 (name "sfarkxtc")
547 (version (string-take commit 10))
548 (source (origin
549 ;; There are no release tarballs, so we just fetch the latest
550 ;; commit at this time.
551 (method git-fetch)
552 (uri (git-reference
553 (url "https://github.com/raboof/sfarkxtc.git")
554 (commit commit)))
555 (sha256
556 (base32
557 "0f5x6i46qfl6ry21s7g2p4sd4b2r1g4fb03yqi2vv4kq3saryhvj"))))
558 (build-system gnu-build-system)
559 (arguments
560 `(#:tests? #f ;no "check" target
561 #:phases
562 (modify-phases %standard-phases
563 (replace 'configure
564 (lambda* (#:key outputs #:allow-other-keys)
565 (substitute* "Makefile"
566 (("/usr/local") (assoc-ref outputs "out")))
567 #t)))))
568 (inputs
569 `(("zlib" ,zlib)
570 ("sfarklib" ,sfarklib)))
571 (home-page "https://github.com/raboof/sfarkxtc")
572 (synopsis "Basic sfArk decompressor")
573 (description "SfArk extractor converts SoundFonts in the compressed legacy
574 sfArk file format to the uncompressed sf2 format.")
575 (license license:gpl3+))))
576
577 (define-public libmspack
578 (package
579 (name "libmspack")
580 (version "0.5")
581 (source
582 (origin
583 (method url-fetch)
584 (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
585 version "alpha.tar.gz"))
586 (sha256
587 (base32 "04413hynb7zizxnkgy9riik3612dwirkpr6fcjrnfl2za9sz4rw9"))))
588 (build-system gnu-build-system)
589 (home-page "http://www.cabextract.org.uk/libmspack/")
590 (synopsis "Compression tools for some formats used by Microsoft")
591 (description
592 "The purpose of libmspack is to provide both compression and
593 decompression of some loosely related file formats used by Microsoft.")
594 (license license:lgpl2.1+)))
595
596 (define-public perl-compress-raw-bzip2
597 (package
598 (name "perl-compress-raw-bzip2")
599 (version "2.074")
600 (source
601 (origin
602 (method url-fetch)
603 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
604 "Compress-Raw-Bzip2-" version ".tar.gz"))
605 (sha256
606 (base32
607 "0b5jwqf15zr787acnx8sfyy2zavdd7gfkd98n1dgy8fs6r8yb8a4"))))
608 (build-system perl-build-system)
609 ;; TODO: Use our bzip2 package.
610 (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
611 (synopsis "Low-level interface to bzip2 compression library")
612 (description "This module provides a Perl interface to the bzip2
613 compression library.")
614 (license (package-license perl))))
615
616 (define-public perl-compress-raw-zlib
617 (package
618 (name "perl-compress-raw-zlib")
619 (version "2.074")
620 (source
621 (origin
622 (method url-fetch)
623 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
624 "Compress-Raw-Zlib-" version ".tar.gz"))
625 (sha256
626 (base32
627 "08bpx9v6i40n54rdcj6invlj294z20amrl8wvwf9b83aldwdwsd3"))))
628 (build-system perl-build-system)
629 (inputs
630 `(("zlib" ,zlib)))
631 (arguments
632 `(#:phases (modify-phases %standard-phases
633 (add-before
634 'configure 'configure-zlib
635 (lambda* (#:key inputs #:allow-other-keys)
636 (call-with-output-file "config.in"
637 (lambda (port)
638 (format port "
639 BUILD_ZLIB = False
640 INCLUDE = ~a/include
641 LIB = ~:*~a/lib
642 OLD_ZLIB = False
643 GZIP_OS_CODE = AUTO_DETECT"
644 (assoc-ref inputs "zlib")))))))))
645 (home-page "http://search.cpan.org/dist/Compress-Raw-Zlib")
646 (synopsis "Low-level interface to zlib compression library")
647 (description "This module provides a Perl interface to the zlib
648 compression library.")
649 (license (package-license perl))))
650
651 (define-public perl-io-compress
652 (package
653 (name "perl-io-compress")
654 (version "2.074")
655 (source
656 (origin
657 (method url-fetch)
658 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
659 "IO-Compress-" version ".tar.gz"))
660 (sha256
661 (base32
662 "1wlpy2026djfmq0bjync531yq6s695jf7bcnpvjphrasi776igdl"))))
663 (build-system perl-build-system)
664 (propagated-inputs
665 `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib) ; >=2.074
666 ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.074
667 (home-page "http://search.cpan.org/dist/IO-Compress")
668 (synopsis "IO Interface to compressed files/buffers")
669 (description "IO-Compress provides a Perl interface to allow reading and
670 writing of compressed data created with the zlib and bzip2 libraries.")
671 (license (package-license perl))))
672
673 (define-public lz4
674 (package
675 (name "lz4")
676 (version "1.7.5")
677 (source
678 (origin
679 (method url-fetch)
680 (uri (string-append "https://github.com/lz4/lz4/archive/"
681 "v" version ".tar.gz"))
682 (patches (search-patches "lz4-fix-test-failures.patch"))
683 (sha256
684 (base32
685 "0zkykqqjfa1q3ji0qmb1ml3l9063qqfh99agyj3cnb02cg6wm401"))
686 (file-name (string-append name "-" version ".tar.gz"))))
687 (build-system gnu-build-system)
688 (native-inputs `(("valgrind" ,valgrind))) ; for tests
689 (arguments
690 `(#:test-target "test"
691 #:parallel-tests? #f ; tests fail if run in parallel
692 #:make-flags (list "CC=gcc"
693 (string-append "PREFIX=" (assoc-ref %outputs "out")))
694 #:phases (modify-phases %standard-phases
695 (delete 'configure)))) ; no configure script
696 (home-page "https://github.com/lz4/lz4")
697 (synopsis "Compression algorithm focused on speed")
698 (description "LZ4 is a lossless compression algorithm, providing
699 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
700 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
701 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
702 time for compression ratio.")
703 ;; The libraries (lz4, lz4hc, and xxhash are BSD licenced. The command
704 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
705 (license (list license:bsd-2 license:gpl2+))))
706
707 (define-public python-lz4
708 (package
709 (name "python-lz4")
710 (version "0.8.2")
711 (source
712 (origin
713 (method url-fetch)
714 (uri (pypi-uri "lz4" version))
715 (sha256
716 (base32
717 "1irad4sq4hdr30fr53smvv3zzk4rddcf9b4jx19w8s9xsxhr1x3b"))))
718 (build-system python-build-system)
719 (native-inputs
720 `(("python-nose" ,python-nose)))
721 (home-page "https://github.com/python-lz4/python-lz4")
722 (synopsis "LZ4 Bindings for Python")
723 (description
724 "This package provides python bindings for the lz4 compression library
725 by Yann Collet. The project contains bindings for the LZ4 block format and
726 the LZ4 frame format.")
727 (license license:bsd-3)))
728
729 (define-public python2-lz4
730 (package-with-python2 python-lz4))
731
732 (define-public squashfs-tools
733 (package
734 (name "squashfs-tools")
735 (version "4.3")
736 (source (origin
737 (method url-fetch)
738 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
739 "squashfs" version "/"
740 "squashfs" version ".tar.gz"))
741 (sha256
742 (base32
743 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
744 (build-system gnu-build-system)
745 (arguments
746 '(#:tests? #f ; no check target
747 #:make-flags
748 (list "CC=gcc"
749 "XZ_SUPPORT=1"
750 "LZO_SUPPORT=1"
751 "LZ4_SUPPORT=1"
752 (string-append "INSTALL_DIR=" %output "/bin"))
753 #:phases
754 (modify-phases %standard-phases
755 (replace 'configure
756 (lambda _
757 (chdir "squashfs-tools"))))))
758 (inputs
759 `(("lz4" ,lz4)
760 ("lzo" ,lzo)
761 ("xz" ,xz)
762 ("zlib" ,zlib)))
763 (home-page "http://squashfs.sourceforge.net/")
764 (synopsis "Tools to create and extract squashfs file systems")
765 (description
766 "Squashfs is a highly compressed read-only file system for Linux. It uses
767 zlib to compress files, inodes, and directories. All blocks are packed to
768 minimize the data overhead, and block sizes of between 4K and 1M are supported.
769 It is intended to be used for archival use, for live CDs, and for embedded
770 systems where low overhead is needed. This package allows you to create and
771 extract such file systems.")
772 (license license:gpl2+)))
773
774 (define-public pigz
775 (package
776 (name "pigz")
777 (version "2.3.3")
778 (source (origin
779 (method url-fetch)
780 (uri (string-append "http://zlib.net/pigz/"
781 name "-" version ".tar.gz"))
782 (sha256
783 (base32
784 "172hdf26k4zmm7z8md7nl0dph2a7mhf3x7slb9bhfyff6as6g2sf"))))
785 (build-system gnu-build-system)
786 (arguments
787 `(#:phases
788 (modify-phases %standard-phases
789 (delete 'configure)
790 (replace 'install
791 (lambda* (#:key outputs #:allow-other-keys)
792 (let* ((out (assoc-ref outputs "out"))
793 (bin (string-append out "/bin"))
794 (man (string-append out "/share/man/man1")))
795 (install-file "pigz" bin)
796 (symlink "pigz" (string-append bin "/unpigz"))
797 (install-file "pigz.1" man)
798 #t))))
799 #:make-flags (list "CC=gcc")
800 #:test-target "tests"))
801 (inputs `(("zlib" ,zlib)))
802 (home-page "http://zlib.net/pigz/")
803 (synopsis "Parallel implementation of gzip")
804 (description
805 "This package provides a parallel implementation of gzip that exploits
806 multiple processors and multiple cores when compressing data.")
807
808 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
809 ;; written by Mark Adler, are under another non-copyleft license.
810 (license license:asl2.0)))
811
812 (define-public pixz
813 (package
814 (name "pixz")
815 (version "1.0.6")
816 (source (origin
817 (method url-fetch)
818 (uri (string-append
819 "https://github.com/vasi/pixz/releases/download/v" version
820 "/pixz-" version ".tar.xz"))
821 (sha256
822 (base32
823 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
824 (build-system gnu-build-system)
825 (native-inputs
826 `(("pkg-config" ,pkg-config)
827 ("libarchive" ,libarchive)))
828 (home-page "https://github.com/vasi/pixz")
829 (synopsis "Parallel indexing implementation of LZMA")
830 (description
831 "The existing XZ Utils provide great compression in the .xz file format,
832 but they produce just one big block of compressed data. Pixz instead produces
833 a collection of smaller blocks which makes random access to the original data
834 possible and can compress in parallel. This is especially useful for large
835 tarballs.")
836 (license license:bsd-2)))
837
838 (define-public brotli
839 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
840 (revision "1"))
841 (package
842 (name "brotli")
843 (version (string-append "0.1-" revision "."
844 (string-take commit 7)))
845 (source (origin
846 (method git-fetch)
847 (uri (git-reference
848 (url "https://github.com/bagder/libbrotli.git")
849 (commit commit)
850 (recursive? #t)))
851 (file-name (string-append name "-" version ".tar.xz"))
852 (sha256
853 (base32
854 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
855 (modules '((guix build utils)))
856 (snippet
857 ;; This is a recursive submodule that is unnecessary for this
858 ;; package, so delete it.
859 '(delete-file-recursively "brotli/terryfy"))))
860 (build-system gnu-build-system)
861 (native-inputs
862 `(("autoconf" ,autoconf)
863 ("automake" ,automake)
864 ("libtool" ,libtool)))
865 (arguments
866 `(#:phases (modify-phases %standard-phases
867 (add-after 'unpack 'autogen
868 (lambda _
869 (mkdir "m4")
870 (zero? (system* "autoreconf" "-vfi")))))))
871 (home-page "https://github.com/bagder/libbrotli/")
872 (synopsis "Implementation of the Brotli compression algorithm")
873 (description
874 "Brotli is a general-purpose lossless compression algorithm. It is
875 similar in speed to deflate but offers denser compression. This package
876 provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
877 respectively, based on the reference implementation from Google.")
878 (license license:expat))))
879
880 (define-public cabextract
881 (package
882 (name "cabextract")
883 (version "1.6")
884 (source (origin
885 (method url-fetch)
886 (uri (string-append
887 "http://cabextract.org.uk/cabextract-" version ".tar.gz"))
888 (sha256
889 (base32
890 "1ysmmz25fjghq7mxb2anyyvr1ljxqxzi4piwjhk0sdamcnsn3rnf"))))
891 (build-system gnu-build-system)
892 (arguments '(#:configure-flags '("--with-external-libmspack")))
893 (native-inputs
894 `(("pkg-config" ,pkg-config)))
895 (inputs
896 `(("libmspack" ,libmspack)))
897 (home-page "http://www.cabextract.org.uk/")
898 (synopsis "Tool to unpack Cabinet archives")
899 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
900 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
901 (license license:gpl3+)))
902
903 (define-public xdelta
904 (package
905 (name "xdelta")
906 (version "3.1.0")
907 (source
908 (origin
909 (method url-fetch)
910 (uri (string-append "https://github.com/jmacd/xdelta/archive/v"
911 version ".tar.gz"))
912 (sha256
913 (base32
914 "17g2pbbqy6h20qgdjq7ykib7kg5ajh8fwbsfgyjqg8pwg19wy5bm"))
915 (file-name (string-append name "-" version ".tar.gz"))
916 (snippet
917 ;; This file isn't freely distributable and has no effect on building.
918 '(delete-file "xdelta3/draft-korn-vcdiff.txt"))))
919 (build-system gnu-build-system)
920 (native-inputs
921 `(("autoconf" ,autoconf)
922 ("automake" ,automake)))
923 (arguments
924 `(#:phases
925 (modify-phases %standard-phases
926 (add-after 'unpack 'enter-build-directory
927 (lambda _ (chdir "xdelta3")))
928 (add-before 'configure 'autoconf
929 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
930 (home-page "http://xdelta.com")
931 (synopsis "Delta encoder for binary files")
932 (description "xdelta encodes only the differences between two binary files
933 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
934 also be used to apply such patches. xdelta is similar to @command{diff} and
935 @command{patch}, but is not limited to plain text and does not generate
936 human-readable output.")
937 (license license:asl2.0)))
938
939 (define-public lrzip
940 (package
941 (name "lrzip")
942 (version "0.631")
943 (source
944 (origin
945 (method url-fetch)
946 (uri (string-append
947 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
948 (sha256
949 (base32
950 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))))
951 (build-system gnu-build-system)
952 (native-inputs
953 `(;; nasm is only required when building for 32-bit x86 platforms
954 ,@(if (string-prefix? "i686" (or (%current-target-system)
955 (%current-system)))
956 `(("nasm" ,nasm))
957 '())
958 ("perl" ,perl)))
959 (inputs
960 `(("bzip2" ,bzip2)
961 ("lzo" ,lzo)
962 ("zlib" ,zlib)))
963 (home-page "http://ck.kolivas.org/apps/lrzip/")
964 (synopsis "Large file compressor with a very high compression ratio")
965 (description "lrzip is a compression utility that uses long-range
966 redundancy reduction to improve the subsequent compression ratio of
967 larger files. It can then further compress the result with the ZPAQ or
968 LZMA algorithms for maximum compression, or LZO for maximum speed. This
969 choice between size or speed allows for either better compression than
970 even LZMA can provide, or a higher speed than gzip while compressing as
971 well as bzip2.")
972 (license (list license:gpl3+
973 license:public-domain)))) ; most files in lzma/
974
975 (define-public snappy
976 (package
977 (name "snappy")
978 (version "1.1.3")
979 (source (origin
980 (method url-fetch)
981 (uri (string-append
982 "https://github.com/google/snappy/releases/download/"
983 version "/" name "-" version ".tar.gz"))
984 (sha256
985 (base32
986 "1wzf8yif5ym2gj52db6v5m1pxnmn258i38x7llk9x346y2nq47ig"))))
987 (build-system gnu-build-system)
988 (home-page "https://github.com/google/snappy")
989 (synopsis "Fast compressor/decompressor")
990 (description "Snappy is a compression/decompression library. It does not
991 aim for maximum compression, or compatibility with any other compression library;
992 instead, it aims for very high speeds and reasonable compression. For instance,
993 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
994 for most inputs, but the resulting compressed files are anywhere from 20% to
995 100% bigger.")
996 (license license:asl2.0)))
997
998 (define-public p7zip
999 (package
1000 (name "p7zip")
1001 (version "16.02")
1002 (source (origin
1003 (method url-fetch)
1004 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1005 version "/" name "_" version
1006 "_src_all.tar.bz2"))
1007 (sha256
1008 (base32
1009 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1010 (modules '((guix build utils)))
1011 (snippet
1012 '(begin
1013 ;; Remove non-free source files
1014 (for-each delete-file
1015 (append
1016 (find-files "CPP/7zip/Compress" "Rar.*")
1017 (find-files "CPP/7zip/Crypto" "Rar.*")
1018 (find-files "DOC/unRarLicense.txt")
1019 (find-files "Utils/file_Codecs_Rar_so.py")))
1020 (delete-file-recursively "CPP/7zip/Archive/Rar")
1021 (delete-file-recursively "CPP/7zip/Compress/Rar")
1022 #t))
1023 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1024 "p7zip-remove-unused-code.patch"))))
1025 (build-system gnu-build-system)
1026 (arguments
1027 `(#:make-flags
1028 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1029 #:phases
1030 (modify-phases %standard-phases
1031 (replace 'configure
1032 (lambda* (#:key system outputs #:allow-other-keys)
1033 (zero? (system* "cp"
1034 (let ((system ,(or (%current-target-system)
1035 (%current-system))))
1036 (cond
1037 ((string-prefix? "x86_64" system)
1038 "makefile.linux_amd64_asm")
1039 ((string-prefix? "i686" system)
1040 "makefile.linux_x86_asm_gcc_4.X")
1041 (else
1042 "makefile.linux_any_cpu_gcc_4.X")))
1043 "makefile.machine"))))
1044 (replace 'check
1045 (lambda _
1046 (and (zero? (system* "make" "test"))
1047 (zero? (system* "make" "test_7z"))
1048 (zero? (system* "make" "test_7zr"))))))))
1049 (inputs
1050 (let ((system (or (%current-target-system)
1051 (%current-system))))
1052 `(,@(cond ((string-prefix? "x86_64" system)
1053 `(("yasm" ,yasm)))
1054 ((string-prefix? "i686" system)
1055 `(("nasm" ,nasm)))
1056 (else '())))))
1057 (home-page "http://p7zip.sourceforge.net/")
1058 (synopsis "Command-line file archiver with high compression ratio")
1059 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1060 handles the 7z format which features very high compression ratios.")
1061 (license (list license:lgpl2.1+
1062 license:gpl2+
1063 license:public-domain))))
1064
1065 (define-public gzstream
1066 (package
1067 (name "gzstream")
1068 (version "1.5")
1069 (source (origin
1070 (method url-fetch)
1071 (uri
1072 ;; No versioned URL, but last release was in 2003.
1073 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1074 (file-name (string-append name "-" version ".tgz"))
1075 (sha256
1076 (base32
1077 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1078 (modules '((guix build utils)))
1079 (snippet
1080 ;; Remove pre-compiled object.
1081 '(delete-file "gzstream.o"))))
1082 (build-system gnu-build-system)
1083 (arguments
1084 `(#:test-target "test"
1085 #:phases
1086 (modify-phases %standard-phases
1087 (delete 'configure)
1088 (replace 'install
1089 (lambda* (#:key outputs #:allow-other-keys)
1090 (let* ((out (assoc-ref outputs "out"))
1091 (lib (string-append out "/lib"))
1092 (include (string-append out "/include")))
1093 (install-file "libgzstream.a" lib)
1094 (install-file "gzstream.h" include)
1095 #t))))))
1096 (propagated-inputs `(("zlib" ,zlib)))
1097 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1098 (synopsis "Compressed C++ iostream")
1099 (description "gzstream is a small library for providing zlib
1100 functionality in a C++ iostream.")
1101 (license license:lgpl2.1+)))
1102
1103 (define-public zpaq
1104 (package
1105 (name "zpaq")
1106 (version "7.15")
1107 (source
1108 (origin
1109 (method url-fetch/zipbomb)
1110 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1111 (string-delete #\. version) ".zip"))
1112 (sha256
1113 (base32
1114 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1115 (modules '((guix build utils)))
1116 (snippet
1117 ;; Delete irrelevant pre-compiled binaries.
1118 '(for-each delete-file (find-files "." "\\.exe$")))))
1119 (build-system gnu-build-system)
1120 (arguments
1121 `(#:phases
1122 (modify-phases %standard-phases
1123 (delete 'configure)) ; no ‘configure’ script
1124 #:make-flags
1125 (list
1126 (string-append "CPPFLAGS=-Dunix"
1127 ,(match (or (%current-target-system)
1128 (%current-system))
1129 ("x86_64-linux" "")
1130 ("i686-linux" "")
1131 (_ " -DNOJIT")))
1132 ;; These should be safe, lowest-common-denominator instruction sets,
1133 ;; allowing for some optimisation while remaining reproducible.
1134 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1135 ,(match (or (%current-target-system)
1136 (%current-system))
1137 ("x86_64-linux" " -march=nocona -mtune=generic")
1138 ("i686-linux" " -march=i686 -mtune=generic")
1139 ("armhf-linux" " -mtune=generic-armv7-a")
1140 (_ "")))
1141 (string-append "PREFIX="
1142 (assoc-ref %outputs "out")))))
1143 (native-inputs
1144 `(("perl" ,perl))) ; for pod2man
1145 (home-page "http://mattmahoney.net/dc/zpaq.html")
1146 (synopsis "Incremental journaling archiver")
1147 (description "ZPAQ is a command-line archiver for realistic situations with
1148 many duplicate and already compressed files. It backs up only those files
1149 modified since the last update. All previous versions remain untouched and can
1150 be independently recovered. Identical files are only stored once (known as
1151 @dfn{de-duplication}). Archives can also be encrypted.
1152
1153 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1154 owner and group IDs, ACLs, extended attributes, or special file types like
1155 devices, sockets, or named pipes. It does not follow or restore symbolic links
1156 or junctions, and always follows hard links.")
1157 (license (list license:public-domain
1158 ;; libzpaq.cpp contains a mix of public-domain and
1159 ;; expat-licenced (or ‘MIT’) code.
1160 license:expat))))
1161
1162 (define-public unrar
1163 (package
1164 (name "unrar")
1165 (version "0.0.1")
1166 (source (origin
1167 (method url-fetch)
1168 (uri (string-append
1169 "http://download.gna.org/unrar/unrar-" version ".tar.gz"))
1170 (sha256
1171 (base32
1172 "1fgmjaxffj3shyxgy765jhxwz1cq88hk0fih1bsdzyvymyyz6mz7"))))
1173 (build-system gnu-build-system)
1174 (home-page "http://download.gna.org/unrar")
1175 (synopsis "RAR archive extraction tool")
1176 (description "Unrar is a simple command-line program to list and extract
1177 RAR archives.")
1178 (license license:gpl2+)))
1179
1180 (define-public zstd
1181 (package
1182 (name "zstd")
1183 (version "1.1.4")
1184 (source (origin
1185 (method url-fetch)
1186 (uri (string-append "https://github.com/facebook/zstd/archive/v"
1187 version ".tar.gz"))
1188 (file-name (string-append name "-" version ".tar.gz"))
1189 (sha256
1190 (base32
1191 "1yxr1y83gphljxaqhwvxbldy1ivx81x93rngiv5l94rmdrc2pbka"))
1192 (modules '((guix build utils)))
1193 (snippet
1194 ;; Remove non-free source files.
1195 '(begin
1196 (for-each delete-file-recursively
1197 (list
1198 ;; Commercial use of the following is not allowed.
1199 "examples"
1200 "LICENSE-examples"))
1201 #t))))
1202 (build-system gnu-build-system)
1203 (arguments
1204 `(#:phases
1205 (modify-phases %standard-phases
1206 (delete 'configure)) ; no configure script
1207 #:make-flags
1208 (list "CC=gcc"
1209 (string-append "PREFIX=" (assoc-ref %outputs "out")))
1210 #:test-target "test"))
1211 (home-page "http://zstd.net/")
1212 (synopsis "Zstandard real-time compression algorithm")
1213 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1214 that combines very fast operation with a compression ratio comparable to that of
1215 zlib. In most scenarios, both compression and decompression can be performed in
1216 ‘real time’. The compressor can be configured to provide the most suitable
1217 trade-off between compression ratio and speed, without affecting decompression
1218 speed.")
1219 (license (list license:bsd-3 ; the main top-level LICENSE file
1220 license:bsd-2 ; quite a few files have but 2 clauses
1221 license:public-domain ; zlibWrapper/examples/fitblk*
1222 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1223
1224 (define-public pzstd
1225 (package
1226 (name "pzstd")
1227 (version (package-version zstd))
1228 (source (package-source zstd))
1229 (build-system gnu-build-system)
1230 (native-inputs
1231 `(("googletest", googletest)))
1232 (arguments
1233 `(#:phases
1234 (modify-phases %standard-phases
1235 (add-after 'unpack 'enter-subdirectory
1236 (lambda _ (chdir "contrib/pzstd")))
1237 (delete 'configure) ; no configure script
1238 (add-before 'check 'compile-tests
1239 (lambda* (#:key make-flags #:allow-other-keys)
1240 (zero? (apply system* "make" "tests" make-flags))))
1241 (add-after 'install 'install-documentation
1242 (lambda* (#:key outputs #:allow-other-keys)
1243 (let* ((out (assoc-ref outputs "out"))
1244 (doc (string-append out "/share/doc/" ,name)))
1245 (mkdir-p doc)
1246 (install-file "README.md" doc)
1247 #t))))
1248 #:make-flags
1249 (list "CC=gcc"
1250 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1251 (home-page (package-home-page zstd))
1252 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1253 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1254 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1255 compression algorithm}. It is fully compatible with the original Zstandard file
1256 format and command-line interface, and can be used as a drop-in replacement.
1257
1258 Compression is distributed over multiple processor cores to improve performance,
1259 as is the decompression of data compressed in this manner. Data compressed by
1260 other implementations will only be decompressed by two threads: one performing
1261 the actual decompression, the other input and output.")
1262 (license (package-license zstd))))