gnu: Update module imports for asciidoc and doxygen.
[jackhill/guix/guix.git] / gnu / packages / image.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
5 ;;; Copyright © 2014, 2016 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
7 ;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
8 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
9 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
10 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages image)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages algebra)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages boost)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages documentation)
34 #:use-module (gnu packages fontutils)
35 #:use-module (gnu packages ghostscript)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages graphics)
38 #:use-module (gnu packages maths)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages xml)
43 #:use-module (gnu packages xorg)
44 #:use-module (gnu packages zip)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix build-system gnu)
49 #:use-module (guix build-system cmake)
50 #:use-module (srfi srfi-1))
51
52 (define-public libpng
53 (package
54 (name "libpng")
55 (version "1.5.26")
56 (source (origin
57 (method url-fetch)
58
59 ;; Note: upstream removes older tarballs.
60 (uri (list (string-append "mirror://sourceforge/libpng/libpng15/"
61 version "/libpng-" version ".tar.xz")
62 (string-append
63 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
64 "/libpng15/libpng-" version ".tar.xz")))
65 (sha256
66 (base32 "0kbissyd7d4ahwdpm968nnzl7q15p6hadg44i9x0vrkrzdgdi93v"))))
67 (build-system gnu-build-system)
68
69 ;; libpng.la says "-lz", so propagate it.
70 (propagated-inputs `(("zlib" ,zlib)))
71
72 (synopsis "Library for handling PNG files")
73 (description
74 "Libpng is the official PNG (Portable Network Graphics) reference
75 library. It supports almost all PNG features and is extensible.")
76 (license license:zlib)
77 (home-page "http://www.libpng.org/pub/png/libpng.html")))
78
79 (define-public libpng-1.2
80 (package
81 (inherit libpng)
82 (version "1.2.56")
83 (source
84 (origin
85 (method url-fetch)
86 ;; Note: upstream removes older tarballs.
87 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
88 version "/libpng-" version ".tar.xz")
89 (string-append
90 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
91 "/libpng12/libpng-" version ".tar.xz")))
92 (sha256
93 (base32 "1ghd03p353x0vi4dk83n1nlldg11w7vqdk3f99rkgfb82ic59ki4"))))))
94
95 (define-public libjpeg
96 (package
97 (name "libjpeg")
98 (version "9a")
99 (source (origin
100 (method url-fetch)
101 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
102 version ".tar.gz"))
103 (sha256 (base32
104 "19q5zr4n60sjcvfbyv06n4pcl1mai3ipvnd2akflayciinj3wx9s"))))
105 (build-system gnu-build-system)
106 (synopsis "Library for handling JPEG files")
107 (description
108 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
109 JPEG is a standardized compression method for full-color and gray-scale
110 images.
111 The included programs provide conversion between the JPEG format and
112 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
113 (license license:ijg)
114 (home-page "http://www.ijg.org/")))
115
116 (define-public libjpeg-8
117 (package (inherit libjpeg)
118 (version "8d")
119 (source (origin
120 (method url-fetch)
121 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
122 version ".tar.gz"))
123 (sha256 (base32
124 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
125
126 (define-public jpegoptim
127 (package
128 (name "jpegoptim")
129 (version "1.4.3")
130 (source (origin
131 (method url-fetch)
132 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
133 version ".tar.gz"))
134 (sha256 (base32
135 "0k53q7dc8w5ashz8v261x2b5vvz7gdvg8w962rz9gjvkjbh4lg93"))))
136 (build-system gnu-build-system)
137 (inputs `(("libjpeg" ,libjpeg)))
138 (arguments
139 ;; no tests
140 '(#:tests? #f))
141 (synopsis "Optimize JPEG images")
142 (description
143 "jpegoptim provides lossless optimization (based on optimizing
144 the Huffman tables) and \"lossy\" optimization based on setting
145 maximum quality factor.")
146 (license license:gpl2+)
147 (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim")))
148
149 (define-public libtiff
150 (package
151 (name "libtiff")
152 (version "4.0.6")
153 (source (origin
154 (method url-fetch)
155 (uri (string-append "ftp://ftp.remotesensing.org/pub/libtiff/tiff-"
156 version ".tar.gz"))
157 (sha256 (base32
158 "136nf1rj9dp5jgv1p7z4dk0xy3wki1w0vfjbk82f645m0w4samsd"))
159 (patches (search-patches
160 "libtiff-oob-accesses-in-decode.patch"
161 "libtiff-oob-write-in-nextdecode.patch"
162 "libtiff-CVE-2015-8665+CVE-2015-8683.patch"))))
163 (build-system gnu-build-system)
164 (outputs '("out"
165 "doc")) ;1.3 MiB of HTML documentation
166 (arguments
167 ;; Instead of using --docdir, this package has its own --with-docdir.
168 `(#:configure-flags (list (string-append "--with-docdir="
169 (assoc-ref %outputs "doc")
170 "/share/doc/"
171 ,name "-" ,version))))
172 (inputs `(("zlib" ,zlib)
173 ("libjpeg" ,libjpeg)))
174 (synopsis "Library for handling TIFF files")
175 (description
176 "Libtiff provides support for the Tag Image File Format (TIFF), a format
177 used for storing image data.
178 Included are a library, libtiff, for reading and writing TIFF and a small
179 collection of tools for doing simple manipulations of TIFF images.")
180 (license (license:non-copyleft "file://COPYRIGHT"
181 "See COPYRIGHT in the distribution."))
182 (home-page "http://www.remotesensing.org/libtiff/")))
183
184 (define-public libwmf
185 (package
186 (name "libwmf")
187 (version "0.2.8.4")
188 (source
189 (origin
190 (method url-fetch)
191 (uri (string-append "mirror://sourceforge/wvware/"
192 name "/" version
193 "/" name "-" version ".tar.gz"))
194 (sha256
195 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v"))
196 (patches
197 (search-patches "libwmf-CAN-2004-0941.patch"
198 "libwmf-CVE-2006-3376.patch"
199 "libwmf-CVE-2007-0455.patch"
200 "libwmf-CVE-2007-2756.patch"
201 "libwmf-CVE-2007-3472.patch"
202 "libwmf-CVE-2007-3473.patch"
203 "libwmf-CVE-2007-3477.patch"
204 "libwmf-CVE-2009-1364.patch"
205 "libwmf-CVE-2009-3546.patch"
206 "libwmf-CVE-2015-0848+CVE-2015-4588.patch"
207 "libwmf-CVE-2015-4695.patch"
208 "libwmf-CVE-2015-4696.patch"))))
209
210 (build-system gnu-build-system)
211 (inputs
212 `(("freetype" ,freetype)
213 ("libjpeg" ,libjpeg)
214 ("libpng",libpng)
215 ("libxml2" ,libxml2)
216 ("zlib" ,zlib)))
217 (native-inputs
218 `(("pkg-config" ,pkg-config)))
219 (synopsis "Library for reading images in the Microsoft WMF format")
220 (description
221 "libwmf is a library for reading vector images in Microsoft's native
222 Windows Metafile Format (WMF) and for either (a) displaying them in, e.g., an X
223 window; or (b) converting them to more standard/free file formats such as, e.g.,
224 the W3C's XML-based Scaleable Vector Graphic (SVG) format.")
225 (home-page "http://wvware.sourceforge.net/libwmf.html")
226
227 ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+.
228 (license license:lgpl2.0+)))
229
230 (define-public leptonica
231 (package
232 (name "leptonica")
233 (version "1.72")
234 (source
235 (origin
236 (method url-fetch)
237 (uri (string-append "http://www.leptonica.com/source/leptonica-"
238 version ".tar.gz"))
239 (sha256
240 (base32 "0mhzvqs0im04y1cpcc1yma70hgdac1frf33h73m9z3356bfymmbr"))
241 (modules '((guix build utils)))
242 ;; zlib and openjpg should be under Libs, not Libs.private. See:
243 ;; https://code.google.com/p/tesseract-ocr/issues/detail?id=1436
244 (snippet
245 '(substitute* "lept.pc.in"
246 (("^(Libs\\.private: .*)@ZLIB_LIBS@(.*)" all pre post)
247 (string-append pre post))
248 (("^(Libs\\.private: .*)@JPEG_LIBS@(.*)" all pre post)
249 (string-append pre post))
250 (("^Libs: .*" all)
251 (string-append all " @ZLIB_LIBS@ @JPEG_LIBS@"))))))
252 (build-system gnu-build-system)
253 (native-inputs
254 `(("gnuplot" ,gnuplot))) ;needed for test suite
255 (inputs
256 `(("giflib" ,giflib)
257 ("libjpeg" ,libjpeg)
258 ("libpng" ,libpng)
259 ("libtiff" ,libtiff)
260 ("libwebp" ,libwebp)))
261 (propagated-inputs
262 `(("openjpeg" ,openjpeg)
263 ("zlib" ,zlib)))
264 (arguments
265 '(#:parallel-tests? #f ; XXX: cause fpix1_reg to fail
266 #:phases
267 (modify-phases %standard-phases
268 ;; Prevent make from trying to regenerate config.h.in.
269 (add-after
270 'unpack 'set-config-h-in-file-time
271 (lambda _
272 (set-file-time "config/config.h.in" (stat "configure"))))
273 (add-after
274 'unpack 'patch-reg-wrapper
275 (lambda _
276 (substitute* "prog/reg_wrapper.sh"
277 ((" /bin/sh ")
278 (string-append " " (which "sh") " "))
279 (("which gnuplot") (which "gnuplot")))))
280 (add-before
281 'check 'disable-failing-tests
282 ;; XXX: 2 of 9 tests from webpio_reg fails.
283 (lambda _
284 (substitute* "prog/webpio_reg.c"
285 ((".*DoWebpTest2.* 90.*") "")
286 ((".*DoWebpTest2.* 100.*") "")))))))
287 (home-page "http://www.leptonica.com/")
288 (synopsis "Library and tools for image processing and analysis")
289 (description
290 "Leptonica is a C library and set of command-line tools for efficient
291 image processing and image analysis operations. It supports rasterop, affine
292 transformations, binary and grayscale morphology, rank order, and convolution,
293 seedfill and connected components, image transformations combining changes in
294 scale and pixel depth, and pixelwise masking, blending, enhancement, and
295 arithmetic ops.")
296 (license license:bsd-2)))
297
298 (define-public jbig2dec
299 (package
300 (name "jbig2dec")
301 (version "0.11")
302 (source
303 (origin
304 (method url-fetch)
305 (uri ;; The link on the homepage is dead.
306 (string-append "http://distfiles.gentoo.org/distfiles/" name "-"
307 version ".tar.gz"))
308 (sha256
309 (base32 "1ffhgmf2fqzk0h4k736pp06z7q5y4x41fg844bd6a9vgncq86bby"))
310 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
311
312 (build-system gnu-build-system)
313 (synopsis "Decoder of the JBIG2 image compression format")
314 (description
315 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
316 monochrome) images at moderately high resolution, and in particular scanned
317 paper documents. In this domain it is very efficient, offering compression
318 ratios on the order of 100:1.
319
320 This is a decoder only implementation, and currently is in the alpha
321 stage, meaning it doesn't completely work yet. However, it is
322 maintaining parity with available encoders, so it is useful for real
323 work.")
324 (home-page "http://jbig2dec.sourceforge.net/")
325 (license license:gpl2+)))
326
327 (define-public openjpeg
328 (package
329 (name "openjpeg")
330 (version "2.1.0")
331 (source
332 (origin
333 (method url-fetch)
334 (uri
335 (string-append "mirror://sourceforge/openjpeg.mirror/" name "-"
336 version ".tar.gz"))
337 (sha256
338 (base32 "00zzm303zvv4ijzancrsb1cqbph3pgz0nky92k9qx3fq9y0vnchj"))
339 (patches (search-patches "openjpeg-use-after-free-fix.patch"
340 "openjpeg-CVE-2015-6581.patch"))))
341 (build-system cmake-build-system)
342 (arguments
343 ;; Trying to run `$ make check' results in a no rule fault.
344 '(#:tests? #f))
345 (inputs
346 `(("lcms" ,lcms)
347 ("libpng" ,libpng)
348 ("libtiff" ,libtiff)
349 ("zlib" ,zlib)))
350 (synopsis "JPEG 2000 codec")
351 (description
352 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
353 been developed in order to promote the use of JPEG 2000, the new
354 still-image compression standard from the Joint Photographic Experts
355 Group (JPEG).
356
357 In addition to the basic codec, various other features are under
358 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
359 an indexing tool useful for the JPIP protocol, JPWL-tools for
360 error-resilience, a Java-viewer for j2k-images, ...")
361 (home-page "https://github.com/uclouvain/openjpeg")
362 (license license:bsd-2)))
363
364 (define-public openjpeg-2.0
365 (package (inherit openjpeg)
366 (name "openjpeg")
367 (version "2.0.1")
368 (source
369 (origin
370 (method url-fetch)
371 (uri
372 (string-append "mirror://sourceforge/openjpeg.mirror/" name "-"
373 version ".tar.gz"))
374 (sha256
375 (base32 "1c2xc3nl2mg511b63rk7hrckmy14681p1m44mzw3n1fyqnjm0b0z"))
376 (patches (search-patches "openjpeg-use-after-free-fix.patch"
377 "openjpeg-CVE-2015-6581.patch"))))))
378
379 (define-public openjpeg-1
380 (package (inherit openjpeg)
381 (name "openjpeg")
382 (version "1.5.2")
383 (source
384 (origin
385 (method url-fetch)
386 (uri
387 (string-append "mirror://sourceforge/openjpeg.mirror/" name "-"
388 version ".tar.gz"))
389 (sha256
390 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
391
392 (define-public giflib
393 (package
394 (name "giflib")
395 (version "5.1.1")
396 (source (origin
397 (method url-fetch)
398 (uri (string-append "mirror://sourceforge/giflib/giflib-"
399 (first (string-split version #\.))
400 ".x/giflib-" version ".tar.bz2"))
401 (sha256
402 (base32 "1z1gzq16sdya8xnl5qjc07634kkwj5m0n3bvvj4v9j11xfn1841r"))))
403 (build-system gnu-build-system)
404 (outputs '("bin" ; utility programs
405 "out")) ; library
406 (inputs `(("libx11" ,libx11)
407 ("libice" ,libice)
408 ("libsm" ,libsm)
409 ("perl" ,perl)))
410 (arguments
411 `(#:phases (alist-cons-after
412 'unpack 'disable-html-doc-gen
413 (lambda _
414 (substitute* "doc/Makefile.in"
415 (("^all: allhtml manpages") "")))
416 (alist-cons-after
417 'install 'install-manpages
418 (lambda* (#:key outputs #:allow-other-keys)
419 (let* ((bin (assoc-ref outputs "bin"))
420 (man1dir (string-append bin "/share/man/man1")))
421 (mkdir-p man1dir)
422 (for-each (lambda (file)
423 (let ((base (basename file)))
424 (format #t "installing `~a' to `~a'~%"
425 base man1dir)
426 (copy-file file
427 (string-append
428 man1dir "/" base))))
429 (find-files "doc" "\\.1"))))
430 %standard-phases))))
431 (synopsis "Tools and library for working with GIF images")
432 (description
433 "GIFLIB is a library for reading and writing GIF images. It is API and
434 ABI compatible with libungif which was in wide use while the LZW compression
435 algorithm was patented. Tools are also included to convert, manipulate,
436 compose, and analyze GIF images.")
437 (home-page "http://giflib.sourceforge.net/")
438 (license license:x11)))
439
440 (define-public libungif
441 (package
442 (name "libungif")
443 (version "4.1.4")
444 (source (origin
445 (method url-fetch)
446 (uri (string-append "mirror://sourceforge/giflib/libungif-"
447 version ".tar.bz2"))
448 (sha256
449 (base32
450 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
451 (build-system gnu-build-system)
452 (inputs `(("perl" ,perl))) ;package ships some perl tools
453 (home-page "http://giflib.sourceforge.net/")
454 (synopsis "GIF decompression library")
455 (description
456 "libungif is the old GIF decompression library by the GIFLIB project.")
457 (license license:expat)))
458
459 (define-public imlib2
460 (package
461 (name "imlib2")
462 (version "1.4.9")
463 (source (origin
464 (method url-fetch)
465 (uri (string-append
466 "mirror://sourceforge/enlightenment/imlib2-"
467 version ".tar.bz2"))
468 (sha256
469 (base32
470 "08809xxk2555yj6glixzw9a0x3x8cx55imd89kj3r0h152bn8a3x"))))
471 (build-system gnu-build-system)
472 (native-inputs
473 `(("pkgconfig" ,pkg-config)))
474 (inputs
475 `(("libx11" ,libx11)
476 ("libxext" ,libxext)
477 ("freetype" ,freetype)
478 ("libjpeg" ,libjpeg)
479 ("libpng" ,libpng)
480 ("libtiff" ,libtiff)
481 ("giflib" ,giflib)
482 ("bzip2" ,bzip2)))
483 (home-page "http://sourceforge.net/projects/enlightenment/")
484 (synopsis
485 "Loading, saving, rendering and manipulating image files")
486 (description
487 "Imlib2 is a library that does image file loading and saving as well as
488 rendering, manipulation, arbitrary polygon support, etc.
489
490 It does ALL of these operations FAST. Imlib2 also tries to be highly
491 intelligent about doing them, so writing naive programs can be done easily,
492 without sacrificing speed.
493
494 This is a complete rewrite over the Imlib 1.x series. The architecture is
495 more modular, simple, and flexible.")
496 (license license:imlib2)))
497
498 (define-public giblib
499 (package
500 (name "giblib")
501 (version "1.2.4")
502 (source (origin
503 (method url-fetch)
504 (uri (string-append
505 "http://linuxbrit.co.uk/downloads/giblib-"
506 version ".tar.gz"))
507 (sha256
508 (base32
509 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
510 (build-system gnu-build-system)
511 (inputs
512 `(("libx11" ,libx11)
513 ("imlib2" ,imlib2)))
514 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
515 (synopsis "Wrapper library for imlib2")
516 (description
517 "Giblib is a simple library which wraps imlib2's context API, avoiding
518 all the context_get/set calls, adds fontstyles to the truetype renderer and
519 supplies a generic doubly-linked list and some string functions.")
520 ;; This license removes a clause about X Consortium from the original
521 ;; X11 license.
522 (license (license:x11-style "file://COPYING"
523 "See 'COPYING' in the distribution."))))
524
525 (define-public freeimage
526 (package
527 (name "freeimage")
528 (version "3.17.0")
529 (source (origin
530 (method url-fetch)
531 (uri (string-append
532 "mirror://sourceforge/freeimage/Source%20Distribution/"
533 version "/FreeImage"
534 (string-concatenate (string-split version #\.))
535 ".zip"))
536 (sha256
537 (base32
538 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
539 (patches (search-patches "freeimage-CVE-2015-0852.patch"))))
540 (build-system gnu-build-system)
541 (arguments
542 '(#:phases (alist-delete
543 'configure
544 (alist-cons-before
545 'build 'patch-makefile
546 (lambda* (#:key outputs #:allow-other-keys)
547 (substitute* "Makefile.gnu"
548 (("/usr") (assoc-ref outputs "out"))
549 (("-o root -g root") "")))
550 %standard-phases))
551 #:make-flags '("CC=gcc")
552 #:tests? #f)) ; no check target
553 (native-inputs
554 `(("unzip" ,unzip)))
555 ;; Fails to build on MIPS due to assembly code in the source.
556 (supported-systems (delete "mips64el-linux" %supported-systems))
557 (synopsis "Library for handling popular graphics image formats")
558 (description
559 "FreeImage is a library for developers who would like to support popular
560 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
561 (license license:gpl2+)
562 (home-page "http://freeimage.sourceforge.net")))
563
564 (define-public vigra
565 (package
566 (name "vigra")
567 (version "1.11.0")
568 (source
569 (origin
570 (method url-fetch)
571 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
572 "Version-1-11-0/vigra-"
573 version "-src.tar.gz"))
574 (sha256 (base32
575 "1jzm79kqiiilvys3b8mlzy9cvmiirrcwsrlg19qd9rza8zipsqb8"))))
576 (build-system cmake-build-system)
577 (inputs
578 `(("boost" ,boost)
579 ("fftw" ,fftw)
580 ("fftwf" ,fftwf)
581 ("hdf5" ,hdf5)
582 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
583 ; to create a configure-flag
584 ("libjpeg" ,libjpeg)
585 ("libpng" ,libpng)
586 ("libtiff" ,libtiff)
587 ("openexr" ,openexr)
588 ("python" ,python-2) ; print syntax
589 ("python2-numpy" ,python2-numpy)
590 ("zlib" ,zlib)))
591 (native-inputs
592 `(("doxygen" ,doxygen)
593 ("python2-nose" ,python2-nose)
594 ("python2-sphinx" ,python2-sphinx)))
595 (arguments
596 `(#:test-target "check"
597 #:parallel-build? #f ; parallel builds trigger an ICE
598 #:configure-flags
599 (list "-Wno-dev" ; suppress developer mode with lots of warnings
600 (string-append "-DVIGRANUMPY_INSTALL_DIR="
601 (assoc-ref %outputs "out")
602 "/lib/python2.7/site-packages")
603 ;; OpenEXR is not enabled by default.
604 "-DWITH_OPENEXR=1"
605 ;; The header files of ilmbase are not found when included
606 ;; by the header files of openexr, and an explicit flag
607 ;; needs to be set.
608 (string-append "-DCMAKE_CXX_FLAGS=-I"
609 (assoc-ref %build-inputs "ilmbase")
610 "/include/OpenEXR"))))
611 (synopsis "Computer vision library")
612 (description
613 "VIGRA stands for Vision with Generic Algorithms. It is an image
614 processing and analysis library that puts its main emphasis on customizable
615 algorithms and data structures. It is particularly strong for
616 multi-dimensional image processing.")
617 (license license:expat)
618 (home-page "https://hci.iwr.uni-heidelberg.de/vigra")))
619
620 (define-public libwebp
621 (package
622 (name "libwebp")
623 (version "0.4.3")
624 (source
625 (origin
626 (method url-fetch)
627 (uri (string-append
628 "http://downloads.webmproject.org/releases/webp/libwebp-" version
629 ".tar.gz"))
630 (sha256
631 (base32 "1i4hfczjm3b1qj1g4cc9hgb69l47f3nkgf6hk7nz4dm9zmc0vgpg"))))
632 (build-system gnu-build-system)
633 (inputs
634 `(("freeglut" ,freeglut)
635 ("giflib" ,giflib)
636 ("libjpeg" ,libjpeg)
637 ("libpng" ,libpng)
638 ("libtiff" ,libtiff)))
639 (arguments
640 '(#:configure-flags '("--enable-libwebpmux"
641 "--enable-libwebpdemux"
642 "--enable-libwebpdecoder")))
643 (home-page "https://developers.google.com/speed/webp/")
644 (synopsis "Lossless and lossy image compression")
645 (description
646 "WebP is a new image format that provides lossless and lossy compression
647 for images. WebP lossless images are 26% smaller in size compared to
648 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
649 equivalent SSIM index. WebP supports lossless transparency (also known as
650 alpha channel) with just 22% additional bytes. Transparency is also supported
651 with lossy compression and typically provides 3x smaller file sizes compared
652 to PNG when lossy compression is acceptable for the red/green/blue color
653 channels.")
654 (license license:bsd-3)))
655
656 (define-public libmng
657 (package
658 (name "libmng")
659 (version "2.0.3")
660 (source (origin
661 (method url-fetch)
662 (uri (string-append "mirror://sourceforge/libmng/"
663 name "-" version ".tar.xz"))
664 (sha256
665 (base32
666 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
667 (build-system gnu-build-system)
668 (propagated-inputs
669 ;; These are all in the 'Libs.private' field of libmng.pc.
670 `(("lcms" ,lcms)
671 ("libjpeg" ,libjpeg)
672 ("zlib" ,zlib)))
673 (home-page "http://www.libmng.com/")
674 (synopsis "Library for handling MNG files")
675 (description
676 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
677 (license license:bsd-3)))
678
679 (define-public devil
680 (package
681 (name "devil")
682 (version "1.7.8")
683 (source (origin
684 (method url-fetch)
685 (uri (string-append "http://downloads.sourceforge.net/openil/"
686 "DevIL-" version ".tar.gz"))
687 (sha256
688 (base32
689 "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8"))
690 ;; Backported from upstream:
691 ;; https://github.com/DentonW/DevIL/commit/724194d7a9a91221a564579f64bdd6f0abd64219.patch
692 (patches (search-patches "devil-fix-libpng.patch"))
693 (modules '((guix build utils)))
694 (snippet
695 ;; Fix old lcms include directives and lib flags.
696 '(substitute* '("configure" "src-IL/src/il_profiles.c")
697 (("-llcms") "-llcms2")
698 (("lcms/lcms\\.h") "lcms2/lcms2.h")
699 (("lcms\\.h") "lcms2.h")))))
700 (build-system gnu-build-system)
701 (arguments
702 '(#:configure-flags '("--enable-ILUT=yes") ; build utility library
703 #:phases
704 (modify-phases %standard-phases
705 (add-before 'check 'fix-tests
706 (lambda* (#:key inputs #:allow-other-keys)
707 ;; Fix hard-coded /bin/bash reference.
708 (substitute* '("test/Makefile")
709 (("TESTS_ENVIRONMENT = /bin/bash")
710 (string-append "TESTS_ENVIRONMENT = "
711 (assoc-ref inputs "bash")
712 "/bin/bash")))
713 #t)))))
714 (native-inputs
715 `(("pkg-config" ,pkg-config)))
716 (inputs
717 `(("lcms" ,lcms)
718 ("libjpeg" ,libjpeg)
719 ("libmng" ,libmng)
720 ("libpng" ,libpng)
721 ("libtiff" ,libtiff)
722 ("openexr" ,openexr)
723 ("zlib" ,zlib)))
724 (synopsis "Library for manipulating many image formats")
725 (description "Developer's Image Library (DevIL) is a library to develop
726 applications with support for many types of images. DevIL can load, save,
727 convert, manipulate, filter and display a wide variety of image formats.")
728 (home-page "http://openil.sourceforge.net")
729 (license license:lgpl2.1+)))
730
731 (define-public jasper
732 (package
733 (name "jasper")
734 (version "1.900.1")
735 (source (origin
736 (method url-fetch)
737 (uri (string-append "https://www.ece.uvic.ca/~frodo/jasper"
738 "/software/jasper-" version ".zip"))
739 (sha256
740 (base32
741 "154l7zk7yh3v8l2l6zm5s2alvd2fzkp6c9i18iajfbna5af5m43b"))
742 (patches (search-patches
743 "jasper-CVE-2007-2721.patch"
744 "jasper-CVE-2008-3520.patch"
745 "jasper-CVE-2008-3522.patch"
746 "jasper-CVE-2011-4516-and-CVE-2011-4517.patch"
747 "jasper-CVE-2014-8137.patch"
748 "jasper-CVE-2014-8138.patch"
749 "jasper-CVE-2014-8157.patch"
750 "jasper-CVE-2014-8158.patch"
751 "jasper-CVE-2014-9029.patch"
752 "jasper-CVE-2016-1577.patch"
753 "jasper-CVE-2016-1867.patch"
754 "jasper-CVE-2016-2089.patch"
755 "jasper-CVE-2016-2116.patch"))))
756 (build-system gnu-build-system)
757 (native-inputs
758 `(("unzip" ,unzip)))
759 (synopsis "JPEG-2000 library")
760 (description "The JasPer Project is an initiative to provide a reference
761 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
762 ISO/IEC 15444-1).")
763 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
764 (license (license:x11-style "file://LICENSE"))))