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