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 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
69 (build-system gnu-build-system)
72 (modify-phases %standard-phases
74 (lambda* (#:key outputs #:allow-other-keys)
75 ;; Zlib's home-made `configure' fails when passed
76 ;; extra flags like `--enable-fast-install', so we need to
77 ;; invoke it with just what it understand.
78 (let ((out (assoc-ref outputs "out")))
79 ;; 'configure' doesn't understand '--host'.
80 ,@(if (%current-target-system)
81 `((setenv "CHOST" ,(%current-target-system)))
84 (system* "./configure"
85 (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 minizip
103 (version (package-version zlib))
104 (source (package-source zlib))
105 (build-system gnu-build-system)
108 (modify-phases %standard-phases
109 (add-after 'unpack 'enter-source
110 (lambda _ (chdir "contrib/minizip") #t))
111 (add-before 'configure 'autoreconf
113 (zero? (system* "autoreconf" "-vif")))))))
115 `(("autoconf" ,autoconf)
116 ("automake" ,automake)
117 ("libtool" ,libtool)))
118 (propagated-inputs `(("zlib" ,zlib)))
119 (home-page (package-home-page zlib))
120 (synopsis "Zip Compression library")
122 "Minizip is a minimalistic library that supports compressing,
123 extracting and viewing ZIP archives. This version is extracted from
124 the @code{zlib} source.")
125 (license (package-license zlib))))
127 (define-public fastjar
133 (uri (string-append "mirror://savannah/fastjar/fastjar-"
137 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
138 (build-system gnu-build-system)
139 (inputs `(("zlib" ,zlib)))
140 (home-page "http://savannah.nongnu.org/projects/fastjar")
141 (synopsis "Replacement for Sun's 'jar' utility")
143 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
144 utility. Instead of being written in Java, FastJar is written in C.")
145 (license license:gpl2+)))
147 (define-public libtar
155 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
158 "mirror://debian/pool/main/libt/libtar/libtar_"
159 version ".orig.tar.gz")))
162 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
163 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
164 (build-system gnu-build-system)
166 `(#:tests? #f ;no "check" target
168 (modify-phases %standard-phases
169 (add-after 'unpack 'autoconf
170 (lambda _ (zero? (system* "sh" "autoreconf" "-vfi")))))))
172 `(("autoconf" ,autoconf)
173 ("automake" ,automake)
174 ("libtool" ,libtool)))
177 (synopsis "C library for manipulating POSIX tar files")
179 "libtar is a C library for manipulating POSIX tar files. It handles
180 adding and extracting files to/from a tar archive.")
181 (home-page "https://repo.or.cz/libtar.git")
182 (license license:bsd-3)))
190 (uri (string-append "mirror://gnu/gzip/gzip-"
194 "1lxv3p4iyx7833mlihkn5wfwmz4cys5nybwpz3dfawag8kn6f5zz"))))
195 (build-system gnu-build-system)
196 (synopsis "General file (de)compression (using lzw)")
198 ;; FIXME: The test suite wants `less', and optionally Perl.
201 "GNU Gzip provides data compression and decompression utilities; the
202 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
203 file; as a result, it is often used in conjunction with \"tar\", resulting in
204 \".tar.gz\" or \".tgz\", etc.")
205 (license license:gpl3+)
206 (home-page "http://www.gnu.org/software/gzip/")))
209 (let ((build-shared-lib
210 ;; Build a shared library.
211 '(lambda* (#:key inputs #:allow-other-keys)
212 (patch-makefile-SHELL "Makefile-libbz2_so")
213 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
215 '(lambda* (#:key outputs #:allow-other-keys)
216 (let* ((out (assoc-ref outputs "out"))
217 (libdir (string-append out "/lib")))
218 (for-each (lambda (file)
219 (let ((base (basename file)))
220 (format #t "installing `~a' to `~a'~%"
223 (string-append libdir "/" base))))
224 (find-files "." "^libbz2\\.so")))))
225 (set-cross-environment
226 '(lambda* (#:key target #:allow-other-keys)
227 (substitute* (find-files "." "Makefile")
229 (string-append "CC = " target "-gcc\n"))
231 (string-append "AR = " target "-ar\n"))
233 (string-append "RANLIB = " target "-ranlib\n"))
234 (("^all:(.*)test" _ prerequisites)
235 ;; Remove 'all' -> 'test' dependency.
236 (string-append "all:" prerequisites "\n"))))))
242 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
246 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
247 (build-system gnu-build-system)
249 `(#:modules ((guix build gnu-build-system)
253 ,(if (%current-target-system)
255 ;; Cross-compilation: use the cross tools.
257 'build 'build-shared-lib ,build-shared-lib
259 'install 'install-shared-lib ,install-shared-lib
260 (alist-replace 'configure ,set-cross-environment
263 ;; Native compilation: build the shared library.
265 'build 'build-shared-lib ,build-shared-lib
267 'install 'install-shared-lib ,install-shared-lib
268 (alist-delete 'configure %standard-phases))))
270 #:make-flags (list (string-append "PREFIX="
271 (assoc-ref %outputs "out")))
273 ;; Don't attempt to run the tests when cross-compiling.
274 ,@(if (%current-target-system)
277 (synopsis "High-quality data compression program")
279 "bzip2 is a freely available, patent free (see below), high-quality data
280 compressor. It typically compresses files to within 10% to 15% of the best
281 available techniques (the PPM family of statistical compressors), whilst
282 being around twice as fast at compression and six times faster at
284 (license (license:non-copyleft "file://LICENSE"
285 "See LICENSE in the distribution."))
286 (home-page "http://www.bzip.org/"))))
288 (define-public lbzip2
294 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
298 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))))
299 (build-system gnu-build-system)
300 (synopsis "Parallel bzip2 compression utility")
302 "lbzip2 is a multi-threaded compression utility with support for the
303 bzip2 compressed file format. lbzip2 can process standard bz2 files in
304 parallel. It uses POSIX threading model (pthreads), which allows it to take
305 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
306 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
307 compatible with bzip2 – both at file format and command line level.")
308 (home-page "http://www.lbzip2.org/")
309 (license license:gpl3+)))
311 (define-public pbzip2
317 (uri (string-append "https://launchpad.net/pbzip2/"
318 (version-major+minor version) "/" version
319 "/+download/" name "-" version ".tar.gz"))
322 "1vk6065dv3a47p86vmp8hv3n1ygd9hraz0gq89gvzlx7lmcb6fsp"))))
323 (build-system gnu-build-system)
327 `(#:tests? #f ; no tests
328 #:phases (modify-phases %standard-phases
330 #:make-flags (list (string-append "PREFIX=" %output))))
331 (home-page "http://compression.ca/pbzip2/")
332 (synopsis "Parallel bzip2 implementation")
334 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
335 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
336 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
337 compressed with pbzip2 can be decompressed with bzip2).")
338 (license (license:non-copyleft "file://COPYING"
339 "See COPYING in the distribution."))))
347 (uri (list (string-append "http://tukaani.org/xz/xz-" version
349 (string-append "http://multiprecision.org/guix/xz-"
353 "18h2k4jndhzjs8ln3a54qdnfv59y6spxiwh9gpaqniph6iflvpvk"))))
354 (build-system gnu-build-system)
355 (synopsis "General-purpose data compression")
357 "XZ Utils is free general-purpose data compression software with high
358 compression ratio. XZ Utils were written for POSIX-like systems, but also
359 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
361 The core of the XZ Utils compression code is based on LZMA SDK, but it has
362 been modified quite a lot to be suitable for XZ Utils. The primary
363 compression algorithm is currently LZMA2, which is used inside the .xz
364 container format. With typical files, XZ Utils create 30 % smaller output
365 than gzip and 15 % smaller output than bzip2.")
366 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
367 (home-page "http://tukaani.org/xz/")))
376 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
380 "0k5kpj3jnsjfxqqkblpfpx0mqcy86zs5fhjhgh2kq1hksg7ag57j"))))
381 (build-system gnu-build-system)
382 (arguments '(#:configure-flags '("--enable-shared")))
383 (home-page "http://www.oberhumer.com/opensource/lzo")
385 "Data compression library suitable for real-time data de-/compression")
387 "LZO is a data compression library which is suitable for data
388 de-/compression in real-time. This means it favours speed over
391 LZO is written in ANSI C. Both the source code and the compressed data
392 format are designed to be portable across platforms.")
393 (license license:gpl2+)))
395 (define-public python-lzo
402 (uri (pypi-uri "python-lzo" version))
405 "11p3ifg14p086byhhin6azx5svlkg8dzw2b5abixik97xd6fm81q"))))
406 (build-system python-build-system)
408 `(#:test-target "check"
410 (modify-phases %standard-phases
411 (add-after 'unpack 'patch-setuppy
413 (substitute* "setup.py"
414 (("include_dirs.append\\(.*\\)")
415 (string-append "include_dirs.append('"
416 (assoc-ref %build-inputs "lzo")
422 (home-page "https://github.com/jd-boyd/python-lzo")
423 (synopsis "Python bindings for the LZO data compression library")
425 "Python-LZO provides Python bindings for LZO, i.e. you can access
426 the LZO library from your Python scripts thereby compressing ordinary
428 (license license:gpl2+)))
430 (define-public python2-lzo
431 (package-with-python2 python-lzo))
440 (uri (string-append "http://www.lzop.org/download/lzop-"
444 "1jdjvc4yjndf7ihmlcsyln2rbnbaxa86q4jskmkmm7ylfy65nhn1"))))
445 (build-system gnu-build-system)
446 (inputs `(("lzo" ,lzo)))
447 (home-page "http://www.lzop.org/")
448 (synopsis "Compress or expand files")
450 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
451 LZO data compression library for compression services, and its main advantages
452 over gzip are much higher compression and decompression speed (at the cost of
453 some compression ratio).")
454 (license license:gpl2+)))
462 (uri (string-append "mirror://savannah/lzip/lzip-"
466 "0l9724rw1l3hg2ldr3n7ihqich4m9nc6y7l302bvdj4jmxdw530j"))))
467 (build-system gnu-build-system)
468 (home-page "http://www.nongnu.org/lzip/lzip.html")
469 (synopsis "Lossless data compressor based on the LZMA algorithm")
471 "Lzip is a lossless data compressor with a user interface similar to the
472 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
473 more than bzip2, which makes it well suited for software distribution and data
474 archiving. Lzip is a clean implementation of the LZMA algorithm.")
475 (license license:gpl3+)))
477 (define-public sharutils
484 (uri (string-append "mirror://gnu/sharutils/sharutils-"
488 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))))
489 (build-system gnu-build-system)
495 'patch-source-shebangs 'unpatch-source-shebang
496 ;; revert the patch-shebang phase on a script which is
499 (substitute* "tests/shar-1.ok"
500 (((which "sh")) "/bin/sh")))
502 (home-page "http://www.gnu.org/software/sharutils/")
503 (synopsis "Archives in shell scripts, uuencode/uudecode")
505 "GNU sharutils is a package for creating and manipulating shell
506 archives that can be readily emailed. A shell archive is a file that can be
507 processed by a Bourne-type shell to unpack the original collection of files.
508 This package is mostly for compatibility and historical interest.")
509 (license license:gpl3+)))
511 (define-public sfarklib
517 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
519 (file-name (string-append name "-" version ".tar.gz"))
522 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
523 (build-system gnu-build-system)
525 `(#:tests? #f ;no "check" target
527 (modify-phases %standard-phases
529 (lambda* (#:key outputs #:allow-other-keys)
530 (substitute* "Makefile"
531 (("/usr/local") (assoc-ref outputs "out")))
535 (home-page "https://github.com/raboof/sfArkLib")
536 (synopsis "Library for SoundFont decompression")
538 "SfArkLib is a C++ library for decompressing SoundFont files compressed
539 with the sfArk algorithm.")
540 (license license:gpl3+)))
542 (define-public sfarkxtc
543 (let ((commit "b5e0a2ba3921f019d74d4b92bd31c36dd19d2cf1"))
546 (version (string-take commit 10))
548 ;; There are no release tarballs, so we just fetch the latest
549 ;; commit at this time.
552 (url "https://github.com/raboof/sfarkxtc.git")
556 "0f5x6i46qfl6ry21s7g2p4sd4b2r1g4fb03yqi2vv4kq3saryhvj"))))
557 (build-system gnu-build-system)
559 `(#:tests? #f ;no "check" target
561 (modify-phases %standard-phases
563 (lambda* (#:key outputs #:allow-other-keys)
564 (substitute* "Makefile"
565 (("/usr/local") (assoc-ref outputs "out")))
569 ("sfarklib" ,sfarklib)))
570 (home-page "https://github.com/raboof/sfarkxtc")
571 (synopsis "Basic sfArk decompressor")
572 (description "SfArk extractor converts SoundFonts in the compressed legacy
573 sfArk file format to the uncompressed sf2 format.")
574 (license license:gpl3+))))
576 (define-public libmspack
583 (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
584 version "alpha.tar.gz"))
586 (base32 "04413hynb7zizxnkgy9riik3612dwirkpr6fcjrnfl2za9sz4rw9"))))
587 (build-system gnu-build-system)
588 (home-page "http://www.cabextract.org.uk/libmspack/")
589 (synopsis "Compression tools for some formats used by Microsoft")
591 "The purpose of libmspack is to provide both compression and
592 decompression of some loosely related file formats used by Microsoft.")
593 (license license:lgpl2.1+)))
595 (define-public perl-compress-raw-bzip2
597 (name "perl-compress-raw-bzip2")
602 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
603 "Compress-Raw-Bzip2-" version ".tar.gz"))
606 "16hl58xppckldz05zdyid1l5gpaykzwvkq682h3rc3nilbhgjqqg"))))
607 (build-system perl-build-system)
608 ;; TODO: Use our bzip2 package.
609 (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
610 (synopsis "Low-level interface to bzip2 compression library")
611 (description "This module provides a Perl interface to the bzip2
612 compression library.")
613 (license (package-license perl))))
615 (define-public perl-compress-raw-zlib
617 (name "perl-compress-raw-zlib")
622 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
623 "Compress-Raw-Zlib-" version ".tar.gz"))
626 "06q7n87g26nn5gv4z2p31ca32f6zk124hqxc25rfgkjd3qi5798i"))))
627 (build-system perl-build-system)
631 `(#:phases (modify-phases %standard-phases
633 'configure 'configure-zlib
634 (lambda* (#:key inputs #:allow-other-keys)
635 (call-with-output-file "config.in"
642 GZIP_OS_CODE = AUTO_DETECT"
643 (assoc-ref inputs "zlib")))))))))
644 (home-page "http://search.cpan.org/dist/Compress-Raw-Zlib")
645 (synopsis "Low-level interface to zlib compression library")
646 (description "This module provides a Perl interface to the zlib
647 compression library.")
648 (license (package-license perl))))
650 (define-public perl-io-compress
652 (name "perl-io-compress")
657 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
658 "IO-Compress-" version ".tar.gz"))
661 "0dy0apjp7j9dfkzfjspjd3z9gh26srx5vac72g59bkkz1jf8s1gs"))))
662 (build-system perl-build-system)
664 `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib) ; >=2.068
665 ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.068
666 (home-page "http://search.cpan.org/dist/IO-Compress")
667 (synopsis "IO Interface to compressed files/buffers")
668 (description "IO-Compress provides a Perl interface to allow reading and
669 writing of compressed data created with the zlib and bzip2 libraries.")
670 (license (package-license perl))))
679 (uri (string-append "https://github.com/Cyan4973/lz4/archive/"
680 "v" version ".tar.gz"))
682 (base32 "0l39bymif15rmmfz7h6wvrr853rix4wj8wbqq8z8fm49xa7gx9fb"))
683 (file-name (string-append name "-" version ".tar.gz"))))
684 (build-system gnu-build-system)
685 (native-inputs `(("valgrind" ,valgrind))) ; for tests
687 `(#:test-target "test"
688 #:parallel-tests? #f ; tests fail if run in parallel
689 #:make-flags (list "CC=gcc"
690 (string-append "PREFIX=" (assoc-ref %outputs "out")))
691 #:phases (modify-phases %standard-phases
692 (delete 'configure)))) ; no configure script
693 (home-page "https://github.com/Cyan4973/lz4")
694 (synopsis "Compression algorithm focused on speed")
695 (description "LZ4 is a lossless compression algorithm, providing
696 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
697 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
698 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
699 time for compression ratio.")
700 ;; The libraries (lz4, lz4hc, and xxhash are BSD licenced. The command
701 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
702 (license (list license:bsd-2 license:gpl2+))))
704 (define-public python-lz4
711 (uri (pypi-uri "lz4" version))
714 "1irad4sq4hdr30fr53smvv3zzk4rddcf9b4jx19w8s9xsxhr1x3b"))))
715 (build-system python-build-system)
717 `(("python-nose" ,python-nose)))
718 (home-page "https://github.com/python-lz4/python-lz4")
719 (synopsis "LZ4 Bindings for Python")
721 "This package provides python bindings for the lz4 compression library
722 by Yann Collet. The project contains bindings for the LZ4 block format and
723 the LZ4 frame format.")
724 (license license:bsd-3)))
726 (define-public python2-lz4
727 (package-with-python2 python-lz4))
729 (define-public squashfs-tools
731 (name "squashfs-tools")
735 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
736 "squashfs" version "/"
737 "squashfs" version ".tar.gz"))
740 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
741 (build-system gnu-build-system)
743 '(#:tests? #f ; no check target
749 (string-append "INSTALL_DIR=" %output "/bin"))
751 (modify-phases %standard-phases
754 (chdir "squashfs-tools"))))))
760 (home-page "http://squashfs.sourceforge.net/")
761 (synopsis "Tools to create and extract squashfs file systems")
763 "Squashfs is a highly compressed read-only file system for Linux. It uses
764 zlib to compress files, inodes, and directories. All blocks are packed to
765 minimize the data overhead, and block sizes of between 4K and 1M are supported.
766 It is intended to be used for archival use, for live CDs, and for embedded
767 systems where low overhead is needed. This package allows you to create and
768 extract such file systems.")
769 (license license:gpl2+)))
777 (uri (string-append "http://zlib.net/pigz/"
778 name "-" version ".tar.gz"))
781 "172hdf26k4zmm7z8md7nl0dph2a7mhf3x7slb9bhfyff6as6g2sf"))))
782 (build-system gnu-build-system)
785 (modify-phases %standard-phases
788 (lambda* (#:key outputs #:allow-other-keys)
789 (let* ((out (assoc-ref outputs "out"))
790 (bin (string-append out "/bin"))
791 (man (string-append out "/share/man/man1")))
792 (install-file "pigz" bin)
793 (symlink "pigz" (string-append bin "/unpigz"))
794 (install-file "pigz.1" man)
796 #:make-flags (list "CC=gcc")
797 #:test-target "tests"))
798 (inputs `(("zlib" ,zlib)))
799 (home-page "http://zlib.net/pigz/")
800 (synopsis "Parallel implementation of gzip")
802 "This package provides a parallel implementation of gzip that exploits
803 multiple processors and multiple cores when compressing data.")
805 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
806 ;; written by Mark Adler, are under another non-copyleft license.
807 (license license:asl2.0)))
816 "https://github.com/vasi/pixz/releases/download/v" version
817 "/pixz-" version ".tar.xz"))
820 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
821 (build-system gnu-build-system)
823 `(("pkg-config" ,pkg-config)
824 ("libarchive" ,libarchive)))
825 (home-page "https://github.com/vasi/pixz")
826 (synopsis "Parallel indexing implementation of LZMA")
828 "The existing XZ Utils provide great compression in the .xz file format,
829 but they produce just one big block of compressed data. Pixz instead produces
830 a collection of smaller blocks which makes random access to the original data
831 possible and can compress in parallel. This is especially useful for large
833 (license license:bsd-2)))
835 (define-public brotli
836 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
840 (version (string-append "0.1-" revision "."
841 (string-take commit 7)))
845 (url "https://github.com/bagder/libbrotli.git")
848 (file-name (string-append name "-" version ".tar.xz"))
851 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
852 (modules '((guix build utils)))
854 ;; This is a recursive submodule that is unnecessary for this
855 ;; package, so delete it.
856 '(delete-file-recursively "brotli/terryfy"))))
857 (build-system gnu-build-system)
859 `(("autoconf" ,autoconf)
860 ("automake" ,automake)
861 ("libtool" ,libtool)))
863 `(#:phases (modify-phases %standard-phases
864 (add-after 'unpack 'autogen
867 (zero? (system* "autoreconf" "-vfi")))))))
868 (home-page "https://github.com/bagder/libbrotli/")
869 (synopsis "Implementation of the Brotli compression algorithm")
871 "Brotli is a general-purpose lossless compression algorithm. It is
872 similar in speed to deflate but offers denser compression. This package
873 provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
874 respectively, based on the reference implementation from Google.")
875 (license license:expat))))
877 (define-public cabextract
884 "http://cabextract.org.uk/cabextract-" version ".tar.gz"))
887 "1ysmmz25fjghq7mxb2anyyvr1ljxqxzi4piwjhk0sdamcnsn3rnf"))))
888 (build-system gnu-build-system)
889 (arguments '(#:configure-flags '("--with-external-libmspack")))
891 `(("pkg-config" ,pkg-config)))
893 `(("libmspack" ,libmspack)))
894 (home-page "http://www.cabextract.org.uk/")
895 (synopsis "Tool to unpack Cabinet archives")
896 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
897 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
898 (license license:gpl3+)))
900 (define-public xdelta
907 (uri (string-append "https://github.com/jmacd/xdelta/archive/v"
911 "17g2pbbqy6h20qgdjq7ykib7kg5ajh8fwbsfgyjqg8pwg19wy5bm"))
912 (file-name (string-append name "-" version ".tar.gz"))
914 ;; This file isn't freely distributable and has no effect on building.
915 '(delete-file "xdelta3/draft-korn-vcdiff.txt"))))
916 (build-system gnu-build-system)
918 `(("autoconf" ,autoconf)
919 ("automake" ,automake)))
922 (modify-phases %standard-phases
923 (add-after 'unpack 'enter-build-directory
924 (lambda _ (chdir "xdelta3")))
925 (add-before 'configure 'autoconf
926 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
927 (home-page "http://xdelta.com")
928 (synopsis "Delta encoder for binary files")
929 (description "xdelta encodes only the differences between two binary files
930 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
931 also be used to apply such patches. xdelta is similar to @command{diff} and
932 @command{patch}, but is not limited to plain text and does not generate
933 human-readable output.")
934 (license license:asl2.0)))
944 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
947 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))))
948 (build-system gnu-build-system)
950 `(;; nasm is only required when building for 32-bit x86 platforms
951 ,@(if (string-prefix? "i686" (or (%current-target-system)
960 (home-page "http://ck.kolivas.org/apps/lrzip/")
961 (synopsis "Large file compressor with a very high compression ratio")
962 (description "lrzip is a compression utility that uses long-range
963 redundancy reduction to improve the subsequent compression ratio of
964 larger files. It can then further compress the result with the ZPAQ or
965 LZMA algorithms for maximum compression, or LZO for maximum speed. This
966 choice between size or speed allows for either better compression than
967 even LZMA can provide, or a higher speed than gzip while compressing as
969 (license (list license:gpl3+
970 license:public-domain)))) ; most files in lzma/
972 (define-public snappy
979 "https://github.com/google/snappy/releases/download/"
980 version "/" name "-" version ".tar.gz"))
983 "0mq0nz8gbi1sp3y6xcg0a6wbvnd6gc717f3vh2xrjmfj5w9gwjqk"))))
984 (build-system gnu-build-system)
985 (home-page "https://github.com/google/snappy")
986 (synopsis "Fast compressor/decompressor")
987 (description "Snappy is a compression/decompression library. It does not
988 aim for maximum compression, or compatibility with any other compression library;
989 instead, it aims for very high speeds and reasonable compression. For instance,
990 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
991 for most inputs, but the resulting compressed files are anywhere from 20% to
993 (license license:asl2.0)))
1001 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1002 version "/" name "_" version
1003 "_src_all.tar.bz2"))
1006 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1007 (modules '((guix build utils)))
1010 ;; Remove non-free source files
1011 (for-each delete-file
1013 (find-files "CPP/7zip/Compress" "Rar.*")
1014 (find-files "CPP/7zip/Crypto" "Rar.*")
1015 (find-files "DOC/unRarLicense.txt")
1016 (find-files "Utils/file_Codecs_Rar_so.py")))
1017 (delete-file-recursively "CPP/7zip/Archive/Rar")
1018 (delete-file-recursively "CPP/7zip/Compress/Rar")
1020 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1021 "p7zip-remove-unused-code.patch"))))
1022 (build-system gnu-build-system)
1025 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1027 (modify-phases %standard-phases
1029 (lambda* (#:key system outputs #:allow-other-keys)
1030 (zero? (system* "cp"
1031 (let ((system ,(or (%current-target-system)
1032 (%current-system))))
1034 ((string-prefix? "x86_64" system)
1035 "makefile.linux_amd64_asm")
1036 ((string-prefix? "i686" system)
1037 "makefile.linux_x86_asm_gcc_4.X")
1039 "makefile.linux_any_cpu_gcc_4.X")))
1040 "makefile.machine"))))
1043 (and (zero? (system* "make" "test"))
1044 (zero? (system* "make" "test_7z"))
1045 (zero? (system* "make" "test_7zr"))))))))
1047 (let ((system (or (%current-target-system)
1048 (%current-system))))
1049 `(,@(cond ((string-prefix? "x86_64" system)
1051 ((string-prefix? "i686" system)
1054 (home-page "http://p7zip.sourceforge.net/")
1055 (synopsis "Command-line file archiver with high compression ratio")
1056 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1057 handles the 7z format which features very high compression ratios.")
1058 (license (list license:lgpl2.1+
1060 license:public-domain))))
1062 (define-public gzstream
1069 ;; No versioned URL, but last release was in 2003.
1070 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1071 (file-name (string-append name "-" version ".tgz"))
1074 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1075 (modules '((guix build utils)))
1077 ;; Remove pre-compiled object.
1078 '(delete-file "gzstream.o"))))
1079 (build-system gnu-build-system)
1081 `(#:test-target "test"
1083 (modify-phases %standard-phases
1086 (lambda* (#:key outputs #:allow-other-keys)
1087 (let* ((out (assoc-ref outputs "out"))
1088 (lib (string-append out "/lib"))
1089 (include (string-append out "/include")))
1090 (install-file "libgzstream.a" lib)
1091 (install-file "gzstream.h" include)
1093 (propagated-inputs `(("zlib" ,zlib)))
1094 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1095 (synopsis "Compressed C++ iostream")
1096 (description "gzstream is a small library for providing zlib
1097 functionality in a C++ iostream.")
1098 (license license:lgpl2.1+)))
1106 (method url-fetch/zipbomb)
1107 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1108 (string-delete #\. version) ".zip"))
1111 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1112 (modules '((guix build utils)))
1114 ;; Delete irrelevant pre-compiled binaries.
1115 '(for-each delete-file (find-files "." "\\.exe$")))))
1116 (build-system gnu-build-system)
1119 (modify-phases %standard-phases
1120 (delete 'configure)) ; no ‘configure’ script
1123 (string-append "CPPFLAGS=-Dunix"
1124 ,(match (or (%current-target-system)
1129 ;; These should be safe, lowest-common-denominator instruction sets,
1130 ;; allowing for some optimisation while remaining reproducible.
1131 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1132 ,(match (or (%current-target-system)
1134 ("x86_64-linux" " -march=nocona -mtune=generic")
1135 ("i686-linux" " -march=i686 -mtune=generic")
1136 ("armhf-linux" " -mtune=generic-armv7-a")
1138 (string-append "PREFIX="
1139 (assoc-ref %outputs "out")))))
1141 `(("perl" ,perl))) ; for pod2man
1142 (home-page "http://mattmahoney.net/dc/zpaq.html")
1143 (synopsis "Incremental journaling archiver")
1144 (description "ZPAQ is a command-line archiver for realistic situations with
1145 many duplicate and already compressed files. It backs up only those files
1146 modified since the last update. All previous versions remain untouched and can
1147 be independently recovered. Identical files are only stored once (known as
1148 @dfn{de-duplication}). Archives can also be encrypted.
1150 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1151 owner and group IDs, ACLs, extended attributes, or special file types like
1152 devices, sockets, or named pipes. It does not follow or restore symbolic links
1153 or junctions, and always follows hard links.")
1154 (license (list license:public-domain
1155 ;; libzpaq.cpp contains a mix of public-domain and
1156 ;; expat-licenced (or ‘MIT’) code.
1159 (define-public unrar
1166 "http://download.gna.org/unrar/unrar-" version ".tar.gz"))
1169 "1fgmjaxffj3shyxgy765jhxwz1cq88hk0fih1bsdzyvymyyz6mz7"))))
1170 (build-system gnu-build-system)
1171 (home-page "http://download.gna.org/unrar")
1172 (synopsis "RAR archive extraction tool")
1173 (description "Unrar is a simple command-line program to list and extract
1175 (license license:gpl2+)))