gnu: python-pandas: Fix build on 32-bit.
[jackhill/guix/guix.git] / gnu / packages / image.scm
CommitLineData
e55354b8 1;;; GNU Guix --- Functional package management for GNU
023f0fb0 2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
451b5c5d 3;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
86fa2ea9 4;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
85a02905 5;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
2df831a7 6;;; Copyright © 2014, 2016 Ricardo Wurmus <rekado@elephly.net>
0731a47c 7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
fcc43c1f 8;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
97039f6e 9;;; Copyright © 2014 John Darrington <jmd@gnu.org>
90bcecc5 10;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
4b96149d 11;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
4b50daab 12;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
af7aaaeb 13;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
1fa3e336 14;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
93117227 15;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
b81245cc 16;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
e55354b8
DT
17;;;
18;;; This file is part of GNU Guix.
19;;;
20;;; GNU Guix is free software; you can redistribute it and/or modify it
21;;; under the terms of the GNU General Public License as published by
22;;; the Free Software Foundation; either version 3 of the License, or (at
23;;; your option) any later version.
24;;;
25;;; GNU Guix is distributed in the hope that it will be useful, but
26;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28;;; GNU General Public License for more details.
29;;;
30;;; You should have received a copy of the GNU General Public License
31;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33(define-module (gnu packages image)
34 #:use-module (gnu packages)
97039f6e 35 #:use-module (gnu packages algebra)
37e05d64 36 #:use-module (gnu packages assembly)
894e2cba 37 #:use-module (gnu packages autotools)
97039f6e 38 #:use-module (gnu packages boost)
e55354b8 39 #:use-module (gnu packages compression)
99828fa7 40 #:use-module (gnu packages documentation)
efa77baf 41 #:use-module (gnu packages fontutils)
0bd1097c
LF
42 ;; To provide gcc@5 and gcc@6, to work around <http://bugs.gnu.org/24703>.
43 #:use-module (gnu packages gcc)
1fa3e336 44 #:use-module (gnu packages gettext)
97039f6e 45 #:use-module (gnu packages ghostscript)
060ad3de 46 #:use-module (gnu packages gl)
023f0fb0 47 #:use-module (gnu packages glib)
ced7cc92 48 #:use-module (gnu packages graphics)
97039f6e 49 #:use-module (gnu packages maths)
1fa3e336 50 #:use-module (gnu packages mcrypt)
97039f6e 51 #:use-module (gnu packages perl)
efa77baf 52 #:use-module (gnu packages pkg-config)
97039f6e 53 #:use-module (gnu packages python)
efa77baf 54 #:use-module (gnu packages xml)
76d88cfa 55 #:use-module (gnu packages xorg)
43402c5c 56 #:use-module (gnu packages zip)
b5b73a82 57 #:use-module ((guix licenses) #:prefix license:)
e55354b8
DT
58 #:use-module (guix packages)
59 #:use-module (guix download)
ac2a38a5 60 #:use-module (guix git-download)
38c55e5c 61 #:use-module (guix build-system gnu)
e596ab0f
AK
62 #:use-module (guix build-system cmake)
63 #:use-module (srfi srfi-1))
e55354b8
DT
64
65(define-public libpng
66 (package
67 (name "libpng")
322e724b 68 (replacement libpng/fixed)
a2f3c614 69 (version "1.6.25")
e55354b8
DT
70 (source (origin
71 (method url-fetch)
21ef9843
MW
72
73 ;; Note: upstream removes older tarballs.
a2f3c614 74 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
21ef9843
MW
75 version "/libpng-" version ".tar.xz")
76 (string-append
77 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
78 "/libpng15/libpng-" version ".tar.xz")))
e55354b8 79 (sha256
a2f3c614 80 (base32 "04c8inn745hw25wz2dc5vll5n5d2gsndj01i4srwzgz8861qvzh9"))))
e55354b8
DT
81 (build-system gnu-build-system)
82
83 ;; libpng.la says "-lz", so propagate it.
84 (propagated-inputs `(("zlib" ,zlib)))
85
86 (synopsis "Library for handling PNG files")
87 (description
88 "Libpng is the official PNG (Portable Network Graphics) reference
35b9e423 89library. It supports almost all PNG features and is extensible.")
e55354b8
DT
90 (license license:zlib)
91 (home-page "http://www.libpng.org/pub/png/libpng.html")))
92
322e724b
LF
93(define libpng/fixed
94 (package
95 (inherit libpng)
96 (source
97 (origin
98 (inherit (package-source libpng))
858b9afe 99 (patches (search-patches "libpng-CVE-2016-10087.patch"))))))
322e724b 100
2df831a7
RW
101(define-public libpng-1.2
102 (package
103 (inherit libpng)
fc604eda
LF
104 (replacement #f)
105 (version "1.2.57")
2df831a7
RW
106 (source
107 (origin
108 (method url-fetch)
109 ;; Note: upstream removes older tarballs.
110 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
111 version "/libpng-" version ".tar.xz")
112 (string-append
113 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
114 "/libpng12/libpng-" version ".tar.xz")))
115 (sha256
fc604eda 116 (base32 "1n2lrzjkm5jhfg2bs10q398lkwbbx742fi27zgdgx0x23zhj0ihg"))))))
2df831a7 117
e55354b8
DT
118(define-public libjpeg
119 (package
120 (name "libjpeg")
24f2334e 121 (version "9b")
e55354b8
DT
122 (source (origin
123 (method url-fetch)
124 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
125 version ".tar.gz"))
126 (sha256 (base32
24f2334e 127 "0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
e55354b8 128 (build-system gnu-build-system)
35b9e423 129 (synopsis "Library for handling JPEG files")
e55354b8
DT
130 (description
131 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
132JPEG is a standardized compression method for full-color and gray-scale
133images.
134The included programs provide conversion between the JPEG format and
135image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
136 (license license:ijg)
137 (home-page "http://www.ijg.org/")))
138
139(define-public libjpeg-8
140 (package (inherit libjpeg)
141 (version "8d")
142 (source (origin
143 (method url-fetch)
144 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
145 version ".tar.gz"))
146 (sha256 (base32
147 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
fcc43c1f 148
b81245cc
KK
149(define-public libjxr
150 (package
151 (name "libjxr")
152 (version "1.1")
153 (source (origin
154 ;; We are using the Debian source because CodePlex does not
155 ;; deliver an easily downloadable tarball.
156 (method url-fetch)
157 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
158 version ".orig.tar.gz"))
159 (sha256
160 (base32
161 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
162 (patch-flags '("-p1" "--binary"))
163 (patches (search-patches "libjxr-fix-function-signature.patch"
164 "libjxr-fix-typos.patch"))))
165 (build-system gnu-build-system)
166 (arguments '(#:make-flags '("CC=gcc")
167 #:tests? #f ; no check target
168 #:phases
169 (modify-phases %standard-phases
170 (delete 'configure) ; no configure script
171 ;; The upstream makefile does not include an install phase.
172 (replace 'install
173 (lambda* (#:key outputs #:allow-other-keys)
174 (let* ((out (assoc-ref outputs "out"))
175 (bin (string-append out "/bin"))
176 (lib (string-append out "/lib"))
177 (include (string-append out "/include/jxrlib")))
178 (for-each (lambda (file)
179 (install-file file include)
180 (delete-file file))
181 (append
182 '("jxrgluelib/JXRGlue.h"
183 "jxrgluelib/JXRMeta.h"
184 "jxrtestlib/JXRTest.h"
185 "image/sys/windowsmediaphoto.h")
186 (find-files "common/include" "\\.h$")))
187 (for-each (lambda (file)
188 (install-file file lib)
189 (delete-file file))
190 (find-files "." "\\.a$"))
191 (for-each (lambda (file)
192 (install-file file bin)
193 (delete-file file))
194 '("JxrDecApp" "JxrEncApp")))
195 #t)))))
196 (synopsis "Implementation of the JPEG XR standard")
197 (description "JPEG XR is an approved ISO/IEC International standard (its
198official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
199 (license
200 (license:non-copyleft
201 "file://Makefile"
202 "See the header of the Makefile in the distribution."))
203 (home-page "https://jxrlib.codeplex.com/")))
204
fcc43c1f
AB
205(define-public jpegoptim
206 (package
207 (name "jpegoptim")
cbe2cc02 208 (version "1.4.4")
fcc43c1f
AB
209 (source (origin
210 (method url-fetch)
211 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
212 version ".tar.gz"))
213 (sha256 (base32
cbe2cc02 214 "1cn1i0g1xjdwa12w0ifbnzgb1vqbpr8ji6h05vxksj79vyi3x849"))))
fcc43c1f
AB
215 (build-system gnu-build-system)
216 (inputs `(("libjpeg" ,libjpeg)))
217 (arguments
218 ;; no tests
219 '(#:tests? #f))
220 (synopsis "Optimize JPEG images")
221 (description
222 "jpegoptim provides lossless optimization (based on optimizing
223the Huffman tables) and \"lossy\" optimization based on setting
224maximum quality factor.")
225 (license license:gpl2+)
226 (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim")))
e55354b8 227
f5e4229a
BT
228(define-public libicns
229 (package
230 (name "libicns")
231 (version "0.8.1")
232 (source (origin
233 (method url-fetch)
234 (uri (string-append
235 "mirror://sourceforge/icns/"
236 "libicns-" version ".tar.gz"))
237 (sha256
238 (base32
239 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
240 (build-system gnu-build-system)
241 (inputs
242 `(("libpng" ,libpng)
243 ("jasper" ,jasper)))
244 (arguments
245 `(#:tests? #t)) ; No tests.
246 (home-page "http://icns.sourceforge.net/")
247 (synopsis "Library for handling Mac OS icns resource files")
248 (description
249 "Libicns is a library for the manipulation of Mac OS IconFamily resource
250type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
251convert between PNG and ICNS. @command{icns2png} will extract image files from
252ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
253with .desktop files. Additionally, @command{icontainer2png} is provided for
254extracting icontainer icon files.")
255 (license (list license:lgpl2.1+ ; libicns
256 license:lgpl2.0+ ; src/apidocs.*
257 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
258
e55354b8
DT
259(define-public libtiff
260 (package
261 (name "libtiff")
4b96149d 262 (replacement libtiff/fixed)
0bd1097c 263 (version "4.0.7")
e55354b8
DT
264 (source (origin
265 (method url-fetch)
0bd1097c
LF
266 (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-"
267 version ".tar.gz"))
268 (sha256
269 (base32
270 "06ghqhr4db1ssq0acyyz49gr8k41gzw6pqb6mbn5r7jqp77s4hwz"))))
e55354b8 271 (build-system gnu-build-system)
6f6eb857
LC
272 (outputs '("out"
273 "doc")) ;1.3 MiB of HTML documentation
274 (arguments
275 ;; Instead of using --docdir, this package has its own --with-docdir.
276 `(#:configure-flags (list (string-append "--with-docdir="
277 (assoc-ref %outputs "doc")
278 "/share/doc/"
279 ,name "-" ,version))))
0bd1097c
LF
280 ;; Build with a patched GCC to work around <http://bugs.gnu.org/24703>.
281 (native-inputs
282 `(("gcc@5" ,gcc-5)))
e55354b8 283 (inputs `(("zlib" ,zlib)
1de0afd5 284 ("libjpeg" ,libjpeg)))
35b9e423 285 (synopsis "Library for handling TIFF files")
e55354b8
DT
286 (description
287 "Libtiff provides support for the Tag Image File Format (TIFF), a format
288used for storing image data.
289Included are a library, libtiff, for reading and writing TIFF and a small
290collection of tools for doing simple manipulations of TIFF images.")
166191b3
LC
291 (license (license:non-copyleft "file://COPYRIGHT"
292 "See COPYRIGHT in the distribution."))
0bd1097c 293 (home-page "http://www.simplesystems.org/libtiff/")))
ed5940b6 294
4b96149d
LF
295(define libtiff/fixed
296 (package
297 (inherit libtiff)
298 (source
299 (origin
300 (inherit (package-source libtiff))
301 (patches (search-patches "libtiff-heap-overflow-tiffcp.patch"
302 "libtiff-null-dereference.patch"
303 "libtiff-heap-overflow-tif-dirread.patch"
304 "libtiff-heap-overflow-pixarlog-luv.patch"
305 "libtiff-divide-by-zero.patch"
306 "libtiff-divide-by-zero-ojpeg.patch"
307 "libtiff-tiffcp-underflow.patch"
308 "libtiff-invalid-read.patch"
309 "libtiff-CVE-2016-10092.patch"
310 "libtiff-heap-overflow-tiffcrop.patch"
311 "libtiff-divide-by-zero-tiffcrop.patch"
312 "libtiff-CVE-2016-10093.patch"
313 "libtiff-divide-by-zero-tiffcp.patch"
314 "libtiff-assertion-failure.patch"
62cf8fa7
LF
315 "libtiff-CVE-2016-10094.patch"
316 "libtiff-CVE-2017-5225.patch"))))))
4b96149d 317
efa77baf
MB
318(define-public libwmf
319 (package
320 (name "libwmf")
321 (version "0.2.8.4")
322 (source
323 (origin
324 (method url-fetch)
757d5ff3
LC
325 (uri (string-append "mirror://sourceforge/wvware/"
326 name "/" version
327 "/" name "-" version ".tar.gz"))
efa77baf 328 (sha256
9ed54864
MW
329 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v"))
330 (patches
fc1adab1
AK
331 (search-patches "libwmf-CAN-2004-0941.patch"
332 "libwmf-CVE-2006-3376.patch"
333 "libwmf-CVE-2007-0455.patch"
334 "libwmf-CVE-2007-2756.patch"
335 "libwmf-CVE-2007-3472.patch"
336 "libwmf-CVE-2007-3473.patch"
337 "libwmf-CVE-2007-3477.patch"
338 "libwmf-CVE-2009-1364.patch"
339 "libwmf-CVE-2009-3546.patch"
340 "libwmf-CVE-2015-0848+CVE-2015-4588.patch"
341 "libwmf-CVE-2015-4695.patch"
342 "libwmf-CVE-2015-4696.patch"))))
efa77baf
MB
343
344 (build-system gnu-build-system)
345 (inputs
346 `(("freetype" ,freetype)
347 ("libjpeg" ,libjpeg)
348 ("libpng",libpng)
349 ("libxml2" ,libxml2)
350 ("zlib" ,zlib)))
351 (native-inputs
352 `(("pkg-config" ,pkg-config)))
353 (synopsis "Library for reading images in the Microsoft WMF format")
354 (description
355 "libwmf is a library for reading vector images in Microsoft's native
356Windows Metafile Format (WMF) and for either (a) displaying them in, e.g., an X
357window; or (b) converting them to more standard/free file formats such as, e.g.,
358the W3C's XML-based Scaleable Vector Graphic (SVG) format.")
359 (home-page "http://wvware.sourceforge.net/libwmf.html")
360
361 ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+.
362 (license license:lgpl2.0+)))
8d9872b5 363
894e2cba
TUBK
364(define-public leptonica
365 (package
366 (name "leptonica")
d02fb7ce 367 (version "1.74.0")
894e2cba
TUBK
368 (source
369 (origin
370 (method url-fetch)
d02fb7ce
TUBK
371 (uri (string-append
372 "https://github.com/DanBloomberg/leptonica/archive/" version
373 ".tar.gz"))
374 (file-name (string-append "leptonica-" version ".tar.gz"))
894e2cba 375 (sha256
d02fb7ce 376 (base32 "0i2a4vx9gizki0wgmv03xjz8j9d8agkvbag1a8m4kcw4asd4p87g"))))
894e2cba
TUBK
377 (build-system gnu-build-system)
378 (native-inputs
d02fb7ce
TUBK
379 `(("gnuplot" ,gnuplot) ;needed for test suite
380 ("autoconf" ,autoconf)
381 ("automake" ,automake)
382 ("libtool" ,libtool)
383 ("pkg-config" ,pkg-config)))
894e2cba
TUBK
384 (inputs
385 `(("giflib" ,giflib)
386 ("libjpeg" ,libjpeg)
387 ("libpng" ,libpng)
388 ("libtiff" ,libtiff)
389 ("libwebp" ,libwebp)))
390 (propagated-inputs
d02fb7ce 391 ;; Linking a program with leptonica also requires these.
894e2cba
TUBK
392 `(("openjpeg" ,openjpeg)
393 ("zlib" ,zlib)))
394 (arguments
d02fb7ce 395 '(#:phases
894e2cba 396 (modify-phases %standard-phases
d02fb7ce
TUBK
397 (add-after 'unpack 'autogen
398 (lambda _
399 (zero? (system* "sh" "autobuild"))))
400 (add-after 'unpack 'patch-reg-wrapper
401 (lambda _
402 (substitute* "prog/reg_wrapper.sh"
403 ((" /bin/sh ")
404 (string-append " " (which "sh") " "))
405 (("which gnuplot")
406 "true")))))))
894e2cba
TUBK
407 (home-page "http://www.leptonica.com/")
408 (synopsis "Library and tools for image processing and analysis")
409 (description
410 "Leptonica is a C library and set of command-line tools for efficient
411image processing and image analysis operations. It supports rasterop, affine
412transformations, binary and grayscale morphology, rank order, and convolution,
413seedfill and connected components, image transformations combining changes in
414scale and pixel depth, and pixelwise masking, blending, enhancement, and
415arithmetic ops.")
416 (license license:bsd-2)))
417
8d9872b5
MB
418(define-public jbig2dec
419 (package
420 (name "jbig2dec")
35eade9c 421 (version "0.13")
8d9872b5
MB
422 (source
423 (origin
424 (method url-fetch)
35eade9c
LF
425 (uri (string-append "http://downloads.ghostscript.com/public/" name "/"
426 name "-" version ".tar.gz"))
8d9872b5 427 (sha256
35eade9c 428 (base32 "04akiwab8iy5iy34razcvh9mcja9wy737civ3sbjxk4j143s1b2s"))
fc1adab1 429 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
8d9872b5
MB
430
431 (build-system gnu-build-system)
432 (synopsis "Decoder of the JBIG2 image compression format")
433 (description
7c125ce0
AK
434 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
435monochrome) images at moderately high resolution, and in particular scanned
436paper documents. In this domain it is very efficient, offering compression
437ratios on the order of 100:1.
8d9872b5
MB
438
439This is a decoder only implementation, and currently is in the alpha
440stage, meaning it doesn't completely work yet. However, it is
441maintaining parity with available encoders, so it is useful for real
442work.")
35eade9c 443 (home-page "http://www.ghostscript.com/jbig2dec.html")
8d9872b5 444 (license license:gpl2+)))
38c55e5c
MB
445
446(define-public openjpeg
447 (package
448 (name "openjpeg")
0e8b7b1c 449 (replacement openjpeg-2.1.2)
876d80d4 450 (version "2.1.1")
38c55e5c
MB
451 (source
452 (origin
453 (method url-fetch)
454 (uri
876d80d4
LF
455 (string-append "https://github.com/uclouvain/openjpeg/archive/v"
456 version ".tar.gz"))
457 (file-name (string-append name "-" version ".tar.gz"))
38c55e5c 458 (sha256
876d80d4 459 (base32
0f97e7e5 460 "1anv0rjkbxw9kx91wvlfpb3dhppibda6kb1papny46bjzi3pzhl2"))
4ce01773
LF
461 (patches (search-patches "openjpeg-CVE-2016-5157.patch"
462 "openjpeg-CVE-2016-7163.patch"))))
38c55e5c
MB
463 (build-system cmake-build-system)
464 (arguments
465 ;; Trying to run `$ make check' results in a no rule fault.
466 '(#:tests? #f))
467 (inputs
468 `(("lcms" ,lcms)
469 ("libpng" ,libpng)
470 ("libtiff" ,libtiff)
471 ("zlib" ,zlib)))
472 (synopsis "JPEG 2000 codec")
473 (description
474 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
475been developed in order to promote the use of JPEG 2000, the new
476still-image compression standard from the Joint Photographic Experts
477Group (JPEG).
478
479In addition to the basic codec, various other features are under
480development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
481an indexing tool useful for the JPIP protocol, JPWL-tools for
482error-resilience, a Java-viewer for j2k-images, ...")
b9270582 483 (home-page "https://github.com/uclouvain/openjpeg")
38c55e5c 484 (license license:bsd-2)))
76d88cfa 485
0e8b7b1c 486(define openjpeg-2.1.2
a304b6c3
EF
487 (package
488 (inherit openjpeg)
5ce09ef1 489 (name "openjpeg")
0e8b7b1c 490 (version "2.1.2")
a304b6c3
EF
491 (source
492 (origin
0e8b7b1c
LF
493 (method url-fetch)
494 (uri (string-append "https://github.com/uclouvain/openjpeg/archive/v"
495 version ".tar.gz"))
5ce09ef1 496 (file-name (string-append name "-" version ".tar.gz"))
0e8b7b1c
LF
497 (sha256
498 (base32
499 "19yz4g0c45sm8y1z01j9djsrl1mkz3pmw7fykc6hkvrqymp7prsc"))
a304b6c3 500 (patches
0769cea6
LF
501 (search-patches "openjpeg-CVE-2016-9850-CVE-2016-9851.patch"
502 "openjpeg-CVE-2016-9572-CVE-2016-9573.patch"))))))
a304b6c3 503
6140b9d8
RW
504(define-public openjpeg-1
505 (package (inherit openjpeg)
506 (name "openjpeg")
a304b6c3 507 (replacement #f)
6140b9d8
RW
508 (version "1.5.2")
509 (source
510 (origin
511 (method url-fetch)
512 (uri
de67e922
LF
513 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
514 name "-" version ".tar.gz"))
6140b9d8
RW
515 (sha256
516 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
517
e596ab0f
AK
518(define-public giflib
519 (package
520 (name "giflib")
3fdb2a84 521 (version "5.1.4")
e596ab0f
AK
522 (source (origin
523 (method url-fetch)
524 (uri (string-append "mirror://sourceforge/giflib/giflib-"
de67e922 525 version ".tar.bz2"))
e596ab0f 526 (sha256
44c5f025
EF
527 (base32
528 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
e596ab0f
AK
529 (build-system gnu-build-system)
530 (outputs '("bin" ; utility programs
531 "out")) ; library
532 (inputs `(("libx11" ,libx11)
533 ("libice" ,libice)
534 ("libsm" ,libsm)
535 ("perl" ,perl)))
536 (arguments
44c5f025
EF
537 `(#:phases
538 (modify-phases %standard-phases
539 (add-after 'unpack 'disable-html-doc-gen
540 (lambda _
541 (substitute* "doc/Makefile.in"
542 (("^all: allhtml manpages") ""))))
543 (add-after 'install 'install-manpages
544 (lambda* (#:key outputs #:allow-other-keys)
545 (let* ((bin (assoc-ref outputs "bin"))
546 (man1dir (string-append bin "/share/man/man1")))
547 (mkdir-p man1dir)
548 (for-each (lambda (file)
549 (let ((base (basename file)))
550 (format #t "installing `~a' to `~a'~%"
551 base man1dir)
552 (copy-file file
553 (string-append
554 man1dir "/" base))))
555 (find-files "doc" "\\.1"))))))))
e596ab0f
AK
556 (synopsis "Tools and library for working with GIF images")
557 (description
35b9e423 558 "GIFLIB is a library for reading and writing GIF images. It is API and
e596ab0f
AK
559ABI compatible with libungif which was in wide use while the LZW compression
560algorithm was patented. Tools are also included to convert, manipulate,
561compose, and analyze GIF images.")
562 (home-page "http://giflib.sourceforge.net/")
563 (license license:x11)))
564
0731a47c
TUBK
565(define-public libungif
566 (package
567 (name "libungif")
568 (version "4.1.4")
569 (source (origin
570 (method url-fetch)
de67e922
LF
571 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
572 "libungif-" version "/libungif-"
0731a47c
TUBK
573 version ".tar.bz2"))
574 (sha256
575 (base32
576 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
577 (build-system gnu-build-system)
578 (inputs `(("perl" ,perl))) ;package ships some perl tools
579 (home-page "http://giflib.sourceforge.net/")
580 (synopsis "GIF decompression library")
581 (description
582 "libungif is the old GIF decompression library by the GIFLIB project.")
583 (license license:expat)))
584
76d88cfa
AK
585(define-public imlib2
586 (package
587 (name "imlib2")
8c15e084 588 (version "1.4.9")
76d88cfa
AK
589 (source (origin
590 (method url-fetch)
591 (uri (string-append
de67e922
LF
592 "mirror://sourceforge/enlightenment/imlib2-src/" version
593 "/imlib2-" version ".tar.bz2"))
76d88cfa
AK
594 (sha256
595 (base32
8c15e084 596 "08809xxk2555yj6glixzw9a0x3x8cx55imd89kj3r0h152bn8a3x"))))
76d88cfa 597 (build-system gnu-build-system)
76d88cfa
AK
598 (native-inputs
599 `(("pkgconfig" ,pkg-config)))
600 (inputs
601 `(("libx11" ,libx11)
602 ("libxext" ,libxext)
603 ("freetype" ,freetype)
604 ("libjpeg" ,libjpeg)
605 ("libpng" ,libpng)
606 ("libtiff" ,libtiff)
607 ("giflib" ,giflib)
608 ("bzip2" ,bzip2)))
3b3b60d0 609 (home-page "https://sourceforge.net/projects/enlightenment/")
76d88cfa
AK
610 (synopsis
611 "Loading, saving, rendering and manipulating image files")
612 (description
613 "Imlib2 is a library that does image file loading and saving as well as
614rendering, manipulation, arbitrary polygon support, etc.
615
616It does ALL of these operations FAST. Imlib2 also tries to be highly
617intelligent about doing them, so writing naive programs can be done easily,
618without sacrificing speed.
619
620This is a complete rewrite over the Imlib 1.x series. The architecture is
621more modular, simple, and flexible.")
8835aed4 622 (license license:imlib2)))
f7d28082
AK
623
624(define-public giblib
625 (package
626 (name "giblib")
627 (version "1.2.4")
628 (source (origin
629 (method url-fetch)
bf512da1
EF
630 (uri (list
631 (string-append
632 "http://linuxbrit.co.uk/downloads/giblib-"
633 version ".tar.gz")
634 (string-append
635 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
636 "files/giblib/giblib-" version ".tar.gz")))
f7d28082
AK
637 (sha256
638 (base32
639 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
640 (build-system gnu-build-system)
641 (inputs
642 `(("libx11" ,libx11)
643 ("imlib2" ,imlib2)))
644 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
645 (synopsis "Wrapper library for imlib2")
646 (description
35b9e423 647 "Giblib is a simple library which wraps imlib2's context API, avoiding
f7d28082
AK
648all the context_get/set calls, adds fontstyles to the truetype renderer and
649supplies a generic doubly-linked list and some string functions.")
650 ;; This license removes a clause about X Consortium from the original
651 ;; X11 license.
652 (license (license:x11-style "file://COPYING"
653 "See 'COPYING' in the distribution."))))
43402c5c
DT
654
655(define-public freeimage
656 (package
657 (name "freeimage")
bcc09d9a 658 (version "3.17.0")
43402c5c
DT
659 (source (origin
660 (method url-fetch)
661 (uri (string-append
662 "mirror://sourceforge/freeimage/Source%20Distribution/"
663 version "/FreeImage"
bcc09d9a 664 (string-concatenate (string-split version #\.))
43402c5c
DT
665 ".zip"))
666 (sha256
667 (base32
93bd4a37 668 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
76e8566c
EF
669 (patches (search-patches "freeimage-CVE-2015-0852.patch"
670 "freeimage-CVE-2016-5684.patch"))))
43402c5c
DT
671 (build-system gnu-build-system)
672 (arguments
4a2798e0
EF
673 '(#:phases
674 (modify-phases %standard-phases
675 (delete 'configure)
676 (add-before 'build 'patch-makefile
677 (lambda* (#:key outputs #:allow-other-keys)
678 (substitute* "Makefile.gnu"
679 (("/usr") (assoc-ref outputs "out"))
680 (("-o root -g root") ""))
681 #t)))
43402c5c
DT
682 #:make-flags '("CC=gcc")
683 #:tests? #f)) ; no check target
684 (native-inputs
685 `(("unzip" ,unzip)))
f9664de7
DT
686 ;; Fails to build on MIPS due to assembly code in the source.
687 (supported-systems (delete "mips64el-linux" %supported-systems))
43402c5c
DT
688 (synopsis "Library for handling popular graphics image formats")
689 (description
690 "FreeImage is a library for developers who would like to support popular
691graphics image formats like PNG, BMP, JPEG, TIFF and others.")
692 (license license:gpl2+)
693 (home-page "http://freeimage.sourceforge.net")))
97039f6e
AE
694
695(define-public vigra
019b3875
AE
696 (package
697 (name "vigra")
698 (version "1.11.0")
699 (source
700 (origin
701 (method url-fetch)
702 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
703 "Version-1-11-0/vigra-"
704 version "-src.tar.gz"))
705 (sha256 (base32
706 "1jzm79kqiiilvys3b8mlzy9cvmiirrcwsrlg19qd9rza8zipsqb8"))))
707 (build-system cmake-build-system)
708 (inputs
709 `(("boost" ,boost)
710 ("fftw" ,fftw)
711 ("fftwf" ,fftwf)
712 ("hdf5" ,hdf5)
713 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
714 ; to create a configure-flag
715 ("libjpeg" ,libjpeg)
716 ("libpng" ,libpng)
717 ("libtiff" ,libtiff)
718 ("openexr" ,openexr)
719 ("python" ,python-2) ; print syntax
720 ("python2-numpy" ,python2-numpy)
721 ("zlib" ,zlib)))
722 (native-inputs
723 `(("doxygen" ,doxygen)
724 ("python2-nose" ,python2-nose)
725 ("python2-sphinx" ,python2-sphinx)))
726 (arguments
727 `(#:test-target "check"
728 #:parallel-build? #f ; parallel builds trigger an ICE
729 #:configure-flags
730 (list "-Wno-dev" ; suppress developer mode with lots of warnings
731 (string-append "-DVIGRANUMPY_INSTALL_DIR="
732 (assoc-ref %outputs "out")
733 "/lib/python2.7/site-packages")
734 ;; OpenEXR is not enabled by default.
735 "-DWITH_OPENEXR=1"
f803f775
LF
736 ;; Fix rounding error on 32-bit machines
737 "-DCMAKE_C_FLAGS=-ffloat-store"
019b3875
AE
738 ;; The header files of ilmbase are not found when included
739 ;; by the header files of openexr, and an explicit flag
740 ;; needs to be set.
741 (string-append "-DCMAKE_CXX_FLAGS=-I"
742 (assoc-ref %build-inputs "ilmbase")
f803f775
LF
743 "/include/OpenEXR"
744 " -ffloat-store"))))
019b3875
AE
745 (synopsis "Computer vision library")
746 (description
747 "VIGRA stands for Vision with Generic Algorithms. It is an image
97039f6e
AE
748processing and analysis library that puts its main emphasis on customizable
749algorithms and data structures. It is particularly strong for
750multi-dimensional image processing.")
019b3875
AE
751 (license license:expat)
752 (home-page "https://hci.iwr.uni-heidelberg.de/vigra")))
060ad3de
TUBK
753
754(define-public libwebp
755 (package
756 (name "libwebp")
b2ed5ca7 757 (version "0.5.1")
060ad3de
TUBK
758 (source
759 (origin
760 (method url-fetch)
761 (uri (string-append
762 "http://downloads.webmproject.org/releases/webp/libwebp-" version
763 ".tar.gz"))
95bff4f6 764 (patches (search-patches "libwebp-CVE-2016-9085.patch"))
060ad3de 765 (sha256
b2ed5ca7
LF
766 (base32
767 "1pqki1g8nzi8qgciysypd5r38zccv81np1dn43g27830rmpnrmka"))))
060ad3de
TUBK
768 (build-system gnu-build-system)
769 (inputs
770 `(("freeglut" ,freeglut)
771 ("giflib" ,giflib)
772 ("libjpeg" ,libjpeg)
773 ("libpng" ,libpng)
774 ("libtiff" ,libtiff)))
775 (arguments
776 '(#:configure-flags '("--enable-libwebpmux"
777 "--enable-libwebpdemux"
778 "--enable-libwebpdecoder")))
779 (home-page "https://developers.google.com/speed/webp/")
780 (synopsis "Lossless and lossy image compression")
781 (description
782 "WebP is a new image format that provides lossless and lossy compression
1eefe4a8
LC
783for images. WebP lossless images are 26% smaller in size compared to
784PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
785equivalent SSIM index. WebP supports lossless transparency (also known as
786alpha channel) with just 22% additional bytes. Transparency is also supported
060ad3de
TUBK
787with lossy compression and typically provides 3x smaller file sizes compared
788to PNG when lossy compression is acceptable for the red/green/blue color
789channels.")
790 (license license:bsd-3)))
b9ecd5ae
SB
791
792(define-public libmng
793 (package
794 (name "libmng")
795 (version "2.0.3")
796 (source (origin
797 (method url-fetch)
0f971a04
LF
798 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
799 version "/" name "-" version ".tar.xz"))
b9ecd5ae
SB
800 (sha256
801 (base32
802 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
803 (build-system gnu-build-system)
804 (propagated-inputs
805 ;; These are all in the 'Libs.private' field of libmng.pc.
806 `(("lcms" ,lcms)
807 ("libjpeg" ,libjpeg)
808 ("zlib" ,zlib)))
809 (home-page "http://www.libmng.com/")
810 (synopsis "Library for handling MNG files")
811 (description
812 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
813 (license license:bsd-3)))
3aab2c83 814
023f0fb0
AK
815(define-public exiv2
816 (package
817 (name "exiv2")
818 (version "0.25")
819 (source (origin
820 (method url-fetch)
821 (uri (list (string-append "http://www.exiv2.org/exiv2-"
822 version ".tar.gz")
823 (string-append "https://fossies.org/linux/misc/exiv2-"
824 version ".tar.gz")))
825 (sha256
826 (base32
827 "197g6vgcpyf9p2cwn5p5hb1r714xsk1v4p96f5pv1z8mi9vzq2y8"))))
828 (build-system gnu-build-system)
829 (arguments '(#:tests? #f)) ; no `check' target
830 (propagated-inputs
831 `(("expat" ,expat)
832 ("zlib" ,zlib)))
833 (native-inputs
834 `(("intltool" ,intltool)))
835 (home-page "http://www.exiv2.org/")
836 (synopsis "Library and command-line utility to manage image metadata")
837 (description
838 "Exiv2 is a C++ library and a command line utility to manage image
839metadata. It provides fast and easy read and write access to the Exif, IPTC
840and XMP metadata of images in various formats.")
841
842 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
843 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
844 ;; The core is GPLv2+:
845 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
846 (license license:gpl2+)))
847
3aab2c83
DT
848(define-public devil
849 (package
850 (name "devil")
851 (version "1.7.8")
852 (source (origin
853 (method url-fetch)
854 (uri (string-append "http://downloads.sourceforge.net/openil/"
855 "DevIL-" version ".tar.gz"))
856 (sha256
857 (base32
858 "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8"))
859 ;; Backported from upstream:
860 ;; https://github.com/DentonW/DevIL/commit/724194d7a9a91221a564579f64bdd6f0abd64219.patch
726f0888
LF
861 (patches (search-patches "devil-fix-libpng.patch"
862 "devil-CVE-2009-3994.patch"))
3aab2c83
DT
863 (modules '((guix build utils)))
864 (snippet
865 ;; Fix old lcms include directives and lib flags.
866 '(substitute* '("configure" "src-IL/src/il_profiles.c")
867 (("-llcms") "-llcms2")
868 (("lcms/lcms\\.h") "lcms2/lcms2.h")
869 (("lcms\\.h") "lcms2.h")))))
870 (build-system gnu-build-system)
871 (arguments
872 '(#:configure-flags '("--enable-ILUT=yes") ; build utility library
873 #:phases
874 (modify-phases %standard-phases
875 (add-before 'check 'fix-tests
876 (lambda* (#:key inputs #:allow-other-keys)
877 ;; Fix hard-coded /bin/bash reference.
878 (substitute* '("test/Makefile")
879 (("TESTS_ENVIRONMENT = /bin/bash")
880 (string-append "TESTS_ENVIRONMENT = "
881 (assoc-ref inputs "bash")
882 "/bin/bash")))
883 #t)))))
884 (native-inputs
885 `(("pkg-config" ,pkg-config)))
886 (inputs
887 `(("lcms" ,lcms)
888 ("libjpeg" ,libjpeg)
889 ("libmng" ,libmng)
890 ("libpng" ,libpng)
891 ("libtiff" ,libtiff)
892 ("openexr" ,openexr)
893 ("zlib" ,zlib)))
894 (synopsis "Library for manipulating many image formats")
895 (description "Developer's Image Library (DevIL) is a library to develop
896applications with support for many types of images. DevIL can load, save,
897convert, manipulate, filter and display a wide variety of image formats.")
898 (home-page "http://openil.sourceforge.net")
899 (license license:lgpl2.1+)))
b0b23e52
DT
900
901(define-public jasper
902 (package
903 (name "jasper")
aa6738dd 904 (version "2.0.12")
b0b23e52
DT
905 (source (origin
906 (method url-fetch)
907 (uri (string-append "https://www.ece.uvic.ca/~frodo/jasper"
b333d00c 908 "/software/jasper-" version ".tar.gz"))
b0b23e52
DT
909 (sha256
910 (base32
aa6738dd 911 "1njdbxv7d4anzrd476wjww2qsi96dd8vfnp4hri0srrqxpszl92v"))))
c7a70c33 912 (build-system cmake-build-system)
d87c201f 913 (inputs `(("libjpeg" ,libjpeg)))
b0b23e52
DT
914 (synopsis "JPEG-2000 library")
915 (description "The JasPer Project is an initiative to provide a reference
916implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
917ISO/IEC 15444-1).")
918 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
919 (license (license:x11-style "file://LICENSE"))))
365a4a7f
EF
920
921(define-public zimg
922 (package
923 (name "zimg")
8ee04627 924 (version "2.3")
365a4a7f
EF
925 (source
926 (origin
927 (method url-fetch)
928 (uri (string-append "https://github.com/sekrit-twc/zimg/archive/"
929 "release-" version ".tar.gz"))
930 (file-name (string-append name "-" version ".tar.gz"))
931 (sha256
932 (base32
8ee04627 933 "1yh6kkq8596a9cxcmcxzqvwbwmxwqapwsq31xpccznw6z62j75h9"))))
365a4a7f
EF
934 (build-system gnu-build-system)
935 (native-inputs
936 `(("autoconf" ,autoconf)
937 ("automake" ,automake)
938 ("libtool" ,libtool)))
939 (arguments
940 '(#:phases
941 (modify-phases %standard-phases
942 (add-after 'unpack 'autogen
943 (lambda _
944 (zero? (system* "sh" "autogen.sh")))))))
945 (synopsis "Scaling, colorspace conversion, and dithering library")
946 (description "Zimg implements the commonly required image processing basics
947of scaling, colorspace conversion, and depth conversion. A simple API enables
948conversion between any supported formats to operate with minimal knowledge from
949the programmer.")
950 (home-page "https://github.com/sekrit-twc/zimg")
8ee04627 951 ;; test/extra/ contains musl-libm,
365a4a7f
EF
952 ;; which is MIT/expat licensed, but only used for tests
953 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
af7aaaeb
TGR
954
955(define-public perceptualdiff
956 (package
957 (name "perceptualdiff")
958 (version "1.3")
959 (source
960 (origin
961 (method url-fetch)
962 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
963 version ".tar.gz"))
964 (file-name (string-append name "-" version ".tar.gz"))
965 (sha256
966 (base32
967 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
968 (build-system cmake-build-system)
969 (inputs `(("freeimage" ,freeimage)))
970 (arguments
971 '(#:phases (modify-phases %standard-phases
972 (add-after 'unpack 'fix-tests
973 ;; cmake-build-system uses a build/ directory outside
974 ;; of the source tree, one level higher than expected
975 (lambda _
976 (substitute* "test/run_tests.bash"
977 (("../build") "../../build")))))))
978 (home-page "https://github.com/myint/perceptualdiff")
979 (synopsis "Perceptual image comparison utility")
980 (description "PerceptualDiff visually compares two images to determine
981whether they look alike. It uses a computational model of the human visual
982system to detect similarities. This allows it too see beyond irrelevant
983differences in file encoding, image quality, and other small variations.")
984 (license license:gpl2+)))
1fa3e336
EB
985
986(define-public steghide
987 (package
988 (name "steghide")
989 (version "0.5.1")
990 (source (origin
991 (method url-fetch)
992 (uri (string-append "mirror://sourceforge/steghide/steghide/"
993 version "/steghide-" version ".tar.bz2"))
994 (sha256
995 (base32
996 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
997 (patches (list (search-patch "steghide-fixes.patch")))))
998 (build-system gnu-build-system)
999 (native-inputs
7c90d0f4 1000 `(("gettext" ,gettext-minimal)
1fa3e336
EB
1001 ("libtool" ,libtool)
1002 ("perl" ,perl))) ;for tests
1003 (inputs
1004 `(("libmhash" ,libmhash)
1005 ("libmcrypt" ,libmcrypt)
1006 ("libjpeg" ,libjpeg)
1007 ("zlib" ,zlib)))
1008 (arguments
1009 `(#:make-flags '("CXXFLAGS=-fpermissive"))) ;required for MHashPP.cc
1010 (home-page "http://steghide.sourceforge.net")
1011 (synopsis "Image and audio steganography")
1012 (description
1013 "Steghide is a steganography program that is able to hide data in various
1014kinds of image- and audio-files. The color- respectivly sample-frequencies
1015are not changed thus making the embedding resistant against first-order
1016statistical tests.")
1017 (license license:gpl2+)))
ac2a38a5
RW
1018
1019(define-public stb-image-for-extempore
1020 (let ((revision "1")
1021 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1022 (package
1023 (name "stb-image-for-extempore")
1024 (version (string-append "0-" revision "." (string-take commit 9)))
1025 (source
1026 (origin (method git-fetch)
1027 (uri (git-reference
1028 (url "https://github.com/extemporelang/stb.git")
1029 (commit commit)))
1030 (sha256
1031 (base32
1032 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1033 (file-name (string-append name "-" version "-checkout"))))
1034 (build-system cmake-build-system)
1035 (arguments `(#:tests? #f)) ; no tests included
39162ee4
RW
1036 ;; Extempore refuses to build on architectures other than x86_64
1037 (supported-systems '("x86_64-linux"))
ac2a38a5
RW
1038 (home-page "https://github.com/extemporelang/stb")
1039 (synopsis "Image library for Extempore")
1040 (description
1041 "This package is a collection of assorted single-file libraries. Of
1042all included libraries only the image loading and decoding library is
1043installed as @code{stb_image}.")
1044 (license license:public-domain))))
93117227
AI
1045
1046(define-public optipng
1047 (package
1048 (name "optipng")
1049 (version "0.7.6")
1050 (source
1051 (origin
1052 (method url-fetch)
1053 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1054 version ".tar.gz"))
1055 (sha256
1056 (base32
1057 "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
1058 (build-system gnu-build-system)
1059 (inputs
1060 `(("zlib" ,zlib)))
1061 (arguments
1062 '(#:phases
1063 (modify-phases %standard-phases
1064 ;; configure script does not accept arguments CONFIG_SHELL and SHELL
1065 (replace 'configure
1066 (lambda* (#:key outputs #:allow-other-keys)
1067 (zero? (system* "sh" "configure"
1068 (string-append "--prefix=" (assoc-ref outputs "out")))))))))
1069 (synopsis "Optimizer that recompresses PNG image files to a
1070smaller size")
1071 (description "OptiPNG is a PNG optimizer that recompresses image
1072files to a smaller size, without losing any information. This program
1073also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1074PNG, and performs PNG integrity checks and corrections.")
1075 (home-page "http://optipng.sourceforge.net/")
1076 (license license:zlib)))
37e05d64
TGR
1077
1078(define-public libjpeg-turbo
1079 (package
1080 (name "libjpeg-turbo")
1081 (version "1.5.1")
1082 (source (origin
1083 (method url-fetch)
1084 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1085 name "-" version ".tar.gz"))
1086 (sha256
1087 (base32
1088 "0v365hm6z6lddcqagjj15wflk66rqyw75m73cqzl65rh4lyrshj1"))))
1089 (build-system gnu-build-system)
1090 (native-inputs
1091 `(("nasm" ,nasm)))
1092 (arguments
e90a706e
EF
1093 '(#:test-target "test"
1094 #:phases
1095 (modify-phases %standard-phases
1096 (add-after 'unpack 'set-env-on-MIPS
1097 ;; This is borrowed from Debian's patchset for libjpeg
1098 ;; https://sources.debian.net/data/main/libj/libjpeg-turbo/1:1.5.1-2/debian/patches/0001-Declare-env-on-MIPS-on-first-use-Courtesy-of-Aurelie.patch
1099 (lambda _
1100 (substitute* "simd/jsimd_mips.c"
1101 (("env = getenv\\(\"JSIMD_FORCEDSPR2")
bee075e7 1102 "char *env = getenv(\"JSIMD_FORCEDSPR2"))
e90a706e 1103 #t)))))
37e05d64
TGR
1104 (home-page "http://www.libjpeg-turbo.org/")
1105 (synopsis "SIMD-accelerated JPEG image handling library")
1106 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1107JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1108x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1109its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1110a significant amount.
1111libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1112but more straightforward TurboJPEG API, and provides a full-featured Java
1113interface. It supports color space extensions that allow it to compress from
1114and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1115 (license (list license:bsd-3 ; jsimd*.[ch] and most of simd/
1116 license:ijg)))) ; the rest