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