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