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