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