doc: "filesystem" -> "file system"
[jackhill/guix/guix.git] / gnu / packages / compression.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
9b1bf330 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
b357faac 3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
0a5c3087 4;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
27f76fe6 5;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
69d9792a 6;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
669b7b83 7;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
82aa2a28 8;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
820dc3f5 9;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
209e09fa 10;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
23f3cbb8 11;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
3fd4b90d 12;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
0b073506 13;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
e4c2136d 14;;; Copyright © 2016 David Craven <david@craven.ch>
adbd7faf 15;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
618089f9 16;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
a268f085 17;;;
233e7676 18;;; This file is part of GNU Guix.
a268f085 19;;;
233e7676 20;;; GNU Guix is free software; you can redistribute it and/or modify it
a268f085
LC
21;;; under the terms of the GNU General Public License as published by
22;;; the Free Software Foundation; either version 3 of the License, or (at
23;;; your option) any later version.
24;;;
233e7676 25;;; GNU Guix is distributed in the hope that it will be useful, but
a268f085
LC
26;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28;;; GNU General Public License for more details.
29;;;
30;;; You should have received a copy of the GNU General Public License
233e7676 31;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
a268f085 32
1ffa7090 33(define-module (gnu packages compression)
b5b73a82 34 #:use-module ((guix licenses) #:prefix license:)
21b2ec4d 35 #:use-module (guix utils)
a268f085 36 #:use-module (guix packages)
87f5d366 37 #:use-module (guix download)
646898b3 38 #:use-module (guix git-download)
b357faac 39 #:use-module (guix build-system gnu)
73f542c3 40 #:use-module (guix build-system perl)
e99dd67a 41 #:use-module (gnu packages)
389eb3fa 42 #:use-module (gnu packages assembly)
69d9792a 43 #:use-module (gnu packages autotools)
23f3cbb8 44 #:use-module (gnu packages backup)
73f542c3 45 #:use-module (gnu packages base)
646898b3 46 #:use-module (gnu packages perl)
23f3cbb8 47 #:use-module (gnu packages pkg-config)
82aa2a28 48 #:use-module (gnu packages valgrind)
646898b3 49 #:use-module ((srfi srfi-1) #:select (last)))
a268f085 50
6a92093d
LC
51(define-public zlib
52 (package
53 (name "zlib")
209e09fa 54 (version "1.2.8")
6a92093d
LC
55 (source
56 (origin
87f5d366 57 (method url-fetch)
a67f97fe
CR
58 (uri (list (string-append "http://zlib.net/zlib-"
59 version ".tar.gz")
60 (string-append "mirror://sourceforge/libpng/zlib-"
61 version ".tar.gz")))
6a92093d
LC
62 (sha256
63 (base32
209e09fa 64 "039agw5rqvqny92cpkrfn243x2gd4xn13hs3xi6isk55d2vqqr9n"))))
6a92093d
LC
65 (build-system gnu-build-system)
66 (arguments
67 `(#:phases (alist-replace
68 'configure
69 (lambda* (#:key outputs #:allow-other-keys)
e67253db 70 ;; Zlib's home-made `configure' fails when passed
6a92093d
LC
71 ;; extra flags like `--enable-fast-install', so we need to
72 ;; invoke it with just what it understand.
73 (let ((out (assoc-ref outputs "out")))
e67253db
JD
74 ;; 'configure' doesn't understand '--host'.
75 ,@(if (%current-target-system)
76 `((setenv "CHOST" ,(%current-target-system)))
77 '())
78 (zero?
79 (system* "./configure"
80 (string-append "--prefix=" out)))))
6a92093d
LC
81 %standard-phases)))
82 (home-page "http://zlib.net/")
35b9e423 83 (synopsis "Compression library")
6a92093d
LC
84 (description
85 "zlib is designed to be a free, general-purpose, legally unencumbered --
86that is, not covered by any patents -- lossless data-compression library for
87use on virtually any computer hardware and operating system. The zlib data
35b9e423 88format is itself portable across platforms. Unlike the LZW compression method
6a92093d
LC
89used in Unix compress(1) and in the GIF image format, the compression method
90currently used in zlib essentially never expands the data. (LZW can double or
91triple the file size in extreme cases.) zlib's memory footprint is also
92independent of the input data and can be reduced, if necessary, at some cost
93in compression.")
4a44e743 94 (license license:zlib)))
6a92093d 95
ee97be9f
RW
96(define-public fastjar
97 (package
98 (name "fastjar")
99 (version "0.98")
100 (source (origin
101 (method url-fetch)
102 (uri (string-append "mirror://savannah/fastjar/fastjar-"
103 version ".tar.gz"))
104 (sha256
105 (base32
106 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
107 (build-system gnu-build-system)
108 (inputs `(("zlib" ,zlib)))
109 (home-page "http://savannah.nongnu.org/projects/fastjar")
110 (synopsis "Replacement for Sun's 'jar' utility")
111 (description
112 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
113utility. Instead of being written in Java, FastJar is written in C.")
114 (license license:gpl2+)))
115
58593975
RW
116(define-public libtar
117 (package
118 (name "libtar")
89d80159 119 (version "1.2.20")
58593975
RW
120 (source (origin
121 (method url-fetch)
89d80159
EF
122 (uri (list
123 (string-append
124 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
125 version ".tar.gz")
126 (string-append
127 "mirror://debian/pool/main/libt/libtar/libtar_"
128 version ".orig.tar.gz")))
58593975
RW
129 (sha256
130 (base32
e99dd67a
EF
131 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
132 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
58593975 133 (build-system gnu-build-system)
89d80159
EF
134 (arguments
135 `(#:tests? #f ;no "check" target
136 #:phases
137 (modify-phases %standard-phases
138 (add-after 'unpack 'autoconf
139 (lambda _ (zero? (system* "sh" "autoreconf" "-vfi")))))))
140 (native-inputs
141 `(("autoconf" ,autoconf)
142 ("automake" ,automake)
143 ("libtool" ,libtool)))
144 (inputs
145 `(("zlib" ,zlib)))
58593975
RW
146 (synopsis "C library for manipulating POSIX tar files")
147 (description
148 "libtar is a C library for manipulating POSIX tar files. It handles
149adding and extracting files to/from a tar archive.")
89d80159 150 (home-page "https://repo.or.cz/libtar.git")
58593975
RW
151 (license license:bsd-3)))
152
a268f085
LC
153(define-public gzip
154 (package
155 (name "gzip")
0bfb9b43 156 (version "1.8")
a268f085 157 (source (origin
87f5d366 158 (method url-fetch)
0db342a5 159 (uri (string-append "mirror://gnu/gzip/gzip-"
28181faf 160 version ".tar.xz"))
a268f085
LC
161 (sha256
162 (base32
0bfb9b43 163 "1lxv3p4iyx7833mlihkn5wfwmz4cys5nybwpz3dfawag8kn6f5zz"))))
a268f085 164 (build-system gnu-build-system)
f50d2669 165 (synopsis "General file (de)compression (using lzw)")
a268f085
LC
166 (arguments
167 ;; FIXME: The test suite wants `less', and optionally Perl.
168 '(#:tests? #f))
169 (description
79c311b8
LC
170 "GNU Gzip provides data compression and decompression utilities; the
171typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
172file; as a result, it is often used in conjunction with \"tar\", resulting in
173\".tar.gz\" or \".tgz\", etc.")
4a44e743 174 (license license:gpl3+)
a268f085
LC
175 (home-page "http://www.gnu.org/software/gzip/")))
176
177(define-public bzip2
9b1bf330 178 (let ((build-shared-lib
a268f085
LC
179 ;; Build a shared library.
180 '(lambda* (#:key inputs #:allow-other-keys)
f678f6d9 181 (patch-makefile-SHELL "Makefile-libbz2_so")
a268f085
LC
182 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
183 (install-shared-lib
184 '(lambda* (#:key outputs #:allow-other-keys)
185 (let* ((out (assoc-ref outputs "out"))
186 (libdir (string-append out "/lib")))
187 (for-each (lambda (file)
188 (let ((base (basename file)))
189 (format #t "installing `~a' to `~a'~%"
190 base libdir)
191 (copy-file file
192 (string-append libdir "/" base))))
ab4fab19
LC
193 (find-files "." "^libbz2\\.so")))))
194 (set-cross-environment
195 '(lambda* (#:key target #:allow-other-keys)
196 (substitute* (find-files "." "Makefile")
197 (("CC=.*$")
198 (string-append "CC = " target "-gcc\n"))
199 (("AR=.*$")
200 (string-append "AR = " target "-ar\n"))
201 (("RANLIB=.*$")
202 (string-append "RANLIB = " target "-ranlib\n"))
203 (("^all:(.*)test" _ prerequisites)
204 ;; Remove 'all' -> 'test' dependency.
205 (string-append "all:" prerequisites "\n"))))))
a268f085
LC
206 (package
207 (name "bzip2")
208 (version "1.0.6")
209 (source (origin
87f5d366 210 (method url-fetch)
a268f085
LC
211 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
212 version ".tar.gz"))
213 (sha256
214 (base32
215 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
216 (build-system gnu-build-system)
217 (arguments
218 `(#:modules ((guix build gnu-build-system)
219 (guix build utils)
220 (srfi srfi-1))
221 #:phases
ab4fab19
LC
222 ,(if (%current-target-system)
223
224 ;; Cross-compilation: use the cross tools.
225 `(alist-cons-before
226 'build 'build-shared-lib ,build-shared-lib
227 (alist-cons-after
9b1bf330
LC
228 'install 'install-shared-lib ,install-shared-lib
229 (alist-replace 'configure ,set-cross-environment
230 %standard-phases)))
ab4fab19
LC
231
232 ;; Native compilation: build the shared library.
233 `(alist-cons-before
234 'build 'build-shared-lib ,build-shared-lib
235 (alist-cons-after
9b1bf330
LC
236 'install 'install-shared-lib ,install-shared-lib
237 (alist-delete 'configure %standard-phases))))
ab4fab19 238
a268f085 239 #:make-flags (list (string-append "PREFIX="
ab4fab19
LC
240 (assoc-ref %outputs "out")))
241
242 ;; Don't attempt to run the tests when cross-compiling.
243 ,@(if (%current-target-system)
244 '(#:tests? #f)
245 '())))
35b9e423 246 (synopsis "High-quality data compression program")
a268f085
LC
247 (description
248 "bzip2 is a freely available, patent free (see below), high-quality data
249compressor. It typically compresses files to within 10% to 15% of the best
250available techniques (the PPM family of statistical compressors), whilst
251being around twice as fast at compression and six times faster at
252decompression.")
166191b3 253 (license (license:non-copyleft "file://LICENSE"
4a44e743 254 "See LICENSE in the distribution."))
a268f085
LC
255 (home-page "http://www.bzip.org/"))))
256
669b7b83
RW
257(define-public lbzip2
258 (package
259 (name "lbzip2")
260 (version "2.5")
261 (source (origin
262 (method url-fetch)
263 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
264 version ".tar.gz"))
265 (sha256
266 (base32
267 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))))
268 (build-system gnu-build-system)
269 (synopsis "Parallel bzip2 compression utility")
270 (description
271 "lbzip2 is a multi-threaded compression utility with support for the
272bzip2 compressed file format. lbzip2 can process standard bz2 files in
273parallel. It uses POSIX threading model (pthreads), which allows it to take
274full advantage of symmetric multiprocessing (SMP) systems. It has been proven
275to scale linearly, even to over one hundred processor cores. lbzip2 is fully
276compatible with bzip2 – both at file format and command line level.")
277 (home-page "http://www.lbzip2.org/")
278 (license license:gpl3+)))
279
5d47eab0
EF
280(define-public pbzip2
281 (package
282 (name "pbzip2")
283 (version "1.1.12")
284 (source (origin
285 (method url-fetch)
21b2ec4d
EF
286 (uri (string-append "https://launchpad.net/pbzip2/"
287 (version-major+minor version) "/" version
288 "/+download/" name "-" version ".tar.gz"))
5d47eab0
EF
289 (sha256
290 (base32
291 "1vk6065dv3a47p86vmp8hv3n1ygd9hraz0gq89gvzlx7lmcb6fsp"))))
292 (build-system gnu-build-system)
293 (inputs
b3546174 294 `(("bzip2" ,bzip2)))
5d47eab0
EF
295 (arguments
296 `(#:tests? #f ; no tests
297 #:phases (modify-phases %standard-phases
21b2ec4d
EF
298 (delete 'configure))
299 #:make-flags (list (string-append "PREFIX=" %output))))
5d47eab0
EF
300 (home-page "http://compression.ca/pbzip2/")
301 (synopsis "Parallel bzip2 implementation")
302 (description
303 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
304compressor that uses pthreads and achieves near-linear speedup on SMP machines.
21b2ec4d 305The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
5d47eab0
EF
306compressed with pbzip2 can be decompressed with bzip2).")
307 (license (license:non-copyleft "file://COPYING"
21b2ec4d 308 "See COPYING in the distribution."))))
5d47eab0 309
a268f085
LC
310(define-public xz
311 (package
312 (name "xz")
4655f515 313 (version "5.2.2")
a268f085 314 (source (origin
87f5d366 315 (method url-fetch)
52d76b64
LC
316 (uri (list (string-append "http://tukaani.org/xz/xz-" version
317 ".tar.gz")
318 (string-append "http://multiprecision.org/guix/xz-"
319 version ".tar.gz")))
a268f085
LC
320 (sha256
321 (base32
4655f515 322 "18h2k4jndhzjs8ln3a54qdnfv59y6spxiwh9gpaqniph6iflvpvk"))))
a268f085 323 (build-system gnu-build-system)
35b9e423 324 (synopsis "General-purpose data compression")
a268f085
LC
325 (description
326 "XZ Utils is free general-purpose data compression software with high
327compression ratio. XZ Utils were written for POSIX-like systems, but also
328work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
329
330The core of the XZ Utils compression code is based on LZMA SDK, but it has
331been modified quite a lot to be suitable for XZ Utils. The primary
332compression algorithm is currently LZMA2, which is used inside the .xz
333container format. With typical files, XZ Utils create 30 % smaller output
334than gzip and 15 % smaller output than bzip2.")
38bbd61d 335 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
a268f085 336 (home-page "http://tukaani.org/xz/")))
c6eac761
LC
337
338(define-public lzo
339 (package
340 (name "lzo")
c0ec516d 341 (version "2.09")
c6eac761
LC
342 (source
343 (origin
344 (method url-fetch)
345 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
346 version ".tar.gz"))
347 (sha256
348 (base32
c0ec516d 349 "0k5kpj3jnsjfxqqkblpfpx0mqcy86zs5fhjhgh2kq1hksg7ag57j"))))
c6eac761 350 (build-system gnu-build-system)
165fd9d5 351 (arguments '(#:configure-flags '("--enable-shared")))
c6eac761
LC
352 (home-page "http://www.oberhumer.com/opensource/lzo")
353 (synopsis
e881752c 354 "Data compression library suitable for real-time data de-/compression")
c6eac761
LC
355 (description
356 "LZO is a data compression library which is suitable for data
357de-/compression in real-time. This means it favours speed over
358compression ratio.
359
360LZO is written in ANSI C. Both the source code and the compressed data
361format are designed to be portable across platforms.")
4a44e743 362 (license license:gpl2+)))
0f323dad 363
a9f48ff0
EB
364(define-public lzop
365 (package
366 (name "lzop")
367 (version "1.03")
368 (source
369 (origin
370 (method url-fetch)
371 (uri (string-append "http://www.lzop.org/download/lzop-"
372 version ".tar.gz"))
373 (sha256
374 (base32
375 "1jdjvc4yjndf7ihmlcsyln2rbnbaxa86q4jskmkmm7ylfy65nhn1"))))
376 (build-system gnu-build-system)
377 (inputs `(("lzo" ,lzo)))
378 (home-page "http://www.lzop.org/")
379 (synopsis "Compress or expand files")
380 (description
381 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
382LZO data compression library for compression services, and its main advantages
383over gzip are much higher compression and decompression speed (at the cost of
384some compression ratio).")
385 (license license:gpl2+)))
386
0f323dad
LC
387(define-public lzip
388 (package
389 (name "lzip")
275a7711 390 (version "1.16")
0f323dad
LC
391 (source (origin
392 (method url-fetch)
393 (uri (string-append "mirror://savannah/lzip/lzip-"
394 version ".tar.gz"))
395 (sha256
396 (base32
275a7711 397 "0l9724rw1l3hg2ldr3n7ihqich4m9nc6y7l302bvdj4jmxdw530j"))))
0f323dad
LC
398 (build-system gnu-build-system)
399 (home-page "http://www.nongnu.org/lzip/lzip.html")
400 (synopsis "Lossless data compressor based on the LZMA algorithm")
401 (description
402 "Lzip is a lossless data compressor with a user interface similar to the
403one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
404more than bzip2, which makes it well suited for software distribution and data
405archiving. Lzip is a clean implementation of the LZMA algorithm.")
406 (license license:gpl3+)))
b357faac
AE
407
408(define-public sharutils
409 (package
410 (name "sharutils")
9a59ce24 411 (version "4.15.2")
b357faac
AE
412 (source
413 (origin
414 (method url-fetch)
415 (uri (string-append "mirror://gnu/sharutils/sharutils-"
416 version ".tar.xz"))
417 (sha256
418 (base32
9a59ce24 419 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))))
b357faac
AE
420 (build-system gnu-build-system)
421 (inputs
422 `(("which" ,which)))
423 (arguments
424 `(#:phases
425 (alist-cons-after
426 'patch-source-shebangs 'unpatch-source-shebang
427 ;; revert the patch-shebang phase on a script which is
428 ;; in fact test data
d4bf49b1 429 (lambda _
b357faac
AE
430 (substitute* "tests/shar-1.ok"
431 (((which "sh")) "/bin/sh")))
432 %standard-phases)))
433 (home-page "http://www.gnu.org/software/sharutils/")
434 (synopsis "Archives in shell scripts, uuencode/uudecode")
435 (description
79c311b8
LC
436 "GNU sharutils is a package for creating and manipulating shell
437archives that can be readily emailed. A shell archive is a file that can be
e881752c 438processed by a Bourne-type shell to unpack the original collection of files.
79c311b8 439This package is mostly for compatibility and historical interest.")
b357faac 440 (license license:gpl3+)))
28469ab0 441
646898b3
RW
442(define-public sfarklib
443 (package
444 (name "sfarklib")
979f9e8a 445 (version "2.24")
646898b3 446 (source (origin
979f9e8a
RW
447 (method url-fetch)
448 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
449 version ".tar.gz"))
450 (file-name (string-append name "-" version ".tar.gz"))
646898b3
RW
451 (sha256
452 (base32
979f9e8a 453 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
646898b3
RW
454 (build-system gnu-build-system)
455 (arguments
456 `(#:tests? #f ;no "check" target
457 #:phases
458 (modify-phases %standard-phases
459 (replace 'configure
460 (lambda* (#:key outputs #:allow-other-keys)
461 (substitute* "Makefile"
462 (("/usr/local") (assoc-ref outputs "out")))
463 #t)))))
464 (inputs
465 `(("zlib" ,zlib)))
466 (home-page "https://github.com/raboof/sfArkLib")
467 (synopsis "Library for SoundFont decompression")
468 (description
469 "SfArkLib is a C++ library for decompressing SoundFont files compressed
470with the sfArk algorithm.")
471 (license license:gpl3+)))
472
b5ad1659 473(define-public sfarkxtc
698bd297 474 (let ((commit "b5e0a2ba3921f019d74d4b92bd31c36dd19d2cf1"))
b5ad1659
RW
475 (package
476 (name "sfarkxtc")
698bd297 477 (version (string-take commit 10))
b5ad1659
RW
478 (source (origin
479 ;; There are no release tarballs, so we just fetch the latest
480 ;; commit at this time.
481 (method git-fetch)
482 (uri (git-reference
483 (url "https://github.com/raboof/sfarkxtc.git")
698bd297 484 (commit commit)))
b5ad1659
RW
485 (sha256
486 (base32
487 "0f5x6i46qfl6ry21s7g2p4sd4b2r1g4fb03yqi2vv4kq3saryhvj"))))
488 (build-system gnu-build-system)
489 (arguments
490 `(#:tests? #f ;no "check" target
491 #:phases
492 (modify-phases %standard-phases
493 (replace 'configure
494 (lambda* (#:key outputs #:allow-other-keys)
495 (substitute* "Makefile"
496 (("/usr/local") (assoc-ref outputs "out")))
497 #t)))))
498 (inputs
499 `(("zlib" ,zlib)
500 ("sfarklib" ,sfarklib)))
501 (home-page "https://github.com/raboof/sfarkxtc")
502 (synopsis "Basic sfArk decompressor")
503 (description "SfArk extractor converts SoundFonts in the compressed legacy
504sfArk file format to the uncompressed sf2 format.")
698bd297 505 (license license:gpl3+))))
b5ad1659 506
27f76fe6
TUBK
507(define-public libmspack
508 (package
509 (name "libmspack")
510 (version "0.5")
511 (source
512 (origin
513 (method url-fetch)
514 (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
515 version "alpha.tar.gz"))
516 (sha256
517 (base32 "04413hynb7zizxnkgy9riik3612dwirkpr6fcjrnfl2za9sz4rw9"))))
518 (build-system gnu-build-system)
519 (home-page "http://www.cabextract.org.uk/libmspack/")
520 (synopsis "Compression tools for some formats used by Microsoft")
521 (description
522 "The purpose of libmspack is to provide both compression and
523decompression of some loosely related file formats used by Microsoft.")
524 (license license:lgpl2.1+)))
73f542c3
EB
525
526(define-public perl-compress-raw-bzip2
527 (package
528 (name "perl-compress-raw-bzip2")
529 (version "2.068")
530 (source
531 (origin
532 (method url-fetch)
533 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
534 "Compress-Raw-Bzip2-" version ".tar.gz"))
535 (sha256
536 (base32
537 "16hl58xppckldz05zdyid1l5gpaykzwvkq682h3rc3nilbhgjqqg"))))
538 (build-system perl-build-system)
539 ;; TODO: Use our bzip2 package.
540 (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
541 (synopsis "Low-level interface to bzip2 compression library")
542 (description "This module provides a Perl interface to the bzip2
543compression library.")
544 (license (package-license perl))))
8e18514a
EB
545
546(define-public perl-compress-raw-zlib
547 (package
548 (name "perl-compress-raw-zlib")
549 (version "2.068")
550 (source
551 (origin
552 (method url-fetch)
553 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
554 "Compress-Raw-Zlib-" version ".tar.gz"))
555 (sha256
556 (base32
557 "06q7n87g26nn5gv4z2p31ca32f6zk124hqxc25rfgkjd3qi5798i"))))
558 (build-system perl-build-system)
559 (inputs
560 `(("zlib" ,zlib)))
561 (arguments
562 `(#:phases (modify-phases %standard-phases
563 (add-before
40b084a3 564 'configure 'configure-zlib
8e18514a
EB
565 (lambda* (#:key inputs #:allow-other-keys)
566 (call-with-output-file "config.in"
567 (lambda (port)
568 (format port "
569BUILD_ZLIB = False
570INCLUDE = ~a/include
571LIB = ~:*~a/lib
572OLD_ZLIB = False
573GZIP_OS_CODE = AUTO_DETECT"
574 (assoc-ref inputs "zlib")))))))))
575 (home-page "http://search.cpan.org/dist/Compress-Raw-Zlib")
576 (synopsis "Low-level interface to zlib compression library")
577 (description "This module provides a Perl interface to the zlib
578compression library.")
579 (license (package-license perl))))
8aaafd34
EB
580
581(define-public perl-io-compress
582 (package
583 (name "perl-io-compress")
584 (version "2.068")
585 (source
586 (origin
587 (method url-fetch)
588 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
589 "IO-Compress-" version ".tar.gz"))
590 (sha256
591 (base32
592 "0dy0apjp7j9dfkzfjspjd3z9gh26srx5vac72g59bkkz1jf8s1gs"))))
593 (build-system perl-build-system)
594 (propagated-inputs
595 `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib) ; >=2.068
596 ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.068
597 (home-page "http://search.cpan.org/dist/IO-Compress")
598 (synopsis "IO Interface to compressed files/buffers")
599 (description "IO-Compress provides a Perl interface to allow reading and
600writing of compressed data created with the zlib and bzip2 libraries.")
601 (license (package-license perl))))
82aa2a28
LF
602
603(define-public lz4
604 (package
605 (name "lz4")
606 (version "131")
607 (source
608 (origin
609 (method url-fetch)
610 (uri (string-append "https://github.com/Cyan4973/lz4/archive/"
611 "r" version ".tar.gz"))
612 (sha256
613 (base32 "1vfg305zvj50hwscad24wan9jar6nqj14gdk2hqyr7bb9mhh0kcx"))
614 (file-name (string-append name "-" version ".tar.gz"))))
615 (build-system gnu-build-system)
616 (native-inputs `(("valgrind" ,valgrind)))
617 (arguments
618 `(#:test-target "test"
619 #:parallel-tests? #f ; tests fail if run in parallel
620 #:make-flags (list "CC=gcc"
621 (string-append "PREFIX=" (assoc-ref %outputs "out")))
622 #:phases (modify-phases %standard-phases
623 (delete 'configure))))
624 (home-page "https://github.com/Cyan4973/lz4")
625 (synopsis "Compression algorithm focused on speed")
626 (description "LZ4 is a lossless compression algorithm, providing
627compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
628extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
629A high compression derivative, called LZ4_HC, is also provided. It trades CPU
630time for compression ratio.")
631 ;; The libraries (lz4, lz4hc, and xxhash are BSD licenced. The command
632 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
633 (license (list license:bsd-2 license:gpl2+))))
dd8d6d65
SB
634
635(define-public squashfs-tools
636 (package
637 (name "squashfs-tools")
638 (version "4.3")
639 (source (origin
640 (method url-fetch)
de67e922
LF
641 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
642 "squashfs" version "/"
dd8d6d65
SB
643 "squashfs" version ".tar.gz"))
644 (sha256
645 (base32
646 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
647 (build-system gnu-build-system)
648 (arguments
649 '(#:tests? #f ; no check target
650 #:make-flags
651 (list "CC=gcc"
652 "XZ_SUPPORT=1"
653 "LZO_SUPPORT=1"
654 "LZ4_SUPPORT=1"
655 (string-append "INSTALL_DIR=" %output "/bin"))
656 #:phases
657 (modify-phases %standard-phases
658 (replace 'configure
659 (lambda _
660 (chdir "squashfs-tools"))))))
661 (inputs
662 `(("lz4" ,lz4)
663 ("lzo" ,lzo)
664 ("xz" ,xz)
665 ("zlib" ,zlib)))
666 (home-page "http://squashfs.sourceforge.net/")
8f65585b 667 (synopsis "Tools to create and extract squashfs file systems")
dd8d6d65 668 (description
8f65585b 669 "Squashfs is a highly compressed read-only file system for Linux. It uses
dd8d6d65
SB
670zlib to compress files, inodes, and directories. All blocks are packed to
671minimize the data overhead, and block sizes of between 4K and 1M are supported.
672It is intended to be used for archival use, for live CDs, and for embedded
673systems where low overhead is needed. This package allows you to create and
8f65585b 674extract such file systems.")
dd8d6d65 675 (license license:gpl2+)))
820dc3f5
JM
676
677(define-public pigz
678 (package
679 (name "pigz")
680 (version "2.3.3")
681 (source (origin
682 (method url-fetch)
683 (uri (string-append "http://zlib.net/pigz/"
684 name "-" version ".tar.gz"))
685 (sha256
686 (base32
687 "172hdf26k4zmm7z8md7nl0dph2a7mhf3x7slb9bhfyff6as6g2sf"))))
688 (build-system gnu-build-system)
689 (arguments
690 `(#:phases
691 (modify-phases %standard-phases
692 (delete 'configure)
693 (replace 'install
694 (lambda* (#:key outputs #:allow-other-keys)
695 (let* ((out (assoc-ref outputs "out"))
696 (bin (string-append out "/bin"))
697 (man (string-append out "/share/man/man1")))
698 (install-file "pigz" bin)
699 (symlink "pigz" (string-append bin "/unpigz"))
700 (install-file "pigz.1" man)
701 #t))))
702 #:make-flags (list "CC=gcc")
703 #:test-target "tests"))
704 (inputs `(("zlib" ,zlib)))
705 (home-page "http://zlib.net/pigz/")
706 (synopsis "Parallel implementation of gzip")
707 (description
708 "This package provides a parallel implementation of gzip that exploits
709multiple processors and multiple cores when compressing data.")
710
711 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
712 ;; written by Mark Adler, are under another non-copyleft license.
713 (license license:asl2.0)))
23f3cbb8
BW
714
715(define-public pixz
716 (package
717 (name "pixz")
718 (version "1.0.6")
719 (source (origin
720 (method url-fetch)
721 (uri (string-append
722 "https://github.com/vasi/pixz/releases/download/v" version
723 "/pixz-" version ".tar.xz"))
724 (sha256
725 (base32
726 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
727 (build-system gnu-build-system)
728 (native-inputs
729 `(("pkg-config" ,pkg-config)
730 ("libarchive" ,libarchive)))
731 (home-page "https://github.com/vasi/pixz")
732 (synopsis "Parallel indexing implementation of LZMA")
733 (description
734 "The existing XZ Utils provide great compression in the .xz file format,
735but they produce just one big block of compressed data. Pixz instead produces
736a collection of smaller blocks which makes random access to the original data
737possible and can compress in parallel. This is especially useful for large
738tarballs.")
739 (license license:bsd-2)))
69d9792a
EB
740
741(define-public brotli
742 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
743 (revision "1"))
744 (package
745 (name "brotli")
746 (version (string-append "0.1-" revision "."
747 (string-take commit 7)))
748 (source (origin
749 (method git-fetch)
750 (uri (git-reference
751 (url "https://github.com/bagder/libbrotli.git")
752 (commit commit)
753 (recursive? #t)))
754 (file-name (string-append name "-" version ".tar.xz"))
755 (sha256
756 (base32
757 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
758 (modules '((guix build utils)))
759 (snippet
760 ;; This is a recursive submodule that is unnecessary for this
761 ;; package, so delete it.
762 '(delete-file-recursively "brotli/terryfy"))))
763 (build-system gnu-build-system)
764 (native-inputs
765 `(("autoconf" ,autoconf)
766 ("automake" ,automake)
767 ("libtool" ,libtool)))
768 (arguments
769 `(#:phases (modify-phases %standard-phases
770 (add-after 'unpack 'autogen
771 (lambda _
772 (mkdir "m4")
773 (zero? (system* "autoreconf" "-vfi")))))))
774 (home-page "https://github.com/bagder/libbrotli/")
775 (synopsis "Implementation of the Brotli compression algorithm")
776 (description
777 "Brotli is a general-purpose lossless compression algorithm. It is
778similar in speed to deflate but offers denser compression. This package
779provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
780respectively, based on the reference implementation from Google.")
781 (license license:expat))))
3fd4b90d
DM
782
783(define-public cabextract
784 (package
785 (name "cabextract")
786 (version "1.6")
787 (source (origin
788 (method url-fetch)
789 (uri (string-append
790 "http://cabextract.org.uk/cabextract-" version ".tar.gz"))
791 (sha256
792 (base32
793 "1ysmmz25fjghq7mxb2anyyvr1ljxqxzi4piwjhk0sdamcnsn3rnf"))))
794 (build-system gnu-build-system)
795 (arguments '(#:configure-flags '("--with-external-libmspack")))
796 (native-inputs
797 `(("pkg-config" ,pkg-config)))
798 (inputs
799 `(("libmspack" ,libmspack)))
800 (home-page "http://www.cabextract.org.uk/")
801 (synopsis "Tool to unpack Cabinet archives")
802 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
803 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
804 (license license:gpl3+)))
0b073506
TGR
805
806(define-public xdelta
807 (package
808 (name "xdelta")
809 (version "3.1.0")
810 (source
811 (origin
812 (method url-fetch)
813 (uri (string-append "https://github.com/jmacd/xdelta/archive/v"
814 version ".tar.gz"))
815 (sha256
816 (base32
817 "17g2pbbqy6h20qgdjq7ykib7kg5ajh8fwbsfgyjqg8pwg19wy5bm"))
818 (file-name (string-append name "-" version ".tar.gz"))
819 (snippet
820 ;; This file isn't freely distributable and has no effect on building.
821 '(delete-file "xdelta3/draft-korn-vcdiff.txt"))))
822 (build-system gnu-build-system)
823 (native-inputs
824 `(("autoconf" ,autoconf)
825 ("automake" ,automake)))
826 (arguments
827 `(#:phases
828 (modify-phases %standard-phases
829 (add-after 'unpack 'enter-build-directory
830 (lambda _ (chdir "xdelta3")))
831 (add-before 'configure 'autoconf
832 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
833 (home-page "http://xdelta.com")
834 (synopsis "Delta encoder for binary files")
835 (description "xdelta encodes only the differences between two binary files
836using the VCDIFF algorithm and patch file format described in RFC 3284. It can
837also be used to apply such patches. xdelta is similar to @command{diff} and
838@command{patch}, but is not limited to plain text and does not generate
839human-readable output.")
840 (license license:asl2.0)))
389eb3fa
TGR
841
842(define-public lrzip
843 (package
844 (name "lrzip")
845 (version "0.630")
846 (source
847 (origin
848 (method url-fetch)
849 (uri (string-append
850 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
851 (sha256
852 (base32
853 "01ykxliqw4cavx9f2gawxfa9wf52cjy1qx28cnkrh6i3lfzzcq94"))))
854 (build-system gnu-build-system)
855 (native-inputs
856 `(;; nasm is only required when building for 32-bit x86 platforms
857 ,@(if (string-prefix? "i686" (or (%current-target-system)
858 (%current-system)))
859 `(("nasm" ,nasm))
860 '())
861 ("perl" ,perl)))
862 (inputs
863 `(("bzip2" ,bzip2)
864 ("lzo" ,lzo)
865 ("zlib" ,zlib)))
866 (home-page "http://ck.kolivas.org/apps/lrzip/")
867 (synopsis "Large file compressor with a very high compression ratio")
868 (description "lrzip is a compression utility that uses long-range
869redundancy reduction to improve the subsequent compression ratio of
870larger files. It can then further compress the result with the ZPAQ or
871LZMA algorithms for maximum compression, or LZO for maximum speed. This
872choice between size or speed allows for either better compression than
873even LZMA can provide, or a higher speed than gzip while compressing as
874well as bzip2.")
875 (license (list license:gpl3+
876 license:public-domain)))) ; most files in lzma/
e4c2136d
DC
877
878(define-public snappy
879 (package
880 (name "snappy")
881 (version "1.1.3")
882 (source (origin
883 (method url-fetch)
884 (uri (string-append
885 "https://github.com/google/snappy/releases/download/"
886 version "/" name "-" version ".tar.gz"))
887 (sha256
888 (base32
889 "1wzf8yif5ym2gj52db6v5m1pxnmn258i38x7llk9x346y2nq47ig"))))
890 (build-system gnu-build-system)
891 (home-page "https://github.com/google/snappy")
892 (synopsis "Fast compressor/decompressor")
893 (description "Snappy is a compression/decompression library. It does not
894aim for maximum compression, or compatibility with any other compression library;
895instead, it aims for very high speeds and reasonable compression. For instance,
896compared to the fastest mode of zlib, Snappy is an order of magnitude faster
897for most inputs, but the resulting compressed files are anywhere from 20% to
898100% bigger.")
899 (license license:asl2.0)))
adbd7faf
KK
900
901(define-public p7zip
902 (package
903 (name "p7zip")
904 (version "16.02")
905 (source (origin
906 (method url-fetch)
907 (uri (string-append "mirror://sourceforge/" name "/" name "/"
908 version "/" name "_" version
909 "_src_all.tar.bz2"))
910 (sha256
911 (base32
912 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
913 (modules '((guix build utils)))
914 (snippet
915 '(begin
916 ;; Remove non-free source files
917 (for-each delete-file
918 (append
919 (find-files "CPP/7zip/Compress" "Rar.*")
920 (find-files "CPP/7zip/Crypto" "Rar.*")
921 (find-files "DOC/unRarLicense.txt")
922 (find-files "Utils/file_Codecs_Rar_so.py")))
923 (delete-file-recursively "CPP/7zip/Archive/Rar")
924 (delete-file-recursively "CPP/7zip/Compress/Rar")
925 #t))
926 (patches (search-patches "p7zip-remove-unused-code.patch"))))
927 (build-system gnu-build-system)
928 (arguments
929 `(#:make-flags
930 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
931 #:phases
932 (modify-phases %standard-phases
933 (replace 'configure
934 (lambda* (#:key system outputs #:allow-other-keys)
935 (zero? (system* "cp"
936 (let ((system ,(or (%current-target-system)
937 (%current-system))))
938 (cond
939 ((string-prefix? "x86_64" system)
940 "makefile.linux_amd64_asm")
941 ((string-prefix? "i686" system)
942 "makefile.linux_x86_asm_gcc_4.X")
943 (else
944 "makefile.linux_any_cpu_gcc_4.X")))
945 "makefile.machine"))))
946 (replace 'check
947 (lambda _
948 (and (zero? (system* "make" "test"))
949 (zero? (system* "make" "test_7z"))
950 (zero? (system* "make" "test_7zr"))))))))
951 (inputs
952 (let ((system (or (%current-target-system)
953 (%current-system))))
954 `(,@(cond ((string-prefix? "x86_64" system)
955 `(("yasm" ,yasm)))
956 ((string-prefix? "i686" system)
957 `(("nasm" ,nasm)))
958 (else '())))))
959 (home-page "http://p7zip.sourceforge.net/")
960 (synopsis "Command-line file archiver with high compression ratio")
961 (description "p7zip is a command-line port of 7-Zip, a file archiver that
962handles the 7z format which features very high compression ratios.")
963 (license (list license:lgpl2.1+
964 license:gpl2+
965 license:public-domain))))
618089f9
MB
966
967(define-public gzstream
968 (package
969 (name "gzstream")
970 (version "1.5")
971 (source (origin
972 (method url-fetch)
973 (uri
974 ;; No versioned URL, but last release was in 2003.
975 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
976 (file-name (string-append name "-" version ".tgz"))
977 (sha256
978 (base32
979 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
980 (modules '((guix build utils)))
981 (snippet
982 ;; Remove pre-compiled object.
983 '(delete-file "gzstream.o"))))
984 (build-system gnu-build-system)
985 (arguments
986 `(#:test-target "test"
987 #:phases
988 (modify-phases %standard-phases
989 (delete 'configure)
990 (replace 'install
991 (lambda* (#:key outputs #:allow-other-keys)
992 (let* ((out (assoc-ref outputs "out"))
993 (lib (string-append out "/lib"))
994 (include (string-append out "/include")))
995 (install-file "libgzstream.a" lib)
996 (install-file "gzstream.h" include)
997 #t))))))
998 (propagated-inputs `(("zlib" ,zlib)))
999 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1000 (synopsis "Compressed C++ iostream")
1001 (description "gzstream is a small library for providing zlib
1002functionality in a C++ iostream.")
1003 (license license:lgpl2.1+)))