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