projects/guix·blob java-team · refs

3562 lines · 140.7 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2017, 2019, 2021-2023 Ludovic Courtès <[email protected]>
3;;; Copyright © 2013, 2015, 2016, 2025 Andreas Enge <[email protected]>
4;;; Copyright © 2014, 2015, 2016, 2020 Mark H Weaver <[email protected]>
5;;; Copyright © 2014, 2015 Alex Kost <[email protected]>
6;;; Copyright © 2014, 2016, 2017, 2018, 2019, 2025 Ricardo Wurmus <[email protected]>
7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <[email protected]>
8;;; Copyright © 2015 Amirouche Boubekki <[email protected]>
9;;; Copyright © 2014, 2017 John Darrington <[email protected]>
10;;; Copyright © 2016, 2017, 2018, 2020 Leo Famulari <[email protected]>
11;;; Copyright © 2016-2025 Efraim Flashner <[email protected]>
12;;; Copyright © 2016–2022 Tobias Geerinckx-Rice <[email protected]>
13;;; Copyright © 2016 Eric Bavier <[email protected]>
14;;; Copyright © 2016, 2017, 2020, 2021, 2022, 2025 Arun Isaac <[email protected]>
15;;; Copyright © 2016, 2017 Kei Kebreau <[email protected]>
16;;; Copyright © 2017 Nikita <[email protected]>
17;;; Copyright © 2017,2019,2020 Hartmut Goebel <[email protected]>
18;;; Copyright © 2017 Julien Lepiller <[email protected]>
19;;; Copyright © 2018 Joshua Sierles, Nextjournal <[email protected]>
20;;; Copyright © 2018 Fis Trivial <[email protected]>
21;;; Copyright © 2018 Pierre Neidhardt <[email protected]>
22;;; Copyright © 2018-2020, 2022 Marius Bakke <[email protected]>
23;;; Copyright © 2018 Pierre-Antoine Rouby <[email protected]>
24;;; Copyright © 2018 Alex Vong <[email protected]>
25;;; Copyright © 2018 Rutger Helling <[email protected]>
26;;; Copyright © 2020 Giacomo Leidi <[email protected]>
27;;; Copyright © 2020 R Veera Kumar <[email protected]>
28;;; Copyright © 2020, 2023, 2026 Maxim Cournoyer <[email protected]>
29;;; Copyright © 2020, 2025 Janneke Nieuwenhuizen <[email protected]>
30;;; Copyright © 2020 Zhu Zihao <[email protected]>
31;;; Copyright © 2020, 2021, 2022, 2023, 2024 Vinicius Monego <[email protected]>
32;;; Copyright © 2021, 2026 Sharlatan Hellseher <[email protected]>
33;;; Copyright © 2021 Nicolò Balzarotti <[email protected]>
34;;; Copyright © 2021 Alexandr Vityazev <[email protected]>
35;;; Copyright © 2022 Jai Vetrivelan <[email protected]>
36;;; Copyright © 2022 ( <[email protected]>
37;;; Copyright © 2022-2023 Bruno Victal <[email protected]>
38;;; Copyright © 2023, 2024 Zheng Junjie <[email protected]>
39;;; Copyright © 2023-2025 Nicolas Goaziou <[email protected]>
40;;; Copyright © 2023, 2025 Artyom V. Poptsov <[email protected]>
41;;; Copyright © 2024 chris <[email protected]>
42;;; Copyright © 2025 Josep Bigorra <[email protected]>
43;;; Copyright © 2025 Jake Forster <[email protected]>
44;;; Copyright © 2025 Ghislain Vaillant <[email protected]>
45;;; Copyright © 2025 Junker <[email protected]>
46;;; Copyright © 2025 Hugo Buddelmeijer <[email protected]>
47;;; Copyright © 2026 Carlos Durán Domínguez <[email protected]>
48;;; Copyright © 2026 Sughosha <[email protected]>
49;;; Copyright © 2026 Untrusem <[email protected]>
50;;;
51;;; This file is part of GNU Guix.
52;;;
53;;; GNU Guix is free software; you can redistribute it and/or modify it
54;;; under the terms of the GNU General Public License as published by
55;;; the Free Software Foundation; either version 3 of the License, or (at
56;;; your option) any later version.
57;;;
58;;; GNU Guix is distributed in the hope that it will be useful, but
59;;; WITHOUT ANY WARRANTY; without even the implied warranty of
60;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61;;; GNU General Public License for more details.
62;;;
63;;; You should have received a copy of the GNU General Public License
64;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
65
66(define-module (gnu packages image)
67 #:use-module (gnu packages)
68 #:use-module (gnu packages algebra)
69 #:use-module (gnu packages assembly)
70 #:use-module (gnu packages autotools)
71 #:use-module (gnu packages base)
72 #:use-module (gnu packages bash)
73 #:use-module (gnu packages boost)
74 #:use-module (gnu packages build-tools)
75 #:use-module (gnu packages check)
76 #:use-module (gnu packages cmake)
77 #:use-module (gnu packages compression)
78 #:use-module (gnu packages cpp)
79 #:use-module (gnu packages curl)
80 #:use-module (gnu packages datastructures)
81 #:use-module (gnu packages documentation)
82 #:use-module (gnu packages fonts)
83 #:use-module (gnu packages fontutils)
84 #:use-module (gnu packages freedesktop)
85 #:use-module (gnu packages gcc)
86 #:use-module (gnu packages gettext)
87 #:use-module (gnu packages ghostscript)
88 #:use-module (gnu packages gimp)
89 #:use-module (gnu packages gl)
90 #:use-module (gnu packages glib)
91 #:use-module (gnu packages gnome)
92 #:use-module (gnu packages golang-build)
93 #:use-module (gnu packages golang-graphics)
94 #:use-module (gnu packages golang-xyz)
95 #:use-module (gnu packages graphics)
96 #:use-module (gnu packages gtk)
97 #:use-module (gnu packages guile)
98 #:use-module (gnu packages imagemagick)
99 #:use-module (gnu packages linux)
100 #:use-module (gnu packages lua)
101 #:use-module (gnu packages man)
102 #:use-module (gnu packages maths)
103 #:use-module (gnu packages mcrypt)
104 #:use-module (gnu packages mp3)
105 #:use-module (gnu packages ncurses)
106 #:use-module (gnu packages ocr)
107 #:use-module (gnu packages perl)
108 #:use-module (gnu packages photo)
109 #:use-module (gnu packages pkg-config)
110 #:use-module (gnu packages popt)
111 #:use-module (gnu packages python)
112 #:use-module (gnu packages python-build)
113 #:use-module (gnu packages python-check)
114 #:use-module (gnu packages python-xyz)
115 #:use-module (gnu packages qt)
116 #:use-module (gnu packages ragel)
117 #:use-module (gnu packages sphinx)
118 #:use-module (gnu packages sqlite)
119 #:use-module (gnu packages swig)
120 #:use-module (gnu packages textutils)
121 #:use-module (gnu packages video)
122 #:use-module (gnu packages web)
123 #:use-module (gnu packages xdisorg)
124 #:use-module (gnu packages xml)
125 #:use-module (gnu packages xorg)
126 #:use-module ((guix licenses) #:prefix license:)
127 #:use-module (guix packages)
128 #:use-module (guix gexp)
129 #:use-module (guix download)
130 #:use-module (guix git-download)
131 #:use-module (guix utils)
132 #:use-module (guix build-system gnu)
133 #:use-module (guix build-system cmake)
134 #:use-module (guix build-system copy)
135 #:use-module (guix build-system go)
136 #:use-module (guix build-system guile)
137 #:use-module (guix build-system meson)
138 #:use-module (guix build-system pyproject)
139 #:use-module (guix build-system qt)
140 #:use-module (guix build-system scons)
141 #:use-module (guix deprecation)
142 #:use-module (srfi srfi-1))
143
144(define-public converseen
145 (package
146 (name "converseen")
147 (version "0.15.1.0")
148 (source (origin
149 (method git-fetch)
150 (uri (git-reference
151 (url "https://github.com/Faster3ck/Converseen")
152 (commit (string-append "v" version))))
153 (file-name (git-file-name name version))
154 (sha256
155 (base32
156 "05nm6h4d2rq0kcf2maz95zvx8hd811wdqxxbzwahq1m2az1b11cn"))))
157 (build-system qt-build-system)
158 (arguments
159 (list
160 #:qtbase qtbase
161 #:tests? #false ;no tests
162 #:configure-flags #~(list "-DUSE_QT6=yes")
163 #:phases
164 #~(modify-phases %standard-phases
165 (add-after 'unpack 'patch-source
166 (lambda _
167 ;; Disable auto update and website links, for privacy concerns.
168 (substitute* "src/mainwindowimpl.cpp"
169 (("up->checkForUpdates[(][)];") ""))
170 (substitute* '("src/dialoginfo.cpp" "src/mainwindowimpl.cpp")
171 (("QDesktopServices::openUrl.*;") ""))
172 ;; Fix translations location. Without this, only English is
173 ;; offered.
174 (substitute* "src/translator.cpp"
175 (("QString\\(\"%1/share/converseen/loc\"\\).arg\\(rootPath\\)")
176 (string-append "QString(\""
177 #$output
178 "/share/converseen/loc\")"))))))))
179 (native-inputs
180 (list pkg-config qttools))
181 (inputs
182 (list imagemagick qtbase qtwayland))
183 (home-page "https://converseen.fasterland.net/")
184 (synopsis "Batch image converter and resizer")
185 (description
186 "Converseen is an image batch conversion tool. You can resize and
187convert images in more than 100 different formats.")
188 (license license:gpl3+)))
189
190(define-public didder
191 (package
192 (name "didder")
193 ;; There have been feature addition like color quantization but no
194 ;; releases with the feature.
195 ;; See: <https://github.com/makew0rld/didder/issues/31>.
196 (properties '((commit . "408a18aef878b456fe5cdbec406070fd5bd5c2d2")
197 (revision . "0")))
198 (version (git-version "1.3.0"
199 (assoc-ref properties 'revision)
200 (assoc-ref properties 'commit)))
201 (source
202 (origin
203 (method git-fetch)
204 (uri (git-reference
205 (url "https://github.com/makew0rld/didder")
206 (commit (assoc-ref properties 'commit))))
207 (file-name (git-file-name name version))
208 (sha256
209 (base32 "12vpxzn8p6ay5zqm9g83v0mf4i5nmm1xp13bhygs2yr24pbkkr24"))))
210 (build-system go-build-system)
211 (arguments
212 (list
213 #:install-source? #f
214 #:build-flags
215 #~(list (string-append "-ldflags="
216 "-X main.builtBy=Guix"
217 " -X main.version=" #$version
218 " -X main.commit=" #$version))
219 #:import-path "github.com/makeworld-the-better-one/didder"
220 #:phases
221 #~(modify-phases %standard-phases
222 (add-after 'install 'install-man-page
223 (lambda* (#:key import-path #:allow-other-keys)
224 (let ((man1 (string-append #$output "/share/man/man1/"))
225 (page (format #f "src/~a/didder.1" import-path)))
226 (install-file page man1)))))))
227 (native-inputs
228 (list go-github-com-disintegration-imaging
229 go-github-com-joshdk-quantize
230 go-github-com-makeworld-the-better-one-dither-v2
231 go-github-com-urfave-cli-v2
232 go-golang-org-x-image))
233 (home-page "https://github.com/makew0rld/didder")
234 (synopsis "Image Dithering Utility")
235 (description
236 "Didder is a command-line image dithering tool. It can also be used
237for pipeline scripting. It is backed by
238@url{https://github.com/makeworld-the-better-one/dither, dithering library}.
239It provides various dithering algorithms and you can provide your own by
240specifying a matrix in json format")
241 (license license:gpl3)))
242
243(define-public gradia
244 (package
245 (name "gradia")
246 (version "1.13.0")
247 (source
248 (origin
249 (method git-fetch)
250 (uri (git-reference
251 (url "https://github.com/AlexanderVanhee/Gradia")
252 (commit (string-append "v" version))))
253 (file-name (git-file-name name version))
254 (sha256
255 (base32 "00s6xj9crj5gkh233q98fmq67f41y877xgrn49cycwb3kybp237n"))))
256 (build-system meson-build-system)
257 (arguments
258 (list
259 #:imported-modules (append %meson-build-system-modules
260 %pyproject-build-system-modules)
261 #:modules '((guix build meson-build-system)
262 ((guix build pyproject-build-system)
263 #:prefix py:)
264 (guix build utils))
265 #:glib-or-gtk? #t
266 #:phases
267 #~(modify-phases %standard-phases
268 (add-after 'unpack 'skip-gtk-update-icon-cache
269 (lambda _
270 (substitute* "meson.build"
271 (("gtk_update_icon_cache: true")
272 "gtk_update_icon_cache: false")
273 (("update_desktop_database: true")
274 "update_desktop_database: false"))))
275 (add-after 'unpack 'set-tesseract-and-tessdata-path
276 (lambda _
277 (let* ((tesseract #$(this-package-input "tesseract-ocr"))
278 (tesseract-bin (string-append tesseract "/bin/tesseract"))
279 (tessdata (string-append tesseract "/share/tessdata")))
280 (substitute* "meson.build"
281 (("OCR_TESSERACT_CMD = '/app/bin/tesseract'")
282 (format #f "OCR_TESSERACT_CMD = '~a'" tesseract-bin))
283 (("OCR_ORIGINAL_TESSDATA_DIR = '/app/share/tessdata'")
284 (format #f "OCR_ORIGINAL_TESSDATA_DIR = '~a'" tessdata))))))
285 (add-after 'glib-or-gtk-wrap 'python-and-gi-wrap
286 (lambda* (#:key inputs outputs #:allow-other-keys)
287 (wrap-program (string-append #$output "/bin/gradia")
288 `("GUIX_PYTHONPATH" =
289 (,(getenv "GUIX_PYTHONPATH") ,(py:site-packages inputs
290 outputs)))
291 `("GI_TYPELIB_PATH" =
292 (,(getenv "GI_TYPELIB_PATH")))
293 `("GDK_PIXBUF_MODULE_FILE" =
294 (,(getenv "GDK_PIXBUF_MODULE_FILE")))))))))
295 (inputs (list bash-minimal
296 gtk
297 gtksourceview
298 libadwaita
299 libportal
300 libsoup
301 python
302 python-pillow
303 python-pycairo
304 python-pygobject
305 python-pytesseract
306 tesseract-ocr
307 webp-pixbuf-loader))
308 (native-inputs (list blueprint-compiler
309 desktop-file-utils
310 gettext-minimal
311 `(,glib "bin")
312 gobject-introspection
313 pkg-config))
314 (home-page "https://github.com/AlexanderVanhee/Gradia")
315 (synopsis "Edit screenshots")
316 (description
317 "Gradia is a GTK 4 application for enhancing and preparing
318screenshots for blogs, social media, and documentation. It supports background
319customization, annotation tools (pen, arrow, text, highlight, stamp), padding,
320cropping, @acronym{OCR, optical character recognition} and various export formats.")
321 (license license:gpl3+)))
322
323(define-public iqa
324 (package
325 (name "iqa")
326 (version "1.1.2")
327 (source
328 (origin
329 (method url-fetch)
330 (uri
331 (string-append "mirror://sourceforge/iqa/"
332 version " Release" "/iqa_" version "_src.tar.gz"))
333 (sha256
334 (base32 "00mgwy031ammab6bwmd1whhvqv3fxy1cs1igabq0n3ag12zhjs77"))))
335 (build-system gnu-build-system)
336 (arguments
337 `(#:test-target "test"
338 #:phases
339 (modify-phases %standard-phases
340 (delete 'configure)
341 (replace 'install
342 (lambda* (#:key outputs #:allow-other-keys)
343 (let* ((out (assoc-ref outputs "out"))
344 (lib (string-append out "/lib")))
345 (install-file "build/debug/libiqa.a" lib)
346 #t))))))
347 (synopsis "Image Quality Assessment")
348 (description "IQA is a C library for objectively measuring image/video
349quality. It implements many popular algorithms, such as MS-SSIM, MS-SSIM*,
350SIMM, MSE, and PSNR. It is designed to be fast, accurate, and reliable. All
351code is Valgrind-clean and unit tested.")
352 (home-page "https://sourceforge.net/projects/iqa/")
353 (license license:bsd-4)))
354
355(define-public libdicom
356 (package
357 (name "libdicom")
358 (version "1.2.0")
359 (source
360 (origin
361 (method git-fetch)
362 (uri (git-reference
363 (url "https://github.com/ImagingDataCommons/libdicom")
364 (commit (string-append "v" version))))
365 (file-name (git-file-name name version))
366 (sha256
367 (base32 "0l1z8riv7lrw65nswq8lvyvnxn5vc06gydwc96gj3ywb1gcqv831"))))
368 (build-system meson-build-system)
369 (inputs (list check uthash))
370 (native-inputs (list pkg-config))
371 (home-page "https://github.com/ImagingDataCommons/libdicom")
372 (synopsis "C library for reading DICOM files")
373 (description
374 "This package is a C library and a set of command-line tools for reading
375DICOM WSI files.")
376 (license license:expat)))
377
378(define-public libpng
379 (package
380 (name "libpng")
381 (version "1.6.39") ; Remember to also update libpng-apng if possible!
382 (source (origin
383 (method url-fetch)
384 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
385 version "/libpng-" version ".tar.xz")
386 (string-append
387 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
388 "/libpng16/libpng-" version ".tar.xz")
389 (string-append
390 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
391 "/libpng16/libpng-" version ".tar.xz")))
392 (sha256
393 (base32
394 "0dv90dxvmqpk7mbywyjbz8lh08cv4b0ksqp1y62mzvmlf379cihz"))))
395 (build-system gnu-build-system)
396 (arguments
397 `(#:configure-flags '("--disable-static")))
398
399 ;; libpng.la says "-lz", so propagate it.
400 (propagated-inputs (list zlib))
401
402 (synopsis "Library for handling PNG files")
403 (description
404 "Libpng is the official PNG (Portable Network Graphics) reference
405library. It supports almost all PNG features and is extensible.")
406 (license license:zlib)
407 (home-page "http://www.libpng.org/pub/png/libpng.html")))
408
409(define-public libpng-next
410 (package
411 (inherit libpng)
412 (version "1.6.50")
413 (source (origin
414 (method url-fetch)
415 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
416 version "/libpng-" version ".tar.xz")
417 (string-append
418 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
419 "/libpng16/libpng-" version ".tar.xz")
420 (string-append
421 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
422 "/libpng16/libpng-" version ".tar.xz")))
423 (sha256
424 (base32
425 "01r34c31gq136jwshdfira44wbl6nb8qfgj4a4vam9r0hr8rdwsd"))))))
426
427(define-public libpng-apng
428 ;; The APNG patch is maintained separately and may lag behind upstream libpng.
429 (package
430 (name "libpng-apng")
431 (version "1.6.39")
432 (source
433 (origin
434 (method url-fetch)
435 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
436 version "/libpng-" version ".tar.xz")
437 (string-append
438 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
439 "/libpng16/libpng-" version ".tar.xz")
440 (string-append
441 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
442 "/libpng16/libpng-" version ".tar.xz")))
443 (sha256
444 (base32 "0dv90dxvmqpk7mbywyjbz8lh08cv4b0ksqp1y62mzvmlf379cihz"))))
445 (build-system gnu-build-system)
446 (arguments
447 `(#:modules ((guix build gnu-build-system)
448 (guix build utils)
449 (srfi srfi-1))
450 #:phases
451 (modify-phases %standard-phases
452 (add-after 'unpack 'patch-apng
453 (lambda* (#:key inputs #:allow-other-keys)
454 (define (apply-patch file)
455 (invoke "patch" "-p1" "--force"
456 "--input" file))
457 (let ((apng.gz (assoc-ref inputs "apng")))
458 (format #t "Applying APNG patch '~a'...~%"
459 apng.gz)
460 (invoke "sh" "-c"
461 (string-append "gunzip < " apng.gz " > the-patch"))
462 (apply-patch "the-patch"))))
463 (add-before 'configure 'no-checks
464 (lambda _
465 (substitute* "Makefile.in"
466 (("^scripts/symbols.chk") "")
467 (("check: scripts/symbols.chk") "")))))))
468 (inputs
469 `(("apng" ,(origin
470 (method url-fetch)
471 (uri
472 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
473 version "/libpng-" version "-apng.patch.gz"))
474 (sha256
475 (base32
476 "1z8cx011a2c7vagwgi92rbmky1wi8awmrdldqh9f5k80pbmbdi2a"))))))
477 (native-inputs
478 (list libtool))
479 ;; libpng.la says "-lz", so propagate it.
480 (propagated-inputs
481 (list zlib))
482 (synopsis "APNG patch for libpng")
483 (description
484 "APNG (Animated Portable Network Graphics) is an unofficial
485extension of the APNG (Portable Network Graphics) format.
486APNG patch provides APNG support to libpng.")
487 (home-page "https://sourceforge.net/projects/libpng-apng/")
488 (license license:zlib)))
489
490;; Temporary, until 76798 merges into core-packages-team, and that merges into
491;; master.
492(define-public libpng-apng-next
493 (package
494 (inherit libpng-apng)
495 (version "1.6.50")
496 (source
497 (origin
498 (method url-fetch)
499 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
500 version "/libpng-" version ".tar.xz")
501 (string-append
502 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
503 "/libpng16/libpng-" version ".tar.xz")
504 (string-append
505 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
506 "/libpng16/libpng-" version ".tar.xz")))
507 (sha256
508 (base32
509 "01r34c31gq136jwshdfira44wbl6nb8qfgj4a4vam9r0hr8rdwsd"))))
510 (inputs
511 (modify-inputs inputs
512 (replace "apng"
513 (origin
514 (method url-fetch)
515 (uri
516 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
517 version "/libpng-" version "-apng.patch.gz"))
518 (sha256
519 (base32
520 "0r811izi40qzy69jmhz0xlkpqlsjj89bang1b3ma6a5igh6dqzb8"))))))))
521
522(define-public pngcrush
523 (package
524 (name "pngcrush")
525 (version "1.8.13")
526 (source (origin
527 (method url-fetch)
528 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
529 version "/pngcrush-" version "-nolib.tar.xz"))
530 (sha256 (base32
531 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
532 (build-system gnu-build-system)
533 (arguments
534 '(#:tests? #f ; no check target
535 #:phases
536 (modify-phases %standard-phases
537 (replace 'configure
538 (lambda* (#:key inputs outputs #:allow-other-keys)
539 (substitute* "Makefile"
540 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
541 (string-append vardef (assoc-ref inputs "libpng") "/"))
542 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
543 (string-append vardef (assoc-ref inputs "zlib") "/"))
544 ;; The Makefile is written by hand and not using $PREFIX
545 (("\\$\\(DESTDIR\\)/usr/")
546 (string-append (assoc-ref outputs "out") "/")))
547 #t)))))
548 (inputs
549 (list libpng zlib))
550 (home-page "https://pmt.sourceforge.io/pngcrush")
551 (synopsis "Utility to compress PNG files")
552 (description "Pngcrush optimizes @acronym{PNG, Portable Network Graphics}
553images. It can further losslessly compress them by as much as 40%.")
554 (license license:zlib)))
555
556(define-public pngcheck
557 (package
558 (name "pngcheck")
559 (version "3.0.3")
560 (source (origin
561 (method url-fetch)
562 (uri (string-append
563 "http://www.libpng.org/pub/png/src/pngcheck-" version
564 ".tar.gz"))
565 (sha256
566 (base32
567 "1rny14v57d2zvnqcqbh3m87mkya22qr2394fg7vm3xsacf8l8sn3"))))
568 (build-system gnu-build-system)
569 (arguments
570 '(#:tests? #f ;no check target
571 #:phases (modify-phases %standard-phases
572 (delete 'configure)
573 (replace 'build
574 (lambda* (#:key inputs outputs #:allow-other-keys)
575 (invoke "make" "-f" "Makefile.unx")))
576 (add-after 'build 'compress-man-pages
577 (lambda* (#:key inputs outputs #:allow-other-keys)
578 (invoke "gzip" "pngcheck.1")
579 (invoke "gzip" "gpl/pngsplit.1")
580 (invoke "gzip" "gpl/png-fix-IDAT-windowsize.1")))
581 (replace 'install
582 (lambda* (#:key outputs #:allow-other-keys)
583 (let* ((out (assoc-ref outputs "out"))
584 (bin (string-append out "/bin/"))
585 (man (string-append out "/share/man/man1/")))
586 (install-file "pngcheck" bin)
587 (install-file "pngcheck.1.gz" man)
588 (install-file "pngsplit" bin)
589 (install-file "gpl/pngsplit.1.gz" man)
590 (install-file "png-fix-IDAT-windowsize" bin)
591 (install-file "gpl/png-fix-IDAT-windowsize.1.gz" man)))))))
592 (inputs (list zlib))
593 (home-page "http://www.libpng.org/pub/png/apps/pngcheck.html")
594 (synopsis "Print info and check PNG, JNG and MNG files")
595 (description
596 "@code{pngcheck} verifies the integrity of PNG, JNG and MNG files (by
597checking the internal 32-bit CRCs, a.k.a. checksums, and decompressing the image
598data); it can optionally dump almost all of the chunk-level information in the image
599in human-readable form. For example, it can be used to print the basic statistics
600about an image (dimensions, bit depth, etc.); to list the color and transparency info
601in its palette (assuming it has one); or to extract the embedded text annotations.
602This is a command-line program with batch capabilities (e.g. @code{pngcheck
603*.png}.)
604
605Also includes @code{pngsplit} which can split a PNG, MNG or JNG file into individual,
606numbered chunks, and @code{png-fix-IDAT-windowsize} that allows resetting first IDAT's
607zlib window-size bytes and fix up CRC to match.")
608 ;; "pngsplit" and "png-fix-IDAT-windowsize" are licensed under the terms of
609 ;; GNU GPL2+. See "gpl/COPYING" in the repository."
610 (license (list license:x11 license:gpl2+))))
611
612(define-public pnglite
613 (let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
614 (revision "1"))
615 (package
616 (name "pnglite")
617 ;; The project was moved from sourceforge to github.
618 ;; The latest version in sourceforge was 0.1.17:
619 ;; https://sourceforge.net/projects/pnglite/files/pnglite/
620 ;; No releases are made in github.
621 (version (git-version "0.1.17" revision commit))
622 (source (origin
623 (method git-fetch)
624 (uri (git-reference
625 (url "https://github.com/dankar/pnglite")
626 (commit commit)))
627 (sha256
628 (base32
629 "1lmmkdxby5b8z9kx3zrpgpk33njpcf2xx8z9bgqag855sjsqbbby"))
630 (file-name (git-file-name name version))))
631 (build-system gnu-build-system)
632 (arguments
633 `(#:tests? #f ; no tests
634 #:phases
635 (modify-phases %standard-phases
636 (delete 'configure)
637 (replace 'build
638 (lambda _
639 ;; common build flags for building shared libraries
640 (let ((cflags '("-O2" "-g" "-fPIC"))
641 (ldflags '("-shared")))
642 (apply invoke
643 `("gcc"
644 "-o" "libpnglite.so"
645 ,@cflags
646 ,@ldflags
647 "pnglite.c"))
648 #t)))
649 (replace 'install
650 (lambda* (#:key outputs #:allow-other-keys)
651 (let* ((out (assoc-ref outputs "out"))
652 (lib (string-append out "/lib/"))
653 (include (string-append out "/include/"))
654 (doc (string-append out "/share/doc/"
655 ,name "-" ,version "/")))
656 (install-file "libpnglite.so" lib)
657 (install-file "pnglite.h" include)
658 (install-file "README.md" doc)
659 #t))))))
660 (inputs (list zlib))
661 (home-page "https://github.com/dankar/pnglite")
662 (synopsis "Pretty small png library")
663 (description "A pretty small png library.
664Currently all documentation resides in @file{pnglite.h}.")
665 (license license:zlib))))
666
667(define-public libimagequant
668 (package
669 (name "libimagequant")
670 (version "2.12.6")
671 (source
672 (origin
673 (method git-fetch)
674 (uri (git-reference
675 (url "https://github.com/ImageOptim/libimagequant")
676 (commit version)))
677 (file-name (git-file-name name version))
678 (sha256
679 (base32 "00w7fny3xf14cfyhbdnmqyh9ddqdh1irvgzxd35a2z65kp7vnvj0"))))
680 (build-system gnu-build-system)
681 (arguments
682 '(#:tests? #f)) ; no check target
683 (home-page "https://pngquant.org/lib/")
684 (synopsis "Image palette quantization library")
685 (description "libimagequant is a small, portable C library for
686high-quality conversion of RGBA images to 8-bit indexed-color (palette)
687images. This library can significantly reduces file sizes and powers pngquant
688and other PNG optimizers.")
689 (license license:gpl3+)))
690
691(define-public pngquant
692 (package
693 (name "pngquant")
694 (version "2.12.6")
695 (source
696 (origin
697 (method git-fetch)
698 (uri (git-reference
699 (url "https://github.com/kornelski/pngquant")
700 (commit version)))
701 (file-name (git-file-name name version))
702 (sha256
703 (base32 "15hanshahxqs6s9fyc3aym02251dcys7bf78g3inp0y233amdbl3"))))
704 (build-system gnu-build-system)
705 (arguments
706 `(#:test-target "test"
707 #:configure-flags
708 '("--with-openmp" "--with-lcms2")))
709 (native-inputs
710 (list pkg-config))
711 (inputs
712 (list libpng zlib lcms libimagequant))
713 (home-page "https://pngquant.org/")
714 (synopsis "Utility and library for lossy compressing PNG images")
715 (description "pngquant is a PNG compressor that significantly reduces file
716sizes by converting images to a more efficient 8-bit PNG format with alpha
717channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images
718are fully standards-compliant and are supported by all web browsers and
719operating systems.
720
721Features:
722@enumerate
723@item High-quality palette generation using a combination of vector
724 quantization algorithms.
725@item Unique adaptive dithering algorithm that adds less noise to images
726 than the standard Floyd-Steinberg.
727@item Easy to integrate with shell scripts, GUIs and server-side software.
728@item Fast mode for real-time processing/large numbers of images.
729@end enumerate")
730 (license license:gpl3+)))
731
732(define-public ijg-libjpeg
733 (package
734 (name "libjpeg")
735 (version "9f")
736 (source (origin
737 (method url-fetch)
738 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
739 version ".tar.gz"))
740 (sha256 (base32
741 "0nsn6bwc31clb2j435kff0a4k0xzsyiznwgvg6m9qimj1h8mqw04"))))
742 (build-system gnu-build-system)
743 (synopsis "Library for handling JPEG files")
744 (description
745 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
746JPEG is a standardized compression method for full-color and gray-scale
747images.
748It also includes programs that provide conversion between the JPEG format and
749image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats, as well as
750lossless JPEG manipulations such as rotation, scaling or cropping:
751@enumerate
752@item cjpeg
753@item djpeg
754@item jpegtran
755@item rdjpgcom
756@item wrjpgcom
757@end enumerate")
758 (license license:ijg)
759 (home-page "https://www.ijg.org/")))
760
761(define-public libjxr
762 (package
763 (name "libjxr")
764 (version "1.1")
765 (source (origin
766 ;; We are using the Debian source because CodePlex does not
767 ;; deliver an easily downloadable tarball.
768 (method url-fetch)
769 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
770 version ".orig.tar.gz"))
771 (sha256
772 (base32
773 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
774 (patch-flags '("-p1" "--binary"))
775 (patches (search-patches "libjxr-fix-function-signature.patch"
776 "libjxr-fix-typos.patch"))))
777 (build-system gnu-build-system)
778 (arguments
779 `(#:make-flags
780 (list ,(string-append "CC=" (cc-for-target))
781 ;; A substitute* procedure call would be enough to add the -fPIC
782 ;; flag if there was no file decoding error.
783 ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
784 ;; terminators" according to the file(1) utility.
785 (string-append "CFLAGS=-I."
786 " -Icommon/include"
787 " -Iimage/sys"
788 " -D__ANSI__"
789 " -DDISABLE_PERF_MEASUREMENT"
790 " -fPIC"
791 " -w"
792 " -O"
793 " -Wno-error=implicit-function-declaration"
794 " -Wno-error=incompatible-pointer-types"))
795 #:tests? #f ; no check target
796 #:phases
797 (modify-phases %standard-phases
798 (delete 'configure) ; no configure script
799 (add-after 'build 'build-shared-library
800 (lambda _
801 ;; The Makefile uses optimization level 1, so the same
802 ;; level is used here for consistency.
803 (invoke ,(cc-for-target) "-shared" "-fPIC" "-O"
804 ;; Common files.
805 "adapthuff.o" "image.o" "strcodec.o" "strPredQuant.o"
806 "strTransform.o" "perfTimerANSI.o"
807 ;; Decoding files.
808 "decode.o" "postprocess.o" "segdec.o" "strdec.o"
809 "strInvTransform.o" "strPredQuantDec.o" "JXRTranscode.o"
810 ;; Encoding files.
811 "encode.o" "segenc.o" "strenc.o" "strFwdTransform.o"
812 "strPredQuantEnc.o"
813 "-o" "libjpegxr.so")
814 (invoke ,(cc-for-target) "-shared" "-fPIC" "-O"
815 ;; Glue files.
816 "JXRGlue.o" "JXRMeta.o" "JXRGluePFC.o" "JXRGlueJxr.o"
817 ;; Test files.
818 "JXRTest.o" "JXRTestBmp.o" "JXRTestHdr.o" "JXRTestPnm.o"
819 "JXRTestTif.o" "JXRTestYUV.o"
820 "-o" "libjxrglue.so")))
821 ;; The upstream makefile does not include an install phase.
822 (replace 'install
823 (lambda* (#:key outputs #:allow-other-keys)
824 (let* ((out (assoc-ref outputs "out"))
825 (bin (string-append out "/bin"))
826 (lib (string-append out "/lib"))
827 (include (string-append out "/include/jxrlib")))
828 (for-each (lambda (file)
829 (install-file file include)
830 (delete-file file))
831 (append
832 '("jxrgluelib/JXRGlue.h"
833 "jxrgluelib/JXRMeta.h"
834 "jxrtestlib/JXRTest.h"
835 "image/sys/windowsmediaphoto.h")
836 (find-files "common/include" "\\.h$")))
837 (for-each (lambda (file)
838 (install-file file lib)
839 (delete-file file))
840 (find-files "." "\\.(a|so)$"))
841 (for-each (lambda (file)
842 (install-file file bin)
843 (delete-file file))
844 '("JxrDecApp" "JxrEncApp")))
845 #t)))))
846 (synopsis "Implementation of the JPEG XR standard")
847 (description "JPEG XR is an approved ISO/IEC International standard (its
848official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
849 (license
850 (license:non-copyleft
851 "file://Makefile"
852 "See the header of the Makefile in the distribution."))
853 (home-page "https://jxrlib.codeplex.com/")))
854
855(define-public jhead
856 (package
857 (name "jhead")
858 (version "3.08")
859 (source
860 (origin
861 (method git-fetch)
862 (uri (git-reference
863 (url "https://github.com/Matthias-Wandel/jhead")
864 (commit version)))
865 (file-name (git-file-name name version))
866 (sha256
867 (base32 "0q9zc47ngnj4zfdpy43jcp2cbnmrlgg38aa7spv8zh94i75jwmvp"))))
868 (build-system gnu-build-system)
869 (arguments
870 (list
871 #:tests? #f ;no tests.
872 #:make-flags
873 #~(list (string-append "CC=" #$(cc-for-target))
874 (string-append "PREFIX=" #$output))
875 #:phases
876 #~(modify-phases %standard-phases
877 (delete 'configure))))
878 (home-page "https://github.com/Matthias-Wandel/jhead")
879 (synopsis "Displays and manipulates EXIF header of JPEG files")
880 (description
881 "@command{jhead} is a simple command line tool for display and manipulate
882@acronym{EXIF, Exchangeable Image File Format} header data embedded in JPEG
883images.")
884 (license license:public-domain)))
885
886(define-public jpegoptim
887 (package
888 (name "jpegoptim")
889 (version "1.5.5")
890 (source
891 (origin
892 (method git-fetch)
893 (uri (git-reference
894 (url "https://github.com/tjko/jpegoptim")
895 (commit (string-append "v" version))))
896 (file-name (git-file-name name version))
897 (sha256
898 (base32 "18zq7ada7n17vgkkcixpisxsbs7i8xp5qjp78hyyvmmb9dqy97fy"))))
899 (build-system gnu-build-system)
900 (arguments
901 (list #:tests? #f))
902 (inputs (list libjpeg-turbo))
903 (synopsis "Optimize JPEG images")
904 (description
905 "jpegoptim provides lossless optimization (based on optimizing
906the Huffman tables) and \"lossy\" optimization based on setting
907maximum quality factor.")
908 (license license:gpl3+)
909 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
910
911(define-public libicns
912 (package
913 (name "libicns")
914 (version "0.8.1")
915 (source (origin
916 (method url-fetch)
917 (uri (string-append
918 "mirror://sourceforge/icns/"
919 "libicns-" version ".tar.gz"))
920 (sha256
921 (base32
922 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
923 (build-system gnu-build-system)
924 (arguments
925 (append
926 (list
927 #:configure-flags
928 #~(list (string-append "CFLAGS= "
929 ;; Relax GCC 14's checks.
930 "-Wno-error=builtin-declaration-mismatch "
931 "-Wno-error=implicit-function-declaration")))
932 (if (and (target-riscv64?)
933 (%current-target-system))
934 (list #:phases
935 #~(modify-phases %standard-phases
936 (add-after 'unpack 'update-config-scripts
937 (lambda* (#:key native-inputs inputs #:allow-other-keys)
938 (for-each (lambda (file)
939 (install-file
940 (search-input-file
941 (or native-inputs inputs)
942 (string-append "/bin/" file)) "."))
943 '("config.guess" "config.sub"))))))
944 '())))
945 (native-inputs
946 (if (and (target-riscv64?)
947 (%current-target-system))
948 (list config)
949 '()))
950 (inputs
951 (list libpng jasper))
952 (home-page "https://icns.sourceforge.io/")
953 (synopsis "Library for handling Mac OS icns resource files")
954 (description
955 "Libicns is a library for the manipulation of Mac OS IconFamily resource
956type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
957convert between PNG and ICNS. @command{icns2png} will extract image files from
958ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
959with .desktop files. Additionally, @command{icontainer2png} is provided for
960extracting icontainer icon files.")
961 (license (list license:lgpl2.1+ ; libicns
962 license:lgpl2.0+ ; src/apidocs.*
963 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
964
965(define-public libtiff
966 (package
967 (name "libtiff")
968 (version "4.7.2")
969 (source
970 (origin
971 (method git-fetch)
972 (uri (git-reference
973 (url "https://gitlab.com/libtiff/libtiff.git")
974 (commit (string-append "v" version))))
975 (file-name (git-file-name name version))
976 (sha256
977 (base32
978 "0q6q1kzam5fki7biip3yhrhfb8p8h87m03pajhrn6zcijn1yjhpb"))))
979 (build-system gnu-build-system)
980 (outputs '("out"
981 "doc")) ;1.8 MiB of HTML documentation
982 (arguments
983 (list #:configure-flags
984 ;; Instead of using --docdir, this package has its own --with-docdir.
985 #~(list (string-append "--with-docdir=" #$output:doc "/share/doc/"
986 #$name "-" #$(package-version this-package))
987 "--disable-static")))
988 (native-inputs
989 (list autoconf-2.72 automake libtool))
990 (inputs
991 (list libjpeg-turbo xz zlib))
992 (synopsis "Library for handling TIFF files")
993 (description
994 "Libtiff provides support for the Tag Image File Format (TIFF), a format
995used for storing image data.
996Included are a library, libtiff, for reading and writing TIFF and a small
997collection of tools for doing simple manipulations of TIFF images.")
998 (license (license:non-copyleft "file://COPYRIGHT"
999 "See COPYRIGHT in the distribution."))
1000 (properties
1001 '((upstream-name . "tiff")))
1002 (home-page "http://www.simplesystems.org/libtiff/")))
1003
1004(define-public leptonica
1005 (package
1006 (name "leptonica")
1007 (version "1.84.1")
1008 (source
1009 (origin
1010 (method git-fetch)
1011 (uri (git-reference
1012 (url "https://github.com/DanBloomberg/leptonica")
1013 (commit version)))
1014 (file-name (git-file-name name version))
1015 (sha256
1016 (base32 "0b4ikf1p2ll4310n4dg5lg0b79wys71fb6nj22i7pz17wjdma0j8"))))
1017 (build-system gnu-build-system)
1018 (native-inputs
1019 (list gnuplot ;needed for test suite
1020 autoconf
1021 automake
1022 libtool
1023 pkg-config))
1024 (inputs
1025 (list giflib
1026 libjpeg-turbo
1027 libpng
1028 libtiff
1029 libwebp
1030 openjpeg
1031 zlib))
1032 (arguments
1033 (list
1034 ;; Parallel tests cause some tests to fail randomly.
1035 ;; Same thing observed on Debian.
1036 #:parallel-tests? #f
1037 #:phases
1038 #~(modify-phases %standard-phases
1039 (add-after 'unpack 'patch-reg-wrapper
1040 (lambda _
1041 (substitute* "prog/reg_wrapper.sh"
1042 ((" /bin/sh ")
1043 (string-append " " (which "sh") " "))
1044 (("which gnuplot")
1045 "true"))))
1046 (add-after 'install 'provide-absolute-giflib-reference
1047 (lambda _
1048 (let ((giflib #$(this-package-input "giflib")))
1049 ;; Add an absolute reference to giflib to avoid propagation.
1050 (with-directory-excursion (string-append #$output "/lib")
1051 (substitute* '("libleptonica.la" "pkgconfig/lept.pc")
1052 (("-lgif") (string-append "-L" giflib "/lib -lgif"))))))))))
1053 (home-page "http://www.leptonica.com/")
1054 (synopsis "Library and tools for image processing and analysis")
1055 (description
1056 "Leptonica is a C library and set of command-line tools for efficient
1057image processing and image analysis operations. It supports rasterop, affine
1058transformations, binary and grayscale morphology, rank order, and convolution,
1059seedfill and connected components, image transformations combining changes in
1060scale and pixel depth, and pixelwise masking, blending, enhancement, and
1061arithmetic ops.")
1062 (license license:bsd-2)))
1063
1064(define-public jbig2dec
1065 (package
1066 (name "jbig2dec")
1067 (version "0.19")
1068 (source (origin
1069 (method url-fetch)
1070 (uri (string-append "https://github.com/ArtifexSoftware"
1071 "/ghostpdl-downloads/releases/download"
1072 "/gs9533/" name "-" version ".tar.gz"))
1073 (sha256
1074 (base32
1075 "0dwa24kjqyg9hmm40fh048sdxfpnasz43l2rm8wlkw1qbdlpd517"))))
1076 (build-system gnu-build-system)
1077 (arguments '(#:configure-flags '("--disable-static")))
1078 (native-inputs
1079 (list python-minimal-wrapper)) ;for tests
1080 (synopsis "Decoder of the JBIG2 image compression format")
1081 (description
1082 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
1083monochrome) images at moderately high resolution, and in particular scanned
1084paper documents. In this domain it is very efficient, offering compression
1085ratios on the order of 100:1.
1086
1087This is a decoder only implementation, and currently is in the alpha
1088stage, meaning it doesn't completely work yet. However, it is
1089maintaining parity with available encoders, so it is useful for real
1090work.")
1091 (home-page "https://jbig2dec.com")
1092 (license license:gpl2+)))
1093
1094(define-public jbigkit
1095 (package
1096 (name "jbigkit")
1097 (version "2.1")
1098 (source
1099 (origin
1100 (method url-fetch)
1101 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
1102 "download/jbigkit-" version ".tar.gz"))
1103 (sha256
1104 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
1105 (modules '((guix build utils)))
1106 (snippet
1107 '(begin
1108 ;; Remove files without clear licence information.
1109 (for-each delete-file-recursively
1110 (list "contrib" "examples"))
1111 #t))))
1112 (build-system gnu-build-system)
1113 (outputs (list "out" "pbmtools"))
1114 (arguments
1115 `(#:modules ((srfi srfi-26)
1116 ,@%default-gnu-modules)
1117 #:phases
1118 (modify-phases %standard-phases
1119 (delete 'configure) ; no configure script
1120 (replace 'install ; no ‘make install’ target
1121 (lambda* (#:key outputs #:allow-other-keys)
1122 (let* ((out (assoc-ref outputs "out"))
1123 (lib (string-append out "/lib"))
1124 (include (string-append out "/include")))
1125 (with-directory-excursion "libjbig"
1126 (for-each (cut install-file <> include)
1127 (find-files "." "\\.h$"))
1128 (for-each (cut install-file <> lib)
1129 (find-files "." "\\.a$")))
1130 #t)))
1131 (add-after 'install 'install-pbmtools
1132 (lambda* (#:key outputs #:allow-other-keys)
1133 (let* ((out (assoc-ref outputs "pbmtools"))
1134 (bin (string-append out "/bin"))
1135 (man1 (string-append out "/share/man/man1"))
1136 (man5 (string-append out "/share/man/man5")))
1137 (with-directory-excursion "pbmtools"
1138 (for-each (cut install-file <> bin)
1139 (list "jbgtopbm" "jbgtopbm85"
1140 "pbmtojbg" "pbmtojbg85"))
1141
1142 (for-each (cut install-file <> man1)
1143 (find-files "." "\\.1$"))
1144 (for-each (cut install-file <> man5)
1145 (find-files "." "\\.5$"))
1146 #t)))))
1147 #:test-target "test"
1148 #:tests? #f)) ; tests depend on examples/
1149 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
1150 (synopsis "Lossless compression for bi-level high-resolution images")
1151 (description
1152 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
1153ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
1154black-and-white scanned documents. It is widely used in fax products, printer
1155firmware and drivers, document management systems, and imaging software.
1156
1157This package provides a static C library of (de)compression functions and some
1158simple command-line converters similar to those provided by netpbm.
1159
1160Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
1161options of the standard but has to keep the full uncompressed image in memory.
1162The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
1163memory management optimized for embedded and fax applications. It buffers
1164only a few lines of the uncompressed image in memory and is able to stream
1165images of initially unknown height.")
1166 (license (list license:isc ; pbmtools/p?m.5
1167 license:gpl2+)))) ; the rest
1168
1169(define-public sjpeg
1170 ;; No tags available.
1171 (let ((commit "46da5aec5fce05faabf1facf0066e36e6b1c4dff")
1172 (revision "0"))
1173 (package
1174 (name "sjpeg")
1175 (version (git-version "0" revision commit))
1176 (source
1177 (origin
1178 (method git-fetch)
1179 (uri (git-reference
1180 (url "https://github.com/webmproject/sjpeg")
1181 (commit commit)))
1182 (file-name (git-file-name name version))
1183 (sha256
1184 (base32 "0r496mp2ylisspwxl4883pzbl0l8qpscd1x9l7sb5nnmknawr868"))))
1185 (build-system cmake-build-system)
1186 (arguments
1187 (list
1188 #:phases
1189 #~(modify-phases %standard-phases
1190 (add-after 'unpack 'patch-cmake
1191 (lambda _
1192 ;; Enable building shared libraries.
1193 (substitute* "CMakeLists.txt"
1194 (("add_library\\(sjpeg " all)
1195 (string-append all "SHARED ")))))
1196 (add-before 'check 'patch-tests
1197 (lambda _
1198 (with-directory-excursion "../source/tests"
1199 (substitute* '("test_cmd.sh" "test_png_jpg.sh")
1200 (("\\.\\./examples") "../../build")))))
1201 (replace 'check
1202 (lambda* (#:key tests? #:allow-other-keys)
1203 (when tests?
1204 (with-directory-excursion "../source/tests"
1205 (invoke "./test_cmd.sh")
1206 (invoke "./test_png_jpg.sh"))))))))
1207 (inputs (list freeglut libjpeg-turbo libpng zlib))
1208 (home-page "https://github.com/webmproject/sjpeg")
1209 (synopsis "Simple JPEG encoder")
1210 (description
1211 "sjpeg is a simple encoding library for encoding baseline JPEG files.
1212It is also a command-line tool that takes PNG or JPEG images as input to
1213produce JPEG files.")
1214 (license license:asl2.0))))
1215
1216(define-public openjpeg-data
1217 (package
1218 (name "openjpeg-data")
1219 (version "2021.09.26")
1220 (source
1221 (origin
1222 (method git-fetch)
1223 (uri
1224 (git-reference
1225 (url "https://github.com/uclouvain/openjpeg-data")
1226 (commit "1f3d093030f9a0b43353ec6b48500f65786ff57a")))
1227 (file-name (git-file-name name version))
1228 (sha256
1229 (base32 "13jpdaqk7mngk0xw6xbh9zgipip6n25spvqd97hwpfna1zyh8lzh"))))
1230 (build-system copy-build-system)
1231 (synopsis "Test files for OpenJPEG")
1232 (description "OpenJPEG-Data contains all files required to run the openjpeg
1233test suite, including conformance tests (following Rec. ITU-T T.803 | ISO/IEC
123415444-4 procedures), non-regression tests and unit tests.")
1235 (home-page "https://github.com/uclouvain/openjpeg-data")
1236 (license license:bsd-2)))
1237
1238(define-public openjpeg
1239 (package
1240 (name "openjpeg")
1241 (version "2.5.0")
1242 (source
1243 (origin
1244 (method git-fetch)
1245 (uri (git-reference
1246 (url "https://github.com/uclouvain/openjpeg")
1247 (commit (string-append "v" version))))
1248 (file-name (git-file-name name version))
1249 (sha256
1250 (base32 "0xvcxlzqlylnjsyl1j64d7rgzv68ihm4qy6fpdrix3xzbqb3fjpz"))))
1251 (build-system cmake-build-system)
1252 (arguments
1253 `(#:configure-flags
1254 (list
1255 "-DBUILD_STATIC_LIBS=OFF"
1256 "-DBUILD_UNIT_TESTS=ON"
1257 (string-append "-DOPJ_DATA_ROOT="
1258 (assoc-ref %build-inputs "openjpeg-data")))
1259 #:phases
1260 (modify-phases %standard-phases
1261 (add-after 'unpack 'disable-failing-tests
1262 (lambda _
1263 ;; To be re-enabled after upstream fixes the bug,
1264 ;; https://github.com/uclouvain/openjpeg/issues/1264
1265 (substitute* "tests/CMakeLists.txt"
1266 (("add_subdirectory\\(nonregression\\)")
1267 ""))
1268 ;; These tests fail on all architectures except x86_64
1269 (substitute* "tests/conformance/CMakeLists.txt"
1270 ;; 4, 5, 6 fail
1271 (("numFileC1P0 RANGE 1 16") "numFileC1P0 RANGE 7 16")
1272 ;; 2, 3, 4, 5 fail
1273 (("numFileC1P1 RANGE 1 7") "numFileC1P1 1 6 7")
1274 ;; 2, 3 fail
1275 (("numFileJP2 RANGE 1 9") "numFileJP2 RANGE 4 9")
1276 ;; All fail
1277 (("subsampling.*") "")
1278 (("zoo.*") "")))))))
1279 (native-inputs
1280 (list openjpeg-data)) ; Files for test-suite
1281 (inputs
1282 (list lcms libpng libtiff zlib))
1283 (synopsis "OPENJPEG Library and Applications")
1284 (description "OpenJPEG is an implementation of JPEG 2000 codec written in C
1285language. It has been developed in order to promote the use of JPEG 2000, a
1286still-image compression standard from the Joint Photographic Experts Group
1287(JPEG). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a
1288JPEG 2000 Reference Software.")
1289 (home-page "https://github.com/uclouvain/openjpeg")
1290 (license license:bsd-2)))
1291
1292(define jp2k-test-codestreams
1293 (origin
1294 (method git-fetch)
1295 (uri (git-reference
1296 (url "https://github.com/aous72/jp2k_test_codestreams")
1297 (commit "eda0844b9f3be47d9b64194bcea5eb1ac2285e39")))
1298 (sha256
1299 (base32 "1sci4a4dvgrgmrf942zdf0hqhcx30a5lffwfy6r3hya35l3q8q8f"))))
1300
1301(define-public openjph
1302 (package
1303 (name "openjph")
1304 (version "0.27.3")
1305 (source
1306 (origin
1307 (method git-fetch)
1308 (uri (git-reference
1309 (url "https://github.com/aous72/OpenJPH")
1310 (commit version)))
1311 (file-name (git-file-name name version))
1312 (sha256
1313 (base32 "1knygwn4bf6n53qr12w05yava7464x3c70rf5r20sz8adjcfccvx"))))
1314 (build-system cmake-build-system)
1315 (arguments
1316 (list
1317 #:configure-flags
1318 #~(if #$(%current-target-system)
1319 '()
1320 '("-DOJPH_BUILD_TESTS=ON"))
1321 #:phases
1322 #~(modify-phases %standard-phases
1323 (add-after 'unpack 'patch-cmake
1324 (lambda _
1325 (substitute* "tests/CMakeLists.txt"
1326 (("^FetchContent_MakeAvailable\\(googletest\\)")
1327 #$(if (%current-target-system)
1328 ""
1329 "find_package(GTest REQUIRED)"))
1330 (("^FetchContent_MakeAvailable\\(jp2k_test_codestreams\\).*")
1331 ""))))
1332 #$@(if (%current-target-system)
1333 #~()
1334 #~((add-before 'check 'unpack-jp2k-test-codestreams
1335 (lambda _
1336 (copy-recursively #$jp2k-test-codestreams
1337 "tests/jp2k_test_codestreams"))))))))
1338 (native-inputs (if (%current-target-system)
1339 '()
1340 (list googletest)))
1341 (inputs (list libtiff))
1342 (home-page "https://github.com/aous72/OpenJPH")
1343 (synopsis "JPEG2000 Part-15 (or JPH or HTJ2K) implementation")
1344 (description
1345 "OpenJPH is an implementation of @acronym{HTJ2K, High-throughput JPEG2000},
1346also known as JPH, JPEG2000 Part 15, ISO/IEC 15444-15, and ITU-T T.814.")
1347 (license license:bsd-2)))
1348
1349(define-public openslide
1350 (package
1351 (name "openslide")
1352 (version "4.0.0")
1353 (source
1354 (origin
1355 (method git-fetch)
1356 (uri (git-reference
1357 (url "https://github.com/openslide/openslide")
1358 (commit (string-append "v" version))))
1359 (file-name (git-file-name name version))
1360 (sha256
1361 (base32 "00gc530g0lxm2lhwq249w97021w1v1y9ybqs2z5l1z922s15rhl2"))))
1362 (build-system meson-build-system)
1363 (inputs (list cairo
1364 gdk-pixbuf
1365 glib
1366 libdicom
1367 libjpeg-turbo
1368 libpng
1369 libtiff
1370 libxml2
1371 openjpeg
1372 sqlite
1373 zlib
1374 zstd))
1375 (native-inputs (list pkg-config))
1376 (home-page "https://openslide.org/")
1377 (synopsis "C library for reading slide image files")
1378 (description
1379 "OpenSlide is a C library for reading whole slide image files (also known
1380as virtual slides). It provides a consistent and simple API for reading files
1381from multiple vendors.")
1382 (license license:lgpl2.1)))
1383
1384(define-public giflib
1385 (package
1386 (name "giflib")
1387 (version "5.2.1")
1388 (source (origin
1389 (method url-fetch)
1390 (uri (string-append "mirror://sourceforge/giflib/giflib-"
1391 version ".tar.gz"))
1392 (sha256
1393 (base32
1394 "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii"))))
1395 (build-system gnu-build-system)
1396 (outputs '("bin" ; utility programs
1397 "out")) ; library
1398 (arguments
1399 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
1400 (string-append "PREFIX="
1401 (assoc-ref %outputs "out"))
1402 (string-append "BINDIR="
1403 (assoc-ref %outputs "bin") "/bin"))
1404 #:phases
1405 (modify-phases %standard-phases
1406 (add-after 'unpack 'disable-html-doc-gen
1407 (lambda _
1408 (substitute* "doc/Makefile"
1409 (("^all: allhtml manpages") ""))
1410 #t))
1411 (delete 'configure)
1412 (add-after 'install 'install-manpages
1413 (lambda* (#:key outputs #:allow-other-keys)
1414 (let* ((bin (assoc-ref outputs "bin"))
1415 (man1dir (string-append bin "/share/man/man1")))
1416 (mkdir-p man1dir)
1417 (for-each (lambda (file)
1418 (let ((base (basename file)))
1419 (format #t "installing `~a' to `~a'~%"
1420 base man1dir)
1421 (copy-file file
1422 (string-append
1423 man1dir "/" base))))
1424 (find-files "doc" "\\.1"))
1425 #t))))))
1426 (synopsis "Tools and library for working with GIF images")
1427 (description
1428 "GIFLIB is a library for reading and writing GIF images. It is API and
1429ABI compatible with libungif which was in wide use while the LZW compression
1430algorithm was patented. Tools are also included to convert, manipulate,
1431compose, and analyze GIF images.")
1432 (home-page "http://giflib.sourceforge.net/")
1433 (license license:x11)))
1434
1435(define-public libuemf
1436 (package
1437 (name "libuemf")
1438 (version "0.2.7")
1439 (source (origin
1440 (method url-fetch)
1441 (uri (string-append "mirror://sourceforge/libuemf/libUEMF-"
1442 version ".tar.gz"))
1443 (sha256
1444 (base32
1445 "05djs99vqf067x81xfpskh7a66y5x7b4mmjavybcy7swnm0swg7v"))))
1446 (build-system cmake-build-system)
1447 (arguments
1448 `(#:phases
1449 (modify-phases %standard-phases
1450 ;; Overriding CMAKE_INSTALL_PREFIX is not a good idea.
1451 (add-after 'unpack 'fix-CMakeLists.txt
1452 (lambda _
1453 (substitute* "CMakeLists.txt"
1454 ((".*SET\\(CMAKE_INSTALL_PREFIX.*") ""))
1455 #t))
1456 (delete 'check)
1457 (add-after 'install 'check
1458 (lambda* (#:key inputs outputs #:allow-other-keys)
1459 (let* ((out (assoc-ref outputs "out"))
1460 (bin (string-append out "/bin"))
1461 (sources (string-append "../libUEMF-" ,version))
1462 (drm-tools (assoc-ref inputs "drm-tools"))
1463 (extract (string-append drm-tools "/bin/extract"))
1464 (execinput (string-append drm-tools "/bin/execinput")))
1465 (with-directory-excursion sources
1466 (substitute* "testit.sh"
1467 (("^EPATH=.*")
1468 (format #f "EPATH=~a~%" bin))
1469 (("`which diff`")
1470 "diff")
1471 (("^EXTRACT=.*")
1472 (format #f "EXTRACT=~a~%" extract))
1473 (("^EXECINPUT=.*")
1474 (format #f "EXECINPUT=~a~%" execinput)))
1475 (invoke "sh" "testit.sh"))))))))
1476 (native-inputs (list drm-tools)) ;for tests
1477 (home-page "https://libuemf.sourceforge.net/")
1478 (synopsis "Library for working with WFM, EMF and EMF+ images")
1479 (description "The libUEMF library is a portable C99 implementation for
1480reading and writing @acronym{WFM, Windows Metafile}, @acronym{EMF, Enhanced
1481Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
1482 (license license:gpl2+)))
1483
1484(define-public libungif
1485 (package
1486 (name "libungif")
1487 (version "4.1.4")
1488 (source (origin
1489 (method url-fetch)
1490 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
1491 "libungif-" version "/libungif-"
1492 version ".tar.bz2"))
1493 (sha256
1494 (base32
1495 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
1496 (build-system gnu-build-system)
1497 (inputs (list perl)) ;package ships some perl tools
1498 (home-page "http://giflib.sourceforge.net/")
1499 (synopsis "GIF decompression library")
1500 (description
1501 "libungif is the old GIF decompression library by the GIFLIB project.")
1502 (license license:expat)))
1503
1504(define-public imlib2
1505 (package
1506 (name "imlib2")
1507 (version "1.10.0")
1508 (source (origin
1509 (method url-fetch)
1510 (uri (string-append
1511 "mirror://sourceforge/enlightenment/imlib2-src/" version
1512 "/imlib2-" version ".tar.xz"))
1513 (sha256
1514 (base32
1515 "1fnbh6vj0d9l1c2bzw9psxh3wnlbr1nlfzi16w60hp48gj9ilz3j"))))
1516 (build-system gnu-build-system)
1517 (arguments
1518 '(#:configure-flags (list "--disable-static")))
1519 (native-inputs
1520 (list pkg-config))
1521 (inputs
1522 (list bzip2
1523 freetype
1524 giflib
1525 libid3tag
1526 libjpeg-turbo
1527 libpng
1528 libtiff
1529 libx11
1530 libxext
1531 libwebp))
1532 (home-page "https://sourceforge.net/projects/enlightenment/")
1533 (synopsis
1534 "Loading, saving, rendering and manipulating image files")
1535 (description
1536 "Imlib2 is a library that does image file loading and saving as well as
1537rendering, manipulation, arbitrary polygon support, etc.
1538
1539It does ALL of these operations FAST. Imlib2 also tries to be highly
1540intelligent about doing them, so writing naive programs can be done easily,
1541without sacrificing speed.
1542
1543This is a complete rewrite over the Imlib 1.x series. The architecture is
1544more modular, simple, and flexible.")
1545 (license license:imlib2)))
1546
1547(define-public imlib2-1.7
1548 (package
1549 (inherit imlib2)
1550 (version "1.7.1")
1551 (source (origin
1552 (method url-fetch)
1553 (uri (string-append
1554 "mirror://sourceforge/enlightenment/imlib2-src/" version
1555 "/imlib2-" version ".tar.bz2"))
1556 (sha256
1557 (base32
1558 "01y45cdml2dr9cqgybrgxr86sd77d1qfa1gzclzy1j6bkminlfh3"))))))
1559
1560(define-public giblib
1561 (package
1562 (name "giblib")
1563 (version "1.2.4")
1564 (source (origin
1565 (method url-fetch)
1566 (uri (list
1567 (string-append
1568 "http://linuxbrit.co.uk/downloads/giblib-"
1569 version ".tar.gz")
1570 (string-append
1571 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
1572 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
1573 version ".tar.gz")
1574 (string-append
1575 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
1576 "files/giblib/giblib-" version ".tar.gz")))
1577 (sha256
1578 (base32
1579 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
1580 (build-system gnu-build-system)
1581 (inputs
1582 (list libx11
1583 ;; Needs an old imlib2 with the 'imlib2-config' program.
1584 imlib2-1.7))
1585 (home-page
1586 ;; This vanished page is universally accepted as giblib's home despite not
1587 ;; mentioning the package once.
1588 (string-append "https://web.archive.org/web/20140907071208/"
1589 "https://linuxbrit.co.uk/software/"))
1590 (synopsis "Wrapper library for imlib2")
1591 (description
1592 "Giblib is a simple library which wraps imlib2's context API, avoiding
1593all the context_get/set calls, adds fontstyles to the truetype renderer and
1594supplies a generic doubly-linked list and some string functions.")
1595 ;; This license removes a clause about X Consortium from the original
1596 ;; X11 license.
1597 (license (license:x11-style "file://COPYING"
1598 "See 'COPYING' in the distribution."))))
1599
1600(define-public freeimage
1601 (package
1602 (name "freeimage")
1603 (version "3.18.0")
1604 (source (origin
1605 (method url-fetch)
1606 (uri (string-append
1607 "mirror://sourceforge/freeimage/Source%20Distribution/"
1608 version "/FreeImage"
1609 (string-concatenate (string-split version #\.))
1610 ".zip"))
1611 (sha256
1612 (base32
1613 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
1614 (modules '((guix build utils)))
1615 (snippet
1616 '(begin
1617 (for-each
1618 (lambda (dir)
1619 (delete-file-recursively (string-append "Source/" dir)))
1620 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
1621 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
1622 (patches
1623 (append
1624 (search-patches "freeimage-unbundle.patch"
1625 "freeimage-libtiff-compat.patch"
1626 "freeimage-CVE-2020-21428.patch"
1627 "freeimage-CVE-2020-22524.patch"
1628 "freeimage-libraw-0.21-compat.patch")
1629 ;; Take one patch from Arch Linux that adds LibRaw 0.20 compatibility.
1630 (list (origin
1631 (method url-fetch)
1632 (uri "https://raw.githubusercontent.com/archlinux\
1633/svntogit-community/ca3e6a52f5a46dec87cbf85e9d84fe370e282c8c/trunk\
1634/freeimage-libraw-0.20.patch")
1635 (file-name "freeimage-libraw-compat.patch")
1636 (sha256
1637 (base32
1638 "0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
1639 (build-system gnu-build-system)
1640 (arguments
1641 (list
1642 #:phases
1643 #~(modify-phases %standard-phases
1644 ;; According to Fedora these files depend on private headers, but their
1645 ;; presence is required for building, so we replace them with empty files.
1646 (add-after 'unpack 'delete-unbuildable-files
1647 (lambda _
1648 (for-each (lambda (file)
1649 (delete-file file)
1650 (close (open file O_CREAT)))
1651 '("Source/FreeImage/PluginG3.cpp"
1652 "Source/FreeImageToolkit/JPEGTransform.cpp"))))
1653 ;; These scripts generate the Makefiles.
1654 (replace 'configure
1655 (lambda _
1656 (invoke "sh" "gensrclist.sh")
1657 (invoke "sh" "genfipsrclist.sh")))
1658 (add-before 'build 'patch-makefile
1659 (lambda* (#:key outputs #:allow-other-keys)
1660 (substitute* "Makefile.gnu"
1661 (("/usr") (assoc-ref outputs "out"))
1662 (("-o root -g root") "")))))
1663 #:make-flags
1664 #~(let ((jxrlib (search-input-directory %build-inputs "include/jxrlib")))
1665 (list (string-append "CC=" #$(cc-for-target))
1666 ;; We need '-fpermissive' for Source/FreeImage.h.
1667 ;; libjxr doesn't have a pkg-config file.
1668 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden "
1669 "-fpermissive -I" jxrlib)))
1670 #:tests? #f)) ; no check target
1671 (native-inputs
1672 (list pkg-config unzip))
1673 (inputs
1674 (list libjpeg-turbo
1675 libjxr
1676 libpng
1677 libraw
1678 libtiff
1679 libwebp
1680 openexr-2
1681 openjpeg
1682 zlib))
1683 (synopsis "Library for handling popular graphics image formats")
1684 (description
1685 "FreeImage is a library for developers who would like to support popular
1686graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1687 (license (list license:gpl2+ license:gpl3+)) ;dual-licensed
1688 (home-page "https://freeimage.sourceforge.io/")))
1689
1690(define-public freeimagere
1691 (let ((commit "97e3a992298d1b4c7d87c79ca3c8a735837b628e")
1692 (revision "0"))
1693 (package
1694 (name "freeimagere")
1695 (version (git-version "4.2.0" revision commit))
1696 (source (origin
1697 (method git-fetch)
1698 (uri (git-reference
1699 (url "https://github.com/agruzdev/FreeImageRe")
1700 (commit commit)))
1701 (file-name (git-file-name name version))
1702 (sha256
1703 (base32
1704 "1lx94mgbwzhgi5hrj9dinaizyxlwvapfiz5c58bifkgpy3ab58an"))
1705 (modules '((guix build utils)))
1706 (snippet '(delete-file-recursively "3rdParty"))))
1707 (build-system cmake-build-system)
1708 ;; The libjxr support depends on the bundled 3rdParty/LibJXR source.
1709 (arguments
1710 (list
1711 #:tests? #f ;also disabled upstream
1712 #:cmake cmake-minimal-4
1713 #:configure-flags
1714 #~(list
1715 "-DUSE_SYSTEM_LIBS=ON"
1716 "-DFREEIMAGE_WITH_LIBJXR=OFF" ;relies on bundled 3rdParty
1717 "-DFREEIMAGE_WITH_LIBOPENJPEG=OFF" ;not packaged
1718 "-DFREEIMAGE_WITH_LIBJPEGXL=OFF" ;not packaged
1719 "-DFREEIMAGE_WITH_LIBJPEG_TRANSFORMS=OFF" ;requires private headers
1720 "-DFREEIMAGE_WITH_LIBTIFF=OFF"))) ;requires private headers
1721 (native-inputs (list pkg-config))
1722 (inputs
1723 (list libheif
1724 libjpeg-turbo
1725 libpng
1726 libraw
1727 libwebp
1728 openexr
1729 openjph
1730 yato
1731 zlib))
1732 (home-page "https://github.com/agruzdev/FreeImageRe")
1733 (synopsis "Library for handling popular graphics image formats")
1734 (description "FreeImage Re(surrected) is a fork of FreeImage, a library
1735that supports popular graphics image formats like PNG, BMP, JPEG, TIFF and
1736others.")
1737 (license (list license:gpl3+ license:gpl2+))))) ;dual-licensed
1738
1739(define-public ggg
1740 (package
1741 (name "ggg")
1742 (version "0.6.1")
1743 (source
1744 (origin
1745 (method git-fetch)
1746 (uri (git-reference
1747 (url "https://codeberg.org/jjba23/ggg.git")
1748 (commit (string-append "v" version))))
1749 (file-name (git-file-name name version))
1750 (sha256
1751 (base32 "0asrvc7fzyavv8xmrb0pbqqv35z8bhcl4si0xwj9xndbificx7li"))))
1752 (build-system guile-build-system)
1753 (arguments
1754 (list
1755 #:source-directory "src"
1756 #:modules '((guix build guile-build-system)
1757 (guix build utils)
1758 (ice-9 match))
1759 #:phases
1760 #~(modify-phases %standard-phases
1761 (add-before 'build 'install-program-files
1762 (lambda _
1763 (let ((bin (string-append #$output "/bin"))
1764 (share (string-append #$output "/share")))
1765 (install-file "resources/help.txt"
1766 (string-append share "/resources"))
1767 (copy-recursively "resources/svg-paths"
1768 (string-append share "/resources/svg-paths"))
1769 (install-file "scripts/ggg" bin)
1770 (chmod (string-append bin "/ggg") #o755))))
1771 (add-after 'unpack 'fix-paths
1772 (lambda* (#:key inputs #:allow-other-keys)
1773 (for-each (match-lambda
1774 ((pattern program format-string)
1775 (substitute* "scripts/ggg"
1776 ((pattern)
1777 (format #f format-string
1778 (search-input-file inputs
1779 (string-append "bin/"
1780 program)))))))
1781 '(("readlink -f " "readlink" "~s -f ")
1782 ("realpath " "realpath" "~s ")
1783 ("dirname " "dirname" "~s ")
1784 ("getopt " "getopt" "~s ")
1785 ("exec guile " "guile" "exec ~s ")))
1786 (for-each (match-lambda
1787 ((pattern program format-string)
1788 (substitute* "src/ggg/main.scm"
1789 ((pattern)
1790 (format #f format-string
1791 (search-input-file inputs
1792 (string-append "bin/"
1793 program)))))))
1794 '(("convert -quality 100" "convert" "~a -quality 100"))))))))
1795 (inputs
1796 (list guile-3.0
1797 bash-minimal
1798 imagemagick
1799 coreutils-minimal
1800 util-linux))
1801 (synopsis "GGG is a SVG image generator for project and web badges")
1802 (description
1803 "GGG (Guile Glyph Generator) is a command-line utility
1804that allows you to generate pretty images/badges which can be used for
1805your projects, announcing tech used, sponsoring and appreciating
1806other projects, distinguishing versions of things supported, etc.
1807
1808GGG is highly configurable, reads Scheme files where you define your tasks,
1809and supports badges between one and three parts. It leverages SVG generation
1810from Lisp and S-expressions, building pixel perfect badges.")
1811 (home-page "https://codeberg.org/jjba23/ggg")
1812 (license license:agpl3+)))
1813
1814(define-public vigra
1815 (package
1816 (name "vigra")
1817 (version "1.12.2")
1818 (source
1819 (origin
1820 (method git-fetch)
1821 (uri (git-reference
1822 (url "https://github.com/ukoethe/vigra")
1823 (commit (string-append "Version-"
1824 (string-join (string-split version #\.)
1825 "-")))))
1826 (file-name (git-file-name name version))
1827 (sha256
1828 (base32 "0x6qcsbjxp2alxqxsngs8a22fdi7pi2ylv9q4l1jgmypn0svkqqk"))))
1829 (build-system cmake-build-system)
1830 (arguments
1831 (list
1832 #:configure-flags
1833 #~(list "-Wno-dev" ;suppress developer mode with lots of warnings
1834 (string-append
1835 "-DVIGRANUMPY_INSTALL_DIR=" #$output "/lib/python"
1836 #$(version-major+minor (package-version python))
1837 "/site-packages")
1838 ;; OpenEXR is not enabled by default.
1839 "-DWITH_OPENEXR=1"
1840 ;; Fix rounding error on 32-bit machines
1841 "-DCMAKE_C_FLAGS=-ffloat-store"
1842 ;; The header files of ilmbase are not found when included
1843 ;; by the header files of openexr, and an explicit flag
1844 ;; needs to be set.
1845 (string-append "-DCMAKE_CXX_FLAGS=-I"
1846 (assoc-ref %build-inputs "ilmbase")
1847 "/include/OpenEXR" " -ffloat-store")
1848 ;; Tests are not built by default.
1849 "-DAUTOBUILD_TESTS=ON"
1850 ;; Disable running tests during the build.
1851 "-DAUTOEXEC_TESTS=OFF")))
1852 (inputs (list boost
1853 fftw
1854 fftwf
1855 hdf5
1856 ilmbase ;propagated by openexr, but needed explicitly
1857 ;to create a configure-flag
1858 libjpeg-turbo
1859 libpng
1860 libtiff
1861 openexr-2
1862 python-wrapper
1863 python-numpy
1864 zlib))
1865 (native-inputs (list doxygen python-sphinx))
1866 (synopsis "Computer vision library")
1867 (description
1868 "VIGRA stands for Vision with Generic Algorithms. It is an image
1869 processing and analysis library that puts its main emphasis on customizable
1870 algorithms and data structures. It is particularly strong for
1871 multi-dimensional image processing.")
1872 (license license:expat)
1873 (home-page "https://ukoethe.github.io/vigra/")
1874 (properties '((max-silent-time . 7200))))) ;2 hours, to avoid timing out
1875
1876(define-public vigra-c
1877 (let* ((commit "49f53191a12fe91d4e2fd177d22af167571c71d8")
1878 (revision "2"))
1879 (package
1880 (name "vigra-c")
1881 (version (git-version "0.0.0" revision commit))
1882 (home-page "https://github.com/BSeppke/vigra_c")
1883 (source (origin
1884 (method git-fetch)
1885 (uri (git-reference
1886 (url home-page)
1887 (commit commit)))
1888 (sha256
1889 (base32
1890 "04ch1jhk4zjf1fpsyp8ldzjp8l9bx025zq0vskjx1clb3ncn305x"))
1891 (file-name (git-file-name name version))))
1892 (build-system cmake-build-system)
1893 (arguments
1894 `(#:tests? #f)) ; No test target.
1895 (native-inputs
1896 (list doxygen))
1897 (inputs
1898 (list fftw fftwf hdf5 vigra))
1899 (synopsis "C interface to the VIGRA computer vision library")
1900 (description
1901 "This package provides a C interface to the VIGRA C++ computer vision
1902library. It is designed primarily to ease the implementation of higher-level
1903language bindings to VIGRA.")
1904 (license license:expat))))
1905
1906(define-public libwebp
1907 (package
1908 (name "libwebp")
1909 (version "1.3.2")
1910 (source
1911 (origin
1912 ;; No tarballs are provided for >0.6.1.
1913 (method git-fetch)
1914 (uri (git-reference
1915 (url "https://chromium.googlesource.com/webm/libwebp")
1916 (commit (string-append "v" version))))
1917 (file-name (git-file-name name version))
1918 (sha256
1919 (base32
1920 "1x37795gpc63g1ma9kqw4q3dikwhrjklixqzjjsj6viqksa19z41"))))
1921 (build-system gnu-build-system)
1922 (inputs
1923 (list freeglut
1924 giflib
1925 libjpeg-turbo
1926 libpng
1927 libtiff))
1928 (native-inputs
1929 (list autoconf automake libtool))
1930 (arguments
1931 '(#:configure-flags '("--enable-libwebpmux"
1932 "--enable-libwebpdemux"
1933 "--enable-libwebpdecoder"
1934 "--disable-static")))
1935 (home-page "https://developers.google.com/speed/webp/")
1936 (synopsis "Lossless and lossy image compression")
1937 (description
1938 "WebP is a new image format that provides lossless and lossy compression
1939for images. WebP lossless images are 26% smaller in size compared to
1940PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1941equivalent SSIM index. WebP supports lossless transparency (also known as
1942alpha channel) with just 22% additional bytes. Transparency is also supported
1943with lossy compression and typically provides 3x smaller file sizes compared
1944to PNG when lossy compression is acceptable for the red/green/blue color
1945channels.")
1946 (license license:bsd-3)))
1947
1948(define-public libmng
1949 (package
1950 (name "libmng")
1951 (version "2.0.3")
1952 (source (origin
1953 (method url-fetch)
1954 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1955 version "/" name "-" version ".tar.xz"))
1956 (sha256
1957 (base32
1958 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1959 (build-system gnu-build-system)
1960 (arguments
1961 (if (and (target-riscv64?)
1962 (%current-target-system))
1963 (list #:phases
1964 #~(modify-phases %standard-phases
1965 (add-after 'unpack 'update-config-scripts
1966 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1967 ;; Replace outdated config.guess and config.sub.
1968 (for-each (lambda (file)
1969 (install-file
1970 (search-input-file
1971 (or native-inputs inputs)
1972 (string-append "/bin/" file)) "."))
1973 '("config.guess" "config.sub"))))))
1974 '()))
1975 (native-inputs
1976 (if (and (target-riscv64?)
1977 (%current-target-system))
1978 (list config)
1979 '()))
1980 (propagated-inputs
1981 ;; These are all in the 'Libs.private' field of libmng.pc.
1982 (list lcms libjpeg-turbo zlib))
1983 (home-page "https://www.libmng.com/")
1984 (synopsis "Library for handling MNG files")
1985 (description
1986 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1987 (license license:bsd-3)))
1988
1989(define-public exiv2
1990 (package
1991 (name "exiv2")
1992 (version "0.28.8")
1993 (source
1994 (origin
1995 (method git-fetch)
1996 (uri (git-reference
1997 (url "https://github.com/exiv2/exiv2")
1998 (commit (string-append "v" version))))
1999 (file-name (git-file-name name version))
2000 (sha256
2001 (base32 "1jj88acjqs8l2s8av1b2mmmh7aha9js7pmx0r288mnsfs2abw1zm"))))
2002 (build-system cmake-build-system)
2003 (arguments
2004 (list
2005 #:tests? #f ;no tests
2006 #:configure-flags
2007 #~(list "-DEXIV2_BUILD_UNIT_TESTS=ON"
2008 ;; darktable needs BMFF to support
2009 ;; CR3 files.
2010 "-DEXIV2_ENABLE_BMFF=ON")
2011 #:modules '((guix build cmake-build-system)
2012 ((guix build gnu-build-system) #:prefix gnu:)
2013 (guix build utils))
2014 #:phases
2015 #~(modify-phases %standard-phases
2016 (add-after 'unpack 'patch-gcc-reference
2017 (lambda _
2018 ;; _GLIBCXX_ASSERTIONS brings reference to GCC.
2019 (substitute* "cmake/compilerFlags.cmake"
2020 (("add_compile_options[(]-Wp,-D_GLIBCXX_ASSERTIONS[)]")
2021 ""))))
2022 (add-after 'install 'delete-static-libraries
2023 (lambda* (#:key outputs #:allow-other-keys)
2024 (let* ((out (assoc-ref outputs "out"))
2025 (lib (string-append out "/lib")))
2026 (for-each delete-file (find-files lib "\\.a$")))))
2027 (replace 'check
2028 (lambda* (#:rest args)
2029 (apply (assoc-ref gnu:%standard-phases 'check)
2030 #:test-target "tests" args)))
2031
2032 #$@(if (or (target-ppc64le?)
2033 (target-aarch64?)
2034 (target-riscv64?))
2035 '((add-after 'unpack 'adjust-tests
2036 (lambda _
2037 ;; Adjust test on ppc64 and aarch64, where no exception
2038 ;; is raised and thus the return value is different. See
2039 ;; <https://github.com/Exiv2/exiv2/issues/365> and
2040 ;; <https://github.com/Exiv2/exiv2/issues/933>.
2041 (substitute* "tests/bugfixes/github/test_CVE_2018_12265.py"
2042 (("\\$uncaught_exception \\$addition_overflow_message\n") "")
2043 (("retval = \\[1\\]") "retval = [0]")))))
2044 '()))))
2045 (propagated-inputs
2046 (list brotli expat libinih zlib))
2047 (native-inputs
2048 (list googletest python))
2049 (home-page "https://www.exiv2.org/")
2050 (synopsis "Library and command-line utility to manage image metadata")
2051 (description
2052 "Exiv2 is a C++ library and a command line utility to manage image
2053metadata. It provides fast and easy read and write access to the Exif, IPTC
2054and XMP metadata of images in various formats.")
2055
2056 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
2057 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
2058 ;; The core is GPLv2+:
2059 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
2060 (license license:gpl2+)))
2061
2062(define-public exiv2-static
2063 (package
2064 (inherit exiv2)
2065 (arguments
2066 (substitute-keyword-arguments arguments
2067 ((#:phases phases)
2068 #~(modify-phases #$phases
2069 (delete 'delete-static-libraries)))))))
2070
2071(define-public exiv2-0.27
2072 (package/inherit exiv2
2073 (name (package-name exiv2))
2074 (version "0.27.7")
2075 (source
2076 (origin
2077 (method git-fetch)
2078 (uri (git-reference
2079 (url "https://github.com/exiv2/exiv2")
2080 (commit (string-append "v" version))))
2081 (file-name (git-file-name name version))
2082 (sha256
2083 (base32 "1a3g7qly75zidj2xjfx1548h6az8sda79cpwvfknsjy3n8d5aay7"))))))
2084
2085(define-public jasper
2086 (package
2087 (name "jasper")
2088 (version "2.0.33")
2089 (source (origin
2090 (method git-fetch)
2091 (uri (git-reference
2092 (url "https://github.com/mdadams/jasper")
2093 (commit (string-append "version-" version))))
2094 (file-name (git-file-name name version))
2095 (sha256
2096 (base32
2097 "0p3fj89gkhd2ys5ci75cwb6p7rvb2pf52jd8c9d4g76qp846njnx"))))
2098 (build-system cmake-build-system)
2099 (inputs
2100 (list libjpeg-turbo))
2101 (synopsis "JPEG-2000 library")
2102 (description "The JasPer Project is an initiative to provide a reference
2103implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
2104ISO/IEC 15444-1).")
2105 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
2106 (license (license:x11-style "file://LICENSE"))))
2107
2108(define-public zimg
2109 (package
2110 (name "zimg")
2111 (version "3.0.5")
2112 (source
2113 (origin
2114 (method git-fetch)
2115 (uri (git-reference
2116 (url "https://github.com/sekrit-twc/zimg")
2117 (commit (string-append "release-" version))))
2118 (file-name (git-file-name name version))
2119 (sha256
2120 (base32 "1vhwnhmrd217bf0iw8xvgqp762xnzjvac7w0nk58pj6f54fal90c"))))
2121 (build-system gnu-build-system)
2122 (native-inputs
2123 (list autoconf automake libtool))
2124 (synopsis "Scaling, colorspace conversion, and dithering library")
2125 (description "Zimg implements the commonly required image processing basics
2126of scaling, colorspace conversion, and depth conversion. A simple API enables
2127conversion between any supported formats to operate with minimal knowledge from
2128the programmer.")
2129 (home-page "https://github.com/sekrit-twc/zimg")
2130 ;; test/extra/ contains musl-libm,
2131 ;; which is MIT/expat licensed, but only used for tests
2132 (license license:wtfpl2)))
2133
2134(define-public perceptualdiff
2135 (package
2136 (name "perceptualdiff")
2137 (version "1.3")
2138 (source
2139 (origin
2140 (method git-fetch)
2141 (uri (git-reference
2142 (url "https://github.com/myint/perceptualdiff")
2143 (commit (string-append "v" version))))
2144 (file-name (git-file-name name version))
2145 (sha256
2146 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
2147 (build-system cmake-build-system)
2148 (inputs (list freeimage))
2149 (arguments
2150 '(#:phases (modify-phases %standard-phases
2151 (add-after 'unpack 'fix-tests
2152 ;; cmake-build-system uses a build/ directory outside
2153 ;; of the source tree, one level higher than expected
2154 (lambda _
2155 (substitute* "test/run_tests.bash"
2156 (("../build") "../../build"))
2157 #t)))))
2158 (home-page "https://github.com/myint/perceptualdiff")
2159 (synopsis "Perceptual image comparison utility")
2160 (description "PerceptualDiff visually compares two images to determine
2161whether they look alike. It uses a computational model of the human visual
2162system to detect similarities. This allows it too see beyond irrelevant
2163differences in file encoding, image quality, and other small variations.")
2164 (license license:gpl2+)))
2165
2166(define-public steghide
2167 (package
2168 (name "steghide")
2169 (version "0.5.1")
2170 (source (origin
2171 (method url-fetch)
2172 (uri (string-append "mirror://sourceforge/steghide/steghide/"
2173 version "/steghide-" version ".tar.bz2"))
2174 (sha256
2175 (base32
2176 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
2177 (patches (list (search-patch "steghide-fixes.patch")))))
2178 (build-system gnu-build-system)
2179 (arguments
2180 (list #:make-flags
2181 #~(list "CXXFLAGS=-fpermissive") ; required for MHashPP.cc
2182 #:phases
2183 #~(modify-phases %standard-phases
2184 (add-before 'configure 'set-perl-search-path
2185 (lambda _
2186 ;; Work around "dotless @INC" build failure.
2187 (setenv "PERL5LIB"
2188 (string-append (getcwd) "/tests:"
2189 (getenv "PERL5LIB"))))))))
2190 (native-inputs
2191 (list gettext-minimal libtool perl))
2192 (inputs
2193 (list libjpeg-turbo libmhash libmcrypt zlib))
2194 (home-page "https://steghide.sourceforge.net")
2195 (synopsis "`Hide' (nonconfidential) data in image or audio files")
2196 (description
2197 "Steghide is a program to `hide' data in various kinds of image and audio
2198files. This practice is known as @dfn{steganography}, but the method used by
2199steghide is not very secure and should not be used where security is at stake.
2200Even if a password is used, steghide offers little plausible deniability.
2201
2202Nonetheless, neither color nor sample frequencies are changed, making the
2203embedding resistant against first-order statistical tests not aimed
2204specifically at this tool.")
2205 (license license:gpl2+)))
2206
2207(define-public optipng
2208 (package
2209 (name "optipng")
2210 (version "0.7.7")
2211 (source
2212 (origin
2213 (method url-fetch)
2214 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
2215 version ".tar.gz"))
2216 (sha256
2217 (base32
2218 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
2219 (modules '((guix build utils)))
2220 (snippet
2221 '(begin
2222 (delete-file-recursively "src/libpng")
2223 (delete-file-recursively "src/zlib")
2224 #t))))
2225 (build-system gnu-build-system)
2226 (inputs
2227 (list libpng zlib))
2228 (arguments
2229 '(#:phases
2230 (modify-phases %standard-phases
2231 (replace 'configure
2232 (lambda* (#:key outputs #:allow-other-keys)
2233 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
2234 (invoke "sh" "configure"
2235 (string-append "--prefix=" (assoc-ref outputs "out"))
2236 "-with-system-libs")
2237 #t)))))
2238 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
2239 (description "OptiPNG is a PNG optimizer that recompresses image
2240files to a smaller size, without losing any information. This program
2241also converts external formats (BMP, GIF, PNM and TIFF) to optimized
2242PNG, and performs PNG integrity checks and corrections.")
2243 (home-page "https://optipng.sourceforge.net/")
2244 (license license:zlib)))
2245
2246(define-public imgp
2247 (package
2248 (name "imgp")
2249 ;; 2.9 was released in 2023
2250 (properties '((commit . "00b2b520964f22ca5b6e0c7d7cb07ce7a755cea7")
2251 (revision . "0")))
2252 (version (git-version "2.9"
2253 (assoc-ref properties 'revision)
2254 (assoc-ref properties 'commit)))
2255 (source
2256 (origin
2257 (method git-fetch)
2258 (uri (git-reference
2259 (url "https://github.com/jarun/imgp")
2260 (commit (assoc-ref properties 'commit))))
2261 (file-name (git-file-name name version))
2262 (sha256
2263 (base32 "1rgm52agxrc8sirm72ksg6c2zpibjh4kvx1b2c59vx5inb33kfdh"))))
2264 (build-system pyproject-build-system)
2265 (arguments
2266 (list #:test-backend #~'custom
2267 ;; There are no actual tests, taken from project's Makefile.
2268 #:test-flags #~(list "-m" "imgp" "--help")))
2269 (native-inputs
2270 (list python-setuptools))
2271 (inputs
2272 (list python-pillow))
2273 (home-page "https://github.com/jarun/imgp")
2274 (synopsis "High-performance CLI batch image resizer & rotator")
2275 (description
2276 "@code{imgp} is a command line image resizer and rotator for JPEG and PNG
2277images. It can resize (or thumbnail) and rotate thousands of images in a go
2278while saving significantly on storage.
2279
2280This package may optionally be built with @code{python-pillow-simd} in place
2281of @code{python-pillow} for SIMD parallelism.")
2282 (license license:gpl3+)))
2283
2284(define-public pngsuite
2285 (package
2286 (name "pngsuite")
2287 (version "2017jul19")
2288 (source
2289 (origin
2290 (method url-fetch/tarbomb)
2291 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
2292 version ".tgz"))
2293 (sha256
2294 (base32
2295 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
2296 (build-system gnu-build-system)
2297 (arguments
2298 '(#:tests? #f ; there is no test target
2299 #:license-file-regexp "PngSuite.LICENSE"
2300 #:phases
2301 (modify-phases %standard-phases
2302 (replace 'install
2303 (lambda* (#:key outputs #:allow-other-keys)
2304 (let ((out (assoc-ref outputs "out")))
2305 (copy-recursively "." (string-append out "/"))
2306 #t)))
2307 (delete 'build)
2308 (delete 'configure))))
2309 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
2310 (synopsis "Example PNGs for use in test suites")
2311 (description "Collection of graphics images created to test PNG
2312applications like viewers, converters and editors. As far as that is
2313possible, all formats supported by the PNG standard are represented.")
2314 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
2315use, copy, modify and distribute these images for any purpose and without fee
2316is hereby granted."))))
2317
2318(define-public qoi
2319 (let ((commit "6fff9b70dd79b12f808b0acc5cb44fde9998725e")
2320 (revision "0"))
2321 (package
2322 (name "qoi")
2323 (version (git-version "0.0.0" revision commit))
2324 (source
2325 (origin
2326 (method git-fetch)
2327 (uri (git-reference
2328 (url "https://github.com/phoboslab/qoi")
2329 (commit commit)))
2330 (file-name (git-file-name name version))
2331 (sha256
2332 (base32 "078zasncyylgnwx6br82nkjssl82wygz6fh8zm65fbfpadzfa3x7"))))
2333 (build-system copy-build-system)
2334 (arguments
2335 (list
2336 #:install-plan
2337 #~'(("qoi.h" "include/"))
2338 #:tests? #f)) ;No tests
2339 (home-page "https://qoiformat.org")
2340 (synopsis "Library for the QOI image format")
2341 (description
2342 "This package provides a library for the QOI image format, offering
2343fast, lossless image compression.")
2344 (license license:expat))))
2345
2346(define-public libjpeg-turbo
2347 (package
2348 (name "libjpeg-turbo")
2349 (version "2.1.4")
2350 (source (origin
2351 (method url-fetch)
2352 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
2353 version "/libjpeg-turbo-" version ".tar.gz"))
2354 (sha256
2355 (base32
2356 "0arl61ici38ann5xjidwdzkhmjdp1r95x4x4zinnh4qs2fhjdvfk"))))
2357 (build-system cmake-build-system)
2358 (native-inputs
2359 (list nasm))
2360 (arguments
2361 (list #:configure-flags
2362 #~'("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
2363 "-DENABLE_STATIC=0"
2364 ;; djpeg-shared-3x2-float-prog-cmp fails on some systems.
2365 #$@(if (or (target-ppc32?)
2366 (target-riscv64?))
2367 '("-DFLOATTEST=NO")
2368 '()))))
2369 (home-page "https://libjpeg-turbo.org/")
2370 (synopsis "SIMD-accelerated JPEG image handling library")
2371 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
2372JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
2373x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
2374its highly-optimized Huffman coding routines allow it to outperform libjpeg by
2375a significant amount.
2376libjpeg-turbo implements both the traditional libjpeg API and the less powerful
2377but more straightforward TurboJPEG API, and provides a full-featured Java
2378interface. It supports color space extensions that allow it to compress from
2379and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
2380 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
2381 (license (list license:bsd-3 ;the TurboJPEG API library and programs
2382 license:ijg ;the libjpeg library and associated tools
2383 license:zlib)))) ;the libjpeg-turbo SIMD extensions
2384
2385(define-public libjpeg-turbo-3
2386 (package
2387 (inherit libjpeg-turbo)
2388 (name "libjpeg-turbo")
2389 (version "3.1.2")
2390 (source (origin
2391 (method url-fetch)
2392 (uri (string-append "https://github.com/" name "/" name
2393 "/releases/download/" version "/" name
2394 "-" version ".tar.gz"))
2395 (sha256
2396 (base32
2397 "1kyhczwa17qp8ik3v876yjqsf4zrjj0z3464j04fak269cii404g"))))))
2398
2399(define-public nifticlib
2400 ;; Warning: The version of the test data may not match the package version.
2401 (let* ((nifti-test-data-version "3.0.2")
2402 (nifti-test-data-file (git-file-name "nifti-test-data"
2403 nifti-test-data-version)))
2404 (package
2405 (name "nifticlib")
2406 (version "3.0.1")
2407 (source (origin
2408 (method git-fetch)
2409 (uri (git-reference
2410 (url "https://github.com/NIFTI-Imaging/nifti_clib")
2411 (commit (string-append "v" version))))
2412 (file-name (git-file-name name version))
2413 (sha256
2414 (base32
2415 "0hamm6nvbjdjjd5md4jahzvn5559frigxaiybnjkh59ckxwb1hy4"))))
2416 (build-system cmake-build-system)
2417 (arguments
2418 (list
2419 #:configure-flags
2420 #~(append
2421 (list "-DBUILD_SHARED_LIBS=ON"
2422 "-DDOWNLOAD_TEST_DATA=OFF"
2423 ;; Test data directory must be writeable.
2424 (string-append "-Dfetch_testing_data_SOURCE_DIR="
2425 (canonicalize-path ".") "/source/test-data")
2426 "-DUSE_CIFTI_CODE=ON")
2427 ;; Unable to generate manual pages via help2man when cross-compiling.
2428 (if #$(%current-target-system)
2429 '()
2430 (list "-DNIFTI_INSTALL_NO_DOCS=FALSE")))
2431 #:phases
2432 #~(modify-phases %standard-phases
2433 (add-after 'unpack 'set-version
2434 (lambda _
2435 (substitute* "CMakeLists.txt"
2436 (("0.0.0.0") #$version))))
2437 (add-after 'unpack 'prepare-test-data
2438 (lambda* (#:key tests? #:allow-other-keys)
2439 (when tests?
2440 (copy-recursively #$(this-package-native-input
2441 nifti-test-data-file)
2442 "test-data"))))
2443 (add-after 'unpack 'patch-tests
2444 (lambda* (#:key tests? #:allow-other-keys)
2445 (when tests?
2446 (substitute* (string-append "nifti2/nifti_regress_test/"
2447 "cmake_testscripts/"
2448 "install_linking_test.sh")
2449 (("real_easy") "source/real_easy")))))
2450 (delete 'check)
2451 (add-after 'install 'check
2452 (lambda args
2453 ;; The 'install_linking' test invokes this package's binaries.
2454 (setenv "PATH" (string-append (getenv "PATH") ":"
2455 #$output "/bin"))
2456 (apply (assoc-ref %standard-phases 'check) args))))))
2457 (inputs (list expat zlib))
2458 (native-inputs
2459 (append
2460 (list
2461 (origin
2462 (method git-fetch)
2463 (uri (git-reference
2464 (url "https://github.com/NIFTI-Imaging/nifti-test-data")
2465 (commit (string-append "v" nifti-test-data-version))))
2466 (file-name nifti-test-data-file)
2467 (sha256
2468 (base32 "0jdm8amix7pvfb1zmrb89f7izji2s8fpbfncgamczsngc11yfgcp"))))
2469 (if (%current-target-system)
2470 '()
2471 (list help2man))))
2472 (synopsis
2473 "C libraries for reading and writing files in @acronym{NIfTI, Neuroimaging
2474Informatics Technology Initiative} formats")
2475 (description
2476 "@code{Nifti_clib} is a set of I/O libraries for reading and writing files
2477in the nifti-1, nifti-2, and (to some degree) cifti file formats. These are
2478binary file formats for storing medical image data, e.g. @acronym{MRI, magnetic
2479resonance imaging} and @acronym{fMRI, functional MRI} brain images.")
2480 (home-page "https://github.com/NIFTI-Imaging/nifti_clib")
2481 (license license:public-domain))))
2482
2483(define-public niftilib
2484 (deprecated-package "niftilib" nifticlib))
2485
2486(define-public mini
2487 (package
2488 (name "mini")
2489 (version "0.9.17")
2490 (source (origin
2491 (method git-fetch)
2492 (uri (git-reference
2493 (url "https://github.com/pulzed/mINI")
2494 (commit version)))
2495 (file-name (git-file-name name version))
2496 (sha256
2497 (base32
2498 "0n4c4dsmycp9pgaykc7rpgrgs23nb5gc9fb4agq95fdfpphdarm4"))))
2499 (build-system gnu-build-system)
2500 (arguments
2501 (list #:phases
2502 #~(modify-phases %standard-phases
2503 (delete 'build)
2504 (delete 'configure)
2505 (replace 'check
2506 (lambda* (#:key tests? #:allow-other-keys)
2507 (when tests?
2508 (with-directory-excursion "tests"
2509 (for-each (lambda (test)
2510 (let ((test-name (basename test
2511 ".cpp")))
2512 (invoke "./build.sh" test-name)
2513 (invoke "./run.sh" test-name)))
2514 (find-files "." ".cpp"))))))
2515 (replace 'install
2516 (lambda _
2517 (install-file "src/mini/ini.h"
2518 (string-append #$output "/include/mini")))))))
2519 (home-page "https://github.com/pulzed/mINI")
2520 (synopsis "INI file reader and writer header library")
2521 (description
2522 "This is a tiny, header-only C++ library for manipulating INI files.")
2523 (license license:expat)))
2524
2525(define-public picket
2526 (package
2527 (name "picket")
2528 (version "1.3")
2529 (source (origin
2530 (method git-fetch)
2531 (uri (git-reference
2532 (url "https://github.com/rajter/picket")
2533 (commit (string-append "v" version))))
2534 (file-name (git-file-name name version))
2535 (sha256
2536 (base32
2537 "1zhpynyakjx9nc51b1j80b4y3138p3l380kp1cqmmjx2n9430144"))
2538 (snippet '(begin
2539 ;; bundled mINI header library.
2540 (delete-file "src/cfg/ini.h")))))
2541 (native-inputs (list pkg-config))
2542 (inputs (list gtkmm-3 mini))
2543 (arguments
2544 (list #:tests? #f
2545 #:phases #~(modify-phases %standard-phases
2546 (add-after 'unpack 'fix-mini-includes
2547 (lambda _
2548 (substitute* '("src/cfg/config.h"
2549 "src/cfg/config.cpp")
2550 (("#include \"ini.h\"")
2551 "#include \"mini/ini.h\""))
2552 (substitute* "src/main.cpp"
2553 (("/usr")
2554 #$output))))
2555 (add-after 'unpack 'fix-cmake-paths
2556 (lambda* (#:key inputs #:allow-other-keys)
2557 (substitute* "CMakeLists.txt"
2558 (("src/cfg/ini.h")
2559 (search-input-file inputs
2560 "/include/mini/ini.h"))
2561 (("/usr/")
2562 #$output)))))))
2563 (build-system cmake-build-system)
2564 (home-page "https://github.com/rajter/picket")
2565 (synopsis "Screen color picker with custom format output")
2566 (description
2567 "Picket is a screen color picker that includes a magnifier and supports
2568custom formats for representing color values..")
2569 (license license:gpl3+)))
2570
2571(define-public gpick
2572 (package
2573 (name "gpick")
2574 (version "0.2.6")
2575 (source
2576 (origin
2577 (method git-fetch)
2578 (uri (git-reference
2579 (url "https://github.com/thezbyg/gpick")
2580 (commit (string-append name "-" version))))
2581 (file-name (git-file-name name version))
2582 (sha256
2583 (base32 "0nl89gca5nmbyycv5rl5bm6k7facapdk4pab9pl949aa3cjw9bk7"))))
2584 (build-system scons-build-system)
2585 (arguments
2586 (list
2587 #:tests? #f
2588 #:scons-flags
2589 #~(list (string-append "DESTDIR=" %output))
2590 #:phases
2591 #~(modify-phases %standard-phases
2592 (add-before 'build 'fix-lua-reference
2593 (lambda _
2594 (substitute* "SConscript"
2595 (("lua5.2")
2596 "lua-5.2")))))))
2597 (native-inputs (list boost-1.83 gettext-minimal pkg-config ragel))
2598 (inputs (list expat gtk+-2 lua-5.2))
2599 (home-page "http://www.gpick.org/")
2600 (synopsis "Color picker")
2601 (description "Gpick is an advanced color picker and palette editing tool.")
2602 (license license:bsd-3)))
2603
2604(define-public libiptcdata
2605 (package
2606 (name "libiptcdata")
2607 (version "1.0.5")
2608 (source (origin
2609 (method url-fetch)
2610 (uri (string-append "https://github.com/ianw/libiptcdata"
2611 "/releases/download/release_"
2612 (string-join (string-split version #\.) "_")
2613 "/" name "-" version ".tar.gz"))
2614 (sha256
2615 (base32
2616 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
2617 (build-system gnu-build-system)
2618 (home-page "https://github.com/ianw/libiptcdata")
2619 (synopsis "IPTC metadata manipulation library")
2620 (description
2621 "Libiptcdata is a C library for manipulating the International Press
2622Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
2623such as images. This metadata can include captions and keywords, often used by
2624popular photo management applications. The library provides routines for
2625parsing, viewing, modifying, and saving this metadata.")
2626 (license license:lgpl2.0+)))
2627
2628(define-public flameshot
2629 (package
2630 (name "flameshot")
2631 (version "13.3.0")
2632 (source
2633 (origin
2634 (method git-fetch)
2635 (uri (git-reference
2636 (url "https://github.com/flameshot-org/flameshot")
2637 (commit (string-append "v" version))))
2638 (file-name (git-file-name name version))
2639 (sha256
2640 (base32
2641 "1v9xsivq9wnj7x1gr877a40xi6j672h9j82c5nkih9b64jg0naj7"))))
2642 (build-system qt-build-system)
2643 (arguments
2644 (list
2645 #:qtbase qtbase
2646 #:tests? #f ;no tests
2647 #:configure-flags
2648 #~(list "-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
2649 "-DUSE_BUNDLED_KDSINGLEAPPLICATION=OFF"
2650 "-DDISABLE_UPDATE_CHECKER=ON")))
2651 (native-inputs (list qttools))
2652 (inputs (list kdsingleapplication qtcolorwidgets qtsvg))
2653 (home-page "https://github.com/flameshot-org/flameshot")
2654 (synopsis "Powerful yet simple to use screenshot software")
2655 (description "Flameshot is a screenshot program.
2656Features:
2657
2658@itemize
2659@item Customizable appearance.
2660@item Easy to use.
2661@item In-app screenshot edition.
2662@item DBus interface.
2663@item Upload to Imgur.
2664@end itemize\n")
2665 (license license:gpl3+)))
2666
2667(define-public swappy
2668 (package
2669 (name "swappy")
2670 (version "1.8.0")
2671 (source
2672 (origin
2673 (method git-fetch)
2674 (uri (git-reference
2675 (url "https://github.com/jtheoof/swappy")
2676 (commit (string-append "v" version))))
2677 (file-name (git-file-name name version))
2678 (sha256
2679 (base32 "0drihlsc193dzffnllpjwhq5n6j7m5pix1wxgnkgp4x3nvmvkxxc"))))
2680 (build-system meson-build-system)
2681 (native-inputs
2682 (list pkg-config scdoc
2683 `(,glib "bin"))) ; for 'glib-compile-resources'
2684 (inputs
2685 (list gtk+ libnotify gettext-minimal))
2686 (propagated-inputs
2687 ;; Needed to properly render the icons.
2688 (list font-awesome))
2689 (home-page "https://github.com/jtheoof/swappy")
2690 (synopsis "Grab and edit on the fly snapshots of a Wayland compositor")
2691 (description
2692 "@command{swappy} is a command-line utility to take and edit screenshots
2693of Wayland desktops. Works great with grim, slurp and sway. But can easily
2694work with other screen copy tools that can output a final PNG image to
2695stdout.")
2696 (license license:expat)))
2697
2698(define-public gifsicle
2699 (package
2700 (name "gifsicle")
2701 (version "1.95")
2702 (source
2703 (origin
2704 (method git-fetch)
2705 (uri (git-reference
2706 (url "https://github.com/kohler/gifsicle")
2707 (commit (string-append "v" version))))
2708 (file-name (git-file-name name version))
2709 (sha256
2710 (base32 "1wvsf2kv90bqpyxcjilir4zgmaga0xjg96vnn7rzq4fkjx8pb3yg"))
2711 (modules '((guix build utils)))
2712 (snippet '(begin (substitute* "configure.ac"
2713 (("2.72") "2.69"))))))
2714 (build-system gnu-build-system)
2715 (arguments
2716 (list
2717 #:phases
2718 #~(modify-phases %standard-phases
2719 (add-before 'check 'patch-tests
2720 (lambda _
2721 (substitute* "test/testie"
2722 (("/usr/bin/perl")
2723 (which "perl"))
2724 (("/bin/sh")
2725 (which "sh"))
2726 (("/bin/rm")
2727 (which "rm"))))))))
2728 (native-inputs
2729 (list
2730 autoconf automake
2731 perl)) ; only for tests
2732 (inputs (list libx11))
2733 (home-page "https://www.lcdf.org/gifsicle/")
2734 (synopsis "Edit GIF images and animations")
2735 (description "Gifsicle is a command-line GIF image manipulation tool that:
2736
2737@itemize
2738@item Provides a batch mode for changing GIFs in place.
2739@item Prints detailed information about GIFs, including comments.
2740@item Control over interlacing, comments, looping, transparency, etc.
2741@item Creates well-behaved GIFs: removes redundant colors, only uses local color
2742tables, etc.
2743@item Shrinks colormaps and change images to use the Web-safe palette.
2744@item Optimizes GIF animations, or unoptimizes them for easier editing.
2745@end itemize
2746
2747Two other programs are included with Gifsicle: @command{gifview} is a
2748lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
2749identical visual appearance.")
2750 (license license:gpl2+)))
2751
2752(define-public jp2a
2753 (package
2754 (name "jp2a")
2755 (version "1.1.1")
2756 (source
2757 (origin
2758 (method url-fetch)
2759 (uri (string-append "https://github.com/Talinx/jp2a/releases/download/v"
2760 version "/jp2a-" version ".tar.gz"))
2761 (sha256
2762 (base32
2763 "10kwhh1a0ivrzagl2vcxrbqmlr2q8x29ymqwzchpiriy6xqxck8l"))))
2764 (build-system gnu-build-system)
2765 (inputs
2766 (list curl libpng libjpeg-turbo ncurses))
2767 (native-inputs
2768 (list doxygen))
2769 (home-page "https://csl.name/jp2a/")
2770 (synopsis "Convert JPEG images to ASCII")
2771 (description
2772 "Jp2a is a small utility that converts JPEG images to ASCII.")
2773 (license license:gpl2)))
2774
2775(define-public grim
2776 (package
2777 (name "grim")
2778 (version "1.5.0")
2779 (source
2780 (origin
2781 (method git-fetch)
2782 (uri (git-reference
2783 (url "https://gitlab.freedesktop.org/emersion/grim/")
2784 (commit (string-append "v" version))))
2785 (file-name (git-file-name name version))
2786 (sha256
2787 (base32 "1rabva3x203hbsnmad6zrvlpxadmxw1zmd42i3pjk05pnk73mym0"))))
2788 (build-system meson-build-system)
2789 (native-inputs (append (if (%current-target-system)
2790 ;; For wayland-scanner.
2791 (list pkg-config-for-build wayland)
2792 '())
2793 (list pkg-config scdoc)))
2794 (inputs (list pixman libpng libjpeg-turbo wayland wayland-protocols))
2795 (home-page "https://gitlab.freedesktop.org/emersion/grim")
2796 (synopsis "Create screenshots from a Wayland compositor")
2797 (description "grim can create screenshots from a Wayland compositor.")
2798 (license license:expat)))
2799
2800(define-public slurp
2801 (package
2802 (name "slurp")
2803 (version "1.5.0")
2804 (source
2805 (origin
2806 (method git-fetch)
2807 (uri (git-reference
2808 (url "https://github.com/emersion/slurp")
2809 (commit (string-append "v" version))))
2810 (file-name (git-file-name name version))
2811 (sha256
2812 (base32 "0wlml42c3shma50bsvqzll7p3zn251jaf0jm59q2idks8gg1zkyq"))))
2813 (build-system meson-build-system)
2814 (native-inputs
2815 (append (if (%current-target-system)
2816 ;; for wayland-scanner
2817 (list wayland pkg-config-for-build)
2818 '())
2819 (list pkg-config scdoc)))
2820 (inputs
2821 (list cairo libxkbcommon wayland wayland-protocols))
2822 (home-page "https://github.com/emersion/slurp")
2823 (synopsis "Select a region in a Wayland compositor")
2824 (description "Slurp can select a region in a Wayland compositor and print it
2825to the standard output. It works well together with grim.")
2826 (license license:expat)))
2827
2828(define-public sng
2829 (package
2830 (name "sng")
2831 (version "1.1.0")
2832 (source
2833 (origin
2834 (method url-fetch)
2835 (uri (string-append "mirror://sourceforge/sng/sng-"
2836 version ".tar.gz"))
2837 (sha256
2838 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
2839 (build-system gnu-build-system)
2840 (arguments
2841 `(#:phases
2842 (modify-phases %standard-phases
2843 (add-before 'check 'link-pngsuite
2844 ;; tests expect pngsuite in source dir
2845 (lambda* (#:key inputs #:allow-other-keys)
2846 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
2847 #t)))
2848 #:configure-flags
2849 (list (string-append "--with-rgbtxt="
2850 (assoc-ref %build-inputs "xorg-rgb")
2851 "/share/X11/rgb.txt"))))
2852 (inputs (list xorg-rgb libpng))
2853 (native-inputs (list pngsuite))
2854 (home-page "https://sng.sourceforge.net")
2855 (synopsis "Markup language for representing PNG contents")
2856 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
2857specifically to represent the entire contents of a PNG (Portable Network
2858Graphics) file in an editable form. Thus, SNGs representing elaborate
2859graphics images and ancillary chunk data can be readily generated or modified
2860using only text tools.
2861
2862SNG is implemented by a compiler/decompiler called sng that
2863losslessly translates between SNG and PNG.")
2864 (license license:zlib)))
2865
2866(define-public blurhash
2867 (package
2868 (name "blurhash")
2869 (version "0.2.0")
2870 (source
2871 (origin
2872 (method git-fetch)
2873 (uri (git-reference
2874 (url "https://github.com/Nheko-Reborn/blurhash")
2875 (commit (string-append "v" version))))
2876 (file-name (git-file-name name version))
2877 (sha256
2878 (base32 "0hx15fspava43z47kv17ivxv56g03fb2zf45dl07v3shickqxw0x"))))
2879 (build-system meson-build-system)
2880 (native-inputs
2881 (list doctest pkg-config))
2882 (home-page "https://github.com/Nheko-Reborn/blurhash")
2883 (synopsis "C++ blurhash encoder/decoder")
2884 (description "Simple encoder and decoder for blurhashes. Contains a
2885command line program as well as a shared library.")
2886 (license license:boost1.0)))
2887
2888(define-public lodepng
2889 ;; There are no tags in the repository, so we take the version as defined in
2890 ;; lodepng.cpp.
2891 (let ((commit "48e5364ef48ec2408f44c727657ac1b6703185f8")
2892 (revision "1")
2893 (version "20200215"))
2894 (package
2895 (name "lodepng")
2896 (version (git-version version revision commit))
2897 (source (origin
2898 (method git-fetch)
2899 (uri (git-reference
2900 (url "https://github.com/lvandeve/lodepng")
2901 (commit commit)))
2902 (sha256
2903 (base32
2904 "1a1x8ag2scanzb2066jm9hg2y9kaa3wmpgmz10l1x9bkpik612lw"))
2905 (file-name (git-file-name name version))))
2906 (build-system gnu-build-system)
2907 (arguments
2908 '(#:phases
2909 (modify-phases %standard-phases
2910 (delete 'configure)
2911 (replace 'build
2912 (lambda _
2913 (setenv "CXXFLAGS" "-fPIC")
2914 (invoke "make" "lodepng.o")
2915 (invoke "make" "lodepng_util.o")
2916 (invoke "g++" "-fPIC" "-O3"
2917 "-o" "liblodepng.so"
2918 "-shared" "lodepng.o" "lodepng_util.o")
2919 #t))
2920 (replace 'check
2921 (lambda _
2922 (invoke "make" "unittest")
2923 (invoke "./unittest")
2924 #t))
2925 (replace 'install
2926 (lambda* (#:key outputs #:allow-other-keys)
2927 (let* ((out (assoc-ref outputs "out"))
2928 (doc (string-append out "/share/doc"))
2929 (lib (string-append out "/lib"))
2930 (include (string-append out "/include")))
2931 (install-file "lodepng.h" include)
2932 (install-file "lodepng_util.h" include)
2933 (install-file "liblodepng.so" lib)
2934 (install-file "README.md" doc)
2935 #t))))))
2936 (home-page "https://lodev.org/lodepng/")
2937 (synopsis "PNG encoder and decoder in C and C++, without dependencies")
2938 (description "LodePNG is a PNG image decoder and encoder, all in one,
2939no dependency or linkage required. It's made for C (ISO C90), and has a C++
2940wrapper with a more convenient interface on top.")
2941 (license license:zlib))))
2942
2943(define-public lodepng/c
2944 (package/inherit lodepng
2945 (name "lodepng-c")
2946 (arguments
2947 (substitute-keyword-arguments arguments
2948 ((#:make-flags _ '())
2949 #~(list (string-append "CC=" #$(cc-for-target))
2950 "CFLAGS=-fPIC"))
2951 ((#:phases phases)
2952 #~(modify-phases #$phases
2953 (add-after 'unpack 'patch
2954 (lambda _
2955 (rename-file "lodepng.cpp" "lodepng.c")))
2956 ;; The unittest target requires the <vector> header which is
2957 ;; available only for C++.
2958 (delete 'check)
2959 (replace 'build
2960 (lambda* (#:key (make-flags '()) #:allow-other-keys)
2961 (apply invoke "make" "lodepng.o" make-flags)
2962 (invoke #$(cc-for-target) "-fPIC" "-O3"
2963 "-o" "liblodepng.so"
2964 "-shared" "lodepng.o")))
2965 (replace 'install
2966 (lambda _
2967 (install-file "lodepng.h" (string-append #$output "/include"))
2968 (install-file "liblodepng.so" (string-append #$output "/lib"))
2969 (install-file "README.md"
2970 (string-append #$output
2971 "/share/doc/lodepng"))))))))
2972 (properties '((upstream-name . "lodepng")))))
2973
2974(define-public icoutils
2975 (package
2976 (name "icoutils")
2977 (version "0.32.3")
2978 (source
2979 (origin
2980 (method url-fetch)
2981 (uri (string-append
2982 "mirror://savannah/icoutils/icoutils-" version ".tar.bz2"))
2983 (sha256
2984 (base32 "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp"))))
2985 (build-system gnu-build-system)
2986 (inputs
2987 (list libpng perl))
2988 (propagated-inputs
2989 (list perl-libwww))
2990 (home-page "https://www.nongnu.org/icoutils/")
2991 (synopsis "Extract and convert bitmaps from Windows icon and cursor files")
2992 (description "Icoutils are a set of program for extracting and converting
2993bitmaps from Microsoft Windows icon and cursor files. These files usually
2994have the extension @code{.ico} or @code{.cur}, but they can also be embedded
2995in executables and libraries (@code{.dll}-files). (Such embedded files are
2996referred to as resources.)
2997
2998Conversion of these files to and from PNG images is done @command{icotool}.
2999@command{extresso} automates these tasks with the help of special resource
3000scripts. Resources such can be extracted from MS Windows executable and
3001library files with @command{wrestool}.
3002
3003This package can be used to create @code{favicon.ico} files for web sites.")
3004 (license license:gpl3+)))
3005
3006(define-public libavif
3007 (package
3008 (name "libavif")
3009 (version "1.0.4")
3010 (source (origin
3011 (method git-fetch)
3012 (uri (git-reference
3013 (url "https://github.com/AOMediaCodec/libavif")
3014 (commit (string-append "v" version))))
3015 (file-name (git-file-name name version))
3016 (sha256
3017 (base32
3018 "0k72q7yvfdn92wkslyifw14319nm981a8r3kd84i4ylxmrkgi0zm"))))
3019 (build-system cmake-build-system)
3020 (arguments
3021 (list
3022 #:modules '((guix build cmake-build-system)
3023 (guix build utils)
3024 (srfi srfi-26))
3025 #:configure-flags
3026 #~(list "-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
3027 #$@(if (this-package-input "rav1e")
3028 '("-DAVIF_CODEC_RAV1E=ON")
3029 '())
3030 "-DAVIF_BUILD_TESTS=ON" "-DAVIF_ENABLE_GTEST=ON"
3031 "-DAVIF_BUILD_APPS=ON" "-DAVIF_BUILD_GDK_PIXBUF=ON")
3032 #:phases
3033 #~(modify-phases %standard-phases
3034 (add-before 'configure 'patch-thumbnailer
3035 (lambda _
3036 (substitute* "contrib/gdk-pixbuf/avif.thumbnailer.in"
3037 (("@CMAKE_INSTALL_FULL_BINDIR@/gdk-pixbuf-thumbnailer")
3038 (string-append #$gdk-pixbuf "/bin/gdk-pixbuf-thumbnailer")))))
3039 (add-after 'install 'install-readme
3040 (lambda _
3041 (let ((doc (string-append #$output "/share/doc/libavif-"
3042 #$(package-version this-package))))
3043 (install-file "../source/README.md" doc))))
3044 (add-after 'install 'split
3045 (lambda _
3046 (let* ((avifenc (string-append #$output "/bin/avifenc"))
3047 (avifenc* (string-append #$output:tools "/bin/avifenc"))
3048 (avifdec (string-append #$output "/bin/avifdec"))
3049 (avifdec* (string-append #$output:tools "/bin/avifdec"))
3050
3051 (thumbnailer (string-append
3052 #$output
3053 "/share/thumbnailers/avif.thumbnailer"))
3054 (thumbnailer* (string-append
3055 #$output:pixbuf-loader
3056 "/share/thumbnailers/avif.thumbnailer"))
3057 (pixbuf-loader (string-append
3058 #$output
3059 "/lib/gdk-pixbuf-2.0/2.10.0/loaders/"
3060 "libpixbufloader-avif.so"))
3061 (pixbuf-loader* (string-append
3062 #$output:pixbuf-loader
3063 "/lib/gdk-pixbuf-2.0/2.10.0/loaders/"
3064 "libpixbufloader-avif.so")))
3065 (mkdir-p (string-append #$output:tools "/bin"))
3066 (for-each (compose mkdir-p
3067 (cut string-append
3068 #$output:pixbuf-loader <>))
3069 '("/share/thumbnailers"
3070 "/lib/gdk-pixbuf-2.0/2.10.0/loaders/"))
3071
3072 (for-each (lambda (old new)
3073 (copy-file old new)
3074 (delete-file old)
3075 (chmod new #o555))
3076 (list avifenc avifdec
3077 thumbnailer pixbuf-loader)
3078 (list avifenc* avifdec*
3079 thumbnailer* pixbuf-loader*))))))))
3080 (native-inputs (list googletest pkg-config))
3081 (inputs
3082 (append
3083 (if (member (%current-system) (package-transitive-supported-systems rav1e))
3084 (list rav1e) '())
3085 (list dav1d libaom zlib libpng libjpeg-turbo gdk-pixbuf)))
3086 (outputs (list "out"
3087 "tools" ; avifenc & avifdec
3088 "pixbuf-loader"))
3089 (synopsis "Encode and decode AVIF files")
3090 (description "Libavif is a C implementation of @acronym{AVIF, the AV1 Image
3091File Format}. It can encode and decode all YUV formats and bit depths supported
3092by AOM, including with alpha.")
3093 (home-page "https://github.com/AOMediaCodec/libavif")
3094 (license (list license:bsd-2))))
3095
3096(define-public libheif
3097 (package
3098 (name "libheif")
3099 (version "1.23.1")
3100 (source
3101 (origin
3102 (method git-fetch)
3103 (uri (git-reference
3104 (url "https://github.com/strukturag/libheif")
3105 (commit (string-append "v" version))))
3106 (file-name (git-file-name name version))
3107 (sha256
3108 (base32 "1asr4zvj7h1nywzwmq6dby1ark4709q8rada45z1r9g5zw511s53"))))
3109 (build-system cmake-build-system)
3110 (native-inputs
3111 (list autoconf automake libtool pkg-config))
3112 (inputs
3113 (list gdk-pixbuf ; optional
3114 libjpeg-turbo
3115 libpng))
3116 ;; Propagated to satisfy 'libheif.pc'.
3117 (propagated-inputs
3118 (list dav1d libaom libde265 libx264 openh264 x265))
3119 (home-page "https://github.com/strukturag/libheif")
3120 (synopsis "HEIF and AVIF file format decoder and encoder")
3121 (description
3122 "@code{libheif} is an ISO/IEC 23008-12:2017 HEIF and AVIF (AV1 Image File
3123Format) file format decoder and encoder.")
3124 (license license:lgpl3+)))
3125
3126(define libjxl-testdata
3127 (origin
3128 (method git-fetch)
3129 (uri (git-reference
3130 (url "https://github.com/libjxl/testdata")
3131 (commit "ff8d743aaba05b3014f17e5475e576242fa979fc")))
3132 (sha256
3133 (base32 "05nba2h0m74n5f9jzl3vzvnj74fj3si09ncwk2dqg41qdc49d1ng"))))
3134
3135(define-public libjxl
3136 (package
3137 (name "libjxl")
3138 (version "0.11.2")
3139 (outputs (list "out" "pixbuf-loader"))
3140 (source
3141 (origin
3142 (method git-fetch)
3143 (uri (git-reference
3144 (url "https://github.com/libjxl/libjxl")
3145 (commit (string-append "v" version))))
3146 (file-name (git-file-name name version))
3147 (sha256
3148 (base32 "0a6fg2v81rqsbrzi97x1d7wadcikh2fizr64rsza668cwvsk631q"))))
3149 (build-system cmake-build-system)
3150 (arguments
3151 (list
3152 #:configure-flags
3153 #~'("-DJPEGXL_FORCE_SYSTEM_GTEST=true"
3154 "-DJPEGXL_FORCE_SYSTEM_BROTLI=true"
3155 "-DJPEGXL_FORCE_SYSTEM_LCMS2=true"
3156 "-DJPEGXL_FORCE_SYSTEM_HWY=true"
3157 "-DJPEGXL_BUNDLE_LIBPNG=false"
3158 "-DJPEGXL_ENABLE_PLUGINS=true")
3159 #:phases
3160 #~(modify-phases %standard-phases
3161 #$@(cond
3162 ((target-riscv64?)
3163 #~((add-after 'unpack 'fix-atomic
3164 (lambda _
3165 (substitute* "lib/jxl/enc_xyb.cc"
3166 (("#include \"lib/jxl/enc_xyb.h\"" a)
3167 (string-append a "\n#include <atomic>")))))))
3168 ((target-x86-32?)
3169 #~((add-after 'unpack 'loosen-test-parameter
3170 (lambda _
3171 ;; This test fails likely due to a floating point
3172 ;; rounding difference.
3173 (substitute* "lib/jxl/color_management_test.cc"
3174 (("8\\.7e-4") "8.7e-3"))))))
3175 (#t
3176 #~()))
3177 (add-after 'unpack 'patch-dependencies
3178 (lambda* (#:key inputs #:allow-other-keys)
3179 (with-directory-excursion "third_party"
3180 ;; HACK: Create dummy files to pretend the bundled sjpeg and
3181 ;; skcms exist.
3182 (apply invoke "touch"
3183 '("sjpeg/CMakeLists.txt"
3184 "sjpeg/COPYING"
3185 "skcms/skcms.h"
3186 "skcms/LICENSE"))
3187 (substitute* "CMakeLists.txt"
3188 (("include\\(skcms\\.cmake\\)")
3189 "find_library(SKCMS_LIB NAMES skcms REQUIRED)")
3190 (("include\\(sjpeg\\.cmake\\)")
3191 "find_package(sjpeg REQUIRED)")))
3192 (with-directory-excursion "lib"
3193 (substitute* "jxl_cms.cmake"
3194 (("target_link_skcms\\(jxl_cms\\)")
3195 "target_link_libraries(jxl_cms PRIVATE ${SKCMS_LIB})"))
3196 (substitute* "jxl_extras.cmake"
3197 (("\\.\\.\\/third_party\\/sjpeg\\/src")
3198 (dirname (search-input-file inputs "src/sjpegi.h")))))))
3199 (add-after 'unpack 'unpack-testdata
3200 (lambda _
3201 (rmdir "testdata")
3202 (copy-recursively #$libjxl-testdata "testdata")))
3203 (add-after 'install 'split
3204 (lambda _
3205 (for-each
3206 (lambda (path)
3207 (let ((old (string-append #$output path))
3208 (new (string-append #$output:pixbuf-loader path)))
3209 (install-file old (dirname new))
3210 (delete-file old)
3211 (chmod new #o555)))
3212 '("/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jxl.so"
3213 "/share/thumbnailers/jxl.thumbnailer")))))))
3214 (native-inputs
3215 (list asciidoc
3216 doxygen
3217 googletest
3218 pkg-config
3219 python
3220 (package-source sjpeg))) ;for sjpegi.h
3221 (inputs
3222 (list freeglut
3223 gdk-pixbuf
3224 gflags
3225 giflib
3226 imath
3227 lcms
3228 libavif
3229 libjpeg-turbo
3230 libpng
3231 libwebp
3232 openexr
3233 sjpeg
3234 skcms
3235 zlib))
3236 ;; These are in Requires.private of libjxl.pc.
3237 (propagated-inputs
3238 (list brotli google-highway))
3239 (home-page "https://github.com/libjxl/libjxl")
3240 (synopsis "JPEG XL image format reference implementation")
3241 (description "This package contains a reference implementation of JPEG XL
3242(encoder and decoder).")
3243 (properties
3244 `((output-synopsis "pixbuf-loader" "gdk-pixbuf loader for the JXL format")))
3245 (license license:bsd-3)))
3246
3247(define-public mtpaint
3248 (package
3249 (name "mtpaint")
3250 ;; The author neither releases tarballs nor uses git version tags.
3251 ;; Instead, author puts version in git commit title.
3252 (version "3.50.12")
3253 (source
3254 (origin
3255 (method git-fetch)
3256 (uri (git-reference
3257 (url "https://github.com/wjaguar/mtPaint")
3258 (commit "7cae5d663ed835a365d89a535536c39e18862a83")))
3259 (file-name (git-file-name name version))
3260 (sha256
3261 (base32 "0rcblsdikn5659gzqwq3xdws5k03xyvd4yj7r0rm78daamki1wsv"))))
3262 (build-system gnu-build-system)
3263 (native-inputs
3264 (list
3265 gettext-minimal
3266 perl
3267 pkg-config
3268 which))
3269 (inputs
3270 (list
3271 glib
3272 gtk+
3273 imlib2
3274 libjpeg-turbo
3275 libpng
3276 libtiff
3277 libungif
3278 libwebp
3279 openjpeg
3280 lcms
3281 zlib))
3282 (arguments
3283 (list
3284 #:tests? #f ; no test suite
3285 #:phases
3286 #~(modify-phases %standard-phases
3287 (replace 'configure
3288 ;; Do not use "--enable-fast-install".
3289 (lambda _
3290 (invoke "./configure"
3291 (string-append "--prefix=" #$output)
3292 "intl" "man"))))))
3293 (home-page "https://mtpaint.sourceforge.net/")
3294 (synopsis "Create pixel art and manipulate digital images")
3295 (description
3296 "Mtpaint is a graphic editing program which uses the GTK+ toolkit.
3297It can create and edit indexed palette or 24bit RGB images, offers basic
3298painting and palette manipulation tools. It also handles JPEG, JPEG2000,
3299GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
3300 (license license:gpl3+)))
3301
3302(define-public mypaint
3303 (package
3304 (name "mypaint")
3305 ;; The latest changes contains support for Python 3.12+.
3306 (properties '((commit . "35aa9d33cd3deba6cafea6d8fc901b5a1d161ceb")
3307 (revision . "0")))
3308 (version (git-version "2.0.1"
3309 (assoc-ref properties 'revision)
3310 (assoc-ref properties 'commit)))
3311 (source
3312 (origin
3313 (method git-fetch)
3314 (uri (git-reference
3315 (url "https://github.com/mypaint/mypaint")
3316 (commit (assoc-ref properties 'commit))))
3317 (file-name (git-file-name name version))
3318 (sha256
3319 (base32 "1p1i799dzpx0zr7chkz0pjdq9l32ahckgyagbiw82c27mwxqabfh"))))
3320 (build-system pyproject-build-system)
3321 (arguments
3322 (list
3323 #:imported-modules `(,@%pyproject-build-system-modules
3324 (guix build glib-or-gtk-build-system))
3325 #:modules '((guix build pyproject-build-system)
3326 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
3327 (guix build utils))
3328 #:phases
3329 #~(modify-phases %standard-phases
3330 (add-after 'install 'move-assets-to-data
3331 ;; XXX: Check why.
3332 ;;
3333 ;; ERROR: gui.application: Missing icon 'org.mypaint.MyPaint':
3334 ;; check that mypaint icons have been installed into
3335 ;; /gnu/store/<...>/data/icons
3336 ;;
3337 ;; gi.repository.GLib.GError: g-file-error-quark: Failed to open
3338 ;; file
3339 ;; “/gnu/store/<...>/data/mypaint/pixmaps/cursor_color_picker.png”:
3340 ;; No such file or directory (4)
3341 (lambda _
3342 (let* ((data (string-append #$output "/data"))
3343 (data-icons (string-append data "/icons"))
3344 (data-mypaint (string-append data "/mypaint"))
3345 (icons (string-append #$output "/icons"))
3346 (mypaint (string-append #$output "/mypaint")))
3347 (mkdir-p data-icons)
3348 (mkdir-p data-mypaint)
3349 (copy-recursively icons data-icons)
3350 (copy-recursively mypaint data-mypaint)
3351 (delete-file-recursively icons)
3352 (delete-file-recursively mypaint))))
3353 (add-after 'install 'glib-or-gtk-wrap
3354 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
3355 (add-after 'install 'wrap-program
3356 (lambda* (#:key outputs inputs #:allow-other-keys)
3357 (wrap-program (string-append #$output "/bin/mypaint")
3358 `("GI_TYPELIB_PATH" ":" prefix
3359 (,(getenv "GI_TYPELIB_PATH"))))))
3360 (add-before 'check 'pre-check
3361 (lambda _
3362 ;; Need to get the 'lib' in 'build/'.
3363 (delete-file-recursively "lib")
3364 ;; Tests need writing access
3365 (setenv "HOME" "/tmp"))))))
3366 (native-inputs
3367 (list gettext-minimal
3368 gobject-introspection
3369 pkg-config
3370 python-pytest
3371 python-setuptools
3372 swig))
3373 (inputs
3374 (list bash-minimal
3375 gdk-pixbuf
3376 gtk+
3377 hicolor-icon-theme
3378 json-c
3379 lcms
3380 libmypaint-next
3381 libpng
3382 (librsvg-for-system)
3383 mypaint-brushes
3384 python-numpy
3385 python-pycairo
3386 python-pygobject))
3387 (home-page "https://mypaint.org/")
3388 (synopsis "Fast and simple painting app for artists")
3389 (description
3390 "MyPaint is a simple drawing and painting program that works well with
3391Wacom-style graphics tablets.")
3392 (license license:gpl2+)))
3393
3394(define-public phockup
3395 (package
3396 (name "phockup")
3397 (version "1.13.0")
3398 (source
3399 (origin
3400 (method git-fetch)
3401 (uri (git-reference
3402 (url "https://github.com/ivandokov/phockup")
3403 (commit version)))
3404 (file-name (git-file-name name version))
3405 (sha256
3406 (base32 "1kwz2qy8mx0j25g3gyda08qaz5rgwm6vycsrqhgkd5cqqz76bbmc"))))
3407 (build-system copy-build-system)
3408 (arguments
3409 `(#:install-plan '(("src" "share/phockup/")
3410 ("phockup.py" "share/phockup/"))
3411 #:phases
3412 (modify-phases %standard-phases
3413 (add-after 'unpack 'configure
3414 (lambda* (#:key inputs #:allow-other-keys)
3415 (substitute* (list "src/dependency.py"
3416 "src/exif.py")
3417 (("'exiftool")
3418 (string-append "'" (search-input-file inputs "bin/exiftool"))))))
3419 (add-before 'install 'check
3420 (lambda* (#:key tests? #:allow-other-keys)
3421 (when tests?
3422 ;; Test without PATH to make sure ‘exiftool’ is properly found.
3423 (let ((path (getenv "PATH"))
3424 (pytest (which "pytest")))
3425 (setenv "PATH" "")
3426 (invoke pytest)
3427 (setenv "PATH" path)))))
3428 (add-after 'install 'install-bin
3429 (lambda* (#:key outputs #:allow-other-keys)
3430 (let ((out (assoc-ref outputs "out")))
3431 (mkdir (string-append out "/bin"))
3432 (symlink (string-append out "/share/phockup/phockup.py")
3433 (string-append out "/bin/phockup")))))
3434 (add-after 'install-bin 'wrap-program
3435 (lambda* (#:key inputs outputs #:allow-other-keys)
3436 (let ((out (assoc-ref outputs "out")))
3437 (wrap-program (string-append out "/bin/phockup")
3438 `("GUIX_PYTHONPATH" prefix
3439 ,(search-path-as-string->list
3440 (getenv "GUIX_PYTHONPATH"))))))))))
3441 (inputs
3442 (list bash-minimal perl-image-exiftool python python-tqdm))
3443 (native-inputs
3444 (list python-pytest python-pytest-mock python-pytest-socket))
3445 (home-page "https://github.com/ivandokov/phockup")
3446 (synopsis "Organize photos and videos in folders")
3447 (description "Phockup is a media sorting tool that uses creation date and
3448time information in photos and videos to organize them into folders by year,
3449month and day. All files which are not images or videos or those which do not
3450have creation date information will be placed in a folder called
3451@file{unknown}.")
3452 (license license:expat)))
3453
3454(define-public spng
3455 (package
3456 (name "spng")
3457 (version "0.7.2")
3458 (source (origin
3459 (method git-fetch)
3460 (uri (git-reference
3461 (url "https://github.com/randy408/libspng")
3462 (commit (string-append "v" version))))
3463 (file-name (git-file-name name version))
3464 (sha256
3465 (base32
3466 "0src9ii9w9afz2vgridn9r38pa6888myk28x2bjw0ynw5xcd62hs"))))
3467 (build-system meson-build-system)
3468 (inputs (list zlib))
3469 (native-inputs (list libpng))
3470 (home-page "https://libspng.org")
3471 (synopsis "Simple PNG loading library")
3472 (description
3473 "@code{libspng} is a simple C library for loading Portable Network
3474Graphics (PNGs), intended as an easy-to-use replacement for @code{libpng}.")
3475 (license license:bsd-2)
3476 ;; Supports SSE on x86-64 and NEON on AArch64.
3477 (properties '((tunable? . #t)))))
3478
3479(define-public libsixel
3480 (package
3481 (name "libsixel")
3482 (version "1.10.5")
3483 (source
3484 (origin
3485 (method git-fetch)
3486 (uri (git-reference
3487 (url "https://github.com/libsixel/libsixel")
3488 (commit (string-append "v" version))))
3489 (file-name (git-file-name name version))
3490 (sha256
3491 (base32 "1j85p8s5cy7vz1ph9vsvcmxdrr8yi57pgv8vz1xp6dr715jc3g51"))))
3492 (build-system meson-build-system)
3493 (arguments
3494 (list
3495 #:build-type "release"
3496 #:configure-flags #~(list "--buildtype=plain"
3497 "-Dtests=enabled"
3498 "-Dlibcurl=disabled"
3499 "-Dgdk-pixbuf2=enabled"
3500 "-Dbashcompletiondir=etc/bash_completion.d")))
3501 (native-inputs (list pkg-config))
3502 (inputs (list libjpeg-turbo libpng python))
3503 ;; pkg-config's "Requires.private" need gdk-pixbuf. TODO: Remove it when
3504 ;; we use pkgconf.
3505 (propagated-inputs (list gdk-pixbuf))
3506 (home-page "https://github.com/libsixel/libsixel")
3507 (synopsis
3508 "Encoder and decoder implementation for DEC SIXEL graphics")
3509 (description
3510 "LibSIXEL is a an encoder/decoder implementation for DEC SIXEL graphics,
3511and some converter programs. SIXEL is one of image formats for printer and
3512terminal imaging introduced by @acronym{DEC, Digital Equipment Corp.}. Its
3513data scheme is represented as a terminal-friendly escape sequence. So if you
3514want to view a SIXEL image file, all you have to do is @command{cat} it to
3515your terminal.")
3516 (license license:expat)))
3517
3518(define-public libyuv
3519 (package
3520 (name "libyuv")
3521 (version "1922")
3522 (source
3523 (origin
3524 (method git-fetch)
3525 (uri (git-reference
3526 (url "https://chromium.googlesource.com/libyuv/libyuv")
3527 ;; corresponds to version increase in include/libyuv/version.h
3528 (commit "500f45652c459cfccd20f83f297eb66cb7b015cb")))
3529 (sha256
3530 (base32 "0lmmag8rlpsbq5qg7cv89dcm5j7r0rbbsmjnkg8f5ld29mdd50y3"))))
3531 (build-system cmake-build-system)
3532 (arguments
3533 (list
3534 #:configure-flags
3535 #~(list "-DUNIT_TEST=ON")
3536 #:phases
3537 #~(modify-phases %standard-phases
3538 (replace 'check
3539 (lambda _
3540 ;; tests are configured in GN instead of ctest
3541 ;; invoke them manually
3542 (invoke "./libyuv_unittest"))))))
3543 (inputs (list libjpeg-turbo))
3544 (native-inputs (list googletest))
3545 (home-page "https://chromium.googlesource.com/libyuv/libyuv/")
3546 (synopsis "YUV scaling and conversion functionality")
3547 (description "libyuv is an open source project that includes YUV scaling and
3548conversion functionality. It can:
3549@itemize
3550@item Scale YUV to prepare content for compression, with point, bilinear or box
3551filter.
3552@item Convert to YUV from webcam formats for compression.
3553@item Convert to RGB formats for rendering/effects.
3554@item Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode.
3555@end itemize")
3556 (license license:expat)))
3557
3558(define-public libyuv-prev
3559 (package
3560 (inherit libyuv)
3561 (version "2021.4")
3562 (properties `((superseded . ,libyuv)))))