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