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