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