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