licenses: Add 'imlib2'.
[jackhill/guix/guix.git] / gnu / packages / image.scm
CommitLineData
e55354b8
DT
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
e596ab0f
AK
3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
e55354b8
DT
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages image)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages compression)
efa77baf
MB
24 #:use-module (gnu packages fontutils)
25 #:use-module (gnu packages pkg-config)
26 #:use-module (gnu packages xml)
38c55e5c 27 #:use-module (gnu packages ghostscript) ;lcms
76d88cfa 28 #:use-module (gnu packages xorg)
e596ab0f 29 #:use-module (gnu packages perl)
b5b73a82 30 #:use-module ((guix licenses) #:prefix license:)
e55354b8
DT
31 #:use-module (guix packages)
32 #:use-module (guix download)
38c55e5c 33 #:use-module (guix build-system gnu)
e596ab0f
AK
34 #:use-module (guix build-system cmake)
35 #:use-module (srfi srfi-1))
e55354b8
DT
36
37(define-public libpng
38 (package
39 (name "libpng")
40 (version "1.5.17")
41 (source (origin
42 (method url-fetch)
43
44 ;; Note: upstream removes older tarballs.
45 (uri (list (string-append "mirror://sourceforge/libpng/libpng15/"
46 version "/libpng-" version ".tar.xz")
47 (string-append
48 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
49 "/libpng15/libpng-" version ".tar.xz")))
50 (sha256
51 (base32 "19wj293r4plbfgb43yhrc2qx8bsch9gbazazfqrj9haa7lsk29jp"))))
52 (build-system gnu-build-system)
53
54 ;; libpng.la says "-lz", so propagate it.
55 (propagated-inputs `(("zlib" ,zlib)))
56
57 (synopsis "Library for handling PNG files")
58 (description
59 "Libpng is the official PNG (Portable Network Graphics) reference
35b9e423 60library. It supports almost all PNG features and is extensible.")
e55354b8
DT
61 (license license:zlib)
62 (home-page "http://www.libpng.org/pub/png/libpng.html")))
63
64(define-public libjpeg
65 (package
66 (name "libjpeg")
a0e9b72e 67 (version "9a")
e55354b8
DT
68 (source (origin
69 (method url-fetch)
70 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
71 version ".tar.gz"))
72 (sha256 (base32
a0e9b72e 73 "19q5zr4n60sjcvfbyv06n4pcl1mai3ipvnd2akflayciinj3wx9s"))))
e55354b8 74 (build-system gnu-build-system)
35b9e423 75 (synopsis "Library for handling JPEG files")
e55354b8
DT
76 (description
77 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
78JPEG is a standardized compression method for full-color and gray-scale
79images.
80The included programs provide conversion between the JPEG format and
81image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
82 (license license:ijg)
83 (home-page "http://www.ijg.org/")))
84
85(define-public libjpeg-8
86 (package (inherit libjpeg)
87 (version "8d")
88 (source (origin
89 (method url-fetch)
90 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
91 version ".tar.gz"))
92 (sha256 (base32
93 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
94
95(define-public libtiff
96 (package
97 (name "libtiff")
98 (version "4.0.3")
99 (source (origin
100 (method url-fetch)
101 (uri (string-append "ftp://ftp.remotesensing.org/pub/libtiff/tiff-"
102 version ".tar.gz"))
103 (sha256 (base32
104 "0wj8d1iwk9vnpax2h29xqc2hwknxg3s0ay2d5pxkg59ihbifn6pa"))))
105 (build-system gnu-build-system)
106 (inputs `(("zlib" ,zlib)
107 ("libjpeg-8" ,libjpeg-8)))
108 ;; currently does not compile with libjpeg version 9
e55354b8
DT
109 (arguments
110 `(#:configure-flags
111 (list (string-append "--with-jpeg-include-dir="
112 (assoc-ref %build-inputs "libjpeg-8")
c198872b 113 "/include"))))
35b9e423 114 (synopsis "Library for handling TIFF files")
e55354b8
DT
115 (description
116 "Libtiff provides support for the Tag Image File Format (TIFF), a format
117used for storing image data.
118Included are a library, libtiff, for reading and writing TIFF and a small
119collection 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/")))
efa77baf
MB
123
124(define-public libwmf
125 (package
126 (name "libwmf")
127 (version "0.2.8.4")
128 (source
129 (origin
130 (method url-fetch)
757d5ff3
LC
131 (uri (string-append "mirror://sourceforge/wvware/"
132 name "/" version
133 "/" name "-" version ".tar.gz"))
efa77baf
MB
134 (sha256
135 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v"))))
136
137 (build-system gnu-build-system)
138 (inputs
139 `(("freetype" ,freetype)
140 ("libjpeg" ,libjpeg)
141 ("libpng",libpng)
142 ("libxml2" ,libxml2)
143 ("zlib" ,zlib)))
144 (native-inputs
145 `(("pkg-config" ,pkg-config)))
146 (synopsis "Library for reading images in the Microsoft WMF format")
147 (description
148 "libwmf is a library for reading vector images in Microsoft's native
149Windows Metafile Format (WMF) and for either (a) displaying them in, e.g., an X
150window; or (b) converting them to more standard/free file formats such as, e.g.,
151the W3C's XML-based Scaleable Vector Graphic (SVG) format.")
152 (home-page "http://wvware.sourceforge.net/libwmf.html")
153
154 ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+.
155 (license license:lgpl2.0+)))
8d9872b5
MB
156
157(define-public jbig2dec
158 (package
159 (name "jbig2dec")
160 (version "0.11")
161 (source
162 (origin
163 (method url-fetch)
164 (uri ;; The link on the homepage is dead.
165 (string-append "http://distfiles.gentoo.org/distfiles/" name "-"
166 version ".tar.gz"))
167 (sha256
168 (base32 "1ffhgmf2fqzk0h4k736pp06z7q5y4x41fg844bd6a9vgncq86bby"))
169 (patches (list (search-patch "jbig2dec-ignore-testtest.patch")))))
170
171 (build-system gnu-build-system)
172 (synopsis "Decoder of the JBIG2 image compression format")
173 (description
174 "JBIG2 is designed for lossy or lossless encoding of 'bilevel'
175(1-bit monochrome) images at moderately high resolution, and in
176particular scanned paper documents. In this domain it is very
177efficient, offering compression ratios on the order of 100:1.
178
179This is a decoder only implementation, and currently is in the alpha
180stage, meaning it doesn't completely work yet. However, it is
181maintaining parity with available encoders, so it is useful for real
182work.")
183 (home-page "http://jbig2dec.sourceforge.net/")
184 (license license:gpl2+)))
38c55e5c
MB
185
186(define-public openjpeg
187 (package
188 (name "openjpeg")
189 (version "2.0.0")
190 (source
191 (origin
192 (method url-fetch)
193 (uri
194 (string-append "http://openjpeg.googlecode.com/files/" name "-"
195 version ".tar.gz"))
196 (sha256
197 (base32 "1n05yrmscpgksrh2kfh12h18l0lw9j03mgmvwcg3hm8m0lwgak9k"))))
198
199 (build-system cmake-build-system)
200 (arguments
201 ;; Trying to run `$ make check' results in a no rule fault.
202 '(#:tests? #f))
203 (inputs
204 `(("lcms" ,lcms)
205 ("libpng" ,libpng)
206 ("libtiff" ,libtiff)
207 ("zlib" ,zlib)))
208 (synopsis "JPEG 2000 codec")
209 (description
210 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
211been developed in order to promote the use of JPEG 2000, the new
212still-image compression standard from the Joint Photographic Experts
213Group (JPEG).
214
215In addition to the basic codec, various other features are under
216development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
217an indexing tool useful for the JPIP protocol, JPWL-tools for
218error-resilience, a Java-viewer for j2k-images, ...")
219 (home-page "http://jbig2dec.sourceforge.net/")
220 (license license:bsd-2)))
76d88cfa 221
e596ab0f
AK
222(define-public giflib
223 (package
224 (name "giflib")
225 (version "4.2.3")
226 (source (origin
227 (method url-fetch)
228 (uri (string-append "mirror://sourceforge/giflib/giflib-"
229 (first (string-split version #\.))
230 ".x/giflib-" version ".tar.bz2"))
231 (sha256
232 (base32 "0rmp7ipzk42r841bggd7bfqk4p8qsssbp4wcck4qnz7p4rkxbj0a"))))
233 (build-system gnu-build-system)
234 (outputs '("bin" ; utility programs
235 "out")) ; library
236 (inputs `(("libx11" ,libx11)
237 ("libice" ,libice)
238 ("libsm" ,libsm)
239 ("perl" ,perl)))
240 (arguments
241 `(#:phases (alist-cons-after
242 'unpack 'disable-html-doc-gen
243 (lambda _
244 (substitute* "doc/Makefile.in"
245 (("^all: allhtml manpages") "")))
246 (alist-cons-after
247 'install 'install-manpages
248 (lambda* (#:key outputs #:allow-other-keys)
249 (let* ((bin (assoc-ref outputs "bin"))
250 (man1dir (string-append bin "/share/man/man1")))
251 (mkdir-p man1dir)
252 (for-each (lambda (file)
253 (let ((base (basename file)))
254 (format #t "installing `~a' to `~a'~%"
255 base man1dir)
256 (copy-file file
257 (string-append
258 man1dir "/" base))))
259 (find-files "doc" "\\.1"))))
260 %standard-phases))))
261 (synopsis "Tools and library for working with GIF images")
262 (description
35b9e423 263 "GIFLIB is a library for reading and writing GIF images. It is API and
e596ab0f
AK
264ABI compatible with libungif which was in wide use while the LZW compression
265algorithm was patented. Tools are also included to convert, manipulate,
266compose, and analyze GIF images.")
267 (home-page "http://giflib.sourceforge.net/")
268 (license license:x11)))
269
76d88cfa
AK
270(define-public imlib2
271 (package
272 (name "imlib2")
273 (version "1.4.6")
274 (source (origin
275 (method url-fetch)
276 (uri (string-append
277 "mirror://sourceforge/enlightenment/imlib2-"
278 version ".tar.gz"))
279 (sha256
280 (base32
281 "0kjggg4gfn6chi8v1xddd5qwk1fbnl7rvd93qiclv5v11s615k0p"))))
282 (build-system gnu-build-system)
283 (arguments
284 '(;; Will be fixed in the next release:
285 ;; <http://git.enlightenment.org/legacy/imlib2.git/commit/?id=5dde234b2d3caf067ea827858c53adc5d4c56c13>.
286 #:phases (alist-cons-before
287 'configure 'patch-config
288 (lambda _
289 (substitute* "imlib2-config.in"
290 (("@my_libs@") "")))
291 %standard-phases)))
292 (native-inputs
293 `(("pkgconfig" ,pkg-config)))
294 (inputs
295 `(("libx11" ,libx11)
296 ("libxext" ,libxext)
297 ("freetype" ,freetype)
298 ("libjpeg" ,libjpeg)
299 ("libpng" ,libpng)
300 ("libtiff" ,libtiff)
301 ("giflib" ,giflib)
302 ("bzip2" ,bzip2)))
303 (home-page "http://sourceforge.net/projects/enlightenment/")
304 (synopsis
305 "Loading, saving, rendering and manipulating image files")
306 (description
307 "Imlib2 is a library that does image file loading and saving as well as
308rendering, manipulation, arbitrary polygon support, etc.
309
310It does ALL of these operations FAST. Imlib2 also tries to be highly
311intelligent about doing them, so writing naive programs can be done easily,
312without sacrificing speed.
313
314This is a complete rewrite over the Imlib 1.x series. The architecture is
315more modular, simple, and flexible.")
8835aed4 316 (license license:imlib2)))
f7d28082
AK
317
318(define-public giblib
319 (package
320 (name "giblib")
321 (version "1.2.4")
322 (source (origin
323 (method url-fetch)
324 (uri (string-append
325 "http://linuxbrit.co.uk/downloads/giblib-"
326 version ".tar.gz"))
327 (sha256
328 (base32
329 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
330 (build-system gnu-build-system)
331 (inputs
332 `(("libx11" ,libx11)
333 ("imlib2" ,imlib2)))
334 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
335 (synopsis "Wrapper library for imlib2")
336 (description
35b9e423 337 "Giblib is a simple library which wraps imlib2's context API, avoiding
f7d28082
AK
338all the context_get/set calls, adds fontstyles to the truetype renderer and
339supplies a generic doubly-linked list and some string functions.")
340 ;; This license removes a clause about X Consortium from the original
341 ;; X11 license.
342 (license (license:x11-style "file://COPYING"
343 "See 'COPYING' in the distribution."))))