gnu: git: Add "svn" output for 'git-svn'.
[jackhill/guix/guix.git] / gnu / packages / compression.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
38bbd61d 2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
a268f085 3;;;
233e7676 4;;; This file is part of GNU Guix.
a268f085 5;;;
233e7676 6;;; GNU Guix is free software; you can redistribute it and/or modify it
a268f085
LC
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
233e7676 11;;; GNU Guix is distributed in the hope that it will be useful, but
a268f085
LC
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
233e7676 17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
a268f085 18
1ffa7090 19(define-module (gnu packages compression)
4a44e743
NK
20 #:use-module ((guix licenses)
21 #:renamer (symbol-prefix-proc 'license:))
a268f085 22 #:use-module (guix packages)
87f5d366 23 #:use-module (guix download)
a268f085
LC
24 #:use-module (guix build-system gnu))
25
6a92093d
LC
26(define-public zlib
27 (package
28 (name "zlib")
29 (version "1.2.7")
30 (source
31 (origin
87f5d366 32 (method url-fetch)
a67f97fe
CR
33 (uri (list (string-append "http://zlib.net/zlib-"
34 version ".tar.gz")
35 (string-append "mirror://sourceforge/libpng/zlib-"
36 version ".tar.gz")))
6a92093d
LC
37 (sha256
38 (base32
39 "1i96gsdvxqb6skp9a58bacf1wxamwi9m9pg4yn7cpf7g7239r77s"))))
40 (build-system gnu-build-system)
41 (arguments
42 `(#:phases (alist-replace
43 'configure
44 (lambda* (#:key outputs #:allow-other-keys)
45 ;; Zlib's home-made `configure' doesn't fails when passed
46 ;; extra flags like `--enable-fast-install', so we need to
47 ;; invoke it with just what it understand.
48 (let ((out (assoc-ref outputs "out")))
49 (zero? (system* "./configure"
50 (string-append "--prefix=" out)))))
51 %standard-phases)))
52 (home-page "http://zlib.net/")
53 (synopsis "The zlib compression library")
54 (description
55 "zlib is designed to be a free, general-purpose, legally unencumbered --
56that is, not covered by any patents -- lossless data-compression library for
57use on virtually any computer hardware and operating system. The zlib data
58format is itself portable across platforms. Unlike the LZW compression method
59used in Unix compress(1) and in the GIF image format, the compression method
60currently used in zlib essentially never expands the data. (LZW can double or
61triple the file size in extreme cases.) zlib's memory footprint is also
62independent of the input data and can be reduced, if necessary, at some cost
63in compression.")
4a44e743 64 (license license:zlib)))
6a92093d 65
a268f085
LC
66(define-public gzip
67 (package
68 (name "gzip")
2a511f7a 69 (version "1.6")
a268f085 70 (source (origin
87f5d366 71 (method url-fetch)
0db342a5 72 (uri (string-append "mirror://gnu/gzip/gzip-"
a268f085
LC
73 version ".tar.gz"))
74 (sha256
75 (base32
2a511f7a 76 "0zlgdm4v3dndrbiz7b67mbbj25dpwqbmbzjiycssvrfrcfvq7swp"))))
a268f085 77 (build-system gnu-build-system)
f50d2669 78 (synopsis "General file (de)compression (using lzw)")
a268f085
LC
79 (arguments
80 ;; FIXME: The test suite wants `less', and optionally Perl.
81 '(#:tests? #f))
82 (description
83 "gzip (GNU zip) is a popular data compression program written by Jean-loup
84Gailly for the GNU project. Mark Adler wrote the decompression part.
85
86We developed this program as a replacement for compress because of the Unisys
87and IBM patents covering the LZW algorithm used by compress. These patents
88made it impossible for us to use compress, and we needed a replacement. The
89superior compression ratio of gzip is just a bonus.")
4a44e743 90 (license license:gpl3+)
a268f085
LC
91 (home-page "http://www.gnu.org/software/gzip/")))
92
93(define-public bzip2
94 (let ((fix-man-dir
95 ;; Move man pages to $out/share/.
96 '(lambda* (#:key outputs #:allow-other-keys)
97 (with-directory-excursion (assoc-ref outputs "out")
98 (mkdir "share")
99 (rename-file "man" "share"))))
100 (build-shared-lib
101 ;; Build a shared library.
102 '(lambda* (#:key inputs #:allow-other-keys)
f678f6d9 103 (patch-makefile-SHELL "Makefile-libbz2_so")
a268f085
LC
104 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
105 (install-shared-lib
106 '(lambda* (#:key outputs #:allow-other-keys)
107 (let* ((out (assoc-ref outputs "out"))
108 (libdir (string-append out "/lib")))
109 (for-each (lambda (file)
110 (let ((base (basename file)))
111 (format #t "installing `~a' to `~a'~%"
112 base libdir)
113 (copy-file file
114 (string-append libdir "/" base))))
115 (find-files "." "^libbz2\\.so"))))))
116 (package
117 (name "bzip2")
118 (version "1.0.6")
119 (source (origin
87f5d366 120 (method url-fetch)
a268f085
LC
121 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
122 version ".tar.gz"))
123 (sha256
124 (base32
125 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
126 (build-system gnu-build-system)
127 (arguments
128 `(#:modules ((guix build gnu-build-system)
129 (guix build utils)
130 (srfi srfi-1))
131 #:phases
132 (alist-cons-before
133 'build 'build-shared-lib ,build-shared-lib
134 (alist-cons-after
135 'install 'fix-man-dir ,fix-man-dir
136 (alist-cons-after
137 'install 'install-shared-lib ,install-shared-lib
138 (alist-delete 'configure %standard-phases))))
139 #:make-flags (list (string-append "PREFIX="
140 (assoc-ref %outputs "out")))))
141 (synopsis "high-quality data compression program")
142 (description
143 "bzip2 is a freely available, patent free (see below), high-quality data
144compressor. It typically compresses files to within 10% to 15% of the best
145available techniques (the PPM family of statistical compressors), whilst
146being around twice as fast at compression and six times faster at
147decompression.")
4a44e743
NK
148 (license (license:bsd-style "file://LICENSE"
149 "See LICENSE in the distribution."))
a268f085
LC
150 (home-page "http://www.bzip.org/"))))
151
152(define-public xz
153 (package
154 (name "xz")
155 (version "5.0.4")
156 (source (origin
87f5d366 157 (method url-fetch)
a268f085
LC
158 (uri (string-append "http://tukaani.org/xz/xz-" version
159 ".tar.gz"))
160 (sha256
161 (base32
162 "1dl35ca8fdss9z2d6y234gxh24ixq904xksizrjmjr5dimwhax6n"))))
163 (build-system gnu-build-system)
164 (synopsis
165 "XZ, general-purpose data compression software, successor of LZMA")
166 (description
167 "XZ Utils is free general-purpose data compression software with high
168compression ratio. XZ Utils were written for POSIX-like systems, but also
169work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
170
171The core of the XZ Utils compression code is based on LZMA SDK, but it has
172been modified quite a lot to be suitable for XZ Utils. The primary
173compression algorithm is currently LZMA2, which is used inside the .xz
174container format. With typical files, XZ Utils create 30 % smaller output
175than gzip and 15 % smaller output than bzip2.")
38bbd61d 176 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
a268f085 177 (home-page "http://tukaani.org/xz/")))
c6eac761
LC
178
179(define-public lzo
180 (package
181 (name "lzo")
182 (version "2.06")
183 (source
184 (origin
185 (method url-fetch)
186 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
187 version ".tar.gz"))
188 (sha256
189 (base32
190 "0wryshs446s7cclrbjykyj766znhcpnr7s3cxy33ybfn6vwfcygz"))))
191 (build-system gnu-build-system)
165fd9d5 192 (arguments '(#:configure-flags '("--enable-shared")))
c6eac761
LC
193 (home-page "http://www.oberhumer.com/opensource/lzo")
194 (synopsis
195 "A data compresion library suitable for real-time data de-/compression")
196 (description
197 "LZO is a data compression library which is suitable for data
198de-/compression in real-time. This means it favours speed over
199compression ratio.
200
201LZO is written in ANSI C. Both the source code and the compressed data
202format are designed to be portable across platforms.")
4a44e743 203 (license license:gpl2+)))
0f323dad
LC
204
205(define-public lzip
206 (package
207 (name "lzip")
208 (version "1.14")
209 (source (origin
210 (method url-fetch)
211 (uri (string-append "mirror://savannah/lzip/lzip-"
212 version ".tar.gz"))
213 (sha256
214 (base32
215 "1rybhk2pxpfh2789ck9mrkdv3bpx7b7miwndlshb5vb02m9crxbz"))))
216 (build-system gnu-build-system)
217 (home-page "http://www.nongnu.org/lzip/lzip.html")
218 (synopsis "Lossless data compressor based on the LZMA algorithm")
219 (description
220 "Lzip is a lossless data compressor with a user interface similar to the
221one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
222more than bzip2, which makes it well suited for software distribution and data
223archiving. Lzip is a clean implementation of the LZMA algorithm.")
224 (license license:gpl3+)))