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