gnu: Add teensy-loader-cli.
[jackhill/guix/guix.git] / gnu / packages / compression.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 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 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 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
12 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages compression)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix utils)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix git-download)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system perl)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages backup)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages valgrind)
44 #:use-module ((srfi srfi-1) #:select (last)))
45
46 (define-public zlib
47 (package
48 (name "zlib")
49 (version "1.2.8")
50 (source
51 (origin
52 (method url-fetch)
53 (uri (list (string-append "http://zlib.net/zlib-"
54 version ".tar.gz")
55 (string-append "mirror://sourceforge/libpng/zlib-"
56 version ".tar.gz")))
57 (sha256
58 (base32
59 "039agw5rqvqny92cpkrfn243x2gd4xn13hs3xi6isk55d2vqqr9n"))))
60 (build-system gnu-build-system)
61 (arguments
62 `(#:phases (alist-replace
63 'configure
64 (lambda* (#:key outputs #:allow-other-keys)
65 ;; Zlib's home-made `configure' fails when passed
66 ;; extra flags like `--enable-fast-install', so we need to
67 ;; invoke it with just what it understand.
68 (let ((out (assoc-ref outputs "out")))
69 ;; 'configure' doesn't understand '--host'.
70 ,@(if (%current-target-system)
71 `((setenv "CHOST" ,(%current-target-system)))
72 '())
73 (zero?
74 (system* "./configure"
75 (string-append "--prefix=" out)))))
76 %standard-phases)))
77 (home-page "http://zlib.net/")
78 (synopsis "Compression library")
79 (description
80 "zlib is designed to be a free, general-purpose, legally unencumbered --
81 that is, not covered by any patents -- lossless data-compression library for
82 use on virtually any computer hardware and operating system. The zlib data
83 format is itself portable across platforms. Unlike the LZW compression method
84 used in Unix compress(1) and in the GIF image format, the compression method
85 currently used in zlib essentially never expands the data. (LZW can double or
86 triple the file size in extreme cases.) zlib's memory footprint is also
87 independent of the input data and can be reduced, if necessary, at some cost
88 in compression.")
89 (license license:zlib)))
90
91 (define-public fastjar
92 (package
93 (name "fastjar")
94 (version "0.98")
95 (source (origin
96 (method url-fetch)
97 (uri (string-append "mirror://savannah/fastjar/fastjar-"
98 version ".tar.gz"))
99 (sha256
100 (base32
101 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
102 (build-system gnu-build-system)
103 (inputs `(("zlib" ,zlib)))
104 (home-page "http://savannah.nongnu.org/projects/fastjar")
105 (synopsis "Replacement for Sun's 'jar' utility")
106 (description
107 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
108 utility. Instead of being written in Java, FastJar is written in C.")
109 (license license:gpl2+)))
110
111 (define-public libtar
112 (package
113 (name "libtar")
114 (version "1.2.20")
115 (source (origin
116 (method url-fetch)
117 (uri (list
118 (string-append
119 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
120 version ".tar.gz")
121 (string-append
122 "mirror://debian/pool/main/libt/libtar/libtar_"
123 version ".orig.tar.gz")))
124 (sha256
125 (base32
126 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
127 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
128 (build-system gnu-build-system)
129 (arguments
130 `(#:tests? #f ;no "check" target
131 #:phases
132 (modify-phases %standard-phases
133 (add-after 'unpack 'autoconf
134 (lambda _ (zero? (system* "sh" "autoreconf" "-vfi")))))))
135 (native-inputs
136 `(("autoconf" ,autoconf)
137 ("automake" ,automake)
138 ("libtool" ,libtool)))
139 (inputs
140 `(("zlib" ,zlib)))
141 (synopsis "C library for manipulating POSIX tar files")
142 (description
143 "libtar is a C library for manipulating POSIX tar files. It handles
144 adding and extracting files to/from a tar archive.")
145 (home-page "https://repo.or.cz/libtar.git")
146 (license license:bsd-3)))
147
148 (define-public gzip
149 (package
150 (name "gzip")
151 (version "1.6")
152 (source (origin
153 (method url-fetch)
154 (uri (string-append "mirror://gnu/gzip/gzip-"
155 version ".tar.gz"))
156 (sha256
157 (base32
158 "0zlgdm4v3dndrbiz7b67mbbj25dpwqbmbzjiycssvrfrcfvq7swp"))))
159 (build-system gnu-build-system)
160 (synopsis "General file (de)compression (using lzw)")
161 (arguments
162 ;; FIXME: The test suite wants `less', and optionally Perl.
163 '(#:tests? #f))
164 (description
165 "GNU Gzip provides data compression and decompression utilities; the
166 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
167 file; as a result, it is often used in conjunction with \"tar\", resulting in
168 \".tar.gz\" or \".tgz\", etc.")
169 (license license:gpl3+)
170 (home-page "http://www.gnu.org/software/gzip/")))
171
172 (define-public bzip2
173 (let ((build-shared-lib
174 ;; Build a shared library.
175 '(lambda* (#:key inputs #:allow-other-keys)
176 (patch-makefile-SHELL "Makefile-libbz2_so")
177 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
178 (install-shared-lib
179 '(lambda* (#:key outputs #:allow-other-keys)
180 (let* ((out (assoc-ref outputs "out"))
181 (libdir (string-append out "/lib")))
182 (for-each (lambda (file)
183 (let ((base (basename file)))
184 (format #t "installing `~a' to `~a'~%"
185 base libdir)
186 (copy-file file
187 (string-append libdir "/" base))))
188 (find-files "." "^libbz2\\.so")))))
189 (set-cross-environment
190 '(lambda* (#:key target #:allow-other-keys)
191 (substitute* (find-files "." "Makefile")
192 (("CC=.*$")
193 (string-append "CC = " target "-gcc\n"))
194 (("AR=.*$")
195 (string-append "AR = " target "-ar\n"))
196 (("RANLIB=.*$")
197 (string-append "RANLIB = " target "-ranlib\n"))
198 (("^all:(.*)test" _ prerequisites)
199 ;; Remove 'all' -> 'test' dependency.
200 (string-append "all:" prerequisites "\n"))))))
201 (package
202 (name "bzip2")
203 (version "1.0.6")
204 (source (origin
205 (method url-fetch)
206 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
207 version ".tar.gz"))
208 (sha256
209 (base32
210 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
211 (build-system gnu-build-system)
212 (arguments
213 `(#:modules ((guix build gnu-build-system)
214 (guix build utils)
215 (srfi srfi-1))
216 #:phases
217 ,(if (%current-target-system)
218
219 ;; Cross-compilation: use the cross tools.
220 `(alist-cons-before
221 'build 'build-shared-lib ,build-shared-lib
222 (alist-cons-after
223 'install 'install-shared-lib ,install-shared-lib
224 (alist-replace 'configure ,set-cross-environment
225 %standard-phases)))
226
227 ;; Native compilation: build the shared library.
228 `(alist-cons-before
229 'build 'build-shared-lib ,build-shared-lib
230 (alist-cons-after
231 'install 'install-shared-lib ,install-shared-lib
232 (alist-delete 'configure %standard-phases))))
233
234 #:make-flags (list (string-append "PREFIX="
235 (assoc-ref %outputs "out")))
236
237 ;; Don't attempt to run the tests when cross-compiling.
238 ,@(if (%current-target-system)
239 '(#:tests? #f)
240 '())))
241 (synopsis "High-quality data compression program")
242 (description
243 "bzip2 is a freely available, patent free (see below), high-quality data
244 compressor. It typically compresses files to within 10% to 15% of the best
245 available techniques (the PPM family of statistical compressors), whilst
246 being around twice as fast at compression and six times faster at
247 decompression.")
248 (license (license:non-copyleft "file://LICENSE"
249 "See LICENSE in the distribution."))
250 (home-page "http://www.bzip.org/"))))
251
252 (define-public pbzip2
253 (package
254 (name "pbzip2")
255 (version "1.1.12")
256 (source (origin
257 (method url-fetch)
258 (uri (string-append "https://launchpad.net/pbzip2/"
259 (version-major+minor version) "/" version
260 "/+download/" name "-" version ".tar.gz"))
261 (sha256
262 (base32
263 "1vk6065dv3a47p86vmp8hv3n1ygd9hraz0gq89gvzlx7lmcb6fsp"))))
264 (build-system gnu-build-system)
265 (inputs
266 `(("bzip2" ,bzip2)))
267 (arguments
268 `(#:tests? #f ; no tests
269 #:phases (modify-phases %standard-phases
270 (delete 'configure))
271 #:make-flags (list (string-append "PREFIX=" %output))))
272 (home-page "http://compression.ca/pbzip2/")
273 (synopsis "Parallel bzip2 implementation")
274 (description
275 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
276 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
277 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
278 compressed with pbzip2 can be decompressed with bzip2).")
279 (license (license:non-copyleft "file://COPYING"
280 "See COPYING in the distribution."))))
281
282 (define-public xz
283 (package
284 (name "xz")
285 (version "5.2.2")
286 (source (origin
287 (method url-fetch)
288 (uri (list (string-append "http://tukaani.org/xz/xz-" version
289 ".tar.gz")
290 (string-append "http://multiprecision.org/guix/xz-"
291 version ".tar.gz")))
292 (sha256
293 (base32
294 "18h2k4jndhzjs8ln3a54qdnfv59y6spxiwh9gpaqniph6iflvpvk"))))
295 (build-system gnu-build-system)
296 (synopsis "General-purpose data compression")
297 (description
298 "XZ Utils is free general-purpose data compression software with high
299 compression ratio. XZ Utils were written for POSIX-like systems, but also
300 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
301
302 The core of the XZ Utils compression code is based on LZMA SDK, but it has
303 been modified quite a lot to be suitable for XZ Utils. The primary
304 compression algorithm is currently LZMA2, which is used inside the .xz
305 container format. With typical files, XZ Utils create 30 % smaller output
306 than gzip and 15 % smaller output than bzip2.")
307 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
308 (home-page "http://tukaani.org/xz/")))
309
310 (define-public lzo
311 (package
312 (name "lzo")
313 (version "2.09")
314 (source
315 (origin
316 (method url-fetch)
317 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
318 version ".tar.gz"))
319 (sha256
320 (base32
321 "0k5kpj3jnsjfxqqkblpfpx0mqcy86zs5fhjhgh2kq1hksg7ag57j"))))
322 (build-system gnu-build-system)
323 (arguments '(#:configure-flags '("--enable-shared")))
324 (home-page "http://www.oberhumer.com/opensource/lzo")
325 (synopsis
326 "Data compression library suitable for real-time data de-/compression")
327 (description
328 "LZO is a data compression library which is suitable for data
329 de-/compression in real-time. This means it favours speed over
330 compression ratio.
331
332 LZO is written in ANSI C. Both the source code and the compressed data
333 format are designed to be portable across platforms.")
334 (license license:gpl2+)))
335
336 (define-public lzop
337 (package
338 (name "lzop")
339 (version "1.03")
340 (source
341 (origin
342 (method url-fetch)
343 (uri (string-append "http://www.lzop.org/download/lzop-"
344 version ".tar.gz"))
345 (sha256
346 (base32
347 "1jdjvc4yjndf7ihmlcsyln2rbnbaxa86q4jskmkmm7ylfy65nhn1"))))
348 (build-system gnu-build-system)
349 (inputs `(("lzo" ,lzo)))
350 (home-page "http://www.lzop.org/")
351 (synopsis "Compress or expand files")
352 (description
353 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
354 LZO data compression library for compression services, and its main advantages
355 over gzip are much higher compression and decompression speed (at the cost of
356 some compression ratio).")
357 (license license:gpl2+)))
358
359 (define-public lzip
360 (package
361 (name "lzip")
362 (version "1.16")
363 (source (origin
364 (method url-fetch)
365 (uri (string-append "mirror://savannah/lzip/lzip-"
366 version ".tar.gz"))
367 (sha256
368 (base32
369 "0l9724rw1l3hg2ldr3n7ihqich4m9nc6y7l302bvdj4jmxdw530j"))))
370 (build-system gnu-build-system)
371 (home-page "http://www.nongnu.org/lzip/lzip.html")
372 (synopsis "Lossless data compressor based on the LZMA algorithm")
373 (description
374 "Lzip is a lossless data compressor with a user interface similar to the
375 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
376 more than bzip2, which makes it well suited for software distribution and data
377 archiving. Lzip is a clean implementation of the LZMA algorithm.")
378 (license license:gpl3+)))
379
380 (define-public sharutils
381 (package
382 (name "sharutils")
383 (version "4.15.2")
384 (source
385 (origin
386 (method url-fetch)
387 (uri (string-append "mirror://gnu/sharutils/sharutils-"
388 version ".tar.xz"))
389 (sha256
390 (base32
391 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))))
392 (build-system gnu-build-system)
393 (inputs
394 `(("which" ,which)))
395 (arguments
396 `(#:phases
397 (alist-cons-after
398 'patch-source-shebangs 'unpatch-source-shebang
399 ;; revert the patch-shebang phase on a script which is
400 ;; in fact test data
401 (lambda _
402 (substitute* "tests/shar-1.ok"
403 (((which "sh")) "/bin/sh")))
404 %standard-phases)))
405 (home-page "http://www.gnu.org/software/sharutils/")
406 (synopsis "Archives in shell scripts, uuencode/uudecode")
407 (description
408 "GNU sharutils is a package for creating and manipulating shell
409 archives that can be readily emailed. A shell archive is a file that can be
410 processed by a Bourne-type shell to unpack the original collection of files.
411 This package is mostly for compatibility and historical interest.")
412 (license license:gpl3+)))
413
414 (define-public sfarklib
415 (package
416 (name "sfarklib")
417 (version "2.24")
418 (source (origin
419 (method url-fetch)
420 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
421 version ".tar.gz"))
422 (file-name (string-append name "-" version ".tar.gz"))
423 (sha256
424 (base32
425 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
426 (build-system gnu-build-system)
427 (arguments
428 `(#:tests? #f ;no "check" target
429 #:phases
430 (modify-phases %standard-phases
431 (replace 'configure
432 (lambda* (#:key outputs #:allow-other-keys)
433 (substitute* "Makefile"
434 (("/usr/local") (assoc-ref outputs "out")))
435 #t)))))
436 (inputs
437 `(("zlib" ,zlib)))
438 (home-page "https://github.com/raboof/sfArkLib")
439 (synopsis "Library for SoundFont decompression")
440 (description
441 "SfArkLib is a C++ library for decompressing SoundFont files compressed
442 with the sfArk algorithm.")
443 (license license:gpl3+)))
444
445 (define-public sfarkxtc
446 (let ((commit "b5e0a2ba3921f019d74d4b92bd31c36dd19d2cf1"))
447 (package
448 (name "sfarkxtc")
449 (version (string-take commit 10))
450 (source (origin
451 ;; There are no release tarballs, so we just fetch the latest
452 ;; commit at this time.
453 (method git-fetch)
454 (uri (git-reference
455 (url "https://github.com/raboof/sfarkxtc.git")
456 (commit commit)))
457 (sha256
458 (base32
459 "0f5x6i46qfl6ry21s7g2p4sd4b2r1g4fb03yqi2vv4kq3saryhvj"))))
460 (build-system gnu-build-system)
461 (arguments
462 `(#:tests? #f ;no "check" target
463 #:phases
464 (modify-phases %standard-phases
465 (replace 'configure
466 (lambda* (#:key outputs #:allow-other-keys)
467 (substitute* "Makefile"
468 (("/usr/local") (assoc-ref outputs "out")))
469 #t)))))
470 (inputs
471 `(("zlib" ,zlib)
472 ("sfarklib" ,sfarklib)))
473 (home-page "https://github.com/raboof/sfarkxtc")
474 (synopsis "Basic sfArk decompressor")
475 (description "SfArk extractor converts SoundFonts in the compressed legacy
476 sfArk file format to the uncompressed sf2 format.")
477 (license license:gpl3+))))
478
479 (define-public libmspack
480 (package
481 (name "libmspack")
482 (version "0.5")
483 (source
484 (origin
485 (method url-fetch)
486 (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
487 version "alpha.tar.gz"))
488 (sha256
489 (base32 "04413hynb7zizxnkgy9riik3612dwirkpr6fcjrnfl2za9sz4rw9"))))
490 (build-system gnu-build-system)
491 (home-page "http://www.cabextract.org.uk/libmspack/")
492 (synopsis "Compression tools for some formats used by Microsoft")
493 (description
494 "The purpose of libmspack is to provide both compression and
495 decompression of some loosely related file formats used by Microsoft.")
496 (license license:lgpl2.1+)))
497
498 (define-public perl-compress-raw-bzip2
499 (package
500 (name "perl-compress-raw-bzip2")
501 (version "2.068")
502 (source
503 (origin
504 (method url-fetch)
505 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
506 "Compress-Raw-Bzip2-" version ".tar.gz"))
507 (sha256
508 (base32
509 "16hl58xppckldz05zdyid1l5gpaykzwvkq682h3rc3nilbhgjqqg"))))
510 (build-system perl-build-system)
511 ;; TODO: Use our bzip2 package.
512 (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
513 (synopsis "Low-level interface to bzip2 compression library")
514 (description "This module provides a Perl interface to the bzip2
515 compression library.")
516 (license (package-license perl))))
517
518 (define-public perl-compress-raw-zlib
519 (package
520 (name "perl-compress-raw-zlib")
521 (version "2.068")
522 (source
523 (origin
524 (method url-fetch)
525 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
526 "Compress-Raw-Zlib-" version ".tar.gz"))
527 (sha256
528 (base32
529 "06q7n87g26nn5gv4z2p31ca32f6zk124hqxc25rfgkjd3qi5798i"))))
530 (build-system perl-build-system)
531 (inputs
532 `(("zlib" ,zlib)))
533 (arguments
534 `(#:phases (modify-phases %standard-phases
535 (add-before
536 'configure 'configure-zlib
537 (lambda* (#:key inputs #:allow-other-keys)
538 (call-with-output-file "config.in"
539 (lambda (port)
540 (format port "
541 BUILD_ZLIB = False
542 INCLUDE = ~a/include
543 LIB = ~:*~a/lib
544 OLD_ZLIB = False
545 GZIP_OS_CODE = AUTO_DETECT"
546 (assoc-ref inputs "zlib")))))))))
547 (home-page "http://search.cpan.org/dist/Compress-Raw-Zlib")
548 (synopsis "Low-level interface to zlib compression library")
549 (description "This module provides a Perl interface to the zlib
550 compression library.")
551 (license (package-license perl))))
552
553 (define-public perl-io-compress
554 (package
555 (name "perl-io-compress")
556 (version "2.068")
557 (source
558 (origin
559 (method url-fetch)
560 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
561 "IO-Compress-" version ".tar.gz"))
562 (sha256
563 (base32
564 "0dy0apjp7j9dfkzfjspjd3z9gh26srx5vac72g59bkkz1jf8s1gs"))))
565 (build-system perl-build-system)
566 (propagated-inputs
567 `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib) ; >=2.068
568 ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.068
569 (home-page "http://search.cpan.org/dist/IO-Compress")
570 (synopsis "IO Interface to compressed files/buffers")
571 (description "IO-Compress provides a Perl interface to allow reading and
572 writing of compressed data created with the zlib and bzip2 libraries.")
573 (license (package-license perl))))
574
575 (define-public lz4
576 (package
577 (name "lz4")
578 (version "131")
579 (source
580 (origin
581 (method url-fetch)
582 (uri (string-append "https://github.com/Cyan4973/lz4/archive/"
583 "r" version ".tar.gz"))
584 (sha256
585 (base32 "1vfg305zvj50hwscad24wan9jar6nqj14gdk2hqyr7bb9mhh0kcx"))
586 (file-name (string-append name "-" version ".tar.gz"))))
587 (build-system gnu-build-system)
588 (native-inputs `(("valgrind" ,valgrind)))
589 (arguments
590 `(#:test-target "test"
591 #:parallel-tests? #f ; tests fail if run in parallel
592 #:make-flags (list "CC=gcc"
593 (string-append "PREFIX=" (assoc-ref %outputs "out")))
594 #:phases (modify-phases %standard-phases
595 (delete 'configure))))
596 (home-page "https://github.com/Cyan4973/lz4")
597 (synopsis "Compression algorithm focused on speed")
598 (description "LZ4 is a lossless compression algorithm, providing
599 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
600 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
601 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
602 time for compression ratio.")
603 ;; The libraries (lz4, lz4hc, and xxhash are BSD licenced. The command
604 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
605 (license (list license:bsd-2 license:gpl2+))))
606
607 (define-public squashfs-tools
608 (package
609 (name "squashfs-tools")
610 (version "4.3")
611 (source (origin
612 (method url-fetch)
613 (uri (string-append "mirror://sourceforge/squashfs/"
614 "squashfs" version ".tar.gz"))
615 (sha256
616 (base32
617 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
618 (build-system gnu-build-system)
619 (arguments
620 '(#:tests? #f ; no check target
621 #:make-flags
622 (list "CC=gcc"
623 "XZ_SUPPORT=1"
624 "LZO_SUPPORT=1"
625 "LZ4_SUPPORT=1"
626 (string-append "INSTALL_DIR=" %output "/bin"))
627 #:phases
628 (modify-phases %standard-phases
629 (replace 'configure
630 (lambda _
631 (chdir "squashfs-tools"))))))
632 (inputs
633 `(("lz4" ,lz4)
634 ("lzo" ,lzo)
635 ("xz" ,xz)
636 ("zlib" ,zlib)))
637 (home-page "http://squashfs.sourceforge.net/")
638 (synopsis "Tools to create and extract squashfs filesystems")
639 (description
640 "Squashfs is a highly compressed read-only filesystem for Linux. It uses
641 zlib to compress files, inodes, and directories. All blocks are packed to
642 minimize the data overhead, and block sizes of between 4K and 1M are supported.
643 It is intended to be used for archival use, for live CDs, and for embedded
644 systems where low overhead is needed. This package allows you to create and
645 extract such filesystems.")
646 (license license:gpl2+)))
647
648 (define-public pigz
649 (package
650 (name "pigz")
651 (version "2.3.3")
652 (source (origin
653 (method url-fetch)
654 (uri (string-append "http://zlib.net/pigz/"
655 name "-" version ".tar.gz"))
656 (sha256
657 (base32
658 "172hdf26k4zmm7z8md7nl0dph2a7mhf3x7slb9bhfyff6as6g2sf"))))
659 (build-system gnu-build-system)
660 (arguments
661 `(#:phases
662 (modify-phases %standard-phases
663 (delete 'configure)
664 (replace 'install
665 (lambda* (#:key outputs #:allow-other-keys)
666 (let* ((out (assoc-ref outputs "out"))
667 (bin (string-append out "/bin"))
668 (man (string-append out "/share/man/man1")))
669 (install-file "pigz" bin)
670 (symlink "pigz" (string-append bin "/unpigz"))
671 (install-file "pigz.1" man)
672 #t))))
673 #:make-flags (list "CC=gcc")
674 #:test-target "tests"))
675 (inputs `(("zlib" ,zlib)))
676 (home-page "http://zlib.net/pigz/")
677 (synopsis "Parallel implementation of gzip")
678 (description
679 "This package provides a parallel implementation of gzip that exploits
680 multiple processors and multiple cores when compressing data.")
681
682 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
683 ;; written by Mark Adler, are under another non-copyleft license.
684 (license license:asl2.0)))
685
686 (define-public pixz
687 (package
688 (name "pixz")
689 (version "1.0.6")
690 (source (origin
691 (method url-fetch)
692 (uri (string-append
693 "https://github.com/vasi/pixz/releases/download/v" version
694 "/pixz-" version ".tar.xz"))
695 (sha256
696 (base32
697 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
698 (build-system gnu-build-system)
699 (native-inputs
700 `(("pkg-config" ,pkg-config)
701 ("libarchive" ,libarchive)))
702 (home-page "https://github.com/vasi/pixz")
703 (synopsis "Parallel indexing implementation of LZMA")
704 (description
705 "The existing XZ Utils provide great compression in the .xz file format,
706 but they produce just one big block of compressed data. Pixz instead produces
707 a collection of smaller blocks which makes random access to the original data
708 possible and can compress in parallel. This is especially useful for large
709 tarballs.")
710 (license license:bsd-2)))
711
712 (define-public brotli
713 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
714 (revision "1"))
715 (package
716 (name "brotli")
717 (version (string-append "0.1-" revision "."
718 (string-take commit 7)))
719 (source (origin
720 (method git-fetch)
721 (uri (git-reference
722 (url "https://github.com/bagder/libbrotli.git")
723 (commit commit)
724 (recursive? #t)))
725 (file-name (string-append name "-" version ".tar.xz"))
726 (sha256
727 (base32
728 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
729 (modules '((guix build utils)))
730 (snippet
731 ;; This is a recursive submodule that is unnecessary for this
732 ;; package, so delete it.
733 '(delete-file-recursively "brotli/terryfy"))))
734 (build-system gnu-build-system)
735 (native-inputs
736 `(("autoconf" ,autoconf)
737 ("automake" ,automake)
738 ("libtool" ,libtool)))
739 (arguments
740 `(#:phases (modify-phases %standard-phases
741 (add-after 'unpack 'autogen
742 (lambda _
743 (mkdir "m4")
744 (zero? (system* "autoreconf" "-vfi")))))))
745 (home-page "https://github.com/bagder/libbrotli/")
746 (synopsis "Implementation of the Brotli compression algorithm")
747 (description
748 "Brotli is a general-purpose lossless compression algorithm. It is
749 similar in speed to deflate but offers denser compression. This package
750 provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
751 respectively, based on the reference implementation from Google.")
752 (license license:expat))))
753
754 (define-public cabextract
755 (package
756 (name "cabextract")
757 (version "1.6")
758 (source (origin
759 (method url-fetch)
760 (uri (string-append
761 "http://cabextract.org.uk/cabextract-" version ".tar.gz"))
762 (sha256
763 (base32
764 "1ysmmz25fjghq7mxb2anyyvr1ljxqxzi4piwjhk0sdamcnsn3rnf"))))
765 (build-system gnu-build-system)
766 (arguments '(#:configure-flags '("--with-external-libmspack")))
767 (native-inputs
768 `(("pkg-config" ,pkg-config)))
769 (inputs
770 `(("libmspack" ,libmspack)))
771 (home-page "http://www.cabextract.org.uk/")
772 (synopsis "Tool to unpack Cabinet archives")
773 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
774 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
775 (license license:gpl3+)))