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