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