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