gnu: plzip: Update to 1.8.
[jackhill/guix/guix.git] / gnu / packages / compression.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
b2859a4f 2;;; Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
b357faac 3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
144cc3c4 4;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
27f76fe6 5;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
69d9792a 6;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
e580597d 7;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
77737e03 8;;; Copyright © 2015, 2017, 2018 Leo Famulari <leo@famulari.name>
820dc3f5 9;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
2f325b63 10;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
23f3cbb8 11;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
3fd4b90d 12;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
f6145bb6 13;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
e4c2136d 14;;; Copyright © 2016 David Craven <david@craven.ch>
0dcea35d 15;;; Copyright © 2016, 2019 Kei Kebreau <kkebreau@posteo.net>
2b786f67 16;;; Copyright © 2016, 2018 Marius Bakke <mbakke@fastmail.com>
4a78fd46 17;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
9e6ada8f 18;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
d109b1e8 19;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
ef5c40aa 20;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
b44ecca6 21;;; Copyright © 2017 Petter <petter@mykolab.ch>
9869bb12 22;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
e294c05e 23;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
2ed0ef2f 24;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
4715f92e 25;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
a268f085 26;;;
233e7676 27;;; This file is part of GNU Guix.
a268f085 28;;;
233e7676 29;;; GNU Guix is free software; you can redistribute it and/or modify it
a268f085
LC
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;;;
233e7676 34;;; GNU Guix is distributed in the hope that it will be useful, but
a268f085
LC
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
233e7676 40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
a268f085 41
1ffa7090 42(define-module (gnu packages compression)
b5b73a82 43 #:use-module ((guix licenses) #:prefix license:)
21b2ec4d 44 #:use-module (guix utils)
a268f085 45 #:use-module (guix packages)
87f5d366 46 #:use-module (guix download)
646898b3 47 #:use-module (guix git-download)
9e6ada8f 48 #:use-module (guix build-system cmake)
b357faac 49 #:use-module (guix build-system gnu)
e99dd67a 50 #:use-module (gnu packages)
389eb3fa 51 #:use-module (gnu packages assembly)
69d9792a 52 #:use-module (gnu packages autotools)
23f3cbb8 53 #:use-module (gnu packages backup)
73f542c3 54 #:use-module (gnu packages base)
e294c05e 55 #:use-module (gnu packages boost)
0f03c531 56 #:use-module (gnu packages check)
9e6ada8f 57 #:use-module (gnu packages curl)
ef5c40aa 58 #:use-module (gnu packages file)
9869bb12 59 #:use-module (gnu packages maths)
646898b3 60 #:use-module (gnu packages perl)
23f3cbb8 61 #:use-module (gnu packages pkg-config)
1ae60db8 62 #:use-module (gnu packages python)
9e6ada8f 63 #:use-module (gnu packages tls)
82aa2a28 64 #:use-module (gnu packages valgrind)
36df995c 65 #:use-module (ice-9 match)
646898b3 66 #:use-module ((srfi srfi-1) #:select (last)))
a268f085 67
6a92093d
LC
68(define-public zlib
69 (package
70 (name "zlib")
2b8bea03 71 (version "1.2.11")
6a92093d
LC
72 (source
73 (origin
87f5d366 74 (method url-fetch)
a67f97fe
CR
75 (uri (list (string-append "http://zlib.net/zlib-"
76 version ".tar.gz")
b2859a4f
LC
77 (string-append "mirror://sourceforge/libpng/zlib/"
78 version "/zlib-" version ".tar.gz")))
6a92093d
LC
79 (sha256
80 (base32
2b8bea03 81 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
6a92093d 82 (build-system gnu-build-system)
b90289da 83 (outputs '("out" "static"))
6a92093d 84 (arguments
6cd00453
EF
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 '())
144cc3c4 97 (invoke "./configure"
b90289da
MB
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)))))))
7f1773ea 107 (home-page "https://zlib.net/")
35b9e423 108 (synopsis "Compression library")
6a92093d
LC
109 (description
110 "zlib is designed to be a free, general-purpose, legally unencumbered --
111that is, not covered by any patents -- lossless data-compression library for
112use on virtually any computer hardware and operating system. The zlib data
35b9e423 113format is itself portable across platforms. Unlike the LZW compression method
6a92093d
LC
114used in Unix compress(1) and in the GIF image format, the compression method
115currently used in zlib essentially never expands the data. (LZW can double or
116triple the file size in extreme cases.) zlib's memory footprint is also
117independent of the input data and can be reduced, if necessary, at some cost
118in compression.")
4a44e743 119 (license license:zlib)))
6a92093d 120
8298df96
MB
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
34789459 131 (lambda _ (chdir "contrib/minizip") #t)))))
8298df96
MB
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,
141extracting and viewing ZIP archives. This version is extracted from
142the @code{zlib} source.")
143 (license (package-license zlib))))
144
ee97be9f
RW
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)))
340978d7 158 (home-page "https://savannah.nongnu.org/projects/fastjar")
ee97be9f
RW
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'
162utility. Instead of being written in Java, FastJar is written in C.")
163 (license license:gpl2+)))
164
58593975
RW
165(define-public libtar
166 (package
167 (name "libtar")
89d80159 168 (version "1.2.20")
58593975
RW
169 (source (origin
170 (method url-fetch)
89d80159
EF
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")))
58593975
RW
178 (sha256
179 (base32
e99dd67a
EF
180 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
181 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
58593975 182 (build-system gnu-build-system)
112fcafb 183 (arguments `(#:tests? #f)) ; no "check" target
89d80159
EF
184 (native-inputs
185 `(("autoconf" ,autoconf)
186 ("automake" ,automake)
187 ("libtool" ,libtool)))
188 (inputs
189 `(("zlib" ,zlib)))
58593975
RW
190 (synopsis "C library for manipulating POSIX tar files")
191 (description
192 "libtar is a C library for manipulating POSIX tar files. It handles
193adding and extracting files to/from a tar archive.")
89d80159 194 (home-page "https://repo.or.cz/libtar.git")
58593975
RW
195 (license license:bsd-3)))
196
a268f085
LC
197(define-public gzip
198 (package
199 (name "gzip")
49b080de 200 (version "1.9")
a268f085 201 (source (origin
87f5d366 202 (method url-fetch)
0db342a5 203 (uri (string-append "mirror://gnu/gzip/gzip-"
28181faf 204 version ".tar.xz"))
a268f085
LC
205 (sha256
206 (base32
49b080de 207 "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
a268f085 208 (build-system gnu-build-system)
f50d2669 209 (synopsis "General file (de)compression (using lzw)")
a268f085
LC
210 (arguments
211 ;; FIXME: The test suite wants `less', and optionally Perl.
48623f5b
RW
212 '(#:tests? #f
213 #:phases
214 (modify-phases %standard-phases
c7b87eed
MB
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))
48623f5b
RW
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)))))
a268f085 237 (description
79c311b8
LC
238 "GNU Gzip provides data compression and decompression utilities; the
239typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
240file; as a result, it is often used in conjunction with \"tar\", resulting in
241\".tar.gz\" or \".tgz\", etc.")
4a44e743 242 (license license:gpl3+)
6fd52309 243 (home-page "https://www.gnu.org/software/gzip/")))
a268f085
LC
244
245(define-public bzip2
03bc86b8
CB
246 (package
247 (name "bzip2")
248 (version "1.0.6")
249 (source (origin
250 (method url-fetch)
7598b678
LF
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"))
03bc86b8
CB
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)
5212c52c 262 (ice-9 ftw)
03bc86b8
CB
263 (srfi srfi-1))
264 #:phases
265 (modify-phases %standard-phases
266 (replace 'configure
267 (lambda* (#:key target #:allow-other-keys)
3158bc04
MW
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))
03bc86b8
CB
281 (add-before 'build 'build-shared-lib
282 (lambda* (#:key inputs #:allow-other-keys)
283 (patch-makefile-SHELL "Makefile-libbz2_so")
3158bc04 284 (invoke "make" "-f" "Makefile-libbz2_so")))
03bc86b8
CB
285 (add-after 'install 'install-shared-lib
286 (lambda* (#:key outputs #:allow-other-keys)
2b786f67
MB
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.
03bc86b8 289 (let* ((out (assoc-ref outputs "out"))
2b786f67 290 (libdir (string-append out "/lib"))
5212c52c
MB
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)))))
2b786f67
MB
299 (install-file lib libdir)
300 (with-directory-excursion libdir
301 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
5212c52c 302 (let loop ((base soname)
2b786f67
MB
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)))
45719c1d
MB
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))))
e7ee50f2
CB
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")))
03bc86b8 322 #t)))
ab4fab19 323
03bc86b8
CB
324 #:make-flags (list (string-append "PREFIX="
325 (assoc-ref %outputs "out")))
ab4fab19 326
03bc86b8
CB
327 ;; Don't attempt to run the tests when cross-compiling.
328 ,@(if (%current-target-system)
329 '(#:tests? #f)
330 '())))
45719c1d 331 (outputs '("out" "static"))
03bc86b8
CB
332 (synopsis "High-quality data compression program")
333 (description
334 "bzip2 is a freely available, patent free (see below), high-quality data
a268f085
LC
335compressor. It typically compresses files to within 10% to 15% of the best
336available techniques (the PPM family of statistical compressors), whilst
337being around twice as fast at compression and six times faster at
338decompression.")
03bc86b8
CB
339 (license (license:non-copyleft "file://LICENSE"
340 "See LICENSE in the distribution."))
7598b678 341 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
a268f085 342
669b7b83
RW
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
f268b744
EF
353 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))
354 (modules '((guix build utils)))
355 (snippet
356 '(begin
f268b744
EF
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))))
669b7b83
RW
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
371bzip2 compressed file format. lbzip2 can process standard bz2 files in
372parallel. It uses POSIX threading model (pthreads), which allows it to take
373full advantage of symmetric multiprocessing (SMP) systems. It has been proven
374to scale linearly, even to over one hundred processor cores. lbzip2 is fully
375compatible with bzip2 – both at file format and command line level.")
376 (home-page "http://www.lbzip2.org/")
377 (license license:gpl3+)))
378
5d47eab0
EF
379(define-public pbzip2
380 (package
381 (name "pbzip2")
bf867709 382 (version "1.1.13")
5d47eab0
EF
383 (source (origin
384 (method url-fetch)
21b2ec4d
EF
385 (uri (string-append "https://launchpad.net/pbzip2/"
386 (version-major+minor version) "/" version
387 "/+download/" name "-" version ".tar.gz"))
5d47eab0
EF
388 (sha256
389 (base32
bf867709 390 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
5d47eab0
EF
391 (build-system gnu-build-system)
392 (inputs
b3546174 393 `(("bzip2" ,bzip2)))
5d47eab0 394 (arguments
bf867709 395 `(#:tests? #f ; no tests
5d47eab0 396 #:phases (modify-phases %standard-phases
bf867709 397 (delete 'configure)) ; no configure script
21b2ec4d 398 #:make-flags (list (string-append "PREFIX=" %output))))
5d47eab0
EF
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
403compressor that uses pthreads and achieves near-linear speedup on SMP machines.
21b2ec4d 404The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
5d47eab0
EF
405compressed with pbzip2 can be decompressed with bzip2).")
406 (license (license:non-copyleft "file://COPYING"
21b2ec4d 407 "See COPYING in the distribution."))))
5d47eab0 408
a268f085
LC
409(define-public xz
410 (package
411 (name "xz")
957aac76 412 (version "5.2.4")
a268f085 413 (source (origin
87f5d366 414 (method url-fetch)
52d76b64
LC
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")))
a268f085
LC
419 (sha256
420 (base32
957aac76 421 "0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
a268f085 422 (build-system gnu-build-system)
35b9e423 423 (synopsis "General-purpose data compression")
a268f085
LC
424 (description
425 "XZ Utils is free general-purpose data compression software with high
426compression ratio. XZ Utils were written for POSIX-like systems, but also
427work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
428
429The core of the XZ Utils compression code is based on LZMA SDK, but it has
430been modified quite a lot to be suitable for XZ Utils. The primary
431compression algorithm is currently LZMA2, which is used inside the .xz
432container format. With typical files, XZ Utils create 30 % smaller output
433than gzip and 15 % smaller output than bzip2.")
38bbd61d 434 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
58891850 435 (home-page "https://tukaani.org/xz/")))
c6eac761 436
0dcea35d
KK
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
463decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
464tool is a library, so that it can be reused for other purposes. Lhasa aims to
465be compatible with as many types of lzh/lzs archives as possible. It also aims
466to generate the same output as the (non-free) Unix LHA tool, so that it will
467act as a free drop-in replacement.")
468 (license license:isc)))
469
c6eac761
LC
470(define-public lzo
471 (package
472 (name "lzo")
7276eca4 473 (version "2.10")
c6eac761
LC
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
7276eca4 481 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
c6eac761 482 (build-system gnu-build-system)
165fd9d5 483 (arguments '(#:configure-flags '("--enable-shared")))
c6eac761
LC
484 (home-page "http://www.oberhumer.com/opensource/lzo")
485 (synopsis
e881752c 486 "Data compression library suitable for real-time data de-/compression")
c6eac761
LC
487 (description
488 "LZO is a data compression library which is suitable for data
489de-/compression in real-time. This means it favours speed over
490compression ratio.
491
492LZO is written in ANSI C. Both the source code and the compressed data
493format are designed to be portable across platforms.")
4a44e743 494 (license license:gpl2+)))
0f323dad 495
a9f48ff0
EB
496(define-public lzop
497 (package
498 (name "lzop")
89d159fe 499 (version "1.04")
a9f48ff0
EB
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
89d159fe 507 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
a9f48ff0
EB
508 (build-system gnu-build-system)
509 (inputs `(("lzo" ,lzo)))
6f465a51 510 (home-page "https://www.lzop.org/")
a9f48ff0
EB
511 (synopsis "Compress or expand files")
512 (description
513 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
514LZO data compression library for compression services, and its main advantages
515over gzip are much higher compression and decompression speed (at the cost of
516some compression ratio).")
517 (license license:gpl2+)))
518
0f323dad
LC
519(define-public lzip
520 (package
521 (name "lzip")
5ecc917d 522 (version "1.20")
0f323dad
LC
523 (source (origin
524 (method url-fetch)
525 (uri (string-append "mirror://savannah/lzip/lzip-"
526 version ".tar.gz"))
527 (sha256
528 (base32
5ecc917d 529 "0319q59kb8g324wnj7xzbr7vvlx5bcs13lr34j0zb3kqlyjq2fy9"))))
0f323dad 530 (build-system gnu-build-system)
340978d7 531 (home-page "https://www.nongnu.org/lzip/lzip.html")
0f323dad
LC
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
535one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
0963e3e4 536more than bzip2, which makes it well-suited for software distribution and data
0f323dad
LC
537archiving. Lzip is a clean implementation of the LZMA algorithm.")
538 (license license:gpl3+)))
b357faac 539
9d9fc399
TGR
540(define-public lziprecover
541 (package
542 (name "lziprecover")
b099b4a7 543 (version "1.21")
9d9fc399
TGR
544 (source (origin
545 (method url-fetch)
f6145bb6
TGR
546 (uri (string-append "mirror://savannah/lzip/lziprecover/"
547 "lziprecover-" version ".tar.gz"))
9d9fc399
TGR
548 (sha256
549 (base32
b099b4a7 550 "094w2z8fz41yaq0gkyr61cl7pb1d7kchpl5dka7rvm3qvbb7ncd2"))))
9d9fc399 551 (build-system gnu-build-system)
340978d7 552 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
9d9fc399
TGR
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
556compressed data format (.lz). It can test the integrity of lzip files, extract
557data from damaged ones, and repair most files with small errors (up to one
558single-byte error per member) entirely.
559
560Lziprecover is not a replacement for regular backups, but a last line of defence
561when even the backups are corrupt. It can recover files by merging the good
562parts of two or more damaged copies, such as can be easily produced by running
563@command{ddrescue} on a failing device.
564
565This package also includes @command{unzcrash}, a tool to test the robustness of
566decompressors when faced with corrupted input.")
567 (license (list license:bsd-2 ; arg_parser.{cc,h}
568 license:gpl2+)))) ; everything else
569
b357faac
AE
570(define-public sharutils
571 (package
572 (name "sharutils")
9a59ce24 573 (version "4.15.2")
b357faac
AE
574 (source
575 (origin
576 (method url-fetch)
577 (uri (string-append "mirror://gnu/sharutils/sharutils-"
578 version ".tar.xz"))
d0ee11b2 579 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
b357faac
AE
580 (sha256
581 (base32
b50d58b3 582 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
211db9ca
EF
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))))
b357faac
AE
596 (build-system gnu-build-system)
597 (inputs
598 `(("which" ,which)))
599 (arguments
600 `(#:phases
dc1d3cde
KK
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)))))
6fd52309 609 (home-page "https://www.gnu.org/software/sharutils/")
b357faac
AE
610 (synopsis "Archives in shell scripts, uuencode/uudecode")
611 (description
79c311b8
LC
612 "GNU sharutils is a package for creating and manipulating shell
613archives that can be readily emailed. A shell archive is a file that can be
e881752c 614processed by a Bourne-type shell to unpack the original collection of files.
79c311b8 615This package is mostly for compatibility and historical interest.")
b357faac 616 (license license:gpl3+)))
28469ab0 617
646898b3
RW
618(define-public sfarklib
619 (package
620 (name "sfarklib")
979f9e8a 621 (version "2.24")
646898b3 622 (source (origin
979f9e8a
RW
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"))
646898b3
RW
627 (sha256
628 (base32
979f9e8a 629 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
646898b3
RW
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
646with the sfArk algorithm.")
647 (license license:gpl3+)))
648
b5ad1659 649(define-public sfarkxtc
3fa31317
RW
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
b5ad1659 682sfArk file format to the uncompressed sf2 format.")
3fa31317 683 (license license:gpl3+))))
b5ad1659 684
27f76fe6
TUBK
685(define-public libmspack
686 (package
687 (name "libmspack")
27b2f34c 688 (home-page "https://cabextract.org.uk/libmspack/")
ea80fd1f 689 (version "0.9.1")
27f76fe6
TUBK
690 (source
691 (origin
692 (method url-fetch)
27b2f34c 693 (uri (string-append home-page name "-" version "alpha.tar.gz"))
27f76fe6 694 (sha256
ea80fd1f 695 (base32 "0h1f5w8rjnq7dcqpqm1mpx5m8q80691kid6f7npqlqwqqzckd8v2"))))
27f76fe6 696 (build-system gnu-build-system)
03c16bb5
MB
697 (arguments
698 `(#:configure-flags '("--disable-static")))
27f76fe6
TUBK
699 (synopsis "Compression tools for some formats used by Microsoft")
700 (description
701 "The purpose of libmspack is to provide both compression and
702decompression of some loosely related file formats used by Microsoft.")
703 (license license:lgpl2.1+)))
73f542c3 704
82aa2a28
LF
705(define-public lz4
706 (package
707 (name "lz4")
528d1292 708 (version "1.8.1.2")
82aa2a28
LF
709 (source
710 (origin
b38cfa1d
MB
711 (method git-fetch)
712 (uri (git-reference (url "https://github.com/lz4/lz4")
713 (commit (string-append "v" version))))
82aa2a28 714 (sha256
b496bfea 715 (base32
b38cfa1d
MB
716 "1jggv4lvfav53advnj0pwqgxzn868lrj8dc9zp73iwvqlj82mhmx"))
717 (file-name (git-file-name name version))))
82aa2a28 718 (build-system gnu-build-system)
fc89cb69 719 (native-inputs `(("valgrind" ,valgrind))) ; for tests
82aa2a28
LF
720 (arguments
721 `(#:test-target "test"
82aa2a28 722 #:make-flags (list "CC=gcc"
0dd6d21a 723 (string-append "prefix=" (assoc-ref %outputs "out")))
82aa2a28 724 #:phases (modify-phases %standard-phases
fc89cb69 725 (delete 'configure)))) ; no configure script
fd174342 726 (home-page "https://www.lz4.org")
82aa2a28
LF
727 (synopsis "Compression algorithm focused on speed")
728 (description "LZ4 is a lossless compression algorithm, providing
729compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
730extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
731A high compression derivative, called LZ4_HC, is also provided. It trades CPU
732time for compression ratio.")
b7585ca3 733 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
82aa2a28
LF
734 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
735 (license (list license:bsd-2 license:gpl2+))))
dd8d6d65
SB
736
737(define-public squashfs-tools
738 (package
739 (name "squashfs-tools")
740 (version "4.3")
741 (source (origin
742 (method url-fetch)
de67e922
LF
743 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
744 "squashfs" version "/"
dd8d6d65
SB
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
f793b4ef
EF
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)))))
dd8d6d65
SB
771 (inputs
772 `(("lz4" ,lz4)
773 ("lzo" ,lzo)
774 ("xz" ,xz)
775 ("zlib" ,zlib)))
776 (home-page "http://squashfs.sourceforge.net/")
8f65585b 777 (synopsis "Tools to create and extract squashfs file systems")
dd8d6d65 778 (description
8f65585b 779 "Squashfs is a highly compressed read-only file system for Linux. It uses
dd8d6d65
SB
780zlib to compress files, inodes, and directories. All blocks are packed to
781minimize the data overhead, and block sizes of between 4K and 1M are supported.
782It is intended to be used for archival use, for live CDs, and for embedded
783systems where low overhead is needed. This package allows you to create and
8f65585b 784extract such file systems.")
dd8d6d65 785 (license license:gpl2+)))
820dc3f5 786
e580597d
RW
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")))))))
820dc3f5
JM
803
804(define-public pigz
805 (package
806 (name "pigz")
9dae73c3 807 (version "2.4")
820dc3f5
JM
808 (source (origin
809 (method url-fetch)
810 (uri (string-append "http://zlib.net/pigz/"
811 name "-" version ".tar.gz"))
812 (sha256
813 (base32
9dae73c3 814 "0wsgw5vwl23jrnpsvd8v3xcp5k4waw5mk0164fynjhkv58i1dy54"))))
820dc3f5
JM
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)))
7f1773ea 832 (home-page "https://zlib.net/pigz/")
820dc3f5
JM
833 (synopsis "Parallel implementation of gzip")
834 (description
835 "This package provides a parallel implementation of gzip that exploits
836multiple 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)))
23f3cbb8
BW
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,
862but they produce just one big block of compressed data. Pixz instead produces
863a collection of smaller blocks which makes random access to the original data
864possible and can compress in parallel. This is especially useful for large
865tarballs.")
866 (license license:bsd-2)))
69d9792a
EB
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)))
6cbee49d
MW
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))))
69d9792a
EB
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")
ded1e983 901 (invoke "autoreconf" "-vfi"))))))
69d9792a
EB
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
906similar in speed to deflate but offers denser compression. This package
907provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
908respectively, based on the reference implementation from Google.")
909 (license license:expat))))
3fd4b90d 910
ac83cf22
MB
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
942applying patches to binary files. By using suffix sorting (specifically
943Larsson and Sadakane's @code{qsufsort}) and taking advantage of how
944executable files change, bsdiff routinely produces binary patches 50-80%
945smaller than those produced by @code{Xdelta}.")
946 (license license:bsd-2)))
3fd4b90d
DM
947
948(define-public cabextract
949 (package
950 (name "cabextract")
27b2f34c 951 (home-page "https://cabextract.org.uk/")
b3175c70 952 (version "1.9")
3fd4b90d
DM
953 (source (origin
954 (method url-fetch)
27b2f34c 955 (uri (string-append home-page name "-" version ".tar.gz"))
3fd4b90d
DM
956 (sha256
957 (base32
b3175c70 958 "1hf4zhjxfdgq9x172r5zfdnafma9q0zf7372syn8hcn7hcypkg0v"))
92526ade
MB
959 (modules '((guix build utils)))
960 (snippet
961 '(begin
962 ;; Delete bundled libmspack.
963 (delete-file-recursively "mspack")
964 #t))))
3fd4b90d 965 (build-system gnu-build-system)
b3175c70
KK
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))))))
3fd4b90d
DM
982 (native-inputs
983 `(("pkg-config" ,pkg-config)))
984 (inputs
b3175c70
KK
985 `(("libmspack" ,libmspack)
986 ("libmspack-source" ,(package-source libmspack))))
3fd4b90d
DM
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+)))
0b073506
TGR
991
992(define-public xdelta
993 (package
994 (name "xdelta")
995 (version "3.1.0")
996 (source
997 (origin
0633c77b
RW
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))
0b073506
TGR
1003 (sha256
1004 (base32
0633c77b 1005 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
0b073506
TGR
1006 (snippet
1007 ;; This file isn't freely distributable and has no effect on building.
6cbee49d
MW
1008 '(begin
1009 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1010 #t))))
0b073506
TGR
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
e5ff963a 1019 (lambda _ (chdir "xdelta3") #t)))))
69b7fa3e 1020 (home-page "http://xdelta.org")
0b073506
TGR
1021 (synopsis "Delta encoder for binary files")
1022 (description "xdelta encodes only the differences between two binary files
1023using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1024also 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
1026human-readable output.")
1027 (license license:asl2.0)))
389eb3fa
TGR
1028
1029(define-public lrzip
1030 (package
1031 (name "lrzip")
666619d0 1032 (version "0.631")
389eb3fa
TGR
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
5400fdfd
TGR
1040 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))
1041 (patches (search-patches "lrzip-CVE-2017-8842.patch"))))
389eb3fa
TGR
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
1057redundancy reduction to improve the subsequent compression ratio of
1058larger files. It can then further compress the result with the ZPAQ or
1059LZMA algorithms for maximum compression, or LZO for maximum speed. This
1060choice between size or speed allows for either better compression than
1061even LZMA can provide, or a higher speed than gzip while compressing as
1062well as bzip2.")
1063 (license (list license:gpl3+
1064 license:public-domain)))) ; most files in lzma/
e4c2136d
DC
1065
1066(define-public snappy
1067 (package
1068 (name "snappy")
5a437357 1069 (version "1.1.7")
16de7f15
TGR
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"))))
5a437357
MB
1079 (build-system cmake-build-system)
1080 (arguments
1081 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
e4c2136d
DC
1082 (home-page "https://github.com/google/snappy")
1083 (synopsis "Fast compressor/decompressor")
5a437357 1084 (description "Snappy is a compression/decompression library. It does not
e4c2136d 1085aim for maximum compression, or compatibility with any other compression library;
5a437357 1086instead, it aims for very high speeds and reasonable compression. For instance,
e4c2136d
DC
1087compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1088for most inputs, but the resulting compressed files are anywhere from 20% to
1089100% bigger.")
1090 (license license:asl2.0)))
adbd7faf
KK
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))
1ac675a5 1117 (patches (search-patches "p7zip-CVE-2016-9296.patch"
a630c647 1118 "p7zip-CVE-2017-17969.patch"
1ac675a5 1119 "p7zip-remove-unused-code.patch"))))
adbd7faf
KK
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)
8fcdd9d5
MW
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")))
adbd7faf
KK
1139 (replace 'check
1140 (lambda _
8fcdd9d5
MW
1141 (invoke "make" "test")
1142 (invoke "make" "test_7z")
1143 (invoke "make" "test_7zr"))))))
adbd7faf
KK
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
1155handles the 7z format which features very high compression ratios.")
1156 (license (list license:lgpl2.1+
1157 license:gpl2+
1158 license:public-domain))))
618089f9
MB
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.
6cbee49d
MW
1176 '(begin
1177 (delete-file "gzstream.o")
1178 #t))))
618089f9
MB
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
1197functionality in a C++ iostream.")
1198 (license license:lgpl2.1+)))
36df995c
TGR
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.
6cbee49d
MW
1215 '(begin
1216 (for-each delete-file (find-files "." "\\.exe$"))
1217 #t))))
36df995c
TGR
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.
effd7198 1233 (string-append "CXXFLAGS=-O3 -DNDEBUG"
36df995c
TGR
1234 ,(match (or (%current-target-system)
1235 (%current-system))
effd7198
EF
1236 ("x86_64-linux" " -march=nocona -mtune=generic")
1237 ("i686-linux" " -march=i686 -mtune=generic")
1238 ("armhf-linux" " -mtune=generic-armv7-a")
36df995c
TGR
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
1247many duplicate and already compressed files. It backs up only those files
1248modified since the last update. All previous versions remain untouched and can
1249be independently recovered. Identical files are only stored once (known as
1250@dfn{de-duplication}). Archives can also be encrypted.
1251
1252ZPAQ is intended to back up user data, not entire operating systems. It ignores
1253owner and group IDs, ACLs, extended attributes, or special file types like
1254devices, sockets, or named pipes. It does not follow or restore symbolic links
1255or 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))))
0da8313c 1260
9e6ada8f
MR
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"))
277be74f 1269 (file-name (string-append name "-" version ".tar.gz"))
9e6ada8f
MR
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)
a5fa1a1a
MR
1281 (uri (string-append "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1282 "unshield-avigomanager11b22.zip?dl=1"))
9e6ada8f
MR
1283 (sha256
1284 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1285 (file-name "unshield-avigomanager11b22.zip")))
1286 ("unshield-the-feeble-files-spanish.zip"
1287 ,(origin
1288 (method url-fetch)
a5fa1a1a
MR
1289 (uri (string-append "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1290 "unshield-the-feeble-files-spanish.zip?dl=1"))
9e6ada8f
MR
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 _
df04bd25 1326 (invoke "./run-tests.sh"))))))
9e6ada8f
MR
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
f6ac3101
TGR
1334(define-public zstd
1335 (package
1336 (name "zstd")
2f325b63 1337 (version "1.3.8")
3880537c
TGR
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
2f325b63 1344 (base32 "13nlsqhkn276frxrzjdn7wz0j9zz414lf336885ykyxcvw2a0gr9"))))
f6ac3101
TGR
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"
f45e314e
TGR
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"
e8073063 1358 "HAVE_ZLIB=0")))
2f325b63 1359 (home-page "https://facebook.github.io/zstd/")
f6ac3101
TGR
1360 (synopsis "Zstandard real-time compression algorithm")
1361 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1362that combines very fast operation with a compression ratio comparable to that of
1363zlib. In most scenarios, both compression and decompression can be performed in
1364‘real time’. The compressor can be configured to provide the most suitable
1365trade-off between compression ratio and speed, without affecting decompression
1366speed.")
1367 (license (list license:bsd-3 ; the main top-level LICENSE file
16123d1d 1368 license:bsd-2 ; many files explicitly state 2-Clause
5a719dee 1369 license:gpl2 ; the main top-level COPYING file
16123d1d
TGR
1370 license:gpl3+ ; tests/gzip/*.sh
1371 license:expat ; lib/dictBuilder/divsufsort.[ch]
f6ac3101
TGR
1372 license:public-domain ; zlibWrapper/examples/fitblk*
1373 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
0f03c531
TGR
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
c695fb76 1382 `(("googletest" ,googletest)))
0f03c531
TGR
1383 (arguments
1384 `(#:phases
1385 (modify-phases %standard-phases
1386 (add-after 'unpack 'enter-subdirectory
9f6f726c 1387 (lambda _ (chdir "contrib/pzstd") #t))
0f03c531
TGR
1388 (delete 'configure) ; no configure script
1389 (add-before 'check 'compile-tests
1390 (lambda* (#:key make-flags #:allow-other-keys)
745e83ca 1391 (apply invoke "make" "tests" make-flags)))
0f03c531
TGR
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
1405multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1406compression algorithm}. It is fully compatible with the original Zstandard file
1407format and command-line interface, and can be used as a drop-in replacement.
1408
1409Compression is distributed over multiple processor cores to improve performance,
1410as is the decompression of data compressed in this manner. Data compressed by
1411other implementations will only be decompressed by two threads: one performing
1412the actual decompression, the other input and output.")
1413 (license (package-license zstd))))
148585c2
AI
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")))
148585c2
AI
1435 #:phases
1436 (modify-phases %standard-phases
1437 (replace 'build
1438 (lambda* (#:key (make-flags '()) #:allow-other-keys)
b0559d24 1439 (apply invoke "make" "generic_gcc" make-flags)))
148585c2
AI
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
1445for packaging a set of files for distribution, for archiving files, and for
1446saving disk space by temporarily compressing unused files or directories.
1447Zip puts one or more compressed files into a single ZIP archive, along with
1448information about the files (name, path, date, time of last modification,
1449protection, and check information to verify file integrity). An entire
1450directory structure can be packed into a ZIP archive with a single command.
1451
1452Zip has one compression method (deflation) and can also store files without
1453compression. Zip automatically chooses the better of the two for each file.
1454Compression 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)
190376a1
MW
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))
148585c2
AI
1495 (replace 'build
1496 (lambda* (#:key make-flags #:allow-other-keys)
fa76696b
MW
1497 (apply invoke "make"
1498 `("-j" ,(number->string
1499 (parallel-job-count))
1500 ,@make-flags
1501 "generic_gcc")))))
148585c2
AI
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,
1509also called \"zipfiles\".
1510
1511UnZip lists, tests, or extracts files from a .zip archive. The default
1512behaviour (with no options) is to extract into the current directory, and
1513subdirectories below it, all files from the specified zipfile. UnZip
1514recreates 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")
3f986ff6
MB
1521 (version "0.13.69")
1522 (home-page "https://github.com/gdraheim/zziplib")
148585c2
AI
1523 (source
1524 (origin
1525 (method url-fetch)
3f986ff6 1526 (uri (string-append home-page "/archive/v" version ".tar.gz"))
148585c2
AI
1527 (sha256
1528 (base32
3f986ff6 1529 "0i052a7shww0fzsxrdp3rd7g4mbzx7324a8ysbc0br7frpblcql4"))))
148585c2
AI
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
148585c2
AI
1539 (synopsis "Library for accessing zip files")
1540 (description
1541 "ZZipLib is a library based on zlib for accessing zip files.")
0d729c5b
MB
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))))
148585c2 1545
06de4aaf
TF
1546(define-public libzip
1547 (package
1548 (name "libzip")
80486319 1549 (version "1.5.1")
06de4aaf
TF
1550 (source (origin
1551 (method url-fetch)
1552 (uri (string-append
8d6c7456 1553 "https://libzip.org/download/" name "-" version ".tar.xz"))
06de4aaf
TF
1554 (sha256
1555 (base32
80486319 1556 "0wnkkvkq90wyawj9221i77sf3nix1vj3ygzdy59k8yvcjnv3bsh4"))))
06de4aaf
TF
1557 (native-inputs
1558 `(("perl" ,perl)))
1559 (inputs
1560 `(("zlib" ,zlib)))
80486319 1561 (build-system cmake-build-system)
8d6c7456 1562 (home-page "https://libzip.org")
06de4aaf
TF
1563 (synopsis "C library for reading, creating, and modifying zip archives")
1564 (description "Libzip is a C library for reading, creating, and modifying
1565zip archives. Files can be added from data buffers, files, or compressed data
1566copied directly from other zip archives. Changes made without closing the
1567archive can be reverted.")
1568 (license license:bsd-3)))
ef5c40aa
SR
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)))
340978d7 1596 (home-page "https://www.nongnu.org/atool/")
ef5c40aa
SR
1597 (synopsis "Universal tool to manage file archives of various types")
1598 (description "The main command is @command{aunpack} which extracts files
1599from an archive. The other commands provided are @command{apack} (to create
1600archives), @command{als} (to list files in archives), and @command{acat} (to
1601extract files to standard out). As @command{atool} invokes external programs
1602to handle the archives, not all commands may be supported for a certain type
1603of archives.")
1604 (license license:gpl2+)))
b44ecca6 1605
34e8cf22
TGR
1606(define-public lunzip
1607 (package
1608 (name "lunzip")
83e8a302 1609 (version "1.10")
34e8cf22
TGR
1610 (source
1611 (origin
1612 (method url-fetch)
b7fd77ef 1613 (uri (string-append "mirror://savannah/lzip/"
34e8cf22
TGR
1614 name "/" name "-" version ".tar.gz"))
1615 (sha256
83e8a302 1616 (base32 "1iw59br6nsxs7l1p875h8w3vxwr04xfhg5zyal64crvamhxkj5kl"))))
34e8cf22
TGR
1617 (build-system gnu-build-system)
1618 (arguments
1619 `(#:configure-flags
1620 (list "CC=gcc")))
340978d7 1621 (home-page "https://www.nongnu.org/lzip/lunzip.html")
34e8cf22
TGR
1622 (synopsis "Small, stand-alone lzip decompressor")
1623 (description
1624 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1625written as a single small C tool with no dependencies. This makes it
1626well-suited to embedded and other systems without a C++ compiler, or for use in
1627applications such as software installers that need only to decompress files,
1628not compress them.
1629Lunzip 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
5dca4c76
TGR
1632
1633(define-public clzip
1634 (package
1635 (name "clzip")
d6d1643b 1636 (version "1.10")
5dca4c76
TGR
1637 (source
1638 (origin
1639 (method url-fetch)
b7fd77ef 1640 (uri (string-append "mirror://savannah/lzip/"
5dca4c76
TGR
1641 name "/" name "-" version ".tar.gz"))
1642 (sha256
d6d1643b 1643 (base32 "03xcmhl3dya4jrwmsqh09ikimpb36fr3vkh2bwfzz1sbcns0cdg3"))))
5dca4c76
TGR
1644 (build-system gnu-build-system)
1645 (arguments
1646 `(#:configure-flags
1647 (list "CC=gcc")))
340978d7 1648 (home-page "https://www.nongnu.org/lzip/clzip.html")
5dca4c76
TGR
1649 (synopsis "Small, stand-alone lzip compressor and decompressor")
1650 (description
1651 "Clzip is a compressor and decompressor for files in the lzip compression
1652format (.lz), written as a single small C tool with no dependencies. This makes
1653it well-suited to embedded and other systems without a C++ compiler, or for use
1654in other applications like package managers.
1655Clzip 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+))))
2e3b1a92
TGR
1658
1659(define-public lzlib
1660 (package
1661 (name "lzlib")
d1c1d835 1662 (version "1.10")
2e3b1a92
TGR
1663 (source
1664 (origin
1665 (method url-fetch)
b7fd77ef 1666 (uri (string-append "mirror://savannah/lzip/"
2e3b1a92
TGR
1667 name "/" name "-" version ".tar.gz"))
1668 (sha256
d1c1d835 1669 (base32 "0hqhnj2lzqacdbmmnpy91lsm1rd9zlngs1q6s9pyahsv1a0bfshx"))))
2e3b1a92
TGR
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
340978d7 1677 (home-page "https://www.nongnu.org/lzip/lzlib.html")
2e3b1a92
TGR
1678 (synopsis "Lzip data compression C library")
1679 (description
1680 "Lzlib is a C library for in-memory LZMA compression and decompression in
1681the lzip format. It supports integrity checking of the decompressed data, and
1682all functions are thread-safe. The library should never crash, even in case of
1683corrupted input.")
1684 (license (list license:bsd-2 ; the library itself
1685 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
8c4ca853
TGR
1686
1687(define-public plzip
1688 (package
1689 (name "plzip")
ff0e1eed 1690 (version "1.8")
8c4ca853
TGR
1691 (source
1692 (origin
1693 (method url-fetch)
894669a7
TGR
1694 (uri (string-append "mirror://savannah/lzip/plzip/"
1695 "plzip-" version ".tar.gz"))
8c4ca853 1696 (sha256
ff0e1eed 1697 (base32 "04indil809qgfmz776imb3dnhkysh7zk28jcv3mw0ahl2lyaxbzd"))))
8c4ca853
TGR
1698 (build-system gnu-build-system)
1699 (inputs
1700 `(("lzlib" ,lzlib)))
340978d7 1701 (home-page "https://www.nongnu.org/lzip/plzip.html")
8c4ca853
TGR
1702 (synopsis "Parallel lossless data compressor for the lzip format")
1703 (description
1704 "Plzip is a massively parallel (multi-threaded) lossless data compressor
1705and decompressor that uses the lzip file format (.lz). Files produced by plzip
1706are fully compatible with lzip and can be rescued with lziprecover.
1707On multiprocessor machines, plzip can compress and decompress large files much
1708faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
17092%). The number of usable threads is limited by file size: on files of only a
1710few MiB, plzip is no faster than lzip.
1711Files that were compressed with regular lzip will also not be decompressed
1712faster by plzip, unless the @code{-b} option was used: lzip usually produces
1713single-member files which can't be decompressed in parallel.")
1714 (license (list license:bsd-2 ; arg_parser.{cc,h}
1715 license:gpl2+)))) ; everything else
e294c05e
RH
1716
1717(define-public innoextract
1718 (package
1719 (name "innoextract")
05640222 1720 (version "1.7")
e294c05e
RH
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
05640222 1728 "0khwi9f0q0h6xfbixrrc1rfpgj0b7ajwilq7yhmxnn5lpc807f6x"))
e294c05e
RH
1729 (file-name (string-append name "-" version ".tar.gz"))))
1730 (build-system cmake-build-system)
1731 (arguments
1732 `(#:tests? #f)) ;; No tests available.
4cb9b726 1733 (inputs `(("boost" ,boost)
e294c05e
RH
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
1740non-Windows systems without running the actual installer using wine.")
1741 (license license:zlib)))
2ed0ef2f
LF
1742
1743(define-public google-brotli
1744 (package
1745 (name "google-brotli")
605ade44 1746 (version "1.0.4")
2ed0ef2f
LF
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
605ade44 1753 "1hrpmz162k4x3xm6vmbpm443jlfr1kp536p8962y2dncy7gs6s12"))))
2ed0ef2f
LF
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,
1777a generic-purpose lossless compression algorithm that compresses data using a
1778combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
1779order context modeling, with a compression ratio comparable to the best
1780currently available general-purpose compression methods. It is similar in speed
1781with @code{deflate} but offers more dense compression.
1782
1783The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
1784 (license license:expat)))
71987177
PN
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
1801achieve an excellent compression ratio while allowing fast decompression.
1802Decompression requires no additional memory.
1803
1804Compared to LZO, the UCL algorithms achieve a better compression ratio but
1805decompression is a little bit slower.")
1806 (license license:gpl2+)))
5735256d
PN
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
a14de832
PN
1818 "08anybdliqsbsl6x835iwzljahnm9i7v26icdjkcv33xmk6p5vw1"))
1819 (patches (search-patches "upx-fix-CVE-2017-15056.patch"))))
5735256d
PN
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/")
a14de832
PN
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"))))
5735256d
PN
1856 (synopsis "Compression tool for executables")
1857 (description
1858 "The Ultimate Packer for eXecutables (UPX) is an executable file
1859compressor. UPX typically reduces the file size of programs and shared
1860libraries by around 50%--70%, thus reducing disk space, network load times,
1861download times, and other distribution and storage costs.")
1862 (license license:gpl2+)))