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, 2017 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 check)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages valgrind)
53 #:use-module (ice-9 match)
54 #:use-module ((srfi srfi-1) #:select (last)))
63 (uri (list (string-append "http://zlib.net/zlib-"
65 (string-append "mirror://sourceforge/libpng/zlib/"
66 version "/zlib-" version ".tar.gz")))
69 "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
70 (build-system gnu-build-system)
73 (modify-phases %standard-phases
75 (lambda* (#:key outputs #:allow-other-keys)
76 ;; Zlib's home-made `configure' fails when passed
77 ;; extra flags like `--enable-fast-install', so we need to
78 ;; invoke it with just what it understand.
79 (let ((out (assoc-ref outputs "out")))
80 ;; 'configure' doesn't understand '--host'.
81 ,@(if (%current-target-system)
82 `((setenv "CHOST" ,(%current-target-system)))
85 (system* "./configure"
86 (string-append "--prefix=" out)))))))))
87 (home-page "http://zlib.net/")
88 (synopsis "Compression library")
90 "zlib is designed to be a free, general-purpose, legally unencumbered --
91 that is, not covered by any patents -- lossless data-compression library for
92 use on virtually any computer hardware and operating system. The zlib data
93 format is itself portable across platforms. Unlike the LZW compression method
94 used in Unix compress(1) and in the GIF image format, the compression method
95 currently used in zlib essentially never expands the data. (LZW can double or
96 triple the file size in extreme cases.) zlib's memory footprint is also
97 independent of the input data and can be reduced, if necessary, at some cost
99 (license license:zlib)))
101 (define-public minizip
104 (version (package-version zlib))
105 (source (package-source zlib))
106 (build-system gnu-build-system)
109 (modify-phases %standard-phases
110 (add-after 'unpack 'enter-source
111 (lambda _ (chdir "contrib/minizip") #t))
112 (add-before 'configure 'autoreconf
114 (zero? (system* "autoreconf" "-vif")))))))
116 `(("autoconf" ,autoconf)
117 ("automake" ,automake)
118 ("libtool" ,libtool)))
119 (propagated-inputs `(("zlib" ,zlib)))
120 (home-page (package-home-page zlib))
121 (synopsis "Zip Compression library")
123 "Minizip is a minimalistic library that supports compressing,
124 extracting and viewing ZIP archives. This version is extracted from
125 the @code{zlib} source.")
126 (license (package-license zlib))))
128 (define-public fastjar
134 (uri (string-append "mirror://savannah/fastjar/fastjar-"
138 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
139 (build-system gnu-build-system)
140 (inputs `(("zlib" ,zlib)))
141 (home-page "http://savannah.nongnu.org/projects/fastjar")
142 (synopsis "Replacement for Sun's 'jar' utility")
144 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
145 utility. Instead of being written in Java, FastJar is written in C.")
146 (license license:gpl2+)))
148 (define-public libtar
156 "ftp://ftp.feep.net/pub/software/libtar/libtar-"
159 "mirror://debian/pool/main/libt/libtar/libtar_"
160 version ".orig.tar.gz")))
163 "02cihzl77ia0dcz7z2cga2412vyhhs5pa2355q4wpwbyga2lrwjh"))
164 (patches (search-patches "libtar-CVE-2013-4420.patch"))))
165 (build-system gnu-build-system)
167 `(#:tests? #f ;no "check" target
169 (modify-phases %standard-phases
170 (add-after 'unpack 'autoconf
171 (lambda _ (zero? (system* "sh" "autoreconf" "-vfi")))))))
173 `(("autoconf" ,autoconf)
174 ("automake" ,automake)
175 ("libtool" ,libtool)))
178 (synopsis "C library for manipulating POSIX tar files")
180 "libtar is a C library for manipulating POSIX tar files. It handles
181 adding and extracting files to/from a tar archive.")
182 (home-page "https://repo.or.cz/libtar.git")
183 (license license:bsd-3)))
191 (uri (string-append "mirror://gnu/gzip/gzip-"
195 "1lxv3p4iyx7833mlihkn5wfwmz4cys5nybwpz3dfawag8kn6f5zz"))))
196 (build-system gnu-build-system)
197 (synopsis "General file (de)compression (using lzw)")
199 ;; FIXME: The test suite wants `less', and optionally Perl.
202 "GNU Gzip provides data compression and decompression utilities; the
203 typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
204 file; as a result, it is often used in conjunction with \"tar\", resulting in
205 \".tar.gz\" or \".tgz\", etc.")
206 (license license:gpl3+)
207 (home-page "https://www.gnu.org/software/gzip/")))
210 (let ((build-shared-lib
211 ;; Build a shared library.
212 '(lambda* (#:key inputs #:allow-other-keys)
213 (patch-makefile-SHELL "Makefile-libbz2_so")
214 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
216 '(lambda* (#:key outputs #:allow-other-keys)
217 (let* ((out (assoc-ref outputs "out"))
218 (libdir (string-append out "/lib")))
219 (for-each (lambda (file)
220 (let ((base (basename file)))
221 (format #t "installing `~a' to `~a'~%"
224 (string-append libdir "/" base))))
225 (find-files "." "^libbz2\\.so")))))
226 (set-cross-environment
227 '(lambda* (#:key target #:allow-other-keys)
228 (substitute* (find-files "." "Makefile")
230 (string-append "CC = " target "-gcc\n"))
232 (string-append "AR = " target "-ar\n"))
234 (string-append "RANLIB = " target "-ranlib\n"))
235 (("^all:(.*)test" _ prerequisites)
236 ;; Remove 'all' -> 'test' dependency.
237 (string-append "all:" prerequisites "\n"))))))
243 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
247 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
248 (build-system gnu-build-system)
250 `(#:modules ((guix build gnu-build-system)
254 ,(if (%current-target-system)
256 ;; Cross-compilation: use the cross tools.
258 'build 'build-shared-lib ,build-shared-lib
260 'install 'install-shared-lib ,install-shared-lib
261 (alist-replace 'configure ,set-cross-environment
264 ;; Native compilation: build the shared library.
266 'build 'build-shared-lib ,build-shared-lib
268 'install 'install-shared-lib ,install-shared-lib
269 (alist-delete 'configure %standard-phases))))
271 #:make-flags (list (string-append "PREFIX="
272 (assoc-ref %outputs "out")))
274 ;; Don't attempt to run the tests when cross-compiling.
275 ,@(if (%current-target-system)
278 (synopsis "High-quality data compression program")
280 "bzip2 is a freely available, patent free (see below), high-quality data
281 compressor. It typically compresses files to within 10% to 15% of the best
282 available techniques (the PPM family of statistical compressors), whilst
283 being around twice as fast at compression and six times faster at
285 (license (license:non-copyleft "file://LICENSE"
286 "See LICENSE in the distribution."))
287 (home-page "http://www.bzip.org/"))))
289 (define-public lbzip2
295 (uri (string-append "http://archive.lbzip2.org/lbzip2-"
299 "1sahaqc5bw4i0iyri05syfza4ncf5cml89an033fspn97klmxis6"))))
300 (build-system gnu-build-system)
301 (synopsis "Parallel bzip2 compression utility")
303 "lbzip2 is a multi-threaded compression utility with support for the
304 bzip2 compressed file format. lbzip2 can process standard bz2 files in
305 parallel. It uses POSIX threading model (pthreads), which allows it to take
306 full advantage of symmetric multiprocessing (SMP) systems. It has been proven
307 to scale linearly, even to over one hundred processor cores. lbzip2 is fully
308 compatible with bzip2 – both at file format and command line level.")
309 (home-page "http://www.lbzip2.org/")
310 (license license:gpl3+)))
312 (define-public pbzip2
318 (uri (string-append "https://launchpad.net/pbzip2/"
319 (version-major+minor version) "/" version
320 "/+download/" name "-" version ".tar.gz"))
323 "1vk6065dv3a47p86vmp8hv3n1ygd9hraz0gq89gvzlx7lmcb6fsp"))))
324 (build-system gnu-build-system)
328 `(#:tests? #f ; no tests
329 #:phases (modify-phases %standard-phases
331 #:make-flags (list (string-append "PREFIX=" %output))))
332 (home-page "http://compression.ca/pbzip2/")
333 (synopsis "Parallel bzip2 implementation")
335 "Pbzip2 is a parallel implementation of the bzip2 block-sorting file
336 compressor that uses pthreads and achieves near-linear speedup on SMP machines.
337 The output of this version is fully compatible with bzip2 v1.0.2 (i.e. anything
338 compressed with pbzip2 can be decompressed with bzip2).")
339 (license (license:non-copyleft "file://COPYING"
340 "See COPYING in the distribution."))))
348 (uri (list (string-append "http://tukaani.org/xz/xz-" version
350 (string-append "http://multiprecision.org/guix/xz-"
354 "18h2k4jndhzjs8ln3a54qdnfv59y6spxiwh9gpaqniph6iflvpvk"))))
355 (build-system gnu-build-system)
356 (synopsis "General-purpose data compression")
358 "XZ Utils is free general-purpose data compression software with high
359 compression ratio. XZ Utils were written for POSIX-like systems, but also
360 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
362 The core of the XZ Utils compression code is based on LZMA SDK, but it has
363 been modified quite a lot to be suitable for XZ Utils. The primary
364 compression algorithm is currently LZMA2, which is used inside the .xz
365 container format. With typical files, XZ Utils create 30 % smaller output
366 than gzip and 15 % smaller output than bzip2.")
367 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
368 (home-page "http://tukaani.org/xz/")))
377 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
381 "0k5kpj3jnsjfxqqkblpfpx0mqcy86zs5fhjhgh2kq1hksg7ag57j"))))
382 (build-system gnu-build-system)
383 (arguments '(#:configure-flags '("--enable-shared")))
384 (home-page "http://www.oberhumer.com/opensource/lzo")
386 "Data compression library suitable for real-time data de-/compression")
388 "LZO is a data compression library which is suitable for data
389 de-/compression in real-time. This means it favours speed over
392 LZO is written in ANSI C. Both the source code and the compressed data
393 format are designed to be portable across platforms.")
394 (license license:gpl2+)))
396 (define-public python-lzo
403 (uri (pypi-uri "python-lzo" version))
406 "11p3ifg14p086byhhin6azx5svlkg8dzw2b5abixik97xd6fm81q"))))
407 (build-system python-build-system)
409 `(#:test-target "check"
411 (modify-phases %standard-phases
412 (add-after 'unpack 'patch-setuppy
414 (substitute* "setup.py"
415 (("include_dirs.append\\(.*\\)")
416 (string-append "include_dirs.append('"
417 (assoc-ref %build-inputs "lzo")
423 (home-page "https://github.com/jd-boyd/python-lzo")
424 (synopsis "Python bindings for the LZO data compression library")
426 "Python-LZO provides Python bindings for LZO, i.e. you can access
427 the LZO library from your Python scripts thereby compressing ordinary
429 (license license:gpl2+)))
431 (define-public python2-lzo
432 (package-with-python2 python-lzo))
441 (uri (string-append "http://www.lzop.org/download/lzop-"
445 "1jdjvc4yjndf7ihmlcsyln2rbnbaxa86q4jskmkmm7ylfy65nhn1"))))
446 (build-system gnu-build-system)
447 (inputs `(("lzo" ,lzo)))
448 (home-page "http://www.lzop.org/")
449 (synopsis "Compress or expand files")
451 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
452 LZO data compression library for compression services, and its main advantages
453 over gzip are much higher compression and decompression speed (at the cost of
454 some compression ratio).")
455 (license license:gpl2+)))
463 (uri (string-append "mirror://savannah/lzip/lzip-"
467 "0l9724rw1l3hg2ldr3n7ihqich4m9nc6y7l302bvdj4jmxdw530j"))))
468 (build-system gnu-build-system)
469 (home-page "http://www.nongnu.org/lzip/lzip.html")
470 (synopsis "Lossless data compressor based on the LZMA algorithm")
472 "Lzip is a lossless data compressor with a user interface similar to the
473 one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
474 more than bzip2, which makes it well suited for software distribution and data
475 archiving. Lzip is a clean implementation of the LZMA algorithm.")
476 (license license:gpl3+)))
478 (define-public sharutils
485 (uri (string-append "mirror://gnu/sharutils/sharutils-"
489 "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b"))))
490 (build-system gnu-build-system)
496 'patch-source-shebangs 'unpatch-source-shebang
497 ;; revert the patch-shebang phase on a script which is
500 (substitute* "tests/shar-1.ok"
501 (((which "sh")) "/bin/sh")))
503 (home-page "https://www.gnu.org/software/sharutils/")
504 (synopsis "Archives in shell scripts, uuencode/uudecode")
506 "GNU sharutils is a package for creating and manipulating shell
507 archives that can be readily emailed. A shell archive is a file that can be
508 processed by a Bourne-type shell to unpack the original collection of files.
509 This package is mostly for compatibility and historical interest.")
510 (license license:gpl3+)))
512 (define-public sfarklib
518 (uri (string-append "https://github.com/raboof/sfArkLib/archive/"
520 (file-name (string-append name "-" version ".tar.gz"))
523 "0bzs2d98rk1xw9qwpnc7gmlbxwmwc3dg1rpn310afy9pq1k9clzi"))))
524 (build-system gnu-build-system)
526 `(#:tests? #f ;no "check" target
528 (modify-phases %standard-phases
530 (lambda* (#:key outputs #:allow-other-keys)
531 (substitute* "Makefile"
532 (("/usr/local") (assoc-ref outputs "out")))
536 (home-page "https://github.com/raboof/sfArkLib")
537 (synopsis "Library for SoundFont decompression")
539 "SfArkLib is a C++ library for decompressing SoundFont files compressed
540 with the sfArk algorithm.")
541 (license license:gpl3+)))
543 (define-public sfarkxtc
544 (let ((commit "b5e0a2ba3921f019d74d4b92bd31c36dd19d2cf1"))
547 (version (string-take commit 10))
549 ;; There are no release tarballs, so we just fetch the latest
550 ;; commit at this time.
553 (url "https://github.com/raboof/sfarkxtc.git")
557 "0f5x6i46qfl6ry21s7g2p4sd4b2r1g4fb03yqi2vv4kq3saryhvj"))))
558 (build-system gnu-build-system)
560 `(#:tests? #f ;no "check" target
562 (modify-phases %standard-phases
564 (lambda* (#:key outputs #:allow-other-keys)
565 (substitute* "Makefile"
566 (("/usr/local") (assoc-ref outputs "out")))
570 ("sfarklib" ,sfarklib)))
571 (home-page "https://github.com/raboof/sfarkxtc")
572 (synopsis "Basic sfArk decompressor")
573 (description "SfArk extractor converts SoundFonts in the compressed legacy
574 sfArk file format to the uncompressed sf2 format.")
575 (license license:gpl3+))))
577 (define-public libmspack
584 (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
585 version "alpha.tar.gz"))
587 (base32 "04413hynb7zizxnkgy9riik3612dwirkpr6fcjrnfl2za9sz4rw9"))))
588 (build-system gnu-build-system)
589 (home-page "http://www.cabextract.org.uk/libmspack/")
590 (synopsis "Compression tools for some formats used by Microsoft")
592 "The purpose of libmspack is to provide both compression and
593 decompression of some loosely related file formats used by Microsoft.")
594 (license license:lgpl2.1+)))
596 (define-public perl-compress-raw-bzip2
598 (name "perl-compress-raw-bzip2")
603 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
604 "Compress-Raw-Bzip2-" version ".tar.gz"))
607 "0b5jwqf15zr787acnx8sfyy2zavdd7gfkd98n1dgy8fs6r8yb8a4"))))
608 (build-system perl-build-system)
609 ;; TODO: Use our bzip2 package.
610 (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
611 (synopsis "Low-level interface to bzip2 compression library")
612 (description "This module provides a Perl interface to the bzip2
613 compression library.")
614 (license (package-license perl))))
616 (define-public perl-compress-raw-zlib
618 (name "perl-compress-raw-zlib")
623 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
624 "Compress-Raw-Zlib-" version ".tar.gz"))
627 "08bpx9v6i40n54rdcj6invlj294z20amrl8wvwf9b83aldwdwsd3"))))
628 (build-system perl-build-system)
632 `(#:phases (modify-phases %standard-phases
634 'configure 'configure-zlib
635 (lambda* (#:key inputs #:allow-other-keys)
636 (call-with-output-file "config.in"
643 GZIP_OS_CODE = AUTO_DETECT"
644 (assoc-ref inputs "zlib")))))))))
645 (home-page "http://search.cpan.org/dist/Compress-Raw-Zlib")
646 (synopsis "Low-level interface to zlib compression library")
647 (description "This module provides a Perl interface to the zlib
648 compression library.")
649 (license (package-license perl))))
651 (define-public perl-io-compress
653 (name "perl-io-compress")
658 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
659 "IO-Compress-" version ".tar.gz"))
662 "1wlpy2026djfmq0bjync531yq6s695jf7bcnpvjphrasi776igdl"))))
663 (build-system perl-build-system)
665 `(("perl-compress-raw-zlib" ,perl-compress-raw-zlib) ; >=2.074
666 ("perl-compress-raw-bzip2" ,perl-compress-raw-bzip2))) ; >=2.074
667 (home-page "http://search.cpan.org/dist/IO-Compress")
668 (synopsis "IO Interface to compressed files/buffers")
669 (description "IO-Compress provides a Perl interface to allow reading and
670 writing of compressed data created with the zlib and bzip2 libraries.")
671 (license (package-license perl))))
680 (uri (string-append "https://github.com/lz4/lz4/archive/"
681 "v" version ".tar.gz"))
682 (patches (search-patches "lz4-fix-test-failures.patch"))
685 "0zkykqqjfa1q3ji0qmb1ml3l9063qqfh99agyj3cnb02cg6wm401"))
686 (file-name (string-append name "-" version ".tar.gz"))))
687 (build-system gnu-build-system)
688 (native-inputs `(("valgrind" ,valgrind))) ; for tests
690 `(#:test-target "test"
691 #:parallel-tests? #f ; tests fail if run in parallel
692 #:make-flags (list "CC=gcc"
693 (string-append "PREFIX=" (assoc-ref %outputs "out")))
694 #:phases (modify-phases %standard-phases
695 (delete 'configure)))) ; no configure script
696 (home-page "https://github.com/lz4/lz4")
697 (synopsis "Compression algorithm focused on speed")
698 (description "LZ4 is a lossless compression algorithm, providing
699 compression speed at 400 MB/s per core (0.16 Bytes/cycle). It also features an
700 extremely fast decoder, with speed in multiple GB/s per core (0.71 Bytes/cycle).
701 A high compression derivative, called LZ4_HC, is also provided. It trades CPU
702 time for compression ratio.")
703 ;; The libraries (lz4, lz4hc, and xxhash are BSD licenced. The command
704 ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
705 (license (list license:bsd-2 license:gpl2+))))
707 (define-public python-lz4
714 (uri (pypi-uri "lz4" version))
717 "1irad4sq4hdr30fr53smvv3zzk4rddcf9b4jx19w8s9xsxhr1x3b"))))
718 (build-system python-build-system)
720 `(("python-nose" ,python-nose)))
721 (home-page "https://github.com/python-lz4/python-lz4")
722 (synopsis "LZ4 Bindings for Python")
724 "This package provides python bindings for the lz4 compression library
725 by Yann Collet. The project contains bindings for the LZ4 block format and
726 the LZ4 frame format.")
727 (license license:bsd-3)))
729 (define-public python2-lz4
730 (package-with-python2 python-lz4))
732 (define-public squashfs-tools
734 (name "squashfs-tools")
738 (uri (string-append "mirror://sourceforge/squashfs/squashfs/"
739 "squashfs" version "/"
740 "squashfs" version ".tar.gz"))
743 "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"))))
744 (build-system gnu-build-system)
746 '(#:tests? #f ; no check target
752 (string-append "INSTALL_DIR=" %output "/bin"))
754 (modify-phases %standard-phases
757 (chdir "squashfs-tools"))))))
763 (home-page "http://squashfs.sourceforge.net/")
764 (synopsis "Tools to create and extract squashfs file systems")
766 "Squashfs is a highly compressed read-only file system for Linux. It uses
767 zlib to compress files, inodes, and directories. All blocks are packed to
768 minimize the data overhead, and block sizes of between 4K and 1M are supported.
769 It is intended to be used for archival use, for live CDs, and for embedded
770 systems where low overhead is needed. This package allows you to create and
771 extract such file systems.")
772 (license license:gpl2+)))
780 (uri (string-append "http://zlib.net/pigz/"
781 name "-" version ".tar.gz"))
784 "172hdf26k4zmm7z8md7nl0dph2a7mhf3x7slb9bhfyff6as6g2sf"))))
785 (build-system gnu-build-system)
788 (modify-phases %standard-phases
791 (lambda* (#:key outputs #:allow-other-keys)
792 (let* ((out (assoc-ref outputs "out"))
793 (bin (string-append out "/bin"))
794 (man (string-append out "/share/man/man1")))
795 (install-file "pigz" bin)
796 (symlink "pigz" (string-append bin "/unpigz"))
797 (install-file "pigz.1" man)
799 #:make-flags (list "CC=gcc")
800 #:test-target "tests"))
801 (inputs `(("zlib" ,zlib)))
802 (home-page "http://zlib.net/pigz/")
803 (synopsis "Parallel implementation of gzip")
805 "This package provides a parallel implementation of gzip that exploits
806 multiple processors and multiple cores when compressing data.")
808 ;; Things under zopfli/ are under ASL2.0, but 4 files at the top-level,
809 ;; written by Mark Adler, are under another non-copyleft license.
810 (license license:asl2.0)))
819 "https://github.com/vasi/pixz/releases/download/v" version
820 "/pixz-" version ".tar.xz"))
823 "1s3j7zw6j5zi3fhdxg287ndr3wf6swac7z21mqd1pyiln530gi82"))))
824 (build-system gnu-build-system)
826 `(("pkg-config" ,pkg-config)
827 ("libarchive" ,libarchive)))
828 (home-page "https://github.com/vasi/pixz")
829 (synopsis "Parallel indexing implementation of LZMA")
831 "The existing XZ Utils provide great compression in the .xz file format,
832 but they produce just one big block of compressed data. Pixz instead produces
833 a collection of smaller blocks which makes random access to the original data
834 possible and can compress in parallel. This is especially useful for large
836 (license license:bsd-2)))
838 (define-public brotli
839 (let ((commit "e992cce7a174d6e2b3486616499d26bb0bad6448")
843 (version (string-append "0.1-" revision "."
844 (string-take commit 7)))
848 (url "https://github.com/bagder/libbrotli.git")
851 (file-name (string-append name "-" version ".tar.xz"))
854 "1qxxsasvwbbbh6dl3138y9h3fg0q2v7xdk5jjc690bdg7g1wrj6n"))
855 (modules '((guix build utils)))
857 ;; This is a recursive submodule that is unnecessary for this
858 ;; package, so delete it.
859 '(delete-file-recursively "brotli/terryfy"))))
860 (build-system gnu-build-system)
862 `(("autoconf" ,autoconf)
863 ("automake" ,automake)
864 ("libtool" ,libtool)))
866 `(#:phases (modify-phases %standard-phases
867 (add-after 'unpack 'autogen
870 (zero? (system* "autoreconf" "-vfi")))))))
871 (home-page "https://github.com/bagder/libbrotli/")
872 (synopsis "Implementation of the Brotli compression algorithm")
874 "Brotli is a general-purpose lossless compression algorithm. It is
875 similar in speed to deflate but offers denser compression. This package
876 provides encoder and a decoder libraries: libbrotlienc and libbrotlidec,
877 respectively, based on the reference implementation from Google.")
878 (license license:expat))))
880 (define-public cabextract
887 "http://cabextract.org.uk/cabextract-" version ".tar.gz"))
890 "1ysmmz25fjghq7mxb2anyyvr1ljxqxzi4piwjhk0sdamcnsn3rnf"))))
891 (build-system gnu-build-system)
892 (arguments '(#:configure-flags '("--with-external-libmspack")))
894 `(("pkg-config" ,pkg-config)))
896 `(("libmspack" ,libmspack)))
897 (home-page "http://www.cabextract.org.uk/")
898 (synopsis "Tool to unpack Cabinet archives")
899 (description "Extracts files out of Microsoft Cabinet (.cab) archives")
900 ;; Some source files specify gpl2+, lgpl2+, however COPYING is gpl3.
901 (license license:gpl3+)))
903 (define-public xdelta
910 (uri (string-append "https://github.com/jmacd/xdelta/archive/v"
914 "17g2pbbqy6h20qgdjq7ykib7kg5ajh8fwbsfgyjqg8pwg19wy5bm"))
915 (file-name (string-append name "-" version ".tar.gz"))
917 ;; This file isn't freely distributable and has no effect on building.
918 '(delete-file "xdelta3/draft-korn-vcdiff.txt"))))
919 (build-system gnu-build-system)
921 `(("autoconf" ,autoconf)
922 ("automake" ,automake)))
925 (modify-phases %standard-phases
926 (add-after 'unpack 'enter-build-directory
927 (lambda _ (chdir "xdelta3")))
928 (add-before 'configure 'autoconf
929 (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
930 (home-page "http://xdelta.com")
931 (synopsis "Delta encoder for binary files")
932 (description "xdelta encodes only the differences between two binary files
933 using the VCDIFF algorithm and patch file format described in RFC 3284. It can
934 also be used to apply such patches. xdelta is similar to @command{diff} and
935 @command{patch}, but is not limited to plain text and does not generate
936 human-readable output.")
937 (license license:asl2.0)))
947 "http://ck.kolivas.org/apps/lrzip/lrzip-" version ".tar.bz2"))
950 "0mb449vmmwpkalq732jdyginvql57nxyd31sszb108yps1lf448d"))))
951 (build-system gnu-build-system)
953 `(;; nasm is only required when building for 32-bit x86 platforms
954 ,@(if (string-prefix? "i686" (or (%current-target-system)
963 (home-page "http://ck.kolivas.org/apps/lrzip/")
964 (synopsis "Large file compressor with a very high compression ratio")
965 (description "lrzip is a compression utility that uses long-range
966 redundancy reduction to improve the subsequent compression ratio of
967 larger files. It can then further compress the result with the ZPAQ or
968 LZMA algorithms for maximum compression, or LZO for maximum speed. This
969 choice between size or speed allows for either better compression than
970 even LZMA can provide, or a higher speed than gzip while compressing as
972 (license (list license:gpl3+
973 license:public-domain)))) ; most files in lzma/
975 (define-public snappy
982 "https://github.com/google/snappy/releases/download/"
983 version "/" name "-" version ".tar.gz"))
986 "1wzf8yif5ym2gj52db6v5m1pxnmn258i38x7llk9x346y2nq47ig"))))
987 (build-system gnu-build-system)
988 (home-page "https://github.com/google/snappy")
989 (synopsis "Fast compressor/decompressor")
990 (description "Snappy is a compression/decompression library. It does not
991 aim for maximum compression, or compatibility with any other compression library;
992 instead, it aims for very high speeds and reasonable compression. For instance,
993 compared to the fastest mode of zlib, Snappy is an order of magnitude faster
994 for most inputs, but the resulting compressed files are anywhere from 20% to
996 (license license:asl2.0)))
1004 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1005 version "/" name "_" version
1006 "_src_all.tar.bz2"))
1009 "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy"))
1010 (modules '((guix build utils)))
1013 ;; Remove non-free source files
1014 (for-each delete-file
1016 (find-files "CPP/7zip/Compress" "Rar.*")
1017 (find-files "CPP/7zip/Crypto" "Rar.*")
1018 (find-files "DOC/unRarLicense.txt")
1019 (find-files "Utils/file_Codecs_Rar_so.py")))
1020 (delete-file-recursively "CPP/7zip/Archive/Rar")
1021 (delete-file-recursively "CPP/7zip/Compress/Rar")
1023 (patches (search-patches "p7zip-CVE-2016-9296.patch"
1024 "p7zip-remove-unused-code.patch"))))
1025 (build-system gnu-build-system)
1028 (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
1030 (modify-phases %standard-phases
1032 (lambda* (#:key system outputs #:allow-other-keys)
1033 (zero? (system* "cp"
1034 (let ((system ,(or (%current-target-system)
1035 (%current-system))))
1037 ((string-prefix? "x86_64" system)
1038 "makefile.linux_amd64_asm")
1039 ((string-prefix? "i686" system)
1040 "makefile.linux_x86_asm_gcc_4.X")
1042 "makefile.linux_any_cpu_gcc_4.X")))
1043 "makefile.machine"))))
1046 (and (zero? (system* "make" "test"))
1047 (zero? (system* "make" "test_7z"))
1048 (zero? (system* "make" "test_7zr"))))))))
1050 (let ((system (or (%current-target-system)
1051 (%current-system))))
1052 `(,@(cond ((string-prefix? "x86_64" system)
1054 ((string-prefix? "i686" system)
1057 (home-page "http://p7zip.sourceforge.net/")
1058 (synopsis "Command-line file archiver with high compression ratio")
1059 (description "p7zip is a command-line port of 7-Zip, a file archiver that
1060 handles the 7z format which features very high compression ratios.")
1061 (license (list license:lgpl2.1+
1063 license:public-domain))))
1065 (define-public gzstream
1072 ;; No versioned URL, but last release was in 2003.
1073 "http://www.cs.unc.edu/Research/compgeom/gzstream/gzstream.tgz")
1074 (file-name (string-append name "-" version ".tgz"))
1077 "00y19pqjsdj5zcrx4p9j56pl73vayfwnb7y2hvp423nx0cwv5b4r"))
1078 (modules '((guix build utils)))
1080 ;; Remove pre-compiled object.
1081 '(delete-file "gzstream.o"))))
1082 (build-system gnu-build-system)
1084 `(#:test-target "test"
1086 (modify-phases %standard-phases
1089 (lambda* (#:key outputs #:allow-other-keys)
1090 (let* ((out (assoc-ref outputs "out"))
1091 (lib (string-append out "/lib"))
1092 (include (string-append out "/include")))
1093 (install-file "libgzstream.a" lib)
1094 (install-file "gzstream.h" include)
1096 (propagated-inputs `(("zlib" ,zlib)))
1097 (home-page "http://www.cs.unc.edu/Research/compgeom/gzstream/")
1098 (synopsis "Compressed C++ iostream")
1099 (description "gzstream is a small library for providing zlib
1100 functionality in a C++ iostream.")
1101 (license license:lgpl2.1+)))
1109 (method url-fetch/zipbomb)
1110 (uri (string-append "http://mattmahoney.net/dc/zpaq"
1111 (string-delete #\. version) ".zip"))
1114 "066l94yyladlfzri877nh2dhkvspagjn3m5bmv725fmhkr9c4pp8"))
1115 (modules '((guix build utils)))
1117 ;; Delete irrelevant pre-compiled binaries.
1118 '(for-each delete-file (find-files "." "\\.exe$")))))
1119 (build-system gnu-build-system)
1122 (modify-phases %standard-phases
1123 (delete 'configure)) ; no ‘configure’ script
1126 (string-append "CPPFLAGS=-Dunix"
1127 ,(match (or (%current-target-system)
1132 ;; These should be safe, lowest-common-denominator instruction sets,
1133 ;; allowing for some optimisation while remaining reproducible.
1134 (string-append "CXXFLAGS=-O3 -DNDEBUG"
1135 ,(match (or (%current-target-system)
1137 ("x86_64-linux" " -march=nocona -mtune=generic")
1138 ("i686-linux" " -march=i686 -mtune=generic")
1139 ("armhf-linux" " -mtune=generic-armv7-a")
1141 (string-append "PREFIX="
1142 (assoc-ref %outputs "out")))))
1144 `(("perl" ,perl))) ; for pod2man
1145 (home-page "http://mattmahoney.net/dc/zpaq.html")
1146 (synopsis "Incremental journaling archiver")
1147 (description "ZPAQ is a command-line archiver for realistic situations with
1148 many duplicate and already compressed files. It backs up only those files
1149 modified since the last update. All previous versions remain untouched and can
1150 be independently recovered. Identical files are only stored once (known as
1151 @dfn{de-duplication}). Archives can also be encrypted.
1153 ZPAQ is intended to back up user data, not entire operating systems. It ignores
1154 owner and group IDs, ACLs, extended attributes, or special file types like
1155 devices, sockets, or named pipes. It does not follow or restore symbolic links
1156 or junctions, and always follows hard links.")
1157 (license (list license:public-domain
1158 ;; libzpaq.cpp contains a mix of public-domain and
1159 ;; expat-licenced (or ‘MIT’) code.
1162 (define-public unrar
1169 "http://download.gna.org/unrar/unrar-" version ".tar.gz"))
1172 "1fgmjaxffj3shyxgy765jhxwz1cq88hk0fih1bsdzyvymyyz6mz7"))))
1173 (build-system gnu-build-system)
1174 (home-page "http://download.gna.org/unrar")
1175 (synopsis "RAR archive extraction tool")
1176 (description "Unrar is a simple command-line program to list and extract
1178 (license license:gpl2+)))
1186 (uri (string-append "https://github.com/facebook/zstd/archive/v"
1188 (file-name (string-append name "-" version ".tar.gz"))
1191 "1yxr1y83gphljxaqhwvxbldy1ivx81x93rngiv5l94rmdrc2pbka"))
1192 (modules '((guix build utils)))
1194 ;; Remove non-free source files.
1196 (for-each delete-file-recursively
1198 ;; Commercial use of the following is not allowed.
1200 "LICENSE-examples"))
1202 (build-system gnu-build-system)
1205 (modify-phases %standard-phases
1206 (delete 'configure)) ; no configure script
1209 (string-append "PREFIX=" (assoc-ref %outputs "out")))
1210 #:test-target "test"))
1211 (home-page "http://zstd.net/")
1212 (synopsis "Zstandard real-time compression algorithm")
1213 (description "Zstandard (@command{zstd}) is a lossless compression algorithm
1214 that combines very fast operation with a compression ratio comparable to that of
1215 zlib. In most scenarios, both compression and decompression can be performed in
1216 ‘real time’. The compressor can be configured to provide the most suitable
1217 trade-off between compression ratio and speed, without affecting decompression
1219 (license (list license:bsd-3 ; the main top-level LICENSE file
1220 license:bsd-2 ; quite a few files have but 2 clauses
1221 license:public-domain ; zlibWrapper/examples/fitblk*
1222 license:zlib)))) ; zlibWrapper/{gz*.c,gzguts.h}
1224 (define-public pzstd
1227 (version (package-version zstd))
1228 (source (package-source zstd))
1229 (build-system gnu-build-system)
1231 `(("googletest", googletest)))
1234 (modify-phases %standard-phases
1235 (add-after 'unpack 'enter-subdirectory
1236 (lambda _ (chdir "contrib/pzstd")))
1237 (delete 'configure) ; no configure script
1238 (add-before 'check 'compile-tests
1239 (lambda* (#:key make-flags #:allow-other-keys)
1240 (zero? (apply system* "make" "tests" make-flags))))
1241 (add-after 'install 'install-documentation
1242 (lambda* (#:key outputs #:allow-other-keys)
1243 (let* ((out (assoc-ref outputs "out"))
1244 (doc (string-append out "/share/doc/" ,name)))
1246 (install-file "README.md" doc)
1250 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1251 (home-page (package-home-page zstd))
1252 (synopsis "Threaded implementation of the Zstandard compression algorithm")
1253 (description "Parallel Zstandard (PZstandard or @command{pzstd}) is a
1254 multi-threaded implementation of the @uref{http://zstd.net/, Zstandard
1255 compression algorithm}. It is fully compatible with the original Zstandard file
1256 format and command-line interface, and can be used as a drop-in replacement.
1258 Compression is distributed over multiple processor cores to improve performance,
1259 as is the decompression of data compressed in this manner. Data compressed by
1260 other implementations will only be decompressed by two threads: one performing
1261 the actual decompression, the other input and output.")
1262 (license (package-license zstd))))