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 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 Ricardo Wurmus <rekado@elephly.net>
8 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
9 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
10 ;;; Copyright © 2015, 2016, 2017 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 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2016 David Craven <david@craven.ch>
15 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
16 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages compression)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix utils)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system perl)
42 #:use-module (guix build-system python)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages assembly)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages backup)
47 #:use-module (gnu packages base)
48 #:use-module (gnu packages perl)
49 #:use-module (gnu packages pkg-config)
50 #:use-module (gnu packages python)
51 #:use-module (gnu packages valgrind)
52 #:use-module (ice-9 match)
53 #:use-module ((srfi srfi-1) #:select (last)))
62 (uri (list (string-append "http://zlib.net/zlib-"
64 (string-append "mirror://sourceforge/libpng/zlib/"
65 version "/zlib-" version ".tar.gz")))
68 "039agw5rqvqny92cpkrfn243x2gd4xn13hs3xi6isk55d2vqqr9n"))))
69 (build-system gnu-build-system)
71 `(#:phases (alist-replace
73 (lambda* (#:key outputs #:allow-other-keys)
74 ;; Zlib's home-made `configure' fails when passed
75 ;; extra flags like `--enable-fast-install', so we need to
76 ;; invoke it with just what it understand.
77 (let ((out (assoc-ref outputs "out")))
78 ;; 'configure' doesn't understand '--host'.
79 ,@(if (%current-target-system)
80 `((setenv "CHOST" ,(%current-target-system)))
83 (system* "./configure"
84 (string-append "--prefix=" out)))))
86 (home-page "http://zlib.net/")
87 (synopsis "Compression library")
89 "zlib is designed to be a free, general-purpose, legally unencumbered --
90 that is, not covered by any patents -- lossless data-compression library for
91 use on virtually any computer hardware and operating system. The zlib data
92 format is itself portable across platforms. Unlike the LZW compression method
93 used in Unix compress(1) and in the GIF image format, the compression method
94 currently used in zlib essentially never expands the data. (LZW can double or
95 triple the file size in extreme cases.) zlib's memory footprint is also
96 independent of the input data and can be reduced, if necessary, at some cost
98 (license license:zlib)))
100 (define-public fastjar
106 (uri (string-append "mirror://savannah/fastjar/fastjar-"
110 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
111 (build-system gnu-build-system)
112 (inputs `(("zlib" ,zlib)))
113 (home-page "http://savannah.nongnu.org/projects/fastjar")
114 (synopsis "Replacement for Sun's 'jar' utility")
116 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
117 utility. Instead of being written in Java, FastJar is written in C.")
118 (license license:gpl2+)))
120 (define-public libtar
128 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
131 "mirror://debian/pool/main/libt/libtar/libtar_"
132 version ".orig.tar.gz")))
135 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
136 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
137 (build-system gnu-build-system)
139 `(#:tests? #f ;no "check" target
141 (modify-phases %standard-phases
142 (add-after 'unpack 'autoconf
143 (lambda _ (zero? (system* "sh" "autoreconf" "-vfi")))))))
145 `(("autoconf" ,autoconf)
146 ("automake" ,automake)
147 ("libtool" ,libtool)))
150 (synopsis "C library for manipulating POSIX tar files")
152 "libtar is a C library for manipulating POSIX tar files. It handles
153 adding and extracting files to/from a tar archive.")
154 (home-page "https://repo.or.cz/libtar.git")
155 (license license:bsd-3)))
163 (uri (string-append "mirror://gnu/gzip/gzip-"
167 "1lxv3p4iyx7833mlihkn5wfwmz4cys5nybwpz3dfawag8kn6f5zz"))))
168 (build-system gnu-build-system)
169 (synopsis "General file (de)compression (using lzw)")
171 ;; FIXME: The test suite wants `less', and optionally Perl.
174 "GNU Gzip provides data compression and decompression utilities; the
175 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
176 file; as a result, it is often used in conjunction with \"tar\", resulting in
177 \".tar.gz\" or \".tgz\", etc.")
178 (license license:gpl3+)
179 (home-page "http://www.gnu.org/software/gzip/")))
182 (let ((build-shared-lib
183 ;; Build a shared library.
184 '(lambda* (#:key inputs #:allow-other-keys)
185 (patch-makefile-SHELL "Makefile-libbz2_so")
186 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
188 '(lambda* (#:key outputs #:allow-other-keys)
189 (let* ((out (assoc-ref outputs "out"))
190 (libdir (string-append out "/lib")))
191 (for-each (lambda (file)
192 (let ((base (basename file)))
193 (format #t "installing `~a' to `~a'~%"
196 (string-append libdir "/" base))))
197 (find-files "." "^libbz2\\.so")))))
198 (set-cross-environment
199 '(lambda* (#:key target #:allow-other-keys)
200 (substitute* (find-files "." "Makefile")
202 (string-append "CC = " target "-gcc\n"))
204 (string-append "AR = " target "-ar\n"))
206 (string-append "RANLIB = " target "-ranlib\n"))
207 (("^all:(.*)test" _ prerequisites)
208 ;; Remove 'all' -> 'test' dependency.
209 (string-append "all:" prerequisites "\n"))))))
215 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
219 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
220 (build-system gnu-build-system)
222 `(#:modules ((guix build gnu-build-system)
226 ,(if (%current-target-system)
228 ;; Cross-compilation: use the cross tools.
230 'build 'build-shared-lib ,build-shared-lib
232 'install 'install-shared-lib ,install-shared-lib
233 (alist-replace 'configure ,set-cross-environment
236 ;; Native compilation: build the shared library.
238 'build 'build-shared-lib ,build-shared-lib
240 'install 'install-shared-lib ,install-shared-lib
241 (alist-delete 'configure %standard-phases))))
243 #:make-flags (list (string-append "PREFIX="
244 (assoc-ref %outputs "out")))
246 ;; Don't attempt to run the tests when cross-compiling.
247 ,@(if (%current-target-system)
250 (synopsis "High-quality data compression program")
252 "bzip2 is a freely available, patent free (see below), high-quality data
253 compressor. It typically compresses files to within 10% to 15% of the best
254 available techniques (the PPM family of statistical compressors), whilst
255 being around twice as fast at compression and six times faster at
257 (license (license:non-copyleft "file://LICENSE"
258 "See LICENSE in the distribution."))
259 (home-page "http://www.bzip.org/"))))
261 (define-public lbzip2
267 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
271 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))))
272 (build-system gnu-build-system)
273 (synopsis "Parallel bzip2 compression utility")
275 "lbzip2 is a multi-threaded compression utility with support for the
276 bzip2 compressed file format. lbzip2 can process standard bz2 files in
277 parallel. It uses POSIX threading model (pthreads), which allows it to take
278 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
279 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
280 compatible with bzip2 – both at file format and command line level.")
281 (home-page "http://www.lbzip2.org/")
282 (license license:gpl3+)))
284 (define-public pbzip2
290 (uri (string-append "https://launchpad.net/pbzip2/"
291 (version-major+minor version) "/" version
292 "/+download/" name "-" version ".tar.gz"))
295 "1vk6065dv3a47p86vmp8hv3n1ygd9hraz0gq89gvzlx7lmcb6fsp"))))
296 (build-system gnu-build-system)
300 `(#:tests? #f ; no tests
301 #:phases (modify-phases %standard-phases
303 #:make-flags (list (string-append "PREFIX=" %output))))
304 (home-page "http://compression.ca/pbzip2/")
305 (synopsis "Parallel bzip2 implementation")
307 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
308 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
309 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
310 compressed with pbzip2 can be decompressed with bzip2).")
311 (license (license:non-copyleft "file://COPYING"
312 "See COPYING in the distribution."))))
320 (uri (list (string-append "http://tukaani.org/xz/xz-" version
322 (string-append "http://multiprecision.org/guix/xz-"
326 "18h2k4jndhzjs8ln3a54qdnfv59y6spxiwh9gpaqniph6iflvpvk"))))
327 (build-system gnu-build-system)
328 (synopsis "General-purpose data compression")
330 "XZ Utils is free general-purpose data compression software with high
331 compression ratio. XZ Utils were written for POSIX-like systems, but also
332 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
334 The core of the XZ Utils compression code is based on LZMA SDK, but it has
335 been modified quite a lot to be suitable for XZ Utils. The primary
336 compression algorithm is currently LZMA2, which is used inside the .xz
337 container format. With typical files, XZ Utils create 30 % smaller output
338 than gzip and 15 % smaller output than bzip2.")
339 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
340 (home-page "http://tukaani.org/xz/")))
349 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
353 "0k5kpj3jnsjfxqqkblpfpx0mqcy86zs5fhjhgh2kq1hksg7ag57j"))))
354 (build-system gnu-build-system)
355 (arguments '(#:configure-flags '("--enable-shared")))
356 (home-page "http://www.oberhumer.com/opensource/lzo")
358 "Data compression library suitable for real-time data de-/compression")
360 "LZO is a data compression library which is suitable for data
361 de-/compression in real-time. This means it favours speed over
364 LZO is written in ANSI C. Both the source code and the compressed data
365 format are designed to be portable across platforms.")
366 (license license:gpl2+)))
368 (define-public python-lzo
375 (uri (pypi-uri "python-lzo" version))
378 "11p3ifg14p086byhhin6azx5svlkg8dzw2b5abixik97xd6fm81q"))))
379 (build-system python-build-system)
381 `(#:test-target "check"
383 (modify-phases %standard-phases
384 (add-after 'unpack 'patch-setuppy
386 (substitute* "setup.py"
387 (("include_dirs.append\\(.*\\)")
388 (string-append "include_dirs.append('"
389 (assoc-ref %build-inputs "lzo")
395 (home-page "https://github.com/jd-boyd/python-lzo")
396 (synopsis "Python bindings for the LZO data compression library")
398 "Python-LZO provides Python bindings for LZO, i.e. you can access
399 the LZO library from your Python scripts thereby compressing ordinary
401 (license license:gpl2+)))
403 (define-public python2-lzo
404 (package-with-python2 python-lzo))
413 (uri (string-append "http://www.lzop.org/download/lzop-"
417 "1jdjvc4yjndf7ihmlcsyln2rbnbaxa86q4jskmkmm7ylfy65nhn1"))))
418 (build-system gnu-build-system)
419 (inputs `(("lzo" ,lzo)))
420 (home-page "http://www.lzop.org/")
421 (synopsis "Compress or expand files")
423 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
424 LZO data compression library for compression services, and its main advantages
425 over gzip are much higher compression and decompression speed (at the cost of
426 some compression ratio).")
427 (license license:gpl2+)))
435 (uri (string-append "mirror://savannah/lzip/lzip-"
439 "0l9724rw1l3hg2ldr3n7ihqich4m9nc6y7l302bvdj4jmxdw530j"))))
440 (build-system gnu-build-system)
441 (home-page "http://www.nongnu.org/lzip/lzip.html")
442 (synopsis "Lossless data compressor based on the LZMA algorithm")
444 "Lzip is a lossless data compressor with a user interface similar to the
445 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
446 more than bzip2, which makes it well suited for software distribution and data
447 archiving. Lzip is a clean implementation of the LZMA algorithm.")
448 (license license:gpl3+)))
450 (define-public sharutils
457 (uri (string-append "mirror://gnu/sharutils/sharutils-"
461 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))))
462 (build-system gnu-build-system)
468 'patch-source-shebangs 'unpatch-source-shebang
469 ;; revert the patch-shebang phase on a script which is
472 (substitute* "tests/shar-1.ok"
473 (((which "sh")) "/bin/sh")))
475 (home-page "http://www.gnu.org/software/sharutils/")
476 (synopsis "Archives in shell scripts, uuencode/uudecode")
478 "GNU sharutils is a package for creating and manipulating shell
479 archives that can be readily emailed. A shell archive is a file that can be
480 processed by a Bourne-type shell to unpack the original collection of files.
481 This package is mostly for compatibility and historical interest.")
482 (license license:gpl3+)))
484 (define-public sfarklib
490 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
492 (file-name (string-append name "-" version ".tar.gz"))
495 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
496 (build-system gnu-build-system)
498 `(#:tests? #f ;no "check" target
500 (modify-phases %standard-phases
502 (lambda* (#:key outputs #:allow-other-keys)
503 (substitute* "Makefile"
504 (("/usr/local") (assoc-ref outputs "out")))
508 (home-page "https://github.com/raboof/sfArkLib")
509 (synopsis "Library for SoundFont decompression")
511 "SfArkLib is a C++ library for decompressing SoundFont files compressed
512 with the sfArk algorithm.")
513 (license license:gpl3+)))
515 (define-public sfarkxtc
516 (let ((commit "b5e0a2ba3921f019d74d4b92bd31c36dd19d2cf1"))
519 (version (string-take commit 10))
521 ;; There are no release tarballs, so we just fetch the latest
522 ;; commit at this time.
525 (url "https://github.com/raboof/sfarkxtc.git")
529 "0f5x6i46qfl6ry21s7g2p4sd4b2r1g4fb03yqi2vv4kq3saryhvj"))))
530 (build-system gnu-build-system)
532 `(#:tests? #f ;no "check" target
534 (modify-phases %standard-phases
536 (lambda* (#:key outputs #:allow-other-keys)
537 (substitute* "Makefile"
538 (("/usr/local") (assoc-ref outputs "out")))
542 ("sfarklib" ,sfarklib)))
543 (home-page "https://github.com/raboof/sfarkxtc")
544 (synopsis "Basic sfArk decompressor")
545 (description "SfArk extractor converts SoundFonts in the compressed legacy
546 sfArk file format to the uncompressed sf2 format.")
547 (license license:gpl3+))))
549 (define-public libmspack
556 (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
557 version "alpha.tar.gz"))
559 (base32 "04413hynb7zizxnkgy9riik3612dwirkpr6fcjrnfl2za9sz4rw9"))))
560 (build-system gnu-build-system)
561 (home-page "http://www.cabextract.org.uk/libmspack/")
562 (synopsis "Compression tools for some formats used by Microsoft")
564 "The purpose of libmspack is to provide both compression and
565 decompression of some loosely related file formats used by Microsoft.")
566 (license license:lgpl2.1+)))
568 (define-public perl-compress-raw-bzip2
570 (name "perl-compress-raw-bzip2")
575 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
576 "Compress-Raw-Bzip2-" version ".tar.gz"))
579 "16hl58xppckldz05zdyid1l5gpaykzwvkq682h3rc3nilbhgjqqg"))))
580 (build-system perl-build-system)
581 ;; TODO: Use our bzip2 package.
582 (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
583 (synopsis "Low-level interface to bzip2 compression library")
584 (description "This module provides a Perl interface to the bzip2
585 compression library.")
586 (license (package-license perl))))
588 (define-public perl-compress-raw-zlib
590 (name "perl-compress-raw-zlib")
595 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
596 "Compress-Raw-Zlib-" version ".tar.gz"))
599 "06q7n87g26nn5gv4z2p31ca32f6zk124hqxc25rfgkjd3qi5798i"))))
600 (build-system perl-build-system)
604 `(#:phases (modify-phases %standard-phases
606 'configure 'configure-zlib
607 (lambda* (#:key inputs #:allow-other-keys)
608 (call-with-output-file "config.in"
615 GZIP_OS_CODE = AUTO_DETECT"
616 (assoc-ref inputs "zlib")))))))))
617 (home-page "http://search.cpan.org/dist/Compress-Raw-Zlib")
618 (synopsis "Low-level interface to zlib compression library")
619 (description "This module provides a Perl interface to the zlib
620 compression library.")
621 (license (package-license perl))))
623 (define-public perl-io-compress
625 (name "perl-io-compress")
630 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
631 "IO-Compress-" version ".tar.gz"))
634 "0dy0apjp7j9dfkzfjspjd3z9gh26srx5vac72g59bkkz1jf8s1gs"))))
635 (build-system perl-build-system)
637 `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib) ; >=2.068
638 ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.068
639 (home-page "http://search.cpan.org/dist/IO-Compress")
640 (synopsis "IO Interface to compressed files/buffers")
641 (description "IO-Compress provides a Perl interface to allow reading and
642 writing of compressed data created with the zlib and bzip2 libraries.")
643 (license (package-license perl))))
652 (uri (string-append "https://github.com/Cyan4973/lz4/archive/"
653 "v" version ".tar.gz"))
655 (base32 "0l39bymif15rmmfz7h6wvrr853rix4wj8wbqq8z8fm49xa7gx9fb"))
656 (file-name (string-append name "-" version ".tar.gz"))))
657 (build-system gnu-build-system)
658 (native-inputs `(("valgrind" ,valgrind))) ; for tests
660 `(#:test-target "test"
661 #:parallel-tests? #f ; tests fail if run in parallel
662 #:make-flags (list "CC=gcc"
663 (string-append "PREFIX=" (assoc-ref %outputs "out")))
664 #:phases (modify-phases %standard-phases
665 (delete 'configure)))) ; no configure script
666 (home-page "https://github.com/Cyan4973/lz4")
667 (synopsis "Compression algorithm focused on speed")
668 (description "LZ4 is a lossless compression algorithm, providing
669 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
670 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
671 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
672 time for compression ratio.")
673 ;; The libraries (lz4, lz4hc, and xxhash are BSD licenced. The command
674 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
675 (license (list license:bsd-2 license:gpl2+))))
677 (define-public python-lz4
684 (uri (pypi-uri "lz4" version))
687 "1irad4sq4hdr30fr53smvv3zzk4rddcf9b4jx19w8s9xsxhr1x3b"))))
688 (build-system python-build-system)
690 `(("python-nose" ,python-nose)))
691 (home-page "https://github.com/python-lz4/python-lz4")
692 (synopsis "LZ4 Bindings for Python")
694 "This package provides python bindings for the lz4 compression library
695 by Yann Collet. The project contains bindings for the LZ4 block format and
696 the LZ4 frame format.")
697 (license license:bsd-3)))
699 (define-public python2-lz4
700 (package-with-python2 python-lz4))
702 (define-public squashfs-tools
704 (name "squashfs-tools")
708 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
709 "squashfs" version "/"
710 "squashfs" version ".tar.gz"))
713 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
714 (build-system gnu-build-system)
716 '(#:tests? #f ; no check target
722 (string-append "INSTALL_DIR=" %output "/bin"))
724 (modify-phases %standard-phases
727 (chdir "squashfs-tools"))))))
733 (home-page "http://squashfs.sourceforge.net/")
734 (synopsis "Tools to create and extract squashfs file systems")
736 "Squashfs is a highly compressed read-only file system for Linux. It uses
737 zlib to compress files, inodes, and directories. All blocks are packed to
738 minimize the data overhead, and block sizes of between 4K and 1M are supported.
739 It is intended to be used for archival use, for live CDs, and for embedded
740 systems where low overhead is needed. This package allows you to create and
741 extract such file systems.")
742 (license license:gpl2+)))
750 (uri (string-append "http://zlib.net/pigz/"
751 name "-" version ".tar.gz"))
754 "172hdf26k4zmm7z8md7nl0dph2a7mhf3x7slb9bhfyff6as6g2sf"))))
755 (build-system gnu-build-system)
758 (modify-phases %standard-phases
761 (lambda* (#:key outputs #:allow-other-keys)
762 (let* ((out (assoc-ref outputs "out"))
763 (bin (string-append out "/bin"))
764 (man (string-append out "/share/man/man1")))
765 (install-file "pigz" bin)
766 (symlink "pigz" (string-append bin "/unpigz"))
767 (install-file "pigz.1" man)
769 #:make-flags (list "CC=gcc")
770 #:test-target "tests"))
771 (inputs `(("zlib" ,zlib)))
772 (home-page "http://zlib.net/pigz/")
773 (synopsis "Parallel implementation of gzip")
775 "This package provides a parallel implementation of gzip that exploits
776 multiple processors and multiple cores when compressing data.")
778 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
779 ;; written by Mark Adler, are under another non-copyleft license.
780 (license license:asl2.0)))
789 "https://github.com/vasi/pixz/releases/download/v" version
790 "/pixz-" version ".tar.xz"))
793 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
794 (build-system gnu-build-system)
796 `(("pkg-config" ,pkg-config)
797 ("libarchive" ,libarchive)))
798 (home-page "https://github.com/vasi/pixz")
799 (synopsis "Parallel indexing implementation of LZMA")
801 "The existing XZ Utils provide great compression in the .xz file format,
802 but they produce just one big block of compressed data. Pixz instead produces
803 a collection of smaller blocks which makes random access to the original data
804 possible and can compress in parallel. This is especially useful for large
806 (license license:bsd-2)))
808 (define-public brotli
809 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
813 (version (string-append "0.1-" revision "."
814 (string-take commit 7)))
818 (url "https://github.com/bagder/libbrotli.git")
821 (file-name (string-append name "-" version ".tar.xz"))
824 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
825 (modules '((guix build utils)))
827 ;; This is a recursive submodule that is unnecessary for this
828 ;; package, so delete it.
829 '(delete-file-recursively "brotli/terryfy"))))
830 (build-system gnu-build-system)
832 `(("autoconf" ,autoconf)
833 ("automake" ,automake)
834 ("libtool" ,libtool)))
836 `(#:phases (modify-phases %standard-phases
837 (add-after 'unpack 'autogen
840 (zero? (system* "autoreconf" "-vfi")))))))
841 (home-page "https://github.com/bagder/libbrotli/")
842 (synopsis "Implementation of the Brotli compression algorithm")
844 "Brotli is a general-purpose lossless compression algorithm. It is
845 similar in speed to deflate but offers denser compression. This package
846 provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
847 respectively, based on the reference implementation from Google.")
848 (license license:expat))))
850 (define-public cabextract
857 "http://cabextract.org.uk/cabextract-" version ".tar.gz"))
860 "1ysmmz25fjghq7mxb2anyyvr1ljxqxzi4piwjhk0sdamcnsn3rnf"))))
861 (build-system gnu-build-system)
862 (arguments '(#:configure-flags '("--with-external-libmspack")))
864 `(("pkg-config" ,pkg-config)))
866 `(("libmspack" ,libmspack)))
867 (home-page "http://www.cabextract.org.uk/")
868 (synopsis "Tool to unpack Cabinet archives")
869 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
870 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
871 (license license:gpl3+)))
873 (define-public xdelta
880 (uri (string-append "https://github.com/jmacd/xdelta/archive/v"
884 "17g2pbbqy6h20qgdjq7ykib7kg5ajh8fwbsfgyjqg8pwg19wy5bm"))
885 (file-name (string-append name "-" version ".tar.gz"))
887 ;; This file isn't freely distributable and has no effect on building.
888 '(delete-file "xdelta3/draft-korn-vcdiff.txt"))))
889 (build-system gnu-build-system)
891 `(("autoconf" ,autoconf)
892 ("automake" ,automake)))
895 (modify-phases %standard-phases
896 (add-after 'unpack 'enter-build-directory
897 (lambda _ (chdir "xdelta3")))
898 (add-before 'configure 'autoconf
899 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
900 (home-page "http://xdelta.com")
901 (synopsis "Delta encoder for binary files")
902 (description "xdelta encodes only the differences between two binary files
903 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
904 also be used to apply such patches. xdelta is similar to @command{diff} and
905 @command{patch}, but is not limited to plain text and does not generate
906 human-readable output.")
907 (license license:asl2.0)))
917 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
920 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))))
921 (build-system gnu-build-system)
923 `(;; nasm is only required when building for 32-bit x86 platforms
924 ,@(if (string-prefix? "i686" (or (%current-target-system)
933 (home-page "http://ck.kolivas.org/apps/lrzip/")
934 (synopsis "Large file compressor with a very high compression ratio")
935 (description "lrzip is a compression utility that uses long-range
936 redundancy reduction to improve the subsequent compression ratio of
937 larger files. It can then further compress the result with the ZPAQ or
938 LZMA algorithms for maximum compression, or LZO for maximum speed. This
939 choice between size or speed allows for either better compression than
940 even LZMA can provide, or a higher speed than gzip while compressing as
942 (license (list license:gpl3+
943 license:public-domain)))) ; most files in lzma/
945 (define-public snappy
952 "https://github.com/google/snappy/releases/download/"
953 version "/" name "-" version ".tar.gz"))
956 "0mq0nz8gbi1sp3y6xcg0a6wbvnd6gc717f3vh2xrjmfj5w9gwjqk"))))
957 (build-system gnu-build-system)
958 (home-page "https://github.com/google/snappy")
959 (synopsis "Fast compressor/decompressor")
960 (description "Snappy is a compression/decompression library. It does not
961 aim for maximum compression, or compatibility with any other compression library;
962 instead, it aims for very high speeds and reasonable compression. For instance,
963 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
964 for most inputs, but the resulting compressed files are anywhere from 20% to
966 (license license:asl2.0)))
974 (uri (string-append "mirror://sourceforge/" name "/" name "/"
975 version "/" name "_" version
979 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
980 (modules '((guix build utils)))
983 ;; Remove non-free source files
984 (for-each delete-file
986 (find-files "CPP/7zip/Compress" "Rar.*")
987 (find-files "CPP/7zip/Crypto" "Rar.*")
988 (find-files "DOC/unRarLicense.txt")
989 (find-files "Utils/file_Codecs_Rar_so.py")))
990 (delete-file-recursively "CPP/7zip/Archive/Rar")
991 (delete-file-recursively "CPP/7zip/Compress/Rar")
993 (patches (search-patches "p7zip-CVE-2016-9296.patch"
994 "p7zip-remove-unused-code.patch"))))
995 (build-system gnu-build-system)
998 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1000 (modify-phases %standard-phases
1002 (lambda* (#:key system outputs #:allow-other-keys)
1003 (zero? (system* "cp"
1004 (let ((system ,(or (%current-target-system)
1005 (%current-system))))
1007 ((string-prefix? "x86_64" system)
1008 "makefile.linux_amd64_asm")
1009 ((string-prefix? "i686" system)
1010 "makefile.linux_x86_asm_gcc_4.X")
1012 "makefile.linux_any_cpu_gcc_4.X")))
1013 "makefile.machine"))))
1016 (and (zero? (system* "make" "test"))
1017 (zero? (system* "make" "test_7z"))
1018 (zero? (system* "make" "test_7zr"))))))))
1020 (let ((system (or (%current-target-system)
1021 (%current-system))))
1022 `(,@(cond ((string-prefix? "x86_64" system)
1024 ((string-prefix? "i686" system)
1027 (home-page "http://p7zip.sourceforge.net/")
1028 (synopsis "Command-line file archiver with high compression ratio")
1029 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1030 handles the 7z format which features very high compression ratios.")
1031 (license (list license:lgpl2.1+
1033 license:public-domain))))
1035 (define-public gzstream
1042 ;; No versioned URL, but last release was in 2003.
1043 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1044 (file-name (string-append name "-" version ".tgz"))
1047 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1048 (modules '((guix build utils)))
1050 ;; Remove pre-compiled object.
1051 '(delete-file "gzstream.o"))))
1052 (build-system gnu-build-system)
1054 `(#:test-target "test"
1056 (modify-phases %standard-phases
1059 (lambda* (#:key outputs #:allow-other-keys)
1060 (let* ((out (assoc-ref outputs "out"))
1061 (lib (string-append out "/lib"))
1062 (include (string-append out "/include")))
1063 (install-file "libgzstream.a" lib)
1064 (install-file "gzstream.h" include)
1066 (propagated-inputs `(("zlib" ,zlib)))
1067 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1068 (synopsis "Compressed C++ iostream")
1069 (description "gzstream is a small library for providing zlib
1070 functionality in a C++ iostream.")
1071 (license license:lgpl2.1+)))
1079 (method url-fetch/zipbomb)
1080 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1081 (string-delete #\. version) ".zip"))
1084 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1085 (modules '((guix build utils)))
1087 ;; Delete irrelevant pre-compiled binaries.
1088 '(for-each delete-file (find-files "." "\\.exe$")))))
1089 (build-system gnu-build-system)
1092 (modify-phases %standard-phases
1093 (delete 'configure)) ; no ‘configure’ script
1096 (string-append "CPPFLAGS=-Dunix"
1097 ,(match (or (%current-target-system)
1102 ;; These should be safe, lowest-common-denominator instruction sets,
1103 ;; allowing for some optimisation while remaining reproducible.
1104 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1105 ,(match (or (%current-target-system)
1107 ("x86_64-linux" " -march=nocona -mtune=generic")
1108 ("i686-linux" " -march=i686 -mtune=generic")
1109 ("armhf-linux" " -mtune=generic-armv7-a")
1111 (string-append "PREFIX="
1112 (assoc-ref %outputs "out")))))
1114 `(("perl" ,perl))) ; for pod2man
1115 (home-page "http://mattmahoney.net/dc/zpaq.html")
1116 (synopsis "Incremental journaling archiver")
1117 (description "ZPAQ is a command-line archiver for realistic situations with
1118 many duplicate and already compressed files. It backs up only those files
1119 modified since the last update. All previous versions remain untouched and can
1120 be independently recovered. Identical files are only stored once (known as
1121 @dfn{de-duplication}). Archives can also be encrypted.
1123 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1124 owner and group IDs, ACLs, extended attributes, or special file types like
1125 devices, sockets, or named pipes. It does not follow or restore symbolic links
1126 or junctions, and always follows hard links.")
1127 (license (list license:public-domain
1128 ;; libzpaq.cpp contains a mix of public-domain and
1129 ;; expat-licenced (or ‘MIT’) code.
1132 (define-public unrar
1139 "http://download.gna.org/unrar/unrar-" version ".tar.gz"))
1142 "1fgmjaxffj3shyxgy765jhxwz1cq88hk0fih1bsdzyvymyyz6mz7"))))
1143 (build-system gnu-build-system)
1144 (home-page "http://download.gna.org/unrar")
1145 (synopsis "RAR archive extraction tool")
1146 (description "Unrar is a simple command-line program to list and extract
1148 (license license:gpl2+)))