tests: Make sure to use the bootstrap Guile.
[jackhill/guix/guix.git] / distro / packages / compression.scm
CommitLineData
a268f085
LC
1;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
2;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of Guix.
5;;;
6;;; Guix is free software; you can redistribute it and/or modify it
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;;;
11;;; Guix is distributed in the hope that it will be useful, but
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
17;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (distro packages compression)
20 #:use-module (guix packages)
87f5d366 21 #:use-module (guix download)
a268f085
LC
22 #:use-module (guix build-system gnu))
23
6a92093d
LC
24(define-public zlib
25 (package
26 (name "zlib")
27 (version "1.2.7")
28 (source
29 (origin
87f5d366 30 (method url-fetch)
6a92093d
LC
31 (uri (string-append "http://zlib.net/zlib-"
32 version ".tar.gz"))
33 (sha256
34 (base32
35 "1i96gsdvxqb6skp9a58bacf1wxamwi9m9pg4yn7cpf7g7239r77s"))))
36 (build-system gnu-build-system)
37 (arguments
38 `(#:phases (alist-replace
39 'configure
40 (lambda* (#:key outputs #:allow-other-keys)
41 ;; Zlib's home-made `configure' doesn't fails when passed
42 ;; extra flags like `--enable-fast-install', so we need to
43 ;; invoke it with just what it understand.
44 (let ((out (assoc-ref outputs "out")))
45 (zero? (system* "./configure"
46 (string-append "--prefix=" out)))))
47 %standard-phases)))
48 (home-page "http://zlib.net/")
49 (synopsis "The zlib compression library")
50 (description
51 "zlib is designed to be a free, general-purpose, legally unencumbered --
52that is, not covered by any patents -- lossless data-compression library for
53use on virtually any computer hardware and operating system. The zlib data
54format is itself portable across platforms. Unlike the LZW compression method
55used in Unix compress(1) and in the GIF image format, the compression method
56currently used in zlib essentially never expands the data. (LZW can double or
57triple the file size in extreme cases.) zlib's memory footprint is also
58independent of the input data and can be reduced, if necessary, at some cost
59in compression.")
60
61 ;; See <http://zlib.net/zlib_license.html>.
62 (license "permissive")))
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
82Gailly for the GNU project. Mark Adler wrote the decompression part.
83
84We developed this program as a replacement for compress because of the Unisys
85and IBM patents covering the LZW algorithm used by compress. These patents
86made it impossible for us to use compress, and we needed a replacement. The
87superior compression ratio of gzip is just a bonus.")
88 (license "GPLv3+")
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)
101 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
102 (install-shared-lib
103 '(lambda* (#:key outputs #:allow-other-keys)
104 (let* ((out (assoc-ref outputs "out"))
105 (libdir (string-append out "/lib")))
106 (for-each (lambda (file)
107 (let ((base (basename file)))
108 (format #t "installing `~a' to `~a'~%"
109 base libdir)
110 (copy-file file
111 (string-append libdir "/" base))))
112 (find-files "." "^libbz2\\.so"))))))
113 (package
114 (name "bzip2")
115 (version "1.0.6")
116 (source (origin
87f5d366 117 (method url-fetch)
a268f085
LC
118 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
119 version ".tar.gz"))
120 (sha256
121 (base32
122 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
123 (build-system gnu-build-system)
124 (arguments
125 `(#:modules ((guix build gnu-build-system)
126 (guix build utils)
127 (srfi srfi-1))
128 #:phases
129 (alist-cons-before
130 'build 'build-shared-lib ,build-shared-lib
131 (alist-cons-after
132 'install 'fix-man-dir ,fix-man-dir
133 (alist-cons-after
134 'install 'install-shared-lib ,install-shared-lib
135 (alist-delete 'configure %standard-phases))))
136 #:make-flags (list (string-append "PREFIX="
137 (assoc-ref %outputs "out")))))
138 (synopsis "high-quality data compression program")
139 (description
140 "bzip2 is a freely available, patent free (see below), high-quality data
141compressor. It typically compresses files to within 10% to 15% of the best
142available techniques (the PPM family of statistical compressors), whilst
143being around twice as fast at compression and six times faster at
144decompression.")
145 (license "BSD-style")
146 (home-page "http://www.bzip.org/"))))
147
148(define-public xz
149 (package
150 (name "xz")
151 (version "5.0.4")
152 (source (origin
87f5d366 153 (method url-fetch)
a268f085
LC
154 (uri (string-append "http://tukaani.org/xz/xz-" version
155 ".tar.gz"))
156 (sha256
157 (base32
158 "1dl35ca8fdss9z2d6y234gxh24ixq904xksizrjmjr5dimwhax6n"))))
159 (build-system gnu-build-system)
160 (synopsis
161 "XZ, general-purpose data compression software, successor of LZMA")
162 (description
163 "XZ Utils is free general-purpose data compression software with high
164compression ratio. XZ Utils were written for POSIX-like systems, but also
165work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
166
167The core of the XZ Utils compression code is based on LZMA SDK, but it has
168been modified quite a lot to be suitable for XZ Utils. The primary
169compression algorithm is currently LZMA2, which is used inside the .xz
170container format. With typical files, XZ Utils create 30 % smaller output
171than gzip and 15 % smaller output than bzip2.")
172 (license '("GPLv2+" "LGPLv2.1+")) ; bits of both
173 (home-page "http://tukaani.org/xz/")))