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