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