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