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