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