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