Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / image.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2014, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
9 ;;; Copyright © 2014, 2017 John Darrington <jmd@gnu.org>
10 ;;; Copyright © 2016, 2017, 2018 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2016, 2017 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
17 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
18 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
19 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
20 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
21 ;;;
22 ;;; This file is part of GNU Guix.
23 ;;;
24 ;;; GNU Guix is free software; you can redistribute it and/or modify it
25 ;;; under the terms of the GNU General Public License as published by
26 ;;; the Free Software Foundation; either version 3 of the License, or (at
27 ;;; your option) any later version.
28 ;;;
29 ;;; GNU Guix is distributed in the hope that it will be useful, but
30 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ;;; GNU General Public License for more details.
33 ;;;
34 ;;; You should have received a copy of the GNU General Public License
35 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36
37 (define-module (gnu packages image)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages algebra)
40 #:use-module (gnu packages assembly)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages boost)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages documentation)
46 #:use-module (gnu packages fontutils)
47 ;; To provide gcc@5 and gcc@6, to work around <http://bugs.gnu.org/24703>.
48 #:use-module (gnu packages gcc)
49 #:use-module (gnu packages gettext)
50 #:use-module (gnu packages ghostscript)
51 #:use-module (gnu packages gl)
52 #:use-module (gnu packages glib)
53 #:use-module (gnu packages graphics)
54 #:use-module (gnu packages gtk)
55 #:use-module (gnu packages lua)
56 #:use-module (gnu packages maths)
57 #:use-module (gnu packages mcrypt)
58 #:use-module (gnu packages perl)
59 #:use-module (gnu packages photo)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages python)
62 #:use-module (gnu packages xml)
63 #:use-module (gnu packages xorg)
64 #:use-module (gnu packages qt)
65 #:use-module ((guix licenses) #:prefix license:)
66 #:use-module (guix packages)
67 #:use-module (guix download)
68 #:use-module (guix git-download)
69 #:use-module (guix build-system gnu)
70 #:use-module (guix build-system cmake)
71 #:use-module (guix build-system python)
72 #:use-module (guix build-system r)
73 #:use-module (guix build-system scons)
74 #:use-module (srfi srfi-1))
75
76 (define-public libpng
77 (package
78 (name "libpng")
79 (version "1.6.34")
80 (source (origin
81 (method url-fetch)
82 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
83 version "/libpng-" version ".tar.xz")
84 (string-append
85 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
86 "/libpng16/libpng-" version ".tar.xz")
87 (string-append
88 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
89 "/libpng16/libpng-" version ".tar.xz")))
90 (sha256
91 (base32
92 "1xjr0v34fyjgnhvaa1zixcpx5yvxcg4zwvfh0fyklfyfj86rc7ig"))))
93 (build-system gnu-build-system)
94
95 ;; libpng.la says "-lz", so propagate it.
96 (propagated-inputs `(("zlib" ,zlib)))
97
98 (synopsis "Library for handling PNG files")
99 (description
100 "Libpng is the official PNG (Portable Network Graphics) reference
101 library. It supports almost all PNG features and is extensible.")
102 (license license:zlib)
103 (home-page "http://www.libpng.org/pub/png/libpng.html")))
104
105 ;; libpng-apng should be updated when the APNG patch is released:
106 ;; <https://bugs.gnu.org/27556>
107 (define-public libpng-apng
108 (package
109 (name "libpng-apng")
110 (version "1.6.28")
111 (source
112 (origin
113 (method url-fetch)
114 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
115 version "/libpng-" version ".tar.xz")
116 (string-append
117 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
118 "/libpng16/libpng-" version ".tar.xz")
119 (string-append
120 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
121 "/libpng16/libpng-" version ".tar.xz")))
122 (sha256
123 (base32
124 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
125 (build-system gnu-build-system)
126 (arguments
127 `(#:modules ((guix build gnu-build-system)
128 (guix build utils)
129 (srfi srfi-1))
130 #:phases
131 (modify-phases %standard-phases
132 (add-after 'unpack 'patch-apng
133 (lambda* (#:key inputs #:allow-other-keys)
134 (define (apply-patch file)
135 (zero? (system* "patch" "-p1" "--force"
136 "--input" file)))
137 (let ((apng.gz (assoc-ref inputs "apng")))
138 (format #t "Applying APNG patch '~a'...~%"
139 apng.gz)
140 (and
141 (zero?
142 (system (string-append "gunzip < " apng.gz " > the-patch")))
143 (apply-patch "the-patch")))))
144 (add-before 'configure 'no-checks
145 (lambda _
146 (substitute* "Makefile.in"
147 (("^scripts/symbols.chk") "")
148 (("check: scripts/symbols.chk") ""))
149 #t)))))
150 (inputs
151 `(("apng" ,(origin
152 (method url-fetch)
153 (uri
154 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
155 version "/libpng-" version "-apng.patch.gz"))
156 (sha256
157 (base32
158 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
159 (native-inputs
160 `(("libtool" ,libtool)))
161 ;; libpng.la says "-lz", so propagate it.
162 (propagated-inputs
163 `(("zlib" ,zlib)))
164 (synopsis "APNG patch for libpng")
165 (description
166 "APNG (Animated Portable Network Graphics) is an unofficial
167 extension of the APNG (Portable Network Graphics) format.
168 APNG patch provides APNG support to libpng.")
169 (home-page "https://sourceforge.net/projects/libpng-apng/")
170 (license license:zlib)))
171
172 (define-public libpng-1.2
173 (package
174 (inherit libpng)
175 (version "1.2.59")
176 (source
177 (origin
178 (method url-fetch)
179 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
180 version "/libpng-" version ".tar.xz")
181 (string-append
182 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
183 "/libpng12/libpng-" version ".tar.xz")
184 (string-append
185 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
186 "/libpng12/libpng-" version ".tar.xz")))
187 (sha256
188 (base32
189 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
190
191 (define-public r-png
192 (package
193 (name "r-png")
194 (version "0.1-7")
195 (source (origin
196 (method url-fetch)
197 (uri (cran-uri "png" version))
198 (sha256
199 (base32
200 "0g2mcp55lvvpx4kd3mn225mpbxqcq73wy5qx8b4lyf04iybgysg2"))))
201 (build-system r-build-system)
202 (inputs
203 `(("libpng" ,libpng)
204 ("zlib" ,zlib)))
205 (home-page "http://www.rforge.net/png/")
206 (synopsis "Read and write PNG images")
207 (description
208 "This package provides an easy and simple way to read, write and display
209 bitmap images stored in the PNG format. It can read and write both files and
210 in-memory raw vectors.")
211 ;; Any of these GPL versions.
212 (license (list license:gpl2 license:gpl3))))
213
214 (define-public pngcrush
215 (package
216 (name "pngcrush")
217 (version "1.8.13")
218 (source (origin
219 (method url-fetch)
220 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
221 version "/pngcrush-" version "-nolib.tar.xz"))
222 (sha256 (base32
223 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
224 (build-system gnu-build-system)
225 (arguments
226 '(#:tests? #f ; no check target
227 #:phases
228 (modify-phases %standard-phases
229 (replace 'configure
230 (lambda* (#:key inputs outputs #:allow-other-keys)
231 (substitute* "Makefile"
232 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
233 (string-append vardef (assoc-ref inputs "libpng") "/"))
234 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
235 (string-append vardef (assoc-ref inputs "zlib") "/"))
236 ;; The Makefile is written by hand and not using $PREFIX
237 (("\\$\\(DESTDIR\\)/usr/")
238 (string-append (assoc-ref outputs "out") "/"))))))))
239 (inputs
240 `(("libpng" ,libpng)
241 ("zlib" , zlib)))
242 (home-page "https://pmt.sourceforge.io/pngcrush")
243 (synopsis "Utility to compress PNG files")
244 (description "pngcrusqh is an optimizer for PNG (Portable Network Graphics)
245 files. It can compress them as much as 40% losslessly.")
246 (license license:zlib)))
247
248 (define-public pngcrunch
249 ;; This package used to be wrongfully name "pngcrunch".
250 (deprecated-package "pngcrunch" pngcrush))
251
252 (define-public libjpeg
253 (package
254 (name "libjpeg")
255 (version "9b")
256 (source (origin
257 (method url-fetch)
258 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
259 version ".tar.gz"))
260 (sha256 (base32
261 "0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
262 (build-system gnu-build-system)
263 (synopsis "Library for handling JPEG files")
264 (description
265 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
266 JPEG is a standardized compression method for full-color and gray-scale
267 images.
268 The included programs provide conversion between the JPEG format and
269 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
270 (license license:ijg)
271 (home-page "http://www.ijg.org/")))
272
273 (define-public libjpeg-8
274 (package (inherit libjpeg)
275 (version "8d")
276 (source (origin
277 (method url-fetch)
278 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
279 version ".tar.gz"))
280 (sha256 (base32
281 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
282
283 (define-public libjxr
284 (package
285 (name "libjxr")
286 (version "1.1")
287 (source (origin
288 ;; We are using the Debian source because CodePlex does not
289 ;; deliver an easily downloadable tarball.
290 (method url-fetch)
291 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
292 version ".orig.tar.gz"))
293 (sha256
294 (base32
295 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
296 (patch-flags '("-p1" "--binary"))
297 (patches (search-patches "libjxr-fix-function-signature.patch"
298 "libjxr-fix-typos.patch"))))
299 (build-system gnu-build-system)
300 (arguments '(#:make-flags '("CC=gcc")
301 #:tests? #f ; no check target
302 #:phases
303 (modify-phases %standard-phases
304 (delete 'configure) ; no configure script
305 ;; The upstream makefile does not include an install phase.
306 (replace 'install
307 (lambda* (#:key outputs #:allow-other-keys)
308 (let* ((out (assoc-ref outputs "out"))
309 (bin (string-append out "/bin"))
310 (lib (string-append out "/lib"))
311 (include (string-append out "/include/jxrlib")))
312 (for-each (lambda (file)
313 (install-file file include)
314 (delete-file file))
315 (append
316 '("jxrgluelib/JXRGlue.h"
317 "jxrgluelib/JXRMeta.h"
318 "jxrtestlib/JXRTest.h"
319 "image/sys/windowsmediaphoto.h")
320 (find-files "common/include" "\\.h$")))
321 (for-each (lambda (file)
322 (install-file file lib)
323 (delete-file file))
324 (find-files "." "\\.a$"))
325 (for-each (lambda (file)
326 (install-file file bin)
327 (delete-file file))
328 '("JxrDecApp" "JxrEncApp")))
329 #t)))))
330 (synopsis "Implementation of the JPEG XR standard")
331 (description "JPEG XR is an approved ISO/IEC International standard (its
332 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
333 (license
334 (license:non-copyleft
335 "file://Makefile"
336 "See the header of the Makefile in the distribution."))
337 (home-page "https://jxrlib.codeplex.com/")))
338
339 (define-public jpegoptim
340 (package
341 (name "jpegoptim")
342 (version "1.4.5")
343 (source (origin
344 (method url-fetch)
345 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
346 version ".tar.gz"))
347 (sha256 (base32
348 "1mngi8c4mhzwa7i4wqrqq6i80cqj4adbacblfvk6dy573wywyxmi"))))
349 (build-system gnu-build-system)
350 (inputs `(("libjpeg" ,libjpeg)))
351 (arguments
352 ;; no tests
353 '(#:tests? #f))
354 (synopsis "Optimize JPEG images")
355 (description
356 "jpegoptim provides lossless optimization (based on optimizing
357 the Huffman tables) and \"lossy\" optimization based on setting
358 maximum quality factor.")
359 (license license:gpl2+)
360 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
361
362 (define-public libicns
363 (package
364 (name "libicns")
365 (version "0.8.1")
366 (source (origin
367 (method url-fetch)
368 (uri (string-append
369 "mirror://sourceforge/icns/"
370 "libicns-" version ".tar.gz"))
371 (sha256
372 (base32
373 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
374 (build-system gnu-build-system)
375 (inputs
376 `(("libpng" ,libpng)
377 ("jasper" ,jasper)))
378 (arguments
379 `(#:tests? #t)) ; No tests.
380 (home-page "http://icns.sourceforge.net/")
381 (synopsis "Library for handling Mac OS icns resource files")
382 (description
383 "Libicns is a library for the manipulation of Mac OS IconFamily resource
384 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
385 convert between PNG and ICNS. @command{icns2png} will extract image files from
386 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
387 with .desktop files. Additionally, @command{icontainer2png} is provided for
388 extracting icontainer icon files.")
389 (license (list license:lgpl2.1+ ; libicns
390 license:lgpl2.0+ ; src/apidocs.*
391 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
392
393 (define-public libtiff
394 (package
395 (name "libtiff")
396 (version "4.0.9")
397 (source
398 (origin
399 (method url-fetch)
400 (uri (string-append "http://download.osgeo.org/libtiff/tiff-"
401 version ".tar.gz"))
402 (sha256
403 (base32
404 "1kfg4q01r4mqn7dj63ifhi6pmqzbf4xax6ni6kkk81ri5kndwyvf"))
405 (patches (search-patches "libtiff-CVE-2017-9935.patch"
406 "libtiff-CVE-2017-18013.patch"))))
407 (build-system gnu-build-system)
408 (outputs '("out"
409 "doc")) ;1.3 MiB of HTML documentation
410 (arguments
411 ;; Instead of using --docdir, this package has its own --with-docdir.
412 `(#:configure-flags (list (string-append "--with-docdir="
413 (assoc-ref %outputs "doc")
414 "/share/doc/"
415 ,name "-" ,version))))
416 (inputs `(("zlib" ,zlib)
417 ("libjpeg" ,libjpeg)))
418 (synopsis "Library for handling TIFF files")
419 (description
420 "Libtiff provides support for the Tag Image File Format (TIFF), a format
421 used for storing image data.
422 Included are a library, libtiff, for reading and writing TIFF and a small
423 collection of tools for doing simple manipulations of TIFF images.")
424 (license (license:non-copyleft "file://COPYRIGHT"
425 "See COPYRIGHT in the distribution."))
426 (home-page "http://www.simplesystems.org/libtiff/")))
427
428 (define-public leptonica
429 (package
430 (name "leptonica")
431 (version "1.74.4")
432 (source
433 (origin
434 (method url-fetch)
435 (uri (string-append
436 "https://github.com/DanBloomberg/leptonica/archive/" version
437 ".tar.gz"))
438 (file-name (string-append "leptonica-" version ".tar.gz"))
439 (sha256
440 (base32 "10pw7pwccd0m0fc9rlrr2m41s7j1qvba2wcrav17pw1gclkf34i0"))))
441 (build-system gnu-build-system)
442 (native-inputs
443 `(("gnuplot" ,gnuplot) ;needed for test suite
444 ("autoconf" ,autoconf)
445 ("automake" ,automake)
446 ("libtool" ,libtool)
447 ("pkg-config" ,pkg-config)))
448 (inputs
449 `(("giflib" ,giflib)
450 ("libjpeg" ,libjpeg)
451 ("libpng" ,libpng)
452 ("libtiff" ,libtiff)
453 ("libwebp" ,libwebp)))
454 (propagated-inputs
455 ;; Linking a program with leptonica also requires these.
456 `(("openjpeg" ,openjpeg)
457 ("zlib" ,zlib)))
458 (arguments
459 '(#:phases
460 (modify-phases %standard-phases
461 (add-after 'unpack 'autogen
462 (lambda _
463 (zero? (system* "sh" "autobuild"))))
464 (add-after 'unpack 'patch-reg-wrapper
465 (lambda _
466 (substitute* "prog/reg_wrapper.sh"
467 ((" /bin/sh ")
468 (string-append " " (which "sh") " "))
469 (("which gnuplot")
470 "true")))))))
471 (home-page "http://www.leptonica.com/")
472 (synopsis "Library and tools for image processing and analysis")
473 (description
474 "Leptonica is a C library and set of command-line tools for efficient
475 image processing and image analysis operations. It supports rasterop, affine
476 transformations, binary and grayscale morphology, rank order, and convolution,
477 seedfill and connected components, image transformations combining changes in
478 scale and pixel depth, and pixelwise masking, blending, enhancement, and
479 arithmetic ops.")
480 (license license:bsd-2)))
481
482 (define-public jbig2dec
483 (package
484 (name "jbig2dec")
485 (version "0.14")
486 (source
487 (origin
488 (method url-fetch)
489 (uri (string-append "http://downloads.ghostscript.com/public/" name "/"
490 name "-" version ".tar.gz"))
491 (sha256
492 (base32 "0k01hp0q4275fj4rbr1gy64svfraw5w7wvwl08yjhvsnpb1rid11"))
493 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
494 (build-system gnu-build-system)
495 (synopsis "Decoder of the JBIG2 image compression format")
496 (description
497 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
498 monochrome) images at moderately high resolution, and in particular scanned
499 paper documents. In this domain it is very efficient, offering compression
500 ratios on the order of 100:1.
501
502 This is a decoder only implementation, and currently is in the alpha
503 stage, meaning it doesn't completely work yet. However, it is
504 maintaining parity with available encoders, so it is useful for real
505 work.")
506 (home-page "http://www.ghostscript.com/jbig2dec.html")
507 (license license:gpl2+)))
508
509 (define-public openjpeg
510 (package
511 (name "openjpeg")
512 (version "2.3.0")
513 (source
514 (origin
515 (method url-fetch)
516 (uri
517 (string-append "https://github.com/uclouvain/openjpeg/archive/v"
518 version ".tar.gz"))
519 (file-name (string-append name "-" version ".tar.gz"))
520 (sha256
521 (base32
522 "06npqzkg20avnygdwaqpap91r7qpdqgrn39adj2bl8v0pg0qgirx"))))
523 (build-system cmake-build-system)
524 (arguments
525 ;; Trying to run `$ make check' results in a no rule fault.
526 '(#:tests? #f))
527 (inputs
528 `(("lcms" ,lcms)
529 ("libpng" ,libpng)
530 ("libtiff" ,libtiff)
531 ("zlib" ,zlib)))
532 (synopsis "JPEG 2000 codec")
533 (description
534 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
535 been developed in order to promote the use of JPEG 2000, the new
536 still-image compression standard from the Joint Photographic Experts
537 Group (JPEG).
538
539 In addition to the basic codec, various other features are under
540 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
541 an indexing tool useful for the JPIP protocol, JPWL-tools for
542 error-resilience, a Java-viewer for j2k-images, ...")
543 (home-page "https://github.com/uclouvain/openjpeg")
544 (license license:bsd-2)))
545
546 (define-public openjpeg-1
547 (package (inherit openjpeg)
548 (name "openjpeg")
549 (version "1.5.2")
550 (source
551 (origin
552 (method url-fetch)
553 (uri
554 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
555 name "-" version ".tar.gz"))
556 (sha256
557 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
558
559 (define-public giflib
560 (package
561 (name "giflib")
562 (version "5.1.4")
563 (source (origin
564 (method url-fetch)
565 (uri (string-append "mirror://sourceforge/giflib/giflib-"
566 version ".tar.bz2"))
567 (sha256
568 (base32
569 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))
570 (patches (search-patches
571 "giflib-make-reallocarray-private.patch"))))
572 (build-system gnu-build-system)
573 (outputs '("bin" ; utility programs
574 "out")) ; library
575 (inputs `(("libx11" ,libx11)
576 ("libice" ,libice)
577 ("libsm" ,libsm)
578 ("perl" ,perl)))
579 (arguments
580 `(#:phases
581 (modify-phases %standard-phases
582 (add-after 'unpack 'disable-html-doc-gen
583 (lambda _
584 (substitute* "doc/Makefile.in"
585 (("^all: allhtml manpages") ""))
586 #t))
587 (add-after 'install 'install-manpages
588 (lambda* (#:key outputs #:allow-other-keys)
589 (let* ((bin (assoc-ref outputs "bin"))
590 (man1dir (string-append bin "/share/man/man1")))
591 (mkdir-p man1dir)
592 (for-each (lambda (file)
593 (let ((base (basename file)))
594 (format #t "installing `~a' to `~a'~%"
595 base man1dir)
596 (copy-file file
597 (string-append
598 man1dir "/" base))))
599 (find-files "doc" "\\.1"))
600 #t))))))
601 (synopsis "Tools and library for working with GIF images")
602 (description
603 "GIFLIB is a library for reading and writing GIF images. It is API and
604 ABI compatible with libungif which was in wide use while the LZW compression
605 algorithm was patented. Tools are also included to convert, manipulate,
606 compose, and analyze GIF images.")
607 (home-page "http://giflib.sourceforge.net/")
608 (license license:x11)))
609
610 (define-public libungif
611 (package
612 (name "libungif")
613 (version "4.1.4")
614 (source (origin
615 (method url-fetch)
616 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
617 "libungif-" version "/libungif-"
618 version ".tar.bz2"))
619 (sha256
620 (base32
621 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
622 (build-system gnu-build-system)
623 (inputs `(("perl" ,perl))) ;package ships some perl tools
624 (home-page "http://giflib.sourceforge.net/")
625 (synopsis "GIF decompression library")
626 (description
627 "libungif is the old GIF decompression library by the GIFLIB project.")
628 (license license:expat)))
629
630 (define-public imlib2
631 (package
632 (name "imlib2")
633 (version "1.5.1")
634 (source (origin
635 (method url-fetch)
636 (uri (string-append
637 "mirror://sourceforge/enlightenment/imlib2-src/" version
638 "/imlib2-" version ".tar.bz2"))
639 (sha256
640 (base32
641 "1bms2iwmvnvpz5jqq3r52glarqkafif47zbh1ykz8hw85d2mfkps"))))
642 (build-system gnu-build-system)
643 (native-inputs
644 `(("pkgconfig" ,pkg-config)))
645 (inputs
646 `(("libx11" ,libx11)
647 ("libxext" ,libxext)
648 ("freetype" ,freetype)
649 ("libjpeg" ,libjpeg)
650 ("libpng" ,libpng)
651 ("libtiff" ,libtiff)
652 ("giflib" ,giflib)
653 ("bzip2" ,bzip2)))
654 (home-page "https://sourceforge.net/projects/enlightenment/")
655 (synopsis
656 "Loading, saving, rendering and manipulating image files")
657 (description
658 "Imlib2 is a library that does image file loading and saving as well as
659 rendering, manipulation, arbitrary polygon support, etc.
660
661 It does ALL of these operations FAST. Imlib2 also tries to be highly
662 intelligent about doing them, so writing naive programs can be done easily,
663 without sacrificing speed.
664
665 This is a complete rewrite over the Imlib 1.x series. The architecture is
666 more modular, simple, and flexible.")
667 (license license:imlib2)))
668
669 (define-public giblib
670 (package
671 (name "giblib")
672 (version "1.2.4")
673 (source (origin
674 (method url-fetch)
675 (uri (list
676 (string-append
677 "http://linuxbrit.co.uk/downloads/giblib-"
678 version ".tar.gz")
679 (string-append
680 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
681 "files/giblib/giblib-" version ".tar.gz")))
682 (sha256
683 (base32
684 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
685 (build-system gnu-build-system)
686 (inputs
687 `(("libx11" ,libx11)
688 ("imlib2" ,imlib2)))
689 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
690 (synopsis "Wrapper library for imlib2")
691 (description
692 "Giblib is a simple library which wraps imlib2's context API, avoiding
693 all the context_get/set calls, adds fontstyles to the truetype renderer and
694 supplies a generic doubly-linked list and some string functions.")
695 ;; This license removes a clause about X Consortium from the original
696 ;; X11 license.
697 (license (license:x11-style "file://COPYING"
698 "See 'COPYING' in the distribution."))))
699
700 (define-public freeimage
701 (package
702 (name "freeimage")
703 (version "3.17.0")
704 (source (origin
705 (method url-fetch)
706 (uri (string-append
707 "mirror://sourceforge/freeimage/Source%20Distribution/"
708 version "/FreeImage"
709 (string-concatenate (string-split version #\.))
710 ".zip"))
711 (sha256
712 (base32
713 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
714 (modules '((guix build utils)))
715 (snippet
716 '(begin
717 (for-each
718 (lambda (dir)
719 (delete-file-recursively (string-append "Source/" dir)))
720 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
721 ;; "LibJXR"
722 "LibWebP" "OpenEXR" "ZLib"))))
723 (patches (search-patches "freeimage-unbundle.patch"
724 "freeimage-CVE-2015-0852.patch"
725 "freeimage-CVE-2016-5684.patch"
726 "freeimage-fix-build-with-gcc-5.patch"))))
727 (build-system gnu-build-system)
728 (arguments
729 '(#:phases
730 (modify-phases %standard-phases
731 ;; According to Fedora these files depend on private headers, but their
732 ;; presence is required for building, so we replace them with empty files.
733 (add-after 'unpack 'delete-unbuildable-files
734 (lambda _
735 (for-each (lambda (file)
736 (delete-file file)
737 (close (open file O_CREAT)))
738 '("Source/FreeImage/PluginG3.cpp"
739 "Source/FreeImageToolkit/JPEGTransform.cpp"))
740 #t))
741 ;; These scripts generate the Makefiles.
742 (replace 'configure
743 (lambda _
744 (invoke "sh" "gensrclist.sh")
745 (invoke "sh" "genfipsrclist.sh")))
746 (add-before 'build 'patch-makefile
747 (lambda* (#:key outputs #:allow-other-keys)
748 (substitute* "Makefile.gnu"
749 (("/usr") (assoc-ref outputs "out"))
750 (("-o root -g root") ""))
751 #t)))
752 #:make-flags
753 (list "CC=gcc"
754 ;; We need '-fpermissive' for Source/FreeImage.h.
755 ;; libjxr doesn't have a pkg-config file.
756 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
757 ;"-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"
758 ))
759 #:tests? #f)) ; no check target
760 (native-inputs
761 `(("pkg-config" ,pkg-config)
762 ("unzip" ,unzip)))
763 (inputs
764 `(("libjpeg" ,libjpeg)
765 ;("libjxr" ,libjxr)
766 ("libpng" ,libpng)
767 ("libraw" ,libraw)
768 ("libtiff" ,libtiff)
769 ("libwebp" ,libwebp)
770 ("openexr" ,openexr)
771 ("openjpeg" ,openjpeg)
772 ("zlib" ,zlib)))
773 (synopsis "Library for handling popular graphics image formats")
774 (description
775 "FreeImage is a library for developers who would like to support popular
776 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
777 (license license:gpl2+)
778 (home-page "http://freeimage.sourceforge.net")))
779
780 (define-public vigra
781 (package
782 (name "vigra")
783 (version "1.11.1")
784 (source
785 (origin
786 (method url-fetch)
787 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
788 "Version-" (string-join (string-split version #\.) "-")
789 "/vigra-" version "-src.tar.gz"))
790 (sha256 (base32
791 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
792 (build-system cmake-build-system)
793 (inputs
794 `(("boost" ,boost)
795 ("fftw" ,fftw)
796 ("fftwf" ,fftwf)
797 ("hdf5" ,hdf5)
798 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
799 ; to create a configure-flag
800 ("libjpeg" ,libjpeg)
801 ("libpng" ,libpng)
802 ("libtiff" ,libtiff)
803 ("openexr" ,openexr)
804 ("python" ,python-2) ; print syntax
805 ("python2-numpy" ,python2-numpy)
806 ("zlib" ,zlib)))
807 (native-inputs
808 `(("doxygen" ,doxygen)
809 ("python2-nose" ,python2-nose)
810 ("python2-sphinx" ,python2-sphinx)))
811 (arguments
812 `(#:test-target "check"
813 #:parallel-build? #f ; parallel builds trigger an ICE
814 #:configure-flags
815 (list "-Wno-dev" ; suppress developer mode with lots of warnings
816 (string-append "-DVIGRANUMPY_INSTALL_DIR="
817 (assoc-ref %outputs "out")
818 "/lib/python2.7/site-packages")
819 ;; OpenEXR is not enabled by default.
820 "-DWITH_OPENEXR=1"
821 ;; Fix rounding error on 32-bit machines
822 "-DCMAKE_C_FLAGS=-ffloat-store"
823 ;; The header files of ilmbase are not found when included
824 ;; by the header files of openexr, and an explicit flag
825 ;; needs to be set.
826 (string-append "-DCMAKE_CXX_FLAGS=-I"
827 (assoc-ref %build-inputs "ilmbase")
828 "/include/OpenEXR"
829 " -ffloat-store"))))
830 (synopsis "Computer vision library")
831 (description
832 "VIGRA stands for Vision with Generic Algorithms. It is an image
833 processing and analysis library that puts its main emphasis on customizable
834 algorithms and data structures. It is particularly strong for
835 multi-dimensional image processing.")
836 (license license:expat)
837 (home-page "https://ukoethe.github.io/vigra/")))
838
839 (define-public vigra-c
840 (let* ((commit "a2ff675f42079e2623318d8ff8b4288dbe7a7f06")
841 (revision "0")
842 (version (git-version "0.0.0" revision commit)))
843 (package
844 (name "vigra-c")
845 (version version)
846 (home-page "https://github.com/BSeppke/vigra_c")
847 (source (origin
848 (method git-fetch)
849 (uri (git-reference
850 (url home-page)
851 (commit commit)))
852 (sha256
853 (base32
854 "1f1phmfbbz3dsq9330rd6bjmdg29hxskxi9l17cyx1f4mdqpgdgl"))
855 (file-name (git-file-name name version))))
856 (build-system cmake-build-system)
857 (arguments
858 `(#:tests? #f)) ; No test target.
859 (native-inputs
860 `(("doxygen" ,doxygen)))
861 (inputs
862 `(("fftw" ,fftw)
863 ("fftwf" ,fftwf)
864 ("vigra" ,vigra)))
865 (synopsis "C interface to the VIGRA computer vision library")
866 (description
867 "This package provides a C interface to the VIGRA C++ computer vision
868 library. It is designed primarily to ease the implementation of higher-level
869 language bindings to VIGRA.")
870 (license license:expat))))
871
872 (define-public libwebp
873 (package
874 (name "libwebp")
875 (version "1.0.0")
876 (source
877 (origin
878 ;; No tarballs are provided for >0.6.1.
879 (method git-fetch)
880 (uri (git-reference
881 (url "https://chromium.googlesource.com/webm/libwebp")
882 (commit (string-append "v" version))))
883 (file-name (git-file-name name version))
884 (sha256
885 (base32
886 "1w8jzdbr1s4238ygyrlxryycss3f2z6d9amxdq8m82nl3l6skar4"))))
887 (build-system gnu-build-system)
888 (inputs
889 `(("freeglut" ,freeglut)
890 ("giflib" ,giflib)
891 ("libjpeg" ,libjpeg)
892 ("libpng" ,libpng)
893 ("libtiff" ,libtiff)))
894 (native-inputs
895 `(("autoconf" ,autoconf)
896 ("automake" ,automake)
897 ("libtool" ,libtool)))
898 (arguments
899 '(#:configure-flags '("--enable-libwebpmux"
900 "--enable-libwebpdemux"
901 "--enable-libwebpdecoder")
902 #:phases (modify-phases %standard-phases
903 (add-after 'unpack 'bootstrap
904 (lambda _
905 (invoke "autoreconf" "-vif"))))))
906 (home-page "https://developers.google.com/speed/webp/")
907 (synopsis "Lossless and lossy image compression")
908 (description
909 "WebP is a new image format that provides lossless and lossy compression
910 for images. WebP lossless images are 26% smaller in size compared to
911 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
912 equivalent SSIM index. WebP supports lossless transparency (also known as
913 alpha channel) with just 22% additional bytes. Transparency is also supported
914 with lossy compression and typically provides 3x smaller file sizes compared
915 to PNG when lossy compression is acceptable for the red/green/blue color
916 channels.")
917 (license license:bsd-3)))
918
919 (define-public libmng
920 (package
921 (name "libmng")
922 (version "2.0.3")
923 (source (origin
924 (method url-fetch)
925 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
926 version "/" name "-" version ".tar.xz"))
927 (sha256
928 (base32
929 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
930 (build-system gnu-build-system)
931 (propagated-inputs
932 ;; These are all in the 'Libs.private' field of libmng.pc.
933 `(("lcms" ,lcms)
934 ("libjpeg" ,libjpeg)
935 ("zlib" ,zlib)))
936 (home-page "http://www.libmng.com/")
937 (synopsis "Library for handling MNG files")
938 (description
939 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
940 (license license:bsd-3)))
941
942 (define-public exiv2
943 (package
944 (name "exiv2")
945 (version "0.26")
946 (source (origin
947 (method url-fetch)
948 (uri (list (string-append "http://www.exiv2.org/builds/exiv2-"
949 version "-trunk.tar.gz")
950 (string-append "http://www.exiv2.org/exiv2-"
951 version ".tar.gz")
952 (string-append "https://fossies.org/linux/misc/exiv2-"
953 version ".tar.gz")))
954 (patches (search-patches "exiv2-CVE-2017-14860.patch"
955 "exiv2-CVE-2017-14859-14862-14864.patch"))
956 (sha256
957 (base32
958 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
959 (build-system gnu-build-system)
960 (arguments '(#:tests? #f)) ; no `check' target
961 (propagated-inputs
962 `(("expat" ,expat)
963 ("zlib" ,zlib)))
964 (native-inputs
965 `(("intltool" ,intltool)))
966 (home-page "http://www.exiv2.org/")
967 (synopsis "Library and command-line utility to manage image metadata")
968 (description
969 "Exiv2 is a C++ library and a command line utility to manage image
970 metadata. It provides fast and easy read and write access to the Exif, IPTC
971 and XMP metadata of images in various formats.")
972
973 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
974 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
975 ;; The core is GPLv2+:
976 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
977 (license license:gpl2+)))
978
979 (define-public devil
980 (package
981 (name "devil")
982 (version "1.8.0")
983 (source (origin
984 (method url-fetch)
985 (uri (string-append "http://downloads.sourceforge.net/openil/"
986 "DevIL-" version ".tar.gz"))
987 (sha256
988 (base32
989 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
990 (build-system cmake-build-system)
991 (arguments
992 '(;; XXX: Not supported in the released CMakeLists.txt.
993 ;; Enable this for > 1.8.0.
994 #:tests? #f
995 #:phases
996 (modify-phases %standard-phases
997 (add-before 'configure 'change-directory
998 (lambda _ (chdir "DevIL") #t)))))
999 (native-inputs
1000 `(("pkg-config" ,pkg-config)))
1001 (inputs
1002 `(("lcms" ,lcms)
1003 ("libjpeg" ,libjpeg-turbo)
1004 ("libmng" ,libmng)
1005 ("libpng" ,libpng)
1006 ("libtiff" ,libtiff)
1007 ("openexr" ,openexr)
1008 ("zlib" ,zlib)))
1009 (synopsis "Library for manipulating many image formats")
1010 (description "Developer's Image Library (DevIL) is a library to develop
1011 applications with support for many types of images. DevIL can load, save,
1012 convert, manipulate, filter and display a wide variety of image formats.")
1013 (home-page "http://openil.sourceforge.net")
1014 (license license:lgpl2.1+)))
1015
1016 (define-public jasper
1017 (package
1018 (name "jasper")
1019 (version "2.0.14")
1020 (source (origin
1021 (method url-fetch)
1022 (uri (string-append "https://github.com/mdadams/jasper/archive/"
1023 "version-" version ".tar.gz"))
1024 (file-name (string-append name "-" version ".tar.gz"))
1025 (sha256
1026 (base32
1027 "0yx9y5y0g6jv142vnqp50j3k8k5yqznz3smrblv192wgfbm6w9l5"))))
1028 (build-system cmake-build-system)
1029 (inputs `(("libjpeg" ,libjpeg)))
1030 (synopsis "JPEG-2000 library")
1031 (description "The JasPer Project is an initiative to provide a reference
1032 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1033 ISO/IEC 15444-1).")
1034 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1035 (license (license:x11-style "file://LICENSE"))))
1036
1037 (define-public zimg
1038 (package
1039 (name "zimg")
1040 (version "2.5")
1041 (source
1042 (origin
1043 (method url-fetch)
1044 (uri (string-append "https://github.com/sekrit-twc/zimg/archive/"
1045 "release-" version ".tar.gz"))
1046 (file-name (string-append name "-" version ".tar.gz"))
1047 (sha256
1048 (base32
1049 "0kbq2dy659645fmgxpzg38b6y6x82kwkydhc380kdkaikv2brcjh"))))
1050 (build-system gnu-build-system)
1051 (native-inputs
1052 `(("autoconf" ,autoconf)
1053 ("automake" ,automake)
1054 ("libtool" ,libtool)))
1055 (arguments
1056 '(#:phases
1057 (modify-phases %standard-phases
1058 (add-after 'unpack 'autogen
1059 (lambda _
1060 (zero? (system* "sh" "autogen.sh")))))))
1061 (synopsis "Scaling, colorspace conversion, and dithering library")
1062 (description "Zimg implements the commonly required image processing basics
1063 of scaling, colorspace conversion, and depth conversion. A simple API enables
1064 conversion between any supported formats to operate with minimal knowledge from
1065 the programmer.")
1066 (home-page "https://github.com/sekrit-twc/zimg")
1067 ;; test/extra/ contains musl-libm,
1068 ;; which is MIT/expat licensed, but only used for tests
1069 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
1070
1071 (define-public perceptualdiff
1072 (package
1073 (name "perceptualdiff")
1074 (version "1.3")
1075 (source
1076 (origin
1077 (method url-fetch)
1078 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
1079 version ".tar.gz"))
1080 (file-name (string-append name "-" version ".tar.gz"))
1081 (sha256
1082 (base32
1083 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
1084 (build-system cmake-build-system)
1085 (inputs `(("freeimage" ,freeimage)))
1086 (arguments
1087 '(#:phases (modify-phases %standard-phases
1088 (add-after 'unpack 'fix-tests
1089 ;; cmake-build-system uses a build/ directory outside
1090 ;; of the source tree, one level higher than expected
1091 (lambda _
1092 (substitute* "test/run_tests.bash"
1093 (("../build") "../../build")))))))
1094 (home-page "https://github.com/myint/perceptualdiff")
1095 (synopsis "Perceptual image comparison utility")
1096 (description "PerceptualDiff visually compares two images to determine
1097 whether they look alike. It uses a computational model of the human visual
1098 system to detect similarities. This allows it too see beyond irrelevant
1099 differences in file encoding, image quality, and other small variations.")
1100 (license license:gpl2+)))
1101
1102 (define-public steghide
1103 (package
1104 (name "steghide")
1105 (version "0.5.1")
1106 (source (origin
1107 (method url-fetch)
1108 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1109 version "/steghide-" version ".tar.bz2"))
1110 (sha256
1111 (base32
1112 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1113 (patches (list (search-patch "steghide-fixes.patch")))))
1114 (build-system gnu-build-system)
1115 (native-inputs
1116 `(("gettext" ,gettext-minimal)
1117 ("libtool" ,libtool)
1118 ("perl" ,perl))) ;for tests
1119 (inputs
1120 `(("libmhash" ,libmhash)
1121 ("libmcrypt" ,libmcrypt)
1122 ("libjpeg" ,libjpeg)
1123 ("zlib" ,zlib)))
1124 (arguments
1125 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1126
1127 #:phases (modify-phases %standard-phases
1128 (add-before 'configure 'set-perl-search-path
1129 (lambda _
1130 ;; Work around "dotless @INC" build failure.
1131 (setenv "PERL5LIB"
1132 (string-append (getcwd) "/tests:"
1133 (getenv "PERL5LIB")))
1134 #t)))))
1135 (home-page "http://steghide.sourceforge.net")
1136 (synopsis "Image and audio steganography")
1137 (description
1138 "Steghide is a program to hide data in various kinds of image and audio
1139 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1140 changed, making the embedding resistant against first-order statistical tests.")
1141 (license license:gpl2+)))
1142
1143 (define-public stb-image-for-extempore
1144 (let ((revision "1")
1145 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1146 (package
1147 (name "stb-image-for-extempore")
1148 (version (string-append "0-" revision "." (string-take commit 9)))
1149 (source
1150 (origin (method git-fetch)
1151 (uri (git-reference
1152 (url "https://github.com/extemporelang/stb.git")
1153 (commit commit)))
1154 (sha256
1155 (base32
1156 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1157 (file-name (string-append name "-" version "-checkout"))))
1158 (build-system cmake-build-system)
1159 (arguments `(#:tests? #f)) ; no tests included
1160 ;; Extempore refuses to build on architectures other than x86_64
1161 (supported-systems '("x86_64-linux"))
1162 (home-page "https://github.com/extemporelang/stb")
1163 (synopsis "Image library for Extempore")
1164 (description
1165 "This package is a collection of assorted single-file libraries. Of
1166 all included libraries only the image loading and decoding library is
1167 installed as @code{stb_image}.")
1168 (license license:public-domain))))
1169
1170 (define-public optipng
1171 (package
1172 (name "optipng")
1173 (version "0.7.7")
1174 (source
1175 (origin
1176 (method url-fetch)
1177 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1178 version ".tar.gz"))
1179 (sha256
1180 (base32
1181 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))))
1182 (build-system gnu-build-system)
1183 (inputs
1184 `(("zlib" ,zlib)))
1185 (arguments
1186 '(#:phases
1187 (modify-phases %standard-phases
1188 (replace 'configure
1189 (lambda* (#:key outputs #:allow-other-keys)
1190 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1191 (invoke "sh" "configure"
1192 (string-append "--prefix=" (assoc-ref outputs "out")))
1193 #t)))))
1194 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1195 (description "OptiPNG is a PNG optimizer that recompresses image
1196 files to a smaller size, without losing any information. This program
1197 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1198 PNG, and performs PNG integrity checks and corrections.")
1199 (home-page "http://optipng.sourceforge.net/")
1200 (license license:zlib)))
1201
1202 (define-public libjpeg-turbo
1203 (package
1204 (name "libjpeg-turbo")
1205 (version "1.5.3")
1206 (source (origin
1207 (method url-fetch)
1208 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1209 name "-" version ".tar.gz"))
1210 (sha256
1211 (base32
1212 "08r5b5mywwrxv4axvq80dm31cklz81grczlzlxr2xqa6pgi90j5j"))))
1213 (build-system gnu-build-system)
1214 (native-inputs
1215 `(("nasm" ,nasm)))
1216 (arguments
1217 '(#:test-target "test"
1218 #:configure-flags (list "--with-build-date=1970-01-01")))
1219 (home-page "http://www.libjpeg-turbo.org/")
1220 (synopsis "SIMD-accelerated JPEG image handling library")
1221 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1222 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1223 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1224 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1225 a significant amount.
1226 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1227 but more straightforward TurboJPEG API, and provides a full-featured Java
1228 interface. It supports color space extensions that allow it to compress from
1229 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1230 (license (list license:bsd-3 ; jsimd*.[ch] and most of simd/
1231 license:ijg)))) ; the rest
1232
1233 (define-public niftilib
1234 (package
1235 (name "niftilib")
1236 (version "2.0.0")
1237 (source (origin
1238 (method url-fetch)
1239 (uri (list (string-append "mirror://sourceforge/niftilib/"
1240 "nifticlib/nifticlib_"
1241 (string-join (string-split version #\.) "_")
1242 "/nifticlib-" version ".tar.gz")))
1243 (sha256
1244 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1245 (build-system gnu-build-system)
1246 (arguments
1247 '(#:tests? #f ; there is no test target
1248 #:parallel-build? #f ; not supported
1249 #:make-flags
1250 (list "SHELL=bash"
1251 (string-append "ZLIB_INC="
1252 (assoc-ref %build-inputs "zlib") "/include")
1253 ;; Append "-fPIC" to CFLAGS.
1254 (string-append "CFLAGS="
1255 "-Wall -ansi -pedantic -fPIC"))
1256 #:phases
1257 (modify-phases %standard-phases
1258 (replace 'install
1259 (lambda* (#:key outputs #:allow-other-keys)
1260 (let ((out (assoc-ref outputs "out")))
1261 (for-each
1262 (lambda (dir)
1263 (copy-recursively dir (string-append out "/" dir)))
1264 '("bin" "lib" "include")))
1265 #t))
1266 (delete 'configure))))
1267 (inputs
1268 `(("zlib" ,zlib)))
1269 (synopsis "Library for reading and writing files in the nifti-1 format")
1270 (description "Niftilib is a set of i/o libraries for reading and writing
1271 files in the nifti-1 data format - a binary file format for storing
1272 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1273 (fMRI) brain images.")
1274 (home-page "http://niftilib.sourceforge.net")
1275 (license license:public-domain)))
1276
1277 (define-public gpick
1278 (package
1279 (name "gpick")
1280 (version "0.2.5")
1281 (source (origin
1282 (method url-fetch)
1283 (uri (string-append "https://github.com/thezbyg/gpick/archive/"
1284 name "-" version ".tar.gz"))
1285 (sha256
1286 (base32
1287 "0mxvxk15xhk2i5vfavjhnkk4j3bnii0gpf8di14rlbpq070hd5rs"))))
1288 (build-system scons-build-system)
1289 (native-inputs
1290 `(("boost" ,boost)
1291 ("gettext" ,gnu-gettext)
1292 ("pkg-config" ,pkg-config)))
1293 (inputs
1294 `(("expat" ,expat)
1295 ("gtk2" ,gtk+-2)
1296 ("lua" ,lua-5.2)))
1297 (arguments
1298 `(#:tests? #f
1299 #:scons ,scons-python2
1300 #:scons-flags (list (string-append "DESTDIR=" %output))
1301 #:phases
1302 (modify-phases %standard-phases
1303 (add-before 'build 'fix-lua-reference
1304 (lambda _
1305 (substitute* "SConscript"
1306 (("lua5.2") "lua-5.2"))
1307 #t)))))
1308 (home-page "http://www.gpick.org/")
1309 (synopsis "Color picker")
1310 (description "Gpick is an advanced color picker and palette editing tool.")
1311 (license license:bsd-3)))
1312
1313 (define-public libiptcdata
1314 (package
1315 (name "libiptcdata")
1316 (version "1.0.4")
1317 (source (origin
1318 (method url-fetch)
1319 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1320 version "/" name "-" version ".tar.gz"))
1321 (sha256
1322 (base32
1323 "03pfvkmmx762iydq0q207x2028d275pbdysfsgpmrr0ywy63pxkr"))))
1324 (build-system gnu-build-system)
1325 (home-page "http://libiptcdata.sourceforge.net/")
1326 (synopsis "IPTC metadata manipulation library")
1327 (description "Libiptcdata is a C library for manipulating the International
1328 Press Telecommunications Council (IPTC) metadata stored within multimedia files
1329 such as images. This metadata can include captions and keywords, often used by
1330 popular photo management applications. The library provides routines for
1331 parsing, viewing, modifying, and saving this metadata.")
1332 (license license:lgpl2.0+)))
1333
1334 (define-public flameshot
1335 (package
1336 (name "flameshot")
1337 (version "0.5.1")
1338 (source
1339 (origin
1340 (method url-fetch)
1341 (uri (string-append "https://github.com/lupoDharkael/flameshot/archive/"
1342 "v" version ".tar.gz"))
1343 (file-name (string-append name "-" version ".tar.gz"))
1344 (sha256
1345 (base32
1346 "0kp451bqgssvg8n3sg60s3fifplm9l5kxiij0yxkl864p2mhw8im"))))
1347 (build-system gnu-build-system)
1348 (native-inputs
1349 `(("qttools" ,qttools)))
1350 (inputs
1351 `(("qtbase" ,qtbase)))
1352 (arguments
1353 `(#:tests? #f ; no tests
1354 #:phases
1355 (modify-phases %standard-phases
1356 (replace 'configure
1357 (lambda* (#:key outputs #:allow-other-keys)
1358 (invoke "qmake"
1359 "CONFIG+=packaging"
1360 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1361 "PREFIX=/"))))))
1362 (home-page "https://github.com/lupoDharkael/flameshot")
1363 (synopsis "Powerful yet simple to use screenshot software")
1364 (description "Flameshot is a screenshot program.
1365 Features:
1366
1367 @itemize
1368 @item Customizable appearance.
1369 @item Easy to use.
1370 @item In-app screenshot edition.
1371 @item DBus interface.
1372 @item Upload to Imgur.
1373 @end itemize\n")
1374 (license license:gpl3+)))
1375
1376 (define-public r-jpeg
1377 (package
1378 (name "r-jpeg")
1379 (version "0.1-8")
1380 (source
1381 (origin
1382 (method url-fetch)
1383 (uri (cran-uri "jpeg" version))
1384 (sha256
1385 (base32
1386 "05hawv5qcb82ljc1l2nchx1wah8mq2k2kfkhpzyww554ngzbwcnh"))))
1387 (build-system r-build-system)
1388 (inputs `(("libjpeg" ,libjpeg)))
1389 (home-page "http://www.rforge.net/jpeg/")
1390 (synopsis "Read and write JPEG images with R")
1391 (description "This package provides a way to read, write and display bitmap
1392 images stored in the JPEG format with R. It can read and write both files and
1393 in-memory raw vectors.")
1394 (license license:gpl2+)))