gnu: libmspack: Update to 0.9.1.
[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/")
ea80fd1f 640 (version "0.9.1")
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
ea80fd1f 646 (base32 "0h1f5w8rjnq7dcqpqm1mpx5m8q80691kid6f7npqlqwqqzckd8v2"))))
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
0633c77b
RW
1050 (method git-fetch)
1051 (uri (git-reference
1052 (url "https://github.com/jmacd/xdelta.git")
1053 (commit (string-append "v" version))))
1054 (file-name (git-file-name name version))
0b073506
TGR
1055 (sha256
1056 (base32
0633c77b 1057 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
0b073506
TGR
1058 (snippet
1059 ;; This file isn't freely distributable and has no effect on building.
6cbee49d
MW
1060 '(begin
1061 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1062 #t))))
0b073506
TGR
1063 (build-system gnu-build-system)
1064 (native-inputs
1065 `(("autoconf" ,autoconf)
1066 ("automake" ,automake)))
1067 (arguments
1068 `(#:phases
1069 (modify-phases %standard-phases
1070 (add-after 'unpack 'enter-build-directory
e5ff963a 1071 (lambda _ (chdir "xdelta3") #t)))))
69b7fa3e 1072 (home-page "http://xdelta.org")
0b073506
TGR
1073 (synopsis "Delta encoder for binary files")
1074 (description "xdelta encodes only the differences between two binary files
1075using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1076also be used to apply such patches. xdelta is similar to @command{diff} and
1077@command{patch}, but is not limited to plain text and does not generate
1078human-readable output.")
1079 (license license:asl2.0)))
389eb3fa
TGR
1080
1081(define-public lrzip
1082 (package
1083 (name "lrzip")
666619d0 1084 (version "0.631")
389eb3fa
TGR
1085 (source
1086 (origin
1087 (method url-fetch)
1088 (uri (string-append
1089 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
1090 (sha256
1091 (base32
5400fdfd
TGR
1092 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))
1093 (patches (search-patches "lrzip-CVE-2017-8842.patch"))))
389eb3fa
TGR
1094 (build-system gnu-build-system)
1095 (native-inputs
1096 `(;; nasm is only required when building for 32-bit x86 platforms
1097 ,@(if (string-prefix? "i686" (or (%current-target-system)
1098 (%current-system)))
1099 `(("nasm" ,nasm))
1100 '())
1101 ("perl" ,perl)))
1102 (inputs
1103 `(("bzip2" ,bzip2)
1104 ("lzo" ,lzo)
1105 ("zlib" ,zlib)))
1106 (home-page "http://ck.kolivas.org/apps/lrzip/")
1107 (synopsis "Large file compressor with a very high compression ratio")
1108 (description "lrzip is a compression utility that uses long-range
1109redundancy reduction to improve the subsequent compression ratio of
1110larger files. It can then further compress the result with the ZPAQ or
1111LZMA algorithms for maximum compression, or LZO for maximum speed. This
1112choice between size or speed allows for either better compression than
1113even LZMA can provide, or a higher speed than gzip while compressing as
1114well as bzip2.")
1115 (license (list license:gpl3+
1116 license:public-domain)))) ; most files in lzma/
e4c2136d 1117
9869bb12
JL
1118(define-public bitshuffle
1119 (package
1120 (name "bitshuffle")
6370fb2d 1121 (version "0.3.4")
9869bb12
JL
1122 (source (origin
1123 (method url-fetch)
1124 (uri (pypi-uri "bitshuffle" version))
1125 (sha256
1126 (base32
6370fb2d 1127 "0ydawb01ghsvmw0lraczhrgvkjj97bpg98f1qqs1cnfp953mdd5v"))))
9869bb12
JL
1128 (build-system python-build-system)
1129 (arguments
6370fb2d 1130 `(#:tests? #f)) ; fail: https://github.com/h5py/h5py/issues/769
9869bb12
JL
1131 (inputs
1132 `(("numpy" ,python-numpy)
1133 ("h5py" ,python-h5py)
1134 ("hdf5" ,hdf5)))
1135 (native-inputs
1136 `(("cython" ,python-cython)))
1137 (home-page "https://github.com/kiyo-masui/bitshuffle")
1138 (synopsis "Filter for improving compression of typed binary data")
1139 (description "Bitshuffle is an algorithm that rearranges typed, binary data
1140for improving compression, as well as a python/C package that implements this
1141algorithm within the Numpy framework.")
1142 (license license:expat)))
1143
e4c2136d
DC
1144(define-public snappy
1145 (package
1146 (name "snappy")
5a437357 1147 (version "1.1.7")
9e17757f
MB
1148 (source (origin
1149 (method url-fetch)
1150 (uri (string-append "https://github.com/google/snappy/archive/"
1151 version ".tar.gz"))
1152 (file-name (string-append "snappy-" version ".tar.gz"))
1153 (sha256
1154 (base32
1155 "1m7rcdqzkys5lspj8jcsaah8w33zh28s771bw0ga2lgzfgl05yix"))))
5a437357
MB
1156 (build-system cmake-build-system)
1157 (arguments
1158 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
e4c2136d
DC
1159 (home-page "https://github.com/google/snappy")
1160 (synopsis "Fast compressor/decompressor")
5a437357 1161 (description "Snappy is a compression/decompression library. It does not
e4c2136d 1162aim for maximum compression, or compatibility with any other compression library;
5a437357 1163instead, it aims for very high speeds and reasonable compression. For instance,
e4c2136d
DC
1164compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1165for most inputs, but the resulting compressed files are anywhere from 20% to
1166100% bigger.")
1167 (license license:asl2.0)))
adbd7faf 1168
cea83466
JL
1169(define bitshuffle-for-snappy
1170 (package
1171 (inherit bitshuffle)
1172 (name "bitshuffle-for-snappy")
1173 (build-system gnu-build-system)
1174 (arguments
1175 `(#:tests? #f
1176 #:phases
1177 (modify-phases %standard-phases
1178 (replace 'configure
1179 (lambda* (#:key outputs #:allow-other-keys)
1180 (with-output-to-file "Makefile"
1181 (lambda _
04e91134
RW
1182 (format #t "\
1183libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o
1184\tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^
1185
1186%.o: %.c
1187\tgcc -O3 -ffast-math -std=c99 -fPIC -Isrc -Ilz4 -c $< -o $@
1188
1189PREFIX:=~a
1190LIBDIR:=$(PREFIX)/lib
1191INCLUDEDIR:=$(PREFIX)/include
1192
1193install: libbitshuffle.so
1194\tinstall -dm755 $(LIBDIR)
1195\tinstall -dm755 $(INCLUDEDIR)
1196\tinstall -m755 libbitshuffle.so $(LIBDIR)
1197\tinstall -m644 src/bitshuffle.h $(INCLUDEDIR)
1198\tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR)
1199\tinstall -m644 src/iochain.h $(INCLUDEDIR)
1200\tinstall -m644 lz4/lz4.h $(INCLUDEDIR)
1201" (assoc-ref outputs "out"))))
1202 #t)))))
cea83466
JL
1203 (inputs '())
1204 (native-inputs '())))
1205
1206(define-public java-snappy
1207 (package
1208 (name "java-snappy")
d06160b0 1209 (version "1.1.7.2")
cea83466
JL
1210 (source (origin
1211 (method url-fetch)
1212 (uri (string-append "https://github.com/xerial/snappy-java/archive/"
1213 version ".tar.gz"))
1214 (file-name (string-append name "-" version ".tar.gz"))
1215 (sha256
1216 (base32
d06160b0 1217 "1p557vdv006ysgxbpp83krmq0066k46108vyiyka69w8i4i8rbbm"))))
cea83466
JL
1218 (build-system ant-build-system)
1219 (arguments
1220 `(#:jar-name "snappy.jar"
1221 #:source-dir "src/main/java"
1222 #:phases
1223 (modify-phases %standard-phases
1224 (add-before 'build 'remove-binaries
1225 (lambda _
1226 (delete-file "lib/org/xerial/snappy/OSInfo.class")
1227 (delete-file-recursively "src/main/resources/org/xerial/snappy/native")
1228 #t))
1229 (add-before 'build 'build-jni
1230 (lambda _
1231 ;; Rebuild one of the binaries we removed earlier
74d29bed 1232 (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
cea83466
JL
1233 "-d" "lib")
1234 ;; Link to the dynamic bitshuffle and snappy, not the static ones
1235 (substitute* "Makefile.common"
1236 (("-shared")
1237 "-shared -lbitshuffle -lsnappy"))
1238 (substitute* "Makefile"
1239 ;; Don't try to use git, don't download bitshuffle source
1240 ;; and don't build it.
1241 (("\\$\\(SNAPPY_GIT_UNPACKED\\) ")
1242 "")
1243 ((": \\$\\(SNAPPY_GIT_UNPACKED\\)")
1244 ":")
1245 (("\\$\\(BITSHUFFLE_UNPACKED\\) ")
1246 "")
1247 ((": \\$\\(SNAPPY_SOURCE_CONFIGURED\\)") ":")
1248 ;; What we actually want to build
1249 (("SNAPPY_OBJ:=.*")
1250 "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, \
1251 SnappyNative.o BitShuffleNative.o)\n")
1252 ;; Since we removed the directory structure in "native" during
1253 ;; the previous phase, we need to recreate it.
1254 (("NAME\\): \\$\\(SNAPPY_OBJ\\)")
1255 "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)"))
1256 ;; Finally we can run the Makefile to build the dynamic library.
8293d21c
MB
1257 ;; Use the -nocmake target to avoid a dependency on cmake,
1258 ;; which in turn requires the "git_unpacked" directory.
1259 (invoke "make" "native-nocmake")))
cea83466
JL
1260 ;; Once we have built the shared library, we need to place it in the
1261 ;; "build" directory so it can be added to the jar file.
1262 (add-after 'build-jni 'copy-jni
1263 (lambda _
1264 (copy-recursively "src/main/resources/org/xerial/snappy/native"
1265 "build/classes/org/xerial/snappy/native")))
1266 (add-before 'check 'fix-failing
1267 (lambda _
8293d21c
MB
1268 (with-directory-excursion "src/test/java/org/xerial/snappy"
1269 ;; This package assumes maven build, which puts results in "target".
1270 ;; We put them in "build" instead, so fix that.
1271 (substitute* "SnappyLoaderTest.java"
1272 (("target/classes") "build/classes"))
1273 ;; This requires Hadoop, which is not in Guix yet.
1274 (delete-file "SnappyHadoopCompatibleOutputStreamTest.java"))
1275 #t)))))
cea83466
JL
1276 (inputs
1277 `(("osgi-framework" ,java-osgi-framework)))
1278 (propagated-inputs
1279 `(("bitshuffle" ,bitshuffle-for-snappy)
1280 ("snappy" ,snappy)))
1281 (native-inputs
1282 `(("junit" ,java-junit)
1283 ("hamcrest" ,java-hamcrest-core)
1284 ("xerial-core" ,java-xerial-core)
1285 ("classworlds" ,java-plexus-classworlds)
8293d21c
MB
1286 ("commons-lang" ,java-commons-lang)
1287 ("commons-io" ,java-commons-io)
cea83466
JL
1288 ("perl" ,perl)))
1289 (home-page "https://github.com/xerial/snappy-java")
1290 (synopsis "Compression/decompression algorithm in Java")
665fcd32
TGR
1291 (description "Snappy-java is a Java port of snappy, a fast C++
1292compressor/decompressor.")
cea83466
JL
1293 (license license:asl2.0)))
1294
933ad809
RW
1295(define-public java-snappy-1
1296 (package
1297 (inherit java-snappy)
1298 (version "1.0.3-rc3")
1299 (source (origin
1300 (method url-fetch)
1301 (uri (string-append "https://github.com/xerial/snappy-java/archive/"
1302 "snappy-java-" version ".tar.gz"))
1303 (sha256
1304 (base32
1305 "08hsxlqidiqck0q57fshwyv3ynyxy18vmhrai9fyc8mz17m7gsa3"))))
1306 (arguments
1307 `(#:jar-name "snappy.jar"
1308 #:source-dir "src/main/java"
1309 #:phases
1310 (modify-phases %standard-phases
1311 (add-before 'build 'remove-binaries
1312 (lambda _
1313 (delete-file "lib/org/xerial/snappy/OSInfo.class")
1314 (delete-file-recursively "src/main/resources/org/xerial/snappy/native")
1315 #t))
1316 (add-before 'build 'build-jni
1317 (lambda _
1318 ;; Rebuild one of the binaries we removed earlier
74d29bed 1319 (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java"
933ad809
RW
1320 "-d" "lib")
1321 ;; Link to the dynamic snappy, not the static ones
1322 (substitute* "Makefile.common"
1323 (("-shared") "-shared -lsnappy"))
1324 (substitute* "Makefile"
1325 ;; Don't download the sources here.
1326 (("\\$\\(SNAPPY_UNPACKED\\) ") "")
1327 ((": \\$\\(SNAPPY_UNPACKED\\) ") ":")
1328 ;; What we actually want to build
1329 (("SNAPPY_OBJ:=.*")
1330 "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, SnappyNative.o)\n")
1331 ;; Since we removed the directory structure in "native" during
1332 ;; the previous phase, we need to recreate it.
1333 (("NAME\\): \\$\\(SNAPPY_OBJ\\)")
1334 "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)"))
1335 ;; Finally we can run the Makefile to build the dynamic library.
74d29bed 1336 (invoke "make" "native")))
933ad809
RW
1337 ;; Once we have built the shared library, we need to place it in the
1338 ;; "build" directory so it can be added to the jar file.
1339 (add-after 'build-jni 'copy-jni
1340 (lambda _
1341 (copy-recursively "src/main/resources/org/xerial/snappy/native"
1342 "build/classes/org/xerial/snappy/native")
1343 #t))
1344 (add-before 'check 'fix-tests
1345 (lambda _
1346 (mkdir-p "src/test/resources/org/xerial/snappy/")
1347 (copy-recursively "src/test/java/org/xerial/snappy/testdata"
1348 "src/test/resources/org/xerial/snappy/testdata")
1349 (install-file "src/test/java/org/xerial/snappy/alice29.txt"
1350 "src/test/resources/org/xerial/snappy/")
1351 #t)))))))
1352
823997e9
JL
1353(define-public java-iq80-snappy
1354 (package
1355 (name "java-iq80-snappy")
1356 (version "0.4")
1357 (source (origin
1358 (method url-fetch)
1359 (uri (string-append "https://github.com/dain/snappy/archive/snappy-"
1360 version ".tar.gz"))
1361 (sha256
1362 (base32
1363 "0rb3zhci7w9wzd65lfnk7p3ip0n6gb58a9qpx8n7r0231gahyamf"))))
1364 (build-system ant-build-system)
1365 (arguments
1366 `(#:jar-name "iq80-snappy.jar"
1367 #:source-dir "src/main/java"
1368 #:test-dir "src/test"
1369 #:jdk ,icedtea-8
1370 #:phases
1371 (modify-phases %standard-phases
1372 (replace 'check
1373 (lambda _
1374 (define (test class)
831016bd
MW
1375 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
1376 ":build/classes"
1377 ":build/test-classes")
1378 "-Dtest.resources.dir=src/test/resources"
1379 "org.testng.TestNG" "-testclass"
1380 class))
1381 (invoke "ant" "compile-tests")
1382 (test "org.iq80.snappy.SnappyFramedStreamTest")
1383 (test "org.iq80.snappy.SnappyStreamTest")))
823997e9
JL
1384 (add-before 'build 'remove-hadoop-dependency
1385 (lambda _
1386 ;; We don't have hadoop
1387 (delete-file "src/main/java/org/iq80/snappy/HadoopSnappyCodec.java")
1388 (delete-file "src/test/java/org/iq80/snappy/TestHadoopSnappyCodec.java")
1389 #t)))))
1390 (home-page "https://github.com/dain/snappy")
1391 (native-inputs
1392 `(("guava" ,java-guava)
1393 ("java-snappy" ,java-snappy)
1394 ("hamcrest" ,java-hamcrest-core)
1395 ("testng" ,java-testng)))
107a14f9
TGR
1396 (synopsis "Java port of the Snappy (de)compressor")
1397 (description
1398 "Iq80-snappy is a port of the Snappy compressor and decompressor rewritten
1399in pure Java. This compression code produces a byte-for-byte exact copy of the
1400output created by the original C++ code, and is extremely fast.")
823997e9
JL
1401 (license license:asl2.0)))
1402
776d2fb1
RW
1403(define-public java-jbzip2
1404 (package
1405 (name "java-jbzip2")
1406 (version "0.9.1")
1407 (source (origin
1408 (method url-fetch)
1409 (uri (string-append "https://storage.googleapis.com/"
1410 "google-code-archive-source/v2/"
1411 "code.google.com/jbzip2/"
1412 "source-archive.zip"))
1413 (file-name (string-append name "-" version ".zip"))
1414 (sha256
1415 (base32
1416 "0ncmhlqmrfmj96nqf6p77b9ws35lcfsvpfxzwxi2asissc83z1l3"))))
1417 (build-system ant-build-system)
1418 (native-inputs
1419 `(("unzip" ,unzip)
1420 ("java-junit" ,java-junit)))
1421 (arguments
1422 `(#:tests? #f ; no tests
1423 #:jar-name "jbzip2.jar"
1424 #:source-dir "tags/release-0.9.1/src"
1425 #:phases
1426 (modify-phases %standard-phases
1427 (add-after 'unpack 'fix-encoding-problems
1428 (lambda _
1429 ;; Some of the files we're patching are
1430 ;; ISO-8859-1-encoded, so choose it as the default
1431 ;; encoding so the byte encoding is preserved.
1432 (with-fluids ((%default-port-encoding #f))
1433 (substitute* "tags/release-0.9.1/src/org/itadaki/bzip2/HuffmanAllocator.java"
1434 (("Milidi.") "Milidiu")))
1435 #t)))))
1436 (home-page "https://code.google.com/archive/p/jbzip2/")
1437 (synopsis "Java bzip2 compression/decompression library")
1438 (description "Jbzip2 is a Java bzip2 compression/decompression library.
1439It can be used as a replacement for the Apache @code{CBZip2InputStream} /
1440@code{CBZip2OutputStream} classes.")
1441 (license license:expat)))
1442
adbd7faf
KK
1443(define-public p7zip
1444 (package
1445 (name "p7zip")
1446 (version "16.02")
1447 (source (origin
1448 (method url-fetch)
1449 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1450 version "/" name "_" version
1451 "_src_all.tar.bz2"))
1452 (sha256
1453 (base32
1454 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1455 (modules '((guix build utils)))
1456 (snippet
1457 '(begin
1458 ;; Remove non-free source files
1459 (for-each delete-file
1460 (append
1461 (find-files "CPP/7zip/Compress" "Rar.*")
1462 (find-files "CPP/7zip/Crypto" "Rar.*")
1463 (find-files "DOC/unRarLicense.txt")
1464 (find-files "Utils/file_Codecs_Rar_so.py")))
1465 (delete-file-recursively "CPP/7zip/Archive/Rar")
1466 (delete-file-recursively "CPP/7zip/Compress/Rar")
1467 #t))
1ac675a5 1468 (patches (search-patches "p7zip-CVE-2016-9296.patch"
a630c647 1469 "p7zip-CVE-2017-17969.patch"
1ac675a5 1470 "p7zip-remove-unused-code.patch"))))
adbd7faf
KK
1471 (build-system gnu-build-system)
1472 (arguments
1473 `(#:make-flags
1474 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1475 #:phases
1476 (modify-phases %standard-phases
1477 (replace 'configure
1478 (lambda* (#:key system outputs #:allow-other-keys)
8fcdd9d5
MW
1479 (invoke "cp"
1480 (let ((system ,(or (%current-target-system)
1481 (%current-system))))
1482 (cond
1483 ((string-prefix? "x86_64" system)
1484 "makefile.linux_amd64_asm")
1485 ((string-prefix? "i686" system)
1486 "makefile.linux_x86_asm_gcc_4.X")
1487 (else
1488 "makefile.linux_any_cpu_gcc_4.X")))
1489 "makefile.machine")))
adbd7faf
KK
1490 (replace 'check
1491 (lambda _
8fcdd9d5
MW
1492 (invoke "make" "test")
1493 (invoke "make" "test_7z")
1494 (invoke "make" "test_7zr"))))))
adbd7faf
KK
1495 (inputs
1496 (let ((system (or (%current-target-system)
1497 (%current-system))))
1498 `(,@(cond ((string-prefix? "x86_64" system)
1499 `(("yasm" ,yasm)))
1500 ((string-prefix? "i686" system)
1501 `(("nasm" ,nasm)))
1502 (else '())))))
1503 (home-page "http://p7zip.sourceforge.net/")
1504 (synopsis "Command-line file archiver with high compression ratio")
1505 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1506handles the 7z format which features very high compression ratios.")
1507 (license (list license:lgpl2.1+
1508 license:gpl2+
1509 license:public-domain))))
618089f9
MB
1510
1511(define-public gzstream
1512 (package
1513 (name "gzstream")
1514 (version "1.5")
1515 (source (origin
1516 (method url-fetch)
1517 (uri
1518 ;; No versioned URL, but last release was in 2003.
1519 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1520 (file-name (string-append name "-" version ".tgz"))
1521 (sha256
1522 (base32
1523 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1524 (modules '((guix build utils)))
1525 (snippet
1526 ;; Remove pre-compiled object.
6cbee49d
MW
1527 '(begin
1528 (delete-file "gzstream.o")
1529 #t))))
618089f9
MB
1530 (build-system gnu-build-system)
1531 (arguments
1532 `(#:test-target "test"
1533 #:phases
1534 (modify-phases %standard-phases
1535 (delete 'configure)
1536 (replace 'install
1537 (lambda* (#:key outputs #:allow-other-keys)
1538 (let* ((out (assoc-ref outputs "out"))
1539 (lib (string-append out "/lib"))
1540 (include (string-append out "/include")))
1541 (install-file "libgzstream.a" lib)
1542 (install-file "gzstream.h" include)
1543 #t))))))
1544 (propagated-inputs `(("zlib" ,zlib)))
1545 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1546 (synopsis "Compressed C++ iostream")
1547 (description "gzstream is a small library for providing zlib
1548functionality in a C++ iostream.")
1549 (license license:lgpl2.1+)))
36df995c
TGR
1550
1551(define-public zpaq
1552 (package
1553 (name "zpaq")
1554 (version "7.15")
1555 (source
1556 (origin
1557 (method url-fetch/zipbomb)
1558 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1559 (string-delete #\. version) ".zip"))
1560 (sha256
1561 (base32
1562 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1563 (modules '((guix build utils)))
1564 (snippet
1565 ;; Delete irrelevant pre-compiled binaries.
6cbee49d
MW
1566 '(begin
1567 (for-each delete-file (find-files "." "\\.exe$"))
1568 #t))))
36df995c
TGR
1569 (build-system gnu-build-system)
1570 (arguments
1571 `(#:phases
1572 (modify-phases %standard-phases
1573 (delete 'configure)) ; no ‘configure’ script
1574 #:make-flags
1575 (list
1576 (string-append "CPPFLAGS=-Dunix"
1577 ,(match (or (%current-target-system)
1578 (%current-system))
1579 ("x86_64-linux" "")
1580 ("i686-linux" "")
1581 (_ " -DNOJIT")))
1582 ;; These should be safe, lowest-common-denominator instruction sets,
1583 ;; allowing for some optimisation while remaining reproducible.
effd7198 1584 (string-append "CXXFLAGS=-O3 -DNDEBUG"
36df995c
TGR
1585 ,(match (or (%current-target-system)
1586 (%current-system))
effd7198
EF
1587 ("x86_64-linux" " -march=nocona -mtune=generic")
1588 ("i686-linux" " -march=i686 -mtune=generic")
1589 ("armhf-linux" " -mtune=generic-armv7-a")
36df995c
TGR
1590 (_ "")))
1591 (string-append "PREFIX="
1592 (assoc-ref %outputs "out")))))
1593 (native-inputs
1594 `(("perl" ,perl))) ; for pod2man
1595 (home-page "http://mattmahoney.net/dc/zpaq.html")
1596 (synopsis "Incremental journaling archiver")
1597 (description "ZPAQ is a command-line archiver for realistic situations with
1598many duplicate and already compressed files. It backs up only those files
1599modified since the last update. All previous versions remain untouched and can
1600be independently recovered. Identical files are only stored once (known as
1601@dfn{de-duplication}). Archives can also be encrypted.
1602
1603ZPAQ is intended to back up user data, not entire operating systems. It ignores
1604owner and group IDs, ACLs, extended attributes, or special file types like
1605devices, sockets, or named pipes. It does not follow or restore symbolic links
1606or junctions, and always follows hard links.")
1607 (license (list license:public-domain
1608 ;; libzpaq.cpp contains a mix of public-domain and
1609 ;; expat-licenced (or ‘MIT’) code.
1610 license:expat))))
0da8313c 1611
9e6ada8f
MR
1612(define-public unshield
1613 (package
1614 (name "unshield")
1615 (version "1.4.2")
1616 (source
1617 (origin (method url-fetch)
1618 (uri (string-append "http://github.com/twogood/unshield/archive/"
1619 version ".tar.gz"))
277be74f 1620 (file-name (string-append name "-" version ".tar.gz"))
9e6ada8f
MR
1621 (sha256
1622 (base32
1623 "0x7ps644yp5dka2zhb8w0ifqmw3d255jafpzfwv8xbcpgq6fmm2x"))))
1624 (build-system cmake-build-system)
1625 (inputs
1626 `(("zlib" ,zlib)
1627 ("openssl" ,openssl)
1628 ;; test data that is otherwise downloaded with curl
1629 ("unshield-avigomanager11b22.zip"
1630 ,(origin
1631 (method url-fetch)
a5fa1a1a
MR
1632 (uri (string-append "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1633 "unshield-avigomanager11b22.zip?dl=1"))
9e6ada8f
MR
1634 (sha256
1635 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1636 (file-name "unshield-avigomanager11b22.zip")))
1637 ("unshield-the-feeble-files-spanish.zip"
1638 ,(origin
1639 (method url-fetch)
a5fa1a1a
MR
1640 (uri (string-append "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1641 "unshield-the-feeble-files-spanish.zip?dl=1"))
9e6ada8f
MR
1642 (sha256
1643 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1644 (file-name "unshield-the-feeble-files-spanish.zip")))))
1645 (native-inputs
1646 `(("unzip" ,unzip)))
1647 (arguments
1648 `(#:out-of-source? #f
1649 #:phases
1650 (modify-phases %standard-phases
1651 (add-before 'check 'pre-check
1652 (lambda* (#:key inputs #:allow-other-keys)
1653 (for-each (lambda (i)
1654 (copy-file (assoc-ref inputs i)
1655 (string-append "test/v0/" i)))
1656 '("unshield-avigomanager11b22.zip"
1657 "unshield-the-feeble-files-spanish.zip"))
1658 (substitute* (find-files "test/" "/*\\.sh")
1659 ;; Tests expect the unshield binary in a specific
1660 ;; location.
1661 (("/var/tmp/unshield/bin/unshield")
1662 (string-append (getcwd) "/src/unshield"))
1663 ;; We no longer need to download the data.
1664 ((".?URL=.*$") "")
1665 (("curl -(|f)sSL -o test.zip .*") ""))
1666 (substitute* "test/v0/avigomanager.sh"
1667 (("test.zip")
1668 (string-append (getcwd)
1669 "/test/v0/unshield-avigomanager11b22.zip")))
1670 (substitute* "test/v0/the-feeble-files-spanish.sh"
1671 (("test.zip")
1672 (string-append (getcwd)
1673 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1674 #t))
1675 (replace 'check
1676 (lambda _
df04bd25 1677 (invoke "./run-tests.sh"))))))
9e6ada8f
MR
1678 (home-page "https://github.com/twogood/unshield")
1679 (synopsis "Extract CAB files from InstallShield installers")
1680 (description
1681 "@command{unshield} is a tool and library for extracting @file{.cab}
1682 archives from InstallShield installers.")
1683 (license license:expat)))
1684
f6ac3101
TGR
1685(define-public zstd
1686 (package
1687 (name "zstd")
2820e315 1688 (version "1.3.7")
3880537c
TGR
1689 (source
1690 (origin
1691 (method url-fetch)
1692 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1693 "v" version "/zstd-" version ".tar.gz"))
1694 (sha256
2820e315 1695 (base32 "0gapsdzqfsfqqddzv22592iwa0008xjyi15f06pfv9hcvwvg4xrj"))))
f6ac3101
TGR
1696 (build-system gnu-build-system)
1697 (arguments
1698 `(#:phases
1699 (modify-phases %standard-phases
1700 (delete 'configure)) ; no configure script
1701 #:make-flags
1702 (list "CC=gcc"
f45e314e
TGR
1703 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1704 ;; Skip auto-detection of, and creating a dependency on, the build
1705 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1706 "HAVE_LZMA=0"
1707 ;; Not currently detected, but be explicit & avoid surprises later.
1708 "HAVE_LZ4=0"
e8073063 1709 "HAVE_ZLIB=0")))
f6ac3101
TGR
1710 (home-page "http://zstd.net/")
1711 (synopsis "Zstandard real-time compression algorithm")
1712 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1713that combines very fast operation with a compression ratio comparable to that of
1714zlib. In most scenarios, both compression and decompression can be performed in
1715‘real time’. The compressor can be configured to provide the most suitable
1716trade-off between compression ratio and speed, without affecting decompression
1717speed.")
1718 (license (list license:bsd-3 ; the main top-level LICENSE file
16123d1d 1719 license:bsd-2 ; many files explicitly state 2-Clause
5a719dee 1720 license:gpl2 ; the main top-level COPYING file
16123d1d
TGR
1721 license:gpl3+ ; tests/gzip/*.sh
1722 license:expat ; lib/dictBuilder/divsufsort.[ch]
f6ac3101
TGR
1723 license:public-domain ; zlibWrapper/examples/fitblk*
1724 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
0f03c531
TGR
1725
1726(define-public pzstd
1727 (package
1728 (name "pzstd")
1729 (version (package-version zstd))
1730 (source (package-source zstd))
1731 (build-system gnu-build-system)
1732 (native-inputs
c695fb76 1733 `(("googletest" ,googletest)))
0f03c531
TGR
1734 (arguments
1735 `(#:phases
1736 (modify-phases %standard-phases
1737 (add-after 'unpack 'enter-subdirectory
1738 (lambda _ (chdir "contrib/pzstd")))
1739 (delete 'configure) ; no configure script
1740 (add-before 'check 'compile-tests
1741 (lambda* (#:key make-flags #:allow-other-keys)
745e83ca 1742 (apply invoke "make" "tests" make-flags)))
0f03c531
TGR
1743 (add-after 'install 'install-documentation
1744 (lambda* (#:key outputs #:allow-other-keys)
1745 (let* ((out (assoc-ref outputs "out"))
1746 (doc (string-append out "/share/doc/" ,name)))
1747 (mkdir-p doc)
1748 (install-file "README.md" doc)
1749 #t))))
1750 #:make-flags
1751 (list "CC=gcc"
1752 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1753 (home-page (package-home-page zstd))
1754 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1755 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1756multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1757compression algorithm}. It is fully compatible with the original Zstandard file
1758format and command-line interface, and can be used as a drop-in replacement.
1759
1760Compression is distributed over multiple processor cores to improve performance,
1761as is the decompression of data compressed in this manner. Data compressed by
1762other implementations will only be decompressed by two threads: one performing
1763the actual decompression, the other input and output.")
1764 (license (package-license zstd))))
148585c2
AI
1765
1766(define-public zip
1767 (package
1768 (name "zip")
1769 (version "3.0")
1770 (source
1771 (origin
1772 (method url-fetch)
1773 (uri (string-append "mirror://sourceforge/infozip"
1774 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1775 (sha256
1776 (base32
1777 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1778 (build-system gnu-build-system)
1779 (inputs `(("bzip2" ,bzip2)))
1780 (arguments
1781 `(#:tests? #f ; no test target
1782 #:make-flags (let ((out (assoc-ref %outputs "out")))
1783 (list "-f" "unix/Makefile"
1784 (string-append "prefix=" out)
1785 (string-append "MANDIR=" out "/share/man/man1")))
148585c2
AI
1786 #:phases
1787 (modify-phases %standard-phases
1788 (replace 'build
1789 (lambda* (#:key (make-flags '()) #:allow-other-keys)
b0559d24 1790 (apply invoke "make" "generic_gcc" make-flags)))
148585c2
AI
1791 (delete 'configure))))
1792 (home-page "http://www.info-zip.org/Zip.html")
1793 (synopsis "Compression and file packing utility")
1794 (description
1795 "Zip is a compression and file packaging/archive utility. Zip is useful
1796for packaging a set of files for distribution, for archiving files, and for
1797saving disk space by temporarily compressing unused files or directories.
1798Zip puts one or more compressed files into a single ZIP archive, along with
1799information about the files (name, path, date, time of last modification,
1800protection, and check information to verify file integrity). An entire
1801directory structure can be packed into a ZIP archive with a single command.
1802
1803Zip has one compression method (deflation) and can also store files without
1804compression. Zip automatically chooses the better of the two for each file.
1805Compression ratios of 2:1 to 3:1 are common for text files.")
1806 (license (license:non-copyleft "file://LICENSE"
1807 "See LICENSE in the distribution."))))
1808
1809(define-public unzip
1810 (package (inherit zip)
1811 (name "unzip")
1812 (version "6.0")
1813 (source
1814 (origin
1815 (method url-fetch)
1816 (uri (string-append "mirror://sourceforge/infozip"
1817 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1818 (sha256
1819 (base32
1820 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1821 (patches (search-patches "unzip-CVE-2014-8139.patch"
1822 "unzip-CVE-2014-8140.patch"
1823 "unzip-CVE-2014-8141.patch"
1824 "unzip-CVE-2014-9636.patch"
1825 "unzip-CVE-2015-7696.patch"
1826 "unzip-CVE-2015-7697.patch"
1827 "unzip-allow-greater-hostver-values.patch"
1828 "unzip-initialize-symlink-flag.patch"
1829 "unzip-remove-build-date.patch"
1830 "unzip-attribs-overflow.patch"
1831 "unzip-overflow-on-invalid-input.patch"
1832 "unzip-format-secure.patch"
1833 "unzip-overflow-long-fsize.patch"))))
1834 (build-system gnu-build-system)
1835 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1836 (arguments
1837 `(#:phases (modify-phases %standard-phases
1838 (delete 'configure)
190376a1
MW
1839 (add-after 'unpack 'fortify
1840 (lambda _
1841 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1842 ;; This environment variable is recommended in 'unix/Makefile'
1843 ;; for passing flags to the C compiler.
1844 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1845 #t))
148585c2
AI
1846 (replace 'build
1847 (lambda* (#:key make-flags #:allow-other-keys)
fa76696b
MW
1848 (apply invoke "make"
1849 `("-j" ,(number->string
1850 (parallel-job-count))
1851 ,@make-flags
1852 "generic_gcc")))))
148585c2
AI
1853 #:make-flags (list "-f" "unix/Makefile"
1854 (string-append "prefix=" %output)
1855 (string-append "MANDIR=" %output "/share/man/man1"))))
1856 (home-page "http://www.info-zip.org/UnZip.html")
1857 (synopsis "Decompression and file extraction utility")
1858 (description
1859 "UnZip is an extraction utility for archives compressed in .zip format,
1860also called \"zipfiles\".
1861
1862UnZip lists, tests, or extracts files from a .zip archive. The default
1863behaviour (with no options) is to extract into the current directory, and
1864subdirectories below it, all files from the specified zipfile. UnZip
1865recreates the stored directory structure by default.")
1866 (license (license:non-copyleft "file://LICENSE"
1867 "See LICENSE in the distribution."))))
1868
1869(define-public zziplib
1870 (package
1871 (name "zziplib")
3f986ff6
MB
1872 (version "0.13.69")
1873 (home-page "https://github.com/gdraheim/zziplib")
148585c2
AI
1874 (source
1875 (origin
1876 (method url-fetch)
3f986ff6 1877 (uri (string-append home-page "/archive/v" version ".tar.gz"))
148585c2
AI
1878 (sha256
1879 (base32
3f986ff6 1880 "0i052a7shww0fzsxrdp3rd7g4mbzx7324a8ysbc0br7frpblcql4"))))
148585c2
AI
1881 (build-system gnu-build-system)
1882 (inputs
1883 `(("zlib" ,zlib)))
1884 (native-inputs `(("perl" ,perl) ; for the documentation
1885 ("pkg-config" ,pkg-config)
1886 ;; for the documentation; Python 3 not supported,
1887 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1888 ("python" ,python-2)
1889 ("zip" ,zip))) ; to create test files
148585c2
AI
1890 (synopsis "Library for accessing zip files")
1891 (description
1892 "ZZipLib is a library based on zlib for accessing zip files.")
0d729c5b
MB
1893 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1894 ;; files carry the Zlib license; see "docs/copying.html" for details.
1895 (license (list license:lgpl2.0+ license:mpl1.1))))
148585c2 1896
b6f024ad 1897(define-public perl-archive-zip
148585c2 1898 (package
b6f024ad 1899 (name "perl-archive-zip")
d5960bf7 1900 (version "1.60")
148585c2
AI
1901 (source
1902 (origin
1903 (method url-fetch)
1904 (uri (string-append
d5960bf7 1905 "mirror://cpan/authors/id/P/PH/PHRED/Archive-Zip-"
148585c2
AI
1906 version ".tar.gz"))
1907 (sha256
1908 (base32
d5960bf7 1909 "02y2ylq83hy9kgj57sc0239x65br9sm98c0chsm61s08yc2mpiza"))))
148585c2 1910 (build-system perl-build-system)
d5960bf7
TGR
1911 (native-inputs
1912 ;; For tests.
1913 `(("perl-test-mockmodule" ,perl-test-mockmodule)))
49ab09e6
TGR
1914 (synopsis "Provides an interface to Zip archive files")
1915 (description "The @code{Archive::Zip} module allows a Perl program to
1916create, manipulate, read, and write Zip archive files.")
9aba9b12 1917 (home-page "https://metacpan.org/release/Archive-Zip")
148585c2 1918 (license license:perl-license)))
06de4aaf
TF
1919
1920(define-public libzip
1921 (package
1922 (name "libzip")
80486319 1923 (version "1.5.1")
06de4aaf
TF
1924 (source (origin
1925 (method url-fetch)
1926 (uri (string-append
8d6c7456 1927 "https://libzip.org/download/" name "-" version ".tar.xz"))
06de4aaf
TF
1928 (sha256
1929 (base32
80486319 1930 "0wnkkvkq90wyawj9221i77sf3nix1vj3ygzdy59k8yvcjnv3bsh4"))))
06de4aaf
TF
1931 (native-inputs
1932 `(("perl" ,perl)))
1933 (inputs
1934 `(("zlib" ,zlib)))
80486319 1935 (build-system cmake-build-system)
8d6c7456 1936 (home-page "https://libzip.org")
06de4aaf
TF
1937 (synopsis "C library for reading, creating, and modifying zip archives")
1938 (description "Libzip is a C library for reading, creating, and modifying
1939zip archives. Files can be added from data buffers, files, or compressed data
1940copied directly from other zip archives. Changes made without closing the
1941archive can be reverted.")
1942 (license license:bsd-3)))
ef5c40aa
SR
1943
1944(define-public atool
1945 (package
1946 (name "atool")
1947 (version "0.39.0")
1948 (source
1949 (origin
1950 (method url-fetch)
1951 (uri (string-append "http://savannah.nongnu.org/download/atool/atool-"
1952 version ".tar.gz"))
1953 (sha256
1954 (base32
1955 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1956 (build-system gnu-build-system)
1957 (arguments
1958 `(#:phases
1959 (modify-phases %standard-phases
1960 (add-after 'unpack 'embed-absolute-file-name
1961 (lambda* (#:key inputs #:allow-other-keys)
1962 (substitute* "atool"
1963 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1964 (string-append pre "'" (assoc-ref inputs "file")
1965 "/bin/file'")))
1966 #t)))))
1967 (inputs
1968 `(("perl" ,perl)
1969 ("file" ,file)))
340978d7 1970 (home-page "https://www.nongnu.org/atool/")
ef5c40aa
SR
1971 (synopsis "Universal tool to manage file archives of various types")
1972 (description "The main command is @command{aunpack} which extracts files
1973from an archive. The other commands provided are @command{apack} (to create
1974archives), @command{als} (to list files in archives), and @command{acat} (to
1975extract files to standard out). As @command{atool} invokes external programs
1976to handle the archives, not all commands may be supported for a certain type
1977of archives.")
1978 (license license:gpl2+)))
b44ecca6
P
1979
1980(define-public perl-archive-extract
1981 (package
1982 (name "perl-archive-extract")
1983 (version "0.80")
1984 (source
1985 (origin
1986 (method url-fetch)
1987 (uri (string-append "mirror://cpan/authors/id/B/BI/BINGOS/Archive-Extract-"
1988 version ".tar.gz"))
1989 (sha256
1990 (base32
1991 "1x15j1q6w6z8hqyqgap0lz4qbq2174wfhksy1fdd653ccbaw5jr5"))))
1992 (build-system perl-build-system)
9aba9b12 1993 (home-page "https://metacpan.org/release/Archive-Extract")
b44ecca6
P
1994 (synopsis "Generic archive extracting mechanism")
1995 (description "It allows you to extract any archive file of the type .tar,
1996.tar.gz, .gz, .Z, tar.bz2, .tbz, .bz2, .zip, .xz,, .txz, .tar.xz or .lzma
1997without having to worry how it does so, or use different interfaces for each
1998type by using either Perl modules, or command-line tools on your system.")
1999 (license license:perl-license)))
b80027e5
JL
2000
2001(define-public java-tukaani-xz
2002 (package
2003 (name "java-tukaani-xz")
2004 (version "1.6")
2005 (source (origin
2006 (method url-fetch)
2007 (uri (string-append "https://tukaani.org/xz/xz-java-" version ".zip"))
2008 (sha256
2009 (base32
2010 "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x"))))
2011 (build-system ant-build-system)
2012 (arguments
2013 `(#:tests? #f; no tests
2014 #:phases
2015 (modify-phases %standard-phases
2016 (add-after 'unpack 'chdir
2017 (lambda _
2018 ;; Our build system enters the first directory in the archive, but
2019 ;; the package is not contained in a subdirectory
2020 (chdir "..")))
2021 (replace 'install
2022 (lambda* (#:key outputs #:allow-other-keys)
2023 ;; Do we want to install *Demo.jar?
2024 (install-file "build/jar/xz.jar"
2025 (string-append
2026 (assoc-ref outputs "out")
2027 "/share/java/xz.jar")))))))
2028 (native-inputs
2029 `(("unzip" ,unzip)))
2030 (home-page "https://tukaani.org")
2031 (synopsis "XZ in Java")
2032 (description "Tukaani-xz is an implementation of xz compression/decompression
2033algorithms in Java.")
2034 (license license:public-domain)))
34e8cf22
TGR
2035
2036(define-public lunzip
2037 (package
2038 (name "lunzip")
83e8a302 2039 (version "1.10")
34e8cf22
TGR
2040 (source
2041 (origin
2042 (method url-fetch)
b7fd77ef 2043 (uri (string-append "mirror://savannah/lzip/"
34e8cf22
TGR
2044 name "/" name "-" version ".tar.gz"))
2045 (sha256
83e8a302 2046 (base32 "1iw59br6nsxs7l1p875h8w3vxwr04xfhg5zyal64crvamhxkj5kl"))))
34e8cf22
TGR
2047 (build-system gnu-build-system)
2048 (arguments
2049 `(#:configure-flags
2050 (list "CC=gcc")))
340978d7 2051 (home-page "https://www.nongnu.org/lzip/lunzip.html")
34e8cf22
TGR
2052 (synopsis "Small, stand-alone lzip decompressor")
2053 (description
2054 "Lunzip is a decompressor for files in the lzip compression format (.lz),
2055written as a single small C tool with no dependencies. This makes it
2056well-suited to embedded and other systems without a C++ compiler, or for use in
2057applications such as software installers that need only to decompress files,
2058not compress them.
2059Lunzip is intended to be fully compatible with the regular lzip package.")
2060 (license (list license:bsd-2 ; carg_parser.[ch]
2061 license:gpl2+)))) ; everything else
5dca4c76
TGR
2062
2063(define-public clzip
2064 (package
2065 (name "clzip")
d6d1643b 2066 (version "1.10")
5dca4c76
TGR
2067 (source
2068 (origin
2069 (method url-fetch)
b7fd77ef 2070 (uri (string-append "mirror://savannah/lzip/"
5dca4c76
TGR
2071 name "/" name "-" version ".tar.gz"))
2072 (sha256
d6d1643b 2073 (base32 "03xcmhl3dya4jrwmsqh09ikimpb36fr3vkh2bwfzz1sbcns0cdg3"))))
5dca4c76
TGR
2074 (build-system gnu-build-system)
2075 (arguments
2076 `(#:configure-flags
2077 (list "CC=gcc")))
340978d7 2078 (home-page "https://www.nongnu.org/lzip/clzip.html")
5dca4c76
TGR
2079 (synopsis "Small, stand-alone lzip compressor and decompressor")
2080 (description
2081 "Clzip is a compressor and decompressor for files in the lzip compression
2082format (.lz), written as a single small C tool with no dependencies. This makes
2083it well-suited to embedded and other systems without a C++ compiler, or for use
2084in other applications like package managers.
2085Clzip is intended to be fully compatible with the regular lzip package.")
2086 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
2087 license:gpl2+))))
2e3b1a92
TGR
2088
2089(define-public lzlib
2090 (package
2091 (name "lzlib")
d1c1d835 2092 (version "1.10")
2e3b1a92
TGR
2093 (source
2094 (origin
2095 (method url-fetch)
b7fd77ef 2096 (uri (string-append "mirror://savannah/lzip/"
2e3b1a92
TGR
2097 name "/" name "-" version ".tar.gz"))
2098 (sha256
d1c1d835 2099 (base32 "0hqhnj2lzqacdbmmnpy91lsm1rd9zlngs1q6s9pyahsv1a0bfshx"))))
2e3b1a92
TGR
2100 (build-system gnu-build-system)
2101 ;; The included minilzip binary is only ~16 smaller than the ‘real’ lzip.
2102 ;; It's used during the test suite, but don't be tempted to install it.
2103 (arguments
2104 `(#:configure-flags
2105 (list "CC=gcc"
2106 "--enable-shared"))) ; only static (.a) is built by default
340978d7 2107 (home-page "https://www.nongnu.org/lzip/lzlib.html")
2e3b1a92
TGR
2108 (synopsis "Lzip data compression C library")
2109 (description
2110 "Lzlib is a C library for in-memory LZMA compression and decompression in
2111the lzip format. It supports integrity checking of the decompressed data, and
2112all functions are thread-safe. The library should never crash, even in case of
2113corrupted input.")
2114 (license (list license:bsd-2 ; the library itself
2115 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
8c4ca853
TGR
2116
2117(define-public plzip
2118 (package
2119 (name "plzip")
10cac630 2120 (version "1.7")
8c4ca853
TGR
2121 (source
2122 (origin
2123 (method url-fetch)
b7fd77ef 2124 (uri (string-append "mirror://savannah/lzip/"
8c4ca853
TGR
2125 name "/" name "-" version ".tar.gz"))
2126 (sha256
10cac630 2127 (base32 "1dzjp9r7krwpsn224bhcqbzd5aj5b4556sdi9yzl2bzbk3fjrqlm"))))
8c4ca853
TGR
2128 (build-system gnu-build-system)
2129 (inputs
2130 `(("lzlib" ,lzlib)))
340978d7 2131 (home-page "https://www.nongnu.org/lzip/plzip.html")
8c4ca853
TGR
2132 (synopsis "Parallel lossless data compressor for the lzip format")
2133 (description
2134 "Plzip is a massively parallel (multi-threaded) lossless data compressor
2135and decompressor that uses the lzip file format (.lz). Files produced by plzip
2136are fully compatible with lzip and can be rescued with lziprecover.
2137On multiprocessor machines, plzip can compress and decompress large files much
2138faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
21392%). The number of usable threads is limited by file size: on files of only a
2140few MiB, plzip is no faster than lzip.
2141Files that were compressed with regular lzip will also not be decompressed
2142faster by plzip, unless the @code{-b} option was used: lzip usually produces
2143single-member files which can't be decompressed in parallel.")
2144 (license (list license:bsd-2 ; arg_parser.{cc,h}
2145 license:gpl2+)))) ; everything else
e294c05e
RH
2146
2147(define-public innoextract
2148 (package
2149 (name "innoextract")
05640222 2150 (version "1.7")
e294c05e
RH
2151 (source
2152 (origin
2153 (method url-fetch)
2154 (uri (string-append "https://github.com/dscharrer/innoextract/archive/"
2155 version ".tar.gz"))
2156 (sha256
2157 (base32
05640222 2158 "0khwi9f0q0h6xfbixrrc1rfpgj0b7ajwilq7yhmxnn5lpc807f6x"))
e294c05e
RH
2159 (file-name (string-append name "-" version ".tar.gz"))))
2160 (build-system cmake-build-system)
2161 (arguments
2162 `(#:tests? #f)) ;; No tests available.
2163 (inputs `(("boost" ,boost)
2164 ("libiconv" ,libiconv)
2165 ("xz" ,xz)))
2166 (native-inputs `(("pkg-config" ,pkg-config)))
2167 (home-page "https://constexpr.org/innoextract/")
2168 (synopsis "Tool for extracting Inno Setup installers")
2169 (description "innoextract allows extracting Inno Setup installers under
2170non-Windows systems without running the actual installer using wine.")
2171 (license license:zlib)))
2ed0ef2f
LF
2172
2173(define-public google-brotli
2174 (package
2175 (name "google-brotli")
605ade44 2176 (version "1.0.4")
2ed0ef2f
LF
2177 (source (origin
2178 (method url-fetch)
2179 (uri (string-append "https://github.com/google/brotli/archive/v"
2180 version ".tar.gz"))
2181 (sha256
2182 (base32
605ade44 2183 "1hrpmz162k4x3xm6vmbpm443jlfr1kp536p8962y2dncy7gs6s12"))))
2ed0ef2f
LF
2184 (build-system cmake-build-system)
2185 (arguments
2186 `(#:phases
2187 (modify-phases %standard-phases
2188 (add-after 'install 'rename-static-libraries
2189 ;; The build tools put a 'static' suffix on the static libraries, but
2190 ;; other applications don't know how to find these.
2191 (lambda* (#:key outputs #:allow-other-keys)
2192 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
2193 (rename-file (string-append lib "libbrotlicommon-static.a")
2194 (string-append lib "libbrotlicommon.a"))
2195 (rename-file (string-append lib "libbrotlidec-static.a")
2196 (string-append lib "libbrotlidec.a"))
2197 (rename-file (string-append lib "libbrotlienc-static.a")
2198 (string-append lib "libbrotlienc.a"))
2199 #t))))
2200 #:configure-flags
2201 (list ;; Defaults to "lib64" on 64-bit archs.
2202 (string-append "-DCMAKE_INSTALL_LIBDIR="
2203 (assoc-ref %outputs "out") "/lib"))))
2204 (home-page "https://github.com/google/brotli")
2205 (synopsis "General-purpose lossless compression")
2206 (description "This package provides the reference implementation of Brotli,
2207a generic-purpose lossless compression algorithm that compresses data using a
2208combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
2209order context modeling, with a compression ratio comparable to the best
2210currently available general-purpose compression methods. It is similar in speed
2211with @code{deflate} but offers more dense compression.
2212
2213The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
2214 (license license:expat)))
71987177
PN
2215
2216(define-public ucl
2217 (package
2218 (name "ucl")
2219 (version "1.03")
2220 (source (origin
2221 (method url-fetch)
2222 (uri (string-append "http://www.oberhumer.com/opensource/"
2223 name "/download/" name "-" version ".tar.gz"))
2224 (sha256
2225 (base32
2226 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
2227 (build-system gnu-build-system)
2228 (home-page "http://www.oberhumer.com/opensource/ucl/")
2229 (synopsis "Portable lossless data compression library")
2230 (description "UCL implements a number of compression algorithms that
2231achieve an excellent compression ratio while allowing fast decompression.
2232Decompression requires no additional memory.
2233
2234Compared to LZO, the UCL algorithms achieve a better compression ratio but
2235decompression is a little bit slower.")
2236 (license license:gpl2+)))
5735256d
PN
2237
2238(define-public upx
2239 (package
2240 (name "upx")
2241 (version "3.94")
2242 (source (origin
2243 (method url-fetch)
2244 (uri (string-append "https://github.com/upx/upx/releases/download/v"
2245 version "/" name "-" version "-src.tar.xz"))
2246 (sha256
2247 (base32
a14de832
PN
2248 "08anybdliqsbsl6x835iwzljahnm9i7v26icdjkcv33xmk6p5vw1"))
2249 (patches (search-patches "upx-fix-CVE-2017-15056.patch"))))
5735256d
PN
2250 (build-system gnu-build-system)
2251 (native-inputs `(("perl" ,perl)
2252 ("ucl" ,ucl)))
2253 (inputs `(("zlib" ,zlib)))
2254 (arguments
2255 `(#:make-flags
2256 (list "all"
2257 ;; CHECK_WHITESPACE does not seem to work.
2258 ;; See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/upx.
2259 "CHECK_WHITESPACE=true")
2260 #:phases
2261 (modify-phases %standard-phases
2262 (delete 'configure)
2263 (delete 'check)
2264 (delete 'install)
2265 (add-before 'build 'patch-exec-bin-sh
2266 (lambda _
2267 (substitute* (find-files "Makefile")
2268 (("/bin/sh") (which "sh")))
2269 (substitute* "src/Makefile"
2270 (("/bin/sh") (which "sh")))
2271 #t))
2272 (add-after 'build 'install-upx
2273 (lambda* (#:key outputs #:allow-other-keys)
2274 (let* ((out (assoc-ref outputs "out"))
2275 (bin (string-append out "/bin")))
2276 (mkdir-p bin)
2277 (copy-file "src/upx.out" (string-append bin "/upx")))
2278 #t))
2279 )))
2280 (home-page "https://upx.github.io/")
a14de832
PN
2281 ;; CVE-2017-16869 is about Mach-O files which is not of a big concern for Guix.
2282 ;; See https://github.com/upx/upx/issues/146 and
2283 ;; https://nvd.nist.gov/vuln/detail?vulnId=CVE-2017-16869.
2284 ;; The issue will be fixed after version 3.94.
2285 (properties `((lint-hidden-cve . ("CVE-2017-16869"))))
5735256d
PN
2286 (synopsis "Compression tool for executables")
2287 (description
2288 "The Ultimate Packer for eXecutables (UPX) is an executable file
2289compressor. UPX typically reduces the file size of programs and shared
2290libraries by around 50%--70%, thus reducing disk space, network load times,
2291download times, and other distribution and storage costs.")
2292 (license license:gpl2+)))