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