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