Commit | Line | Data |
---|---|---|
233e7676 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2012 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) |
6a92093d LC |
33 | (uri (string-append "http://zlib.net/zlib-" |
34 | version ".tar.gz")) | |
35 | (sha256 | |
36 | (base32 | |
37 | "1i96gsdvxqb6skp9a58bacf1wxamwi9m9pg4yn7cpf7g7239r77s")))) | |
38 | (build-system gnu-build-system) | |
39 | (arguments | |
40 | `(#:phases (alist-replace | |
41 | 'configure | |
42 | (lambda* (#:key outputs #:allow-other-keys) | |
43 | ;; Zlib's home-made `configure' doesn't fails when passed | |
44 | ;; extra flags like `--enable-fast-install', so we need to | |
45 | ;; invoke it with just what it understand. | |
46 | (let ((out (assoc-ref outputs "out"))) | |
47 | (zero? (system* "./configure" | |
48 | (string-append "--prefix=" out))))) | |
49 | %standard-phases))) | |
50 | (home-page "http://zlib.net/") | |
51 | (synopsis "The zlib compression library") | |
52 | (description | |
53 | "zlib is designed to be a free, general-purpose, legally unencumbered -- | |
54 | that is, not covered by any patents -- lossless data-compression library for | |
55 | use on virtually any computer hardware and operating system. The zlib data | |
56 | format is itself portable across platforms. Unlike the LZW compression method | |
57 | used in Unix compress(1) and in the GIF image format, the compression method | |
58 | currently used in zlib essentially never expands the data. (LZW can double or | |
59 | triple the file size in extreme cases.) zlib's memory footprint is also | |
60 | independent of the input data and can be reduced, if necessary, at some cost | |
61 | in compression.") | |
4a44e743 | 62 | (license license:zlib))) |
6a92093d | 63 | |
a268f085 LC |
64 | (define-public gzip |
65 | (package | |
66 | (name "gzip") | |
67 | (version "1.5") | |
68 | (source (origin | |
87f5d366 | 69 | (method url-fetch) |
0db342a5 | 70 | (uri (string-append "mirror://gnu/gzip/gzip-" |
a268f085 LC |
71 | version ".tar.gz")) |
72 | (sha256 | |
73 | (base32 | |
74 | "18rm80kar7n016g8bsyy1a3zk50i2826xdgs874yh64rzj7nxmdm")))) | |
75 | (build-system gnu-build-system) | |
76 | (synopsis "Gzip, the GNU zip compression program") | |
77 | (arguments | |
78 | ;; FIXME: The test suite wants `less', and optionally Perl. | |
79 | '(#:tests? #f)) | |
80 | (description | |
81 | "gzip (GNU zip) is a popular data compression program written by Jean-loup | |
82 | Gailly for the GNU project. Mark Adler wrote the decompression part. | |
83 | ||
84 | We developed this program as a replacement for compress because of the Unisys | |
85 | and IBM patents covering the LZW algorithm used by compress. These patents | |
86 | made it impossible for us to use compress, and we needed a replacement. The | |
87 | superior compression ratio of gzip is just a bonus.") | |
4a44e743 | 88 | (license license:gpl3+) |
a268f085 LC |
89 | (home-page "http://www.gnu.org/software/gzip/"))) |
90 | ||
91 | (define-public bzip2 | |
92 | (let ((fix-man-dir | |
93 | ;; Move man pages to $out/share/. | |
94 | '(lambda* (#:key outputs #:allow-other-keys) | |
95 | (with-directory-excursion (assoc-ref outputs "out") | |
96 | (mkdir "share") | |
97 | (rename-file "man" "share")))) | |
98 | (build-shared-lib | |
99 | ;; Build a shared library. | |
100 | '(lambda* (#:key inputs #:allow-other-keys) | |
f678f6d9 | 101 | (patch-makefile-SHELL "Makefile-libbz2_so") |
a268f085 LC |
102 | (zero? (system* "make" "-f" "Makefile-libbz2_so")))) |
103 | (install-shared-lib | |
104 | '(lambda* (#:key outputs #:allow-other-keys) | |
105 | (let* ((out (assoc-ref outputs "out")) | |
106 | (libdir (string-append out "/lib"))) | |
107 | (for-each (lambda (file) | |
108 | (let ((base (basename file))) | |
109 | (format #t "installing `~a' to `~a'~%" | |
110 | base libdir) | |
111 | (copy-file file | |
112 | (string-append libdir "/" base)))) | |
113 | (find-files "." "^libbz2\\.so")))))) | |
114 | (package | |
115 | (name "bzip2") | |
116 | (version "1.0.6") | |
117 | (source (origin | |
87f5d366 | 118 | (method url-fetch) |
a268f085 LC |
119 | (uri (string-append "http://www.bzip.org/" version "/bzip2-" |
120 | version ".tar.gz")) | |
121 | (sha256 | |
122 | (base32 | |
123 | "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152")))) | |
124 | (build-system gnu-build-system) | |
125 | (arguments | |
126 | `(#:modules ((guix build gnu-build-system) | |
127 | (guix build utils) | |
128 | (srfi srfi-1)) | |
129 | #:phases | |
130 | (alist-cons-before | |
131 | 'build 'build-shared-lib ,build-shared-lib | |
132 | (alist-cons-after | |
133 | 'install 'fix-man-dir ,fix-man-dir | |
134 | (alist-cons-after | |
135 | 'install 'install-shared-lib ,install-shared-lib | |
136 | (alist-delete 'configure %standard-phases)))) | |
137 | #:make-flags (list (string-append "PREFIX=" | |
138 | (assoc-ref %outputs "out"))))) | |
139 | (synopsis "high-quality data compression program") | |
140 | (description | |
141 | "bzip2 is a freely available, patent free (see below), high-quality data | |
142 | compressor. It typically compresses files to within 10% to 15% of the best | |
143 | available techniques (the PPM family of statistical compressors), whilst | |
144 | being around twice as fast at compression and six times faster at | |
145 | decompression.") | |
4a44e743 NK |
146 | (license (license:bsd-style "file://LICENSE" |
147 | "See LICENSE in the distribution.")) | |
a268f085 LC |
148 | (home-page "http://www.bzip.org/")))) |
149 | ||
150 | (define-public xz | |
151 | (package | |
152 | (name "xz") | |
153 | (version "5.0.4") | |
154 | (source (origin | |
87f5d366 | 155 | (method url-fetch) |
a268f085 LC |
156 | (uri (string-append "http://tukaani.org/xz/xz-" version |
157 | ".tar.gz")) | |
158 | (sha256 | |
159 | (base32 | |
160 | "1dl35ca8fdss9z2d6y234gxh24ixq904xksizrjmjr5dimwhax6n")))) | |
161 | (build-system gnu-build-system) | |
162 | (synopsis | |
163 | "XZ, general-purpose data compression software, successor of LZMA") | |
164 | (description | |
165 | "XZ Utils is free general-purpose data compression software with high | |
166 | compression ratio. XZ Utils were written for POSIX-like systems, but also | |
167 | work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils. | |
168 | ||
169 | The core of the XZ Utils compression code is based on LZMA SDK, but it has | |
170 | been modified quite a lot to be suitable for XZ Utils. The primary | |
171 | compression algorithm is currently LZMA2, which is used inside the .xz | |
172 | container format. With typical files, XZ Utils create 30 % smaller output | |
173 | than gzip and 15 % smaller output than bzip2.") | |
4a44e743 | 174 | (license '(license:gpl2+ license:lgpl2.1+)) ; bits of both |
a268f085 | 175 | (home-page "http://tukaani.org/xz/"))) |
c6eac761 LC |
176 | |
177 | (define-public lzo | |
178 | (package | |
179 | (name "lzo") | |
180 | (version "2.06") | |
181 | (source | |
182 | (origin | |
183 | (method url-fetch) | |
184 | (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-" | |
185 | version ".tar.gz")) | |
186 | (sha256 | |
187 | (base32 | |
188 | "0wryshs446s7cclrbjykyj766znhcpnr7s3cxy33ybfn6vwfcygz")))) | |
189 | (build-system gnu-build-system) | |
190 | (home-page "http://www.oberhumer.com/opensource/lzo") | |
191 | (synopsis | |
192 | "A data compresion library suitable for real-time data de-/compression") | |
193 | (description | |
194 | "LZO is a data compression library which is suitable for data | |
195 | de-/compression in real-time. This means it favours speed over | |
196 | compression ratio. | |
197 | ||
198 | LZO is written in ANSI C. Both the source code and the compressed data | |
199 | format are designed to be portable across platforms.") | |
4a44e743 | 200 | (license license:gpl2+))) |