1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU 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.
11 ;;; GNU 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.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages compression)
20 #:use-module ((guix licenses)
21 #:renamer (symbol-prefix-proc 'license:))
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu))
33 (uri (list (string-append "http://zlib.net/zlib-"
35 (string-append "mirror://sourceforge/libpng/zlib-"
39 "1i96gsdvxqb6skp9a58bacf1wxamwi9m9pg4yn7cpf7g7239r77s"))))
40 (build-system gnu-build-system)
42 `(#:phases (alist-replace
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)))))
52 (home-page "http://zlib.net/")
53 (synopsis "The zlib compression library")
55 "zlib is designed to be a free, general-purpose, legally unencumbered --
56 that is, not covered by any patents -- lossless data-compression library for
57 use on virtually any computer hardware and operating system. The zlib data
58 format is itself portable across platforms. Unlike the LZW compression method
59 used in Unix compress(1) and in the GIF image format, the compression method
60 currently used in zlib essentially never expands the data. (LZW can double or
61 triple the file size in extreme cases.) zlib's memory footprint is also
62 independent of the input data and can be reduced, if necessary, at some cost
64 (license license:zlib)))
72 (uri (string-append "mirror://gnu/gzip/gzip-"
76 "0zlgdm4v3dndrbiz7b67mbbj25dpwqbmbzjiycssvrfrcfvq7swp"))))
77 (build-system gnu-build-system)
78 (synopsis "General file (de)compression (using lzw)")
80 ;; FIXME: The test suite wants `less', and optionally Perl.
83 "gzip (GNU zip) is a popular data compression program written by Jean-loup
84 Gailly for the GNU project. Mark Adler wrote the decompression part.
86 We developed this program as a replacement for compress because of the Unisys
87 and IBM patents covering the LZW algorithm used by compress. These patents
88 made it impossible for us to use compress, and we needed a replacement. The
89 superior compression ratio of gzip is just a bonus.")
90 (license license:gpl3+)
91 (home-page "http://www.gnu.org/software/gzip/")))
95 ;; Move man pages to $out/share/.
96 '(lambda* (#:key outputs #:allow-other-keys)
97 (with-directory-excursion (assoc-ref outputs "out")
99 (rename-file "man" "share"))))
101 ;; Build a shared library.
102 '(lambda* (#:key inputs #:allow-other-keys)
103 (patch-makefile-SHELL "Makefile-libbz2_so")
104 (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
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'~%"
114 (string-append libdir "/" base))))
115 (find-files "." "^libbz2\\.so"))))))
121 (uri (string-append "http://www.bzip.org/" version "/bzip2-"
125 "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
126 (build-system gnu-build-system)
128 `(#:modules ((guix build gnu-build-system)
133 'build 'build-shared-lib ,build-shared-lib
135 'install 'fix-man-dir ,fix-man-dir
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")
143 "bzip2 is a freely available, patent free (see below), high-quality data
144 compressor. It typically compresses files to within 10% to 15% of the best
145 available techniques (the PPM family of statistical compressors), whilst
146 being around twice as fast at compression and six times faster at
148 (license (license:bsd-style "file://LICENSE"
149 "See LICENSE in the distribution."))
150 (home-page "http://www.bzip.org/"))))
158 (uri (string-append "http://tukaani.org/xz/xz-" version
162 "1dl35ca8fdss9z2d6y234gxh24ixq904xksizrjmjr5dimwhax6n"))))
163 (build-system gnu-build-system)
165 "XZ, general-purpose data compression software, successor of LZMA")
167 "XZ Utils is free general-purpose data compression software with high
168 compression ratio. XZ Utils were written for POSIX-like systems, but also
169 work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
171 The core of the XZ Utils compression code is based on LZMA SDK, but it has
172 been modified quite a lot to be suitable for XZ Utils. The primary
173 compression algorithm is currently LZMA2, which is used inside the .xz
174 container format. With typical files, XZ Utils create 30 % smaller output
175 than gzip and 15 % smaller output than bzip2.")
176 (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
177 (home-page "http://tukaani.org/xz/")))
186 (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
190 "0wryshs446s7cclrbjykyj766znhcpnr7s3cxy33ybfn6vwfcygz"))))
191 (build-system gnu-build-system)
192 (home-page "http://www.oberhumer.com/opensource/lzo")
194 "A data compresion library suitable for real-time data de-/compression")
196 "LZO is a data compression library which is suitable for data
197 de-/compression in real-time. This means it favours speed over
200 LZO is written in ANSI C. Both the source code and the compressed data
201 format are designed to be portable across platforms.")
202 (license license:gpl2+)))