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