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