gnu: Add Compress-Raw-Bzip2.
[jackhill/guix/guix.git] / gnu / packages / compression.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
9b1bf330 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
b357faac 3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
0a5c3087 4;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
27f76fe6 5;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
73f542c3 6;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
a268f085 7;;;
233e7676 8;;; This file is part of GNU Guix.
a268f085 9;;;
233e7676 10;;; GNU Guix is free software; you can redistribute it and/or modify it
a268f085
LC
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
233e7676 15;;; GNU Guix is distributed in the hope that it will be useful, but
a268f085
LC
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
233e7676 21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
a268f085 22
1ffa7090 23(define-module (gnu packages compression)
b5b73a82 24 #:use-module ((guix licenses) #:prefix license:)
a268f085 25 #:use-module (guix packages)
87f5d366 26 #:use-module (guix download)
b357faac 27 #:use-module (guix build-system gnu)
73f542c3
EB
28 #:use-module (guix build-system perl)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages perl))
a268f085 31
6a92093d
LC
32(define-public zlib
33 (package
34 (name "zlib")
35 (version "1.2.7")
36 (source
37 (origin
87f5d366 38 (method url-fetch)
a67f97fe
CR
39 (uri (list (string-append "http://zlib.net/zlib-"
40 version ".tar.gz")
41 (string-append "mirror://sourceforge/libpng/zlib-"
42 version ".tar.gz")))
6a92093d
LC
43 (sha256
44 (base32
45 "1i96gsdvxqb6skp9a58bacf1wxamwi9m9pg4yn7cpf7g7239r77s"))))
46 (build-system gnu-build-system)
47 (arguments
48 `(#:phases (alist-replace
49 'configure
50 (lambda* (#:key outputs #:allow-other-keys)
e67253db 51 ;; Zlib's home-made `configure' fails when passed
6a92093d
LC
52 ;; extra flags like `--enable-fast-install', so we need to
53 ;; invoke it with just what it understand.
54 (let ((out (assoc-ref outputs "out")))
e67253db
JD
55 ;; 'configure' doesn't understand '--host'.
56 ,@(if (%current-target-system)
57 `((setenv "CHOST" ,(%current-target-system)))
58 '())
59 (zero?
60 (system* "./configure"
61 (string-append "--prefix=" out)))))
6a92093d
LC
62 %standard-phases)))
63 (home-page "http://zlib.net/")
35b9e423 64 (synopsis "Compression library")
6a92093d
LC
65 (description
66 "zlib is designed to be a free, general-purpose, legally unencumbered --
67that is, not covered by any patents -- lossless data-compression library for
68use on virtually any computer hardware and operating system. The zlib data
35b9e423 69format is itself portable across platforms. Unlike the LZW compression method
6a92093d
LC
70used in Unix compress(1) and in the GIF image format, the compression method
71currently used in zlib essentially never expands the data. (LZW can double or
72triple the file size in extreme cases.) zlib's memory footprint is also
73independent of the input data and can be reduced, if necessary, at some cost
74in compression.")
4a44e743 75 (license license:zlib)))
6a92093d 76
ee97be9f
RW
77(define-public fastjar
78 (package
79 (name "fastjar")
80 (version "0.98")
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "mirror://savannah/fastjar/fastjar-"
84 version ".tar.gz"))
85 (sha256
86 (base32
87 "0iginbz2m15hcsa3x4y7v3mhk54gr1r7m3ghx0pg4n46vv2snmpi"))))
88 (build-system gnu-build-system)
89 (inputs `(("zlib" ,zlib)))
90 (home-page "http://savannah.nongnu.org/projects/fastjar")
91 (synopsis "Replacement for Sun's 'jar' utility")
92 (description
93 "FastJar is an attempt to create a much faster replacement for Sun's 'jar'
94utility. Instead of being written in Java, FastJar is written in C.")
95 (license license:gpl2+)))
96
a268f085
LC
97(define-public gzip
98 (package
99 (name "gzip")
2a511f7a 100 (version "1.6")
a268f085 101 (source (origin
87f5d366 102 (method url-fetch)
0db342a5 103 (uri (string-append "mirror://gnu/gzip/gzip-"
a268f085
LC
104 version ".tar.gz"))
105 (sha256
106 (base32
2a511f7a 107 "0zlgdm4v3dndrbiz7b67mbbj25dpwqbmbzjiycssvrfrcfvq7swp"))))
a268f085 108 (build-system gnu-build-system)
f50d2669 109 (synopsis "General file (de)compression (using lzw)")
a268f085
LC
110 (arguments
111 ;; FIXME: The test suite wants `less', and optionally Perl.
112 '(#:tests? #f))
113 (description
79c311b8
LC
114 "GNU Gzip provides data compression and decompression utilities; the
115typical extension is \".gz\". Unlike the \"zip\" format, it compresses a single
116file; as a result, it is often used in conjunction with \"tar\", resulting in
117\".tar.gz\" or \".tgz\", etc.")
4a44e743 118 (license license:gpl3+)
a268f085
LC
119 (home-page "http://www.gnu.org/software/gzip/")))
120
121(define-public bzip2
9b1bf330 122 (let ((build-shared-lib
a268f085
LC
123 ;; Build a shared library.
124 '(lambda* (#:key inputs #:allow-other-keys)
f678f6d9 125 (patch-makefile-SHELL "Makefile-libbz2_so")
a268f085
LC
126 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
127 (install-shared-lib
128 '(lambda* (#:key outputs #:allow-other-keys)
129 (let* ((out (assoc-ref outputs "out"))
130 (libdir (string-append out "/lib")))
131 (for-each (lambda (file)
132 (let ((base (basename file)))
133 (format #t "installing `~a' to `~a'~%"
134 base libdir)
135 (copy-file file
136 (string-append libdir "/" base))))
ab4fab19
LC
137 (find-files "." "^libbz2\\.so")))))
138 (set-cross-environment
139 '(lambda* (#:key target #:allow-other-keys)
140 (substitute* (find-files "." "Makefile")
141 (("CC=.*$")
142 (string-append "CC = " target "-gcc\n"))
143 (("AR=.*$")
144 (string-append "AR = " target "-ar\n"))
145 (("RANLIB=.*$")
146 (string-append "RANLIB = " target "-ranlib\n"))
147 (("^all:(.*)test" _ prerequisites)
148 ;; Remove 'all' -> 'test' dependency.
149 (string-append "all:" prerequisites "\n"))))))
a268f085
LC
150 (package
151 (name "bzip2")
152 (version "1.0.6")
153 (source (origin
87f5d366 154 (method url-fetch)
a268f085
LC
155 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
156 version ".tar.gz"))
157 (sha256
158 (base32
159 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
160 (build-system gnu-build-system)
161 (arguments
162 `(#:modules ((guix build gnu-build-system)
163 (guix build utils)
164 (srfi srfi-1))
165 #:phases
ab4fab19
LC
166 ,(if (%current-target-system)
167
168 ;; Cross-compilation: use the cross tools.
169 `(alist-cons-before
170 'build 'build-shared-lib ,build-shared-lib
171 (alist-cons-after
9b1bf330
LC
172 'install 'install-shared-lib ,install-shared-lib
173 (alist-replace 'configure ,set-cross-environment
174 %standard-phases)))
ab4fab19
LC
175
176 ;; Native compilation: build the shared library.
177 `(alist-cons-before
178 'build 'build-shared-lib ,build-shared-lib
179 (alist-cons-after
9b1bf330
LC
180 'install 'install-shared-lib ,install-shared-lib
181 (alist-delete 'configure %standard-phases))))
ab4fab19 182
a268f085 183 #:make-flags (list (string-append "PREFIX="
ab4fab19
LC
184 (assoc-ref %outputs "out")))
185
186 ;; Don't attempt to run the tests when cross-compiling.
187 ,@(if (%current-target-system)
188 '(#:tests? #f)
189 '())))
35b9e423 190 (synopsis "High-quality data compression program")
a268f085
LC
191 (description
192 "bzip2 is a freely available, patent free (see below), high-quality data
193compressor. It typically compresses files to within 10% to 15% of the best
194available techniques (the PPM family of statistical compressors), whilst
195being around twice as fast at compression and six times faster at
196decompression.")
166191b3 197 (license (license:non-copyleft "file://LICENSE"
4a44e743 198 "See LICENSE in the distribution."))
a268f085
LC
199 (home-page "http://www.bzip.org/"))))
200
201(define-public xz
202 (package
203 (name "xz")
204 (version "5.0.4")
205 (source (origin
87f5d366 206 (method url-fetch)
a268f085
LC
207 (uri (string-append "http://tukaani.org/xz/xz-" version
208 ".tar.gz"))
209 (sha256
210 (base32
211 "1dl35ca8fdss9z2d6y234gxh24ixq904xksizrjmjr5dimwhax6n"))))
212 (build-system gnu-build-system)
35b9e423 213 (synopsis "General-purpose data compression")
a268f085
LC
214 (description
215 "XZ Utils is free general-purpose data compression software with high
216compression ratio. XZ Utils were written for POSIX-like systems, but also
217work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
218
219The core of the XZ Utils compression code is based on LZMA SDK, but it has
220been modified quite a lot to be suitable for XZ Utils. The primary
221compression algorithm is currently LZMA2, which is used inside the .xz
222container format. With typical files, XZ Utils create 30 % smaller output
223than gzip and 15 % smaller output than bzip2.")
38bbd61d 224 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
a268f085 225 (home-page "http://tukaani.org/xz/")))
c6eac761
LC
226
227(define-public lzo
228 (package
229 (name "lzo")
230 (version "2.06")
231 (source
232 (origin
233 (method url-fetch)
234 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
235 version ".tar.gz"))
236 (sha256
237 (base32
238 "0wryshs446s7cclrbjykyj766znhcpnr7s3cxy33ybfn6vwfcygz"))))
239 (build-system gnu-build-system)
165fd9d5 240 (arguments '(#:configure-flags '("--enable-shared")))
c6eac761
LC
241 (home-page "http://www.oberhumer.com/opensource/lzo")
242 (synopsis
9e771e3b 243 "Data compresion library suitable for real-time data de-/compression")
c6eac761
LC
244 (description
245 "LZO is a data compression library which is suitable for data
246de-/compression in real-time. This means it favours speed over
247compression ratio.
248
249LZO is written in ANSI C. Both the source code and the compressed data
250format are designed to be portable across platforms.")
4a44e743 251 (license license:gpl2+)))
0f323dad 252
a9f48ff0
EB
253(define-public lzop
254 (package
255 (name "lzop")
256 (version "1.03")
257 (source
258 (origin
259 (method url-fetch)
260 (uri (string-append "http://www.lzop.org/download/lzop-"
261 version ".tar.gz"))
262 (sha256
263 (base32
264 "1jdjvc4yjndf7ihmlcsyln2rbnbaxa86q4jskmkmm7ylfy65nhn1"))))
265 (build-system gnu-build-system)
266 (inputs `(("lzo" ,lzo)))
267 (home-page "http://www.lzop.org/")
268 (synopsis "Compress or expand files")
269 (description
270 "Lzop is a file compressor which is very similar to gzip. Lzop uses the
271LZO data compression library for compression services, and its main advantages
272over gzip are much higher compression and decompression speed (at the cost of
273some compression ratio).")
274 (license license:gpl2+)))
275
0f323dad
LC
276(define-public lzip
277 (package
278 (name "lzip")
275a7711 279 (version "1.16")
0f323dad
LC
280 (source (origin
281 (method url-fetch)
282 (uri (string-append "mirror://savannah/lzip/lzip-"
283 version ".tar.gz"))
284 (sha256
285 (base32
275a7711 286 "0l9724rw1l3hg2ldr3n7ihqich4m9nc6y7l302bvdj4jmxdw530j"))))
0f323dad
LC
287 (build-system gnu-build-system)
288 (home-page "http://www.nongnu.org/lzip/lzip.html")
289 (synopsis "Lossless data compressor based on the LZMA algorithm")
290 (description
291 "Lzip is a lossless data compressor with a user interface similar to the
292one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
293more than bzip2, which makes it well suited for software distribution and data
294archiving. Lzip is a clean implementation of the LZMA algorithm.")
295 (license license:gpl3+)))
b357faac
AE
296
297(define-public sharutils
298 (package
299 (name "sharutils")
0a5c3087 300 (version "4.15")
b357faac
AE
301 (source
302 (origin
303 (method url-fetch)
304 (uri (string-append "mirror://gnu/sharutils/sharutils-"
305 version ".tar.xz"))
306 (sha256
307 (base32
0a5c3087 308 "19gqb6qbqmpgh6xlpgpj0ayw2nshllxg9d01qb5z8bnkhfcla8ka"))))
b357faac
AE
309 (build-system gnu-build-system)
310 (inputs
311 `(("which" ,which)))
312 (arguments
313 `(#:phases
314 (alist-cons-after
315 'patch-source-shebangs 'unpatch-source-shebang
316 ;; revert the patch-shebang phase on a script which is
317 ;; in fact test data
d4bf49b1 318 (lambda _
b357faac
AE
319 (substitute* "tests/shar-1.ok"
320 (((which "sh")) "/bin/sh")))
321 %standard-phases)))
322 (home-page "http://www.gnu.org/software/sharutils/")
323 (synopsis "Archives in shell scripts, uuencode/uudecode")
324 (description
79c311b8
LC
325 "GNU sharutils is a package for creating and manipulating shell
326archives that can be readily emailed. A shell archive is a file that can be
327processed by a Bourne-type shell to unpack the original collection of files.
328This package is mostly for compatibility and historical interest.")
b357faac 329 (license license:gpl3+)))
28469ab0 330
27f76fe6
TUBK
331(define-public libmspack
332 (package
333 (name "libmspack")
334 (version "0.5")
335 (source
336 (origin
337 (method url-fetch)
338 (uri (string-append "http://www.cabextract.org.uk/libmspack/libmspack-"
339 version "alpha.tar.gz"))
340 (sha256
341 (base32 "04413hynb7zizxnkgy9riik3612dwirkpr6fcjrnfl2za9sz4rw9"))))
342 (build-system gnu-build-system)
343 (home-page "http://www.cabextract.org.uk/libmspack/")
344 (synopsis "Compression tools for some formats used by Microsoft")
345 (description
346 "The purpose of libmspack is to provide both compression and
347decompression of some loosely related file formats used by Microsoft.")
348 (license license:lgpl2.1+)))
73f542c3
EB
349
350(define-public perl-compress-raw-bzip2
351 (package
352 (name "perl-compress-raw-bzip2")
353 (version "2.068")
354 (source
355 (origin
356 (method url-fetch)
357 (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/"
358 "Compress-Raw-Bzip2-" version ".tar.gz"))
359 (sha256
360 (base32
361 "16hl58xppckldz05zdyid1l5gpaykzwvkq682h3rc3nilbhgjqqg"))))
362 (build-system perl-build-system)
363 ;; TODO: Use our bzip2 package.
364 (home-page "http://search.cpan.org/dist/Compress-Raw-Bzip2")
365 (synopsis "Low-level interface to bzip2 compression library")
366 (description "This module provides a Perl interface to the bzip2
367compression library.")
368 (license (package-license perl))))