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, 2019 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>
27 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 cmake)
49 #:use-module (guix build-system gnu)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages assembly)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages base)
55 #:use-module (gnu packages boost)
56 #:use-module (gnu packages check)
57 #:use-module (gnu packages curl)
58 #:use-module (gnu packages file)
59 #:use-module (gnu packages maths)
60 #:use-module (gnu packages perl)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages tls)
64 #:use-module (gnu packages valgrind)
65 #:use-module (ice-9 match)
66 #:use-module ((srfi srfi-1) #:select (last)))
75 (uri (list (string-append "http://zlib.net/zlib-"
77 (string-append "mirror://sourceforge/libpng/zlib/"
78 version "/zlib-" version ".tar.gz")))
81 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
82 (build-system gnu-build-system)
83 (outputs '("out" "static"))
86 (modify-phases %standard-phases
88 (lambda* (#:key outputs #:allow-other-keys)
89 ;; Zlib's home-made `configure' fails when passed
90 ;; extra flags like `--enable-fast-install', so we need to
91 ;; invoke it with just what it understand.
92 (let ((out (assoc-ref outputs "out")))
93 ;; 'configure' doesn't understand '--host'.
94 ,@(if (%current-target-system)
95 `((setenv "CHOST" ,(%current-target-system)))
98 (string-append "--prefix=" out)))))
99 (add-after 'install 'move-static-library
100 (lambda* (#:key outputs #:allow-other-keys)
101 (let ((out (assoc-ref outputs "out"))
102 (static (assoc-ref outputs "static")))
103 (with-directory-excursion (string-append out "/lib")
104 (install-file "libz.a" (string-append static "/lib"))
105 (delete-file "libz.a")
107 (home-page "https://zlib.net/")
108 (synopsis "Compression library")
110 "zlib is designed to be a free, general-purpose, legally unencumbered --
111 that is, not covered by any patents -- lossless data-compression library for
112 use on virtually any computer hardware and operating system. The zlib data
113 format is itself portable across platforms. Unlike the LZW compression method
114 used in Unix compress(1) and in the GIF image format, the compression method
115 currently used in zlib essentially never expands the data. (LZW can double or
116 triple the file size in extreme cases.) zlib's memory footprint is also
117 independent of the input data and can be reduced, if necessary, at some cost
119 (license license:zlib)))
121 (define-public minizip
124 (version (package-version zlib))
125 (source (package-source zlib))
126 (build-system gnu-build-system)
129 (modify-phases %standard-phases
130 (add-after 'unpack 'enter-source
131 (lambda _ (chdir "contrib/minizip") #t)))))
133 `(("autoconf" ,autoconf)
134 ("automake" ,automake)
135 ("libtool" ,libtool)))
136 (propagated-inputs `(("zlib" ,zlib)))
137 (home-page (package-home-page zlib))
138 (synopsis "Zip Compression library")
140 "Minizip is a minimalistic library that supports compressing,
141 extracting and viewing ZIP archives. This version is extracted from
142 the @code{zlib} source.")
143 (license (package-license zlib))))
145 (define-public fastjar
151 (uri (string-append "mirror://savannah/fastjar/fastjar-"
155 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
156 (build-system gnu-build-system)
157 (inputs `(("zlib" ,zlib)))
158 (home-page "https://savannah.nongnu.org/projects/fastjar")
159 (synopsis "Replacement for Sun's 'jar' utility")
161 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
162 utility. Instead of being written in Java, FastJar is written in C.")
163 (license license:gpl2+)))
165 (define-public libtar
173 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
176 "mirror://debian/pool/main/libt/libtar/libtar_"
177 version ".orig.tar.gz")))
180 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
181 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
182 (build-system gnu-build-system)
183 (arguments `(#:tests? #f)) ; no "check" target
185 `(("autoconf" ,autoconf)
186 ("automake" ,automake)
187 ("libtool" ,libtool)))
190 (synopsis "C library for manipulating POSIX tar files")
192 "libtar is a C library for manipulating POSIX tar files. It handles
193 adding and extracting files to/from a tar archive.")
194 (home-page "https://repo.or.cz/libtar.git")
195 (license license:bsd-3)))
203 (uri (string-append "mirror://gnu/gzip/gzip-"
207 "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
208 (build-system gnu-build-system)
209 (synopsis "General file (de)compression (using lzw)")
211 ;; FIXME: The test suite wants `less', and optionally Perl.
214 (modify-phases %standard-phases
215 (add-after 'unpack 'patch-for-glibc-2.28
217 ;; Adjust the bundled gnulib to work with glibc 2.28. See e.g.
218 ;; "m4-gnulib-libio.patch". This is a phase rather than patch
219 ;; or snippet to work around <https://bugs.gnu.org/32347>.
220 (substitute* (find-files "lib" "\\.c$")
221 (("#if defined _IO_ftrylockfile")
222 "#if defined _IO_EOF_SEEN"))
223 (substitute* "lib/stdio-impl.h"
224 (("^/\\* BSD stdio derived implementations")
225 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
226 "# define _IO_IN_BACKUP 0x100\n"
228 "/* BSD stdio derived implementations")))
230 (add-after 'unpack 'use-absolute-name-of-gzip
231 (lambda* (#:key outputs #:allow-other-keys)
232 (substitute* "gunzip.in"
234 (string-append "exec " (assoc-ref outputs "out")
238 "GNU Gzip provides data compression and decompression utilities; the
239 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
240 file; as a result, it is often used in conjunction with \"tar\", resulting in
241 \".tar.gz\" or \".tgz\", etc.")
242 (license license:gpl3+)
243 (home-page "https://www.gnu.org/software/gzip/")))
251 ;; XXX The bzip.org domain was allowed to expire.
252 (uri (string-append "https://web.archive.org/web/20180624184806/"
253 "http://www.bzip.org/"
254 version "/bzip2-" version ".tar.gz"))
257 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
258 (build-system gnu-build-system)
260 `(#:modules ((guix build gnu-build-system)
265 (modify-phases %standard-phases
267 (lambda* (#:key target #:allow-other-keys)
268 (when ,(%current-target-system)
269 ;; Cross-compilation: use the cross tools.
270 (substitute* (find-files "." "Makefile")
272 (string-append "CC = " target "-gcc\n"))
274 (string-append "AR = " target "-ar\n"))
276 (string-append "RANLIB = " target "-ranlib\n"))
277 (("^all:(.*)test" _ prerequisites)
278 ;; Remove 'all' -> 'test' dependency.
279 (string-append "all:" prerequisites "\n"))))
281 (add-before 'build 'build-shared-lib
282 (lambda* (#:key inputs #:allow-other-keys)
283 (patch-makefile-SHELL "Makefile-libbz2_so")
284 (invoke "make" "-f" "Makefile-libbz2_so")))
285 (add-after 'install 'install-shared-lib
286 (lambda* (#:key outputs #:allow-other-keys)
287 ;; The Makefile above does not have an 'install' target, nor does
288 ;; it create all the (un)versioned symlinks, so we handle it here.
289 (let* ((out (assoc-ref outputs "out"))
290 (libdir (string-append out "/lib"))
292 ;; Locate the built library (e.g. "libbz2.so.1.0.6").
293 (lib (car (scandir "."
295 (and (string-prefix? soname file)
297 (stat:type (lstat file))))))))
298 (soversion (string-drop lib (+ 1 (string-length soname)))))
299 (install-file lib libdir)
300 (with-directory-excursion libdir
301 ;; Create symlinks libbz2.so.1 -> libbz2.so.1.0, etc.
302 (let loop ((base soname)
303 (numbers (string-split soversion #\.)))
304 (unless (null? numbers)
305 (let ((so-file (string-append base "." (car numbers))))
306 (symlink so-file base)
307 (loop so-file (cdr numbers))))))
309 (add-after 'install-shared-lib 'move-static-lib
310 (lambda* (#:key outputs #:allow-other-keys)
311 (let ((out (assoc-ref outputs "out"))
312 (static (assoc-ref outputs "static")))
313 (with-directory-excursion (string-append out "/lib")
314 (install-file "libbz2.a" (string-append static "/lib"))
315 (delete-file "libbz2.a")
317 (add-after 'install-shared-lib 'patch-scripts
318 (lambda* (#:key outputs inputs #:allow-other-keys)
319 (let* ((out (assoc-ref outputs "out")))
320 (substitute* (string-append out "/bin/bzdiff")
324 #:make-flags (list (string-append "PREFIX="
325 (assoc-ref %outputs "out")))
327 ;; Don't attempt to run the tests when cross-compiling.
328 ,@(if (%current-target-system)
331 (outputs '("out" "static"))
332 (synopsis "High-quality data compression program")
334 "bzip2 is a freely available, patent free (see below), high-quality data
335 compressor. It typically compresses files to within 10% to 15% of the best
336 available techniques (the PPM family of statistical compressors), whilst
337 being around twice as fast at compression and six times faster at
339 (license (license:non-copyleft "file://LICENSE"
340 "See LICENSE in the distribution."))
341 (home-page "https://web.archive.org/web/20180801004107/http://www.bzip.org/")))
343 (define-public lbzip2
349 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
353 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))
354 (modules '((guix build utils)))
357 (substitute* (find-files "lib" "\\.c$")
358 (("#if defined _IO_ftrylockfile")
359 "#if defined _IO_EOF_SEEN"))
360 (substitute* "lib/stdio-impl.h"
361 (("^/\\* BSD stdio derived implementations")
362 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
363 "# define _IO_IN_BACKUP 0x100\n"
365 "/* BSD stdio derived implementations")))
367 (build-system gnu-build-system)
368 (synopsis "Parallel bzip2 compression utility")
370 "lbzip2 is a multi-threaded compression utility with support for the
371 bzip2 compressed file format. lbzip2 can process standard bz2 files in
372 parallel. It uses POSIX threading model (pthreads), which allows it to take
373 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
374 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
375 compatible with bzip2 – both at file format and command line level.")
376 (home-page "http://www.lbzip2.org/")
377 (license license:gpl3+)))
379 (define-public pbzip2
385 (uri (string-append "https://launchpad.net/pbzip2/"
386 (version-major+minor version) "/" version
387 "/+download/" name "-" version ".tar.gz"))
390 "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"))))
391 (build-system gnu-build-system)
395 `(#:tests? #f ; no tests
396 #:phases (modify-phases %standard-phases
397 (delete 'configure)) ; no configure script
398 #:make-flags (list (string-append "PREFIX=" %output))))
399 (home-page "http://compression.ca/pbzip2/")
400 (synopsis "Parallel bzip2 implementation")
402 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
403 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
404 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
405 compressed with pbzip2 can be decompressed with bzip2).")
406 (license (license:non-copyleft "file://COPYING"
407 "See COPYING in the distribution."))))
415 (uri (list (string-append "http://tukaani.org/xz/xz-" version
417 (string-append "http://multiprecision.org/guix/xz-"
421 "0ibi2zsfaz6l756spjwc5rayf4ckgc9hwmy8qinppcyk4svz64mm"))))
422 (build-system gnu-build-system)
423 (synopsis "General-purpose data compression")
425 "XZ Utils is free general-purpose data compression software with high
426 compression ratio. XZ Utils were written for POSIX-like systems, but also
427 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
429 The core of the XZ Utils compression code is based on LZMA SDK, but it has
430 been modified quite a lot to be suitable for XZ Utils. The primary
431 compression algorithm is currently LZMA2, which is used inside the .xz
432 container format. With typical files, XZ Utils create 30 % smaller output
433 than gzip and 15 % smaller output than bzip2.")
434 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
435 (home-page "https://tukaani.org/xz/")))
444 "https://github.com/fragglet/lhasa/releases/download/v"
445 version "/lhasa-" version ".tar.gz"))
448 "092zi9av18ma20c6h9448k0bapvx2plnp292741dvfd9hmgqxc1z"))))
449 (build-system gnu-build-system)
452 (modify-phases %standard-phases
453 (add-before 'check 'set-up-test-environment
454 (lambda* (#:key inputs #:allow-other-keys)
455 (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata")
459 `(("tzdata" ,tzdata)))
460 (home-page "https://fragglet.github.com/lhasa/")
461 (synopsis "LHA archive decompressor")
462 (description "Lhasa is a replacement for the Unix LHA tool, for
463 decompressing .lzh (LHA / LHarc) and .lzs (LArc) archives. The backend for the
464 tool is a library, so that it can be reused for other purposes. Lhasa aims to
465 be compatible with as many types of lzh/lzs archives as possible. It also aims
466 to generate the same output as the (non-free) Unix LHA tool, so that it will
467 act as a free drop-in replacement.")
468 (license license:isc)))
477 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
481 "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60"))))
482 (build-system gnu-build-system)
483 (arguments '(#:configure-flags '("--enable-shared")))
484 (home-page "http://www.oberhumer.com/opensource/lzo")
486 "Data compression library suitable for real-time data de-/compression")
488 "LZO is a data compression library which is suitable for data
489 de-/compression in real-time. This means it favours speed over
492 LZO is written in ANSI C. Both the source code and the compressed data
493 format are designed to be portable across platforms.")
494 (license license:gpl2+)))
503 (uri (string-append "http://www.lzop.org/download/lzop-"
507 "0h9gb8q7y54m9mvy3jvsmxf21yx8fc3ylzh418hgbbv0i8mbcwky"))))
508 (build-system gnu-build-system)
509 (inputs `(("lzo" ,lzo)))
510 (home-page "https://www.lzop.org/")
511 (synopsis "Compress or expand files")
513 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
514 LZO data compression library for compression services, and its main advantages
515 over gzip are much higher compression and decompression speed (at the cost of
516 some compression ratio).")
517 (license license:gpl2+)))
525 (uri (string-append "mirror://savannah/lzip/lzip-"
529 "0319q59kb8g324wnj7xzbr7vvlx5bcs13lr34j0zb3kqlyjq2fy9"))))
530 (build-system gnu-build-system)
531 (home-page "https://www.nongnu.org/lzip/lzip.html")
532 (synopsis "Lossless data compressor based on the LZMA algorithm")
534 "Lzip is a lossless data compressor with a user interface similar to the
535 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
536 more than bzip2, which makes it well-suited for software distribution and data
537 archiving. Lzip is a clean implementation of the LZMA algorithm.")
538 (license license:gpl3+)))
540 (define-public lziprecover
546 (uri (string-append "mirror://savannah/lzip/" name "/"
547 name "-" version ".tar.gz"))
550 "0fpnmdxayvd1ff0rk9606dvr431ji6b1v71km4ww244rih1rmmzz"))))
551 (build-system gnu-build-system)
552 (home-page "https://www.nongnu.org/lzip/lziprecover.html")
553 (synopsis "Recover and decompress data from damaged lzip files")
555 "Lziprecover is a data recovery tool and decompressor for files in the lzip
556 compressed data format (.lz). It can test the integrity of lzip files, extract
557 data from damaged ones, and repair most files with small errors (up to one
558 single-byte error per member) entirely.
560 Lziprecover is not a replacement for regular backups, but a last line of defence
561 when even the backups are corrupt. It can recover files by merging the good
562 parts of two or more damaged copies, such as can be easily produced by running
563 @command{ddrescue} on a failing device.
565 This package also includes @command{unzcrash}, a tool to test the robustness of
566 decompressors when faced with corrupted input.")
567 (license (list license:bsd-2 ; arg_parser.{cc,h}
568 license:gpl2+)))) ; everything else
570 (define-public sharutils
577 (uri (string-append "mirror://gnu/sharutils/sharutils-"
579 (patches (search-patches "sharutils-CVE-2018-1000097.patch"))
582 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))
583 (modules '((guix build utils)))
586 (substitute* (find-files "lib" "\\.c$")
587 (("#if defined _IO_ftrylockfile")
588 "#if defined _IO_EOF_SEEN"))
589 (substitute* "lib/stdio-impl.h"
590 (("^/\\* BSD stdio derived implementations")
591 (string-append "#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN\n"
592 "# define _IO_IN_BACKUP 0x100\n"
594 "/* BSD stdio derived implementations")))
596 (build-system gnu-build-system)
601 (modify-phases %standard-phases
602 (add-after 'patch-source-shebangs 'unpatch-source-shebang
603 ;; revert the patch-shebang phase on a script which is
606 (substitute* "tests/shar-1.ok"
607 (((which "sh")) "/bin/sh"))
609 (home-page "https://www.gnu.org/software/sharutils/")
610 (synopsis "Archives in shell scripts, uuencode/uudecode")
612 "GNU sharutils is a package for creating and manipulating shell
613 archives that can be readily emailed. A shell archive is a file that can be
614 processed by a Bourne-type shell to unpack the original collection of files.
615 This package is mostly for compatibility and historical interest.")
616 (license license:gpl3+)))
618 (define-public sfarklib
624 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
626 (file-name (string-append name "-" version ".tar.gz"))
629 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
630 (build-system gnu-build-system)
632 `(#:tests? #f ;no "check" target
634 (modify-phases %standard-phases
636 (lambda* (#:key outputs #:allow-other-keys)
637 (substitute* "Makefile"
638 (("/usr/local") (assoc-ref outputs "out")))
642 (home-page "https://github.com/raboof/sfArkLib")
643 (synopsis "Library for SoundFont decompression")
645 "SfArkLib is a C++ library for decompressing SoundFont files compressed
646 with the sfArk algorithm.")
647 (license license:gpl3+)))
649 (define-public sfarkxtc
650 (let ((commit "13cd6f93725a90d91ec5ea75babf1dbd694ac463")
654 (version (git-version "0" revision commit))
656 ;; There are no release tarballs, so we just fetch the latest
657 ;; commit at this time.
660 (url "https://github.com/raboof/sfarkxtc.git")
662 (file-name (git-file-name name version))
665 "1mb1jyk1m11l1gppd9hmql9cyp55sdf7jk5rbc7acky1z4k4mv19"))))
666 (build-system gnu-build-system)
668 `(#:tests? #f ;no "check" target
670 (modify-phases %standard-phases
672 (lambda* (#:key outputs #:allow-other-keys)
673 (substitute* "Makefile"
674 (("/usr/local") (assoc-ref outputs "out")))
678 ("sfarklib" ,sfarklib)))
679 (home-page "https://github.com/raboof/sfarkxtc")
680 (synopsis "Basic sfArk decompressor")
681 (description "SfArk extractor converts SoundFonts in the compressed legacy
682 sfArk file format to the uncompressed sf2 format.")
683 (license license:gpl3+))))
685 (define-public libmspack
688 (home-page "https://cabextract.org.uk/libmspack/")
693 (uri (string-append home-page name "-" version "alpha.tar.gz"))
695 (base32 "0h1f5w8rjnq7dcqpqm1mpx5m8q80691kid6f7npqlqwqqzckd8v2"))))
696 (build-system gnu-build-system)
698 `(#:configure-flags '("--disable-static")))
699 (synopsis "Compression tools for some formats used by Microsoft")
701 "The purpose of libmspack is to provide both compression and
702 decompression of some loosely related file formats used by Microsoft.")
703 (license license:lgpl2.1+)))
712 (uri (git-reference (url "https://github.com/lz4/lz4")
713 (commit (string-append "v" version))))
716 "1jggv4lvfav53advnj0pwqgxzn868lrj8dc9zp73iwvqlj82mhmx"))
717 (file-name (git-file-name name version))))
718 (build-system gnu-build-system)
719 (native-inputs `(("valgrind" ,valgrind))) ; for tests
721 `(#:test-target "test"
722 #:make-flags (list "CC=gcc"
723 (string-append "prefix=" (assoc-ref %outputs "out")))
724 #:phases (modify-phases %standard-phases
725 (delete 'configure)))) ; no configure script
726 (home-page "https://www.lz4.org")
727 (synopsis "Compression algorithm focused on speed")
728 (description "LZ4 is a lossless compression algorithm, providing
729 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
730 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
731 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
732 time for compression ratio.")
733 ;; The libraries (lz4, lz4hc, and xxhash) are BSD licenced. The command
734 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
735 (license (list license:bsd-2 license:gpl2+))))
737 (define-public squashfs-tools
739 (name "squashfs-tools")
743 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
744 "squashfs" version "/"
745 "squashfs" version ".tar.gz"))
748 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
749 (build-system gnu-build-system)
751 '(#:tests? #f ; no check target
757 (string-append "INSTALL_DIR=" %output "/bin"))
759 (modify-phases %standard-phases
762 (chdir "squashfs-tools")
764 (add-after 'unpack 'fix-glibc-compatability
766 (substitute* '("squashfs-tools/mksquashfs.c"
767 "squashfs-tools/unsquashfs.c")
769 "<sys/sysinfo.h>\n#include <sys/sysmacros.h>"))
776 (home-page "http://squashfs.sourceforge.net/")
777 (synopsis "Tools to create and extract squashfs file systems")
779 "Squashfs is a highly compressed read-only file system for Linux. It uses
780 zlib to compress files, inodes, and directories. All blocks are packed to
781 minimize the data overhead, and block sizes of between 4K and 1M are supported.
782 It is intended to be used for archival use, for live CDs, and for embedded
783 systems where low overhead is needed. This package allows you to create and
784 extract such file systems.")
785 (license license:gpl2+)))
787 ;; We need this for building squashfs images with symlinks.
788 (define-public squashfs-tools-next
789 (let ((commit "fb33dfc32b131a1162dcf0e35bd88254ae10e265")
791 (package (inherit squashfs-tools)
792 (name "squashfs-tools-next")
793 (version (string-append "4.3-" revision (string-take commit 7)))
797 (url "https://github.com/plougher/squashfs-tools.git")
799 (file-name (git-file-name name version))
802 "1x2skf8hxzfch978nzx5mh46d4hhi6gl22270hiarjszsjk3bnsx")))))))
810 (uri (string-append "http://zlib.net/pigz/"
811 name "-" version ".tar.gz"))
814 "0wsgw5vwl23jrnpsvd8v3xcp5k4waw5mk0164fynjhkv58i1dy54"))))
815 (build-system gnu-build-system)
818 (modify-phases %standard-phases
821 (lambda* (#:key outputs #:allow-other-keys)
822 (let* ((out (assoc-ref outputs "out"))
823 (bin (string-append out "/bin"))
824 (man (string-append out "/share/man/man1")))
825 (install-file "pigz" bin)
826 (symlink "pigz" (string-append bin "/unpigz"))
827 (install-file "pigz.1" man)
829 #:make-flags (list "CC=gcc")
830 #:test-target "tests"))
831 (inputs `(("zlib" ,zlib)))
832 (home-page "https://zlib.net/pigz/")
833 (synopsis "Parallel implementation of gzip")
835 "This package provides a parallel implementation of gzip that exploits
836 multiple processors and multiple cores when compressing data.")
838 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
839 ;; written by Mark Adler, are under another non-copyleft license.
840 (license license:asl2.0)))
849 "https://github.com/vasi/pixz/releases/download/v" version
850 "/pixz-" version ".tar.xz"))
853 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
854 (build-system gnu-build-system)
856 `(("pkg-config" ,pkg-config)
857 ("libarchive" ,libarchive)))
858 (home-page "https://github.com/vasi/pixz")
859 (synopsis "Parallel indexing implementation of LZMA")
861 "The existing XZ Utils provide great compression in the .xz file format,
862 but they produce just one big block of compressed data. Pixz instead produces
863 a collection of smaller blocks which makes random access to the original data
864 possible and can compress in parallel. This is especially useful for large
866 (license license:bsd-2)))
868 (define-public brotli
869 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
873 (version (string-append "0.1-" revision "."
874 (string-take commit 7)))
878 (url "https://github.com/bagder/libbrotli.git")
881 (file-name (string-append name "-" version ".tar.xz"))
884 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
885 (modules '((guix build utils)))
887 ;; This is a recursive submodule that is
888 ;; unnecessary for this package, so delete it.
889 (delete-file-recursively "brotli/terryfy")
891 (build-system gnu-build-system)
893 `(("autoconf" ,autoconf)
894 ("automake" ,automake)
895 ("libtool" ,libtool)))
897 `(#:phases (modify-phases %standard-phases
898 (add-after 'unpack 'autogen
901 (invoke "autoreconf" "-vfi"))))))
902 (home-page "https://github.com/bagder/libbrotli/")
903 (synopsis "Implementation of the Brotli compression algorithm")
905 "Brotli is a general-purpose lossless compression algorithm. It is
906 similar in speed to deflate but offers denser compression. This package
907 provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
908 respectively, based on the reference implementation from Google.")
909 (license license:expat))))
911 (define-public bsdiff
915 (home-page "https://www.daemonology.net/bsdiff/")
918 (uri (string-append home-page name "-" version ".tar.gz"))
921 "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq"))))
922 (build-system gnu-build-system)
924 `(#:make-flags (list "INSTALL=install" "CC=gcc"
925 (string-append "PREFIX=" (assoc-ref %outputs "out")))
926 #:phases (modify-phases %standard-phases
928 (add-before 'build 'fix-Makefile
930 (substitute* "Makefile"
931 ;; Adjust syntax to make it compatible with GNU Make.
933 ;; Help install(1) create the target directory.
934 (("\\$\\{PREFIX\\}") "-D -t ${PREFIX}"))
936 #:tests? #f)) ;no tests
939 (synopsis "Patch binary files")
941 "@command{bsdiff} and @command{bspatch} are tools for building and
942 applying patches to binary files. By using suffix sorting (specifically
943 Larsson and Sadakane's @code{qsufsort}) and taking advantage of how
944 executable files change, bsdiff routinely produces binary patches 50-80%
945 smaller than those produced by @code{Xdelta}.")
946 (license license:bsd-2)))
948 (define-public cabextract
951 (home-page "https://cabextract.org.uk/")
955 (uri (string-append home-page name "-" version ".tar.gz"))
958 "1hf4zhjxfdgq9x172r5zfdnafma9q0zf7372syn8hcn7hcypkg0v"))
959 (modules '((guix build utils)))
962 ;; Delete bundled libmspack.
963 (delete-file-recursively "mspack")
965 (build-system gnu-build-system)
967 '(#:configure-flags '("--with-external-libmspack")
969 (modify-phases %standard-phases
970 ;; cabextract needs some of libmspack's header files.
971 ;; These are located in the "mspack" directory of libmspack.
972 (add-before 'build 'unpack-libmspack
973 (lambda* (#:key inputs #:allow-other-keys)
974 (let ((dir-name "libmspack-src"))
976 (invoke "tar" "-xvf" (assoc-ref inputs "libmspack-source")
977 "-C" dir-name "--strip-components" "1")
978 (rename-file (string-append dir-name "/mspack")
980 (delete-file-recursively dir-name)
983 `(("pkg-config" ,pkg-config)))
985 `(("libmspack" ,libmspack)
986 ("libmspack-source" ,(package-source libmspack))))
987 (synopsis "Tool to unpack Cabinet archives")
988 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
989 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
990 (license license:gpl3+)))
992 (define-public xdelta
1000 (url "https://github.com/jmacd/xdelta.git")
1001 (commit (string-append "v" version))))
1002 (file-name (git-file-name name version))
1005 "09mmsalc7dwlvgrda56s2k927rpl3a5dzfa88aslkqcjnr790wjy"))
1007 ;; This file isn't freely distributable and has no effect on building.
1009 (delete-file "xdelta3/draft-korn-vcdiff.txt")
1011 (build-system gnu-build-system)
1013 `(("autoconf" ,autoconf)
1014 ("automake" ,automake)))
1017 (modify-phases %standard-phases
1018 (add-after 'unpack 'enter-build-directory
1019 (lambda _ (chdir "xdelta3") #t)))))
1020 (home-page "http://xdelta.org")
1021 (synopsis "Delta encoder for binary files")
1022 (description "xdelta encodes only the differences between two binary files
1023 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
1024 also be used to apply such patches. xdelta is similar to @command{diff} and
1025 @command{patch}, but is not limited to plain text and does not generate
1026 human-readable output.")
1027 (license license:asl2.0)))
1029 (define-public lrzip
1037 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
1040 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))
1041 (patches (search-patches "lrzip-CVE-2017-8842.patch"))))
1042 (build-system gnu-build-system)
1044 `(;; nasm is only required when building for 32-bit x86 platforms
1045 ,@(if (string-prefix? "i686" (or (%current-target-system)
1054 (home-page "http://ck.kolivas.org/apps/lrzip/")
1055 (synopsis "Large file compressor with a very high compression ratio")
1056 (description "lrzip is a compression utility that uses long-range
1057 redundancy reduction to improve the subsequent compression ratio of
1058 larger files. It can then further compress the result with the ZPAQ or
1059 LZMA algorithms for maximum compression, or LZO for maximum speed. This
1060 choice between size or speed allows for either better compression than
1061 even LZMA can provide, or a higher speed than gzip while compressing as
1063 (license (list license:gpl3+
1064 license:public-domain)))) ; most files in lzma/
1066 (define-public snappy
1073 (uri (string-append "https://github.com/google/snappy/archive/"
1075 (file-name (string-append "snappy-" version ".tar.gz"))
1077 (base32 "1m7rcdqzkys5lspj8jcsaah8w33zh28s771bw0ga2lgzfgl05yix"))
1078 (patches (search-patches "snappy-add-O2-flag-in-CmakeLists.txt.patch"))))
1079 (build-system cmake-build-system)
1081 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
1082 (home-page "https://github.com/google/snappy")
1083 (synopsis "Fast compressor/decompressor")
1084 (description "Snappy is a compression/decompression library. It does not
1085 aim for maximum compression, or compatibility with any other compression library;
1086 instead, it aims for very high speeds and reasonable compression. For instance,
1087 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
1088 for most inputs, but the resulting compressed files are anywhere from 20% to
1090 (license license:asl2.0)))
1092 (define-public p7zip
1098 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1099 version "/" name "_" version
1100 "_src_all.tar.bz2"))
1103 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1104 (modules '((guix build utils)))
1107 ;; Remove non-free source files
1108 (for-each delete-file
1110 (find-files "CPP/7zip/Compress" "Rar.*")
1111 (find-files "CPP/7zip/Crypto" "Rar.*")
1112 (find-files "DOC/unRarLicense.txt")
1113 (find-files "Utils/file_Codecs_Rar_so.py")))
1114 (delete-file-recursively "CPP/7zip/Archive/Rar")
1115 (delete-file-recursively "CPP/7zip/Compress/Rar")
1117 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1118 "p7zip-CVE-2017-17969.patch"
1119 "p7zip-remove-unused-code.patch"))))
1120 (build-system gnu-build-system)
1123 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1125 (modify-phases %standard-phases
1127 (lambda* (#:key system outputs #:allow-other-keys)
1129 (let ((system ,(or (%current-target-system)
1130 (%current-system))))
1132 ((string-prefix? "x86_64" system)
1133 "makefile.linux_amd64_asm")
1134 ((string-prefix? "i686" system)
1135 "makefile.linux_x86_asm_gcc_4.X")
1137 "makefile.linux_any_cpu_gcc_4.X")))
1138 "makefile.machine")))
1141 (invoke "make" "test")
1142 (invoke "make" "test_7z")
1143 (invoke "make" "test_7zr"))))))
1145 (let ((system (or (%current-target-system)
1146 (%current-system))))
1147 `(,@(cond ((string-prefix? "x86_64" system)
1149 ((string-prefix? "i686" system)
1152 (home-page "http://p7zip.sourceforge.net/")
1153 (synopsis "Command-line file archiver with high compression ratio")
1154 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1155 handles the 7z format which features very high compression ratios.")
1156 (license (list license:lgpl2.1+
1158 license:public-domain))))
1160 (define-public gzstream
1167 ;; No versioned URL, but last release was in 2003.
1168 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1169 (file-name (string-append name "-" version ".tgz"))
1172 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1173 (modules '((guix build utils)))
1175 ;; Remove pre-compiled object.
1177 (delete-file "gzstream.o")
1179 (build-system gnu-build-system)
1181 `(#:test-target "test"
1183 (modify-phases %standard-phases
1186 (lambda* (#:key outputs #:allow-other-keys)
1187 (let* ((out (assoc-ref outputs "out"))
1188 (lib (string-append out "/lib"))
1189 (include (string-append out "/include")))
1190 (install-file "libgzstream.a" lib)
1191 (install-file "gzstream.h" include)
1193 (propagated-inputs `(("zlib" ,zlib)))
1194 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1195 (synopsis "Compressed C++ iostream")
1196 (description "gzstream is a small library for providing zlib
1197 functionality in a C++ iostream.")
1198 (license license:lgpl2.1+)))
1206 (method url-fetch/zipbomb)
1207 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1208 (string-delete #\. version) ".zip"))
1211 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1212 (modules '((guix build utils)))
1214 ;; Delete irrelevant pre-compiled binaries.
1216 (for-each delete-file (find-files "." "\\.exe$"))
1218 (build-system gnu-build-system)
1221 (modify-phases %standard-phases
1222 (delete 'configure)) ; no ‘configure’ script
1225 (string-append "CPPFLAGS=-Dunix"
1226 ,(match (or (%current-target-system)
1231 ;; These should be safe, lowest-common-denominator instruction sets,
1232 ;; allowing for some optimisation while remaining reproducible.
1233 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1234 ,(match (or (%current-target-system)
1236 ("x86_64-linux" " -march=nocona -mtune=generic")
1237 ("i686-linux" " -march=i686 -mtune=generic")
1238 ("armhf-linux" " -mtune=generic-armv7-a")
1240 (string-append "PREFIX="
1241 (assoc-ref %outputs "out")))))
1243 `(("perl" ,perl))) ; for pod2man
1244 (home-page "http://mattmahoney.net/dc/zpaq.html")
1245 (synopsis "Incremental journaling archiver")
1246 (description "ZPAQ is a command-line archiver for realistic situations with
1247 many duplicate and already compressed files. It backs up only those files
1248 modified since the last update. All previous versions remain untouched and can
1249 be independently recovered. Identical files are only stored once (known as
1250 @dfn{de-duplication}). Archives can also be encrypted.
1252 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1253 owner and group IDs, ACLs, extended attributes, or special file types like
1254 devices, sockets, or named pipes. It does not follow or restore symbolic links
1255 or junctions, and always follows hard links.")
1256 (license (list license:public-domain
1257 ;; libzpaq.cpp contains a mix of public-domain and
1258 ;; expat-licenced (or ‘MIT’) code.
1261 (define-public unshield
1266 (origin (method url-fetch)
1267 (uri (string-append "http://github.com/twogood/unshield/archive/"
1269 (file-name (string-append name "-" version ".tar.gz"))
1272 "0x7ps644yp5dka2zhb8w0ifqmw3d255jafpzfwv8xbcpgq6fmm2x"))))
1273 (build-system cmake-build-system)
1276 ("openssl" ,openssl)
1277 ;; test data that is otherwise downloaded with curl
1278 ("unshield-avigomanager11b22.zip"
1281 (uri (string-append "https://www.dropbox.com/s/8r4b6752swe3nhu/"
1282 "unshield-avigomanager11b22.zip?dl=1"))
1284 (base32 "0fwq7lih04if68wpwpsk5wjqyvh32db76a41sq6gbx4dn1lc3ddn"))
1285 (file-name "unshield-avigomanager11b22.zip")))
1286 ("unshield-the-feeble-files-spanish.zip"
1289 (uri (string-append "https://www.dropbox.com/s/1ng0z9kfxc7eb1e/"
1290 "unshield-the-feeble-files-spanish.zip?dl=1"))
1292 (base32 "1k5cw6vnpja8yjlnhx5124xrw9i8s1l539hfdqqrqz3l5gn0bnyd"))
1293 (file-name "unshield-the-feeble-files-spanish.zip")))))
1295 `(("unzip" ,unzip)))
1297 `(#:out-of-source? #f
1299 (modify-phases %standard-phases
1300 (add-before 'check 'pre-check
1301 (lambda* (#:key inputs #:allow-other-keys)
1302 (for-each (lambda (i)
1303 (copy-file (assoc-ref inputs i)
1304 (string-append "test/v0/" i)))
1305 '("unshield-avigomanager11b22.zip"
1306 "unshield-the-feeble-files-spanish.zip"))
1307 (substitute* (find-files "test/" "/*\\.sh")
1308 ;; Tests expect the unshield binary in a specific
1310 (("/var/tmp/unshield/bin/unshield")
1311 (string-append (getcwd) "/src/unshield"))
1312 ;; We no longer need to download the data.
1314 (("curl -(|f)sSL -o test.zip .*") ""))
1315 (substitute* "test/v0/avigomanager.sh"
1317 (string-append (getcwd)
1318 "/test/v0/unshield-avigomanager11b22.zip")))
1319 (substitute* "test/v0/the-feeble-files-spanish.sh"
1321 (string-append (getcwd)
1322 "/test/v0/unshield-the-feeble-files-spanish.zip")))
1326 (invoke "./run-tests.sh"))))))
1327 (home-page "https://github.com/twogood/unshield")
1328 (synopsis "Extract CAB files from InstallShield installers")
1330 "@command{unshield} is a tool and library for extracting @file{.cab}
1331 archives from InstallShield installers.")
1332 (license license:expat)))
1341 (uri (string-append "https://github.com/facebook/zstd/releases/download/"
1342 "v" version "/zstd-" version ".tar.gz"))
1344 (base32 "13nlsqhkn276frxrzjdn7wz0j9zz414lf336885ykyxcvw2a0gr9"))))
1345 (build-system gnu-build-system)
1348 (modify-phases %standard-phases
1349 (delete 'configure)) ; no configure script
1352 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1353 ;; Skip auto-detection of, and creating a dependency on, the build
1354 ;; environment's ‘xz’ for what amounts to a dubious feature anyway.
1356 ;; Not currently detected, but be explicit & avoid surprises later.
1359 (home-page "https://facebook.github.io/zstd/")
1360 (synopsis "Zstandard real-time compression algorithm")
1361 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1362 that combines very fast operation with a compression ratio comparable to that of
1363 zlib. In most scenarios, both compression and decompression can be performed in
1364 ‘real time’. The compressor can be configured to provide the most suitable
1365 trade-off between compression ratio and speed, without affecting decompression
1367 (license (list license:bsd-3 ; the main top-level LICENSE file
1368 license:bsd-2 ; many files explicitly state 2-Clause
1369 license:gpl2 ; the main top-level COPYING file
1370 license:gpl3+ ; tests/gzip/*.sh
1371 license:expat ; lib/dictBuilder/divsufsort.[ch]
1372 license:public-domain ; zlibWrapper/examples/fitblk*
1373 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1375 (define-public pzstd
1378 (version (package-version zstd))
1379 (source (package-source zstd))
1380 (build-system gnu-build-system)
1382 `(("googletest" ,googletest)))
1385 (modify-phases %standard-phases
1386 (add-after 'unpack 'enter-subdirectory
1387 (lambda _ (chdir "contrib/pzstd") #t))
1388 (delete 'configure) ; no configure script
1389 (add-before 'check 'compile-tests
1390 (lambda* (#:key make-flags #:allow-other-keys)
1391 (apply invoke "make" "tests" make-flags)))
1392 (add-after 'install 'install-documentation
1393 (lambda* (#:key outputs #:allow-other-keys)
1394 (let* ((out (assoc-ref outputs "out"))
1395 (doc (string-append out "/share/doc/" ,name)))
1397 (install-file "README.md" doc)
1401 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1402 (home-page (package-home-page zstd))
1403 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1404 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1405 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1406 compression algorithm}. It is fully compatible with the original Zstandard file
1407 format and command-line interface, and can be used as a drop-in replacement.
1409 Compression is distributed over multiple processor cores to improve performance,
1410 as is the decompression of data compressed in this manner. Data compressed by
1411 other implementations will only be decompressed by two threads: one performing
1412 the actual decompression, the other input and output.")
1413 (license (package-license zstd))))
1422 (uri (string-append "mirror://sourceforge/infozip"
1423 "/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz"))
1426 "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"))))
1427 (build-system gnu-build-system)
1428 (inputs `(("bzip2" ,bzip2)))
1430 `(#:tests? #f ; no test target
1431 #:make-flags (let ((out (assoc-ref %outputs "out")))
1432 (list "-f" "unix/Makefile"
1433 (string-append "prefix=" out)
1434 (string-append "MANDIR=" out "/share/man/man1")))
1436 (modify-phases %standard-phases
1438 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1439 (apply invoke "make" "generic_gcc" make-flags)))
1440 (delete 'configure))))
1441 (home-page "http://www.info-zip.org/Zip.html")
1442 (synopsis "Compression and file packing utility")
1444 "Zip is a compression and file packaging/archive utility. Zip is useful
1445 for packaging a set of files for distribution, for archiving files, and for
1446 saving disk space by temporarily compressing unused files or directories.
1447 Zip puts one or more compressed files into a single ZIP archive, along with
1448 information about the files (name, path, date, time of last modification,
1449 protection, and check information to verify file integrity). An entire
1450 directory structure can be packed into a ZIP archive with a single command.
1452 Zip has one compression method (deflation) and can also store files without
1453 compression. Zip automatically chooses the better of the two for each file.
1454 Compression ratios of 2:1 to 3:1 are common for text files.")
1455 (license (license:non-copyleft "file://LICENSE"
1456 "See LICENSE in the distribution."))))
1458 (define-public unzip
1459 (package (inherit zip)
1465 (uri (string-append "mirror://sourceforge/infozip"
1466 "/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz"))
1469 "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83"))
1470 (patches (search-patches "unzip-CVE-2014-8139.patch"
1471 "unzip-CVE-2014-8140.patch"
1472 "unzip-CVE-2014-8141.patch"
1473 "unzip-CVE-2014-9636.patch"
1474 "unzip-CVE-2015-7696.patch"
1475 "unzip-CVE-2015-7697.patch"
1476 "unzip-allow-greater-hostver-values.patch"
1477 "unzip-initialize-symlink-flag.patch"
1478 "unzip-remove-build-date.patch"
1479 "unzip-attribs-overflow.patch"
1480 "unzip-overflow-on-invalid-input.patch"
1481 "unzip-format-secure.patch"
1482 "unzip-overflow-long-fsize.patch"))))
1483 (build-system gnu-build-system)
1484 ;; no inputs; bzip2 is not supported, since not compiled with BZ_NO_STDIO
1486 `(#:phases (modify-phases %standard-phases
1488 (add-after 'unpack 'fortify
1490 ;; Mitigate CVE-2018-1000035, an exploitable buffer overflow.
1491 ;; This environment variable is recommended in 'unix/Makefile'
1492 ;; for passing flags to the C compiler.
1493 (setenv "LOCAL_UNZIP" "-D_FORTIFY_SOURCE=1")
1496 (lambda* (#:key make-flags #:allow-other-keys)
1497 (apply invoke "make"
1498 `("-j" ,(number->string
1499 (parallel-job-count))
1502 #:make-flags (list "-f" "unix/Makefile"
1503 (string-append "prefix=" %output)
1504 (string-append "MANDIR=" %output "/share/man/man1"))))
1505 (home-page "http://www.info-zip.org/UnZip.html")
1506 (synopsis "Decompression and file extraction utility")
1508 "UnZip is an extraction utility for archives compressed in .zip format,
1509 also called \"zipfiles\".
1511 UnZip lists, tests, or extracts files from a .zip archive. The default
1512 behaviour (with no options) is to extract into the current directory, and
1513 subdirectories below it, all files from the specified zipfile. UnZip
1514 recreates the stored directory structure by default.")
1515 (license (license:non-copyleft "file://LICENSE"
1516 "See LICENSE in the distribution."))))
1518 (define-public zziplib
1522 (home-page "https://github.com/gdraheim/zziplib")
1526 (uri (string-append home-page "/archive/v" version ".tar.gz"))
1529 "0i052a7shww0fzsxrdp3rd7g4mbzx7324a8ysbc0br7frpblcql4"))))
1530 (build-system gnu-build-system)
1533 (native-inputs `(("perl" ,perl) ; for the documentation
1534 ("pkg-config" ,pkg-config)
1535 ;; for the documentation; Python 3 not supported,
1536 ;; http://forums.gentoo.org/viewtopic-t-863161-start-0.html
1537 ("python" ,python-2)
1538 ("zip" ,zip))) ; to create test files
1539 (synopsis "Library for accessing zip files")
1541 "ZZipLib is a library based on zlib for accessing zip files.")
1542 ;; zziplib is dual licensed under LGPL2.0+ and MPL1.1. Some example source
1543 ;; files carry the Zlib license; see "docs/copying.html" for details.
1544 (license (list license:lgpl2.0+ license:mpl1.1))))
1546 (define-public libzip
1553 "https://libzip.org/download/" name "-" version ".tar.xz"))
1556 "0wnkkvkq90wyawj9221i77sf3nix1vj3ygzdy59k8yvcjnv3bsh4"))))
1561 (build-system cmake-build-system)
1562 (home-page "https://libzip.org")
1563 (synopsis "C library for reading, creating, and modifying zip archives")
1564 (description "Libzip is a C library for reading, creating, and modifying
1565 zip archives. Files can be added from data buffers, files, or compressed data
1566 copied directly from other zip archives. Changes made without closing the
1567 archive can be reverted.")
1568 (license license:bsd-3)))
1570 (define-public atool
1577 (uri (string-append "http://savannah.nongnu.org/download/atool/atool-"
1581 "0fvhzip2v08jgnlfpyj6rapan39xlsl1ksgq4lp8gfsai2ah1xma"))))
1582 (build-system gnu-build-system)
1585 (modify-phases %standard-phases
1586 (add-after 'unpack 'embed-absolute-file-name
1587 (lambda* (#:key inputs #:allow-other-keys)
1588 (substitute* "atool"
1589 (("(^\\$::cfg_path_file.*= )'file'" _ pre)
1590 (string-append pre "'" (assoc-ref inputs "file")
1596 (home-page "https://www.nongnu.org/atool/")
1597 (synopsis "Universal tool to manage file archives of various types")
1598 (description "The main command is @command{aunpack} which extracts files
1599 from an archive. The other commands provided are @command{apack} (to create
1600 archives), @command{als} (to list files in archives), and @command{acat} (to
1601 extract files to standard out). As @command{atool} invokes external programs
1602 to handle the archives, not all commands may be supported for a certain type
1604 (license license:gpl2+)))
1606 (define-public lunzip
1613 (uri (string-append "mirror://savannah/lzip/"
1614 name "/" name "-" version ".tar.gz"))
1616 (base32 "1iw59br6nsxs7l1p875h8w3vxwr04xfhg5zyal64crvamhxkj5kl"))))
1617 (build-system gnu-build-system)
1621 (home-page "https://www.nongnu.org/lzip/lunzip.html")
1622 (synopsis "Small, stand-alone lzip decompressor")
1624 "Lunzip is a decompressor for files in the lzip compression format (.lz),
1625 written as a single small C tool with no dependencies. This makes it
1626 well-suited to embedded and other systems without a C++ compiler, or for use in
1627 applications such as software installers that need only to decompress files,
1629 Lunzip is intended to be fully compatible with the regular lzip package.")
1630 (license (list license:bsd-2 ; carg_parser.[ch]
1631 license:gpl2+)))) ; everything else
1633 (define-public clzip
1640 (uri (string-append "mirror://savannah/lzip/"
1641 name "/" name "-" version ".tar.gz"))
1643 (base32 "03xcmhl3dya4jrwmsqh09ikimpb36fr3vkh2bwfzz1sbcns0cdg3"))))
1644 (build-system gnu-build-system)
1648 (home-page "https://www.nongnu.org/lzip/clzip.html")
1649 (synopsis "Small, stand-alone lzip compressor and decompressor")
1651 "Clzip is a compressor and decompressor for files in the lzip compression
1652 format (.lz), written as a single small C tool with no dependencies. This makes
1653 it well-suited to embedded and other systems without a C++ compiler, or for use
1654 in other applications like package managers.
1655 Clzip is intended to be fully compatible with the regular lzip package.")
1656 (license (list license:bsd-2 ; carg_parser.[ch], lzd in clzip.texi
1659 (define-public lzlib
1666 (uri (string-append "mirror://savannah/lzip/"
1667 name "/" name "-" version ".tar.gz"))
1669 (base32 "0hqhnj2lzqacdbmmnpy91lsm1rd9zlngs1q6s9pyahsv1a0bfshx"))))
1670 (build-system gnu-build-system)
1671 ;; The included minilzip binary is only ~16 smaller than the ‘real’ lzip.
1672 ;; It's used during the test suite, but don't be tempted to install it.
1676 "--enable-shared"))) ; only static (.a) is built by default
1677 (home-page "https://www.nongnu.org/lzip/lzlib.html")
1678 (synopsis "Lzip data compression C library")
1680 "Lzlib is a C library for in-memory LZMA compression and decompression in
1681 the lzip format. It supports integrity checking of the decompressed data, and
1682 all functions are thread-safe. The library should never crash, even in case of
1684 (license (list license:bsd-2 ; the library itself
1685 license:gpl2+)))) ; main.c (i.e. minilzip used by tests)
1687 (define-public plzip
1694 (uri (string-append "mirror://savannah/lzip/"
1695 name "/" name "-" version ".tar.gz"))
1697 (base32 "1dzjp9r7krwpsn224bhcqbzd5aj5b4556sdi9yzl2bzbk3fjrqlm"))))
1698 (build-system gnu-build-system)
1700 `(("lzlib" ,lzlib)))
1701 (home-page "https://www.nongnu.org/lzip/plzip.html")
1702 (synopsis "Parallel lossless data compressor for the lzip format")
1704 "Plzip is a massively parallel (multi-threaded) lossless data compressor
1705 and decompressor that uses the lzip file format (.lz). Files produced by plzip
1706 are fully compatible with lzip and can be rescued with lziprecover.
1707 On multiprocessor machines, plzip can compress and decompress large files much
1708 faster than lzip, at the cost of a slightly reduced compression ratio (0.4% to
1709 2%). The number of usable threads is limited by file size: on files of only a
1710 few MiB, plzip is no faster than lzip.
1711 Files that were compressed with regular lzip will also not be decompressed
1712 faster by plzip, unless the @code{-b} option was used: lzip usually produces
1713 single-member files which can't be decompressed in parallel.")
1714 (license (list license:bsd-2 ; arg_parser.{cc,h}
1715 license:gpl2+)))) ; everything else
1717 (define-public innoextract
1719 (name "innoextract")
1724 (uri (string-append "https://github.com/dscharrer/innoextract/archive/"
1728 "0khwi9f0q0h6xfbixrrc1rfpgj0b7ajwilq7yhmxnn5lpc807f6x"))
1729 (file-name (string-append name "-" version ".tar.gz"))))
1730 (build-system cmake-build-system)
1732 `(#:tests? #f)) ;; No tests available.
1733 (inputs `(("boost" ,boost)
1734 ("libiconv" ,libiconv)
1736 (native-inputs `(("pkg-config" ,pkg-config)))
1737 (home-page "https://constexpr.org/innoextract/")
1738 (synopsis "Tool for extracting Inno Setup installers")
1739 (description "innoextract allows extracting Inno Setup installers under
1740 non-Windows systems without running the actual installer using wine.")
1741 (license license:zlib)))
1743 (define-public google-brotli
1745 (name "google-brotli")
1749 (uri (string-append "https://github.com/google/brotli/archive/v"
1753 "1hrpmz162k4x3xm6vmbpm443jlfr1kp536p8962y2dncy7gs6s12"))))
1754 (build-system cmake-build-system)
1757 (modify-phases %standard-phases
1758 (add-after 'install 'rename-static-libraries
1759 ;; The build tools put a 'static' suffix on the static libraries, but
1760 ;; other applications don't know how to find these.
1761 (lambda* (#:key outputs #:allow-other-keys)
1762 (let ((lib (string-append (assoc-ref %outputs "out") "/lib/")))
1763 (rename-file (string-append lib "libbrotlicommon-static.a")
1764 (string-append lib "libbrotlicommon.a"))
1765 (rename-file (string-append lib "libbrotlidec-static.a")
1766 (string-append lib "libbrotlidec.a"))
1767 (rename-file (string-append lib "libbrotlienc-static.a")
1768 (string-append lib "libbrotlienc.a"))
1771 (list ;; Defaults to "lib64" on 64-bit archs.
1772 (string-append "-DCMAKE_INSTALL_LIBDIR="
1773 (assoc-ref %outputs "out") "/lib"))))
1774 (home-page "https://github.com/google/brotli")
1775 (synopsis "General-purpose lossless compression")
1776 (description "This package provides the reference implementation of Brotli,
1777 a generic-purpose lossless compression algorithm that compresses data using a
1778 combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd
1779 order context modeling, with a compression ratio comparable to the best
1780 currently available general-purpose compression methods. It is similar in speed
1781 with @code{deflate} but offers more dense compression.
1783 The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
1784 (license license:expat)))
1792 (uri (string-append "http://www.oberhumer.com/opensource/"
1793 name "/download/" name "-" version ".tar.gz"))
1796 "0j036lkwsxvm15gr29n8wn07cqq79dswjs9k54939ms5zngjjrdq"))))
1797 (build-system gnu-build-system)
1798 (home-page "http://www.oberhumer.com/opensource/ucl/")
1799 (synopsis "Portable lossless data compression library")
1800 (description "UCL implements a number of compression algorithms that
1801 achieve an excellent compression ratio while allowing fast decompression.
1802 Decompression requires no additional memory.
1804 Compared to LZO, the UCL algorithms achieve a better compression ratio but
1805 decompression is a little bit slower.")
1806 (license license:gpl2+)))
1814 (uri (string-append "https://github.com/upx/upx/releases/download/v"
1815 version "/" name "-" version "-src.tar.xz"))
1818 "08anybdliqsbsl6x835iwzljahnm9i7v26icdjkcv33xmk6p5vw1"))
1819 (patches (search-patches "upx-fix-CVE-2017-15056.patch"))))
1820 (build-system gnu-build-system)
1821 (native-inputs `(("perl" ,perl)
1823 (inputs `(("zlib" ,zlib)))
1827 ;; CHECK_WHITESPACE does not seem to work.
1828 ;; See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/upx.
1829 "CHECK_WHITESPACE=true")
1831 (modify-phases %standard-phases
1835 (add-before 'build 'patch-exec-bin-sh
1837 (substitute* (find-files "Makefile")
1838 (("/bin/sh") (which "sh")))
1839 (substitute* "src/Makefile"
1840 (("/bin/sh") (which "sh")))
1842 (add-after 'build 'install-upx
1843 (lambda* (#:key outputs #:allow-other-keys)
1844 (let* ((out (assoc-ref outputs "out"))
1845 (bin (string-append out "/bin")))
1847 (copy-file "src/upx.out" (string-append bin "/upx")))
1850 (home-page "https://upx.github.io/")
1851 ;; CVE-2017-16869 is about Mach-O files which is not of a big concern for Guix.
1852 ;; See https://github.com/upx/upx/issues/146 and
1853 ;; https://nvd.nist.gov/vuln/detail?vulnId=CVE-2017-16869.
1854 ;; The issue will be fixed after version 3.94.
1855 (properties `((lint-hidden-cve . ("CVE-2017-16869"))))
1856 (synopsis "Compression tool for executables")
1858 "The Ultimate Packer for eXecutables (UPX) is an executable file
1859 compressor. UPX typically reduces the file size of programs and shared
1860 libraries by around 50%--70%, thus reducing disk space, network load times,
1861 download times, and other distribution and storage costs.")
1862 (license license:gpl2+)))