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