gnu: glib: Upgrade to 2.40.0.
[jackhill/guix/guix.git] / gnu / packages / image.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
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.
10 ;;;
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.
15 ;;;
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/>.
18
19 (define-module (gnu packages image)
20 #:use-module (gnu packages)
21 #:use-module (gnu packages compression)
22 #:use-module (gnu packages file)
23 #:use-module ((guix licenses) #:renamer (symbol-prefix-proc 'license:))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu))
27
28 (define-public libpng
29 (package
30 (name "libpng")
31 (version "1.5.17")
32 (source (origin
33 (method url-fetch)
34
35 ;; Note: upstream removes older tarballs.
36 (uri (list (string-append "mirror://sourceforge/libpng/libpng15/"
37 version "/libpng-" version ".tar.xz")
38 (string-append
39 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
40 "/libpng15/libpng-" version ".tar.xz")))
41 (sha256
42 (base32 "19wj293r4plbfgb43yhrc2qx8bsch9gbazazfqrj9haa7lsk29jp"))))
43 (build-system gnu-build-system)
44
45 ;; libpng.la says "-lz", so propagate it.
46 (propagated-inputs `(("zlib" ,zlib)))
47
48 (synopsis "Library for handling PNG files")
49 (description
50 "Libpng is the official PNG (Portable Network Graphics) reference
51 library. It supports almost all PNG features and is extensible.")
52 (license license:zlib)
53 (home-page "http://www.libpng.org/pub/png/libpng.html")))
54
55 (define-public libjpeg
56 (package
57 (name "libjpeg")
58 (version "9")
59 (source (origin
60 (method url-fetch)
61 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
62 version ".tar.gz"))
63 (sha256 (base32
64 "0dg5wxcx3cw0hal9gvivj97vid9z0s5sb1yvg55hpxmafn9rxqn4"))))
65 (build-system gnu-build-system)
66 (synopsis "Libjpeg, a library for handling JPEG files")
67 (description
68 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
69 JPEG is a standardized compression method for full-color and gray-scale
70 images.
71 The included programs provide conversion between the JPEG format and
72 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
73 (license license:ijg)
74 (home-page "http://www.ijg.org/")))
75
76 (define-public libjpeg-8
77 (package (inherit libjpeg)
78 (version "8d")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
82 version ".tar.gz"))
83 (sha256 (base32
84 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
85
86 (define-public libtiff
87 (package
88 (name "libtiff")
89 (version "4.0.3")
90 (source (origin
91 (method url-fetch)
92 (uri (string-append "ftp://ftp.remotesensing.org/pub/libtiff/tiff-"
93 version ".tar.gz"))
94 (sha256 (base32
95 "0wj8d1iwk9vnpax2h29xqc2hwknxg3s0ay2d5pxkg59ihbifn6pa"))))
96 (build-system gnu-build-system)
97 (inputs `(("zlib" ,zlib)
98 ("libjpeg-8" ,libjpeg-8)))
99 ;; currently does not compile with libjpeg version 9
100 (native-inputs `(("file" ,file)))
101 (arguments
102 `(#:configure-flags
103 (list (string-append "--with-jpeg-include-dir="
104 (assoc-ref %build-inputs "libjpeg-8")
105 "/include"))
106 #:phases
107 (alist-cons-before
108 'configure 'patch-configure
109 (lambda _
110 (substitute* "configure"
111 (("`/usr/bin/file")
112 (string-append "`" (which "file")))))
113 %standard-phases)))
114 (synopsis "Libtiff, a library for handling TIFF files")
115 (description
116 "Libtiff provides support for the Tag Image File Format (TIFF), a format
117 used for storing image data.
118 Included are a library, libtiff, for reading and writing TIFF and a small
119 collection of tools for doing simple manipulations of TIFF images.")
120 (license (license:bsd-style "file://COPYRIGHT"
121 "See COPYRIGHT in the distribution."))
122 (home-page "http://www.libtiff.org/")))