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