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