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