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