gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / image.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015, 2016, 2020 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2014, 2016, 2017, 2018, 2019 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, 2020 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2016, 2017, 2020 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2017 Nikita <nikita@n0.is>
17 ;;; Copyright © 2017,2019,2020 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 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
22 ;;; Copyright © 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
23 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
24 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
25 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
26 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
27 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
28 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
29 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
30 ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
31 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
32 ;;;
33 ;;; This file is part of GNU Guix.
34 ;;;
35 ;;; GNU Guix is free software; you can redistribute it and/or modify it
36 ;;; under the terms of the GNU General Public License as published by
37 ;;; the Free Software Foundation; either version 3 of the License, or (at
38 ;;; your option) any later version.
39 ;;;
40 ;;; GNU Guix is distributed in the hope that it will be useful, but
41 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
42 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 ;;; GNU General Public License for more details.
44 ;;;
45 ;;; You should have received a copy of the GNU General Public License
46 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
47
48 (define-module (gnu packages image)
49 #:use-module (gnu packages)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages assembly)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages boost)
55 #:use-module (gnu packages check)
56 #:use-module (gnu packages cmake)
57 #:use-module (gnu packages curl)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages documentation)
60 #:use-module (gnu packages fontutils)
61 #:use-module (gnu packages freedesktop)
62 #:use-module (gnu packages gettext)
63 #:use-module (gnu packages ghostscript)
64 #:use-module (gnu packages gimp)
65 #:use-module (gnu packages gl)
66 #:use-module (gnu packages glib)
67 #:use-module (gnu packages gnome)
68 #:use-module (gnu packages graphics)
69 #:use-module (gnu packages gtk)
70 #:use-module (gnu packages lua)
71 #:use-module (gnu packages man)
72 #:use-module (gnu packages maths)
73 #:use-module (gnu packages mcrypt)
74 #:use-module (gnu packages mp3)
75 #:use-module (gnu packages ncurses)
76 #:use-module (gnu packages perl)
77 #:use-module (gnu packages photo)
78 #:use-module (gnu packages pkg-config)
79 #:use-module (gnu packages python)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages qt)
82 #:use-module (gnu packages ragel)
83 #:use-module (gnu packages sphinx)
84 #:use-module (gnu packages swig)
85 #:use-module (gnu packages textutils)
86 #:use-module (gnu packages video)
87 #:use-module (gnu packages web)
88 #:use-module (gnu packages xdisorg)
89 #:use-module (gnu packages xml)
90 #:use-module (gnu packages xorg)
91 #:use-module ((guix licenses) #:prefix license:)
92 #:use-module (guix packages)
93 #:use-module (guix download)
94 #:use-module (guix git-download)
95 #:use-module (guix utils)
96 #:use-module (guix build-system gnu)
97 #:use-module (guix build-system cmake)
98 #:use-module (guix build-system copy)
99 #:use-module (guix build-system meson)
100 #:use-module (guix build-system python)
101 #:use-module (guix build-system qt)
102 #:use-module (guix build-system scons)
103 #:use-module (guix deprecation)
104 #:use-module (srfi srfi-1))
105
106 (define-public iqa
107 (package
108 (name "iqa")
109 (version "1.1.2")
110 (source
111 (origin
112 (method url-fetch)
113 (uri
114 (string-append "https://sourceforge.net/projects/iqa/files/"
115 "1.1.2%20Release/iqa_1.1.2_src.tar.gz/download"))
116 (sha256
117 (base32 "00mgwy031ammab6bwmd1whhvqv3fxy1cs1igabq0n3ag12zhjs77"))))
118 (build-system gnu-build-system)
119 (arguments
120 `(#:test-target "test"
121 #:phases
122 (modify-phases %standard-phases
123 (delete 'configure)
124 (replace 'install
125 (lambda* (#:key outputs #:allow-other-keys)
126 (let* ((out (assoc-ref outputs "out"))
127 (lib (string-append out "/lib")))
128 (install-file "build/debug/libiqa.a" lib)
129 #t))))))
130 (synopsis "Image Quality Assessment")
131 (description "IQA is a C library for objectively measuring image/video
132 quality. It implements many popular algorithms, such as MS-SSIM, MS-SSIM*,
133 SIMM, MSE, and PSNR. It is designed to be fast, accurate, and reliable. All
134 code is Valgrind-clean and unit tested.")
135 (home-page "https://sourceforge.net/projects/iqa/")
136 (license license:bsd-4)))
137
138 (define-public libpng
139 (package
140 (name "libpng")
141 (version "1.6.37") ; Remember to also update libpng-apng if possible!
142 (source (origin
143 (method url-fetch)
144 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
145 version "/libpng-" version ".tar.xz")
146 (string-append
147 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
148 "/libpng16/libpng-" version ".tar.xz")
149 (string-append
150 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
151 "/libpng16/libpng-" version ".tar.xz")))
152 (sha256
153 (base32
154 "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"))))
155 (build-system gnu-build-system)
156 (arguments
157 `(#:configure-flags '("--disable-static")))
158
159 ;; libpng.la says "-lz", so propagate it.
160 (propagated-inputs `(("zlib" ,zlib)))
161
162 (synopsis "Library for handling PNG files")
163 (description
164 "Libpng is the official PNG (Portable Network Graphics) reference
165 library. It supports almost all PNG features and is extensible.")
166 (license license:zlib)
167 (home-page "http://www.libpng.org/pub/png/libpng.html")))
168
169 ;; libpng-apng should be updated when the APNG patch is released:
170 ;; <https://bugs.gnu.org/27556>
171 (define-public libpng-apng
172 (package
173 (name "libpng-apng")
174 (version "1.6.37")
175 (source
176 (origin
177 (method url-fetch)
178 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
179 version "/libpng-" version ".tar.xz")
180 (string-append
181 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
182 "/libpng16/libpng-" version ".tar.xz")
183 (string-append
184 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
185 "/libpng16/libpng-" version ".tar.xz")))
186 (sha256
187 (base32
188 "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"))))
189 (build-system gnu-build-system)
190 (arguments
191 `(#:modules ((guix build gnu-build-system)
192 (guix build utils)
193 (srfi srfi-1))
194 #:phases
195 (modify-phases %standard-phases
196 (add-after 'unpack 'patch-apng
197 (lambda* (#:key inputs #:allow-other-keys)
198 (define (apply-patch file)
199 (invoke "patch" "-p1" "--force"
200 "--input" file))
201 (let ((apng.gz (assoc-ref inputs "apng")))
202 (format #t "Applying APNG patch '~a'...~%"
203 apng.gz)
204 (invoke "sh" "-c"
205 (string-append "gunzip < " apng.gz " > the-patch"))
206 (apply-patch "the-patch")
207 #t)))
208 (add-before 'configure 'no-checks
209 (lambda _
210 (substitute* "Makefile.in"
211 (("^scripts/symbols.chk") "")
212 (("check: scripts/symbols.chk") ""))
213 #t)))))
214 (inputs
215 `(("apng" ,(origin
216 (method url-fetch)
217 (uri
218 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
219 version "/libpng-" version "-apng.patch.gz"))
220 (sha256
221 (base32
222 "1dh0250mw9b2hx7cdmnb2blk7ddl49n6vx8zz7jdmiwxy38v4fw2"))))))
223 (native-inputs
224 `(("libtool" ,libtool)))
225 ;; libpng.la says "-lz", so propagate it.
226 (propagated-inputs
227 `(("zlib" ,zlib)))
228 (synopsis "APNG patch for libpng")
229 (description
230 "APNG (Animated Portable Network Graphics) is an unofficial
231 extension of the APNG (Portable Network Graphics) format.
232 APNG patch provides APNG support to libpng.")
233 (home-page "https://sourceforge.net/projects/libpng-apng/")
234 (license license:zlib)))
235
236 (define-public libpng-1.2
237 (package
238 (inherit libpng)
239 (version "1.2.59")
240 (source
241 (origin
242 (method url-fetch)
243 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
244 version "/libpng-" version ".tar.xz")
245 (string-append
246 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
247 "/libpng12/libpng-" version ".tar.xz")
248 (string-append
249 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
250 "/libpng12/libpng-" version ".tar.xz")))
251 (sha256
252 (base32
253 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
254
255 (define-public pngcrush
256 (package
257 (name "pngcrush")
258 (version "1.8.13")
259 (source (origin
260 (method url-fetch)
261 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
262 version "/pngcrush-" version "-nolib.tar.xz"))
263 (sha256 (base32
264 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
265 (build-system gnu-build-system)
266 (arguments
267 '(#:tests? #f ; no check target
268 #:phases
269 (modify-phases %standard-phases
270 (replace 'configure
271 (lambda* (#:key inputs outputs #:allow-other-keys)
272 (substitute* "Makefile"
273 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
274 (string-append vardef (assoc-ref inputs "libpng") "/"))
275 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
276 (string-append vardef (assoc-ref inputs "zlib") "/"))
277 ;; The Makefile is written by hand and not using $PREFIX
278 (("\\$\\(DESTDIR\\)/usr/")
279 (string-append (assoc-ref outputs "out") "/")))
280 #t)))))
281 (inputs
282 `(("libpng" ,libpng)
283 ("zlib" , zlib)))
284 (home-page "https://pmt.sourceforge.io/pngcrush")
285 (synopsis "Utility to compress PNG files")
286 (description "Pngcrush optimizes @acronym{PNG, Portable Network Graphics}
287 images. It can further losslessly compress them by as much as 40%.")
288 (license license:zlib)))
289
290 (define-public pnglite
291 (let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
292 (revision "1"))
293 (package
294 (name "pnglite")
295 ;; The project was moved from sourceforge to github.
296 ;; The latest version in sourceforge was 0.1.17:
297 ;; https://sourceforge.net/projects/pnglite/files/pnglite/
298 ;; No releases are made in github.
299 (version (git-version "0.1.17" revision commit))
300 (source (origin
301 (method git-fetch)
302 (uri (git-reference
303 (url "https://github.com/dankar/pnglite")
304 (commit commit)))
305 (sha256
306 (base32
307 "1lmmkdxby5b8z9kx3zrpgpk33njpcf2xx8z9bgqag855sjsqbbby"))
308 (file-name (git-file-name name version))))
309 (build-system gnu-build-system)
310 (arguments
311 `(#:tests? #f ; no tests
312 #:phases
313 (modify-phases %standard-phases
314 (delete 'configure)
315 (replace 'build
316 (lambda _
317 ;; common build flags for building shared libraries
318 (let ((cflags '("-O2" "-g" "-fPIC"))
319 (ldflags '("-shared")))
320 (apply invoke
321 `("gcc"
322 "-o" "libpnglite.so"
323 ,@cflags
324 ,@ldflags
325 "pnglite.c"))
326 #t)))
327 (replace 'install
328 (lambda* (#:key outputs #:allow-other-keys)
329 (let* ((out (assoc-ref outputs "out"))
330 (lib (string-append out "/lib/"))
331 (include (string-append out "/include/"))
332 (doc (string-append out "/share/doc/"
333 ,name "-" ,version "/")))
334 (install-file "libpnglite.so" lib)
335 (install-file "pnglite.h" include)
336 (install-file "README.md" doc)
337 #t))))))
338 (inputs `(("zlib" ,zlib)))
339 (home-page "https://github.com/dankar/pnglite")
340 (synopsis "Pretty small png library")
341 (description "A pretty small png library.
342 Currently all documentation resides in @file{pnglite.h}.")
343 (license license:zlib))))
344
345 (define-public libimagequant
346 (package
347 (name "libimagequant")
348 (version "2.12.6")
349 (source
350 (origin
351 (method git-fetch)
352 (uri (git-reference
353 (url "https://github.com/ImageOptim/libimagequant")
354 (commit version)))
355 (file-name (git-file-name name version))
356 (sha256
357 (base32 "00w7fny3xf14cfyhbdnmqyh9ddqdh1irvgzxd35a2z65kp7vnvj0"))))
358 (build-system gnu-build-system)
359 (arguments
360 '(#:tests? #f)) ; no check target
361 (home-page "https://pngquant.org/lib/")
362 (synopsis "Image palette quantization library")
363 (description "libimagequant is a small, portable C library for
364 high-quality conversion of RGBA images to 8-bit indexed-color (palette)
365 images. This library can significantly reduces file sizes and powers pngquant
366 and other PNG optimizers.")
367 (license license:gpl3+)))
368
369 (define-public pngquant
370 (package
371 (name "pngquant")
372 (version "2.12.6")
373 (source
374 (origin
375 (method git-fetch)
376 (uri (git-reference
377 (url "https://github.com/kornelski/pngquant")
378 (commit version)))
379 (file-name (git-file-name name version))
380 (sha256
381 (base32 "15hanshahxqs6s9fyc3aym02251dcys7bf78g3inp0y233amdbl3"))))
382 (build-system gnu-build-system)
383 (arguments
384 `(#:test-target "test"
385 #:configure-flags
386 '("--with-openmp" "--with-lcms2")))
387 (native-inputs
388 `(("pkg-config" ,pkg-config)))
389 (inputs
390 `(("libpng" ,libpng)
391 ("zlib" , zlib)
392 ("lcms" ,lcms)
393 ("libimagequant" ,libimagequant)))
394 (home-page "https://pngquant.org/")
395 (synopsis "Utility and library for lossy compressing PNG images")
396 (description "pngquant is a PNG compressor that significantly reduces file
397 sizes by converting images to a more efficient 8-bit PNG format with alpha
398 channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images
399 are fully standards-compliant and are supported by all web browsers and
400 operating systems.
401
402 Features:
403 @enumerate
404 @item High-quality palette generation using a combination of vector
405 quantization algorithms.
406 @item Unique adaptive dithering algorithm that adds less noise to images
407 than the standard Floyd-Steinberg.
408 @item Easy to integrate with shell scripts, GUIs and server-side software.
409 @item Fast mode for real-time processing/large numbers of images.
410 @end enumerate")
411 (license license:gpl3+)))
412
413 (define-public ijg-libjpeg
414 (package
415 (name "libjpeg")
416 (version "9d")
417 (source (origin
418 (method url-fetch)
419 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
420 version ".tar.gz"))
421 (sha256 (base32
422 "0clwys9lcqlxqgcw8s1gwfm5ix2zjlqpklmd3mbvqmj5ibj51jwr"))))
423 (build-system gnu-build-system)
424 (synopsis "Library for handling JPEG files")
425 (description
426 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
427 JPEG is a standardized compression method for full-color and gray-scale
428 images.
429 It also includes programs that provide conversion between the JPEG format and
430 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats, as well as
431 lossless JPEG manipulations such as rotation, scaling or cropping:
432 @enumerate
433 @item cjpeg
434 @item djpeg
435 @item jpegtran
436 @item rdjpgcom
437 @item wrjpgcom
438 @end enumerate")
439 (license license:ijg)
440 (home-page "https://www.ijg.org/")))
441
442 (define-public libjxr
443 (package
444 (name "libjxr")
445 (version "1.1")
446 (source (origin
447 ;; We are using the Debian source because CodePlex does not
448 ;; deliver an easily downloadable tarball.
449 (method url-fetch)
450 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
451 version ".orig.tar.gz"))
452 (sha256
453 (base32
454 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
455 (patch-flags '("-p1" "--binary"))
456 (patches (search-patches "libjxr-fix-function-signature.patch"
457 "libjxr-fix-typos.patch"))))
458 (build-system gnu-build-system)
459 (arguments
460 '(#:make-flags
461 (list "CC=gcc"
462 ;; A substitute* procedure call would be enough to add the -fPIC
463 ;; flag if there was no file decoding error.
464 ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
465 ;; terminators" according to the file(1) utility.
466 (string-append "CFLAGS=-I. -Icommon/include -Iimage/sys -fPIC "
467 "-D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O "))
468 #:tests? #f ; no check target
469 #:phases
470 (modify-phases %standard-phases
471 (delete 'configure) ; no configure script
472 (add-after 'build 'build-shared-library
473 (lambda _
474 ;; The Makefile uses optimization level 1, so the same
475 ;; level is used here for consistency.
476 (invoke "gcc" "-shared" "-fPIC" "-O"
477 ;; Common files.
478 "adapthuff.o" "image.o" "strcodec.o" "strPredQuant.o"
479 "strTransform.o" "perfTimerANSI.o"
480 ;; Decoding files.
481 "decode.o" "postprocess.o" "segdec.o" "strdec.o"
482 "strInvTransform.o" "strPredQuantDec.o" "JXRTranscode.o"
483 ;; Encoding files.
484 "encode.o" "segenc.o" "strenc.o" "strFwdTransform.o"
485 "strPredQuantEnc.o"
486 "-o" "libjpegxr.so")
487 (invoke "gcc" "-shared" "-fPIC" "-O"
488 ;; Glue files.
489 "JXRGlue.o" "JXRMeta.o" "JXRGluePFC.o" "JXRGlueJxr.o"
490 ;; Test files.
491 "JXRTest.o" "JXRTestBmp.o" "JXRTestHdr.o" "JXRTestPnm.o"
492 "JXRTestTif.o" "JXRTestYUV.o"
493 "-o" "libjxrglue.so")))
494 ;; The upstream makefile does not include an install phase.
495 (replace 'install
496 (lambda* (#:key outputs #:allow-other-keys)
497 (let* ((out (assoc-ref outputs "out"))
498 (bin (string-append out "/bin"))
499 (lib (string-append out "/lib"))
500 (include (string-append out "/include/jxrlib")))
501 (for-each (lambda (file)
502 (install-file file include)
503 (delete-file file))
504 (append
505 '("jxrgluelib/JXRGlue.h"
506 "jxrgluelib/JXRMeta.h"
507 "jxrtestlib/JXRTest.h"
508 "image/sys/windowsmediaphoto.h")
509 (find-files "common/include" "\\.h$")))
510 (for-each (lambda (file)
511 (install-file file lib)
512 (delete-file file))
513 (find-files "." "\\.(a|so)$"))
514 (for-each (lambda (file)
515 (install-file file bin)
516 (delete-file file))
517 '("JxrDecApp" "JxrEncApp")))
518 #t)))))
519 (synopsis "Implementation of the JPEG XR standard")
520 (description "JPEG XR is an approved ISO/IEC International standard (its
521 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
522 (license
523 (license:non-copyleft
524 "file://Makefile"
525 "See the header of the Makefile in the distribution."))
526 (home-page "https://jxrlib.codeplex.com/")))
527
528 (define-public jpegoptim
529 (package
530 (name "jpegoptim")
531 (version "1.4.6")
532 (source (origin
533 (method url-fetch)
534 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
535 version ".tar.gz"))
536 (sha256 (base32
537 "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8"))))
538 (build-system gnu-build-system)
539 (inputs `(("libjpeg" ,libjpeg-turbo)))
540 (arguments
541 '(#:tests? #f)) ; no tests
542 (synopsis "Optimize JPEG images")
543 (description
544 "jpegoptim provides lossless optimization (based on optimizing
545 the Huffman tables) and \"lossy\" optimization based on setting
546 maximum quality factor.")
547 (license license:gpl2+)
548 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
549
550 (define-public libicns
551 (package
552 (name "libicns")
553 (version "0.8.1")
554 (source (origin
555 (method url-fetch)
556 (uri (string-append
557 "mirror://sourceforge/icns/"
558 "libicns-" version ".tar.gz"))
559 (sha256
560 (base32
561 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
562 (build-system gnu-build-system)
563 (inputs
564 `(("libpng" ,libpng)
565 ("jasper" ,jasper)))
566 (arguments
567 `(#:tests? #t)) ; No tests.
568 (home-page "http://icns.sourceforge.net/")
569 (synopsis "Library for handling Mac OS icns resource files")
570 (description
571 "Libicns is a library for the manipulation of Mac OS IconFamily resource
572 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
573 convert between PNG and ICNS. @command{icns2png} will extract image files from
574 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
575 with .desktop files. Additionally, @command{icontainer2png} is provided for
576 extracting icontainer icon files.")
577 (license (list license:lgpl2.1+ ; libicns
578 license:lgpl2.0+ ; src/apidocs.*
579 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
580
581 (define-public libtiff
582 (package
583 (name "libtiff")
584 (version "4.1.0")
585 (source
586 (origin
587 (method url-fetch)
588 (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
589 version ".tar.gz"))
590 (sha256
591 (base32
592 "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax"))))
593 (replacement libtiff/fixed)
594 (build-system gnu-build-system)
595 (outputs '("out"
596 "doc")) ;1.3 MiB of HTML documentation
597 (arguments
598 ;; Instead of using --docdir, this package has its own --with-docdir.
599 `(#:configure-flags
600 (list (string-append "--with-docdir="
601 (assoc-ref %outputs "doc")
602 "/share/doc/"
603 ,name "-" ,(package-version this-package))
604 "--disable-static")))
605 (inputs `(("zlib" ,zlib)
606 ("libjpeg" ,libjpeg-turbo)))
607 (synopsis "Library for handling TIFF files")
608 (description
609 "Libtiff provides support for the Tag Image File Format (TIFF), a format
610 used for storing image data.
611 Included are a library, libtiff, for reading and writing TIFF and a small
612 collection of tools for doing simple manipulations of TIFF images.")
613 (license (license:non-copyleft "file://COPYRIGHT"
614 "See COPYRIGHT in the distribution."))
615 (home-page "http://www.simplesystems.org/libtiff/")))
616
617 (define-public libtiff/fixed
618 (package
619 (inherit libtiff)
620 (name "libtiff")
621 (version "4.2.0")
622 (source
623 (origin
624 (method url-fetch)
625 (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
626 version ".tar.gz"))
627 (sha256
628 (base32
629 "1jrkjv0xya9radddn8idxvs2gqzp3l2b1s8knlizmn7ad3jq817b"))))))
630
631 (define-public leptonica
632 (package
633 (name "leptonica")
634 (version "1.80.0")
635 (source
636 (origin
637 (method git-fetch)
638 (uri (git-reference
639 (url "https://github.com/DanBloomberg/leptonica")
640 (commit version)))
641 (file-name (git-file-name name version))
642 (sha256
643 (base32 "12ddln72z5l3icz0i9rpsfkg5xik8fcwcn8lb0cp3jigjxi8gvkg"))))
644 (build-system gnu-build-system)
645 (native-inputs
646 `(("gnuplot" ,gnuplot) ;needed for test suite
647 ("autoconf" ,autoconf)
648 ("automake" ,automake)
649 ("libtool" ,libtool)
650 ("pkg-config" ,pkg-config)))
651 (inputs
652 `(("giflib" ,giflib)
653 ("libjpeg" ,libjpeg-turbo)
654 ("libpng" ,libpng)
655 ("libtiff" ,libtiff)
656 ("libwebp" ,libwebp)
657 ("openjpeg" ,openjpeg)
658 ("zlib" ,zlib)))
659 (arguments
660 '(#:phases
661 (modify-phases %standard-phases
662 (add-after 'unpack 'patch-reg-wrapper
663 (lambda _
664 (substitute* "prog/reg_wrapper.sh"
665 ((" /bin/sh ")
666 (string-append " " (which "sh") " "))
667 (("which gnuplot")
668 "true"))
669 #t))
670 (add-after 'install 'provide-absolute-giflib-reference
671 (lambda* (#:key inputs outputs #:allow-other-keys)
672 (let ((out (assoc-ref outputs "out"))
673 (giflib (assoc-ref inputs "giflib")))
674 ;; Add an absolute reference to giflib to avoid propagation.
675 (with-directory-excursion (string-append out "/lib")
676 (substitute* '("liblept.la" "pkgconfig/lept.pc")
677 (("-lgif") (string-append "-L" giflib "/lib -lgif"))))
678 #t))))))
679 (home-page "http://www.leptonica.com/")
680 (synopsis "Library and tools for image processing and analysis")
681 (description
682 "Leptonica is a C library and set of command-line tools for efficient
683 image processing and image analysis operations. It supports rasterop, affine
684 transformations, binary and grayscale morphology, rank order, and convolution,
685 seedfill and connected components, image transformations combining changes in
686 scale and pixel depth, and pixelwise masking, blending, enhancement, and
687 arithmetic ops.")
688 (license license:bsd-2)))
689
690 (define-public jbig2dec
691 (package
692 (name "jbig2dec")
693 (version "0.18")
694 (source (origin
695 (method url-fetch)
696 (uri (string-append "https://github.com/ArtifexSoftware"
697 "/ghostpdl-downloads/releases/download"
698 "/gs951/" name "-" version ".tar.gz"))
699 (sha256
700 (base32
701 "0pigfw2v0ppvr0lbysm69gx0zsa5q2q92yrb8af2j3im6x97f6cy"))))
702 (build-system gnu-build-system)
703 (arguments '(#:configure-flags '("--disable-static")
704 #:phases (modify-phases %standard-phases
705 (add-before 'bootstrap 'force-bootstrap
706 (lambda _
707 ;; XXX: jbig2dec 0.18 was released with
708 ;; a broken configure script, so we
709 ;; recreate the build system here.
710 ;; Remove the autoconf inputs below
711 ;; when deleting this code.
712 (delete-file "configure")
713 (delete-file "autogen.sh")
714 #t)))))
715 (native-inputs
716 `(("autoconf" ,autoconf)
717 ("automake" ,automake)
718 ("libtool" ,libtool)
719 ("python" ,python-wrapper))) ;for tests
720 (synopsis "Decoder of the JBIG2 image compression format")
721 (description
722 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
723 monochrome) images at moderately high resolution, and in particular scanned
724 paper documents. In this domain it is very efficient, offering compression
725 ratios on the order of 100:1.
726
727 This is a decoder only implementation, and currently is in the alpha
728 stage, meaning it doesn't completely work yet. However, it is
729 maintaining parity with available encoders, so it is useful for real
730 work.")
731 (home-page "https://jbig2dec.com")
732 (license license:gpl2+)))
733
734 (define-public jbigkit
735 (package
736 (name "jbigkit")
737 (version "2.1")
738 (source
739 (origin
740 (method url-fetch)
741 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
742 "download/jbigkit-" version ".tar.gz"))
743 (sha256
744 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
745 (modules '((guix build utils)))
746 (snippet
747 '(begin
748 ;; Remove files without clear licence information.
749 (for-each delete-file-recursively
750 (list "contrib" "examples"))
751 #t))))
752 (build-system gnu-build-system)
753 (outputs (list "out" "pbmtools"))
754 (arguments
755 `(#:modules ((srfi srfi-26)
756 ,@%gnu-build-system-modules)
757 #:phases
758 (modify-phases %standard-phases
759 (delete 'configure) ; no configure script
760 (replace 'install ; no ‘make install’ target
761 (lambda* (#:key outputs #:allow-other-keys)
762 (let* ((out (assoc-ref outputs "out"))
763 (lib (string-append out "/lib"))
764 (include (string-append out "/include")))
765 (with-directory-excursion "libjbig"
766 (for-each (cut install-file <> include)
767 (find-files "." "\\.h$"))
768 (for-each (cut install-file <> lib)
769 (find-files "." "\\.a$")))
770 #t)))
771 (add-after 'install 'install-pbmtools
772 (lambda* (#:key outputs #:allow-other-keys)
773 (let* ((out (assoc-ref outputs "pbmtools"))
774 (bin (string-append out "/bin"))
775 (man1 (string-append out "/share/man/man1"))
776 (man5 (string-append out "/share/man/man5")))
777 (with-directory-excursion "pbmtools"
778 (for-each (cut install-file <> bin)
779 (list "jbgtopbm" "jbgtopbm85"
780 "pbmtojbg" "pbmtojbg85"))
781
782 (for-each (cut install-file <> man1)
783 (find-files "." "\\.1$"))
784 (for-each (cut install-file <> man5)
785 (find-files "." "\\.5$"))
786 #t)))))
787 #:test-target "test"
788 #:tests? #f)) ; tests depend on examples/
789 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
790 (synopsis "Lossless compression for bi-level high-resolution images")
791 (description
792 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
793 ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
794 black-and-white scanned documents. It is widely used in fax products, printer
795 firmware and drivers, document management systems, and imaging software.
796
797 This package provides a static C library of (de)compression functions and some
798 simple command-line converters similar to those provided by netpbm.
799
800 Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
801 options of the standard but has to keep the full uncompressed image in memory.
802 The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
803 memory management optimized for embedded and fax applications. It buffers
804 only a few lines of the uncompressed image in memory and is able to stream
805 images of initially unknown height.")
806 (license (list license:isc ; pbmtools/p?m.5
807 license:gpl2+)))) ; the rest
808
809 (define-public openjpeg-data
810 (package
811 (name "openjpeg-data")
812 (version "2020.05.19")
813 (source
814 (origin
815 (method git-fetch)
816 (uri
817 (git-reference
818 (url "https://github.com/uclouvain/openjpeg-data")
819 (commit "c5c4a8c")))
820 (file-name (git-file-name name version))
821 (sha256
822 (base32 "1jp84gbhw8q5b8mhc322ql9410hjf32w9hg10x4isfa9j59mnncb"))))
823 (build-system copy-build-system)
824 (synopsis "Test files for OpenJPEG")
825 (description "OpenJPEG-Data contains all files required to run the openjpeg
826 test suite, including conformance tests (following Rec. ITU-T T.803 | ISO/IEC
827 15444-4 procedures), non-regression tests and unit tests.")
828 (home-page "https://github.com/uclouvain/openjpeg-data")
829 (license license:bsd-2)))
830
831 (define-public openjpeg
832 (package
833 (name "openjpeg")
834 (version "2.3.1")
835 (source
836 (origin
837 (method git-fetch)
838 (uri
839 (git-reference
840 (url "https://github.com/uclouvain/openjpeg")
841 (commit
842 (string-append "v" version))))
843 (file-name
844 (git-file-name "openjpeg" version))
845 (sha256
846 (base32 "1dn98d2dfa1lqyxxmab6rrcv52dyhjr4g7i4xf2w54fqsx14ynrb"))))
847 (build-system cmake-build-system)
848 (arguments
849 '(#:tests? #f ;TODO: requires a 1.1 GiB data repository
850 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF")))
851 (inputs
852 `(("lcms" ,lcms)
853 ("libpng" ,libpng)
854 ("libtiff" ,libtiff)
855 ("zlib" ,zlib)))
856 (synopsis "OPENJPEG Library and Applications")
857 (description "OpenJPEG is an implementation of JPEG 2000 codec written in C
858 language. It has been developed in order to promote the use of JPEG 2000, a
859 still-image compression standard from the Joint Photographic Experts Group
860 (JPEG). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a
861 JPEG 2000 Reference Software.")
862 (home-page "https://github.com/uclouvain/openjpeg")
863 (license license:bsd-2)))
864
865 (define-public openjpeg-1
866 (package (inherit openjpeg)
867 (name "openjpeg")
868 (version "1.5.2")
869 (source
870 (origin
871 (method url-fetch)
872 (uri
873 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
874 name "-" version ".tar.gz"))
875 (sha256
876 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
877
878 (define-public giflib
879 (package
880 (name "giflib")
881 (version "5.2.1")
882 (source (origin
883 (method url-fetch)
884 (uri (string-append "mirror://sourceforge/giflib/giflib-"
885 version ".tar.gz"))
886 (sha256
887 (base32
888 "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii"))))
889 (build-system gnu-build-system)
890 (outputs '("bin" ; utility programs
891 "out")) ; library
892 (arguments
893 '(#:make-flags (list "CC=gcc"
894 (string-append "PREFIX="
895 (assoc-ref %outputs "out"))
896 (string-append "BINDIR="
897 (assoc-ref %outputs "bin") "/bin"))
898 #:phases
899 (modify-phases %standard-phases
900 (add-after 'unpack 'disable-html-doc-gen
901 (lambda _
902 (substitute* "doc/Makefile"
903 (("^all: allhtml manpages") ""))
904 #t))
905 (delete 'configure)
906 (add-after 'install 'install-manpages
907 (lambda* (#:key outputs #:allow-other-keys)
908 (let* ((bin (assoc-ref outputs "bin"))
909 (man1dir (string-append bin "/share/man/man1")))
910 (mkdir-p man1dir)
911 (for-each (lambda (file)
912 (let ((base (basename file)))
913 (format #t "installing `~a' to `~a'~%"
914 base man1dir)
915 (copy-file file
916 (string-append
917 man1dir "/" base))))
918 (find-files "doc" "\\.1"))
919 #t))))))
920 (synopsis "Tools and library for working with GIF images")
921 (description
922 "GIFLIB is a library for reading and writing GIF images. It is API and
923 ABI compatible with libungif which was in wide use while the LZW compression
924 algorithm was patented. Tools are also included to convert, manipulate,
925 compose, and analyze GIF images.")
926 (home-page "http://giflib.sourceforge.net/")
927 (license license:x11)))
928
929 (define-public libuemf
930 (package
931 (name "libuemf")
932 (version "0.2.7")
933 (source (origin
934 (method url-fetch)
935 (uri (string-append "mirror://sourceforge/libuemf/libUEMF-"
936 version ".tar.gz"))
937 (sha256
938 (base32
939 "05djs99vqf067x81xfpskh7a66y5x7b4mmjavybcy7swnm0swg7v"))))
940 (build-system cmake-build-system)
941 (arguments
942 `(#:phases
943 (modify-phases %standard-phases
944 ;; Overriding CMAKE_INSTALL_PREFIX is not a good idea.
945 (add-after 'unpack 'fix-CMakeLists.txt
946 (lambda _
947 (substitute* "CMakeLists.txt"
948 ((".*SET\\(CMAKE_INSTALL_PREFIX.*") ""))
949 #t))
950 (delete 'check)
951 (add-after 'install 'check
952 (lambda* (#:key inputs outputs #:allow-other-keys)
953 (let* ((out (assoc-ref outputs "out"))
954 (bin (string-append out "/bin"))
955 (sources (string-append "../libUEMF-" ,version))
956 (drm-tools (assoc-ref inputs "drm-tools"))
957 (extract (string-append drm-tools "/bin/extract"))
958 (execinput (string-append drm-tools "/bin/execinput")))
959 (with-directory-excursion sources
960 (substitute* "testit.sh"
961 (("^EPATH=.*")
962 (format #f "EPATH=~a~%" bin))
963 (("`which diff`")
964 "diff")
965 (("^EXTRACT=.*")
966 (format #f "EXTRACT=~a~%" extract))
967 (("^EXECINPUT=.*")
968 (format #f "EXECINPUT=~a~%" execinput)))
969 (invoke "sh" "testit.sh"))))))))
970 (native-inputs `(("drm-tools" ,drm-tools))) ;for tests
971 (home-page "http://libuemf.sourceforge.net/")
972 (synopsis "Library for working with WFM, EMF and EMF+ images")
973 (description "The libUEMF library is a portable C99 implementation for
974 reading and writing @acronym{WFM, Windows Metafile}, @acronym{EMF, Enhanced
975 Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
976 (license license:gpl2+)))
977
978 (define-public libungif
979 (package
980 (name "libungif")
981 (version "4.1.4")
982 (source (origin
983 (method url-fetch)
984 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
985 "libungif-" version "/libungif-"
986 version ".tar.bz2"))
987 (sha256
988 (base32
989 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
990 (build-system gnu-build-system)
991 (inputs `(("perl" ,perl))) ;package ships some perl tools
992 (home-page "http://giflib.sourceforge.net/")
993 (synopsis "GIF decompression library")
994 (description
995 "libungif is the old GIF decompression library by the GIFLIB project.")
996 (license license:expat)))
997
998 (define-public imlib2
999 (package
1000 (name "imlib2")
1001 (version "1.7.1")
1002 (source (origin
1003 (method url-fetch)
1004 (uri (string-append
1005 "mirror://sourceforge/enlightenment/imlib2-src/" version
1006 "/imlib2-" version ".tar.bz2"))
1007 (sha256
1008 (base32
1009 "01y45cdml2dr9cqgybrgxr86sd77d1qfa1gzclzy1j6bkminlfh3"))))
1010 (build-system gnu-build-system)
1011 (arguments
1012 '(#:configure-flags (list "--disable-static")))
1013 (native-inputs
1014 `(("pkgconfig" ,pkg-config)))
1015 (inputs
1016 `(("bzip2" ,bzip2)
1017 ("freetype" ,freetype)
1018 ("giflib" ,giflib)
1019 ("libid3tag" ,libid3tag)
1020 ("libjpeg" ,libjpeg-turbo)
1021 ("libpng" ,libpng)
1022 ("libtiff" ,libtiff)
1023 ("libx11" ,libx11)
1024 ("libxext" ,libxext)
1025 ("libwebp" ,libwebp)))
1026 (home-page "https://sourceforge.net/projects/enlightenment/")
1027 (synopsis
1028 "Loading, saving, rendering and manipulating image files")
1029 (description
1030 "Imlib2 is a library that does image file loading and saving as well as
1031 rendering, manipulation, arbitrary polygon support, etc.
1032
1033 It does ALL of these operations FAST. Imlib2 also tries to be highly
1034 intelligent about doing them, so writing naive programs can be done easily,
1035 without sacrificing speed.
1036
1037 This is a complete rewrite over the Imlib 1.x series. The architecture is
1038 more modular, simple, and flexible.")
1039 (license license:imlib2)))
1040
1041 (define-public giblib
1042 (package
1043 (name "giblib")
1044 (version "1.2.4")
1045 (source (origin
1046 (method url-fetch)
1047 (uri (list
1048 (string-append
1049 "http://linuxbrit.co.uk/downloads/giblib-"
1050 version ".tar.gz")
1051 (string-append
1052 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
1053 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
1054 version ".tar.gz")
1055 (string-append
1056 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
1057 "files/giblib/giblib-" version ".tar.gz")))
1058 (sha256
1059 (base32
1060 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
1061 (build-system gnu-build-system)
1062 (inputs
1063 `(("libx11" ,libx11)
1064 ("imlib2" ,imlib2)))
1065 (home-page
1066 ;; This vanished page is universally accepted as giblib's home despite not
1067 ;; mentioning the package once.
1068 (string-append "https://web.archive.org/web/20140907071208/"
1069 "https://linuxbrit.co.uk/software/"))
1070 (synopsis "Wrapper library for imlib2")
1071 (description
1072 "Giblib is a simple library which wraps imlib2's context API, avoiding
1073 all the context_get/set calls, adds fontstyles to the truetype renderer and
1074 supplies a generic doubly-linked list and some string functions.")
1075 ;; This license removes a clause about X Consortium from the original
1076 ;; X11 license.
1077 (license (license:x11-style "file://COPYING"
1078 "See 'COPYING' in the distribution."))))
1079
1080 (define-public freeimage
1081 (package
1082 (name "freeimage")
1083 (version "3.18.0")
1084 (source (origin
1085 (method url-fetch)
1086 (uri (string-append
1087 "mirror://sourceforge/freeimage/Source%20Distribution/"
1088 version "/FreeImage"
1089 (string-concatenate (string-split version #\.))
1090 ".zip"))
1091 (sha256
1092 (base32
1093 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
1094 (modules '((guix build utils)))
1095 (snippet
1096 '(begin
1097 (for-each
1098 (lambda (dir)
1099 (delete-file-recursively (string-append "Source/" dir)))
1100 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
1101 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
1102 (patches
1103 (append
1104 (search-patches "freeimage-unbundle.patch")
1105 ;; Take one patch from Arch Linux that adds LibRaw 0.20 compatibility.
1106 (list (origin
1107 (method url-fetch)
1108 (uri "https://raw.githubusercontent.com/archlinux\
1109 /svntogit-community/ca3e6a52f5a46dec87cbf85e9d84fe370e282c8c/trunk\
1110 /freeimage-libraw-0.20.patch")
1111 (file-name "freeimage-libraw-compat.patch")
1112 (sha256
1113 (base32
1114 "0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
1115 (build-system gnu-build-system)
1116 (arguments
1117 '(#:phases
1118 (modify-phases %standard-phases
1119 ;; According to Fedora these files depend on private headers, but their
1120 ;; presence is required for building, so we replace them with empty files.
1121 (add-after 'unpack 'delete-unbuildable-files
1122 (lambda _
1123 (for-each (lambda (file)
1124 (delete-file file)
1125 (close (open file O_CREAT)))
1126 '("Source/FreeImage/PluginG3.cpp"
1127 "Source/FreeImageToolkit/JPEGTransform.cpp"))
1128 #t))
1129 ;; These scripts generate the Makefiles.
1130 (replace 'configure
1131 (lambda _
1132 (invoke "sh" "gensrclist.sh")
1133 (invoke "sh" "genfipsrclist.sh")))
1134 (add-before 'build 'patch-makefile
1135 (lambda* (#:key outputs #:allow-other-keys)
1136 (substitute* "Makefile.gnu"
1137 (("/usr") (assoc-ref outputs "out"))
1138 (("-o root -g root") ""))
1139 #t)))
1140 #:make-flags
1141 (list "CC=gcc"
1142 ;; We need '-fpermissive' for Source/FreeImage.h.
1143 ;; libjxr doesn't have a pkg-config file.
1144 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
1145 "-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"))
1146 #:tests? #f)) ; no check target
1147 (native-inputs
1148 `(("pkg-config" ,pkg-config)
1149 ("unzip" ,unzip)))
1150 (inputs
1151 `(("libjpeg" ,libjpeg-turbo)
1152 ("libjxr" ,libjxr)
1153 ("libpng" ,libpng)
1154 ("libraw" ,libraw)
1155 ("libtiff" ,libtiff)
1156 ("libwebp" ,libwebp)
1157 ("openexr" ,openexr)
1158 ("openjpeg" ,openjpeg)
1159 ("zlib" ,zlib)))
1160 (synopsis "Library for handling popular graphics image formats")
1161 (description
1162 "FreeImage is a library for developers who would like to support popular
1163 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1164 (license license:gpl2+)
1165 (home-page "http://freeimage.sourceforge.net")))
1166
1167 (define-public vigra
1168 (package
1169 (name "vigra")
1170 (version "1.11.1")
1171 (source
1172 (origin
1173 (method url-fetch)
1174 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
1175 "Version-" (string-join (string-split version #\.) "-")
1176 "/vigra-" version "-src.tar.gz"))
1177 (patches (search-patches "vigra-python-compat.patch"))
1178 (sha256 (base32
1179 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
1180 (build-system cmake-build-system)
1181 (inputs
1182 `(("boost" ,boost)
1183 ("fftw" ,fftw)
1184 ("fftwf" ,fftwf)
1185 ("hdf5" ,hdf5)
1186 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
1187 ; to create a configure-flag
1188 ("libjpeg" ,libjpeg-turbo)
1189 ("libpng" ,libpng)
1190 ("libtiff" ,libtiff)
1191 ("openexr" ,openexr)
1192 ("python" ,python-wrapper)
1193 ("python-numpy" ,python-numpy)
1194 ("zlib" ,zlib)))
1195 (native-inputs
1196 `(("doxygen" ,doxygen)
1197 ("python-nose" ,python-nose)
1198 ("sphinx" ,python-sphinx)))
1199 (arguments
1200 `(#:test-target "check"
1201 #:phases
1202 (modify-phases %standard-phases
1203 (add-after 'unpack 'disable-broken-tests
1204 (lambda _
1205 ;; See https://github.com/ukoethe/vigra/issues/432
1206 (substitute* "test/fourier/CMakeLists.txt"
1207 (("VIGRA_ADD_TEST.*") ""))
1208 ;; This test fails with Numpy 1.15:
1209 ;; <https://github.com/ukoethe/vigra/issues/436>.
1210 (substitute* "vigranumpy/test/CMakeLists.txt"
1211 (("test1\\.py") ""))
1212 #t)))
1213 #:configure-flags
1214 (list "-Wno-dev" ; suppress developer mode with lots of warnings
1215 (string-append "-DVIGRANUMPY_INSTALL_DIR="
1216 (assoc-ref %outputs "out")
1217 "/lib/python"
1218 ,(version-major+minor (package-version python))
1219 "/site-packages")
1220 ;; OpenEXR is not enabled by default.
1221 "-DWITH_OPENEXR=1"
1222 ;; Fix rounding error on 32-bit machines
1223 "-DCMAKE_C_FLAGS=-ffloat-store"
1224 ;; The header files of ilmbase are not found when included
1225 ;; by the header files of openexr, and an explicit flag
1226 ;; needs to be set.
1227 (string-append "-DCMAKE_CXX_FLAGS=-I"
1228 (assoc-ref %build-inputs "ilmbase")
1229 "/include/OpenEXR"
1230 " -ffloat-store"))))
1231 (synopsis "Computer vision library")
1232 (description
1233 "VIGRA stands for Vision with Generic Algorithms. It is an image
1234 processing and analysis library that puts its main emphasis on customizable
1235 algorithms and data structures. It is particularly strong for
1236 multi-dimensional image processing.")
1237 (license license:expat)
1238 (home-page "https://ukoethe.github.io/vigra/")
1239 (properties '((max-silent-time . 7200))))) ;2 hours, to avoid timing out
1240
1241
1242 (define-public vigra-c
1243 (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
1244 (revision "1"))
1245 (package
1246 (name "vigra-c")
1247 (version (git-version "0.0.0" revision commit))
1248 (home-page "https://github.com/BSeppke/vigra_c")
1249 (source (origin
1250 (method git-fetch)
1251 (uri (git-reference
1252 (url home-page)
1253 (commit commit)))
1254 (sha256
1255 (base32
1256 "1pnd92s284dvsg8zp6md7p8ck55bmcsryz58gzic7jh6m72hg689"))
1257 (file-name (git-file-name name version))))
1258 (build-system cmake-build-system)
1259 (arguments
1260 `(#:tests? #f)) ; No test target.
1261 (native-inputs
1262 `(("doxygen" ,doxygen)))
1263 (inputs
1264 `(("fftw" ,fftw)
1265 ("fftwf" ,fftwf)
1266 ("hdf5" ,hdf5)
1267 ("vigra" ,vigra)))
1268 (synopsis "C interface to the VIGRA computer vision library")
1269 (description
1270 "This package provides a C interface to the VIGRA C++ computer vision
1271 library. It is designed primarily to ease the implementation of higher-level
1272 language bindings to VIGRA.")
1273 (license license:expat))))
1274
1275 (define-public libwebp
1276 (package
1277 (name "libwebp")
1278 (version "1.1.0")
1279 (source
1280 (origin
1281 ;; No tarballs are provided for >0.6.1.
1282 (method git-fetch)
1283 (uri (git-reference
1284 (url "https://chromium.googlesource.com/webm/libwebp")
1285 (commit (string-append "v" version))))
1286 (file-name (git-file-name name version))
1287 (sha256
1288 (base32
1289 "0r2yy9if0ndvpzadk39bigvsygyqnlv0xjb9w2aj6rs534mncazz"))))
1290 (build-system gnu-build-system)
1291 (inputs
1292 `(("freeglut" ,freeglut)
1293 ("giflib" ,giflib)
1294 ("libjpeg" ,libjpeg-turbo)
1295 ("libpng" ,libpng)
1296 ("libtiff" ,libtiff)))
1297 (native-inputs
1298 `(("autoconf" ,autoconf)
1299 ("automake" ,automake)
1300 ("libtool" ,libtool)))
1301 (arguments
1302 '(#:configure-flags '("--enable-libwebpmux"
1303 "--enable-libwebpdemux"
1304 "--enable-libwebpdecoder"
1305 "--disable-static")))
1306 (home-page "https://developers.google.com/speed/webp/")
1307 (synopsis "Lossless and lossy image compression")
1308 (description
1309 "WebP is a new image format that provides lossless and lossy compression
1310 for images. WebP lossless images are 26% smaller in size compared to
1311 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1312 equivalent SSIM index. WebP supports lossless transparency (also known as
1313 alpha channel) with just 22% additional bytes. Transparency is also supported
1314 with lossy compression and typically provides 3x smaller file sizes compared
1315 to PNG when lossy compression is acceptable for the red/green/blue color
1316 channels.")
1317 (license license:bsd-3)))
1318
1319 (define-public libmng
1320 (package
1321 (name "libmng")
1322 (version "2.0.3")
1323 (source (origin
1324 (method url-fetch)
1325 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1326 version "/" name "-" version ".tar.xz"))
1327 (sha256
1328 (base32
1329 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1330 (build-system gnu-build-system)
1331 (propagated-inputs
1332 ;; These are all in the 'Libs.private' field of libmng.pc.
1333 `(("lcms" ,lcms)
1334 ("libjpeg" ,libjpeg-turbo)
1335 ("zlib" ,zlib)))
1336 (home-page "https://www.libmng.com/")
1337 (synopsis "Library for handling MNG files")
1338 (description
1339 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1340 (license license:bsd-3)))
1341
1342 (define-public exiv2
1343 (package
1344 (name "exiv2")
1345 (version "0.27.3")
1346 (source
1347 (origin
1348 (method url-fetch)
1349 (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
1350 "-Source.tar.gz"))
1351 (sha256
1352 (base32 "0y77wfadjsrcxijdqgkr3q88b6mm9y3rg8kqsmaig8iah49md7x7"))))
1353 (build-system cmake-build-system)
1354 (arguments '(#:tests? #f)) ; no test suite
1355 (propagated-inputs
1356 `(("expat" ,expat)
1357 ("zlib" ,zlib)))
1358 (home-page "https://www.exiv2.org/")
1359 (synopsis "Library and command-line utility to manage image metadata")
1360 (description
1361 "Exiv2 is a C++ library and a command line utility to manage image
1362 metadata. It provides fast and easy read and write access to the Exif, IPTC
1363 and XMP metadata of images in various formats.")
1364
1365 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
1366 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
1367 ;; The core is GPLv2+:
1368 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
1369 (license license:gpl2+)))
1370
1371 (define-public devil
1372 (package
1373 (name "devil")
1374 (version "1.8.0")
1375 (source (origin
1376 (method url-fetch)
1377 (uri (string-append "http://downloads.sourceforge.net/openil/"
1378 "DevIL-" version ".tar.gz"))
1379 (sha256
1380 (base32
1381 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1382 (build-system cmake-build-system)
1383 (arguments
1384 '(;; XXX: Not supported in the released CMakeLists.txt.
1385 ;; Enable this for > 1.8.0.
1386 #:tests? #f
1387 #:phases
1388 (modify-phases %standard-phases
1389 (add-before 'configure 'change-directory
1390 (lambda _ (chdir "DevIL") #t)))))
1391 (native-inputs
1392 `(("pkg-config" ,pkg-config)))
1393 (inputs
1394 `(("lcms" ,lcms)
1395 ("libjpeg" ,libjpeg-turbo)
1396 ("libmng" ,libmng)
1397 ("libpng" ,libpng)
1398 ("libtiff" ,libtiff)
1399 ("openexr" ,openexr)
1400 ("zlib" ,zlib)))
1401 (synopsis "Library for manipulating many image formats")
1402 (description "Developer's Image Library (DevIL) is a library to develop
1403 applications with support for many types of images. DevIL can load, save,
1404 convert, manipulate, filter and display a wide variety of image formats.")
1405 (home-page "http://openil.sourceforge.net")
1406 (license license:lgpl2.1+)))
1407
1408 (define-public jasper
1409 (package
1410 (name "jasper")
1411 (version "2.0.27")
1412 (source (origin
1413 (method git-fetch)
1414 (uri (git-reference
1415 (url "https://github.com/mdadams/jasper")
1416 (commit (string-append "version-" version))))
1417 (file-name (git-file-name name version))
1418 (sha256
1419 (base32
1420 "0mrnazk8qla7nn59xad86gmrf5fzqcv74j5xhcdrxbgfw67l17zd"))))
1421 (build-system cmake-build-system)
1422 (inputs
1423 `(("libjpeg" ,libjpeg-turbo)))
1424 (synopsis "JPEG-2000 library")
1425 (description "The JasPer Project is an initiative to provide a reference
1426 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1427 ISO/IEC 15444-1).")
1428 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1429 (license (license:x11-style "file://LICENSE"))))
1430
1431 (define-public zimg
1432 (package
1433 (name "zimg")
1434 (version "2.9.3")
1435 (source
1436 (origin
1437 (method git-fetch)
1438 (uri (git-reference
1439 (url "https://github.com/sekrit-twc/zimg")
1440 (commit (string-append "release-" version))))
1441 (file-name (git-file-name name version))
1442 (sha256
1443 (base32 "1dqyrq3p8bkgvj4ci50ac342hjnhyz6xxvhiwp7wpi3v3nbj7s02"))))
1444 (build-system gnu-build-system)
1445 (native-inputs
1446 `(("autoconf" ,autoconf)
1447 ("automake" ,automake)
1448 ("libtool" ,libtool)))
1449 (synopsis "Scaling, colorspace conversion, and dithering library")
1450 (description "Zimg implements the commonly required image processing basics
1451 of scaling, colorspace conversion, and depth conversion. A simple API enables
1452 conversion between any supported formats to operate with minimal knowledge from
1453 the programmer.")
1454 (home-page "https://github.com/sekrit-twc/zimg")
1455 ;; test/extra/ contains musl-libm,
1456 ;; which is MIT/expat licensed, but only used for tests
1457 (license license:wtfpl2)))
1458
1459 (define-public perceptualdiff
1460 (package
1461 (name "perceptualdiff")
1462 (version "1.3")
1463 (source
1464 (origin
1465 (method git-fetch)
1466 (uri (git-reference
1467 (url "https://github.com/myint/perceptualdiff")
1468 (commit (string-append "v" version))))
1469 (file-name (git-file-name name version))
1470 (sha256
1471 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
1472 (build-system cmake-build-system)
1473 (inputs `(("freeimage" ,freeimage)))
1474 (arguments
1475 '(#:phases (modify-phases %standard-phases
1476 (add-after 'unpack 'fix-tests
1477 ;; cmake-build-system uses a build/ directory outside
1478 ;; of the source tree, one level higher than expected
1479 (lambda _
1480 (substitute* "test/run_tests.bash"
1481 (("../build") "../../build"))
1482 #t)))))
1483 (home-page "https://github.com/myint/perceptualdiff")
1484 (synopsis "Perceptual image comparison utility")
1485 (description "PerceptualDiff visually compares two images to determine
1486 whether they look alike. It uses a computational model of the human visual
1487 system to detect similarities. This allows it too see beyond irrelevant
1488 differences in file encoding, image quality, and other small variations.")
1489 (license license:gpl2+)))
1490
1491 (define-public steghide
1492 (package
1493 (name "steghide")
1494 (version "0.5.1")
1495 (source (origin
1496 (method url-fetch)
1497 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1498 version "/steghide-" version ".tar.bz2"))
1499 (sha256
1500 (base32
1501 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1502 (patches (list (search-patch "steghide-fixes.patch")))))
1503 (build-system gnu-build-system)
1504 (native-inputs
1505 `(("gettext" ,gettext-minimal)
1506 ("libtool" ,libtool)
1507 ("perl" ,perl))) ;for tests
1508 (inputs
1509 `(("libmhash" ,libmhash)
1510 ("libmcrypt" ,libmcrypt)
1511 ("libjpeg" ,libjpeg-turbo)
1512 ("zlib" ,zlib)))
1513 (arguments
1514 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1515
1516 #:phases (modify-phases %standard-phases
1517 (add-before 'configure 'set-perl-search-path
1518 (lambda _
1519 ;; Work around "dotless @INC" build failure.
1520 (setenv "PERL5LIB"
1521 (string-append (getcwd) "/tests:"
1522 (getenv "PERL5LIB")))
1523 #t)))))
1524 (home-page "http://steghide.sourceforge.net")
1525 (synopsis "Image and audio steganography")
1526 (description
1527 "Steghide is a program to hide data in various kinds of image and audio
1528 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1529 changed, making the embedding resistant against first-order statistical tests.")
1530 (license license:gpl2+)))
1531
1532 (define-public optipng
1533 (package
1534 (name "optipng")
1535 (version "0.7.7")
1536 (source
1537 (origin
1538 (method url-fetch)
1539 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1540 version ".tar.gz"))
1541 (sha256
1542 (base32
1543 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
1544 (modules '((guix build utils)))
1545 (snippet
1546 '(begin
1547 (delete-file-recursively "src/libpng")
1548 (delete-file-recursively "src/zlib")
1549 #t))))
1550 (build-system gnu-build-system)
1551 (inputs
1552 `(("libpng" ,libpng)
1553 ("zlib" ,zlib)))
1554 (arguments
1555 '(#:phases
1556 (modify-phases %standard-phases
1557 (replace 'configure
1558 (lambda* (#:key outputs #:allow-other-keys)
1559 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1560 (invoke "sh" "configure"
1561 (string-append "--prefix=" (assoc-ref outputs "out"))
1562 "-with-system-libs")
1563 #t)))))
1564 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1565 (description "OptiPNG is a PNG optimizer that recompresses image
1566 files to a smaller size, without losing any information. This program
1567 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1568 PNG, and performs PNG integrity checks and corrections.")
1569 (home-page "http://optipng.sourceforge.net/")
1570 (license license:zlib)))
1571
1572 (define-public imgp
1573 (package
1574 (name "imgp")
1575 (version "2.8")
1576 (source
1577 (origin
1578 (method url-fetch)
1579 (uri (pypi-uri "imgp" version))
1580 (sha256
1581 (base32 "0q99h9wv9rynig0s0flnr9mxi541zzl0gw8vh4y6m5x132diilri"))))
1582 (build-system python-build-system)
1583 (arguments
1584 `(#:tests? #f ;there are no tests
1585 #:phases
1586 (modify-phases %standard-phases
1587 ;; setup.py expects the file to be named 'imgp'.
1588 (add-after 'unpack 'rename-imgp
1589 (lambda _
1590 (rename-file "imgp.py" "imgp")
1591 #t)))))
1592 (inputs
1593 `(("python-pillow" ,python-pillow)))
1594 (home-page "https://github.com/jarun/imgp")
1595 (synopsis "High-performance CLI batch image resizer & rotator")
1596 (description
1597 "@code{imgp} is a command line image resizer and rotator for JPEG and PNG
1598 images. It can resize (or thumbnail) and rotate thousands of images in a go
1599 while saving significantly on storage.
1600
1601 This package may optionally be built with @code{python-pillow-simd} in place
1602 of @{python-pillow} for SIMD parallelism.")
1603 (license license:gpl3+)))
1604
1605 (define-public pngsuite
1606 (package
1607 (name "pngsuite")
1608 (version "2017jul19")
1609 (source
1610 (origin
1611 (method url-fetch/tarbomb)
1612 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
1613 version ".tgz"))
1614 (sha256
1615 (base32
1616 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
1617 (build-system gnu-build-system)
1618 (arguments
1619 '(#:tests? #f ; there is no test target
1620 #:license-file-regexp "PngSuite.LICENSE"
1621 #:phases
1622 (modify-phases %standard-phases
1623 (replace 'install
1624 (lambda* (#:key outputs #:allow-other-keys)
1625 (let ((out (assoc-ref outputs "out")))
1626 (copy-recursively "." (string-append out "/"))
1627 #t)))
1628 (delete 'build)
1629 (delete 'configure))))
1630 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
1631 (synopsis "Example PNGs for use in test suites")
1632 (description "Collection of graphics images created to test PNG
1633 applications like viewers, converters and editors. As far as that is
1634 possible, all formats supported by the PNG standard are represented.")
1635 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
1636 use, copy, modify and distribute these images for any purpose and without fee
1637 is hereby granted."))))
1638
1639 (define-public libjpeg-turbo
1640 (package
1641 (name "libjpeg-turbo")
1642 (version "2.0.5")
1643 (source (origin
1644 (method url-fetch)
1645 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1646 version "/libjpeg-turbo-" version ".tar.gz"))
1647 (sha256
1648 (base32
1649 "0pbv6pc97kbj7ib31qcwi7lnmm9xg5y3b11aasmkhfjvf7rgdy0n"))))
1650 (build-system cmake-build-system)
1651 (native-inputs
1652 `(("nasm" ,nasm)))
1653 (arguments
1654 `(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
1655 "-DENABLE_STATIC=0"
1656 ;; djpeg-shared-3x2-float-prog-cmp fails on 32-bit PPC.
1657 ,@(if (string=? "powerpc-linux" (%current-system))
1658 `("-DFLOATTEST=NO")
1659 '())
1660 ;; The build system probes for the current CPU, but
1661 ;; that fails when cross-compiling.
1662 ,@(let ((target (%current-target-system)))
1663 (if target
1664 (cond
1665 ((string-prefix? "arm" target)
1666 `("-DCMAKE_SYSTEM_PROCESSOR=arm"))
1667 ((string-prefix? "aarch64" target)
1668 `("-DCMAKE_SYSTEM_PROCESSOR=aarch64"))
1669 ((string-prefix? "i686" target)
1670 `("-DCMAKE_SYSTEM_PROCESSOR=x86"))
1671 ((string-prefix? "x86_64" target)
1672 `("-DCMAKE_SYSTEM_PROCESSOR=x86_64"))
1673 ;; 32-bit and 64-bit
1674 ((string-prefix? "powerpc" target)
1675 `("-DCMAKE_SYSTEM_PROCESSOR=powerpc"))
1676 (else '()))
1677 '())))
1678 ,@(if (%current-target-system)
1679 '()
1680 ;; Use a special "bootstrap" CMake for the native build to work
1681 ;; around a circular dependency between CMake and this package.
1682 `(#:cmake ,cmake-bootstrap))))
1683 (home-page "https://libjpeg-turbo.org/")
1684 (synopsis "SIMD-accelerated JPEG image handling library")
1685 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1686 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1687 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1688 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1689 a significant amount.
1690 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1691 but more straightforward TurboJPEG API, and provides a full-featured Java
1692 interface. It supports color space extensions that allow it to compress from
1693 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1694 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
1695 (license (list license:bsd-3 ;the TurboJPEG API library and programs
1696 license:ijg ;the libjpeg library and associated tools
1697 license:zlib)))) ;the libjpeg-turbo SIMD extensions
1698
1699 (define-deprecated libjpeg libjpeg-turbo)
1700 (export libjpeg)
1701
1702 (define-public niftilib
1703 (package
1704 (name "niftilib")
1705 (version "2.0.0")
1706 (source (origin
1707 (method url-fetch)
1708 (uri (list (string-append "mirror://sourceforge/niftilib/"
1709 "nifticlib/nifticlib_"
1710 (string-join (string-split version #\.) "_")
1711 "/nifticlib-" version ".tar.gz")))
1712 (sha256
1713 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1714 (build-system gnu-build-system)
1715 (arguments
1716 '(#:tests? #f ; there is no test target
1717 #:parallel-build? #f ; not supported
1718 #:make-flags
1719 (list "SHELL=bash"
1720 (string-append "ZLIB_INC="
1721 (assoc-ref %build-inputs "zlib") "/include")
1722 ;; Append "-fPIC" to CFLAGS.
1723 (string-append "CFLAGS="
1724 "-Wall -ansi -pedantic -fPIC"))
1725 #:phases
1726 (modify-phases %standard-phases
1727 (replace 'install
1728 (lambda* (#:key outputs #:allow-other-keys)
1729 (let ((out (assoc-ref outputs "out")))
1730 (for-each
1731 (lambda (dir)
1732 (copy-recursively dir (string-append out "/" dir)))
1733 '("bin" "lib" "include")))
1734 #t))
1735 (delete 'configure))))
1736 (inputs
1737 `(("zlib" ,zlib)))
1738 (synopsis "Library for reading and writing files in the nifti-1 format")
1739 (description "Niftilib is a set of i/o libraries for reading and writing
1740 files in the nifti-1 data format - a binary file format for storing
1741 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1742 (fMRI) brain images.")
1743 (home-page "http://niftilib.sourceforge.net")
1744 (license license:public-domain)))
1745
1746 (define-public gpick
1747 (package
1748 (name "gpick")
1749 (version "0.2.6")
1750 (source (origin
1751 (method git-fetch)
1752 (uri (git-reference
1753 (url "https://github.com/thezbyg/gpick")
1754 (commit (string-append name "-" version))))
1755 (file-name (git-file-name name version))
1756 (sha256
1757 (base32
1758 "0nl89gca5nmbyycv5rl5bm6k7facapdk4pab9pl949aa3cjw9bk7"))))
1759 (build-system scons-build-system)
1760 (native-inputs
1761 `(("boost" ,boost)
1762 ("gettext" ,gettext-minimal)
1763 ("pkg-config" ,pkg-config)
1764 ("ragel" ,ragel)))
1765 (inputs
1766 `(("expat" ,expat)
1767 ("gtk2" ,gtk+-2)
1768 ("lua" ,lua-5.2)))
1769 (arguments
1770 `(#:tests? #f
1771 #:scons ,scons-python2
1772 #:scons-flags (list (string-append "DESTDIR=" %output))
1773 #:phases
1774 (modify-phases %standard-phases
1775 (add-before 'build 'fix-lua-reference
1776 (lambda _
1777 (substitute* "SConscript"
1778 (("lua5.2") "lua-5.2"))
1779 #t)))))
1780 (home-page "http://www.gpick.org/")
1781 (synopsis "Color picker")
1782 (description "Gpick is an advanced color picker and palette editing tool.")
1783 (license license:bsd-3)))
1784
1785 (define-public libiptcdata
1786 (package
1787 (name "libiptcdata")
1788 (version "1.0.5")
1789 (source (origin
1790 (method url-fetch)
1791 (uri (string-append "https://github.com/ianw/libiptcdata"
1792 "/releases/download/release_"
1793 (string-join (string-split version #\.) "_")
1794 "/" name "-" version ".tar.gz"))
1795 (sha256
1796 (base32
1797 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
1798 (build-system gnu-build-system)
1799 (home-page "https://github.com/ianw/libiptcdata")
1800 (synopsis "IPTC metadata manipulation library")
1801 (description
1802 "Libiptcdata is a C library for manipulating the International Press
1803 Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
1804 such as images. This metadata can include captions and keywords, often used by
1805 popular photo management applications. The library provides routines for
1806 parsing, viewing, modifying, and saving this metadata.")
1807 (license license:lgpl2.0+)))
1808
1809 (define-public flameshot
1810 (package
1811 (name "flameshot")
1812 (version "0.8.5")
1813 (source
1814 (origin
1815 (method git-fetch)
1816 (uri (git-reference
1817 (url "https://github.com/flameshot-org/flameshot")
1818 (commit (string-append "v" version))))
1819 (file-name (git-file-name name version))
1820 (sha256
1821 (base32
1822 "1z77igs60lz106vsf6wsayxjafxm3llf2lm4dpvsqyyrxybfq191"))))
1823 (build-system qt-build-system)
1824 (native-inputs
1825 `(("qttools" ,qttools)))
1826 (inputs
1827 `(("qtbase" ,qtbase)
1828 ("qtsvg" ,qtsvg)))
1829 (arguments
1830 `(#:tests? #f)) ;no tests
1831 (home-page "https://github.com/flameshot-org/flameshot")
1832 (synopsis "Powerful yet simple to use screenshot software")
1833 (description "Flameshot is a screenshot program.
1834 Features:
1835
1836 @itemize
1837 @item Customizable appearance.
1838 @item Easy to use.
1839 @item In-app screenshot edition.
1840 @item DBus interface.
1841 @item Upload to Imgur.
1842 @end itemize\n")
1843 (license license:gpl3+)))
1844
1845 (define-public swappy
1846 (package
1847 (name "swappy")
1848 (version "1.2.1")
1849 (source
1850 (origin
1851 (method git-fetch)
1852 (uri (git-reference
1853 (url "https://github.com/jtheoof/swappy")
1854 (commit (string-append "v" version))))
1855 (file-name (git-file-name name version))
1856 (sha256
1857 (base32 "14ac2jmnak7avcz0jhqjm30vk7pv3gq5aq5rdyh84k8c613kkicf"))))
1858 (build-system meson-build-system)
1859 (native-inputs
1860 `(("pkg-config" ,pkg-config)
1861 ("scdoc" ,scdoc)
1862 ("glib" ,glib "bin"))) ; for 'glib-compile-resources'
1863 (inputs
1864 `(("gtk+" ,gtk+)
1865 ("libnotify" ,libnotify)))
1866 (home-page "https://github.com/jtheoof/swappy")
1867 (synopsis "Grab and edit on the fly snapshots of a Wayland compositor")
1868 (description
1869 "@command{swappy} is a command-line utility to take and edit screenshots
1870 of Wayland desktops. Works great with grim, slurp and sway. But can easily
1871 work with other screen copy tools that can output a final PNG image to
1872 stdout.")
1873 (license license:expat)))
1874
1875 (define-public gifsicle
1876 (package
1877 (name "gifsicle")
1878 (version "1.92")
1879 (source
1880 (origin
1881 (method url-fetch)
1882 (uri (string-append "https://www.lcdf.org/gifsicle/gifsicle-"
1883 version ".tar.gz"))
1884 (sha256
1885 (base32 "0rffpzxcak19k6cngpxn73khvm3z1gswrqs90ycdzzb53p05ddas"))))
1886 (build-system gnu-build-system)
1887 (arguments
1888 '(#:phases
1889 (modify-phases %standard-phases
1890 (add-before 'check 'patch-tests
1891 (lambda _
1892 (substitute* "test/testie"
1893 (("/usr/bin/perl")
1894 (which "perl"))
1895 (("/bin/sh")
1896 (which "sh"))
1897 (("/bin/rm")
1898 (which "rm")))
1899 #t)))))
1900 (native-inputs `(("perl" ,perl))) ; only for tests
1901 (inputs `(("libx11" ,libx11)))
1902 (home-page "https://www.lcdf.org/gifsicle/")
1903 (synopsis "Edit GIF images and animations")
1904 (description "Gifsicle is a command-line GIF image manipulation tool that:
1905
1906 @itemize
1907 @item Provides a batch mode for changing GIFs in place.
1908 @item Prints detailed information about GIFs, including comments.
1909 @item Control over interlacing, comments, looping, transparency, etc.
1910 @item Creates well-behaved GIFs: removes redundant colors, only uses local color
1911 tables, etc.
1912 @item Shrinks colormaps and change images to use the Web-safe palette.
1913 @item Optimizes GIF animations, or unoptimizes them for easier editing.
1914 @end itemize
1915
1916 Two other programs are included with Gifsicle: @command{gifview} is a
1917 lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1918 identical visual appearance.")
1919 (license license:gpl2+)))
1920
1921 ;; 1.0.7 is buggy and reverted in git repository.
1922 (define-public jp2a
1923 (package
1924 (name "jp2a")
1925 (version "1.0.6")
1926 (source
1927 (origin
1928 (method url-fetch)
1929 (uri (string-append "mirror://debian/pool/main/j/jp2a/jp2a_"
1930 version ".orig.tar.gz"))
1931 (sha256
1932 (base32
1933 "076frk3pa16s4r1b10zgy81vdlz0385zh3ykbnkaij25jn5aqc09"))))
1934 (build-system gnu-build-system)
1935 (inputs
1936 `(("curl" ,curl)
1937 ("libjpeg" ,libjpeg-turbo)
1938 ("ncurses" ,ncurses)))
1939 (home-page "https://csl.name/jp2a/")
1940 (synopsis "Convert JPEG images to ASCII")
1941 (description
1942 "Jp2a is a small utility that converts JPEG images to ASCII.")
1943 (license license:gpl2)))
1944
1945 (define-public grim
1946 (package
1947 (name "grim")
1948 (version "1.3.2")
1949 (source
1950 (origin
1951 (method git-fetch)
1952 (uri (git-reference
1953 (url "https://github.com/emersion/grim")
1954 (commit (string-append "v" version))))
1955 (file-name (git-file-name name version))
1956 (sha256
1957 (base32 "1l4gwvvc0zvg5b6f6w92xjhmwj7cg9hlgrf43lc7ygaz8dh6cmzg"))))
1958 (build-system meson-build-system)
1959 (native-inputs `(("pkg-config" ,pkg-config)
1960 ("scdoc" ,scdoc)))
1961 (inputs `(("cairo" ,cairo)
1962 ("libjpeg-turbo" ,libjpeg-turbo)
1963 ("wayland" ,wayland)
1964 ("wayland-protocols" ,wayland-protocols)))
1965 (home-page "https://github.com/emersion/grim")
1966 (synopsis "Create screenshots from a Wayland compositor")
1967 (description "grim can create screenshots from a Wayland compositor.")
1968 ;; MIT license.
1969 (license license:expat)))
1970
1971 (define-public slurp
1972 (package
1973 (name "slurp")
1974 (version "1.3.2")
1975 (source
1976 (origin
1977 (method git-fetch)
1978 (uri (git-reference
1979 (url "https://github.com/emersion/slurp")
1980 (commit (string-append "v" version))))
1981 (file-name (git-file-name name version))
1982 (sha256
1983 (base32 "00dx6ds1227qnxqrw58k0am78q8fa49rgp1zingrkjcbpbi7g475"))))
1984 (build-system meson-build-system)
1985 (native-inputs
1986 `(("pkg-config" ,pkg-config)
1987 ("scdoc" ,scdoc)))
1988 (inputs
1989 `(("cairo" ,cairo)
1990 ("libxkbcommon" ,libxkbcommon)
1991 ("wayland" ,wayland)
1992 ("wayland-protocols" ,wayland-protocols)))
1993 (home-page "https://github.com/emersion/slurp")
1994 (synopsis "Select a region in a Wayland compositor")
1995 (description "Slurp can select a region in a Wayland compositor and print it
1996 to the standard output. It works well together with grim.")
1997 (license license:expat)))
1998
1999 (define-public sng
2000 (package
2001 (name "sng")
2002 (version "1.1.0")
2003 (source
2004 (origin
2005 (method url-fetch)
2006 (uri (string-append "mirror://sourceforge/sng/sng-"
2007 version ".tar.gz"))
2008 (sha256
2009 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
2010 (build-system gnu-build-system)
2011 (arguments
2012 `(#:phases
2013 (modify-phases %standard-phases
2014 (add-before 'check 'link-pngsuite
2015 ;; tests expect pngsuite in source dir
2016 (lambda* (#:key inputs #:allow-other-keys)
2017 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
2018 #t)))
2019 #:configure-flags
2020 (list (string-append "--with-rgbtxt="
2021 (assoc-ref %build-inputs "xorg-rgb")
2022 "/share/X11/rgb.txt"))))
2023 (inputs `(("xorg-rgb" ,xorg-rgb)
2024 ("libpng" ,libpng)))
2025 (native-inputs `(("pngsuite" ,pngsuite)))
2026 (home-page "http://sng.sourceforge.net")
2027 (synopsis "Markup language for representing PNG contents")
2028 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
2029 specifically to represent the entire contents of a PNG (Portable Network
2030 Graphics) file in an editable form. Thus, SNGs representing elaborate
2031 graphics images and ancillary chunk data can be readily generated or modified
2032 using only text tools.
2033
2034 SNG is implemented by a compiler/decompiler called sng that
2035 losslessly translates between SNG and PNG.")
2036 (license license:zlib)))
2037
2038 (define-public lodepng
2039 ;; There are no tags in the repository, so we take the version as defined in
2040 ;; lodepng.cpp.
2041 (let ((commit "48e5364ef48ec2408f44c727657ac1b6703185f8")
2042 (revision "1")
2043 (version "20200215"))
2044 (package
2045 (name "lodepng")
2046 (version (git-version version revision commit))
2047 (source (origin
2048 (method git-fetch)
2049 (uri (git-reference
2050 (url "https://github.com/lvandeve/lodepng")
2051 (commit commit)))
2052 (sha256
2053 (base32
2054 "1a1x8ag2scanzb2066jm9hg2y9kaa3wmpgmz10l1x9bkpik612lw"))
2055 (file-name (git-file-name name version))))
2056 (build-system gnu-build-system)
2057 (arguments
2058 '(#:phases
2059 (modify-phases %standard-phases
2060 (delete 'configure)
2061 (replace 'build
2062 (lambda _
2063 (setenv "CXXFLAGS" "-fPIC")
2064 (invoke "make" "lodepng.o")
2065 (invoke "make" "lodepng_util.o")
2066 (invoke "g++" "-fPIC" "-O3"
2067 "-o" "liblodepng.so"
2068 "-shared" "lodepng.o" "lodepng_util.o")
2069 #t))
2070 (replace 'check
2071 (lambda _
2072 (invoke "make" "unittest")
2073 (invoke "./unittest")
2074 #t))
2075 (replace 'install
2076 (lambda* (#:key outputs #:allow-other-keys)
2077 (let* ((out (assoc-ref outputs "out"))
2078 (doc (string-append out "/share/doc"))
2079 (lib (string-append out "/lib"))
2080 (include (string-append out "/include")))
2081 (install-file "lodepng.h" include)
2082 (install-file "lodepng_util.h" include)
2083 (install-file "liblodepng.so" lib)
2084 (install-file "README.md" doc)
2085 #t))))))
2086 (home-page "https://lodev.org/lodepng/")
2087 (synopsis "PNG encoder and decoder in C and C++, without dependencies")
2088 (description "LodePNG is a PNG image decoder and encoder, all in one,
2089 no dependency or linkage required. It's made for C (ISO C90), and has a C++
2090 wrapper with a more convenient interface on top.")
2091 (license license:zlib))))
2092
2093 (define-public icoutils
2094 (package
2095 (name "icoutils")
2096 (version "0.32.3")
2097 (source
2098 (origin
2099 (method url-fetch)
2100 (uri (string-append
2101 "mirror://savannah/icoutils/icoutils-" version ".tar.bz2"))
2102 (sha256
2103 (base32 "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp"))))
2104 (build-system gnu-build-system)
2105 (inputs
2106 `(("libpng" ,libpng)
2107 ("perl" ,perl)))
2108 (propagated-inputs
2109 `(("perl-libwww" ,perl-libwww)))
2110 (home-page "https://www.nongnu.org/icoutils/")
2111 (synopsis "Extract and convert bitmaps from Windows icon and cursor files")
2112 (description "Icoutils are a set of program for extracting and converting
2113 bitmaps from Microsoft Windows icon and cursor files. These files usually
2114 have the extension @code{.ico} or @code{.cur}, but they can also be embedded
2115 in executables and libraries (@code{.dll}-files). (Such embedded files are
2116 referred to as resources.)
2117
2118 Conversion of these files to and from PNG images is done @command{icotool}.
2119 @command{extresso} automates these tasks with the help of special resource
2120 scripts. Resources such can be extracted from MS Windows executable and
2121 library files with @command{wrestool}.
2122
2123 This package can be used to create @code{favicon.ico} files for web sites.")
2124 (license license:gpl3+)))
2125
2126 (define-public libavif
2127 (package
2128 (name "libavif")
2129 (version "0.9.0")
2130 (source (origin
2131 (method git-fetch)
2132 (uri (git-reference
2133 (url "https://github.com/AOMediaCodec/libavif")
2134 (commit (string-append "v" version))))
2135 (file-name (git-file-name name version))
2136 (sha256
2137 (base32
2138 "1aw41m8ddrckq375w0lv2zd4ybhccsy1hw4f9kipppwxhgvk17gf"))))
2139 (build-system cmake-build-system)
2140 (arguments
2141 `(#:configure-flags '("-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
2142 "-DAVIF_CODEC_RAV1E=ON"
2143 "-DAVIF_BUILD_TESTS=ON")
2144 #:phases
2145 (modify-phases %standard-phases
2146 (replace 'check
2147 (lambda _
2148 (invoke "./aviftest" "../source/tests/data")))
2149 (add-after 'install 'install-readme
2150 (lambda* (#:key outputs #:allow-other-keys)
2151 (let* ((out (assoc-ref outputs "out"))
2152 (doc (string-append out "/share/doc/libavif-" ,version)))
2153 (install-file "../source/README.md" doc)
2154 #t))))))
2155 (inputs
2156 `(("dav1d" ,dav1d)
2157 ("libaom" ,libaom)
2158 ("rav1e" ,rav1e)))
2159 (synopsis "Encode and decode AVIF files")
2160 (description "Libavif is a C implementation of @acronym{AVIF, the AV1 Image
2161 File Format}. It can encode and decode all YUV formats and bit depths supported
2162 by AOM, including with alpha.")
2163 (home-page "https://github.com/AOMediaCodec/libavif")
2164 (license (list license:bsd-2 ; libavif itself
2165 license:expat)))) ; cJSON in the test suite
2166
2167 (define-public libheif
2168 (package
2169 (name "libheif")
2170 (version "1.11.0")
2171 (source
2172 (origin
2173 (method git-fetch)
2174 (uri (git-reference
2175 (url "https://github.com/strukturag/libheif")
2176 (commit (string-append "v" version))))
2177 (file-name (git-file-name name version))
2178 (sha256
2179 (base32 "036n63vlk4sk7y25q2kzyvvw4r5vv323ysbmbrcaprg9hdyjqgf5"))))
2180 (build-system cmake-build-system)
2181 (arguments
2182 `(#:tests? #f)) ;no test target although there is a tests folder
2183 (native-inputs
2184 `(("autoconf" ,autoconf)
2185 ("automake" ,automake)
2186 ("libtool" ,libtool)
2187 ("pkg-config" ,pkg-config)))
2188 (inputs
2189 `(("dav1d" ,dav1d)
2190 ("gdk-pixbuf" ,gdk-pixbuf) ;optional
2191 ("libaom" ,libaom)
2192 ("libde265" ,libde265)
2193 ("libjpeg" ,libjpeg-turbo)
2194 ("libpng" ,libpng)
2195 ("x265" ,x265)))
2196 (home-page "https://github.com/strukturag/libheif")
2197 (synopsis "HEIF and AVIF file format decoder and encoder")
2198 (description
2199 "@code{libheif} is an ISO/IEC 23008-12:2017 HEIF and AVIF (AV1 Image File
2200 Format) file format decoder and encoder.")
2201 (license license:lgpl3+)))
2202
2203 (define-public mtpaint
2204 (package
2205 (name "mtpaint")
2206 ;; The author neither releases tarballs nor uses git version tags.
2207 ;; Instead, author puts version in git commit title.
2208 (version "3.49.33")
2209 (source
2210 (origin
2211 (method git-fetch)
2212 (uri (git-reference
2213 (url "https://github.com/wjaguar/mtPaint")
2214 (commit "5272e2b1e773c8e02ac3506b2d3bde82ad946b21")))
2215 (file-name (git-file-name name version))
2216 (sha256
2217 (base32 "1bmq4m0dxczl18n1yiqb75g05a4c3pal1vdcyypkilx7ijsr0cmc"))))
2218 (build-system gnu-build-system)
2219 (native-inputs
2220 `(("gettext" ,gettext-minimal)
2221 ("pkg-config" ,pkg-config)
2222 ("which" ,which)))
2223 (inputs
2224 `(("imlib2" ,imlib2)
2225 ("libtiff" ,libtiff)
2226 ("libpng" ,libpng)
2227 ("libungif" ,libungif)
2228 ("libjpeg" ,libjpeg-turbo)
2229 ("libwebp" ,libwebp)
2230 ("openjpeg" ,openjpeg)
2231 ("lcms" ,lcms)
2232 ("zlib" ,zlib)
2233 ("glib" ,glib)
2234 ;; Support for gtk3 is in the testing stage.
2235 ("gtk+" ,gtk+-2)))
2236 (arguments
2237 `(#:configure-flags
2238 (list "intl" ; build internationalized version
2239 "man") ; build the man page
2240 #:tests? #f)) ; no test suite
2241 (home-page "http://mtpaint.sourceforge.net/")
2242 (synopsis "Create pixel art and manipulate digital images")
2243 (description
2244 "Mtpaint is a graphic editing program which uses the GTK+ toolkit.
2245 It can create and edit indexed palette or 24bit RGB images, offers basic
2246 painting and palette manipulation tools. It also handles JPEG, JPEG2000,
2247 GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
2248 (license license:gpl3+)))
2249
2250 (define-public mypaint
2251 (package
2252 (name "mypaint")
2253 (version "2.0.1")
2254 (source (origin
2255 (method url-fetch)
2256 (uri (string-append "https://github.com/mypaint/mypaint/"
2257 "releases/download/v" version "/mypaint-"
2258 version ".tar.xz"))
2259 (sha256
2260 (base32
2261 "05mvay73vb9d2sh1ckv4vny45n059dmsps1jcppjizfmrpbkgr7k"))))
2262 (build-system python-build-system)
2263 (arguments
2264 `(#:imported-modules ((guix build glib-or-gtk-build-system)
2265 ,@%python-build-system-modules)
2266 #:modules ((guix build python-build-system)
2267 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
2268 (guix build utils))
2269 #:phases
2270 (modify-phases %standard-phases
2271 (add-after 'install 'glib-or-gtk-wrap
2272 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
2273 (add-after 'install 'wrap-program
2274 (lambda* (#:key outputs inputs #:allow-other-keys)
2275 (let* ((out (assoc-ref outputs "out"))
2276 (gdk-pixbuf (assoc-ref inputs "gdk-pixbuf"))
2277 (gtk+ (assoc-ref inputs "gtk+")))
2278 (wrap-program (string-append out "/bin/mypaint")
2279 `("GI_TYPELIB_PATH" ":" prefix
2280 (,(getenv "GI_TYPELIB_PATH"))))
2281 #t)))
2282 (add-before 'check 'pre-check
2283 (lambda _
2284 ;; Tests need writing access
2285 (setenv "HOME" "/tmp")
2286 #t)))))
2287 (native-inputs
2288 `(("pkg-config" ,pkg-config)
2289 ("gobject-introspection" ,gobject-introspection)
2290 ("swig" ,swig)
2291 ("gettext" ,gettext-minimal)))
2292 (inputs
2293 `(("gtk+" ,gtk+)
2294 ("gdk-pixbuf" ,gdk-pixbuf+svg)
2295 ("hicolor-icon-theme" ,hicolor-icon-theme)
2296 ("libmypaint" ,libmypaint)
2297 ("mypaint-brushes" ,mypaint-brushes)
2298 ("json-c" ,json-c)
2299 ("lcms" ,lcms)
2300 ("python-numpy" ,python-numpy)
2301 ("python-pycairo" ,python-pycairo)
2302 ("python-pygobject" ,python-pygobject)))
2303 (home-page "http://mypaint.org/")
2304 (synopsis "Fast and simple painting app for artists")
2305 (description
2306 "MyPaint is a simple drawing and painting program that works well with
2307 Wacom-style graphics tablets.")
2308 (license license:gpl2+)))
2309
2310 (define-public phockup
2311 (package
2312 (name "phockup")
2313 (version "1.5.9")
2314 (source
2315 (origin
2316 (method git-fetch)
2317 (uri (git-reference
2318 (url "https://github.com/ivandokov/phockup")
2319 (commit version)))
2320 (file-name (git-file-name name version))
2321 (sha256
2322 (base32
2323 "13ajj0xch7yfqaaxbw0awxs0fz17n1rxir4gqh2wcgxjysqk1j2y"))))
2324 (build-system copy-build-system)
2325 (arguments
2326 `(#:install-plan '(("src" "share/phockup/")
2327 ("phockup.py" "share/phockup/"))
2328 #:phases
2329 (modify-phases %standard-phases
2330 (add-after 'unpack 'configure
2331 (lambda* (#:key inputs #:allow-other-keys)
2332 (substitute* (list "src/dependency.py" "src/exif.py")
2333 (("exiftool")
2334 (string-append (assoc-ref inputs "perl-image-exiftool")
2335 "/bin/exiftool")))
2336 #t))
2337 (add-before 'install 'check
2338 (lambda _
2339 (invoke "pytest")))
2340 (add-after 'install 'install-bin
2341 (lambda* (#:key outputs #:allow-other-keys)
2342 (let ((out (assoc-ref outputs "out")))
2343 (mkdir (string-append out "/bin"))
2344 (symlink (string-append out "/share/phockup/phockup.py")
2345 (string-append out "/bin/phockup")))
2346 #t)))))
2347 (inputs
2348 `(("perl-image-exiftool" ,perl-image-exiftool)
2349 ("python" ,python)))
2350 (native-inputs
2351 `(("python-pytest" ,python-pytest)
2352 ("python-pytest-mock" ,python-pytest-mock)))
2353 (home-page "https://github.com/ivandokov/phockup")
2354 (synopsis "Organize photos and videos in folders")
2355 (description "Phockup is a media sorting tool that uses creation date and
2356 time information in photos and videos to organize them into folders by year,
2357 month and day. All files which are not images or videos or those which do not
2358 have creation date information will be placed in a folder called
2359 @file{unknown}.")
2360 (license license:expat)))