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