gnu: libdvdcss: Update to 1.4.3.
[jackhill/guix/guix.git] / gnu / packages / compression.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
31dcc272 2;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2019, 2020 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>
9a2fcb63 7;;; Copyright © 2015, 2016, 2017, 2018, 2020 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>
9098745b 10;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
23f3cbb8 11;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
3fd4b90d 12;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
0eacdd46 13;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
e4c2136d 14;;; Copyright © 2016 David Craven <david@craven.ch>
3480ceb1 15;;; Copyright © 2016, 2019, 2020 Kei Kebreau <kkebreau@posteo.net>
8e98f750 16;;; Copyright © 2016, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
3c986a7d 17;;; Copyright © 2017 Nikita <nikita@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>
8ff5c735 25;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
09debcf5 26;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
9720104c 27;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
1ac624cd 28;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
d2b237d0 29;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
ee4ba542 30;;; Copyright © 2020, 2021 Lars-Dominik Braun <lars@6xq.net>
ff43f128 31;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
9d5ed931 32;;; Copyright © 2020 Léo Le Bouter <lle-bout@zaclys.net>
e7195e83 33;;; Copyright © 2021 Antoine Côté <antoine.cote@posteo.net>
51697aab 34;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
a268f085 35;;;
233e7676 36;;; This file is part of GNU Guix.
a268f085 37;;;
233e7676 38;;; GNU Guix is free software; you can redistribute it and/or modify it
a268f085
LC
39;;; under the terms of the GNU General Public License as published by
40;;; the Free Software Foundation; either version 3 of the License, or (at
41;;; your option) any later version.
42;;;
233e7676 43;;; GNU Guix is distributed in the hope that it will be useful, but
a268f085
LC
44;;; WITHOUT ANY WARRANTY; without even the implied warranty of
45;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46;;; GNU General Public License for more details.
47;;;
48;;; You should have received a copy of the GNU General Public License
233e7676 49;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
a268f085 50
1ffa7090 51(define-module (gnu packages compression)
b5b73a82 52 #:use-module ((guix licenses) #:prefix license:)
21b2ec4d 53 #:use-module (guix utils)
a268f085 54 #:use-module (guix packages)
87f5d366 55 #:use-module (guix download)
646898b3 56 #:use-module (guix git-download)
9e6ada8f 57 #:use-module (guix build-system cmake)
0745e28d 58 #:use-module (guix build-system glib-or-gtk)
b357faac 59 #:use-module (guix build-system gnu)
910bf1f7 60 #:use-module (guix build-system go)
9d5ed931 61 #:use-module (guix build-system meson)
d2b237d0 62 #:use-module (guix build-system python)
8ff5c735 63 #:use-module (guix build-system trivial)
e99dd67a 64 #:use-module (gnu packages)
389eb3fa 65 #:use-module (gnu packages assembly)
69d9792a 66 #:use-module (gnu packages autotools)
23f3cbb8 67 #:use-module (gnu packages backup)
73f542c3 68 #:use-module (gnu packages base)
e294c05e 69 #:use-module (gnu packages boost)
0f03c531 70 #:use-module (gnu packages check)
9e6ada8f 71 #:use-module (gnu packages curl)
09debcf5 72 #:use-module (gnu packages documentation)
ef5c40aa 73 #:use-module (gnu packages file)
0745e28d
RG
74 #:use-module (gnu packages gettext)
75 #:use-module (gnu packages glib)
76 #:use-module (gnu packages gnome)
9d5ed931 77 #:use-module (gnu packages gnupg)
0745e28d 78 #:use-module (gnu packages gtk)
9d5ed931 79 #:use-module (gnu packages man)
9869bb12 80 #:use-module (gnu packages maths)
646898b3 81 #:use-module (gnu packages perl)
23f3cbb8 82 #:use-module (gnu packages pkg-config)
1ae60db8 83 #:use-module (gnu packages python)
09debcf5 84 #:use-module (gnu packages qt)
9e6ada8f 85 #:use-module (gnu packages tls)
82aa2a28 86 #:use-module (gnu packages valgrind)
9d5ed931 87 #:use-module (gnu packages version-control)
0745e28d 88 #:use-module (gnu packages xml)
36df995c 89 #:use-module (ice-9 match)
f7fdafef 90 #:use-module (srfi srfi-1))
a268f085 91
6a92093d
LC
92(define-public zlib
93 (package
94 (name "zlib")
2b8bea03 95 (version "1.2.11")
6a92093d
LC
96 (source
97 (origin
87f5d366 98 (method url-fetch)
a67f97fe
CR
99 (uri (list (string-append "http://zlib.net/zlib-"
100 version ".tar.gz")
b2859a4f
LC
101 (string-append "mirror://sourceforge/libpng/zlib/"
102 version "/zlib-" version ".tar.gz")))
6a92093d
LC
103 (sha256
104 (base32
2b8bea03 105 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
6a92093d 106 (build-system gnu-build-system)
b90289da 107 (outputs '("out" "static"))
6a92093d 108 (arguments
6cd00453
EF
109 `(#:phases
110 (modify-phases %standard-phases
111 (replace 'configure
112 (lambda* (#:key outputs #:allow-other-keys)
113 ;; Zlib's home-made `configure' fails when passed
114 ;; extra flags like `--enable-fast-install', so we need to
115 ;; invoke it with just what it understand.
116 (let ((out (assoc-ref outputs "out")))
117 ;; 'configure' doesn't understand '--host'.
118 ,@(if (%current-target-system)
119 `((setenv "CHOST" ,(%current-target-system)))
120 '())
144cc3c4 121 (invoke "./configure"
b90289da
MB
122 (string-append "--prefix=" out)))))
123 (add-after 'install 'move-static-library
124 (lambda* (#:key outputs #:allow-other-keys)
125 (let ((out (assoc-ref outputs "out"))
126 (static (assoc-ref outputs "static")))
127 (with-directory-excursion (string-append out "/lib")
128 (install-file "libz.a" (string-append static "/lib"))
129 (delete-file "libz.a")
130 #t)))))))
7f1773ea 131 (home-page "https://zlib.net/")
35b9e423 132 (synopsis "Compression library")
6a92093d
LC
133 (description
134 "zlib is designed to be a free, general-purpose, legally unencumbered --
135that is, not covered by any patents -- lossless data-compression library for
136use on virtually any computer hardware and operating system. The zlib data
35b9e423 137format is itself portable across platforms. Unlike the LZW compression method
6a92093d
LC
138used in Unix compress(1) and in the GIF image format, the compression method
139currently used in zlib essentially never expands the data. (LZW can double or
140triple the file size in extreme cases.) zlib's memory footprint is also
141independent of the input data and can be reduced, if necessary, at some cost
142in compression.")
4a44e743 143 (license license:zlib)))
6a92093d 144
8298df96
MB
145(define-public minizip
146 (package
147 (name "minizip")
148 (version (package-version zlib))
149 (source (package-source zlib))
150 (build-system gnu-build-system)
151 (arguments
152 `(#:phases
153 (modify-phases %standard-phases
154 (add-after 'unpack 'enter-source
c11ac62d
LC
155 (lambda _ (chdir "contrib/minizip") #t))
156 (add-after 'install 'remove-crypt-h
157 (lambda* (#:key outputs #:allow-other-keys)
158 ;; Remove <minizip/crypt.h> because it interferes with libc's
159 ;; <crypt.h> given that 'minizip.pc' says "-I…/include/minizip".
160 ;; Fedora does the same:
161 ;; <https://src.fedoraproject.org/rpms/zlib/c/4d2785ec3116947872f6f32dc4104e6d36d8a7a4?branch=master>.
162 (let ((out (assoc-ref outputs "out")))
163 (delete-file (string-append out "/include/minizip/crypt.h"))
164 #t))))))
8298df96
MB
165 (native-inputs
166 `(("autoconf" ,autoconf)
167 ("automake" ,automake)
168 ("libtool" ,libtool)))
169 (propagated-inputs `(("zlib" ,zlib)))
170 (home-page (package-home-page zlib))
171 (synopsis "Zip Compression library")
172 (description
173 "Minizip is a minimalistic library that supports compressing,
174extracting and viewing ZIP archives. This version is extracted from
175the @code{zlib} source.")
176 (license (package-license zlib))))
177
ee97be9f
RW
178(define-public fastjar
179 (package
180 (name "fastjar")
181 (version "0.98")
182 (source (origin
183 (method url-fetch)
184 (uri (string-append "mirror://savannah/fastjar/fastjar-"
185 version ".tar.gz"))
186 (sha256
187 (base32
188 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
189 (build-system gnu-build-system)
190 (inputs `(("zlib" ,zlib)))
340978d7 191 (home-page "https://savannah.nongnu.org/projects/fastjar")
ee97be9f
RW
192 (synopsis "Replacement for Sun's 'jar' utility")
193 (description
36a4366d
EF
194 "FastJar is an attempt to create a much faster replacement for Sun's
195@code{jar} utility. Instead of being written in Java, FastJar is written in C.")
ee97be9f
RW
196 (license license:gpl2+)))
197
58593975
RW
198(define-public libtar
199 (package
200 (name "libtar")
89d80159 201 (version "1.2.20")
58593975
RW
202 (source (origin
203 (method url-fetch)
89d80159
EF
204 (uri (list
205 (string-append
206 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
207 version ".tar.gz")
208 (string-append
209 "mirror://debian/pool/main/libt/libtar/libtar_"
210 version ".orig.tar.gz")))
58593975
RW
211 (sha256
212 (base32
e99dd67a
EF
213 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
214 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
58593975 215 (build-system gnu-build-system)
112fcafb 216 (arguments `(#:tests? #f)) ; no "check" target
89d80159
EF
217 (native-inputs
218 `(("autoconf" ,autoconf)
219 ("automake" ,automake)
220 ("libtool" ,libtool)))
221 (inputs
222 `(("zlib" ,zlib)))
58593975
RW
223 (synopsis "C library for manipulating POSIX tar files")
224 (description
225 "libtar is a C library for manipulating POSIX tar files. It handles
226adding and extracting files to/from a tar archive.")
89d80159 227 (home-page "https://repo.or.cz/libtar.git")
58593975
RW
228 (license license:bsd-3)))
229
a268f085
LC
230(define-public gzip
231 (package
232 (name "gzip")
07c95566 233 (version "1.10")
a268f085 234 (source (origin
87f5d366 235 (method url-fetch)
0db342a5 236 (uri (string-append "mirror://gnu/gzip/gzip-"
28181faf 237 version ".tar.xz"))
a268f085
LC
238 (sha256
239 (base32
07c95566 240 "1h6p374d3j8d4cdfydzls021xa2yby8myc0h8d6m8bc7k6ncq9c4"))))
a268f085 241 (build-system gnu-build-system)
f50d2669 242 (synopsis "General file (de)compression (using lzw)")
a268f085
LC
243 (arguments
244 ;; FIXME: The test suite wants `less', and optionally Perl.
48623f5b
RW
245 '(#:tests? #f
246 #:phases
247 (modify-phases %standard-phases
c7b87eed
MB
248 (add-after 'unpack 'patch-for-glibc-2.28
249 (lambda _
250 ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
251 ;; "m4-gnulib-libio.patch". This is a phase rather than patch
252 ;; or snippet to work around <https://bugs.gnu.org/32347>.
253 (substitute* (find-files "lib" "\\.c$")
254 (("#if defined _IO_ftrylockfile")
255 "#if defined _IO_EOF_SEEN"))
256 (substitute* "lib/stdio-impl.h"
257 (("^/\\* BSD stdio derived implementations")
258 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
259 "# define _IO_IN_BACKUP 0x100\n"
260 "#endif\n\n"
261 "/* BSD stdio derived implementations")))
262 #t))
48623f5b
RW
263 (add-after 'unpack 'use-absolute-name-of-gzip
264 (lambda* (#:key outputs #:allow-other-keys)
265 (substitute* "gunzip.in"
266 (("exec gzip")
267 (string-append "exec " (assoc-ref outputs "out")
268 "/bin/gzip")))
269 #t)))))
a268f085 270 (description
79c311b8
LC
271 "GNU Gzip provides data compression and decompression utilities; the
272typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
273file; as a result, it is often used in conjunction with \"tar\", resulting in
274\".tar.gz\" or \".tgz\", etc.")
4a44e743 275 (license license:gpl3+)
6fd52309 276 (home-page "https://www.gnu.org/software/gzip/")))
a268f085
LC
277
278(define-public bzip2
03bc86b8
CB
279 (package
280 (name "bzip2")
b9a3654e 281 (version "1.0.8")
03bc86b8
CB
282 (source (origin
283 (method url-fetch)
b9a3654e
MB
284 (uri (string-append "https://sourceware.org/pub/bzip2/bzip2-"
285 version ".tar.gz"))
03bc86b8
CB
286 (sha256
287 (base32
b9a3654e 288 "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb"))))
03bc86b8
CB
289 (build-system gnu-build-system)
290 (arguments
291 `(#:modules ((guix build gnu-build-system)
292 (guix build utils)
5212c52c 293 (ice-9 ftw)
03bc86b8
CB
294 (srfi srfi-1))
295 #:phases
296 (modify-phases %standard-phases
8e98f750
MB
297 (add-after 'set-paths 'hide-input-bzip2
298 (lambda* (#:key inputs #:allow-other-keys)
299 (let ((bzip2 (assoc-ref inputs "bzip2")))
300 (if bzip2
301 ;; Prevent the build system from retaining a reference to
302 ;; BZIP2 from INPUTS.
303 (begin
304 (setenv "LIBRARY_PATH"
305 (string-join (delete (string-append bzip2 "/lib")
306 (string-split (getenv "LIBRARY_PATH")
307 #\:))
308 ":"))
309 (format #t "environment variable `LIBRARY_PATH' set to `~a'~%"
310 (getenv "LIBRARY_PATH")))
311 (format #t "no bzip2 found, nothing done~%"))
312 #t)))
03bc86b8
CB
313 (replace 'configure
314 (lambda* (#:key target #:allow-other-keys)
3158bc04
MW
315 (when ,(%current-target-system)
316 ;; Cross-compilation: use the cross tools.
317 (substitute* (find-files "." "Makefile")
318 (("CC=.*$")
319 (string-append "CC = " target "-gcc\n"))
320 (("AR=.*$")
321 (string-append "AR = " target "-ar\n"))
322 (("RANLIB=.*$")
323 (string-append "RANLIB = " target "-ranlib\n"))
324 (("^all:(.*)test" _ prerequisites)
325 ;; Remove 'all' -> 'test' dependency.
326 (string-append "all:" prerequisites "\n"))))
327 #t))
03bc86b8
CB
328 (add-before 'build 'build-shared-lib
329 (lambda* (#:key inputs #:allow-other-keys)
330 (patch-makefile-SHELL "Makefile-libbz2_so")
3158bc04 331 (invoke "make" "-f" "Makefile-libbz2_so")))
03bc86b8
CB
332 (add-after 'install 'install-shared-lib
333 (lambda* (#:key outputs #:allow-other-keys)
2b786f67
MB
334 ;; The Makefile above does not have an 'install' target, nor does
335 ;; it create all the (un)versioned symlinks, so we handle it here.
03bc86b8 336 (let* ((out (assoc-ref outputs "out"))
2b786f67 337 (libdir (string-append out "/lib"))
5212c52c
MB
338 (soname "libbz2.so")
339 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
340 (lib (car (scandir "."
341 (lambda (file)
342 (and (string-prefix? soname file)
343 (eq? 'regular
344 (stat:type (lstat file))))))))
345 (soversion (string-drop lib (+ 1 (string-length soname)))))
2b786f67
MB
346 (install-file lib libdir)
347 (with-directory-excursion libdir
348 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
5212c52c 349 (let loop ((base soname)
2b786f67
MB
350 (numbers (string-split soversion #\.)))
351 (unless (null? numbers)
352 (let ((so-file (string-append base "." (car numbers))))
353 (symlink so-file base)
354 (loop so-file (cdr numbers))))))
355 #t)))
45719c1d
MB
356 (add-after 'install-shared-lib 'move-static-lib
357 (lambda* (#:key outputs #:allow-other-keys)
358 (let ((out (assoc-ref outputs "out"))
359 (static (assoc-ref outputs "static")))
360 (with-directory-excursion (string-append out "/lib")
361 (install-file "libbz2.a" (string-append static "/lib"))
362 (delete-file "libbz2.a")
363 #t))))
e7ee50f2
CB
364 (add-after 'install-shared-lib 'patch-scripts
365 (lambda* (#:key outputs inputs #:allow-other-keys)
366 (let* ((out (assoc-ref outputs "out")))
367 (substitute* (string-append out "/bin/bzdiff")
368 (("/bin/rm") "rm")))
03bc86b8 369 #t)))
ab4fab19 370
03bc86b8
CB
371 #:make-flags (list (string-append "PREFIX="
372 (assoc-ref %outputs "out")))
ab4fab19 373
03bc86b8
CB
374 ;; Don't attempt to run the tests when cross-compiling.
375 ,@(if (%current-target-system)
376 '(#:tests? #f)
377 '())))
45719c1d 378 (outputs '("out" "static"))
03bc86b8
CB
379 (synopsis "High-quality data compression program")
380 (description
381 "bzip2 is a freely available, patent free (see below), high-quality data
a268f085
LC
382compressor. It typically compresses files to within 10% to 15% of the best
383available techniques (the PPM family of statistical compressors), whilst
384being around twice as fast at compression and six times faster at
385decompression.")
03bc86b8
CB
386 (license (license:non-copyleft "file://LICENSE"
387 "See LICENSE in the distribution."))
7598b678 388 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
a268f085 389
669b7b83 390(define-public lbzip2
7bb7bb5c
TGR
391 ;; The last 2.5 release is 4 years behind the newest commit (from 2018) and
392 ;; may create files that can't even be decompressed by newer bzip2 versions.
393 (let ((commit "b6dc48a7b9bfe6b340ed1f6d72133608ad57144b")
394 (revision "0"))
395 (package
396 (name "lbzip2")
397 (version (git-version "2.5" revision commit))
398 (source
399 (origin
400 (method git-fetch)
401 (uri (git-reference
402 (url "https://github.com/kjn/lbzip2")
403 (commit commit)))
404 (sha256
405 (base32 "140xp00dmjsr6c3dwb4dwf0pzlgf159igri321inbinsjiclkngy"))
406 (file-name (git-file-name name version))))
407 (build-system gnu-build-system)
408 (arguments
409 `(#:phases
410 (modify-phases %standard-phases
411 (add-after 'unpack 'unpack-gnulib
412 (lambda* (#:key inputs #:allow-other-keys)
413 (let ((gnulib (assoc-ref inputs "gnulib")))
414 (copy-recursively gnulib "lib")
415 (setenv "PATH" (string-append "lib:" (getenv "PATH")))
416 #t)))
417 (delete 'bootstrap) ; gnulib still has unpatched shebangs
418 (add-after 'patch-source-shebangs 'bootstrap
419 (lambda _
420 (invoke "sh" "build-aux/autogen.sh")
421 #t)))))
422 (native-inputs
423 `(("autoconf" ,autoconf)
424 ("automake" ,automake)
425 ("gnulib"
426 ,(let ((commit "2d431ac35c4943a3655c07ba91870d2323321b43"))
427 (origin
428 (method git-fetch)
429 (uri (git-reference
430 (url "git://git.savannah.gnu.org/gnulib.git")
431 (commit commit)))
432 (sha256
433 (base32 "1f0xr4w89bqvhzsfcflcagdixidrk41k00k7kpr91w9lazfis4kf"))
434 (file-name (git-file-name "gnulib" commit)))))
435 ("perl" ,perl)))
436 (synopsis "Parallel bzip2 compression utility")
437 (description
438 "lbzip2 is a multi-threaded compression utility with support for the
669b7b83
RW
439bzip2 compressed file format. lbzip2 can process standard bz2 files in
440parallel. It uses POSIX threading model (pthreads), which allows it to take
441full advantage of symmetric multiprocessing (SMP) systems. It has been proven
442to scale linearly, even to over one hundred processor cores. lbzip2 is fully
443compatible with bzip2 – both at file format and command line level.")
7bb7bb5c
TGR
444 ;; lbzip2.org now looks fishy. There is no source code to be found.
445 ;; Reported upstream: <https://github.com/kjn/lbzip2/issues/26>.
446 (home-page "https://github.com/kjn/lbzip2")
447 (license license:gpl3+))))
669b7b83 448
5d47eab0
EF
449(define-public pbzip2
450 (package
451 (name "pbzip2")
bf867709 452 (version "1.1.13")
5d47eab0
EF
453 (source (origin
454 (method url-fetch)
21b2ec4d
EF
455 (uri (string-append "https://launchpad.net/pbzip2/"
456 (version-major+minor version) "/" version
457 "/+download/" name "-" version ".tar.gz"))
5d47eab0
EF
458 (sha256
459 (base32
bf867709 460 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
5d47eab0
EF
461 (build-system gnu-build-system)
462 (inputs
b3546174 463 `(("bzip2" ,bzip2)))
5d47eab0 464 (arguments
bf867709 465 `(#:tests? #f ; no tests
5d47eab0 466 #:phases (modify-phases %standard-phases
bf867709 467 (delete 'configure)) ; no configure script
21b2ec4d 468 #:make-flags (list (string-append "PREFIX=" %output))))
1ac624cd
BH
469 (home-page (string-append "https://web.archive.org/web/20180412020219/"
470 "http://compression.ca/pbzip2/"))
5d47eab0
EF
471 (synopsis "Parallel bzip2 implementation")
472 (description
473 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
474compressor that uses pthreads and achieves near-linear speedup on SMP machines.
21b2ec4d 475The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
5d47eab0
EF
476compressed with pbzip2 can be decompressed with bzip2).")
477 (license (license:non-copyleft "file://COPYING"
21b2ec4d 478 "See COPYING in the distribution."))))
5d47eab0 479
a268f085
LC
480(define-public xz
481 (package
482 (name "xz")
957aac76 483 (version "5.2.4")
a268f085 484 (source (origin
87f5d366 485 (method url-fetch)
52d76b64
LC
486 (uri (list (string-append "http://tukaani.org/xz/xz-" version
487 ".tar.gz")
488 (string-append "http://multiprecision.org/guix/xz-"
489 version ".tar.gz")))
a268f085
LC
490 (sha256
491 (base32
957aac76 492 "0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
a268f085 493 (build-system gnu-build-system)
5b2da2a6
MB
494 (arguments
495 `(#:phases
496 (modify-phases %standard-phases
497 (add-after 'install 'move-static-lib
498 (lambda* (#:key outputs #:allow-other-keys)
499 (let ((out (assoc-ref outputs "out"))
500 (static (assoc-ref outputs "static")))
501 (mkdir-p (string-append static "/lib"))
502 (rename-file (string-append out "/lib/liblzma.a")
503 (string-append static "/lib/liblzma.a"))
504 ;; Remove reference to the static library from the .la file
505 ;; so Libtool does the right thing when both the shared and
506 ;; static library is available.
507 (substitute* (string-append out "/lib/liblzma.la")
508 (("^old_library='liblzma.a'") "old_library=''"))
509 #t))))))
510 (outputs '("out" "static"))
35b9e423 511 (synopsis "General-purpose data compression")
a268f085
LC
512 (description
513 "XZ Utils is free general-purpose data compression software with high
514compression ratio. XZ Utils were written for POSIX-like systems, but also
515work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
516
517The core of the XZ Utils compression code is based on LZMA SDK, but it has
518been modified quite a lot to be suitable for XZ Utils. The primary
519compression algorithm is currently LZMA2, which is used inside the .xz
520container format. With typical files, XZ Utils create 30 % smaller output
521than gzip and 15 % smaller output than bzip2.")
38bbd61d 522 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
58891850 523 (home-page "https://tukaani.org/xz/")))
c6eac761 524
0dcea35d
KK
525(define-public lhasa
526 (package
527 (name "lhasa")
528 (version "0.3.1")
529 (source (origin
530 (method url-fetch)
531 (uri (string-append
532 "https://github.com/fragglet/lhasa/releases/download/v"
533 version "/lhasa-" version ".tar.gz"))
534 (sha256
535 (base32
536 "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z"))))
537 (build-system gnu-build-system)
538 (arguments
539 '(#:phases
540 (modify-phases %standard-phases
541 (add-before 'check 'set-up-test-environment
542 (lambda* (#:key inputs #:allow-other-keys)
543 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
544 "/share/zoneinfo"))
545 #t)))))
546 (native-inputs
5a8ef3c1 547 `(("tzdata" ,tzdata-for-tests)))
0dcea35d
KK
548 (home-page "https://fragglet.github.com/lhasa/")
549 (synopsis "LHA archive decompressor")
550 (description "Lhasa is a replacement for the Unix LHA tool, for
551decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
552tool is a library, so that it can be reused for other purposes. Lhasa aims to
553be compatible with as many types of lzh/lzs archives as possible. It also aims
554to generate the same output as the (non-free) Unix LHA tool, so that it will
555act as a free drop-in replacement.")
556 (license license:isc)))
557
c6eac761
LC
558(define-public lzo
559 (package
560 (name "lzo")
7276eca4 561 (version "2.10")
c6eac761
LC
562 (source
563 (origin
564 (method url-fetch)
565 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
566 version ".tar.gz"))
567 (sha256
568 (base32
7276eca4 569 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
c6eac761 570 (build-system gnu-build-system)
165fd9d5 571 (arguments '(#:configure-flags '("--enable-shared")))
c6eac761
LC
572 (home-page "http://www.oberhumer.com/opensource/lzo")
573 (synopsis
e881752c 574 "Data compression library suitable for real-time data de-/compression")
c6eac761
LC
575 (description
576 "LZO is a data compression library which is suitable for data
577de-/compression in real-time. This means it favours speed over
578compression ratio.
579
580LZO is written in ANSI C. Both the source code and the compressed data
581format are designed to be portable across platforms.")
4a44e743 582 (license license:gpl2+)))
0f323dad 583
a9f48ff0
EB
584(define-public lzop
585 (package
586 (name "lzop")
89d159fe 587 (version "1.04")
a9f48ff0
EB
588 (source
589 (origin
590 (method url-fetch)
591 (uri (string-append "http://www.lzop.org/download/lzop-"
592 version ".tar.gz"))
593 (sha256
594 (base32
89d159fe 595 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
a9f48ff0
EB
596 (build-system gnu-build-system)
597 (inputs `(("lzo" ,lzo)))
6f465a51 598 (home-page "https://www.lzop.org/")
a9f48ff0
EB
599 (synopsis "Compress or expand files")
600 (description
601 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
602LZO data compression library for compression services, and its main advantages
603over gzip are much higher compression and decompression speed (at the cost of
604some compression ratio).")
605 (license license:gpl2+)))
606
0f323dad
LC
607(define-public lzip
608 (package
609 (name "lzip")
43d9ed77 610 (version "1.21")
0f323dad
LC
611 (source (origin
612 (method url-fetch)
613 (uri (string-append "mirror://savannah/lzip/lzip-"
614 version ".tar.gz"))
615 (sha256
616 (base32
43d9ed77 617 "12qdcw5k1cx77brv9yxi1h4dzwibhfmdpigrj43nfk8nscwm12z4"))))
0f323dad 618 (build-system gnu-build-system)
340978d7 619 (home-page "https://www.nongnu.org/lzip/lzip.html")
0f323dad
LC
620 (synopsis "Lossless data compressor based on the LZMA algorithm")
621 (description
622 "Lzip is a lossless data compressor with a user interface similar to the
623one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
0963e3e4 624more than bzip2, which makes it well-suited for software distribution and data
0f323dad
LC
625archiving. Lzip is a clean implementation of the LZMA algorithm.")
626 (license license:gpl3+)))
b357faac 627
9d9fc399
TGR
628(define-public lziprecover
629 (package
630 (name "lziprecover")
0eacdd46 631 (version "1.22")
9d9fc399
TGR
632 (source (origin
633 (method url-fetch)
f6145bb6
TGR
634 (uri (string-append "mirror://savannah/lzip/lziprecover/"
635 "lziprecover-" version ".tar.gz"))
9d9fc399
TGR
636 (sha256
637 (base32
0eacdd46 638 "0qh8dnhr5rly2k9dnx43qqynqwqzi5kfb15pyd29qwppfl4qm5gx"))))
9d9fc399 639 (build-system gnu-build-system)
340978d7 640 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
9d9fc399
TGR
641 (synopsis "Recover and decompress data from damaged lzip files")
642 (description
643 "Lziprecover is a data recovery tool and decompressor for files in the lzip
644compressed data format (.lz). It can test the integrity of lzip files, extract
645data from damaged ones, and repair most files with small errors (up to one
646single-byte error per member) entirely.
647
648Lziprecover is not a replacement for regular backups, but a last line of defence
649when even the backups are corrupt. It can recover files by merging the good
650parts of two or more damaged copies, such as can be easily produced by running
651@command{ddrescue} on a failing device.
652
653This package also includes @command{unzcrash}, a tool to test the robustness of
654decompressors when faced with corrupted input.")
655 (license (list license:bsd-2 ; arg_parser.{cc,h}
656 license:gpl2+)))) ; everything else
657
b357faac
AE
658(define-public sharutils
659 (package
660 (name "sharutils")
9a59ce24 661 (version "4.15.2")
b357faac
AE
662 (source
663 (origin
664 (method url-fetch)
665 (uri (string-append "mirror://gnu/sharutils/sharutils-"
666 version ".tar.xz"))
d0ee11b2 667 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
b357faac
AE
668 (sha256
669 (base32
b50d58b3 670 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
211db9ca
EF
671 (modules '((guix build utils)))
672 (snippet
673 '(begin
674 (substitute* (find-files "lib" "\\.c$")
675 (("#if defined _IO_ftrylockfile")
676 "#if defined _IO_EOF_SEEN"))
677 (substitute* "lib/stdio-impl.h"
678 (("^/\\* BSD stdio derived implementations")
679 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
680 "# define _IO_IN_BACKUP 0x100\n"
681 "#endif\n\n"
682 "/* BSD stdio derived implementations")))
683 #t))))
b357faac
AE
684 (build-system gnu-build-system)
685 (inputs
686 `(("which" ,which)))
687 (arguments
688 `(#:phases
dc1d3cde
KK
689 (modify-phases %standard-phases
690 (add-after 'patch-source-shebangs 'unpatch-source-shebang
691 ;; revert the patch-shebang phase on a script which is
692 ;; in fact test data
693 (lambda _
694 (substitute* "tests/shar-1.ok"
695 (((which "sh")) "/bin/sh"))
696 #t)))))
6fd52309 697 (home-page "https://www.gnu.org/software/sharutils/")
b357faac
AE
698 (synopsis "Archives in shell scripts, uuencode/uudecode")
699 (description
79c311b8
LC
700 "GNU sharutils is a package for creating and manipulating shell
701archives that can be readily emailed. A shell archive is a file that can be
e881752c 702processed by a Bourne-type shell to unpack the original collection of files.
79c311b8 703This package is mostly for compatibility and historical interest.")
b357faac 704 (license license:gpl3+)))
28469ab0 705
646898b3
RW
706(define-public sfarklib
707 (package
708 (name "sfarklib")
979f9e8a 709 (version "2.24")
646898b3 710 (source (origin
d40362f4
EF
711 (method git-fetch)
712 (uri (git-reference
b0e7b699 713 (url "https://github.com/raboof/sfArkLib")
d40362f4
EF
714 (commit version)))
715 (file-name (git-file-name name version))
646898b3
RW
716 (sha256
717 (base32
d40362f4 718 "0jrxy24gak7q5ml06p5jjgzk9i5r2mkfjk4ycirkp4kg7k5a237w"))))
646898b3
RW
719 (build-system gnu-build-system)
720 (arguments
721 `(#:tests? #f ;no "check" target
722 #:phases
723 (modify-phases %standard-phases
724 (replace 'configure
725 (lambda* (#:key outputs #:allow-other-keys)
726 (substitute* "Makefile"
727 (("/usr/local") (assoc-ref outputs "out")))
728 #t)))))
729 (inputs
730 `(("zlib" ,zlib)))
731 (home-page "https://github.com/raboof/sfArkLib")
732 (synopsis "Library for SoundFont decompression")
733 (description
734 "SfArkLib is a C++ library for decompressing SoundFont files compressed
735with the sfArk algorithm.")
736 (license license:gpl3+)))
737
b5ad1659 738(define-public sfarkxtc
3fa31317
RW
739 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
740 (revision "1"))
741 (package
742 (name "sfarkxtc")
743 (version (git-version "0" revision commit))
744 (source (origin
745 ;; There are no release tarballs, so we just fetch the latest
746 ;; commit at this time.
747 (method git-fetch)
748 (uri (git-reference
b0e7b699 749 (url "https://github.com/raboof/sfarkxtc")
3fa31317
RW
750 (commit commit)))
751 (file-name (git-file-name name version))
752 (sha256
753 (base32
754 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
755 (build-system gnu-build-system)
756 (arguments
757 `(#:tests? #f ;no "check" target
758 #:phases
759 (modify-phases %standard-phases
760 (replace 'configure
761 (lambda* (#:key outputs #:allow-other-keys)
762 (substitute* "Makefile"
763 (("/usr/local") (assoc-ref outputs "out")))
764 #t)))))
765 (inputs
766 `(("zlib" ,zlib)
767 ("sfarklib" ,sfarklib)))
768 (home-page "https://github.com/raboof/sfarkxtc")
769 (synopsis "Basic sfArk decompressor")
770 (description "SfArk extractor converts SoundFonts in the compressed legacy
b5ad1659 771sfArk file format to the uncompressed sf2 format.")
3fa31317 772 (license license:gpl3+))))
b5ad1659 773
27f76fe6
TUBK
774(define-public libmspack
775 (package
776 (name "libmspack")
27b2f34c 777 (home-page "https://cabextract.org.uk/libmspack/")
511930c2 778 (version "0.10.1")
27f76fe6
TUBK
779 (source
780 (origin
781 (method url-fetch)
27b2f34c 782 (uri (string-append home-page name "-" version "alpha.tar.gz"))
27f76fe6 783 (sha256
511930c2 784 (base32 "13janaqsvm7aqc4agjgd4819pbgqv50j88bh5kci1z70wvg65j5s"))))
27f76fe6 785 (build-system gnu-build-system)
03c16bb5
MB
786 (arguments
787 `(#:configure-flags '("--disable-static")))
27f76fe6
TUBK
788 (synopsis "Compression tools for some formats used by Microsoft")
789 (description
790 "The purpose of libmspack is to provide both compression and
791decompression of some loosely related file formats used by Microsoft.")
792 (license license:lgpl2.1+)))
73f542c3 793
82aa2a28
LF
794(define-public lz4
795 (package
796 (name "lz4")
c4227f7b 797 (version "1.9.3")
82aa2a28
LF
798 (source
799 (origin
b38cfa1d
MB
800 (method git-fetch)
801 (uri (git-reference (url "https://github.com/lz4/lz4")
802 (commit (string-append "v" version))))
82aa2a28 803 (sha256
c4227f7b 804 (base32 "1w02kazh1fps3sji2sn89fz862j1199c5ajrqcgl1bnlxj09kcbz"))
b38cfa1d 805 (file-name (git-file-name name version))))
82aa2a28 806 (build-system gnu-build-system)
2e8a9db6 807 (outputs (list "out" "static"))
9205f451
MB
808 (native-inputs
809 `(;; For tests.
810 ("python" ,python)
811 ("valgrind" ,valgrind)))
82aa2a28 812 (arguments
78bbf6c4
LLB
813 `(;; Not designed for parallel testing.
814 ;; See https://github.com/lz4/lz4/issues/957#issuecomment-737419821
815 #:parallel-tests? #f
816 #:test-target "test"
2b6ecdf4 817 #:make-flags (list (string-append "CC=" ,(cc-for-target))
0dd6d21a 818 (string-append "prefix=" (assoc-ref %outputs "out")))
2e8a9db6
TGR
819 #:phases
820 (modify-phases %standard-phases
821 (delete 'configure) ; no configure script
822 (add-before 'check 'disable-broken-test
823 (lambda _
824 (substitute* "tests/Makefile"
825 ;; This fails when $prefix is not a single top-level directory.
826 (("^test: (.*) test-install" _ targets)
827 (string-append "test: " targets)))
828 #t))
829 (add-after 'install 'move-static-library
830 (lambda* (#:key outputs #:allow-other-keys)
831 (let ((out (assoc-ref outputs "out"))
832 (static (assoc-ref outputs "static")))
833 (mkdir-p (string-append static "/lib"))
834 (rename-file (string-append out "/lib/liblz4.a")
835 (string-append static "/lib/liblz4.a"))
836 #t))))))
fd174342 837 (home-page "https://www.lz4.org")
82aa2a28
LF
838 (synopsis "Compression algorithm focused on speed")
839 (description "LZ4 is a lossless compression algorithm, providing
840compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
841extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
842A high compression derivative, called LZ4_HC, is also provided. It trades CPU
843time for compression ratio.")
b7585ca3 844 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
82aa2a28
LF
845 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
846 (license (list license:bsd-2 license:gpl2+))))
dd8d6d65
SB
847
848(define-public squashfs-tools
849 (package
850 (name "squashfs-tools")
957fe1c2 851 (version "4.4")
dd8d6d65
SB
852 (source (origin
853 (method url-fetch)
de67e922
LF
854 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
855 "squashfs" version "/"
dd8d6d65
SB
856 "squashfs" version ".tar.gz"))
857 (sha256
858 (base32
957fe1c2 859 "0zmhvczscqz0mzh4b9m8m42asq14db0a6lc8clp5ljq5ybrv70d9"))))
dd8d6d65
SB
860 (build-system gnu-build-system)
861 (arguments
c0040f0e 862 `(#:tests? #f ; no check target
dd8d6d65 863 #:make-flags
c0040f0e 864 (list (string-append "CC=" ,(cc-for-target))
dd8d6d65
SB
865 "XZ_SUPPORT=1"
866 "LZO_SUPPORT=1"
867 "LZ4_SUPPORT=1"
868 (string-append "INSTALL_DIR=" %output "/bin"))
869 #:phases
870 (modify-phases %standard-phases
871 (replace 'configure
f793b4ef
EF
872 (lambda _
873 (chdir "squashfs-tools")
f793b4ef 874 #t)))))
dd8d6d65
SB
875 (inputs
876 `(("lz4" ,lz4)
877 ("lzo" ,lzo)
878 ("xz" ,xz)
879 ("zlib" ,zlib)))
c5bb55a8 880 (home-page "https://github.com/plougher/squashfs-tools")
8f65585b 881 (synopsis "Tools to create and extract squashfs file systems")
dd8d6d65 882 (description
8f65585b 883 "Squashfs is a highly compressed read-only file system for Linux. It uses
dd8d6d65
SB
884zlib to compress files, inodes, and directories. All blocks are packed to
885minimize the data overhead, and block sizes of between 4K and 1M are supported.
886It is intended to be used for archival use, for live CDs, and for embedded
887systems where low overhead is needed. This package allows you to create and
8f65585b 888extract such file systems.")
dd8d6d65 889 (license license:gpl2+)))
820dc3f5
JM
890
891(define-public pigz
892 (package
893 (name "pigz")
69f75ce1 894 (version "2.6")
820dc3f5
JM
895 (source (origin
896 (method url-fetch)
897 (uri (string-append "http://zlib.net/pigz/"
898 name "-" version ".tar.gz"))
899 (sha256
900 (base32
69f75ce1 901 "0z9avc4mifwcpj3qdsf9m2rjw9jx03b2r9pj0c4xgla9fh6ppv9f"))))
820dc3f5
JM
902 (build-system gnu-build-system)
903 (arguments
904 `(#:phases
905 (modify-phases %standard-phases
906 (delete 'configure)
907 (replace 'install
908 (lambda* (#:key outputs #:allow-other-keys)
909 (let* ((out (assoc-ref outputs "out"))
910 (bin (string-append out "/bin"))
911 (man (string-append out "/share/man/man1")))
912 (install-file "pigz" bin)
913 (symlink "pigz" (string-append bin "/unpigz"))
914 (install-file "pigz.1" man)
915 #t))))
9b9bc1b0
TGR
916 #:make-flags
917 (list ,(string-append "CC=" (cc-for-target)))
820dc3f5
JM
918 #:test-target "tests"))
919 (inputs `(("zlib" ,zlib)))
7f1773ea 920 (home-page "https://zlib.net/pigz/")
820dc3f5
JM
921 (synopsis "Parallel implementation of gzip")
922 (description
923 "This package provides a parallel implementation of gzip that exploits
924multiple processors and multiple cores when compressing data.")
925
926 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
927 ;; written by Mark Adler, are under another non-copyleft license.
928 (license license:asl2.0)))
23f3cbb8
BW
929
930(define-public pixz
931 (package
932 (name "pixz")
468c8f64 933 (version "1.0.7")
23f3cbb8
BW
934 (source (origin
935 (method url-fetch)
936 (uri (string-append
937 "https://github.com/vasi/pixz/releases/download/v" version
938 "/pixz-" version ".tar.xz"))
939 (sha256
940 (base32
468c8f64 941 "1ifxr18f2h75gkcrkx8033kwmwmrcgxshpaawyc2n4dzn1p2rqz5"))))
23f3cbb8
BW
942 (build-system gnu-build-system)
943 (native-inputs
944 `(("pkg-config" ,pkg-config)
945 ("libarchive" ,libarchive)))
946 (home-page "https://github.com/vasi/pixz")
947 (synopsis "Parallel indexing implementation of LZMA")
948 (description
949 "The existing XZ Utils provide great compression in the .xz file format,
950but they produce just one big block of compressed data. Pixz instead produces
951a collection of smaller blocks which makes random access to the original data
952possible and can compress in parallel. This is especially useful for large
953tarballs.")
954 (license license:bsd-2)))
69d9792a 955
3fd4b90d
DM
956(define-public cabextract
957 (package
958 (name "cabextract")
27b2f34c 959 (home-page "https://cabextract.org.uk/")
bde093c2 960 (version "1.9.1")
3fd4b90d
DM
961 (source (origin
962 (method url-fetch)
393b55d5 963 (uri (string-append home-page "cabextract-" version ".tar.gz"))
3fd4b90d
DM
964 (sha256
965 (base32
bde093c2 966 "19qwhl2r8ip95q4vxzxg2kp4p125hjmc9762sns1dwwf7ikm7hmg"))
92526ade
MB
967 (modules '((guix build utils)))
968 (snippet
969 '(begin
970 ;; Delete bundled libmspack.
971 (delete-file-recursively "mspack")
972 #t))))
3fd4b90d 973 (build-system gnu-build-system)
b3175c70
KK
974 (arguments
975 '(#:configure-flags '("--with-external-libmspack")
976 #:phases
977 (modify-phases %standard-phases
978 ;; cabextract needs some of libmspack's header files.
979 ;; These are located in the "mspack" directory of libmspack.
980 (add-before 'build 'unpack-libmspack
981 (lambda* (#:key inputs #:allow-other-keys)
982 (let ((dir-name "libmspack-src"))
983 (mkdir dir-name)
984 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
985 "-C" dir-name "--strip-components" "1")
986 (rename-file (string-append dir-name "/mspack")
987 "mspack")
988 (delete-file-recursively dir-name)
989 #t))))))
3fd4b90d
DM
990 (native-inputs
991 `(("pkg-config" ,pkg-config)))
992 (inputs
b3175c70
KK
993 `(("libmspack" ,libmspack)
994 ("libmspack-source" ,(package-source libmspack))))
3fd4b90d
DM
995 (synopsis "Tool to unpack Cabinet archives")
996 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
997 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
998 (license license:gpl3+)))
0b073506 999
9d5ed931
LLB
1000(define-public libjcat
1001 (package
1002 (name "libjcat")
26688b8d 1003 (version "0.1.6")
9d5ed931
LLB
1004 (source
1005 (origin
1006 (method git-fetch)
1007 (uri
1008 (git-reference
1009 (url "https://github.com/hughsie/libjcat")
1010 (commit version)))
1011 (file-name (git-file-name name version))
1012 (sha256
26688b8d 1013 (base32 "1a2z34m8611xvna9kwch8ralxx7c9mk4rm9vrxx7p9hr8sbqbsaz"))))
9d5ed931
LLB
1014 (build-system meson-build-system)
1015 (native-inputs
1016 `(("gobject-introspection" ,gobject-introspection)
1017 ("help2man" ,help2man)
1018 ("pkg-config" ,pkg-config)))
1019 (inputs
1020 `(("git" ,git)
1021 ("glib" ,glib)
1022 ("gnupg" ,gnupg)
1023 ("gnutls" ,gnutls)
1024 ("gpgme" ,gpgme)
1025 ("json-glib" ,json-glib)
1026 ("vala" ,vala)))
1027 (home-page "https://github.com/hughsie/libjcat")
1028 (synopsis "Library for reading and writing Jcat files")
1029 (description
1030 "This library allows reading and writing gzip-compressed JSON catalog
1031files, which can be used to store GPG, PKCS-7 and SHA-256 checksums for each
1032file.")
1033 (license license:lgpl2.1+)))
1034
0b073506
TGR
1035(define-public xdelta
1036 (package
1037 (name "xdelta")
1038 (version "3.1.0")
1039 (source
1040 (origin
0633c77b
RW
1041 (method git-fetch)
1042 (uri (git-reference
b0e7b699 1043 (url "https://github.com/jmacd/xdelta")
0633c77b
RW
1044 (commit (string-append "v" version))))
1045 (file-name (git-file-name name version))
0b073506
TGR
1046 (sha256
1047 (base32
0633c77b 1048 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
0b073506
TGR
1049 (snippet
1050 ;; This file isn't freely distributable and has no effect on building.
6cbee49d
MW
1051 '(begin
1052 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1053 #t))))
0b073506
TGR
1054 (build-system gnu-build-system)
1055 (native-inputs
1056 `(("autoconf" ,autoconf)
1057 ("automake" ,automake)))
1058 (arguments
1059 `(#:phases
1060 (modify-phases %standard-phases
1061 (add-after 'unpack 'enter-build-directory
e5ff963a 1062 (lambda _ (chdir "xdelta3") #t)))))
69b7fa3e 1063 (home-page "http://xdelta.org")
0b073506
TGR
1064 (synopsis "Delta encoder for binary files")
1065 (description "xdelta encodes only the differences between two binary files
1066using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1067also be used to apply such patches. xdelta is similar to @command{diff} and
1068@command{patch}, but is not limited to plain text and does not generate
1069human-readable output.")
1070 (license license:asl2.0)))
389eb3fa
TGR
1071
1072(define-public lrzip
1073 (package
1074 (name "lrzip")
2e6d40b3 1075 (version "0.641")
389eb3fa
TGR
1076 (source
1077 (origin
1078 (method url-fetch)
1079 (uri (string-append
51697aab 1080 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.xz"))
389eb3fa 1081 (sha256
2e6d40b3 1082 (base32 "0ziyanspd96dc3lp2qdcylc7aq8dhb511jhqrhxvlp502fjqjqrc"))))
389eb3fa
TGR
1083 (build-system gnu-build-system)
1084 (native-inputs
1085 `(;; nasm is only required when building for 32-bit x86 platforms
1086 ,@(if (string-prefix? "i686" (or (%current-target-system)
1087 (%current-system)))
1088 `(("nasm" ,nasm))
1089 '())
1090 ("perl" ,perl)))
1091 (inputs
1092 `(("bzip2" ,bzip2)
51697aab 1093 ("lz4" ,lz4)
389eb3fa
TGR
1094 ("lzo" ,lzo)
1095 ("zlib" ,zlib)))
1096 (home-page "http://ck.kolivas.org/apps/lrzip/")
1097 (synopsis "Large file compressor with a very high compression ratio")
1098 (description "lrzip is a compression utility that uses long-range
1099redundancy reduction to improve the subsequent compression ratio of
1100larger files. It can then further compress the result with the ZPAQ or
1101LZMA algorithms for maximum compression, or LZO for maximum speed. This
1102choice between size or speed allows for either better compression than
1103even LZMA can provide, or a higher speed than gzip while compressing as
1104well as bzip2.")
1105 (license (list license:gpl3+
1106 license:public-domain)))) ; most files in lzma/
e4c2136d
DC
1107
1108(define-public snappy
1109 (package
1110 (name "snappy")
a5407c76 1111 (version "1.1.8")
16de7f15
TGR
1112 (source
1113 (origin
898ac8e7
EF
1114 (method git-fetch)
1115 (uri (git-reference
b0e7b699 1116 (url "https://github.com/google/snappy")
898ac8e7
EF
1117 (commit version)))
1118 (file-name (git-file-name name version))
16de7f15 1119 (sha256
a5407c76 1120 (base32 "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv"))
16de7f15 1121 (patches (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"))))
5a437357
MB
1122 (build-system cmake-build-system)
1123 (arguments
1124 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
e4c2136d
DC
1125 (home-page "https://github.com/google/snappy")
1126 (synopsis "Fast compressor/decompressor")
5a437357 1127 (description "Snappy is a compression/decompression library. It does not
e4c2136d 1128aim for maximum compression, or compatibility with any other compression library;
5a437357 1129instead, it aims for very high speeds and reasonable compression. For instance,
e4c2136d
DC
1130compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1131for most inputs, but the resulting compressed files are anywhere from 20% to
1132100% bigger.")
1133 (license license:asl2.0)))
adbd7faf
KK
1134
1135(define-public p7zip
1136 (package
1137 (name "p7zip")
1138 (version "16.02")
1139 (source (origin
1140 (method url-fetch)
1141 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1142 version "/" name "_" version
1143 "_src_all.tar.bz2"))
1144 (sha256
1145 (base32
1146 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1147 (modules '((guix build utils)))
1148 (snippet
1149 '(begin
1150 ;; Remove non-free source files
1151 (for-each delete-file
1152 (append
1153 (find-files "CPP/7zip/Compress" "Rar.*")
1154 (find-files "CPP/7zip/Crypto" "Rar.*")
1155 (find-files "DOC/unRarLicense.txt")
1156 (find-files "Utils/file_Codecs_Rar_so.py")))
1157 (delete-file-recursively "CPP/7zip/Archive/Rar")
1158 (delete-file-recursively "CPP/7zip/Compress/Rar")
1159 #t))
1ac675a5 1160 (patches (search-patches "p7zip-CVE-2016-9296.patch"
a630c647 1161 "p7zip-CVE-2017-17969.patch"
1ac675a5 1162 "p7zip-remove-unused-code.patch"))))
adbd7faf
KK
1163 (build-system gnu-build-system)
1164 (arguments
1165 `(#:make-flags
1166 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1167 #:phases
1168 (modify-phases %standard-phases
1169 (replace 'configure
1170 (lambda* (#:key system outputs #:allow-other-keys)
8fcdd9d5
MW
1171 (invoke "cp"
1172 (let ((system ,(or (%current-target-system)
1173 (%current-system))))
1174 (cond
1175 ((string-prefix? "x86_64" system)
1176 "makefile.linux_amd64_asm")
1177 ((string-prefix? "i686" system)
1178 "makefile.linux_x86_asm_gcc_4.X")
1179 (else
1180 "makefile.linux_any_cpu_gcc_4.X")))
1181 "makefile.machine")))
adbd7faf
KK
1182 (replace 'check
1183 (lambda _
8fcdd9d5
MW
1184 (invoke "make" "test")
1185 (invoke "make" "test_7z")
1186 (invoke "make" "test_7zr"))))))
0f4f5715 1187 (native-inputs
adbd7faf
KK
1188 (let ((system (or (%current-target-system)
1189 (%current-system))))
1190 `(,@(cond ((string-prefix? "x86_64" system)
1191 `(("yasm" ,yasm)))
1192 ((string-prefix? "i686" system)
1193 `(("nasm" ,nasm)))
1194 (else '())))))
1195 (home-page "http://p7zip.sourceforge.net/")
1196 (synopsis "Command-line file archiver with high compression ratio")
1197 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1198handles the 7z format which features very high compression ratios.")
1199 (license (list license:lgpl2.1+
1200 license:gpl2+
1201 license:public-domain))))
618089f9
MB
1202
1203(define-public gzstream
1204 (package
1205 (name "gzstream")
1206 (version "1.5")
1207 (source (origin
1208 (method url-fetch)
1209 (uri
1210 ;; No versioned URL, but last release was in 2003.
1211 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1212 (file-name (string-append name "-" version ".tgz"))
1213 (sha256
1214 (base32
1215 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1216 (modules '((guix build utils)))
1217 (snippet
1218 ;; Remove pre-compiled object.
6cbee49d
MW
1219 '(begin
1220 (delete-file "gzstream.o")
1221 #t))))
618089f9
MB
1222 (build-system gnu-build-system)
1223 (arguments
1224 `(#:test-target "test"
1225 #:phases
1226 (modify-phases %standard-phases
ee4ba542
LDB
1227 ;; Enable PIC, so it can be used in shared libraries.
1228 (add-after 'unpack 'use-pic
1229 (lambda _
1230 (substitute* "Makefile"
1231 (("CPPFLAGS = " all) (string-append all "-fPIC ")))
1232 #t))
618089f9
MB
1233 (delete 'configure)
1234 (replace 'install
1235 (lambda* (#:key outputs #:allow-other-keys)
1236 (let* ((out (assoc-ref outputs "out"))
1237 (lib (string-append out "/lib"))
1238 (include (string-append out "/include")))
1239 (install-file "libgzstream.a" lib)
1240 (install-file "gzstream.h" include)
1241 #t))))))
1242 (propagated-inputs `(("zlib" ,zlib)))
1243 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1244 (synopsis "Compressed C++ iostream")
1245 (description "gzstream is a small library for providing zlib
1246functionality in a C++ iostream.")
1247 (license license:lgpl2.1+)))
36df995c
TGR
1248
1249(define-public zpaq
1250 (package
1251 (name "zpaq")
1252 (version "7.15")
1253 (source
1254 (origin
1255 (method url-fetch/zipbomb)
1256 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1257 (string-delete #\. version) ".zip"))
1258 (sha256
1259 (base32
1260 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1261 (modules '((guix build utils)))
1262 (snippet
1263 ;; Delete irrelevant pre-compiled binaries.
6cbee49d
MW
1264 '(begin
1265 (for-each delete-file (find-files "." "\\.exe$"))
1266 #t))))
36df995c
TGR
1267 (build-system gnu-build-system)
1268 (arguments
1269 `(#:phases
1270 (modify-phases %standard-phases
1271 (delete 'configure)) ; no ‘configure’ script
1272 #:make-flags
1273 (list
1274 (string-append "CPPFLAGS=-Dunix"
1275 ,(match (or (%current-target-system)
1276 (%current-system))
1277 ("x86_64-linux" "")
1278 ("i686-linux" "")
1279 (_ " -DNOJIT")))
1280 ;; These should be safe, lowest-common-denominator instruction sets,
1281 ;; allowing for some optimisation while remaining reproducible.
effd7198 1282 (string-append "CXXFLAGS=-O3 -DNDEBUG"
36df995c
TGR
1283 ,(match (or (%current-target-system)
1284 (%current-system))
effd7198
EF
1285 ("x86_64-linux" " -march=nocona -mtune=generic")
1286 ("i686-linux" " -march=i686 -mtune=generic")
1287 ("armhf-linux" " -mtune=generic-armv7-a")
36df995c
TGR
1288 (_ "")))
1289 (string-append "PREFIX="
1290 (assoc-ref %outputs "out")))))
1291 (native-inputs
1292 `(("perl" ,perl))) ; for pod2man
1293 (home-page "http://mattmahoney.net/dc/zpaq.html")
1294 (synopsis "Incremental journaling archiver")
1295 (description "ZPAQ is a command-line archiver for realistic situations with
1296many duplicate and already compressed files. It backs up only those files
1297modified since the last update. All previous versions remain untouched and can
1298be independently recovered. Identical files are only stored once (known as
1299@dfn{de-duplication}). Archives can also be encrypted.
1300
1301ZPAQ is intended to back up user data, not entire operating systems. It ignores
1302owner and group IDs, ACLs, extended attributes, or special file types like
1303devices, sockets, or named pipes. It does not follow or restore symbolic links
1304or junctions, and always follows hard links.")
1305 (license (list license:public-domain
1306 ;; libzpaq.cpp contains a mix of public-domain and
1307 ;; expat-licenced (or ‘MIT’) code.
1308 license:expat))))
0da8313c 1309
9e6ada8f
MR
1310(define-public unshield
1311 (package
1312 (name "unshield")
6cf48e8c 1313 (version "1.4.3")
9e6ada8f 1314 (source
298180cd
EF
1315 (origin (method git-fetch)
1316 (uri (git-reference
8ed4c468 1317 (url "http://github.com/twogood/unshield")
298180cd
EF
1318 (commit version)))
1319 (file-name (git-file-name name version))
9e6ada8f
MR
1320 (sha256
1321 (base32
298180cd 1322 "19wn22vszhci8dfcixx5rliz7phx3lv5ablvhjlclvj75k2vsdqd"))))
9e6ada8f
MR
1323 (build-system cmake-build-system)
1324 (inputs
1325 `(("zlib" ,zlib)
1326 ("openssl" ,openssl)
6cf48e8c 1327 ;; Test data that is otherwise downloaded with curl.
9e6ada8f
MR
1328 ("unshield-avigomanager11b22.zip"
1329 ,(origin
1330 (method url-fetch)
6cf48e8c
TGR
1331 (uri (string-append
1332 "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1333 "unshield-avigomanager11b22.zip?dl=1"))
9e6ada8f
MR
1334 (sha256
1335 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1336 (file-name "unshield-avigomanager11b22.zip")))
6cf48e8c
TGR
1337 ("unshield-baldurs_gate_patch_v1_1_4315_international.zip"
1338 ,(origin
1339 (method url-fetch)
1340 (uri (string-append
1341 "https://www.dropbox.com/s/9ruil8oi6amjbbk/"
1342 "unshield-baldurs_gate_patch_v1_1_4315_international.zip?dl=1"))
1343 (sha256
1344 (base32 "0spaxf6dardlhqxz3ys09fzamj007q3nfyw4xng6gh3qp9780maj"))
1345 (file-name "unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
9e6ada8f
MR
1346 ("unshield-the-feeble-files-spanish.zip"
1347 ,(origin
1348 (method url-fetch)
6cf48e8c
TGR
1349 (uri (string-append
1350 "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1351 "unshield-the-feeble-files-spanish.zip?dl=1"))
9e6ada8f
MR
1352 (sha256
1353 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1354 (file-name "unshield-the-feeble-files-spanish.zip")))))
1355 (native-inputs
1356 `(("unzip" ,unzip)))
1357 (arguments
1358 `(#:out-of-source? #f
1359 #:phases
1360 (modify-phases %standard-phases
1361 (add-before 'check 'pre-check
1362 (lambda* (#:key inputs #:allow-other-keys)
1363 (for-each (lambda (i)
1364 (copy-file (assoc-ref inputs i)
1365 (string-append "test/v0/" i)))
1366 '("unshield-avigomanager11b22.zip"
6cf48e8c 1367 "unshield-baldurs_gate_patch_v1_1_4315_international.zip"
9e6ada8f
MR
1368 "unshield-the-feeble-files-spanish.zip"))
1369 (substitute* (find-files "test/" "/*\\.sh")
1370 ;; Tests expect the unshield binary in a specific
1371 ;; location.
1372 (("/var/tmp/unshield/bin/unshield")
1373 (string-append (getcwd) "/src/unshield"))
1374 ;; We no longer need to download the data.
1375 ((".?URL=.*$") "")
1376 (("curl -(|f)sSL -o test.zip .*") ""))
1377 (substitute* "test/v0/avigomanager.sh"
1378 (("test.zip")
1379 (string-append (getcwd)
6cf48e8c
TGR
1380 "/test/v0/unshield-avigomanager11b22.zip")))
1381 (substitute* "test/v0/baldurs_gate_patch_v1_1_4315_international.sh"
1382 (("test.zip")
1383 (string-append
1384 (getcwd)
1385 "/test/v0/unshield-baldurs_gate_patch_v1_1_4315_international.zip")))
9e6ada8f
MR
1386 (substitute* "test/v0/the-feeble-files-spanish.sh"
1387 (("test.zip")
1388 (string-append (getcwd)
1389 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1390 #t))
1391 (replace 'check
1392 (lambda _
df04bd25 1393 (invoke "./run-tests.sh"))))))
9e6ada8f
MR
1394 (home-page "https://github.com/twogood/unshield")
1395 (synopsis "Extract CAB files from InstallShield installers")
1396 (description
1397 "@command{unshield} is a tool and library for extracting @file{.cab}
1398 archives from InstallShield installers.")
1399 (license license:expat)))
1400
f6ac3101
TGR
1401(define-public zstd
1402 (package
1403 (name "zstd")
ca0576d6 1404 (version "1.4.4")
3880537c
TGR
1405 (source
1406 (origin
1407 (method url-fetch)
1408 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1409 "v" version "/zstd-" version ".tar.gz"))
1410 (sha256
ca0576d6 1411 (base32 "05ckxap00qvc0j51d3ci38150cxsw82w7s9zgd5fgzspnzmp1vsr"))))
9feef62b 1412 (replacement zstd/fixed)
f6ac3101 1413 (build-system gnu-build-system)
ca0576d6
MB
1414 (outputs '("out" ;1.2MiB executables and documentation
1415 "lib" ;1.2MiB shared library and headers
1416 "static")) ;1.2MiB static library
f6ac3101
TGR
1417 (arguments
1418 `(#:phases
1419 (modify-phases %standard-phases
ec0de9d8
MB
1420 (delete 'configure) ;no configure script
1421 (add-after 'install 'adjust-library-locations
1422 (lambda* (#:key outputs #:allow-other-keys)
1423 (let* ((out (assoc-ref outputs "out"))
1424 (lib (assoc-ref outputs "lib"))
1425 (static (assoc-ref outputs "static"))
1426 (shared-libs (string-append lib "/lib"))
1427 (static-libs (string-append static "/lib")))
1428 ;; Move the static library to its own output to save ~1MiB.
1429 (mkdir-p static-libs)
1430 (for-each (lambda (ar)
1431 (link ar (string-append static-libs "/"
1432 (basename ar)))
1433 (delete-file ar))
1434 (find-files shared-libs "\\.a$"))
1435
ca0576d6 1436 ;; Make sure the pkg-config file refers to the right output.
ec0de9d8 1437 (substitute* (string-append shared-libs "/pkgconfig/libzstd.pc")
ca0576d6
MB
1438 (("^prefix=.*")
1439 (string-append "prefix=" lib "\n")))
ec0de9d8
MB
1440
1441 #t))))
f6ac3101 1442 #:make-flags
9f58c83c
EF
1443 ;; TODO: Integrate in next rebuild cycle.
1444 (list ,(if (%current-target-system)
1445 (string-append "CC=" (cc-for-target))
1446 "CC=gcc")
f45e314e 1447 (string-append "PREFIX=" (assoc-ref %outputs "out"))
ec0de9d8
MB
1448 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib")
1449 (string-append "INCLUDEDIR=" (assoc-ref %outputs "lib") "/include")
f45e314e
TGR
1450 ;; Skip auto-detection of, and creating a dependency on, the build
1451 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1452 "HAVE_LZMA=0"
1453 ;; Not currently detected, but be explicit & avoid surprises later.
1454 "HAVE_LZ4=0"
e8073063 1455 "HAVE_ZLIB=0")))
2f325b63 1456 (home-page "https://facebook.github.io/zstd/")
f6ac3101
TGR
1457 (synopsis "Zstandard real-time compression algorithm")
1458 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1459that combines very fast operation with a compression ratio comparable to that of
1460zlib. In most scenarios, both compression and decompression can be performed in
1461‘real time’. The compressor can be configured to provide the most suitable
1462trade-off between compression ratio and speed, without affecting decompression
1463speed.")
1464 (license (list license:bsd-3 ; the main top-level LICENSE file
16123d1d 1465 license:bsd-2 ; many files explicitly state 2-Clause
5a719dee 1466 license:gpl2 ; the main top-level COPYING file
16123d1d
TGR
1467 license:gpl3+ ; tests/gzip/*.sh
1468 license:expat ; lib/dictBuilder/divsufsort.[ch]
f6ac3101
TGR
1469 license:public-domain ; zlibWrapper/examples/fitblk*
1470 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
0f03c531 1471
9feef62b 1472(define zstd/fixed
6f873731
LLB
1473 (package
1474 (inherit zstd)
6f873731
LLB
1475 (source
1476 (origin
9feef62b
LLB
1477 (inherit (package-source zstd))
1478 (patches
1479 (search-patches
1480 ;; From Ubuntu focal-security
1481 "zstd-CVE-2021-24031_CVE-2021-24032.patch"))))))
6f873731 1482
0f03c531 1483(define-public pzstd
b26f9586 1484 (package/inherit zstd
0f03c531 1485 (name "pzstd")
b26f9586 1486 (outputs '("out"))
455daf46
EF
1487 (inputs
1488 `(,@(if (%current-target-system)
1489 `(("googletest" ,googletest))
1490 '())))
0f03c531 1491 (native-inputs
455daf46
EF
1492 `(,@(if (%current-system)
1493 `(("googletest" ,googletest))
1494 '())))
0f03c531
TGR
1495 (arguments
1496 `(#:phases
1497 (modify-phases %standard-phases
1498 (add-after 'unpack 'enter-subdirectory
9f6f726c 1499 (lambda _ (chdir "contrib/pzstd") #t))
0f03c531
TGR
1500 (delete 'configure) ; no configure script
1501 (add-before 'check 'compile-tests
1502 (lambda* (#:key make-flags #:allow-other-keys)
745e83ca 1503 (apply invoke "make" "tests" make-flags)))
0f03c531
TGR
1504 (add-after 'install 'install-documentation
1505 (lambda* (#:key outputs #:allow-other-keys)
1506 (let* ((out (assoc-ref outputs "out"))
1507 (doc (string-append out "/share/doc/" ,name)))
1508 (mkdir-p doc)
1509 (install-file "README.md" doc)
1510 #t))))
1511 #:make-flags
455daf46
EF
1512 (list (string-append "CC=" ,(cc-for-target))
1513 (string-append "CXX=" ,(cxx-for-target))
0f03c531
TGR
1514 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1515 (home-page (package-home-page zstd))
1516 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1517 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1518multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1519compression algorithm}. It is fully compatible with the original Zstandard file
1520format and command-line interface, and can be used as a drop-in replacement.
1521
1522Compression is distributed over multiple processor cores to improve performance,
1523as is the decompression of data compressed in this manner. Data compressed by
1524other implementations will only be decompressed by two threads: one performing
1525the actual decompression, the other input and output.")
1526 (license (package-license zstd))))
148585c2
AI
1527
1528(define-public zip
1529 (package
1530 (name "zip")
1531 (version "3.0")
1532 (source
1533 (origin
1534 (method url-fetch)
1535 (uri (string-append "mirror://sourceforge/infozip"
1536 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1537 (sha256
1538 (base32
1539 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1540 (build-system gnu-build-system)
1541 (inputs `(("bzip2" ,bzip2)))
1542 (arguments
1543 `(#:tests? #f ; no test target
1544 #:make-flags (let ((out (assoc-ref %outputs "out")))
1545 (list "-f" "unix/Makefile"
1546 (string-append "prefix=" out)
1547 (string-append "MANDIR=" out "/share/man/man1")))
148585c2
AI
1548 #:phases
1549 (modify-phases %standard-phases
1550 (replace 'build
1551 (lambda* (#:key (make-flags '()) #:allow-other-keys)
b0559d24 1552 (apply invoke "make" "generic_gcc" make-flags)))
148585c2
AI
1553 (delete 'configure))))
1554 (home-page "http://www.info-zip.org/Zip.html")
1555 (synopsis "Compression and file packing utility")
1556 (description
1557 "Zip is a compression and file packaging/archive utility. Zip is useful
1558for packaging a set of files for distribution, for archiving files, and for
1559saving disk space by temporarily compressing unused files or directories.
1560Zip puts one or more compressed files into a single ZIP archive, along with
1561information about the files (name, path, date, time of last modification,
1562protection, and check information to verify file integrity). An entire
1563directory structure can be packed into a ZIP archive with a single command.
1564
1565Zip has one compression method (deflation) and can also store files without
1566compression. Zip automatically chooses the better of the two for each file.
1567Compression ratios of 2:1 to 3:1 are common for text files.")
1568 (license (license:non-copyleft "file://LICENSE"
1569 "See LICENSE in the distribution."))))
1570
1571(define-public unzip
1572 (package (inherit zip)
1573 (name "unzip")
1574 (version "6.0")
1575 (source
1576 (origin
1577 (method url-fetch)
1578 (uri (string-append "mirror://sourceforge/infozip"
1579 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1580 (sha256
1581 (base32
1582 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1583 (patches (search-patches "unzip-CVE-2014-8139.patch"
1584 "unzip-CVE-2014-8140.patch"
1585 "unzip-CVE-2014-8141.patch"
1586 "unzip-CVE-2014-9636.patch"
1587 "unzip-CVE-2015-7696.patch"
1588 "unzip-CVE-2015-7697.patch"
1589 "unzip-allow-greater-hostver-values.patch"
1590 "unzip-initialize-symlink-flag.patch"
1591 "unzip-remove-build-date.patch"
1592 "unzip-attribs-overflow.patch"
1593 "unzip-overflow-on-invalid-input.patch"
1594 "unzip-format-secure.patch"
1595 "unzip-overflow-long-fsize.patch"))))
31d289a4 1596 (replacement unzip/fixed)
148585c2
AI
1597 (build-system gnu-build-system)
1598 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1599 (arguments
1600 `(#:phases (modify-phases %standard-phases
1601 (delete 'configure)
190376a1
MW
1602 (add-after 'unpack 'fortify
1603 (lambda _
1604 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1605 ;; This environment variable is recommended in 'unix/Makefile'
1606 ;; for passing flags to the C compiler.
1607 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1608 #t))
148585c2
AI
1609 (replace 'build
1610 (lambda* (#:key make-flags #:allow-other-keys)
fa76696b
MW
1611 (apply invoke "make"
1612 `("-j" ,(number->string
1613 (parallel-job-count))
1614 ,@make-flags
1615 "generic_gcc")))))
148585c2
AI
1616 #:make-flags (list "-f" "unix/Makefile"
1617 (string-append "prefix=" %output)
1618 (string-append "MANDIR=" %output "/share/man/man1"))))
1619 (home-page "http://www.info-zip.org/UnZip.html")
1620 (synopsis "Decompression and file extraction utility")
1621 (description
1622 "UnZip is an extraction utility for archives compressed in .zip format,
1623also called \"zipfiles\".
1624
1625UnZip lists, tests, or extracts files from a .zip archive. The default
1626behaviour (with no options) is to extract into the current directory, and
1627subdirectories below it, all files from the specified zipfile. UnZip
1628recreates the stored directory structure by default.")
1629 (license (license:non-copyleft "file://LICENSE"
1630 "See LICENSE in the distribution."))))
1631
cddf0b89 1632(define unzip/fixed
31d289a4
LLB
1633 (package
1634 (inherit unzip)
1635 (version "6.0")
1636 (source
1637 (origin
1638 (method url-fetch)
1639 (uri (string-append "mirror://sourceforge/infozip"
1640 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1641 (sha256
1642 (base32
1643 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1644 (patches (search-patches "unzip-CVE-2014-8139.patch"
1645 "unzip-CVE-2014-8140.patch"
1646 "unzip-CVE-2014-8141.patch"
1647 "unzip-CVE-2014-9636.patch"
1648 "unzip-CVE-2015-7696.patch"
1649 "unzip-CVE-2015-7697.patch"
1650 "unzip-allow-greater-hostver-values.patch"
1651 "unzip-initialize-symlink-flag.patch"
1652 "unzip-remove-build-date.patch"
1653 "unzip-attribs-overflow.patch"
1654 "unzip-overflow-on-invalid-input.patch"
1655 "unzip-format-secure.patch"
1656 "unzip-overflow-long-fsize.patch"
1657
1658 ;; From Fedora
1659 "unzip-alt-iconv-utf8.patch"
1660 "unzip-alt-iconv-utf8-print.patch"
1661 "unzip-fix-recmatch.patch"
699a56e3 1662 "unzip-case-insensitive.patch"
31d289a4
LLB
1663 "unzip-close.patch"
1664 "unzip-COVSCAN-fix-unterminated-string.patch"
1665 "unzip-CVE-2016-9844.patch"
1666 "unzip-CVE-2018-1000035.patch"
1667 "unzip-CVE-2018-18384.patch"
1668 "unzip-exec-shield.patch"
1669 "unzip-manpage-fix.patch"
1670 "unzip-overflow.patch"
1671 "unzip-timestamp.patch"
1672 "unzip-valgrind.patch"
1673 "unzip-x-option.patch"
1674 ;; CVE-2019-13232
1675 "unzip-zipbomb-manpage.patch"
1676 "unzip-zipbomb-part1.patch"
1677 "unzip-zipbomb-part2.patch"
70384392
LLB
1678 "unzip-zipbomb-part3.patch"
1679
1680 ;; https://github.com/madler/unzip/issues/2
1681 "unzip-32bit-zipbomb-fix.patch"))))))
31d289a4 1682
65c110e2
TGR
1683(define-public ziptime
1684 (let ((commit "2a5bc9dfbf7c6a80e5f7cb4dd05b4036741478bc")
1685 (revision "0"))
1686 (package
1687 (name "ziptime")
1688 (version (git-version "0.0.0" revision commit))
1689 (source
1690 (origin
1691 (method git-fetch)
1692 (uri (git-reference
1693 (url "https://android.googlesource.com/platform/build")
1694 (commit commit)))
1695 (file-name (git-file-name name version))
1696 (sha256
1697 (base32 "0hrn61b3a97dlc4iqc28rwx8k8zf7ycbwzqqp93vj34zy5a541kn"))))
1698 (build-system gnu-build-system)
1699 (arguments
1700 `(#:tests? #f ; no test suite
1701 #:phases
1702 (modify-phases %standard-phases
1703 (add-after 'unpack 'change-directory
1704 (lambda _
1705 (chdir "tools/ziptime")))
1706 (delete 'configure) ; nothing to configure
1707 (replace 'build
1708 ;; There is no Makefile, only an ‘Android.bp’ file. Ignore it.
1709 (lambda _
1710 (let ((c++ ,(cxx-for-target)))
1711 (apply invoke c++ "-O2" "-o" "ziptime"
1712 (find-files "." "\\.cpp$")))))
1713 (replace 'install
1714 (lambda* (#:key outputs #:allow-other-keys)
1715 (let* ((out (assoc-ref outputs "out"))
1716 (bin (string-append out "/bin"))
1717 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1718 (install-file "ziptime" bin)
1719 (install-file "README.txt" doc)))))))
1720 ;; There is no separate home page for this tiny bundled build tool.
1721 (home-page (string-append "https://android.googlesource.com/platform/build/"
1722 "+/master/tools/ziptime/README.txt"))
1723 (synopsis "Normalize @file{.zip} archive header timestamps")
1724 (description
1725 "Ziptime helps make @file{.zip} archives reproducible by replacing
1726timestamps in the file header with a fixed time (1 January 2008).
1727
1728``Extra fields'' are not changed, so you'll need to use the @code{-X} option to
1729@command{zip} to prevent it from storing the ``universal time'' field.")
1730 (license license:asl2.0))))
1731
148585c2
AI
1732(define-public zziplib
1733 (package
1734 (name "zziplib")
3f986ff6
MB
1735 (version "0.13.69")
1736 (home-page "https://github.com/gdraheim/zziplib")
d0a52e65
MB
1737 (source (origin
1738 (method git-fetch)
1739 (uri (git-reference (url home-page)
1740 (commit (string-append "v" version))))
1741 (file-name (git-file-name name version))
e6bd8b5e 1742 (patches (search-patches "zziplib-CVE-2018-16548.patch"))
d0a52e65
MB
1743 (sha256
1744 (base32
1745 "0fbk9k7ryas2wh2ykwkvm1pbi40i88rfvc3dydh9xyd7w2jcki92"))))
f7fdafef 1746 (replacement zziplib/fixed)
148585c2 1747 (build-system gnu-build-system)
d0a52e65
MB
1748 (arguments
1749 `(#:phases (modify-phases %standard-phases
1750 (add-before 'check 'make-files-writable
1751 (lambda _
1752 (for-each make-file-writable
1753 (find-files "test" #:directories? #t))
b0dc2454
MB
1754 #t)))
1755
1756 ;; XXX: The default test target attempts to download external resources and
1757 ;; fails without error: <https://github.com/gdraheim/zziplib/issues/53>.
1758 ;; To prevent confusing log messages, just run a simple zip test that works.
1759 #:test-target "check-readme"))
148585c2
AI
1760 (inputs
1761 `(("zlib" ,zlib)))
1762 (native-inputs `(("perl" ,perl) ; for the documentation
1763 ("pkg-config" ,pkg-config)
1764 ;; for the documentation; Python 3 not supported,
1765 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1766 ("python" ,python-2)
1767 ("zip" ,zip))) ; to create test files
148585c2
AI
1768 (synopsis "Library for accessing zip files")
1769 (description
1770 "ZZipLib is a library based on zlib for accessing zip files.")
0d729c5b
MB
1771 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1772 ;; files carry the Zlib license; see "docs/copying.html" for details.
1773 (license (list license:lgpl2.0+ license:mpl1.1))))
148585c2 1774
f7fdafef
LLB
1775(define-public zziplib/fixed
1776 (package
1777 (inherit zziplib)
1778 (name "zziplib")
1779 (version "0.13.72")
1780 (home-page "https://github.com/gdraheim/zziplib")
1781 (source (origin
1782 (method git-fetch)
1783 (uri (git-reference (url home-page)
1784 (commit (string-append "v" version))))
1785 (file-name (git-file-name name version))
1786 (sha256
1787 (base32
1788 "0i6bpa2b13z19alm6ig80364dnin1w28cvif18k6wkkb0w3dzp8y"))))
9098745b
EF
1789 (arguments
1790 `(#:phases
1791 (modify-phases %standard-phases
1792 (add-after 'install 'install-compatibility-symlinks
1793 (lambda* (#:key outputs #:allow-other-keys)
1794 (with-directory-excursion
1795 (string-append (assoc-ref outputs "out") "/lib")
1796 (map (lambda (lib new-symlink)
1797 (symlink lib new-symlink))
1798 (list "libzzip.so.13" "libzzipfseeko.so.13"
1799 "libzzipmmapped.so.13" "libzzipwrap.so.13")
1800 (list "libzzip-0.so.13" "libzzipfseeko-0.so.13"
1801 "libzzipmmapped-0.so.13" "libzzipwrap-0.so.13")))
1802 #t)))))
f7fdafef
LLB
1803 (native-inputs
1804 `(("python" ,python)
1805 ,@(alist-delete "python"
1806 (package-native-inputs zziplib))))
1807 (build-system cmake-build-system)))
1808
06de4aaf
TF
1809(define-public libzip
1810 (package
1811 (name "libzip")
7e6df0e9 1812 (version "1.7.3")
06de4aaf
TF
1813 (source (origin
1814 (method url-fetch)
1815 (uri (string-append
66fea0c4 1816 "https://libzip.org/download/libzip-" version ".tar.xz"))
06de4aaf
TF
1817 (sha256
1818 (base32
7e6df0e9 1819 "0ck1dk7zn5qzpgxklg0r26nfsf04xb6c46gsig060hkvvgzp6156"))))
06de4aaf
TF
1820 (native-inputs
1821 `(("perl" ,perl)))
1822 (inputs
a9b15d4c 1823 `(("gnutls" ,gnutls)
dcc3f215 1824 ("liblzma" ,xz)
a9b15d4c
BH
1825 ("openssl" ,openssl)
1826 ("zlib" ,zlib)))
80486319 1827 (build-system cmake-build-system)
8d6c7456 1828 (home-page "https://libzip.org")
06de4aaf
TF
1829 (synopsis "C library for reading, creating, and modifying zip archives")
1830 (description "Libzip is a C library for reading, creating, and modifying
1831zip archives. Files can be added from data buffers, files, or compressed data
1832copied directly from other zip archives. Changes made without closing the
1833archive can be reverted.")
1834 (license license:bsd-3)))
ef5c40aa
SR
1835
1836(define-public atool
1837 (package
1838 (name "atool")
1839 (version "0.39.0")
1840 (source
1841 (origin
1842 (method url-fetch)
97ac5b70 1843 (uri (string-append "mirror://savannah/atool/atool-"
ef5c40aa
SR
1844 version ".tar.gz"))
1845 (sha256
1846 (base32
1847 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1848 (build-system gnu-build-system)
1849 (arguments
1850 `(#:phases
1851 (modify-phases %standard-phases
1852 (add-after 'unpack 'embed-absolute-file-name
1853 (lambda* (#:key inputs #:allow-other-keys)
1854 (substitute* "atool"
1855 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1856 (string-append pre "'" (assoc-ref inputs "file")
1857 "/bin/file'")))
1858 #t)))))
1859 (inputs
1860 `(("perl" ,perl)
1861 ("file" ,file)))
340978d7 1862 (home-page "https://www.nongnu.org/atool/")
ef5c40aa
SR
1863 (synopsis "Universal tool to manage file archives of various types")
1864 (description "The main command is @command{aunpack} which extracts files
1865from an archive. The other commands provided are @command{apack} (to create
1866archives), @command{als} (to list files in archives), and @command{acat} (to
1867extract files to standard out). As @command{atool} invokes external programs
1868to handle the archives, not all commands may be supported for a certain type
1869of archives.")
1870 (license license:gpl2+)))
b44ecca6 1871
34e8cf22
TGR
1872(define-public lunzip
1873 (package
1874 (name "lunzip")
4bf11e25 1875 (version "1.12")
34e8cf22
TGR
1876 (source
1877 (origin
1878 (method url-fetch)
a28cd477
TGR
1879 (uri (string-append "mirror://savannah/lzip/lunzip/"
1880 "lunzip-" version ".tar.gz"))
34e8cf22 1881 (sha256
4bf11e25 1882 (base32 "1liaynyy3qcs29hfk1pnb7i9r1mnmpw557j5v356qsv6qnm4lnz5"))))
34e8cf22
TGR
1883 (build-system gnu-build-system)
1884 (arguments
1885 `(#:configure-flags
cb3ca320 1886 (list ,(string-append "CC=" (cc-for-target)))))
340978d7 1887 (home-page "https://www.nongnu.org/lzip/lunzip.html")
34e8cf22
TGR
1888 (synopsis "Small, stand-alone lzip decompressor")
1889 (description
1890 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1891written as a single small C tool with no dependencies. This makes it
1892well-suited to embedded and other systems without a C++ compiler, or for use in
1893applications such as software installers that need only to decompress files,
1894not compress them.
1895Lunzip is intended to be fully compatible with the regular lzip package.")
1896 (license (list license:bsd-2 ; carg_parser.[ch]
1897 license:gpl2+)))) ; everything else
5dca4c76
TGR
1898
1899(define-public clzip
1900 (package
1901 (name "clzip")
afeb2e27 1902 (version "1.12")
5dca4c76
TGR
1903 (source
1904 (origin
1905 (method url-fetch)
39e5d3b6
TGR
1906 (uri (string-append "mirror://savannah/lzip/clzip/"
1907 "clzip-" version ".tar.gz"))
5dca4c76 1908 (sha256
afeb2e27 1909 (base32 "1s7yidqvmxi61hh569h5aci816l6qkffjgx0zx57qyyq0qq2pjgw"))))
5dca4c76
TGR
1910 (build-system gnu-build-system)
1911 (arguments
1912 `(#:configure-flags
cb056c40 1913 (list ,(string-append "CC=" (cc-for-target)))))
340978d7 1914 (home-page "https://www.nongnu.org/lzip/clzip.html")
5dca4c76
TGR
1915 (synopsis "Small, stand-alone lzip compressor and decompressor")
1916 (description
1917 "Clzip is a compressor and decompressor for files in the lzip compression
1918format (.lz), written as a single small C tool with no dependencies. This makes
1919it well-suited to embedded and other systems without a C++ compiler, or for use
1920in other applications like package managers.
1921Clzip is intended to be fully compatible with the regular lzip package.")
1922 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
1923 license:gpl2+))))
2e3b1a92
TGR
1924
1925(define-public lzlib
1926 (package
1927 (name "lzlib")
57b0949a 1928 (version "1.12")
2e3b1a92
TGR
1929 (source
1930 (origin
1931 (method url-fetch)
76b2f084
TGR
1932 (uri (string-append "mirror://savannah/lzip/lzlib/"
1933 "lzlib-" version ".tar.gz"))
2e3b1a92 1934 (sha256
57b0949a 1935 (base32 "1c9pwd6by8is4z8bs6j306jyy6pgm2dvsn4fr7fg2b5m5qj88pcf"))))
2e3b1a92 1936 (build-system gnu-build-system)
2e3b1a92
TGR
1937 (arguments
1938 `(#:configure-flags
31dcc272 1939 (list (string-append "CC=" ,(cc-for-target))
6c519722 1940 "--disable-static"
2e3b1a92 1941 "--enable-shared"))) ; only static (.a) is built by default
340978d7 1942 (home-page "https://www.nongnu.org/lzip/lzlib.html")
2e3b1a92
TGR
1943 (synopsis "Lzip data compression C library")
1944 (description
1945 "Lzlib is a C library for in-memory LZMA compression and decompression in
1946the lzip format. It supports integrity checking of the decompressed data, and
1947all functions are thread-safe. The library should never crash, even in case of
1948corrupted input.")
1949 (license (list license:bsd-2 ; the library itself
1950 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
8c4ca853
TGR
1951
1952(define-public plzip
1953 (package
1954 (name "plzip")
341b2d3d 1955 (version "1.9")
8c4ca853
TGR
1956 (source
1957 (origin
1958 (method url-fetch)
894669a7
TGR
1959 (uri (string-append "mirror://savannah/lzip/plzip/"
1960 "plzip-" version ".tar.gz"))
8c4ca853 1961 (sha256
341b2d3d 1962 (base32 "19zinpx7hssl6r3vilpvq2s7wha3545xan8b0vcvsxnyipdx3n0l"))))
8c4ca853
TGR
1963 (build-system gnu-build-system)
1964 (inputs
1965 `(("lzlib" ,lzlib)))
340978d7 1966 (home-page "https://www.nongnu.org/lzip/plzip.html")
8c4ca853
TGR
1967 (synopsis "Parallel lossless data compressor for the lzip format")
1968 (description
1969 "Plzip is a massively parallel (multi-threaded) lossless data compressor
1970and decompressor that uses the lzip file format (.lz). Files produced by plzip
1971are fully compatible with lzip and can be rescued with lziprecover.
1972On multiprocessor machines, plzip can compress and decompress large files much
1973faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
19742%). The number of usable threads is limited by file size: on files of only a
1975few MiB, plzip is no faster than lzip.
1976Files that were compressed with regular lzip will also not be decompressed
1977faster by plzip, unless the @code{-b} option was used: lzip usually produces
1978single-member files which can't be decompressed in parallel.")
1979 (license (list license:bsd-2 ; arg_parser.{cc,h}
1980 license:gpl2+)))) ; everything else
e294c05e
RH
1981
1982(define-public innoextract
1983 (package
1984 (name "innoextract")
73996c02 1985 (version "1.9")
e294c05e
RH
1986 (source
1987 (origin
1988 (method url-fetch)
73996c02
TGR
1989 (uri (string-append "https://constexpr.org/innoextract/files/"
1990 "innoextract-" version "/"
ff983864 1991 "/innoextract-" version ".tar.gz"))
e294c05e 1992 (sha256
73996c02 1993 (base32 "09l1z1nbl6ijqqwszdwch9mqr54qb7df0wp2sd77v17dq6gsci33"))))
e294c05e
RH
1994 (build-system cmake-build-system)
1995 (arguments
73996c02 1996 `(#:tests? #f))
4cb9b726 1997 (inputs `(("boost" ,boost)
e294c05e
RH
1998 ("libiconv" ,libiconv)
1999 ("xz" ,xz)))
2000 (native-inputs `(("pkg-config" ,pkg-config)))
2001 (home-page "https://constexpr.org/innoextract/")
2002 (synopsis "Tool for extracting Inno Setup installers")
2003 (description "innoextract allows extracting Inno Setup installers under
2004non-Windows systems without running the actual installer using wine.")
2005 (license license:zlib)))
2ed0ef2f
LF
2006
2007(define-public google-brotli
2008 (package
2009 (name "google-brotli")
6b7c4833 2010 (version "1.0.9")
fc82c175
TGR
2011 (source
2012 (origin
2013 (method git-fetch)
2014 (uri (git-reference
b0e7b699 2015 (url "https://github.com/google/brotli")
fc82c175
TGR
2016 (commit (string-append "v" version))))
2017 (file-name (git-file-name name version))
2018 (sha256
6b7c4833
EF
2019 (base32 "1fikasxf7r2dwlk8mv8w7nmjkn0jw5ic31ky3mvpkdzwgd4xfndl"))
2020 (modules '((guix build utils)))
2021 (snippet
2022 '(begin
2023 ;; Cherry-picked from upstream since the latest release
2024 ;; https://github.com/google/brotli/commit/09b0992b6acb7faa6fd3b23f9bc036ea117230fc
2025 (substitute* (find-files "scripts" "^lib.*pc\\.in")
2026 (("-R\\$\\{libdir\\} ") ""))
2027 #t))))
2ed0ef2f
LF
2028 (build-system cmake-build-system)
2029 (arguments
2030 `(#:phases
2031 (modify-phases %standard-phases
2032 (add-after 'install 'rename-static-libraries
2033 ;; The build tools put a 'static' suffix on the static libraries, but
2034 ;; other applications don't know how to find these.
2035 (lambda* (#:key outputs #:allow-other-keys)
2036 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
2037 (rename-file (string-append lib "libbrotlicommon-static.a")
2038 (string-append lib "libbrotlicommon.a"))
2039 (rename-file (string-append lib "libbrotlidec-static.a")
2040 (string-append lib "libbrotlidec.a"))
2041 (rename-file (string-append lib "libbrotlienc-static.a")
2042 (string-append lib "libbrotlienc.a"))
2043 #t))))
2044 #:configure-flags
2045 (list ;; Defaults to "lib64" on 64-bit archs.
2046 (string-append "-DCMAKE_INSTALL_LIBDIR="
2047 (assoc-ref %outputs "out") "/lib"))))
2048 (home-page "https://github.com/google/brotli")
2049 (synopsis "General-purpose lossless compression")
2050 (description "This package provides the reference implementation of Brotli,
2051a generic-purpose lossless compression algorithm that compresses data using a
2052combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
2053order context modeling, with a compression ratio comparable to the best
2054currently available general-purpose compression methods. It is similar in speed
2055with @code{deflate} but offers more dense compression.
2056
2057The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
2058 (license license:expat)))
71987177 2059
83ac7cb4
LDB
2060(define-public brotli
2061 ;; We used to provide an older version under the name "brotli".
2062 (deprecated-package "brotli" google-brotli))
2063
d2b237d0
AI
2064(define-public python-google-brotli
2065 (package
2066 (inherit google-brotli)
2067 (name "python-google-brotli")
2068 (build-system python-build-system)
2069 (arguments '())
2070 (synopsis "Python interface to google-brotli")
2071 (description "@code{python-google-brotli} provides a Python interface to
2072@code{google-brotli}, an implementation of the Brotli lossless compression
2073algorithm.")))
2074
71987177
PN
2075(define-public ucl
2076 (package
2077 (name "ucl")
2078 (version "1.03")
2079 (source (origin
2080 (method url-fetch)
01c8b90b 2081 (uri (string-append "https://www.oberhumer.com/opensource/"
71987177
PN
2082 name "/download/" name "-" version ".tar.gz"))
2083 (sha256
2084 (base32
2085 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
2086 (build-system gnu-build-system)
7349f926
MB
2087 (arguments
2088 `(;; UCL 1.03 fails to build with newer C standards.
41c27444
MB
2089 #:configure-flags '("CFLAGS=-std=gnu90"
2090 "--enable-shared" "--disable-static")))
01c8b90b 2091 (home-page "https://www.oberhumer.com/opensource/ucl/")
71987177
PN
2092 (synopsis "Portable lossless data compression library")
2093 (description "UCL implements a number of compression algorithms that
2094achieve an excellent compression ratio while allowing fast decompression.
2095Decompression requires no additional memory.
2096
2097Compared to LZO, the UCL algorithms achieve a better compression ratio but
2098decompression is a little bit slower.")
2099 (license license:gpl2+)))
5735256d
PN
2100
2101(define-public upx
2102 (package
2103 (name "upx")
f5255ed3 2104 (version "3.96")
5735256d
PN
2105 (source (origin
2106 (method url-fetch)
2107 (uri (string-append "https://github.com/upx/upx/releases/download/v"
de5bc83c 2108 version "/upx-" version "-src.tar.xz"))
5735256d
PN
2109 (sha256
2110 (base32
53dd99bc
LLB
2111 "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7"))
2112 (patches (search-patches "upx-CVE-2021-20285.patch"))))
5735256d 2113 (build-system gnu-build-system)
d8963031
MB
2114 (native-inputs
2115 `(("perl" ,perl)))
2116 (inputs
2117 `(("ucl" ,ucl)
2118 ("zlib" ,zlib)))
5735256d
PN
2119 (arguments
2120 `(#:make-flags
f5255ed3 2121 (list "all")
5735256d
PN
2122 #:phases
2123 (modify-phases %standard-phases
7046106e
TGR
2124 (delete 'configure) ; no configure script
2125 (delete 'check) ; no test suite
5735256d
PN
2126 (add-before 'build 'patch-exec-bin-sh
2127 (lambda _
7046106e
TGR
2128 (substitute* (list "Makefile"
2129 "src/Makefile")
5735256d
PN
2130 (("/bin/sh") (which "sh")))
2131 #t))
7046106e 2132 (replace 'install
5735256d
PN
2133 (lambda* (#:key outputs #:allow-other-keys)
2134 (let* ((out (assoc-ref outputs "out"))
7046106e 2135 (bin (string-append out "/bin")))
5735256d
PN
2136 (mkdir-p bin)
2137 (copy-file "src/upx.out" (string-append bin "/upx")))
7046106e 2138 #t)))))
5735256d
PN
2139 (home-page "https://upx.github.io/")
2140 (synopsis "Compression tool for executables")
2141 (description
2142 "The Ultimate Packer for eXecutables (UPX) is an executable file
2143compressor. UPX typically reduces the file size of programs and shared
2144libraries by around 50%--70%, thus reducing disk space, network load times,
2145download times, and other distribution and storage costs.")
2146 (license license:gpl2+)))
09debcf5
NG
2147
2148(define-public quazip
2149 (package
2150 (name "quazip")
d84ddbb9 2151 (version "0.9.1")
09debcf5
NG
2152 (source (origin
2153 (method git-fetch)
2154 (uri (git-reference
b0e7b699 2155 (url "https://github.com/stachenov/quazip")
09debcf5
NG
2156 (commit (string-append "v" version))))
2157 (file-name (git-file-name name version))
2158 (sha256
2159 (base32
d84ddbb9 2160 "11icgwv2xyxhd1hm1add51xv54zwkcqkg85d1xqlgiigvbm196iq"))))
09debcf5
NG
2161 (build-system cmake-build-system)
2162 (arguments
2163 `(#:tests? #f)) ;no test
2164 (native-inputs
2165 `(("doxygen" ,doxygen)))
2166 (inputs
2167 `(("qtbase" ,qtbase)
2168 ("zlib" ,zlib)))
2169 (home-page "https://stachenov.github.io/quazip/index.html")
2170 (synopsis "Qt/C++ wrapper for Minizip")
2171 (description "QuaZIP is a simple C++ wrapper over Gilles Vollant's
2172ZIP/UNZIP package that can be used to access ZIP archives. It uses
2173Trolltech's Qt toolkit.
2174
2175QuaZIP allows you to access files inside ZIP archives using QIODevice
2176API, and that means that you can also use QTextStream, QDataStream or
2177whatever you would like to use on your zipped files.
2178
2179QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both
2180reading from and writing to ZIP archives. ")
2181 ;; Project is distributed under LGPL, but "quazip/z*" "quazip/unzip.*" are
2182 ;; distributed under zlib terms.
2183 (license (list license:lgpl2.1+ license:zlib))))
f5111b4d
TGR
2184
2185(define-public zutils
2186 (package
2187 (name "zutils")
8818bb3a 2188 (version "1.10")
f5111b4d
TGR
2189 (source
2190 (origin
2191 (method url-fetch)
2192 (uri (string-append "mirror://savannah/zutils/zutils-" version ".tar.lz"))
2193 (sha256
8818bb3a 2194 (base32 "15dimqp8zlqaaa2l46r22srp1py38mlmn69ph1j5fmrd54w43m0d"))))
f5111b4d
TGR
2195 (build-system gnu-build-system)
2196 (arguments
2197 `(#:configure-flags
2198 (list "--sysconfdir=/etc")
2199 #:phases
2200 (modify-phases %standard-phases
1de23e55 2201 (add-before 'check 'disable-failing-tests
2f650473 2202 ;; XXX https://lists.nongnu.org/archive/html/zutils-bug/2020-07/msg00005.html
1de23e55
TGR
2203 (lambda _
2204 (substitute* "testsuite/check.sh"
2205 (("\"\\$\\{ZGREP\\}\" -N -L \"GNU\"") "true")
2206 (("\"\\$\\{ZGREP\\}\" -N -L \"nx_pattern\"") "false"))
2207 #t))
f5111b4d
TGR
2208 (replace 'install
2209 (lambda* (#:key make-flags outputs #:allow-other-keys)
2210 (apply invoke "make" "install"
2211 (string-append "sysconfdir=" (assoc-ref outputs "out")
2212 "/etc")
2213 make-flags))))))
2214 (native-inputs
2215 ;; Needed to extract the source tarball and run the test suite.
2216 `(("lzip" ,lzip)))
f5111b4d
TGR
2217 (home-page "https://www.nongnu.org/zutils/zutils.html")
2218 (synopsis "Utilities that transparently operate on compressed files")
2219 (description
2220 "Zutils is a collection of utilities able to process any combination of
2221compressed and uncompressed files transparently. If any given file, including
2222standard input, is compressed, its decompressed content is used instead.
2223
2224@command{zcat}, @command{zcmp}, @command{zdiff}, and @command{zgrep} are
2225improved replacements for the shell scripts provided by GNU gzip.
2226@command{ztest} tests the integrity of supported compressed files.
2227@command{zupdate} recompresses files with lzip, similar to gzip's
2228@command{znew}.
2229
2230Supported compression formats are bzip2, gzip, lzip, and xz. Zutils uses
2231external compressors: the compressor to be used for each format is configurable
2232at run time, and must be installed separately.")
2233 (license (list license:bsd-2 ; arg_parser.{cc,h}
2234 license:gpl2+)))) ; the rest
8ff5c735
PN
2235
2236(define-public makeself-safeextract
2237 (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683"))
2238 (package
2239 (name "makeself-safeextract")
2240 (version (git-version "0.0.0" "1" commit))
2241 (home-page "https://github.com/ssokolow/makeself_safeextract")
2242 (source
2243 (origin
2244 (method git-fetch)
2245 (uri (git-reference
2246 (url home-page)
2247 (commit commit)))
2248 (file-name (git-file-name name version))
2249 (sha256
2250 (base32
2251 "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c"))))
2252 (build-system trivial-build-system)
2253 (inputs
2254 `(("python" ,python-2)
2255 ("p7zip" ,p7zip)
2256 ("unzip" ,unzip)))
2257 (arguments
2258 `(#:modules ((guix build utils))
2259 #:builder
2260 (begin
2261 (use-modules (guix build utils))
2262 (let* ((name "makeself_safeextract")
2263 (source (string-append (assoc-ref %build-inputs "source")
2264 "/" name ".py"))
2265 (bin (string-append (assoc-ref %outputs "out") "/bin"))
2266 (target (string-append bin "/" name))
2267 (python (string-append (assoc-ref %build-inputs "python") "/bin"))
2268 (7z (string-append (assoc-ref %build-inputs "p7zip") "/bin/7z"))
2269 (unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip")))
2270 (setenv "PATH" (string-append (getenv "PATH") ":" python))
2271 (mkdir-p bin)
2272 (copy-file source target)
2273 (substitute* target
2274 (("'7z'") (format #f "'~a'" 7z))
2275 (("'unzip'") (format #f "'~a'" unzip)))
2276 (patch-shebang target)))))
2277 (synopsis "Extract makeself and mojo archives without running untrusted code")
2278 (description "This package provides a script to unpack self-extracting
2279archives generated by @command{makeself} or @command{mojo} without running the
2280possibly untrusted extraction shell script.")
2281 (license license:gpl3+))))
9720104c
JN
2282
2283(define-public ncompress
2284 (package
2285 (name "ncompress")
f38eabe9 2286 (version "4.2.4.6")
9720104c
JN
2287 (source (origin
2288 (method git-fetch)
2289 (uri (git-reference
2290 (url "https://github.com/vapier/ncompress")
2291 (commit (string-append "v" version))))
2292 (patches (search-patches "ncompress-fix-softlinks.patch"))
2293 (file-name (string-append name "-" version ".tar.gz"))
2294 (sha256
2295 (base32
f38eabe9 2296 "1a4yir1ilafz0nzxdwigj204j4yy2zljbc501nsaqqm3dxdap8zn"))))
9720104c
JN
2297 (arguments
2298 '(#:make-flags (list "CC=gcc"
2299 (string-append "BINDIR=" %output "/bin")
2300 (string-append "MANDIR=" %output "/share/man/man1"))
2301 #:phases (modify-phases %standard-phases
2302 (delete 'configure))))
2303 (build-system gnu-build-system)
2304 (home-page "https://github.com/vapier/ncompress/")
2305 (synopsis "Original Lempel-Ziv compress/uncompress programs")
2306 (description "(N)compress provides the original compress and uncompress
2307programs that used to be the de facto UNIX standard for compressing and
2308uncompressing files. These programs implement a fast, simple Lempel-Ziv (LZW)
2309file compression algorithm.")
2310 (license license:gpl2+)))
0745e28d
RG
2311
2312(define-public xarchiver
2313 (package
2314 (name "xarchiver")
43e09b43 2315 (version "0.5.4.17")
0745e28d
RG
2316 (source
2317 (origin
2318 (method git-fetch)
2319 (uri (git-reference
b0e7b699 2320 (url "https://github.com/ib/xarchiver")
0745e28d
RG
2321 (commit version)))
2322 (file-name (git-file-name name version))
2323 (sha256
43e09b43 2324 (base32 "00adrjpxqlaccrwjf65w3vhxfswdj0as8aj263c6f9b85llypc5v"))))
0745e28d
RG
2325 (build-system glib-or-gtk-build-system)
2326 (native-inputs
2327 `(("gettext" ,gettext-minimal)
2328 ("intltool" ,intltool)
2329 ("libxslt" ,libxslt)
2330 ("pkg-config" ,pkg-config)))
2331 (inputs
ddde8a07 2332 `(("adwaita-icon-theme" ,adwaita-icon-theme) ; hard-coded theme
0745e28d
RG
2333 ("gtk+" ,gtk+)))
2334 (home-page "https://github.com/ib/xarchiver")
2335 (synopsis "Graphical front-end for archive operations")
2336 (description "Xarchiver is a front-end to various command line archiving
2337tools. It uses GTK+ tool-kit and is designed to be desktop-environment
2338independent. Supported formats are 7z, ARJ, bzip2, gzip, LHA, lzma, lzop,
2339RAR, RPM, DEB, tar, and ZIP. It cannot perform functions for archives, whose
2340archiver is not installed.")
2341 (license license:gpl2+)))
910bf1f7
LDB
2342
2343(define-public tarsplitter
2344 (package
2345 (name "tarsplitter")
2346 (version "2.2.0")
2347 (source (origin
2348 (method git-fetch)
2349 (uri (git-reference
b0e7b699 2350 (url "https://github.com/AQUAOSOTech/tarsplitter")
910bf1f7
LDB
2351 (commit (string-append "v" version))))
2352 (file-name (git-file-name name version))
2353 (sha256
2354 (base32
2355 "17qkg95r97kcrs17b0mcqswx99280ni47j5yx8xa7nl3bdhm6325"))))
2356 (build-system go-build-system)
2357 (arguments
2358 `(#:import-path "github.com/AQUAOSOTech/tarsplitter"
2359 #:install-source? #f
2360 #:phases
2361 (modify-phases %standard-phases
2362 (add-after 'install 'install-documentation
2363 (lambda* (#:key import-path outputs #:allow-other-keys)
2364 (let* ((source (string-append "src/" import-path))
2365 (out (assoc-ref outputs "out"))
2366 (doc (string-append out "/share/doc/" ,name "-" ,version)))
2367 (with-directory-excursion source
2368 (install-file "README.md" doc))
2369 #t))))))
2370 (home-page "https://github.com/AQUAOSOTech/tarsplitter")
2371 (synopsis "Multithreaded tar utility")
2372 (description
bb6d9e26 2373 "Archive huge numbers of files, or split massive tar archives into smaller
910bf1f7
LDB
2374chunks.")
2375 (license license:expat)))
9a2fcb63
RW
2376
2377(define-public c-blosc
2378 (package
2379 (name "c-blosc")
2380 (version "1.18.1")
2381 (source (origin
2382 (method git-fetch)
2383 (uri (git-reference
b0e7b699 2384 (url "https://github.com/Blosc/c-blosc")
9a2fcb63
RW
2385 (commit (string-append "v" version))))
2386 (file-name (git-file-name name version))
2387 (sha256
2388 (base32
2389 "1ywq8j70149859vvs19wgjq89d6xsvvmvm2n1dmkzpchxgrvnw70"))))
2390 (build-system cmake-build-system)
2391 (home-page "https://blosc.org")
2392 (synopsis "Blocking, shuffling and lossless compression library")
2393 (description
2394 "Blosc is a high performance compressor optimized for binary data. It has
2395been designed to transmit data to the processor cache faster than the
2396traditional, non-compressed, direct memory fetch approach via a
2397@code{memcpy()} system call. Blosc is meant not only to reduce the size of
2398large datasets on-disk or in-memory, but also to accelerate memory-bound
2399computations.")
2400 ;; Blosc itself is released under BSD-3 but it incorporates code under
2401 ;; other non-copyleft licenses.
2402 (license license:bsd-3)))
3480ceb1
KK
2403
2404(define-public ecm
2405 (package
2406 (name "ecm")
2407 (version "1.0.3")
2408 (source (origin
2409 (method git-fetch)
2410 (uri (git-reference
2411 (url "https://github.com/alucryd/ecm-tools")
2412 (commit (string-append "v" version))))
2413 (file-name (git-file-name name version))
2414 (sha256
2415 (base32
2416 "1rvyx5gcy8lfklgj80szlz3312x45wzx0d9jsgwyvy8f6m4nnb0c"))))
2417 (build-system gnu-build-system)
2418 (arguments
2419 `(#:tests? #f ; no check target
2420 #:make-flags
1ca44ae3
MB
2421 (list (string-append "CC=" ,(cc-for-target))
2422 (string-append "DESTDIR=" (assoc-ref %outputs "out")))
3480ceb1
KK
2423 #:phases
2424 (modify-phases %standard-phases
2425 (replace 'configure
2426 (lambda _
2427 (substitute* "Makefile"
2428 (("\\$\\(DESTDIR\\)/usr") "$(DESTDIR)"))
2429 #t)))))
2430 (home-page "https://github.com/alucryd/ecm-tools")
2431 (synopsis "Error code modeler")
2432 (description "ECM is a utility that converts ECM files, i.e., CD data files
2433with their error correction data losslessly rearranged for better compression,
2434to their original, binary CD format.")
2435 (license license:gpl3+)))
ff43f128
GLV
2436
2437(define-public tarlz
2438 (package
2439 (name "tarlz")
e7195e83 2440 (version "0.19")
ff43f128
GLV
2441 (source
2442 (origin
2443 (method url-fetch)
2444 (uri (string-append "mirror://savannah/lzip/tarlz/"
2445 "tarlz-" version ".tar.lz"))
2446 (sha256
e7195e83 2447 (base32 "09xal55973ivzpaja93jcc1pfla8gb3vrk8dx7pj9qvvz5aynf9n"))))
ff43f128
GLV
2448 (build-system gnu-build-system)
2449 (native-inputs
2450 `(("lzip" ,lzip)))
2451 (inputs
2452 `(("lzlib" ,lzlib)))
2453 (home-page "https://www.nongnu.org/lzip/tarlz.html")
2454 (synopsis "Combination of the tar archiver and the lzip compressor")
2455 (description
2456 "Tarlz is a massively parallel (multi-threaded) combined implementation of
2457the tar archiver and the lzip compressor. Tarlz creates, lists, and extracts
2458archives in a simplified and safer variant of the POSIX pax format compressed
2459with lzip, keeping the alignment between tar members and lzip members. The
2460resulting multimember tar.lz archive is fully backward compatible with standard
2461tar tools like GNU tar, which treat it like any other tar.lz archive. Tarlz
2462can append files to the end of such compressed archives.")
2463 (license license:gpl2+)))