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