Merge branch '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, 2018 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, 2018 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, 2018 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 <ng0@n0.is>
18 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
19 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
20 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
21 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
22 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
23 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
24 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
25 ;;;
26 ;;; This file is part of GNU Guix.
27 ;;;
28 ;;; GNU Guix is free software; you can redistribute it and/or modify it
29 ;;; under the terms of the GNU General Public License as published by
30 ;;; the Free Software Foundation; either version 3 of the License, or (at
31 ;;; your option) any later version.
32 ;;;
33 ;;; GNU Guix is distributed in the hope that it will be useful, but
34 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 ;;; GNU General Public License for more details.
37 ;;;
38 ;;; You should have received a copy of the GNU General Public License
39 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40
41 (define-module (gnu packages compression)
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix utils)
44 #:use-module (guix packages)
45 #:use-module (guix download)
46 #:use-module (guix git-download)
47 #:use-module (guix build-system ant)
48 #:use-module (guix build-system cmake)
49 #:use-module (guix build-system gnu)
50 #:use-module (guix build-system perl)
51 #:use-module (guix build-system python)
52 #:use-module (gnu packages)
53 #:use-module (gnu packages assembly)
54 #:use-module (gnu packages autotools)
55 #:use-module (gnu packages backup)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages boost)
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages curl)
60 #:use-module (gnu packages file)
61 #:use-module (gnu packages java)
62 #:use-module (gnu packages maths)
63 #:use-module (gnu packages perl)
64 #:use-module (gnu packages perl-check)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages python)
67 #:use-module (gnu packages tls)
68 #:use-module (gnu packages valgrind)
69 #:use-module (ice-9 match)
70 #:use-module ((srfi srfi-1) #:select (last)))
71
72 (define-public zlib
73 (package
74 (name "zlib")
75 (version "1.2.11")
76 (source
77 (origin
78 (method url-fetch)
79 (uri (list (string-append "http://zlib.net/zlib-"
80 version ".tar.gz")
81 (string-append "mirror://sourceforge/libpng/zlib/"
82 version "/zlib-" version ".tar.gz")))
83 (sha256
84 (base32
85 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
86 (build-system gnu-build-system)
87 (arguments
88 `(#:phases
89 (modify-phases %standard-phases
90 (replace 'configure
91 (lambda* (#:key outputs #:allow-other-keys)
92 ;; Zlib's home-made `configure' fails when passed
93 ;; extra flags like `--enable-fast-install', so we need to
94 ;; invoke it with just what it understand.
95 (let ((out (assoc-ref outputs "out")))
96 ;; 'configure' doesn't understand '--host'.
97 ,@(if (%current-target-system)
98 `((setenv "CHOST" ,(%current-target-system)))
99 '())
100 (invoke "./configure"
101 (string-append "--prefix=" out))))))))
102 (home-page "https://zlib.net/")
103 (synopsis "Compression library")
104 (description
105 "zlib is designed to be a free, general-purpose, legally unencumbered --
106 that is, not covered by any patents -- lossless data-compression library for
107 use on virtually any computer hardware and operating system. The zlib data
108 format is itself portable across platforms. Unlike the LZW compression method
109 used in Unix compress(1) and in the GIF image format, the compression method
110 currently used in zlib essentially never expands the data. (LZW can double or
111 triple the file size in extreme cases.) zlib's memory footprint is also
112 independent of the input data and can be reduced, if necessary, at some cost
113 in compression.")
114 (license license:zlib)))
115
116 (define-public minizip
117 (package
118 (name "minizip")
119 (version (package-version zlib))
120 (source (package-source zlib))
121 (build-system gnu-build-system)
122 (arguments
123 `(#:phases
124 (modify-phases %standard-phases
125 (add-after 'unpack 'enter-source
126 (lambda _ (chdir "contrib/minizip") #t))
127 (add-after 'enter-source 'autoreconf
128 (lambda _
129 (zero? (system* "autoreconf" "-vif")))))))
130 (native-inputs
131 `(("autoconf" ,autoconf)
132 ("automake" ,automake)
133 ("libtool" ,libtool)))
134 (propagated-inputs `(("zlib" ,zlib)))
135 (home-page (package-home-page zlib))
136 (synopsis "Zip Compression library")
137 (description
138 "Minizip is a minimalistic library that supports compressing,
139 extracting and viewing ZIP archives. This version is extracted from
140 the @code{zlib} source.")
141 (license (package-license zlib))))
142
143 (define-public fastjar
144 (package
145 (name "fastjar")
146 (version "0.98")
147 (source (origin
148 (method url-fetch)
149 (uri (string-append "mirror://savannah/fastjar/fastjar-"
150 version ".tar.gz"))
151 (sha256
152 (base32
153 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
154 (build-system gnu-build-system)
155 (inputs `(("zlib" ,zlib)))
156 (home-page "https://savannah.nongnu.org/projects/fastjar")
157 (synopsis "Replacement for Sun's 'jar' utility")
158 (description
159 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
160 utility. Instead of being written in Java, FastJar is written in C.")
161 (license license:gpl2+)))
162
163 (define-public libtar
164 (package
165 (name "libtar")
166 (version "1.2.20")
167 (source (origin
168 (method url-fetch)
169 (uri (list
170 (string-append
171 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
172 version ".tar.gz")
173 (string-append
174 "mirror://debian/pool/main/libt/libtar/libtar_"
175 version ".orig.tar.gz")))
176 (sha256
177 (base32
178 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
179 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
180 (build-system gnu-build-system)
181 (arguments
182 `(#:tests? #f ;no "check" target
183 #:phases
184 (modify-phases %standard-phases
185 (add-after 'unpack 'autoconf
186 (lambda _ (zero? (system* "sh" "autoreconf" "-vfi")))))))
187 (native-inputs
188 `(("autoconf" ,autoconf)
189 ("automake" ,automake)
190 ("libtool" ,libtool)))
191 (inputs
192 `(("zlib" ,zlib)))
193 (synopsis "C library for manipulating POSIX tar files")
194 (description
195 "libtar is a C library for manipulating POSIX tar files. It handles
196 adding and extracting files to/from a tar archive.")
197 (home-page "https://repo.or.cz/libtar.git")
198 (license license:bsd-3)))
199
200 (define-public gzip
201 (package
202 (name "gzip")
203 (version "1.9")
204 (source (origin
205 (method url-fetch)
206 (uri (string-append "mirror://gnu/gzip/gzip-"
207 version ".tar.xz"))
208 (sha256
209 (base32
210 "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
211 (build-system gnu-build-system)
212 (synopsis "General file (de)compression (using lzw)")
213 (arguments
214 ;; FIXME: The test suite wants `less', and optionally Perl.
215 '(#:tests? #f
216 #:phases
217 (modify-phases %standard-phases
218 (add-after 'unpack 'use-absolute-name-of-gzip
219 (lambda* (#:key outputs #:allow-other-keys)
220 (substitute* "gunzip.in"
221 (("exec gzip")
222 (string-append "exec " (assoc-ref outputs "out")
223 "/bin/gzip")))
224 #t)))))
225 (description
226 "GNU Gzip provides data compression and decompression utilities; the
227 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
228 file; as a result, it is often used in conjunction with \"tar\", resulting in
229 \".tar.gz\" or \".tgz\", etc.")
230 (license license:gpl3+)
231 (home-page "https://www.gnu.org/software/gzip/")))
232
233 (define-public bzip2
234 (package
235 (name "bzip2")
236 (version "1.0.6")
237 (source (origin
238 (method url-fetch)
239 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
240 version ".tar.gz"))
241 (sha256
242 (base32
243 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
244 (build-system gnu-build-system)
245 (arguments
246 `(#:modules ((guix build gnu-build-system)
247 (guix build utils)
248 (srfi srfi-1))
249 #:phases
250 (modify-phases %standard-phases
251 (replace 'configure
252 (lambda* (#:key target #:allow-other-keys)
253 (when ,(%current-target-system)
254 ;; Cross-compilation: use the cross tools.
255 (substitute* (find-files "." "Makefile")
256 (("CC=.*$")
257 (string-append "CC = " target "-gcc\n"))
258 (("AR=.*$")
259 (string-append "AR = " target "-ar\n"))
260 (("RANLIB=.*$")
261 (string-append "RANLIB = " target "-ranlib\n"))
262 (("^all:(.*)test" _ prerequisites)
263 ;; Remove 'all' -> 'test' dependency.
264 (string-append "all:" prerequisites "\n"))))
265 #t))
266 (add-before 'build 'build-shared-lib
267 (lambda* (#:key inputs #:allow-other-keys)
268 (patch-makefile-SHELL "Makefile-libbz2_so")
269 (invoke "make" "-f" "Makefile-libbz2_so")))
270 (add-after 'install 'install-shared-lib
271 (lambda* (#:key outputs #:allow-other-keys)
272 (let* ((out (assoc-ref outputs "out"))
273 (libdir (string-append out "/lib")))
274 (for-each (lambda (file)
275 (format #t "installing `~a' to `~a'~%"
276 (basename file) libdir)
277 (install-file file libdir))
278 (find-files "." "^libbz2\\.so")))
279 #t))
280 (add-after 'install-shared-lib 'patch-scripts
281 (lambda* (#:key outputs inputs #:allow-other-keys)
282 (let* ((out (assoc-ref outputs "out")))
283 (substitute* (string-append out "/bin/bzdiff")
284 (("/bin/rm") "rm")))
285 #t)))
286
287 #:make-flags (list (string-append "PREFIX="
288 (assoc-ref %outputs "out")))
289
290 ;; Don't attempt to run the tests when cross-compiling.
291 ,@(if (%current-target-system)
292 '(#:tests? #f)
293 '())))
294 (synopsis "High-quality data compression program")
295 (description
296 "bzip2 is a freely available, patent free (see below), high-quality data
297 compressor. It typically compresses files to within 10% to 15% of the best
298 available techniques (the PPM family of statistical compressors), whilst
299 being around twice as fast at compression and six times faster at
300 decompression.")
301 (license (license:non-copyleft "file://LICENSE"
302 "See LICENSE in the distribution."))
303 (home-page "http://www.bzip.org/")))
304
305 (define-public lbzip2
306 (package
307 (name "lbzip2")
308 (version "2.5")
309 (source (origin
310 (method url-fetch)
311 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
312 version ".tar.gz"))
313 (sha256
314 (base32
315 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))))
316 (build-system gnu-build-system)
317 (synopsis "Parallel bzip2 compression utility")
318 (description
319 "lbzip2 is a multi-threaded compression utility with support for the
320 bzip2 compressed file format. lbzip2 can process standard bz2 files in
321 parallel. It uses POSIX threading model (pthreads), which allows it to take
322 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
323 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
324 compatible with bzip2 – both at file format and command line level.")
325 (home-page "http://www.lbzip2.org/")
326 (license license:gpl3+)))
327
328 (define-public pbzip2
329 (package
330 (name "pbzip2")
331 (version "1.1.13")
332 (source (origin
333 (method url-fetch)
334 (uri (string-append "https://launchpad.net/pbzip2/"
335 (version-major+minor version) "/" version
336 "/+download/" name "-" version ".tar.gz"))
337 (sha256
338 (base32
339 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
340 (build-system gnu-build-system)
341 (inputs
342 `(("bzip2" ,bzip2)))
343 (arguments
344 `(#:tests? #f ; no tests
345 #:phases (modify-phases %standard-phases
346 (delete 'configure)) ; no configure script
347 #:make-flags (list (string-append "PREFIX=" %output))))
348 (home-page "http://compression.ca/pbzip2/")
349 (synopsis "Parallel bzip2 implementation")
350 (description
351 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
352 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
353 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
354 compressed with pbzip2 can be decompressed with bzip2).")
355 (license (license:non-copyleft "file://COPYING"
356 "See COPYING in the distribution."))))
357
358 (define-public xz
359 (package
360 (name "xz")
361 (version "5.2.3")
362 (source (origin
363 (method url-fetch)
364 (uri (list (string-append "http://tukaani.org/xz/xz-" version
365 ".tar.gz")
366 (string-append "http://multiprecision.org/guix/xz-"
367 version ".tar.gz")))
368 (sha256
369 (base32
370 "1jr8pxnz55ifc8cvp3ivgl79ph9iik5aypsc9cma228aglsqp4ki"))))
371 (build-system gnu-build-system)
372 (synopsis "General-purpose data compression")
373 (description
374 "XZ Utils is free general-purpose data compression software with high
375 compression ratio. XZ Utils were written for POSIX-like systems, but also
376 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
377
378 The core of the XZ Utils compression code is based on LZMA SDK, but it has
379 been modified quite a lot to be suitable for XZ Utils. The primary
380 compression algorithm is currently LZMA2, which is used inside the .xz
381 container format. With typical files, XZ Utils create 30 % smaller output
382 than gzip and 15 % smaller output than bzip2.")
383 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
384 (home-page "https://tukaani.org/xz/")))
385
386 (define-public lzo
387 (package
388 (name "lzo")
389 (version "2.10")
390 (source
391 (origin
392 (method url-fetch)
393 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
394 version ".tar.gz"))
395 (sha256
396 (base32
397 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
398 (build-system gnu-build-system)
399 (arguments '(#:configure-flags '("--enable-shared")))
400 (home-page "http://www.oberhumer.com/opensource/lzo")
401 (synopsis
402 "Data compression library suitable for real-time data de-/compression")
403 (description
404 "LZO is a data compression library which is suitable for data
405 de-/compression in real-time. This means it favours speed over
406 compression ratio.
407
408 LZO is written in ANSI C. Both the source code and the compressed data
409 format are designed to be portable across platforms.")
410 (license license:gpl2+)))
411
412 (define-public python-lzo
413 (package
414 (name "python-lzo")
415 (version "1.11")
416 (source
417 (origin
418 (method url-fetch)
419 (uri (pypi-uri "python-lzo" version))
420 (sha256
421 (base32
422 "11p3ifg14p086byhhin6azx5svlkg8dzw2b5abixik97xd6fm81q"))))
423 (build-system python-build-system)
424 (arguments
425 `(#:test-target "check"
426 #:phases
427 (modify-phases %standard-phases
428 (add-after 'unpack 'patch-setuppy
429 (lambda _
430 (substitute* "setup.py"
431 (("include_dirs.append\\(.*\\)")
432 (string-append "include_dirs.append('"
433 (assoc-ref %build-inputs "lzo")
434 "/include/lzo"
435 "')")))
436 #t)))))
437 (inputs
438 `(("lzo" ,lzo)))
439 (home-page "https://github.com/jd-boyd/python-lzo")
440 (synopsis "Python bindings for the LZO data compression library")
441 (description
442 "Python-LZO provides Python bindings for LZO, i.e. you can access
443 the LZO library from your Python scripts thereby compressing ordinary
444 Python strings.")
445 (license license:gpl2+)))
446
447 (define-public python2-lzo
448 (package-with-python2 python-lzo))
449
450 (define-public lzop
451 (package
452 (name "lzop")
453 (version "1.04")
454 (source
455 (origin
456 (method url-fetch)
457 (uri (string-append "http://www.lzop.org/download/lzop-"
458 version ".tar.gz"))
459 (sha256
460 (base32
461 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
462 (build-system gnu-build-system)
463 (inputs `(("lzo" ,lzo)))
464 (home-page "https://www.lzop.org/")
465 (synopsis "Compress or expand files")
466 (description
467 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
468 LZO data compression library for compression services, and its main advantages
469 over gzip are much higher compression and decompression speed (at the cost of
470 some compression ratio).")
471 (license license:gpl2+)))
472
473 (define-public lzip
474 (package
475 (name "lzip")
476 (version "1.20")
477 (source (origin
478 (method url-fetch)
479 (uri (string-append "mirror://savannah/lzip/lzip-"
480 version ".tar.gz"))
481 (sha256
482 (base32
483 "0319q59kb8g324wnj7xzbr7vvlx5bcs13lr34j0zb3kqlyjq2fy9"))))
484 (build-system gnu-build-system)
485 (home-page "https://www.nongnu.org/lzip/lzip.html")
486 (synopsis "Lossless data compressor based on the LZMA algorithm")
487 (description
488 "Lzip is a lossless data compressor with a user interface similar to the
489 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
490 more than bzip2, which makes it well-suited for software distribution and data
491 archiving. Lzip is a clean implementation of the LZMA algorithm.")
492 (license license:gpl3+)))
493
494 (define-public lziprecover
495 (package
496 (name "lziprecover")
497 (version "1.20")
498 (source (origin
499 (method url-fetch)
500 (uri (string-append "mirror://savannah/lzip/" name "/"
501 name "-" version ".tar.gz"))
502 (sha256
503 (base32
504 "0fpnmdxayvd1ff0rk9606dvr431ji6b1v71km4ww244rih1rmmzz"))))
505 (build-system gnu-build-system)
506 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
507 (synopsis "Recover and decompress data from damaged lzip files")
508 (description
509 "Lziprecover is a data recovery tool and decompressor for files in the lzip
510 compressed data format (.lz). It can test the integrity of lzip files, extract
511 data from damaged ones, and repair most files with small errors (up to one
512 single-byte error per member) entirely.
513
514 Lziprecover is not a replacement for regular backups, but a last line of defence
515 when even the backups are corrupt. It can recover files by merging the good
516 parts of two or more damaged copies, such as can be easily produced by running
517 @command{ddrescue} on a failing device.
518
519 This package also includes @command{unzcrash}, a tool to test the robustness of
520 decompressors when faced with corrupted input.")
521 (license (list license:bsd-2 ; arg_parser.{cc,h}
522 license:gpl2+)))) ; everything else
523
524 (define-public sharutils
525 (package
526 (name "sharutils")
527 (version "4.15.2")
528 (source
529 (origin
530 (method url-fetch)
531 (uri (string-append "mirror://gnu/sharutils/sharutils-"
532 version ".tar.xz"))
533 (sha256
534 (base32
535 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))))
536 (build-system gnu-build-system)
537 (inputs
538 `(("which" ,which)))
539 (arguments
540 `(#:phases
541 (modify-phases %standard-phases
542 (add-after 'patch-source-shebangs 'unpatch-source-shebang
543 ;; revert the patch-shebang phase on a script which is
544 ;; in fact test data
545 (lambda _
546 (substitute* "tests/shar-1.ok"
547 (((which "sh")) "/bin/sh"))
548 #t)))))
549 (home-page "https://www.gnu.org/software/sharutils/")
550 (synopsis "Archives in shell scripts, uuencode/uudecode")
551 (description
552 "GNU sharutils is a package for creating and manipulating shell
553 archives that can be readily emailed. A shell archive is a file that can be
554 processed by a Bourne-type shell to unpack the original collection of files.
555 This package is mostly for compatibility and historical interest.")
556 (license license:gpl3+)))
557
558 (define-public sfarklib
559 (package
560 (name "sfarklib")
561 (version "2.24")
562 (source (origin
563 (method url-fetch)
564 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
565 version ".tar.gz"))
566 (file-name (string-append name "-" version ".tar.gz"))
567 (sha256
568 (base32
569 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
570 (build-system gnu-build-system)
571 (arguments
572 `(#:tests? #f ;no "check" target
573 #:phases
574 (modify-phases %standard-phases
575 (replace 'configure
576 (lambda* (#:key outputs #:allow-other-keys)
577 (substitute* "Makefile"
578 (("/usr/local") (assoc-ref outputs "out")))
579 #t)))))
580 (inputs
581 `(("zlib" ,zlib)))
582 (home-page "https://github.com/raboof/sfArkLib")
583 (synopsis "Library for SoundFont decompression")
584 (description
585 "SfArkLib is a C++ library for decompressing SoundFont files compressed
586 with the sfArk algorithm.")
587 (license license:gpl3+)))
588
589 (define-public sfarkxtc
590 (let ((commit "b5e0a2ba3921f019d74d4b92bd31c36dd19d2cf1"))
591 (package
592 (name "sfarkxtc")
593 (version (string-take commit 10))
594 (source (origin
595 ;; There are no release tarballs, so we just fetch the latest
596 ;; commit at this time.
597 (method git-fetch)
598 (uri (git-reference
599 (url "https://github.com/raboof/sfarkxtc.git")
600 (commit commit)))
601 (file-name (git-file-name name version))
602 (sha256
603 (base32
604 "0f5x6i46qfl6ry21s7g2p4sd4b2r1g4fb03yqi2vv4kq3saryhvj"))))
605 (build-system gnu-build-system)
606 (arguments
607 `(#:tests? #f ;no "check" target
608 #:phases
609 (modify-phases %standard-phases
610 (replace 'configure
611 (lambda* (#:key outputs #:allow-other-keys)
612 (substitute* "Makefile"
613 (("/usr/local") (assoc-ref outputs "out")))
614 #t)))))
615 (inputs
616 `(("zlib" ,zlib)
617 ("sfarklib" ,sfarklib)))
618 (home-page "https://github.com/raboof/sfarkxtc")
619 (synopsis "Basic sfArk decompressor")
620 (description "SfArk extractor converts SoundFonts in the compressed legacy
621 sfArk file format to the uncompressed sf2 format.")
622 (license license:gpl3+))))
623
624 (define-public libmspack
625 (package
626 (name "libmspack")
627 (version "0.6")
628 (source
629 (origin
630 (method url-fetch)
631 (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
632 version "alpha.tar.gz"))
633 (sha256
634 (base32 "08gr2pcinas6bdqz3k0286g5cnksmcx813skmdwyca6bmj1fxnqy"))))
635 (build-system gnu-build-system)
636 (home-page "http://www.cabextract.org.uk/libmspack/")
637 (synopsis "Compression tools for some formats used by Microsoft")
638 (description
639 "The purpose of libmspack is to provide both compression and
640 decompression of some loosely related file formats used by Microsoft.")
641 (license license:lgpl2.1+)))
642
643 (define-public perl-compress-raw-bzip2
644 (package
645 (name "perl-compress-raw-bzip2")
646 (version "2.074")
647 (source
648 (origin
649 (method url-fetch)
650 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
651 "Compress-Raw-Bzip2-" version ".tar.gz"))
652 (sha256
653 (base32
654 "0b5jwqf15zr787acnx8sfyy2zavdd7gfkd98n1dgy8fs6r8yb8a4"))))
655 (build-system perl-build-system)
656 ;; TODO: Use our bzip2 package.
657 (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
658 (synopsis "Low-level interface to bzip2 compression library")
659 (description "This module provides a Perl interface to the bzip2
660 compression library.")
661 (license license:perl-license)))
662
663 (define-public perl-compress-raw-zlib
664 (package
665 (name "perl-compress-raw-zlib")
666 (version "2.076")
667 (source
668 (origin
669 (method url-fetch)
670 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
671 "Compress-Raw-Zlib-" version ".tar.gz"))
672 (sha256
673 (base32
674 "1al2h0i6mspldmlf5c09fy5a4j8swsxd31v6zi8zx9iyqk1lw7in"))))
675 (build-system perl-build-system)
676 (inputs
677 `(("zlib" ,zlib)))
678 (arguments
679 `(#:phases (modify-phases %standard-phases
680 (add-before
681 'configure 'configure-zlib
682 (lambda* (#:key inputs #:allow-other-keys)
683 (call-with-output-file "config.in"
684 (lambda (port)
685 (format port "
686 BUILD_ZLIB = False
687 INCLUDE = ~a/include
688 LIB = ~:*~a/lib
689 OLD_ZLIB = False
690 GZIP_OS_CODE = AUTO_DETECT"
691 (assoc-ref inputs "zlib")))))))))
692 (home-page "http://search.cpan.org/dist/Compress-Raw-Zlib")
693 (synopsis "Low-level interface to zlib compression library")
694 (description "This module provides a Perl interface to the zlib
695 compression library.")
696 (license license:perl-license)))
697
698 (define-public perl-io-compress
699 (package
700 (name "perl-io-compress")
701 (version "2.074")
702 (source
703 (origin
704 (method url-fetch)
705 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
706 "IO-Compress-" version ".tar.gz"))
707 (sha256
708 (base32
709 "1wlpy2026djfmq0bjync531yq6s695jf7bcnpvjphrasi776igdl"))))
710 (build-system perl-build-system)
711 (propagated-inputs
712 `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib) ; >=2.074
713 ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.074
714 (home-page "http://search.cpan.org/dist/IO-Compress")
715 (synopsis "IO Interface to compressed files/buffers")
716 (description "IO-Compress provides a Perl interface to allow reading and
717 writing of compressed data created with the zlib and bzip2 libraries.")
718 (license license:perl-license)))
719
720 (define-public lz4
721 (package
722 (name "lz4")
723 (version "1.8.1.2")
724 (source
725 (origin
726 (method url-fetch)
727 (uri (string-append "https://github.com/lz4/lz4/archive/"
728 "v" version ".tar.gz"))
729 (sha256
730 (base32
731 "1y93h6dyi3026gvpzdv310ldcylnnhwf32n75mdjf8x9fvkskwqj"))
732 (file-name (string-append name "-" version ".tar.gz"))))
733 (build-system gnu-build-system)
734 (native-inputs `(("valgrind" ,valgrind))) ; for tests
735 (arguments
736 `(#:test-target "test"
737 #:make-flags (list "CC=gcc"
738 (string-append "prefix=" (assoc-ref %outputs "out")))
739 #:phases (modify-phases %standard-phases
740 (delete 'configure)))) ; no configure script
741 (home-page "http://www.lz4.org")
742 (synopsis "Compression algorithm focused on speed")
743 (description "LZ4 is a lossless compression algorithm, providing
744 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
745 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
746 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
747 time for compression ratio.")
748 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
749 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
750 (license (list license:bsd-2 license:gpl2+))))
751
752 (define-public python-lz4
753 (package
754 (name "python-lz4")
755 (version "0.10.1")
756 (source
757 (origin
758 (method url-fetch)
759 (uri (pypi-uri "lz4" version))
760 (sha256
761 (base32
762 "0ghv1xbaq693kgww1x9c22bplz479ls9szjsaa4ig778ls834hm0"))))
763 (build-system python-build-system)
764 (native-inputs
765 `(("python-nose" ,python-nose)
766 ("python-setuptools-scm" ,python-setuptools-scm)))
767 (home-page "https://github.com/python-lz4/python-lz4")
768 (synopsis "LZ4 bindings for Python")
769 (description
770 "This package provides python bindings for the lz4 compression library
771 by Yann Collet. The project contains bindings for the LZ4 block format and
772 the LZ4 frame format.")
773 (license license:bsd-3)))
774
775 (define-public python2-lz4
776 (package-with-python2 python-lz4))
777
778 (define-public python-lzstring
779 (package
780 (name "python-lzstring")
781 (version "1.0.3")
782 (source
783 (origin
784 (method url-fetch)
785 (uri (pypi-uri "lzstring" version))
786 (sha256
787 (base32
788 "1d3ck454y41mii0gcjabpmp2skb7n0f9zk232gycqdv8z2jxakfm"))))
789 (build-system python-build-system)
790 (propagated-inputs
791 `(("python-future" ,python-future)))
792 (home-page "https://github.com/gkovacs/lz-string-python")
793 (synopsis "String compression")
794 (description "Lz-string is a string compressor library for Python.")
795 (license license:expat)))
796
797 (define-public python2-lzstring
798 (package-with-python2 python-lzstring))
799
800 (define-public squashfs-tools
801 (package
802 (name "squashfs-tools")
803 (version "4.3")
804 (source (origin
805 (method url-fetch)
806 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
807 "squashfs" version "/"
808 "squashfs" version ".tar.gz"))
809 (sha256
810 (base32
811 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
812 (build-system gnu-build-system)
813 (arguments
814 '(#:tests? #f ; no check target
815 #:make-flags
816 (list "CC=gcc"
817 "XZ_SUPPORT=1"
818 "LZO_SUPPORT=1"
819 "LZ4_SUPPORT=1"
820 (string-append "INSTALL_DIR=" %output "/bin"))
821 #:phases
822 (modify-phases %standard-phases
823 (replace 'configure
824 (lambda _
825 (chdir "squashfs-tools"))))))
826 (inputs
827 `(("lz4" ,lz4)
828 ("lzo" ,lzo)
829 ("xz" ,xz)
830 ("zlib" ,zlib)))
831 (home-page "http://squashfs.sourceforge.net/")
832 (synopsis "Tools to create and extract squashfs file systems")
833 (description
834 "Squashfs is a highly compressed read-only file system for Linux. It uses
835 zlib to compress files, inodes, and directories. All blocks are packed to
836 minimize the data overhead, and block sizes of between 4K and 1M are supported.
837 It is intended to be used for archival use, for live CDs, and for embedded
838 systems where low overhead is needed. This package allows you to create and
839 extract such file systems.")
840 (license license:gpl2+)))
841
842 (define-public pigz
843 (package
844 (name "pigz")
845 (version "2.4")
846 (source (origin
847 (method url-fetch)
848 (uri (string-append "http://zlib.net/pigz/"
849 name "-" version ".tar.gz"))
850 (sha256
851 (base32
852 "0wsgw5vwl23jrnpsvd8v3xcp5k4waw5mk0164fynjhkv58i1dy54"))))
853 (build-system gnu-build-system)
854 (arguments
855 `(#:phases
856 (modify-phases %standard-phases
857 (delete 'configure)
858 (replace 'install
859 (lambda* (#:key outputs #:allow-other-keys)
860 (let* ((out (assoc-ref outputs "out"))
861 (bin (string-append out "/bin"))
862 (man (string-append out "/share/man/man1")))
863 (install-file "pigz" bin)
864 (symlink "pigz" (string-append bin "/unpigz"))
865 (install-file "pigz.1" man)
866 #t))))
867 #:make-flags (list "CC=gcc")
868 #:test-target "tests"))
869 (inputs `(("zlib" ,zlib)))
870 (home-page "https://zlib.net/pigz/")
871 (synopsis "Parallel implementation of gzip")
872 (description
873 "This package provides a parallel implementation of gzip that exploits
874 multiple processors and multiple cores when compressing data.")
875
876 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
877 ;; written by Mark Adler, are under another non-copyleft license.
878 (license license:asl2.0)))
879
880 (define-public pixz
881 (package
882 (name "pixz")
883 (version "1.0.6")
884 (source (origin
885 (method url-fetch)
886 (uri (string-append
887 "https://github.com/vasi/pixz/releases/download/v" version
888 "/pixz-" version ".tar.xz"))
889 (sha256
890 (base32
891 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
892 (build-system gnu-build-system)
893 (native-inputs
894 `(("pkg-config" ,pkg-config)
895 ("libarchive" ,libarchive)))
896 (home-page "https://github.com/vasi/pixz")
897 (synopsis "Parallel indexing implementation of LZMA")
898 (description
899 "The existing XZ Utils provide great compression in the .xz file format,
900 but they produce just one big block of compressed data. Pixz instead produces
901 a collection of smaller blocks which makes random access to the original data
902 possible and can compress in parallel. This is especially useful for large
903 tarballs.")
904 (license license:bsd-2)))
905
906 (define-public brotli
907 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
908 (revision "1"))
909 (package
910 (name "brotli")
911 (version (string-append "0.1-" revision "."
912 (string-take commit 7)))
913 (source (origin
914 (method git-fetch)
915 (uri (git-reference
916 (url "https://github.com/bagder/libbrotli.git")
917 (commit commit)
918 (recursive? #t)))
919 (file-name (string-append name "-" version ".tar.xz"))
920 (sha256
921 (base32
922 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
923 (modules '((guix build utils)))
924 (snippet '(begin
925 ;; This is a recursive submodule that is
926 ;; unnecessary for this package, so delete it.
927 (delete-file-recursively "brotli/terryfy")
928 #t))))
929 (build-system gnu-build-system)
930 (native-inputs
931 `(("autoconf" ,autoconf)
932 ("automake" ,automake)
933 ("libtool" ,libtool)))
934 (arguments
935 `(#:phases (modify-phases %standard-phases
936 (add-after 'unpack 'autogen
937 (lambda _
938 (mkdir "m4")
939 (zero? (system* "autoreconf" "-vfi")))))))
940 (home-page "https://github.com/bagder/libbrotli/")
941 (synopsis "Implementation of the Brotli compression algorithm")
942 (description
943 "Brotli is a general-purpose lossless compression algorithm. It is
944 similar in speed to deflate but offers denser compression. This package
945 provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
946 respectively, based on the reference implementation from Google.")
947 (license license:expat))))
948
949 (define-public cabextract
950 (package
951 (name "cabextract")
952 (version "1.6")
953 (source (origin
954 (method url-fetch)
955 (uri (string-append
956 "http://cabextract.org.uk/cabextract-" version ".tar.gz"))
957 (sha256
958 (base32
959 "1ysmmz25fjghq7mxb2anyyvr1ljxqxzi4piwjhk0sdamcnsn3rnf"))))
960 (build-system gnu-build-system)
961 (arguments '(#:configure-flags '("--with-external-libmspack")))
962 (native-inputs
963 `(("pkg-config" ,pkg-config)))
964 (inputs
965 `(("libmspack" ,libmspack)))
966 (home-page "http://www.cabextract.org.uk/")
967 (synopsis "Tool to unpack Cabinet archives")
968 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
969 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
970 (license license:gpl3+)))
971
972 (define-public xdelta
973 (package
974 (name "xdelta")
975 (version "3.1.0")
976 (source
977 (origin
978 (method url-fetch)
979 (uri (string-append "https://github.com/jmacd/xdelta/archive/v"
980 version ".tar.gz"))
981 (sha256
982 (base32
983 "17g2pbbqy6h20qgdjq7ykib7kg5ajh8fwbsfgyjqg8pwg19wy5bm"))
984 (file-name (string-append name "-" version ".tar.gz"))
985 (snippet
986 ;; This file isn't freely distributable and has no effect on building.
987 '(begin
988 (delete-file "xdelta3/draft-korn-vcdiff.txt")
989 #t))))
990 (build-system gnu-build-system)
991 (native-inputs
992 `(("autoconf" ,autoconf)
993 ("automake" ,automake)))
994 (arguments
995 `(#:phases
996 (modify-phases %standard-phases
997 (add-after 'unpack 'enter-build-directory
998 (lambda _ (chdir "xdelta3")))
999 (add-after 'enter-build-directory 'autoconf
1000 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
1001 (home-page "http://xdelta.org")
1002 (synopsis "Delta encoder for binary files")
1003 (description "xdelta encodes only the differences between two binary files
1004 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1005 also be used to apply such patches. xdelta is similar to @command{diff} and
1006 @command{patch}, but is not limited to plain text and does not generate
1007 human-readable output.")
1008 (license license:asl2.0)))
1009
1010 (define-public lrzip
1011 (package
1012 (name "lrzip")
1013 (version "0.631")
1014 (source
1015 (origin
1016 (method url-fetch)
1017 (uri (string-append
1018 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
1019 (sha256
1020 (base32
1021 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))
1022 (patches (search-patches "lrzip-CVE-2017-8842.patch"))))
1023 (build-system gnu-build-system)
1024 (native-inputs
1025 `(;; nasm is only required when building for 32-bit x86 platforms
1026 ,@(if (string-prefix? "i686" (or (%current-target-system)
1027 (%current-system)))
1028 `(("nasm" ,nasm))
1029 '())
1030 ("perl" ,perl)))
1031 (inputs
1032 `(("bzip2" ,bzip2)
1033 ("lzo" ,lzo)
1034 ("zlib" ,zlib)))
1035 (home-page "http://ck.kolivas.org/apps/lrzip/")
1036 (synopsis "Large file compressor with a very high compression ratio")
1037 (description "lrzip is a compression utility that uses long-range
1038 redundancy reduction to improve the subsequent compression ratio of
1039 larger files. It can then further compress the result with the ZPAQ or
1040 LZMA algorithms for maximum compression, or LZO for maximum speed. This
1041 choice between size or speed allows for either better compression than
1042 even LZMA can provide, or a higher speed than gzip while compressing as
1043 well as bzip2.")
1044 (license (list license:gpl3+
1045 license:public-domain)))) ; most files in lzma/
1046
1047 (define-public bitshuffle
1048 (package
1049 (name "bitshuffle")
1050 (version "0.3.4")
1051 (source (origin
1052 (method url-fetch)
1053 (uri (pypi-uri "bitshuffle" version))
1054 (sha256
1055 (base32
1056 "0ydawb01ghsvmw0lraczhrgvkjj97bpg98f1qqs1cnfp953mdd5v"))))
1057 (build-system python-build-system)
1058 (arguments
1059 `(#:tests? #f)) ; fail: https://github.com/h5py/h5py/issues/769
1060 (inputs
1061 `(("numpy" ,python-numpy)
1062 ("h5py" ,python-h5py)
1063 ("hdf5" ,hdf5)))
1064 (native-inputs
1065 `(("cython" ,python-cython)))
1066 (home-page "https://github.com/kiyo-masui/bitshuffle")
1067 (synopsis "Filter for improving compression of typed binary data")
1068 (description "Bitshuffle is an algorithm that rearranges typed, binary data
1069 for improving compression, as well as a python/C package that implements this
1070 algorithm within the Numpy framework.")
1071 (license license:expat)))
1072
1073 (define-public snappy
1074 (package
1075 (name "snappy")
1076 (version "1.1.7")
1077 (source (origin
1078 (method url-fetch)
1079 (uri (string-append "https://github.com/google/snappy/archive/"
1080 version ".tar.gz"))
1081 (file-name (string-append "snappy-" version ".tar.gz"))
1082 (sha256
1083 (base32
1084 "1m7rcdqzkys5lspj8jcsaah8w33zh28s771bw0ga2lgzfgl05yix"))))
1085 (build-system cmake-build-system)
1086 (arguments
1087 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
1088 (home-page "https://github.com/google/snappy")
1089 (synopsis "Fast compressor/decompressor")
1090 (description "Snappy is a compression/decompression library. It does not
1091 aim for maximum compression, or compatibility with any other compression library;
1092 instead, it aims for very high speeds and reasonable compression. For instance,
1093 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1094 for most inputs, but the resulting compressed files are anywhere from 20% to
1095 100% bigger.")
1096 (license license:asl2.0)))
1097
1098 (define bitshuffle-for-snappy
1099 (package
1100 (inherit bitshuffle)
1101 (name "bitshuffle-for-snappy")
1102 (build-system gnu-build-system)
1103 (arguments
1104 `(#:tests? #f
1105 #:phases
1106 (modify-phases %standard-phases
1107 (replace 'configure
1108 (lambda* (#:key outputs #:allow-other-keys)
1109 (with-output-to-file "Makefile"
1110 (lambda _
1111 (format #t "\
1112 libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o
1113 \tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^
1114
1115 %.o: %.c
1116 \tgcc -O3 -ffast-math -std=c99 -fPIC -Isrc -Ilz4 -c $< -o $@
1117
1118 PREFIX:=~a
1119 LIBDIR:=$(PREFIX)/lib
1120 INCLUDEDIR:=$(PREFIX)/include
1121
1122 install: libbitshuffle.so
1123 \tinstall -dm755 $(LIBDIR)
1124 \tinstall -dm755 $(INCLUDEDIR)
1125 \tinstall -m755 libbitshuffle.so $(LIBDIR)
1126 \tinstall -m644 src/bitshuffle.h $(INCLUDEDIR)
1127 \tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR)
1128 \tinstall -m644 src/iochain.h $(INCLUDEDIR)
1129 \tinstall -m644 lz4/lz4.h $(INCLUDEDIR)
1130 " (assoc-ref outputs "out"))))
1131 #t)))))
1132 (inputs '())
1133 (native-inputs '())))
1134
1135 (define-public java-snappy
1136 (package
1137 (name "java-snappy")
1138 (version "1.1.7")
1139 (source (origin
1140 (method url-fetch)
1141 (uri (string-append "https://github.com/xerial/snappy-java/archive/"
1142 version ".tar.gz"))
1143 (file-name (string-append name "-" version ".tar.gz"))
1144 (sha256
1145 (base32
1146 "0q4kxz2n97czf6g5gzq0d8yz22cgiaj7wp51rzsswh3bi99bpgg5"))))
1147 (build-system ant-build-system)
1148 (arguments
1149 `(#:jar-name "snappy.jar"
1150 #:source-dir "src/main/java"
1151 #:phases
1152 (modify-phases %standard-phases
1153 (add-before 'build 'remove-binaries
1154 (lambda _
1155 (delete-file "lib/org/xerial/snappy/OSInfo.class")
1156 (delete-file-recursively "src/main/resources/org/xerial/snappy/native")
1157 #t))
1158 (add-before 'build 'build-jni
1159 (lambda _
1160 ;; Rebuild one of the binaries we removed earlier
1161 (system* "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
1162 "-d" "lib")
1163 ;; Link to the dynamic bitshuffle and snappy, not the static ones
1164 (substitute* "Makefile.common"
1165 (("-shared")
1166 "-shared -lbitshuffle -lsnappy"))
1167 (substitute* "Makefile"
1168 ;; Don't try to use git, don't download bitshuffle source
1169 ;; and don't build it.
1170 (("\\$\\(SNAPPY_GIT_UNPACKED\\) ")
1171 "")
1172 ((": \\$\\(SNAPPY_GIT_UNPACKED\\)")
1173 ":")
1174 (("\\$\\(BITSHUFFLE_UNPACKED\\) ")
1175 "")
1176 ((": \\$\\(SNAPPY_SOURCE_CONFIGURED\\)") ":")
1177 ;; What we actually want to build
1178 (("SNAPPY_OBJ:=.*")
1179 "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, \
1180 SnappyNative.o BitShuffleNative.o)\n")
1181 ;; Since we removed the directory structure in "native" during
1182 ;; the previous phase, we need to recreate it.
1183 (("NAME\\): \\$\\(SNAPPY_OBJ\\)")
1184 "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)"))
1185 ;; Finally we can run the Makefile to build the dynamic library.
1186 ;; Use the -nocmake target to avoid a dependency on cmake,
1187 ;; which in turn requires the "git_unpacked" directory.
1188 (invoke "make" "native-nocmake")))
1189 ;; Once we have built the shared library, we need to place it in the
1190 ;; "build" directory so it can be added to the jar file.
1191 (add-after 'build-jni 'copy-jni
1192 (lambda _
1193 (copy-recursively "src/main/resources/org/xerial/snappy/native"
1194 "build/classes/org/xerial/snappy/native")))
1195 (add-before 'check 'fix-failing
1196 (lambda _
1197 (with-directory-excursion "src/test/java/org/xerial/snappy"
1198 ;; This package assumes maven build, which puts results in "target".
1199 ;; We put them in "build" instead, so fix that.
1200 (substitute* "SnappyLoaderTest.java"
1201 (("target/classes") "build/classes"))
1202 ;; This requires Hadoop, which is not in Guix yet.
1203 (delete-file "SnappyHadoopCompatibleOutputStreamTest.java"))
1204 #t)))))
1205 (inputs
1206 `(("osgi-framework" ,java-osgi-framework)))
1207 (propagated-inputs
1208 `(("bitshuffle" ,bitshuffle-for-snappy)
1209 ("snappy" ,snappy)))
1210 (native-inputs
1211 `(("junit" ,java-junit)
1212 ("hamcrest" ,java-hamcrest-core)
1213 ("xerial-core" ,java-xerial-core)
1214 ("classworlds" ,java-plexus-classworlds)
1215 ("commons-lang" ,java-commons-lang)
1216 ("commons-io" ,java-commons-io)
1217 ("perl" ,perl)))
1218 (home-page "https://github.com/xerial/snappy-java")
1219 (synopsis "Compression/decompression algorithm in Java")
1220 (description "Snappy-java is a Java port of the snappy, a fast C++
1221 compresser/decompresser.")
1222 (license license:asl2.0)))
1223
1224 (define-public java-snappy-1
1225 (package
1226 (inherit java-snappy)
1227 (version "1.0.3-rc3")
1228 (source (origin
1229 (method url-fetch)
1230 (uri (string-append "https://github.com/xerial/snappy-java/archive/"
1231 "snappy-java-" version ".tar.gz"))
1232 (sha256
1233 (base32
1234 "08hsxlqidiqck0q57fshwyv3ynyxy18vmhrai9fyc8mz17m7gsa3"))))
1235 (arguments
1236 `(#:jar-name "snappy.jar"
1237 #:source-dir "src/main/java"
1238 #:phases
1239 (modify-phases %standard-phases
1240 (add-before 'build 'remove-binaries
1241 (lambda _
1242 (delete-file "lib/org/xerial/snappy/OSInfo.class")
1243 (delete-file-recursively "src/main/resources/org/xerial/snappy/native")
1244 #t))
1245 (add-before 'build 'build-jni
1246 (lambda _
1247 ;; Rebuild one of the binaries we removed earlier
1248 (system* "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
1249 "-d" "lib")
1250 ;; Link to the dynamic snappy, not the static ones
1251 (substitute* "Makefile.common"
1252 (("-shared") "-shared -lsnappy"))
1253 (substitute* "Makefile"
1254 ;; Don't download the sources here.
1255 (("\\$\\(SNAPPY_UNPACKED\\) ") "")
1256 ((": \\$\\(SNAPPY_UNPACKED\\) ") ":")
1257 ;; What we actually want to build
1258 (("SNAPPY_OBJ:=.*")
1259 "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, SnappyNative.o)\n")
1260 ;; Since we removed the directory structure in "native" during
1261 ;; the previous phase, we need to recreate it.
1262 (("NAME\\): \\$\\(SNAPPY_OBJ\\)")
1263 "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)"))
1264 ;; Finally we can run the Makefile to build the dynamic library.
1265 (zero? (system* "make" "native"))))
1266 ;; Once we have built the shared library, we need to place it in the
1267 ;; "build" directory so it can be added to the jar file.
1268 (add-after 'build-jni 'copy-jni
1269 (lambda _
1270 (copy-recursively "src/main/resources/org/xerial/snappy/native"
1271 "build/classes/org/xerial/snappy/native")
1272 #t))
1273 (add-before 'check 'fix-tests
1274 (lambda _
1275 (mkdir-p "src/test/resources/org/xerial/snappy/")
1276 (copy-recursively "src/test/java/org/xerial/snappy/testdata"
1277 "src/test/resources/org/xerial/snappy/testdata")
1278 (install-file "src/test/java/org/xerial/snappy/alice29.txt"
1279 "src/test/resources/org/xerial/snappy/")
1280 #t)))))))
1281
1282 (define-public java-iq80-snappy
1283 (package
1284 (name "java-iq80-snappy")
1285 (version "0.4")
1286 (source (origin
1287 (method url-fetch)
1288 (uri (string-append "https://github.com/dain/snappy/archive/snappy-"
1289 version ".tar.gz"))
1290 (sha256
1291 (base32
1292 "0rb3zhci7w9wzd65lfnk7p3ip0n6gb58a9qpx8n7r0231gahyamf"))))
1293 (build-system ant-build-system)
1294 (arguments
1295 `(#:jar-name "iq80-snappy.jar"
1296 #:source-dir "src/main/java"
1297 #:test-dir "src/test"
1298 #:jdk ,icedtea-8
1299 #:phases
1300 (modify-phases %standard-phases
1301 (replace 'check
1302 (lambda _
1303 (define (test class)
1304 (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
1305 ":build/classes"
1306 ":build/test-classes")
1307 "-Dtest.resources.dir=src/test/resources"
1308 "org.testng.TestNG" "-testclass"
1309 class)))
1310 (system* "ant" "compile-tests")
1311 (and
1312 (test "org.iq80.snappy.SnappyFramedStreamTest")
1313 (test "org.iq80.snappy.SnappyStreamTest"))))
1314 (add-before 'build 'remove-hadoop-dependency
1315 (lambda _
1316 ;; We don't have hadoop
1317 (delete-file "src/main/java/org/iq80/snappy/HadoopSnappyCodec.java")
1318 (delete-file "src/test/java/org/iq80/snappy/TestHadoopSnappyCodec.java")
1319 #t)))))
1320 (home-page "https://github.com/dain/snappy")
1321 (native-inputs
1322 `(("guava" ,java-guava)
1323 ("java-snappy" ,java-snappy)
1324 ("hamcrest" ,java-hamcrest-core)
1325 ("testng" ,java-testng)))
1326 (synopsis "Java port of the Snappy (de)compressor")
1327 (description
1328 "Iq80-snappy is a port of the Snappy compressor and decompressor rewritten
1329 in pure Java. This compression code produces a byte-for-byte exact copy of the
1330 output created by the original C++ code, and is extremely fast.")
1331 (license license:asl2.0)))
1332
1333 (define-public java-jbzip2
1334 (package
1335 (name "java-jbzip2")
1336 (version "0.9.1")
1337 (source (origin
1338 (method url-fetch)
1339 (uri (string-append "https://storage.googleapis.com/"
1340 "google-code-archive-source/v2/"
1341 "code.google.com/jbzip2/"
1342 "source-archive.zip"))
1343 (file-name (string-append name "-" version ".zip"))
1344 (sha256
1345 (base32
1346 "0ncmhlqmrfmj96nqf6p77b9ws35lcfsvpfxzwxi2asissc83z1l3"))))
1347 (build-system ant-build-system)
1348 (native-inputs
1349 `(("unzip" ,unzip)
1350 ("java-junit" ,java-junit)))
1351 (arguments
1352 `(#:tests? #f ; no tests
1353 #:jar-name "jbzip2.jar"
1354 #:source-dir "tags/release-0.9.1/src"
1355 #:phases
1356 (modify-phases %standard-phases
1357 (add-after 'unpack 'fix-encoding-problems
1358 (lambda _
1359 ;; Some of the files we're patching are
1360 ;; ISO-8859-1-encoded, so choose it as the default
1361 ;; encoding so the byte encoding is preserved.
1362 (with-fluids ((%default-port-encoding #f))
1363 (substitute* "tags/release-0.9.1/src/org/itadaki/bzip2/HuffmanAllocator.java"
1364 (("Milidi.") "Milidiu")))
1365 #t)))))
1366 (home-page "https://code.google.com/archive/p/jbzip2/")
1367 (synopsis "Java bzip2 compression/decompression library")
1368 (description "Jbzip2 is a Java bzip2 compression/decompression library.
1369 It can be used as a replacement for the Apache @code{CBZip2InputStream} /
1370 @code{CBZip2OutputStream} classes.")
1371 (license license:expat)))
1372
1373 (define-public p7zip
1374 (package
1375 (name "p7zip")
1376 (version "16.02")
1377 (source (origin
1378 (method url-fetch)
1379 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1380 version "/" name "_" version
1381 "_src_all.tar.bz2"))
1382 (sha256
1383 (base32
1384 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1385 (modules '((guix build utils)))
1386 (snippet
1387 '(begin
1388 ;; Remove non-free source files
1389 (for-each delete-file
1390 (append
1391 (find-files "CPP/7zip/Compress" "Rar.*")
1392 (find-files "CPP/7zip/Crypto" "Rar.*")
1393 (find-files "DOC/unRarLicense.txt")
1394 (find-files "Utils/file_Codecs_Rar_so.py")))
1395 (delete-file-recursively "CPP/7zip/Archive/Rar")
1396 (delete-file-recursively "CPP/7zip/Compress/Rar")
1397 #t))
1398 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1399 "p7zip-CVE-2017-17969.patch"
1400 "p7zip-remove-unused-code.patch"))))
1401 (build-system gnu-build-system)
1402 (arguments
1403 `(#:make-flags
1404 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1405 #:phases
1406 (modify-phases %standard-phases
1407 (replace 'configure
1408 (lambda* (#:key system outputs #:allow-other-keys)
1409 (zero? (system* "cp"
1410 (let ((system ,(or (%current-target-system)
1411 (%current-system))))
1412 (cond
1413 ((string-prefix? "x86_64" system)
1414 "makefile.linux_amd64_asm")
1415 ((string-prefix? "i686" system)
1416 "makefile.linux_x86_asm_gcc_4.X")
1417 (else
1418 "makefile.linux_any_cpu_gcc_4.X")))
1419 "makefile.machine"))))
1420 (replace 'check
1421 (lambda _
1422 (and (zero? (system* "make" "test"))
1423 (zero? (system* "make" "test_7z"))
1424 (zero? (system* "make" "test_7zr"))))))))
1425 (inputs
1426 (let ((system (or (%current-target-system)
1427 (%current-system))))
1428 `(,@(cond ((string-prefix? "x86_64" system)
1429 `(("yasm" ,yasm)))
1430 ((string-prefix? "i686" system)
1431 `(("nasm" ,nasm)))
1432 (else '())))))
1433 (home-page "http://p7zip.sourceforge.net/")
1434 (synopsis "Command-line file archiver with high compression ratio")
1435 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1436 handles the 7z format which features very high compression ratios.")
1437 (license (list license:lgpl2.1+
1438 license:gpl2+
1439 license:public-domain))))
1440
1441 (define-public gzstream
1442 (package
1443 (name "gzstream")
1444 (version "1.5")
1445 (source (origin
1446 (method url-fetch)
1447 (uri
1448 ;; No versioned URL, but last release was in 2003.
1449 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1450 (file-name (string-append name "-" version ".tgz"))
1451 (sha256
1452 (base32
1453 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1454 (modules '((guix build utils)))
1455 (snippet
1456 ;; Remove pre-compiled object.
1457 '(begin
1458 (delete-file "gzstream.o")
1459 #t))))
1460 (build-system gnu-build-system)
1461 (arguments
1462 `(#:test-target "test"
1463 #:phases
1464 (modify-phases %standard-phases
1465 (delete 'configure)
1466 (replace 'install
1467 (lambda* (#:key outputs #:allow-other-keys)
1468 (let* ((out (assoc-ref outputs "out"))
1469 (lib (string-append out "/lib"))
1470 (include (string-append out "/include")))
1471 (install-file "libgzstream.a" lib)
1472 (install-file "gzstream.h" include)
1473 #t))))))
1474 (propagated-inputs `(("zlib" ,zlib)))
1475 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1476 (synopsis "Compressed C++ iostream")
1477 (description "gzstream is a small library for providing zlib
1478 functionality in a C++ iostream.")
1479 (license license:lgpl2.1+)))
1480
1481 (define-public zpaq
1482 (package
1483 (name "zpaq")
1484 (version "7.15")
1485 (source
1486 (origin
1487 (method url-fetch/zipbomb)
1488 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1489 (string-delete #\. version) ".zip"))
1490 (sha256
1491 (base32
1492 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1493 (modules '((guix build utils)))
1494 (snippet
1495 ;; Delete irrelevant pre-compiled binaries.
1496 '(begin
1497 (for-each delete-file (find-files "." "\\.exe$"))
1498 #t))))
1499 (build-system gnu-build-system)
1500 (arguments
1501 `(#:phases
1502 (modify-phases %standard-phases
1503 (delete 'configure)) ; no ‘configure’ script
1504 #:make-flags
1505 (list
1506 (string-append "CPPFLAGS=-Dunix"
1507 ,(match (or (%current-target-system)
1508 (%current-system))
1509 ("x86_64-linux" "")
1510 ("i686-linux" "")
1511 (_ " -DNOJIT")))
1512 ;; These should be safe, lowest-common-denominator instruction sets,
1513 ;; allowing for some optimisation while remaining reproducible.
1514 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1515 ,(match (or (%current-target-system)
1516 (%current-system))
1517 ("x86_64-linux" " -march=nocona -mtune=generic")
1518 ("i686-linux" " -march=i686 -mtune=generic")
1519 ("armhf-linux" " -mtune=generic-armv7-a")
1520 (_ "")))
1521 (string-append "PREFIX="
1522 (assoc-ref %outputs "out")))))
1523 (native-inputs
1524 `(("perl" ,perl))) ; for pod2man
1525 (home-page "http://mattmahoney.net/dc/zpaq.html")
1526 (synopsis "Incremental journaling archiver")
1527 (description "ZPAQ is a command-line archiver for realistic situations with
1528 many duplicate and already compressed files. It backs up only those files
1529 modified since the last update. All previous versions remain untouched and can
1530 be independently recovered. Identical files are only stored once (known as
1531 @dfn{de-duplication}). Archives can also be encrypted.
1532
1533 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1534 owner and group IDs, ACLs, extended attributes, or special file types like
1535 devices, sockets, or named pipes. It does not follow or restore symbolic links
1536 or junctions, and always follows hard links.")
1537 (license (list license:public-domain
1538 ;; libzpaq.cpp contains a mix of public-domain and
1539 ;; expat-licenced (or ‘MIT’) code.
1540 license:expat))))
1541
1542 (define-public unshield
1543 (package
1544 (name "unshield")
1545 (version "1.4.2")
1546 (source
1547 (origin (method url-fetch)
1548 (uri (string-append "http://github.com/twogood/unshield/archive/"
1549 version ".tar.gz"))
1550 (file-name (string-append name "-" version ".tar.gz"))
1551 (sha256
1552 (base32
1553 "0x7ps644yp5dka2zhb8w0ifqmw3d255jafpzfwv8xbcpgq6fmm2x"))))
1554 (build-system cmake-build-system)
1555 (inputs
1556 `(("zlib" ,zlib)
1557 ("openssl" ,openssl)
1558 ;; test data that is otherwise downloaded with curl
1559 ("unshield-avigomanager11b22.zip"
1560 ,(origin
1561 (method url-fetch)
1562 (uri (string-append "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1563 "unshield-avigomanager11b22.zip?dl=1"))
1564 (sha256
1565 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1566 (file-name "unshield-avigomanager11b22.zip")))
1567 ("unshield-the-feeble-files-spanish.zip"
1568 ,(origin
1569 (method url-fetch)
1570 (uri (string-append "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1571 "unshield-the-feeble-files-spanish.zip?dl=1"))
1572 (sha256
1573 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1574 (file-name "unshield-the-feeble-files-spanish.zip")))))
1575 (native-inputs
1576 `(("unzip" ,unzip)))
1577 (arguments
1578 `(#:out-of-source? #f
1579 #:phases
1580 (modify-phases %standard-phases
1581 (add-before 'check 'pre-check
1582 (lambda* (#:key inputs #:allow-other-keys)
1583 (for-each (lambda (i)
1584 (copy-file (assoc-ref inputs i)
1585 (string-append "test/v0/" i)))
1586 '("unshield-avigomanager11b22.zip"
1587 "unshield-the-feeble-files-spanish.zip"))
1588 (substitute* (find-files "test/" "/*\\.sh")
1589 ;; Tests expect the unshield binary in a specific
1590 ;; location.
1591 (("/var/tmp/unshield/bin/unshield")
1592 (string-append (getcwd) "/src/unshield"))
1593 ;; We no longer need to download the data.
1594 ((".?URL=.*$") "")
1595 (("curl -(|f)sSL -o test.zip .*") ""))
1596 (substitute* "test/v0/avigomanager.sh"
1597 (("test.zip")
1598 (string-append (getcwd)
1599 "/test/v0/unshield-avigomanager11b22.zip")))
1600 (substitute* "test/v0/the-feeble-files-spanish.sh"
1601 (("test.zip")
1602 (string-append (getcwd)
1603 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1604 #t))
1605 (replace 'check
1606 (lambda _
1607 (zero? (system* "./run-tests.sh")))))))
1608 (home-page "https://github.com/twogood/unshield")
1609 (synopsis "Extract CAB files from InstallShield installers")
1610 (description
1611 "@command{unshield} is a tool and library for extracting @file{.cab}
1612 archives from InstallShield installers.")
1613 (license license:expat)))
1614
1615 (define-public zstd
1616 (package
1617 (name "zstd")
1618 (version "1.3.3")
1619 (source (origin
1620 (method url-fetch)
1621 (uri (string-append "https://github.com/facebook/zstd/archive/v"
1622 version ".tar.gz"))
1623 (file-name (string-append name "-" version ".tar.gz"))
1624 (sha256
1625 (base32
1626 "0yr91gwi380632w9y7p6idl72svq0mq0jajvdii05pp77qalfz57"))))
1627 (build-system gnu-build-system)
1628 (arguments
1629 `(#:phases
1630 (modify-phases %standard-phases
1631 (delete 'configure)) ; no configure script
1632 #:make-flags
1633 (list "CC=gcc"
1634 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1635 ;; Skip auto-detection of, and creating a dependency on, the build
1636 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1637 "HAVE_LZMA=0"
1638 ;; Not currently detected, but be explicit & avoid surprises later.
1639 "HAVE_LZ4=0"
1640 "HAVE_ZLIB=0")))
1641 (home-page "http://zstd.net/")
1642 (synopsis "Zstandard real-time compression algorithm")
1643 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1644 that combines very fast operation with a compression ratio comparable to that of
1645 zlib. In most scenarios, both compression and decompression can be performed in
1646 ‘real time’. The compressor can be configured to provide the most suitable
1647 trade-off between compression ratio and speed, without affecting decompression
1648 speed.")
1649 (license (list license:bsd-3 ; the main top-level LICENSE file
1650 license:bsd-2 ; many files explicitly state 2-Clause
1651 license:gpl2 ; the main top-level COPYING file
1652 license:gpl3+ ; tests/gzip/*.sh
1653 license:expat ; lib/dictBuilder/divsufsort.[ch]
1654 license:public-domain ; zlibWrapper/examples/fitblk*
1655 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1656
1657 (define-public pzstd
1658 (package
1659 (name "pzstd")
1660 (version (package-version zstd))
1661 (source (package-source zstd))
1662 (build-system gnu-build-system)
1663 (native-inputs
1664 `(("googletest" ,googletest)))
1665 (arguments
1666 `(#:phases
1667 (modify-phases %standard-phases
1668 (add-after 'unpack 'enter-subdirectory
1669 (lambda _ (chdir "contrib/pzstd")))
1670 (delete 'configure) ; no configure script
1671 (add-before 'check 'compile-tests
1672 (lambda* (#:key make-flags #:allow-other-keys)
1673 (zero? (apply system* "make" "tests" make-flags))))
1674 (add-after 'install 'install-documentation
1675 (lambda* (#:key outputs #:allow-other-keys)
1676 (let* ((out (assoc-ref outputs "out"))
1677 (doc (string-append out "/share/doc/" ,name)))
1678 (mkdir-p doc)
1679 (install-file "README.md" doc)
1680 #t))))
1681 #:make-flags
1682 (list "CC=gcc"
1683 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1684 (home-page (package-home-page zstd))
1685 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1686 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1687 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1688 compression algorithm}. It is fully compatible with the original Zstandard file
1689 format and command-line interface, and can be used as a drop-in replacement.
1690
1691 Compression is distributed over multiple processor cores to improve performance,
1692 as is the decompression of data compressed in this manner. Data compressed by
1693 other implementations will only be decompressed by two threads: one performing
1694 the actual decompression, the other input and output.")
1695 (license (package-license zstd))))
1696
1697 (define-public zip
1698 (package
1699 (name "zip")
1700 (version "3.0")
1701 (source
1702 (origin
1703 (method url-fetch)
1704 (uri (string-append "mirror://sourceforge/infozip"
1705 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1706 (sha256
1707 (base32
1708 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1709 (build-system gnu-build-system)
1710 (inputs `(("bzip2" ,bzip2)))
1711 (arguments
1712 `(#:tests? #f ; no test target
1713 #:make-flags (let ((out (assoc-ref %outputs "out")))
1714 (list "-f" "unix/Makefile"
1715 (string-append "prefix=" out)
1716 (string-append "MANDIR=" out "/share/man/man1")))
1717 #:phases
1718 (modify-phases %standard-phases
1719 (replace 'build
1720 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1721 (apply invoke "make" "generic_gcc" make-flags)))
1722 (delete 'configure))))
1723 (home-page "http://www.info-zip.org/Zip.html")
1724 (synopsis "Compression and file packing utility")
1725 (description
1726 "Zip is a compression and file packaging/archive utility. Zip is useful
1727 for packaging a set of files for distribution, for archiving files, and for
1728 saving disk space by temporarily compressing unused files or directories.
1729 Zip puts one or more compressed files into a single ZIP archive, along with
1730 information about the files (name, path, date, time of last modification,
1731 protection, and check information to verify file integrity). An entire
1732 directory structure can be packed into a ZIP archive with a single command.
1733
1734 Zip has one compression method (deflation) and can also store files without
1735 compression. Zip automatically chooses the better of the two for each file.
1736 Compression ratios of 2:1 to 3:1 are common for text files.")
1737 (license (license:non-copyleft "file://LICENSE"
1738 "See LICENSE in the distribution."))))
1739
1740 (define-public unzip
1741 (package (inherit zip)
1742 (name "unzip")
1743 (version "6.0")
1744 (source
1745 (origin
1746 (method url-fetch)
1747 (uri (string-append "mirror://sourceforge/infozip"
1748 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1749 (sha256
1750 (base32
1751 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1752 (patches (search-patches "unzip-CVE-2014-8139.patch"
1753 "unzip-CVE-2014-8140.patch"
1754 "unzip-CVE-2014-8141.patch"
1755 "unzip-CVE-2014-9636.patch"
1756 "unzip-CVE-2015-7696.patch"
1757 "unzip-CVE-2015-7697.patch"
1758 "unzip-allow-greater-hostver-values.patch"
1759 "unzip-initialize-symlink-flag.patch"
1760 "unzip-remove-build-date.patch"
1761 "unzip-attribs-overflow.patch"
1762 "unzip-overflow-on-invalid-input.patch"
1763 "unzip-format-secure.patch"
1764 "unzip-overflow-long-fsize.patch"))))
1765 (build-system gnu-build-system)
1766 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1767 (arguments
1768 `(#:phases (modify-phases %standard-phases
1769 (delete 'configure)
1770 (add-after 'unpack 'fortify
1771 (lambda _
1772 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1773 ;; This environment variable is recommended in 'unix/Makefile'
1774 ;; for passing flags to the C compiler.
1775 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1776 #t))
1777 (replace 'build
1778 (lambda* (#:key make-flags #:allow-other-keys)
1779 (apply invoke "make"
1780 `("-j" ,(number->string
1781 (parallel-job-count))
1782 ,@make-flags
1783 "generic_gcc")))))
1784 #:make-flags (list "-f" "unix/Makefile"
1785 (string-append "prefix=" %output)
1786 (string-append "MANDIR=" %output "/share/man/man1"))))
1787 (home-page "http://www.info-zip.org/UnZip.html")
1788 (synopsis "Decompression and file extraction utility")
1789 (description
1790 "UnZip is an extraction utility for archives compressed in .zip format,
1791 also called \"zipfiles\".
1792
1793 UnZip lists, tests, or extracts files from a .zip archive. The default
1794 behaviour (with no options) is to extract into the current directory, and
1795 subdirectories below it, all files from the specified zipfile. UnZip
1796 recreates the stored directory structure by default.")
1797 (license (license:non-copyleft "file://LICENSE"
1798 "See LICENSE in the distribution."))))
1799
1800 (define-public zziplib
1801 (package
1802 (name "zziplib")
1803 (version "0.13.69")
1804 (home-page "https://github.com/gdraheim/zziplib")
1805 (source
1806 (origin
1807 (method url-fetch)
1808 (uri (string-append home-page "/archive/v" version ".tar.gz"))
1809 (sha256
1810 (base32
1811 "0i052a7shww0fzsxrdp3rd7g4mbzx7324a8ysbc0br7frpblcql4"))))
1812 (build-system gnu-build-system)
1813 (inputs
1814 `(("zlib" ,zlib)))
1815 (native-inputs `(("perl" ,perl) ; for the documentation
1816 ("pkg-config" ,pkg-config)
1817 ;; for the documentation; Python 3 not supported,
1818 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1819 ("python" ,python-2)
1820 ("zip" ,zip))) ; to create test files
1821 (synopsis "Library for accessing zip files")
1822 (description
1823 "ZZipLib is a library based on zlib for accessing zip files.")
1824 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1825 ;; files carry the Zlib license; see "docs/copying.html" for details.
1826 (license (list license:lgpl2.0+ license:mpl1.1))))
1827
1828 (define-public perl-archive-zip
1829 (package
1830 (name "perl-archive-zip")
1831 (version "1.60")
1832 (source
1833 (origin
1834 (method url-fetch)
1835 (uri (string-append
1836 "mirror://cpan/authors/id/P/PH/PHRED/Archive-Zip-"
1837 version ".tar.gz"))
1838 (sha256
1839 (base32
1840 "02y2ylq83hy9kgj57sc0239x65br9sm98c0chsm61s08yc2mpiza"))))
1841 (build-system perl-build-system)
1842 (native-inputs
1843 ;; For tests.
1844 `(("perl-test-mockmodule" ,perl-test-mockmodule)))
1845 (synopsis "Provides an interface to Zip archive files")
1846 (description "The @code{Archive::Zip} module allows a Perl program to
1847 create, manipulate, read, and write Zip archive files.")
1848 (home-page "http://search.cpan.org/dist/Archive-Zip/")
1849 (license license:perl-license)))
1850
1851 (define-public libzip
1852 (package
1853 (name "libzip")
1854 (version "1.3.2")
1855 (source (origin
1856 (method url-fetch)
1857 (uri (string-append
1858 "https://libzip.org/download/" name "-" version ".tar.xz"))
1859 (sha256
1860 (base32
1861 "11g1hvm2bxa2v5plakfzcwyk5hb5fz4kgrkp38l0xhnv21888xv2"))))
1862 (native-inputs
1863 `(("perl" ,perl)))
1864 (inputs
1865 `(("zlib" ,zlib)))
1866 (build-system gnu-build-system)
1867 (home-page "https://libzip.org")
1868 (synopsis "C library for reading, creating, and modifying zip archives")
1869 (description "Libzip is a C library for reading, creating, and modifying
1870 zip archives. Files can be added from data buffers, files, or compressed data
1871 copied directly from other zip archives. Changes made without closing the
1872 archive can be reverted.")
1873 (license license:bsd-3)))
1874
1875 (define-public atool
1876 (package
1877 (name "atool")
1878 (version "0.39.0")
1879 (source
1880 (origin
1881 (method url-fetch)
1882 (uri (string-append "http://savannah.nongnu.org/download/atool/atool-"
1883 version ".tar.gz"))
1884 (sha256
1885 (base32
1886 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1887 (build-system gnu-build-system)
1888 (arguments
1889 `(#:phases
1890 (modify-phases %standard-phases
1891 (add-after 'unpack 'embed-absolute-file-name
1892 (lambda* (#:key inputs #:allow-other-keys)
1893 (substitute* "atool"
1894 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1895 (string-append pre "'" (assoc-ref inputs "file")
1896 "/bin/file'")))
1897 #t)))))
1898 (inputs
1899 `(("perl" ,perl)
1900 ("file" ,file)))
1901 (home-page "https://www.nongnu.org/atool/")
1902 (synopsis "Universal tool to manage file archives of various types")
1903 (description "The main command is @command{aunpack} which extracts files
1904 from an archive. The other commands provided are @command{apack} (to create
1905 archives), @command{als} (to list files in archives), and @command{acat} (to
1906 extract files to standard out). As @command{atool} invokes external programs
1907 to handle the archives, not all commands may be supported for a certain type
1908 of archives.")
1909 (license license:gpl2+)))
1910
1911 (define-public perl-archive-extract
1912 (package
1913 (name "perl-archive-extract")
1914 (version "0.80")
1915 (source
1916 (origin
1917 (method url-fetch)
1918 (uri (string-append "mirror://cpan/authors/id/B/BI/BINGOS/Archive-Extract-"
1919 version ".tar.gz"))
1920 (sha256
1921 (base32
1922 "1x15j1q6w6z8hqyqgap0lz4qbq2174wfhksy1fdd653ccbaw5jr5"))))
1923 (build-system perl-build-system)
1924 (home-page "http://search.cpan.org/dist/Archive-Extract/")
1925 (synopsis "Generic archive extracting mechanism")
1926 (description "It allows you to extract any archive file of the type .tar,
1927 .tar.gz, .gz, .Z, tar.bz2, .tbz, .bz2, .zip, .xz,, .txz, .tar.xz or .lzma
1928 without having to worry how it does so, or use different interfaces for each
1929 type by using either Perl modules, or command-line tools on your system.")
1930 (license license:perl-license)))
1931
1932 (define-public java-tukaani-xz
1933 (package
1934 (name "java-tukaani-xz")
1935 (version "1.6")
1936 (source (origin
1937 (method url-fetch)
1938 (uri (string-append "https://tukaani.org/xz/xz-java-" version ".zip"))
1939 (sha256
1940 (base32
1941 "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x"))))
1942 (build-system ant-build-system)
1943 (arguments
1944 `(#:tests? #f; no tests
1945 #:phases
1946 (modify-phases %standard-phases
1947 (add-after 'unpack 'chdir
1948 (lambda _
1949 ;; Our build system enters the first directory in the archive, but
1950 ;; the package is not contained in a subdirectory
1951 (chdir "..")))
1952 (replace 'install
1953 (lambda* (#:key outputs #:allow-other-keys)
1954 ;; Do we want to install *Demo.jar?
1955 (install-file "build/jar/xz.jar"
1956 (string-append
1957 (assoc-ref outputs "out")
1958 "/share/java/xz.jar")))))))
1959 (native-inputs
1960 `(("unzip" ,unzip)))
1961 (home-page "https://tukaani.org")
1962 (synopsis "XZ in Java")
1963 (description "Tukaani-xz is an implementation of xz compression/decompression
1964 algorithms in Java.")
1965 (license license:public-domain)))
1966
1967 (define-public lunzip
1968 (package
1969 (name "lunzip")
1970 (version "1.10")
1971 (source
1972 (origin
1973 (method url-fetch)
1974 (uri (string-append "mirror://savannah/lzip/"
1975 name "/" name "-" version ".tar.gz"))
1976 (sha256
1977 (base32 "1iw59br6nsxs7l1p875h8w3vxwr04xfhg5zyal64crvamhxkj5kl"))))
1978 (build-system gnu-build-system)
1979 (arguments
1980 `(#:configure-flags
1981 (list "CC=gcc")))
1982 (home-page "https://www.nongnu.org/lzip/lunzip.html")
1983 (synopsis "Small, stand-alone lzip decompressor")
1984 (description
1985 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1986 written as a single small C tool with no dependencies. This makes it
1987 well-suited to embedded and other systems without a C++ compiler, or for use in
1988 applications such as software installers that need only to decompress files,
1989 not compress them.
1990 Lunzip is intended to be fully compatible with the regular lzip package.")
1991 (license (list license:bsd-2 ; carg_parser.[ch]
1992 license:gpl2+)))) ; everything else
1993
1994 (define-public clzip
1995 (package
1996 (name "clzip")
1997 (version "1.10")
1998 (source
1999 (origin
2000 (method url-fetch)
2001 (uri (string-append "mirror://savannah/lzip/"
2002 name "/" name "-" version ".tar.gz"))
2003 (sha256
2004 (base32 "03xcmhl3dya4jrwmsqh09ikimpb36fr3vkh2bwfzz1sbcns0cdg3"))))
2005 (build-system gnu-build-system)
2006 (arguments
2007 `(#:configure-flags
2008 (list "CC=gcc")))
2009 (home-page "https://www.nongnu.org/lzip/clzip.html")
2010 (synopsis "Small, stand-alone lzip compressor and decompressor")
2011 (description
2012 "Clzip is a compressor and decompressor for files in the lzip compression
2013 format (.lz), written as a single small C tool with no dependencies. This makes
2014 it well-suited to embedded and other systems without a C++ compiler, or for use
2015 in other applications like package managers.
2016 Clzip is intended to be fully compatible with the regular lzip package.")
2017 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
2018 license:gpl2+))))
2019
2020 (define-public lzlib
2021 (package
2022 (name "lzlib")
2023 (version "1.10")
2024 (source
2025 (origin
2026 (method url-fetch)
2027 (uri (string-append "mirror://savannah/lzip/"
2028 name "/" name "-" version ".tar.gz"))
2029 (sha256
2030 (base32 "0hqhnj2lzqacdbmmnpy91lsm1rd9zlngs1q6s9pyahsv1a0bfshx"))))
2031 (build-system gnu-build-system)
2032 ;; The included minilzip binary is only ~16 smaller than the ‘real’ lzip.
2033 ;; It's used during the test suite, but don't be tempted to install it.
2034 (arguments
2035 `(#:configure-flags
2036 (list "CC=gcc"
2037 "--enable-shared"))) ; only static (.a) is built by default
2038 (home-page "https://www.nongnu.org/lzip/lzlib.html")
2039 (synopsis "Lzip data compression C library")
2040 (description
2041 "Lzlib is a C library for in-memory LZMA compression and decompression in
2042 the lzip format. It supports integrity checking of the decompressed data, and
2043 all functions are thread-safe. The library should never crash, even in case of
2044 corrupted input.")
2045 (license (list license:bsd-2 ; the library itself
2046 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
2047
2048 (define-public plzip
2049 (package
2050 (name "plzip")
2051 (version "1.7")
2052 (source
2053 (origin
2054 (method url-fetch)
2055 (uri (string-append "mirror://savannah/lzip/"
2056 name "/" name "-" version ".tar.gz"))
2057 (sha256
2058 (base32 "1dzjp9r7krwpsn224bhcqbzd5aj5b4556sdi9yzl2bzbk3fjrqlm"))))
2059 (build-system gnu-build-system)
2060 (inputs
2061 `(("lzlib" ,lzlib)))
2062 (home-page "https://www.nongnu.org/lzip/plzip.html")
2063 (synopsis "Parallel lossless data compressor for the lzip format")
2064 (description
2065 "Plzip is a massively parallel (multi-threaded) lossless data compressor
2066 and decompressor that uses the lzip file format (.lz). Files produced by plzip
2067 are fully compatible with lzip and can be rescued with lziprecover.
2068 On multiprocessor machines, plzip can compress and decompress large files much
2069 faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
2070 2%). The number of usable threads is limited by file size: on files of only a
2071 few MiB, plzip is no faster than lzip.
2072 Files that were compressed with regular lzip will also not be decompressed
2073 faster by plzip, unless the @code{-b} option was used: lzip usually produces
2074 single-member files which can't be decompressed in parallel.")
2075 (license (list license:bsd-2 ; arg_parser.{cc,h}
2076 license:gpl2+)))) ; everything else
2077
2078 (define-public innoextract
2079 (package
2080 (name "innoextract")
2081 (version "1.6")
2082 (source
2083 (origin
2084 (method url-fetch)
2085 (uri (string-append "https://github.com/dscharrer/innoextract/archive/"
2086 version ".tar.gz"))
2087 (sha256
2088 (base32
2089 "08sp5vbfjvq1irhhraqkn5m2x1z209r4axhx7laf1adcw30ccapi"))
2090 (file-name (string-append name "-" version ".tar.gz"))))
2091 (build-system cmake-build-system)
2092 (arguments
2093 `(#:tests? #f)) ;; No tests available.
2094 (inputs `(("boost" ,boost)
2095 ("libiconv" ,libiconv)
2096 ("xz" ,xz)))
2097 (native-inputs `(("pkg-config" ,pkg-config)))
2098 (home-page "https://constexpr.org/innoextract/")
2099 (synopsis "Tool for extracting Inno Setup installers")
2100 (description "innoextract allows extracting Inno Setup installers under
2101 non-Windows systems without running the actual installer using wine.")
2102 (license license:zlib)))
2103
2104 (define-public google-brotli
2105 (package
2106 (name "google-brotli")
2107 (version "1.0.2")
2108 (source (origin
2109 (method url-fetch)
2110 (uri (string-append "https://github.com/google/brotli/archive/v"
2111 version ".tar.gz"))
2112 (sha256
2113 (base32
2114 "08kl9gww2058p1p7j9xqmcmrabcfihhj3fq984d7fi3bchb2mky2"))))
2115 (build-system cmake-build-system)
2116 (arguments
2117 `(#:phases
2118 (modify-phases %standard-phases
2119 (add-after 'install 'rename-static-libraries
2120 ;; The build tools put a 'static' suffix on the static libraries, but
2121 ;; other applications don't know how to find these.
2122 (lambda* (#:key outputs #:allow-other-keys)
2123 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
2124 (rename-file (string-append lib "libbrotlicommon-static.a")
2125 (string-append lib "libbrotlicommon.a"))
2126 (rename-file (string-append lib "libbrotlidec-static.a")
2127 (string-append lib "libbrotlidec.a"))
2128 (rename-file (string-append lib "libbrotlienc-static.a")
2129 (string-append lib "libbrotlienc.a"))
2130 #t))))
2131 #:configure-flags
2132 (list ;; Defaults to "lib64" on 64-bit archs.
2133 (string-append "-DCMAKE_INSTALL_LIBDIR="
2134 (assoc-ref %outputs "out") "/lib"))))
2135 (home-page "https://github.com/google/brotli")
2136 (synopsis "General-purpose lossless compression")
2137 (description "This package provides the reference implementation of Brotli,
2138 a generic-purpose lossless compression algorithm that compresses data using a
2139 combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
2140 order context modeling, with a compression ratio comparable to the best
2141 currently available general-purpose compression methods. It is similar in speed
2142 with @code{deflate} but offers more dense compression.
2143
2144 The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
2145 (license license:expat)))