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