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