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