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