You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

287 lines
12 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; 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)
  25. #:use-module (gnu packages which))
  26. (define-public zlib
  27. (package
  28. (name "zlib")
  29. (version "1.2.7")
  30. (source
  31. (origin
  32. (method url-fetch)
  33. (uri (list (string-append "http://zlib.net/zlib-"
  34. version ".tar.gz")
  35. (string-append "mirror://sourceforge/libpng/zlib-"
  36. version ".tar.gz")))
  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 --
  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
  63. in compression.")
  64. (license license:zlib)))
  65. (define-public gzip
  66. (package
  67. (name "gzip")
  68. (version "1.6")
  69. (source (origin
  70. (method url-fetch)
  71. (uri (string-append "mirror://gnu/gzip/gzip-"
  72. version ".tar.gz"))
  73. (sha256
  74. (base32
  75. "0zlgdm4v3dndrbiz7b67mbbj25dpwqbmbzjiycssvrfrcfvq7swp"))))
  76. (build-system gnu-build-system)
  77. (synopsis "General file (de)compression (using lzw)")
  78. (arguments
  79. ;; FIXME: The test suite wants `less', and optionally Perl.
  80. '(#:tests? #f))
  81. (description
  82. "GNU Gzip is a data compression and decompression program.")
  83. (license license:gpl3+)
  84. (home-page "http://www.gnu.org/software/gzip/")))
  85. (define-public bzip2
  86. (let ((fix-man-dir
  87. ;; Move man pages to $out/share/.
  88. '(lambda* (#:key outputs #:allow-other-keys)
  89. (with-directory-excursion (assoc-ref outputs "out")
  90. (mkdir "share")
  91. (rename-file "man" "share"))))
  92. (build-shared-lib
  93. ;; Build a shared library.
  94. '(lambda* (#:key inputs #:allow-other-keys)
  95. (patch-makefile-SHELL "Makefile-libbz2_so")
  96. (zero? (system* "make" "-f" "Makefile-libbz2_so"))))
  97. (install-shared-lib
  98. '(lambda* (#:key outputs #:allow-other-keys)
  99. (let* ((out (assoc-ref outputs "out"))
  100. (libdir (string-append out "/lib")))
  101. (for-each (lambda (file)
  102. (let ((base (basename file)))
  103. (format #t "installing `~a' to `~a'~%"
  104. base libdir)
  105. (copy-file file
  106. (string-append libdir "/" base))))
  107. (find-files "." "^libbz2\\.so")))))
  108. (set-cross-environment
  109. '(lambda* (#:key target #:allow-other-keys)
  110. (substitute* (find-files "." "Makefile")
  111. (("CC=.*$")
  112. (string-append "CC = " target "-gcc\n"))
  113. (("AR=.*$")
  114. (string-append "AR = " target "-ar\n"))
  115. (("RANLIB=.*$")
  116. (string-append "RANLIB = " target "-ranlib\n"))
  117. (("^all:(.*)test" _ prerequisites)
  118. ;; Remove 'all' -> 'test' dependency.
  119. (string-append "all:" prerequisites "\n"))))))
  120. (package
  121. (name "bzip2")
  122. (version "1.0.6")
  123. (source (origin
  124. (method url-fetch)
  125. (uri (string-append "http://www.bzip.org/" version "/bzip2-"
  126. version ".tar.gz"))
  127. (sha256
  128. (base32
  129. "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152"))))
  130. (build-system gnu-build-system)
  131. (arguments
  132. `(#:modules ((guix build gnu-build-system)
  133. (guix build utils)
  134. (srfi srfi-1))
  135. #:phases
  136. ,(if (%current-target-system)
  137. ;; Cross-compilation: use the cross tools.
  138. `(alist-cons-before
  139. 'build 'build-shared-lib ,build-shared-lib
  140. (alist-cons-after
  141. 'install 'fix-man-dir ,fix-man-dir
  142. (alist-cons-after
  143. 'install 'install-shared-lib ,install-shared-lib
  144. (alist-replace 'configure ,set-cross-environment
  145. %standard-phases))))
  146. ;; Native compilation: build the shared library.
  147. `(alist-cons-before
  148. 'build 'build-shared-lib ,build-shared-lib
  149. (alist-cons-after
  150. 'install 'fix-man-dir ,fix-man-dir
  151. (alist-cons-after
  152. 'install 'install-shared-lib ,install-shared-lib
  153. (alist-delete 'configure %standard-phases)))))
  154. #:make-flags (list (string-append "PREFIX="
  155. (assoc-ref %outputs "out")))
  156. ;; Don't attempt to run the tests when cross-compiling.
  157. ,@(if (%current-target-system)
  158. '(#:tests? #f)
  159. '())))
  160. (synopsis "high-quality data compression program")
  161. (description
  162. "bzip2 is a freely available, patent free (see below), high-quality data
  163. compressor. It typically compresses files to within 10% to 15% of the best
  164. available techniques (the PPM family of statistical compressors), whilst
  165. being around twice as fast at compression and six times faster at
  166. decompression.")
  167. (license (license:bsd-style "file://LICENSE"
  168. "See LICENSE in the distribution."))
  169. (home-page "http://www.bzip.org/"))))
  170. (define-public xz
  171. (package
  172. (name "xz")
  173. (version "5.0.4")
  174. (source (origin
  175. (method url-fetch)
  176. (uri (string-append "http://tukaani.org/xz/xz-" version
  177. ".tar.gz"))
  178. (sha256
  179. (base32
  180. "1dl35ca8fdss9z2d6y234gxh24ixq904xksizrjmjr5dimwhax6n"))))
  181. (build-system gnu-build-system)
  182. (synopsis
  183. "XZ, general-purpose data compression software, successor of LZMA")
  184. (description
  185. "XZ Utils is free general-purpose data compression software with high
  186. compression ratio. XZ Utils were written for POSIX-like systems, but also
  187. work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
  188. The core of the XZ Utils compression code is based on LZMA SDK, but it has
  189. been modified quite a lot to be suitable for XZ Utils. The primary
  190. compression algorithm is currently LZMA2, which is used inside the .xz
  191. container format. With typical files, XZ Utils create 30 % smaller output
  192. than gzip and 15 % smaller output than bzip2.")
  193. (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both
  194. (home-page "http://tukaani.org/xz/")))
  195. (define-public lzo
  196. (package
  197. (name "lzo")
  198. (version "2.06")
  199. (source
  200. (origin
  201. (method url-fetch)
  202. (uri (string-append "http://www.oberhumer.com/opensource/lzo/download/lzo-"
  203. version ".tar.gz"))
  204. (sha256
  205. (base32
  206. "0wryshs446s7cclrbjykyj766znhcpnr7s3cxy33ybfn6vwfcygz"))))
  207. (build-system gnu-build-system)
  208. (arguments '(#:configure-flags '("--enable-shared")))
  209. (home-page "http://www.oberhumer.com/opensource/lzo")
  210. (synopsis
  211. "A data compresion library suitable for real-time data de-/compression")
  212. (description
  213. "LZO is a data compression library which is suitable for data
  214. de-/compression in real-time. This means it favours speed over
  215. compression ratio.
  216. LZO is written in ANSI C. Both the source code and the compressed data
  217. format are designed to be portable across platforms.")
  218. (license license:gpl2+)))
  219. (define-public lzip
  220. (package
  221. (name "lzip")
  222. (version "1.15")
  223. (source (origin
  224. (method url-fetch)
  225. (uri (string-append "mirror://savannah/lzip/lzip-"
  226. version ".tar.gz"))
  227. (sha256
  228. (base32
  229. "1dh5vmj5apizfawnsm50y7z064yx7cz3313przph16gwd3dgrlvw"))))
  230. (build-system gnu-build-system)
  231. (home-page "http://www.nongnu.org/lzip/lzip.html")
  232. (synopsis "Lossless data compressor based on the LZMA algorithm")
  233. (description
  234. "Lzip is a lossless data compressor with a user interface similar to the
  235. one of gzip or bzip2. Lzip decompresses almost as fast as gzip and compresses
  236. more than bzip2, which makes it well suited for software distribution and data
  237. archiving. Lzip is a clean implementation of the LZMA algorithm.")
  238. (license license:gpl3+)))
  239. (define-public sharutils
  240. (package
  241. (name "sharutils")
  242. (version "4.14")
  243. (source
  244. (origin
  245. (method url-fetch)
  246. (uri (string-append "mirror://gnu/sharutils/sharutils-"
  247. version ".tar.xz"))
  248. (sha256
  249. (base32
  250. "033sq1v0cp0bi1mp320xaqwd4fhakqc5747hh6qa1asjrzpqiqza"))))
  251. (build-system gnu-build-system)
  252. (inputs
  253. `(("which" ,which)))
  254. (arguments
  255. `(#:phases
  256. (alist-cons-after
  257. 'patch-source-shebangs 'unpatch-source-shebang
  258. ;; revert the patch-shebang phase on a script which is
  259. ;; in fact test data
  260. (lambda* (#:key #:allow-other-keys)
  261. (substitute* "tests/shar-1.ok"
  262. (((which "sh")) "/bin/sh")))
  263. %standard-phases)))
  264. (home-page "http://www.gnu.org/software/sharutils/")
  265. (synopsis "Archives in shell scripts, uuencode/uudecode")
  266. (description
  267. "GNU sharutils is a package for manipulating shell archives. Shell
  268. archives are collections of files that can be unpacked using only the shell;
  269. an archive is a self-extracting shell script. The tools in the Sharutils
  270. package make working with shell archives more robust, offering compression,
  271. file-splitting and simple checksums.")
  272. (license license:gpl3+)))