gnu: wayland: Improve fix-graphviz phase.
[jackhill/guix/guix.git] / gnu / packages / compression.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
b2859a4f 2;;; Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
b357faac 3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
0a5c3087 4;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
27f76fe6 5;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
69d9792a 6;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
669b7b83 7;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
b496bfea 8;;; Copyright © 2015, 2017 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>
36df995c 13;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
e4c2136d 14;;; Copyright © 2016 David Craven <david@craven.ch>
adbd7faf 15;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
618089f9 16;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
1ae60db8 17;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
9e6ada8f 18;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
06de4aaf 19;;; Copyright © 2017 Theodoros Foradis <theodoros.for@openmailbox.org>
a268f085 20;;;
233e7676 21;;; This file is part of GNU Guix.
a268f085 22;;;
233e7676 23;;; GNU Guix is free software; you can redistribute it and/or modify it
a268f085
LC
24;;; under the terms of the GNU General Public License as published by
25;;; the Free Software Foundation; either version 3 of the License, or (at
26;;; your option) any later version.
27;;;
233e7676 28;;; GNU Guix is distributed in the hope that it will be useful, but
a268f085
LC
29;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31;;; GNU General Public License for more details.
32;;;
33;;; You should have received a copy of the GNU General Public License
233e7676 34;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
a268f085 35
1ffa7090 36(define-module (gnu packages compression)
b5b73a82 37 #:use-module ((guix licenses) #:prefix license:)
21b2ec4d 38 #:use-module (guix utils)
a268f085 39 #:use-module (guix packages)
87f5d366 40 #:use-module (guix download)
646898b3 41 #:use-module (guix git-download)
9e6ada8f 42 #:use-module (guix build-system cmake)
b357faac 43 #:use-module (guix build-system gnu)
73f542c3 44 #:use-module (guix build-system perl)
1ae60db8 45 #:use-module (guix build-system python)
e99dd67a 46 #:use-module (gnu packages)
389eb3fa 47 #:use-module (gnu packages assembly)
69d9792a 48 #:use-module (gnu packages autotools)
23f3cbb8 49 #:use-module (gnu packages backup)
73f542c3 50 #:use-module (gnu packages base)
0f03c531 51 #:use-module (gnu packages check)
9e6ada8f 52 #:use-module (gnu packages curl)
646898b3 53 #:use-module (gnu packages perl)
23f3cbb8 54 #:use-module (gnu packages pkg-config)
1ae60db8 55 #:use-module (gnu packages python)
9e6ada8f 56 #:use-module (gnu packages tls)
82aa2a28 57 #:use-module (gnu packages valgrind)
36df995c 58 #:use-module (ice-9 match)
646898b3 59 #:use-module ((srfi srfi-1) #:select (last)))
a268f085 60
6a92093d
LC
61(define-public zlib
62 (package
63 (name "zlib")
2b8bea03 64 (version "1.2.11")
6a92093d
LC
65 (source
66 (origin
87f5d366 67 (method url-fetch)
a67f97fe
CR
68 (uri (list (string-append "http://zlib.net/zlib-"
69 version ".tar.gz")
b2859a4f
LC
70 (string-append "mirror://sourceforge/libpng/zlib/"
71 version "/zlib-" version ".tar.gz")))
6a92093d
LC
72 (sha256
73 (base32
2b8bea03 74 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
6a92093d
LC
75 (build-system gnu-build-system)
76 (arguments
6cd00453
EF
77 `(#:phases
78 (modify-phases %standard-phases
79 (replace 'configure
80 (lambda* (#:key outputs #:allow-other-keys)
81 ;; Zlib's home-made `configure' fails when passed
82 ;; extra flags like `--enable-fast-install', so we need to
83 ;; invoke it with just what it understand.
84 (let ((out (assoc-ref outputs "out")))
85 ;; 'configure' doesn't understand '--host'.
86 ,@(if (%current-target-system)
87 `((setenv "CHOST" ,(%current-target-system)))
88 '())
89 (zero?
90 (system* "./configure"
91 (string-append "--prefix=" out)))))))))
6a92093d 92 (home-page "http://zlib.net/")
35b9e423 93 (synopsis "Compression library")
6a92093d
LC
94 (description
95 "zlib is designed to be a free, general-purpose, legally unencumbered --
96that is, not covered by any patents -- lossless data-compression library for
97use on virtually any computer hardware and operating system. The zlib data
35b9e423 98format is itself portable across platforms. Unlike the LZW compression method
6a92093d
LC
99used in Unix compress(1) and in the GIF image format, the compression method
100currently used in zlib essentially never expands the data. (LZW can double or
101triple the file size in extreme cases.) zlib's memory footprint is also
102independent of the input data and can be reduced, if necessary, at some cost
103in compression.")
4a44e743 104 (license license:zlib)))
6a92093d 105
8298df96
MB
106(define-public minizip
107 (package
108 (name "minizip")
109 (version (package-version zlib))
110 (source (package-source zlib))
111 (build-system gnu-build-system)
112 (arguments
113 `(#:phases
114 (modify-phases %standard-phases
115 (add-after 'unpack 'enter-source
116 (lambda _ (chdir "contrib/minizip") #t))
117 (add-before 'configure 'autoreconf
118 (lambda _
119 (zero? (system* "autoreconf" "-vif")))))))
120 (native-inputs
121 `(("autoconf" ,autoconf)
122 ("automake" ,automake)
123 ("libtool" ,libtool)))
124 (propagated-inputs `(("zlib" ,zlib)))
125 (home-page (package-home-page zlib))
126 (synopsis "Zip Compression library")
127 (description
128 "Minizip is a minimalistic library that supports compressing,
129extracting and viewing ZIP archives. This version is extracted from
130the @code{zlib} source.")
131 (license (package-license zlib))))
132
ee97be9f
RW
133(define-public fastjar
134 (package
135 (name "fastjar")
136 (version "0.98")
137 (source (origin
138 (method url-fetch)
139 (uri (string-append "mirror://savannah/fastjar/fastjar-"
140 version ".tar.gz"))
141 (sha256
142 (base32
143 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
144 (build-system gnu-build-system)
145 (inputs `(("zlib" ,zlib)))
146 (home-page "http://savannah.nongnu.org/projects/fastjar")
147 (synopsis "Replacement for Sun's 'jar' utility")
148 (description
149 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
150utility. Instead of being written in Java, FastJar is written in C.")
151 (license license:gpl2+)))
152
58593975
RW
153(define-public libtar
154 (package
155 (name "libtar")
89d80159 156 (version "1.2.20")
58593975
RW
157 (source (origin
158 (method url-fetch)
89d80159
EF
159 (uri (list
160 (string-append
161 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
162 version ".tar.gz")
163 (string-append
164 "mirror://debian/pool/main/libt/libtar/libtar_"
165 version ".orig.tar.gz")))
58593975
RW
166 (sha256
167 (base32
e99dd67a
EF
168 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
169 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
58593975 170 (build-system gnu-build-system)
89d80159
EF
171 (arguments
172 `(#:tests? #f ;no "check" target
173 #:phases
174 (modify-phases %standard-phases
175 (add-after 'unpack 'autoconf
176 (lambda _ (zero? (system* "sh" "autoreconf" "-vfi")))))))
177 (native-inputs
178 `(("autoconf" ,autoconf)
179 ("automake" ,automake)
180 ("libtool" ,libtool)))
181 (inputs
182 `(("zlib" ,zlib)))
58593975
RW
183 (synopsis "C library for manipulating POSIX tar files")
184 (description
185 "libtar is a C library for manipulating POSIX tar files. It handles
186adding and extracting files to/from a tar archive.")
89d80159 187 (home-page "https://repo.or.cz/libtar.git")
58593975
RW
188 (license license:bsd-3)))
189
a268f085
LC
190(define-public gzip
191 (package
192 (name "gzip")
0bfb9b43 193 (version "1.8")
a268f085 194 (source (origin
87f5d366 195 (method url-fetch)
0db342a5 196 (uri (string-append "mirror://gnu/gzip/gzip-"
28181faf 197 version ".tar.xz"))
a268f085
LC
198 (sha256
199 (base32
0bfb9b43 200 "1lxv3p4iyx7833mlihkn5wfwmz4cys5nybwpz3dfawag8kn6f5zz"))))
a268f085 201 (build-system gnu-build-system)
f50d2669 202 (synopsis "General file (de)compression (using lzw)")
a268f085
LC
203 (arguments
204 ;; FIXME: The test suite wants `less', and optionally Perl.
205 '(#:tests? #f))
206 (description
79c311b8
LC
207 "GNU Gzip provides data compression and decompression utilities; the
208typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
209file; as a result, it is often used in conjunction with \"tar\", resulting in
210\".tar.gz\" or \".tgz\", etc.")
4a44e743 211 (license license:gpl3+)
6fd52309 212 (home-page "https://www.gnu.org/software/gzip/")))
a268f085
LC
213
214(define-public bzip2
9b1bf330 215 (let ((build-shared-lib
a268f085
LC
216 ;; Build a shared library.
217 '(lambda* (#:key inputs #:allow-other-keys)
f678f6d9 218 (patch-makefile-SHELL "Makefile-libbz2_so")
a268f085
LC
219 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
220 (install-shared-lib
221 '(lambda* (#:key outputs #:allow-other-keys)
222 (let* ((out (assoc-ref outputs "out"))
223 (libdir (string-append out "/lib")))
224 (for-each (lambda (file)
225 (let ((base (basename file)))
226 (format #t "installing `~a' to `~a'~%"
227 base libdir)
228 (copy-file file
229 (string-append libdir "/" base))))
ab4fab19
LC
230 (find-files "." "^libbz2\\.so")))))
231 (set-cross-environment
232 '(lambda* (#:key target #:allow-other-keys)
233 (substitute* (find-files "." "Makefile")
234 (("CC=.*$")
235 (string-append "CC = " target "-gcc\n"))
236 (("AR=.*$")
237 (string-append "AR = " target "-ar\n"))
238 (("RANLIB=.*$")
239 (string-append "RANLIB = " target "-ranlib\n"))
240 (("^all:(.*)test" _ prerequisites)
241 ;; Remove 'all' -> 'test' dependency.
242 (string-append "all:" prerequisites "\n"))))))
a268f085
LC
243 (package
244 (name "bzip2")
245 (version "1.0.6")
246 (source (origin
87f5d366 247 (method url-fetch)
a268f085
LC
248 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
249 version ".tar.gz"))
250 (sha256
251 (base32
252 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
253 (build-system gnu-build-system)
254 (arguments
255 `(#:modules ((guix build gnu-build-system)
256 (guix build utils)
257 (srfi srfi-1))
258 #:phases
ab4fab19
LC
259 ,(if (%current-target-system)
260
261 ;; Cross-compilation: use the cross tools.
262 `(alist-cons-before
263 'build 'build-shared-lib ,build-shared-lib
264 (alist-cons-after
9b1bf330
LC
265 'install 'install-shared-lib ,install-shared-lib
266 (alist-replace 'configure ,set-cross-environment
267 %standard-phases)))
ab4fab19
LC
268
269 ;; Native compilation: build the shared library.
270 `(alist-cons-before
271 'build 'build-shared-lib ,build-shared-lib
272 (alist-cons-after
9b1bf330
LC
273 'install 'install-shared-lib ,install-shared-lib
274 (alist-delete 'configure %standard-phases))))
ab4fab19 275
a268f085 276 #:make-flags (list (string-append "PREFIX="
ab4fab19
LC
277 (assoc-ref %outputs "out")))
278
279 ;; Don't attempt to run the tests when cross-compiling.
280 ,@(if (%current-target-system)
281 '(#:tests? #f)
282 '())))
35b9e423 283 (synopsis "High-quality data compression program")
a268f085
LC
284 (description
285 "bzip2 is a freely available, patent free (see below), high-quality data
286compressor. It typically compresses files to within 10% to 15% of the best
287available techniques (the PPM family of statistical compressors), whilst
288being around twice as fast at compression and six times faster at
289decompression.")
166191b3 290 (license (license:non-copyleft "file://LICENSE"
4a44e743 291 "See LICENSE in the distribution."))
a268f085
LC
292 (home-page "http://www.bzip.org/"))))
293
669b7b83
RW
294(define-public lbzip2
295 (package
296 (name "lbzip2")
297 (version "2.5")
298 (source (origin
299 (method url-fetch)
300 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
301 version ".tar.gz"))
302 (sha256
303 (base32
304 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))))
305 (build-system gnu-build-system)
306 (synopsis "Parallel bzip2 compression utility")
307 (description
308 "lbzip2 is a multi-threaded compression utility with support for the
309bzip2 compressed file format. lbzip2 can process standard bz2 files in
310parallel. It uses POSIX threading model (pthreads), which allows it to take
311full advantage of symmetric multiprocessing (SMP) systems. It has been proven
312to scale linearly, even to over one hundred processor cores. lbzip2 is fully
313compatible with bzip2 – both at file format and command line level.")
314 (home-page "http://www.lbzip2.org/")
315 (license license:gpl3+)))
316
5d47eab0
EF
317(define-public pbzip2
318 (package
319 (name "pbzip2")
320 (version "1.1.12")
321 (source (origin
322 (method url-fetch)
21b2ec4d
EF
323 (uri (string-append "https://launchpad.net/pbzip2/"
324 (version-major+minor version) "/" version
325 "/+download/" name "-" version ".tar.gz"))
5d47eab0
EF
326 (sha256
327 (base32
328 "1vk6065dv3a47p86vmp8hv3n1ygd9hraz0gq89gvzlx7lmcb6fsp"))))
329 (build-system gnu-build-system)
330 (inputs
b3546174 331 `(("bzip2" ,bzip2)))
5d47eab0
EF
332 (arguments
333 `(#:tests? #f ; no tests
334 #:phases (modify-phases %standard-phases
21b2ec4d
EF
335 (delete 'configure))
336 #:make-flags (list (string-append "PREFIX=" %output))))
5d47eab0
EF
337 (home-page "http://compression.ca/pbzip2/")
338 (synopsis "Parallel bzip2 implementation")
339 (description
340 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
341compressor that uses pthreads and achieves near-linear speedup on SMP machines.
21b2ec4d 342The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
5d47eab0
EF
343compressed with pbzip2 can be decompressed with bzip2).")
344 (license (license:non-copyleft "file://COPYING"
21b2ec4d 345 "See COPYING in the distribution."))))
5d47eab0 346
a268f085
LC
347(define-public xz
348 (package
349 (name "xz")
4655f515 350 (version "5.2.2")
a268f085 351 (source (origin
87f5d366 352 (method url-fetch)
52d76b64
LC
353 (uri (list (string-append "http://tukaani.org/xz/xz-" version
354 ".tar.gz")
355 (string-append "http://multiprecision.org/guix/xz-"
356 version ".tar.gz")))
a268f085
LC
357 (sha256
358 (base32
4655f515 359 "18h2k4jndhzjs8ln3a54qdnfv59y6spxiwh9gpaqniph6iflvpvk"))))
a268f085 360 (build-system gnu-build-system)
35b9e423 361 (synopsis "General-purpose data compression")
a268f085
LC
362 (description
363 "XZ Utils is free general-purpose data compression software with high
364compression ratio. XZ Utils were written for POSIX-like systems, but also
365work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
366
367The core of the XZ Utils compression code is based on LZMA SDK, but it has
368been modified quite a lot to be suitable for XZ Utils. The primary
369compression algorithm is currently LZMA2, which is used inside the .xz
370container format. With typical files, XZ Utils create 30 % smaller output
371than gzip and 15 % smaller output than bzip2.")
38bbd61d 372 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
a268f085 373 (home-page "http://tukaani.org/xz/")))
c6eac761
LC
374
375(define-public lzo
376 (package
377 (name "lzo")
c0ec516d 378 (version "2.09")
c6eac761
LC
379 (source
380 (origin
381 (method url-fetch)
382 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
383 version ".tar.gz"))
384 (sha256
385 (base32
c0ec516d 386 "0k5kpj3jnsjfxqqkblpfpx0mqcy86zs5fhjhgh2kq1hksg7ag57j"))))
c6eac761 387 (build-system gnu-build-system)
165fd9d5 388 (arguments '(#:configure-flags '("--enable-shared")))
c6eac761
LC
389 (home-page "http://www.oberhumer.com/opensource/lzo")
390 (synopsis
e881752c 391 "Data compression library suitable for real-time data de-/compression")
c6eac761
LC
392 (description
393 "LZO is a data compression library which is suitable for data
394de-/compression in real-time. This means it favours speed over
395compression ratio.
396
397LZO is written in ANSI C. Both the source code and the compressed data
398format are designed to be portable across platforms.")
4a44e743 399 (license license:gpl2+)))
0f323dad 400
1a0a5509 401(define-public python-lzo
402 (package
403 (name "python-lzo")
404 (version "1.11")
405 (source
406 (origin
407 (method url-fetch)
408 (uri (pypi-uri "python-lzo" version))
409 (sha256
410 (base32
411 "11p3ifg14p086byhhin6azx5svlkg8dzw2b5abixik97xd6fm81q"))))
412 (build-system python-build-system)
413 (arguments
414 `(#:test-target "check"
415 #:phases
416 (modify-phases %standard-phases
417 (add-after 'unpack 'patch-setuppy
418 (lambda _
419 (substitute* "setup.py"
420 (("include_dirs.append\\(.*\\)")
421 (string-append "include_dirs.append('"
422 (assoc-ref %build-inputs "lzo")
423 "/include/lzo"
424 "')")))
425 #t)))))
426 (inputs
427 `(("lzo" ,lzo)))
428 (home-page "https://github.com/jd-boyd/python-lzo")
429 (synopsis "Python bindings for the LZO data compression library")
430 (description
431 "Python-LZO provides Python bindings for LZO, i.e. you can access
432the LZO library from your Python scripts thereby compressing ordinary
433Python strings.")
434 (license license:gpl2+)))
435
436(define-public python2-lzo
437 (package-with-python2 python-lzo))
438
a9f48ff0
EB
439(define-public lzop
440 (package
441 (name "lzop")
442 (version "1.03")
443 (source
444 (origin
445 (method url-fetch)
446 (uri (string-append "http://www.lzop.org/download/lzop-"
447 version ".tar.gz"))
448 (sha256
449 (base32
450 "1jdjvc4yjndf7ihmlcsyln2rbnbaxa86q4jskmkmm7ylfy65nhn1"))))
451 (build-system gnu-build-system)
452 (inputs `(("lzo" ,lzo)))
453 (home-page "http://www.lzop.org/")
454 (synopsis "Compress or expand files")
455 (description
456 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
457LZO data compression library for compression services, and its main advantages
458over gzip are much higher compression and decompression speed (at the cost of
459some compression ratio).")
460 (license license:gpl2+)))
461
0f323dad
LC
462(define-public lzip
463 (package
464 (name "lzip")
275a7711 465 (version "1.16")
0f323dad
LC
466 (source (origin
467 (method url-fetch)
468 (uri (string-append "mirror://savannah/lzip/lzip-"
469 version ".tar.gz"))
470 (sha256
471 (base32
275a7711 472 "0l9724rw1l3hg2ldr3n7ihqich4m9nc6y7l302bvdj4jmxdw530j"))))
0f323dad
LC
473 (build-system gnu-build-system)
474 (home-page "http://www.nongnu.org/lzip/lzip.html")
475 (synopsis "Lossless data compressor based on the LZMA algorithm")
476 (description
477 "Lzip is a lossless data compressor with a user interface similar to the
478one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
479more than bzip2, which makes it well suited for software distribution and data
480archiving. Lzip is a clean implementation of the LZMA algorithm.")
481 (license license:gpl3+)))
b357faac
AE
482
483(define-public sharutils
484 (package
485 (name "sharutils")
9a59ce24 486 (version "4.15.2")
b357faac
AE
487 (source
488 (origin
489 (method url-fetch)
490 (uri (string-append "mirror://gnu/sharutils/sharutils-"
491 version ".tar.xz"))
492 (sha256
493 (base32
9a59ce24 494 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))))
b357faac
AE
495 (build-system gnu-build-system)
496 (inputs
497 `(("which" ,which)))
498 (arguments
499 `(#:phases
500 (alist-cons-after
501 'patch-source-shebangs 'unpatch-source-shebang
502 ;; revert the patch-shebang phase on a script which is
503 ;; in fact test data
d4bf49b1 504 (lambda _
b357faac
AE
505 (substitute* "tests/shar-1.ok"
506 (((which "sh")) "/bin/sh")))
507 %standard-phases)))
6fd52309 508 (home-page "https://www.gnu.org/software/sharutils/")
b357faac
AE
509 (synopsis "Archives in shell scripts, uuencode/uudecode")
510 (description
79c311b8
LC
511 "GNU sharutils is a package for creating and manipulating shell
512archives that can be readily emailed. A shell archive is a file that can be
e881752c 513processed by a Bourne-type shell to unpack the original collection of files.
79c311b8 514This package is mostly for compatibility and historical interest.")
b357faac 515 (license license:gpl3+)))
28469ab0 516
646898b3
RW
517(define-public sfarklib
518 (package
519 (name "sfarklib")
979f9e8a 520 (version "2.24")
646898b3 521 (source (origin
979f9e8a
RW
522 (method url-fetch)
523 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
524 version ".tar.gz"))
525 (file-name (string-append name "-" version ".tar.gz"))
646898b3
RW
526 (sha256
527 (base32
979f9e8a 528 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
646898b3
RW
529 (build-system gnu-build-system)
530 (arguments
531 `(#:tests? #f ;no "check" target
532 #:phases
533 (modify-phases %standard-phases
534 (replace 'configure
535 (lambda* (#:key outputs #:allow-other-keys)
536 (substitute* "Makefile"
537 (("/usr/local") (assoc-ref outputs "out")))
538 #t)))))
539 (inputs
540 `(("zlib" ,zlib)))
541 (home-page "https://github.com/raboof/sfArkLib")
542 (synopsis "Library for SoundFont decompression")
543 (description
544 "SfArkLib is a C++ library for decompressing SoundFont files compressed
545with the sfArk algorithm.")
546 (license license:gpl3+)))
547
b5ad1659 548(define-public sfarkxtc
698bd297 549 (let ((commit "b5e0a2ba3921f019d74d4b92bd31c36dd19d2cf1"))
b5ad1659
RW
550 (package
551 (name "sfarkxtc")
698bd297 552 (version (string-take commit 10))
b5ad1659
RW
553 (source (origin
554 ;; There are no release tarballs, so we just fetch the latest
555 ;; commit at this time.
556 (method git-fetch)
557 (uri (git-reference
558 (url "https://github.com/raboof/sfarkxtc.git")
698bd297 559 (commit commit)))
b5ad1659
RW
560 (sha256
561 (base32
562 "0f5x6i46qfl6ry21s7g2p4sd4b2r1g4fb03yqi2vv4kq3saryhvj"))))
563 (build-system gnu-build-system)
564 (arguments
565 `(#:tests? #f ;no "check" target
566 #:phases
567 (modify-phases %standard-phases
568 (replace 'configure
569 (lambda* (#:key outputs #:allow-other-keys)
570 (substitute* "Makefile"
571 (("/usr/local") (assoc-ref outputs "out")))
572 #t)))))
573 (inputs
574 `(("zlib" ,zlib)
575 ("sfarklib" ,sfarklib)))
576 (home-page "https://github.com/raboof/sfarkxtc")
577 (synopsis "Basic sfArk decompressor")
578 (description "SfArk extractor converts SoundFonts in the compressed legacy
579sfArk file format to the uncompressed sf2 format.")
698bd297 580 (license license:gpl3+))))
b5ad1659 581
27f76fe6
TUBK
582(define-public libmspack
583 (package
584 (name "libmspack")
585 (version "0.5")
586 (source
587 (origin
588 (method url-fetch)
589 (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
590 version "alpha.tar.gz"))
591 (sha256
592 (base32 "04413hynb7zizxnkgy9riik3612dwirkpr6fcjrnfl2za9sz4rw9"))))
593 (build-system gnu-build-system)
594 (home-page "http://www.cabextract.org.uk/libmspack/")
595 (synopsis "Compression tools for some formats used by Microsoft")
596 (description
597 "The purpose of libmspack is to provide both compression and
598decompression of some loosely related file formats used by Microsoft.")
599 (license license:lgpl2.1+)))
73f542c3
EB
600
601(define-public perl-compress-raw-bzip2
602 (package
603 (name "perl-compress-raw-bzip2")
c0b7b797 604 (version "2.074")
73f542c3
EB
605 (source
606 (origin
607 (method url-fetch)
608 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
609 "Compress-Raw-Bzip2-" version ".tar.gz"))
610 (sha256
611 (base32
c0b7b797 612 "0b5jwqf15zr787acnx8sfyy2zavdd7gfkd98n1dgy8fs6r8yb8a4"))))
73f542c3
EB
613 (build-system perl-build-system)
614 ;; TODO: Use our bzip2 package.
615 (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
616 (synopsis "Low-level interface to bzip2 compression library")
617 (description "This module provides a Perl interface to the bzip2
618compression library.")
2f3108ad 619 (license license:perl-license)))
8e18514a
EB
620
621(define-public perl-compress-raw-zlib
622 (package
623 (name "perl-compress-raw-zlib")
02b067d7 624 (version "2.074")
8e18514a
EB
625 (source
626 (origin
627 (method url-fetch)
628 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
629 "Compress-Raw-Zlib-" version ".tar.gz"))
630 (sha256
631 (base32
02b067d7 632 "08bpx9v6i40n54rdcj6invlj294z20amrl8wvwf9b83aldwdwsd3"))))
8e18514a
EB
633 (build-system perl-build-system)
634 (inputs
635 `(("zlib" ,zlib)))
636 (arguments
637 `(#:phases (modify-phases %standard-phases
638 (add-before
40b084a3 639 'configure 'configure-zlib
8e18514a
EB
640 (lambda* (#:key inputs #:allow-other-keys)
641 (call-with-output-file "config.in"
642 (lambda (port)
643 (format port "
644BUILD_ZLIB = False
645INCLUDE = ~a/include
646LIB = ~:*~a/lib
647OLD_ZLIB = False
648GZIP_OS_CODE = AUTO_DETECT"
649 (assoc-ref inputs "zlib")))))))))
650 (home-page "http://search.cpan.org/dist/Compress-Raw-Zlib")
651 (synopsis "Low-level interface to zlib compression library")
652 (description "This module provides a Perl interface to the zlib
653compression library.")
2f3108ad 654 (license license:perl-license)))
8aaafd34
EB
655
656(define-public perl-io-compress
657 (package
658 (name "perl-io-compress")
c70b50ef 659 (version "2.074")
8aaafd34
EB
660 (source
661 (origin
662 (method url-fetch)
663 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
664 "IO-Compress-" version ".tar.gz"))
665 (sha256
666 (base32
c70b50ef 667 "1wlpy2026djfmq0bjync531yq6s695jf7bcnpvjphrasi776igdl"))))
8aaafd34
EB
668 (build-system perl-build-system)
669 (propagated-inputs
c70b50ef
EF
670 `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib) ; >=2.074
671 ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.074
8aaafd34
EB
672 (home-page "http://search.cpan.org/dist/IO-Compress")
673 (synopsis "IO Interface to compressed files/buffers")
674 (description "IO-Compress provides a Perl interface to allow reading and
675writing of compressed data created with the zlib and bzip2 libraries.")
2f3108ad 676 (license license:perl-license)))
82aa2a28
LF
677
678(define-public lz4
679 (package
680 (name "lz4")
b496bfea 681 (version "1.7.5")
82aa2a28
LF
682 (source
683 (origin
684 (method url-fetch)
b496bfea 685 (uri (string-append "https://github.com/lz4/lz4/archive/"
fc89cb69 686 "v" version ".tar.gz"))
b496bfea 687 (patches (search-patches "lz4-fix-test-failures.patch"))
82aa2a28 688 (sha256
b496bfea
LF
689 (base32
690 "0zkykqqjfa1q3ji0qmb1ml3l9063qqfh99agyj3cnb02cg6wm401"))
82aa2a28
LF
691 (file-name (string-append name "-" version ".tar.gz"))))
692 (build-system gnu-build-system)
fc89cb69 693 (native-inputs `(("valgrind" ,valgrind))) ; for tests
82aa2a28
LF
694 (arguments
695 `(#:test-target "test"
696 #:parallel-tests? #f ; tests fail if run in parallel
697 #:make-flags (list "CC=gcc"
698 (string-append "PREFIX=" (assoc-ref %outputs "out")))
699 #:phases (modify-phases %standard-phases
fc89cb69 700 (delete 'configure)))) ; no configure script
b496bfea 701 (home-page "https://github.com/lz4/lz4")
82aa2a28
LF
702 (synopsis "Compression algorithm focused on speed")
703 (description "LZ4 is a lossless compression algorithm, providing
704compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
705extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
706A high compression derivative, called LZ4_HC, is also provided. It trades CPU
707time for compression ratio.")
708 ;; The libraries (lz4, lz4hc, and xxhash are BSD licenced. The command
709 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
710 (license (list license:bsd-2 license:gpl2+))))
dd8d6d65 711
1ae60db8 712(define-public python-lz4
713 (package
714 (name "python-lz4")
715 (version "0.8.2")
716 (source
717 (origin
718 (method url-fetch)
719 (uri (pypi-uri "lz4" version))
720 (sha256
721 (base32
722 "1irad4sq4hdr30fr53smvv3zzk4rddcf9b4jx19w8s9xsxhr1x3b"))))
723 (build-system python-build-system)
724 (native-inputs
725 `(("python-nose" ,python-nose)))
726 (home-page "https://github.com/python-lz4/python-lz4")
727 (synopsis "LZ4 Bindings for Python")
728 (description
729 "This package provides python bindings for the lz4 compression library
730by Yann Collet. The project contains bindings for the LZ4 block format and
731the LZ4 frame format.")
732 (license license:bsd-3)))
733
734(define-public python2-lz4
735 (package-with-python2 python-lz4))
736
dd8d6d65
SB
737(define-public squashfs-tools
738 (package
739 (name "squashfs-tools")
740 (version "4.3")
741 (source (origin
742 (method url-fetch)
de67e922
LF
743 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
744 "squashfs" version "/"
dd8d6d65
SB
745 "squashfs" version ".tar.gz"))
746 (sha256
747 (base32
748 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
749 (build-system gnu-build-system)
750 (arguments
751 '(#:tests? #f ; no check target
752 #:make-flags
753 (list "CC=gcc"
754 "XZ_SUPPORT=1"
755 "LZO_SUPPORT=1"
756 "LZ4_SUPPORT=1"
757 (string-append "INSTALL_DIR=" %output "/bin"))
758 #:phases
759 (modify-phases %standard-phases
760 (replace 'configure
761 (lambda _
762 (chdir "squashfs-tools"))))))
763 (inputs
764 `(("lz4" ,lz4)
765 ("lzo" ,lzo)
766 ("xz" ,xz)
767 ("zlib" ,zlib)))
768 (home-page "http://squashfs.sourceforge.net/")
8f65585b 769 (synopsis "Tools to create and extract squashfs file systems")
dd8d6d65 770 (description
8f65585b 771 "Squashfs is a highly compressed read-only file system for Linux. It uses
dd8d6d65
SB
772zlib to compress files, inodes, and directories. All blocks are packed to
773minimize the data overhead, and block sizes of between 4K and 1M are supported.
774It is intended to be used for archival use, for live CDs, and for embedded
775systems where low overhead is needed. This package allows you to create and
8f65585b 776extract such file systems.")
dd8d6d65 777 (license license:gpl2+)))
820dc3f5
JM
778
779(define-public pigz
780 (package
781 (name "pigz")
782 (version "2.3.3")
783 (source (origin
784 (method url-fetch)
785 (uri (string-append "http://zlib.net/pigz/"
786 name "-" version ".tar.gz"))
787 (sha256
788 (base32
789 "172hdf26k4zmm7z8md7nl0dph2a7mhf3x7slb9bhfyff6as6g2sf"))))
790 (build-system gnu-build-system)
791 (arguments
792 `(#:phases
793 (modify-phases %standard-phases
794 (delete 'configure)
795 (replace 'install
796 (lambda* (#:key outputs #:allow-other-keys)
797 (let* ((out (assoc-ref outputs "out"))
798 (bin (string-append out "/bin"))
799 (man (string-append out "/share/man/man1")))
800 (install-file "pigz" bin)
801 (symlink "pigz" (string-append bin "/unpigz"))
802 (install-file "pigz.1" man)
803 #t))))
804 #:make-flags (list "CC=gcc")
805 #:test-target "tests"))
806 (inputs `(("zlib" ,zlib)))
807 (home-page "http://zlib.net/pigz/")
808 (synopsis "Parallel implementation of gzip")
809 (description
810 "This package provides a parallel implementation of gzip that exploits
811multiple processors and multiple cores when compressing data.")
812
813 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
814 ;; written by Mark Adler, are under another non-copyleft license.
815 (license license:asl2.0)))
23f3cbb8
BW
816
817(define-public pixz
818 (package
819 (name "pixz")
820 (version "1.0.6")
821 (source (origin
822 (method url-fetch)
823 (uri (string-append
824 "https://github.com/vasi/pixz/releases/download/v" version
825 "/pixz-" version ".tar.xz"))
826 (sha256
827 (base32
828 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
829 (build-system gnu-build-system)
830 (native-inputs
831 `(("pkg-config" ,pkg-config)
832 ("libarchive" ,libarchive)))
833 (home-page "https://github.com/vasi/pixz")
834 (synopsis "Parallel indexing implementation of LZMA")
835 (description
836 "The existing XZ Utils provide great compression in the .xz file format,
837but they produce just one big block of compressed data. Pixz instead produces
838a collection of smaller blocks which makes random access to the original data
839possible and can compress in parallel. This is especially useful for large
840tarballs.")
841 (license license:bsd-2)))
69d9792a
EB
842
843(define-public brotli
844 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
845 (revision "1"))
846 (package
847 (name "brotli")
848 (version (string-append "0.1-" revision "."
849 (string-take commit 7)))
850 (source (origin
851 (method git-fetch)
852 (uri (git-reference
853 (url "https://github.com/bagder/libbrotli.git")
854 (commit commit)
855 (recursive? #t)))
856 (file-name (string-append name "-" version ".tar.xz"))
857 (sha256
858 (base32
859 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
860 (modules '((guix build utils)))
861 (snippet
862 ;; This is a recursive submodule that is unnecessary for this
863 ;; package, so delete it.
864 '(delete-file-recursively "brotli/terryfy"))))
865 (build-system gnu-build-system)
866 (native-inputs
867 `(("autoconf" ,autoconf)
868 ("automake" ,automake)
869 ("libtool" ,libtool)))
870 (arguments
871 `(#:phases (modify-phases %standard-phases
872 (add-after 'unpack 'autogen
873 (lambda _
874 (mkdir "m4")
875 (zero? (system* "autoreconf" "-vfi")))))))
876 (home-page "https://github.com/bagder/libbrotli/")
877 (synopsis "Implementation of the Brotli compression algorithm")
878 (description
879 "Brotli is a general-purpose lossless compression algorithm. It is
880similar in speed to deflate but offers denser compression. This package
881provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
882respectively, based on the reference implementation from Google.")
883 (license license:expat))))
3fd4b90d
DM
884
885(define-public cabextract
886 (package
887 (name "cabextract")
888 (version "1.6")
889 (source (origin
890 (method url-fetch)
891 (uri (string-append
892 "http://cabextract.org.uk/cabextract-" version ".tar.gz"))
893 (sha256
894 (base32
895 "1ysmmz25fjghq7mxb2anyyvr1ljxqxzi4piwjhk0sdamcnsn3rnf"))))
896 (build-system gnu-build-system)
897 (arguments '(#:configure-flags '("--with-external-libmspack")))
898 (native-inputs
899 `(("pkg-config" ,pkg-config)))
900 (inputs
901 `(("libmspack" ,libmspack)))
902 (home-page "http://www.cabextract.org.uk/")
903 (synopsis "Tool to unpack Cabinet archives")
904 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
905 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
906 (license license:gpl3+)))
0b073506
TGR
907
908(define-public xdelta
909 (package
910 (name "xdelta")
911 (version "3.1.0")
912 (source
913 (origin
914 (method url-fetch)
915 (uri (string-append "https://github.com/jmacd/xdelta/archive/v"
916 version ".tar.gz"))
917 (sha256
918 (base32
919 "17g2pbbqy6h20qgdjq7ykib7kg5ajh8fwbsfgyjqg8pwg19wy5bm"))
920 (file-name (string-append name "-" version ".tar.gz"))
921 (snippet
922 ;; This file isn't freely distributable and has no effect on building.
923 '(delete-file "xdelta3/draft-korn-vcdiff.txt"))))
924 (build-system gnu-build-system)
925 (native-inputs
926 `(("autoconf" ,autoconf)
927 ("automake" ,automake)))
928 (arguments
929 `(#:phases
930 (modify-phases %standard-phases
931 (add-after 'unpack 'enter-build-directory
932 (lambda _ (chdir "xdelta3")))
933 (add-before 'configure 'autoconf
934 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
935 (home-page "http://xdelta.com")
936 (synopsis "Delta encoder for binary files")
937 (description "xdelta encodes only the differences between two binary files
938using the VCDIFF algorithm and patch file format described in RFC 3284. It can
939also be used to apply such patches. xdelta is similar to @command{diff} and
940@command{patch}, but is not limited to plain text and does not generate
941human-readable output.")
942 (license license:asl2.0)))
389eb3fa
TGR
943
944(define-public lrzip
945 (package
946 (name "lrzip")
666619d0 947 (version "0.631")
389eb3fa
TGR
948 (source
949 (origin
950 (method url-fetch)
951 (uri (string-append
952 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
953 (sha256
954 (base32
666619d0 955 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))))
389eb3fa
TGR
956 (build-system gnu-build-system)
957 (native-inputs
958 `(;; nasm is only required when building for 32-bit x86 platforms
959 ,@(if (string-prefix? "i686" (or (%current-target-system)
960 (%current-system)))
961 `(("nasm" ,nasm))
962 '())
963 ("perl" ,perl)))
964 (inputs
965 `(("bzip2" ,bzip2)
966 ("lzo" ,lzo)
967 ("zlib" ,zlib)))
968 (home-page "http://ck.kolivas.org/apps/lrzip/")
969 (synopsis "Large file compressor with a very high compression ratio")
970 (description "lrzip is a compression utility that uses long-range
971redundancy reduction to improve the subsequent compression ratio of
972larger files. It can then further compress the result with the ZPAQ or
973LZMA algorithms for maximum compression, or LZO for maximum speed. This
974choice between size or speed allows for either better compression than
975even LZMA can provide, or a higher speed than gzip while compressing as
976well as bzip2.")
977 (license (list license:gpl3+
978 license:public-domain)))) ; most files in lzma/
e4c2136d
DC
979
980(define-public snappy
981 (package
982 (name "snappy")
ad31b4fe 983 (version "1.1.3")
e4c2136d
DC
984 (source (origin
985 (method url-fetch)
986 (uri (string-append
987 "https://github.com/google/snappy/releases/download/"
988 version "/" name "-" version ".tar.gz"))
989 (sha256
990 (base32
ad31b4fe 991 "1wzf8yif5ym2gj52db6v5m1pxnmn258i38x7llk9x346y2nq47ig"))))
e4c2136d
DC
992 (build-system gnu-build-system)
993 (home-page "https://github.com/google/snappy")
994 (synopsis "Fast compressor/decompressor")
995 (description "Snappy is a compression/decompression library. It does not
996aim for maximum compression, or compatibility with any other compression library;
997instead, it aims for very high speeds and reasonable compression. For instance,
998compared to the fastest mode of zlib, Snappy is an order of magnitude faster
999for most inputs, but the resulting compressed files are anywhere from 20% to
1000100% bigger.")
1001 (license license:asl2.0)))
adbd7faf
KK
1002
1003(define-public p7zip
1004 (package
1005 (name "p7zip")
1006 (version "16.02")
1007 (source (origin
1008 (method url-fetch)
1009 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1010 version "/" name "_" version
1011 "_src_all.tar.bz2"))
1012 (sha256
1013 (base32
1014 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1015 (modules '((guix build utils)))
1016 (snippet
1017 '(begin
1018 ;; Remove non-free source files
1019 (for-each delete-file
1020 (append
1021 (find-files "CPP/7zip/Compress" "Rar.*")
1022 (find-files "CPP/7zip/Crypto" "Rar.*")
1023 (find-files "DOC/unRarLicense.txt")
1024 (find-files "Utils/file_Codecs_Rar_so.py")))
1025 (delete-file-recursively "CPP/7zip/Archive/Rar")
1026 (delete-file-recursively "CPP/7zip/Compress/Rar")
1027 #t))
1ac675a5
EF
1028 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1029 "p7zip-remove-unused-code.patch"))))
adbd7faf
KK
1030 (build-system gnu-build-system)
1031 (arguments
1032 `(#:make-flags
1033 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1034 #:phases
1035 (modify-phases %standard-phases
1036 (replace 'configure
1037 (lambda* (#:key system outputs #:allow-other-keys)
1038 (zero? (system* "cp"
1039 (let ((system ,(or (%current-target-system)
1040 (%current-system))))
1041 (cond
1042 ((string-prefix? "x86_64" system)
1043 "makefile.linux_amd64_asm")
1044 ((string-prefix? "i686" system)
1045 "makefile.linux_x86_asm_gcc_4.X")
1046 (else
1047 "makefile.linux_any_cpu_gcc_4.X")))
1048 "makefile.machine"))))
1049 (replace 'check
1050 (lambda _
1051 (and (zero? (system* "make" "test"))
1052 (zero? (system* "make" "test_7z"))
1053 (zero? (system* "make" "test_7zr"))))))))
1054 (inputs
1055 (let ((system (or (%current-target-system)
1056 (%current-system))))
1057 `(,@(cond ((string-prefix? "x86_64" system)
1058 `(("yasm" ,yasm)))
1059 ((string-prefix? "i686" system)
1060 `(("nasm" ,nasm)))
1061 (else '())))))
1062 (home-page "http://p7zip.sourceforge.net/")
1063 (synopsis "Command-line file archiver with high compression ratio")
1064 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1065handles the 7z format which features very high compression ratios.")
1066 (license (list license:lgpl2.1+
1067 license:gpl2+
1068 license:public-domain))))
618089f9
MB
1069
1070(define-public gzstream
1071 (package
1072 (name "gzstream")
1073 (version "1.5")
1074 (source (origin
1075 (method url-fetch)
1076 (uri
1077 ;; No versioned URL, but last release was in 2003.
1078 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1079 (file-name (string-append name "-" version ".tgz"))
1080 (sha256
1081 (base32
1082 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1083 (modules '((guix build utils)))
1084 (snippet
1085 ;; Remove pre-compiled object.
1086 '(delete-file "gzstream.o"))))
1087 (build-system gnu-build-system)
1088 (arguments
1089 `(#:test-target "test"
1090 #:phases
1091 (modify-phases %standard-phases
1092 (delete 'configure)
1093 (replace 'install
1094 (lambda* (#:key outputs #:allow-other-keys)
1095 (let* ((out (assoc-ref outputs "out"))
1096 (lib (string-append out "/lib"))
1097 (include (string-append out "/include")))
1098 (install-file "libgzstream.a" lib)
1099 (install-file "gzstream.h" include)
1100 #t))))))
1101 (propagated-inputs `(("zlib" ,zlib)))
1102 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1103 (synopsis "Compressed C++ iostream")
1104 (description "gzstream is a small library for providing zlib
1105functionality in a C++ iostream.")
1106 (license license:lgpl2.1+)))
36df995c
TGR
1107
1108(define-public zpaq
1109 (package
1110 (name "zpaq")
1111 (version "7.15")
1112 (source
1113 (origin
1114 (method url-fetch/zipbomb)
1115 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1116 (string-delete #\. version) ".zip"))
1117 (sha256
1118 (base32
1119 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1120 (modules '((guix build utils)))
1121 (snippet
1122 ;; Delete irrelevant pre-compiled binaries.
1123 '(for-each delete-file (find-files "." "\\.exe$")))))
1124 (build-system gnu-build-system)
1125 (arguments
1126 `(#:phases
1127 (modify-phases %standard-phases
1128 (delete 'configure)) ; no ‘configure’ script
1129 #:make-flags
1130 (list
1131 (string-append "CPPFLAGS=-Dunix"
1132 ,(match (or (%current-target-system)
1133 (%current-system))
1134 ("x86_64-linux" "")
1135 ("i686-linux" "")
1136 (_ " -DNOJIT")))
1137 ;; These should be safe, lowest-common-denominator instruction sets,
1138 ;; allowing for some optimisation while remaining reproducible.
effd7198 1139 (string-append "CXXFLAGS=-O3 -DNDEBUG"
36df995c
TGR
1140 ,(match (or (%current-target-system)
1141 (%current-system))
effd7198
EF
1142 ("x86_64-linux" " -march=nocona -mtune=generic")
1143 ("i686-linux" " -march=i686 -mtune=generic")
1144 ("armhf-linux" " -mtune=generic-armv7-a")
36df995c
TGR
1145 (_ "")))
1146 (string-append "PREFIX="
1147 (assoc-ref %outputs "out")))))
1148 (native-inputs
1149 `(("perl" ,perl))) ; for pod2man
1150 (home-page "http://mattmahoney.net/dc/zpaq.html")
1151 (synopsis "Incremental journaling archiver")
1152 (description "ZPAQ is a command-line archiver for realistic situations with
1153many duplicate and already compressed files. It backs up only those files
1154modified since the last update. All previous versions remain untouched and can
1155be independently recovered. Identical files are only stored once (known as
1156@dfn{de-duplication}). Archives can also be encrypted.
1157
1158ZPAQ is intended to back up user data, not entire operating systems. It ignores
1159owner and group IDs, ACLs, extended attributes, or special file types like
1160devices, sockets, or named pipes. It does not follow or restore symbolic links
1161or junctions, and always follows hard links.")
1162 (license (list license:public-domain
1163 ;; libzpaq.cpp contains a mix of public-domain and
1164 ;; expat-licenced (or ‘MIT’) code.
1165 license:expat))))
0da8313c 1166
9e6ada8f
MR
1167(define-public unshield
1168 (package
1169 (name "unshield")
1170 (version "1.4.2")
1171 (source
1172 (origin (method url-fetch)
1173 (uri (string-append "http://github.com/twogood/unshield/archive/"
1174 version ".tar.gz"))
1175 (sha256
1176 (base32
1177 "0x7ps644yp5dka2zhb8w0ifqmw3d255jafpzfwv8xbcpgq6fmm2x"))))
1178 (build-system cmake-build-system)
1179 (inputs
1180 `(("zlib" ,zlib)
1181 ("openssl" ,openssl)
1182 ;; test data that is otherwise downloaded with curl
1183 ("unshield-avigomanager11b22.zip"
1184 ,(origin
1185 (method url-fetch)
a5fa1a1a
MR
1186 (uri (string-append "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1187 "unshield-avigomanager11b22.zip?dl=1"))
9e6ada8f
MR
1188 (sha256
1189 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1190 (file-name "unshield-avigomanager11b22.zip")))
1191 ("unshield-the-feeble-files-spanish.zip"
1192 ,(origin
1193 (method url-fetch)
a5fa1a1a
MR
1194 (uri (string-append "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1195 "unshield-the-feeble-files-spanish.zip?dl=1"))
9e6ada8f
MR
1196 (sha256
1197 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1198 (file-name "unshield-the-feeble-files-spanish.zip")))))
1199 (native-inputs
1200 `(("unzip" ,unzip)))
1201 (arguments
1202 `(#:out-of-source? #f
1203 #:phases
1204 (modify-phases %standard-phases
1205 (add-before 'check 'pre-check
1206 (lambda* (#:key inputs #:allow-other-keys)
1207 (for-each (lambda (i)
1208 (copy-file (assoc-ref inputs i)
1209 (string-append "test/v0/" i)))
1210 '("unshield-avigomanager11b22.zip"
1211 "unshield-the-feeble-files-spanish.zip"))
1212 (substitute* (find-files "test/" "/*\\.sh")
1213 ;; Tests expect the unshield binary in a specific
1214 ;; location.
1215 (("/var/tmp/unshield/bin/unshield")
1216 (string-append (getcwd) "/src/unshield"))
1217 ;; We no longer need to download the data.
1218 ((".?URL=.*$") "")
1219 (("curl -(|f)sSL -o test.zip .*") ""))
1220 (substitute* "test/v0/avigomanager.sh"
1221 (("test.zip")
1222 (string-append (getcwd)
1223 "/test/v0/unshield-avigomanager11b22.zip")))
1224 (substitute* "test/v0/the-feeble-files-spanish.sh"
1225 (("test.zip")
1226 (string-append (getcwd)
1227 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1228 #t))
1229 (replace 'check
1230 (lambda _
1231 (zero? (system* "./run-tests.sh")))))))
1232 (home-page "https://github.com/twogood/unshield")
1233 (synopsis "Extract CAB files from InstallShield installers")
1234 (description
1235 "@command{unshield} is a tool and library for extracting @file{.cab}
1236 archives from InstallShield installers.")
1237 (license license:expat)))
1238
0da8313c
JD
1239(define-public unrar
1240 (package
1241 (name "unrar")
1242 (version "0.0.1")
1243 (source (origin
1244 (method url-fetch)
1245 (uri (string-append
1246 "http://download.gna.org/unrar/unrar-" version ".tar.gz"))
1247 (sha256
1248 (base32
1249 "1fgmjaxffj3shyxgy765jhxwz1cq88hk0fih1bsdzyvymyyz6mz7"))))
1250 (build-system gnu-build-system)
1251 (home-page "http://download.gna.org/unrar")
1252 (synopsis "RAR archive extraction tool")
1253 (description "Unrar is a simple command-line program to list and extract
1254RAR archives.")
1255 (license license:gpl2+)))
f6ac3101
TGR
1256
1257(define-public zstd
1258 (package
1259 (name "zstd")
08094dc9 1260 (version "1.3.0")
f6ac3101
TGR
1261 (source (origin
1262 (method url-fetch)
1263 (uri (string-append "https://github.com/facebook/zstd/archive/v"
1264 version ".tar.gz"))
1265 (file-name (string-append name "-" version ".tar.gz"))
1266 (sha256
1267 (base32
08094dc9 1268 "0j5kf0phx4w4b5x7aqwc10lxi9ix7rxhxk0df37cpdrqni1sdnqg"))
f6ac3101
TGR
1269 (modules '((guix build utils)))
1270 (snippet
1271 ;; Remove non-free source files.
1272 '(begin
1273 (for-each delete-file-recursively
1274 (list
1275 ;; Commercial use of the following is not allowed.
1276 "examples"
1277 "LICENSE-examples"))
1278 #t))))
1279 (build-system gnu-build-system)
1280 (arguments
1281 `(#:phases
1282 (modify-phases %standard-phases
1283 (delete 'configure)) ; no configure script
1284 #:make-flags
1285 (list "CC=gcc"
1286 (string-append "PREFIX=" (assoc-ref %outputs "out")))
1287 #:test-target "test"))
1288 (home-page "http://zstd.net/")
1289 (synopsis "Zstandard real-time compression algorithm")
1290 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1291that combines very fast operation with a compression ratio comparable to that of
1292zlib. In most scenarios, both compression and decompression can be performed in
1293‘real time’. The compressor can be configured to provide the most suitable
1294trade-off between compression ratio and speed, without affecting decompression
1295speed.")
1296 (license (list license:bsd-3 ; the main top-level LICENSE file
1297 license:bsd-2 ; quite a few files have but 2 clauses
1298 license:public-domain ; zlibWrapper/examples/fitblk*
1299 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
0f03c531
TGR
1300
1301(define-public pzstd
1302 (package
1303 (name "pzstd")
1304 (version (package-version zstd))
1305 (source (package-source zstd))
1306 (build-system gnu-build-system)
1307 (native-inputs
1308 `(("googletest", googletest)))
1309 (arguments
1310 `(#:phases
1311 (modify-phases %standard-phases
1312 (add-after 'unpack 'enter-subdirectory
1313 (lambda _ (chdir "contrib/pzstd")))
1314 (delete 'configure) ; no configure script
1315 (add-before 'check 'compile-tests
1316 (lambda* (#:key make-flags #:allow-other-keys)
1317 (zero? (apply system* "make" "tests" make-flags))))
1318 (add-after 'install 'install-documentation
1319 (lambda* (#:key outputs #:allow-other-keys)
1320 (let* ((out (assoc-ref outputs "out"))
1321 (doc (string-append out "/share/doc/" ,name)))
1322 (mkdir-p doc)
1323 (install-file "README.md" doc)
1324 #t))))
1325 #:make-flags
1326 (list "CC=gcc"
1327 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1328 (home-page (package-home-page zstd))
1329 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1330 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1331multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1332compression algorithm}. It is fully compatible with the original Zstandard file
1333format and command-line interface, and can be used as a drop-in replacement.
1334
1335Compression is distributed over multiple processor cores to improve performance,
1336as is the decompression of data compressed in this manner. Data compressed by
1337other implementations will only be decompressed by two threads: one performing
1338the actual decompression, the other input and output.")
1339 (license (package-license zstd))))
148585c2
AI
1340
1341(define-public zip
1342 (package
1343 (name "zip")
1344 (version "3.0")
1345 (source
1346 (origin
1347 (method url-fetch)
1348 (uri (string-append "mirror://sourceforge/infozip"
1349 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1350 (sha256
1351 (base32
1352 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1353 (build-system gnu-build-system)
1354 (inputs `(("bzip2" ,bzip2)))
1355 (arguments
1356 `(#:tests? #f ; no test target
1357 #:make-flags (let ((out (assoc-ref %outputs "out")))
1358 (list "-f" "unix/Makefile"
1359 (string-append "prefix=" out)
1360 (string-append "MANDIR=" out "/share/man/man1")))
1361 #:modules ((guix build gnu-build-system)
1362 (guix build utils)
1363 (srfi srfi-1))
1364 #:phases
1365 (modify-phases %standard-phases
1366 (replace 'build
1367 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1368 (zero? (apply system* "make" "generic_gcc" make-flags))))
1369 (delete 'configure))))
1370 (home-page "http://www.info-zip.org/Zip.html")
1371 (synopsis "Compression and file packing utility")
1372 (description
1373 "Zip is a compression and file packaging/archive utility. Zip is useful
1374for packaging a set of files for distribution, for archiving files, and for
1375saving disk space by temporarily compressing unused files or directories.
1376Zip puts one or more compressed files into a single ZIP archive, along with
1377information about the files (name, path, date, time of last modification,
1378protection, and check information to verify file integrity). An entire
1379directory structure can be packed into a ZIP archive with a single command.
1380
1381Zip has one compression method (deflation) and can also store files without
1382compression. Zip automatically chooses the better of the two for each file.
1383Compression ratios of 2:1 to 3:1 are common for text files.")
1384 (license (license:non-copyleft "file://LICENSE"
1385 "See LICENSE in the distribution."))))
1386
1387(define-public unzip
1388 (package (inherit zip)
1389 (name "unzip")
1390 (version "6.0")
1391 (source
1392 (origin
1393 (method url-fetch)
1394 (uri (string-append "mirror://sourceforge/infozip"
1395 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1396 (sha256
1397 (base32
1398 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1399 (patches (search-patches "unzip-CVE-2014-8139.patch"
1400 "unzip-CVE-2014-8140.patch"
1401 "unzip-CVE-2014-8141.patch"
1402 "unzip-CVE-2014-9636.patch"
1403 "unzip-CVE-2015-7696.patch"
1404 "unzip-CVE-2015-7697.patch"
1405 "unzip-allow-greater-hostver-values.patch"
1406 "unzip-initialize-symlink-flag.patch"
1407 "unzip-remove-build-date.patch"
1408 "unzip-attribs-overflow.patch"
1409 "unzip-overflow-on-invalid-input.patch"
1410 "unzip-format-secure.patch"
1411 "unzip-overflow-long-fsize.patch"))))
1412 (build-system gnu-build-system)
1413 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1414 (arguments
1415 `(#:phases (modify-phases %standard-phases
1416 (delete 'configure)
1417 (replace 'build
1418 (lambda* (#:key make-flags #:allow-other-keys)
1419 (zero? (apply system* "make"
1420 `("-j" ,(number->string
1421 (parallel-job-count))
1422 ,@make-flags
1423 "generic_gcc"))))))
1424 #:make-flags (list "-f" "unix/Makefile"
1425 (string-append "prefix=" %output)
1426 (string-append "MANDIR=" %output "/share/man/man1"))))
1427 (home-page "http://www.info-zip.org/UnZip.html")
1428 (synopsis "Decompression and file extraction utility")
1429 (description
1430 "UnZip is an extraction utility for archives compressed in .zip format,
1431also called \"zipfiles\".
1432
1433UnZip lists, tests, or extracts files from a .zip archive. The default
1434behaviour (with no options) is to extract into the current directory, and
1435subdirectories below it, all files from the specified zipfile. UnZip
1436recreates the stored directory structure by default.")
1437 (license (license:non-copyleft "file://LICENSE"
1438 "See LICENSE in the distribution."))))
1439
1440(define-public zziplib
1441 (package
1442 (name "zziplib")
1443 (version "0.13.62")
1444 (source
1445 (origin
1446 (method url-fetch)
1447 (uri (string-append "mirror://sourceforge/zziplib/zziplib13/"
1448 version "/zziplib-"
1449 version ".tar.bz2"))
1450 (patches (search-patches "zziplib-CVE-2017-5974.patch"
1451 "zziplib-CVE-2017-5975.patch"
1452 "zziplib-CVE-2017-5976.patch"
1453 "zziplib-CVE-2017-5978.patch"
1454 "zziplib-CVE-2017-5979.patch"
1455 "zziplib-CVE-2017-5981.patch"))
1456 (sha256
1457 (base32
1458 "0nsjqxw017hiyp524p9316283jlf5piixc1091gkimhz38zh7f51"))))
1459 (build-system gnu-build-system)
1460 (inputs
1461 `(("zlib" ,zlib)))
1462 (native-inputs `(("perl" ,perl) ; for the documentation
1463 ("pkg-config" ,pkg-config)
1464 ;; for the documentation; Python 3 not supported,
1465 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1466 ("python" ,python-2)
1467 ("zip" ,zip))) ; to create test files
1468 (arguments
1469 `(#:parallel-tests? #f)) ; since test files are created on the fly
1470 (home-page "http://zziplib.sourceforge.net/")
1471 (synopsis "Library for accessing zip files")
1472 (description
1473 "ZZipLib is a library based on zlib for accessing zip files.")
1474 (license license:lgpl2.0+)))
1475
1476(define-public perl-zip
1477 (package
1478 (name "perl-zip")
1479 (version "1.59")
1480 (source
1481 (origin
1482 (method url-fetch)
1483 (uri (string-append
1484 "mirror://cpan/authors/id/A/AD/ADAMK/Archive-Zip-"
1485 version ".tar.gz"))
1486 (sha256
1487 (base32
1488 "0m31qlppg65vh32pwxkwjby02q70abx49d2yk6vfd4585fqb27cx"))))
1489 (build-system perl-build-system)
1490 (synopsis "Provides an interface to ZIP archive files")
1491 (description "The Archive::Zip module allows a Perl program to create,
1492manipulate, read, and write Zip archive files.")
1493 (home-page "http://search.cpan.org/~adamk/Archive-Zip-1.30/")
1494 (license license:perl-license)))
06de4aaf
TF
1495
1496(define-public libzip
1497 (package
1498 (name "libzip")
1499 (version "1.2.0")
1500 (source (origin
1501 (method url-fetch)
1502 (uri (string-append
1503 "https://nih.at/libzip/libzip-" version ".tar.gz"))
1504 (sha256
1505 (base32
1506 "17vxj2ffsxwh8lkc6801ppmwj15jp8q58rin76znxfbx88789ybc"))))
1507 (arguments
1508 `(#:phases
1509 (modify-phases %standard-phases
1510 (add-before 'configure 'patch-perl
1511 (lambda _
1512 (substitute* "regress/runtest.in"
1513 (("/usr/bin/env perl") (which "perl"))))))))
1514 (native-inputs
1515 `(("perl" ,perl)))
1516 (inputs
1517 `(("zlib" ,zlib)))
1518 (build-system gnu-build-system)
1519 (home-page "https://nih.at/libzip/index.html")
1520 (synopsis "C library for reading, creating, and modifying zip archives")
1521 (description "Libzip is a C library for reading, creating, and modifying
1522zip archives. Files can be added from data buffers, files, or compressed data
1523copied directly from other zip archives. Changes made without closing the
1524archive can be reverted.")
1525 (license license:bsd-3)))