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