projects/guix·blob ruby-team · refs

3559 lines · 140.6 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.4.0")
969 (source
970 (origin
971 (method url-fetch)
972 (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
973 version ".tar.xz"))
974 (patches (search-patches "libtiff-CVE-2022-34526.patch"))
975 (sha256
976 (base32
977 "1h8xrcpbyf9id2hw2ms0cmpgx0li8gladjzj82ycgk28018pnc29"))))
978 (build-system gnu-build-system)
979 (outputs '("out"
980 "doc")) ;1.8 MiB of HTML documentation
981 (arguments
982 (list #:configure-flags
983 ;; Instead of using --docdir, this package has its own --with-docdir.
984 #~(list (string-append "--with-docdir=" #$output:doc "/share/doc/"
985 #$name "-" #$(package-version this-package))
986 "--disable-static")))
987 (inputs
988 (list libjpeg-turbo xz zlib))
989 (synopsis "Library for handling TIFF files")
990 (description
991 "Libtiff provides support for the Tag Image File Format (TIFF), a format
992used for storing image data.
993Included are a library, libtiff, for reading and writing TIFF and a small
994collection of tools for doing simple manipulations of TIFF images.")
995 (license (license:non-copyleft "file://COPYRIGHT"
996 "See COPYRIGHT in the distribution."))
997 (properties
998 '((upstream-name . "tiff")))
999 (home-page "http://www.simplesystems.org/libtiff/")))
1000
1001(define-public leptonica
1002 (package
1003 (name "leptonica")
1004 (version "1.84.1")
1005 (source
1006 (origin
1007 (method git-fetch)
1008 (uri (git-reference
1009 (url "https://github.com/DanBloomberg/leptonica")
1010 (commit version)))
1011 (file-name (git-file-name name version))
1012 (sha256
1013 (base32 "0b4ikf1p2ll4310n4dg5lg0b79wys71fb6nj22i7pz17wjdma0j8"))))
1014 (build-system gnu-build-system)
1015 (native-inputs
1016 (list gnuplot ;needed for test suite
1017 autoconf
1018 automake
1019 libtool
1020 pkg-config))
1021 (inputs
1022 (list giflib
1023 libjpeg-turbo
1024 libpng
1025 libtiff
1026 libwebp
1027 openjpeg
1028 zlib))
1029 (arguments
1030 (list
1031 ;; Parallel tests cause some tests to fail randomly.
1032 ;; Same thing observed on Debian.
1033 #:parallel-tests? #f
1034 #:phases
1035 #~(modify-phases %standard-phases
1036 (add-after 'unpack 'patch-reg-wrapper
1037 (lambda _
1038 (substitute* "prog/reg_wrapper.sh"
1039 ((" /bin/sh ")
1040 (string-append " " (which "sh") " "))
1041 (("which gnuplot")
1042 "true"))))
1043 (add-after 'install 'provide-absolute-giflib-reference
1044 (lambda _
1045 (let ((giflib #$(this-package-input "giflib")))
1046 ;; Add an absolute reference to giflib to avoid propagation.
1047 (with-directory-excursion (string-append #$output "/lib")
1048 (substitute* '("libleptonica.la" "pkgconfig/lept.pc")
1049 (("-lgif") (string-append "-L" giflib "/lib -lgif"))))))))))
1050 (home-page "http://www.leptonica.com/")
1051 (synopsis "Library and tools for image processing and analysis")
1052 (description
1053 "Leptonica is a C library and set of command-line tools for efficient
1054image processing and image analysis operations. It supports rasterop, affine
1055transformations, binary and grayscale morphology, rank order, and convolution,
1056seedfill and connected components, image transformations combining changes in
1057scale and pixel depth, and pixelwise masking, blending, enhancement, and
1058arithmetic ops.")
1059 (license license:bsd-2)))
1060
1061(define-public jbig2dec
1062 (package
1063 (name "jbig2dec")
1064 (version "0.19")
1065 (source (origin
1066 (method url-fetch)
1067 (uri (string-append "https://github.com/ArtifexSoftware"
1068 "/ghostpdl-downloads/releases/download"
1069 "/gs9533/" name "-" version ".tar.gz"))
1070 (sha256
1071 (base32
1072 "0dwa24kjqyg9hmm40fh048sdxfpnasz43l2rm8wlkw1qbdlpd517"))))
1073 (build-system gnu-build-system)
1074 (arguments '(#:configure-flags '("--disable-static")))
1075 (native-inputs
1076 (list python-minimal-wrapper)) ;for tests
1077 (synopsis "Decoder of the JBIG2 image compression format")
1078 (description
1079 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
1080monochrome) images at moderately high resolution, and in particular scanned
1081paper documents. In this domain it is very efficient, offering compression
1082ratios on the order of 100:1.
1083
1084This is a decoder only implementation, and currently is in the alpha
1085stage, meaning it doesn't completely work yet. However, it is
1086maintaining parity with available encoders, so it is useful for real
1087work.")
1088 (home-page "https://jbig2dec.com")
1089 (license license:gpl2+)))
1090
1091(define-public jbigkit
1092 (package
1093 (name "jbigkit")
1094 (version "2.1")
1095 (source
1096 (origin
1097 (method url-fetch)
1098 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
1099 "download/jbigkit-" version ".tar.gz"))
1100 (sha256
1101 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
1102 (modules '((guix build utils)))
1103 (snippet
1104 '(begin
1105 ;; Remove files without clear licence information.
1106 (for-each delete-file-recursively
1107 (list "contrib" "examples"))
1108 #t))))
1109 (build-system gnu-build-system)
1110 (outputs (list "out" "pbmtools"))
1111 (arguments
1112 `(#:modules ((srfi srfi-26)
1113 ,@%default-gnu-modules)
1114 #:phases
1115 (modify-phases %standard-phases
1116 (delete 'configure) ; no configure script
1117 (replace 'install ; no ‘make install’ target
1118 (lambda* (#:key outputs #:allow-other-keys)
1119 (let* ((out (assoc-ref outputs "out"))
1120 (lib (string-append out "/lib"))
1121 (include (string-append out "/include")))
1122 (with-directory-excursion "libjbig"
1123 (for-each (cut install-file <> include)
1124 (find-files "." "\\.h$"))
1125 (for-each (cut install-file <> lib)
1126 (find-files "." "\\.a$")))
1127 #t)))
1128 (add-after 'install 'install-pbmtools
1129 (lambda* (#:key outputs #:allow-other-keys)
1130 (let* ((out (assoc-ref outputs "pbmtools"))
1131 (bin (string-append out "/bin"))
1132 (man1 (string-append out "/share/man/man1"))
1133 (man5 (string-append out "/share/man/man5")))
1134 (with-directory-excursion "pbmtools"
1135 (for-each (cut install-file <> bin)
1136 (list "jbgtopbm" "jbgtopbm85"
1137 "pbmtojbg" "pbmtojbg85"))
1138
1139 (for-each (cut install-file <> man1)
1140 (find-files "." "\\.1$"))
1141 (for-each (cut install-file <> man5)
1142 (find-files "." "\\.5$"))
1143 #t)))))
1144 #:test-target "test"
1145 #:tests? #f)) ; tests depend on examples/
1146 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
1147 (synopsis "Lossless compression for bi-level high-resolution images")
1148 (description
1149 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
1150ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
1151black-and-white scanned documents. It is widely used in fax products, printer
1152firmware and drivers, document management systems, and imaging software.
1153
1154This package provides a static C library of (de)compression functions and some
1155simple command-line converters similar to those provided by netpbm.
1156
1157Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
1158options of the standard but has to keep the full uncompressed image in memory.
1159The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
1160memory management optimized for embedded and fax applications. It buffers
1161only a few lines of the uncompressed image in memory and is able to stream
1162images of initially unknown height.")
1163 (license (list license:isc ; pbmtools/p?m.5
1164 license:gpl2+)))) ; the rest
1165
1166(define-public sjpeg
1167 ;; No tags available.
1168 (let ((commit "46da5aec5fce05faabf1facf0066e36e6b1c4dff")
1169 (revision "0"))
1170 (package
1171 (name "sjpeg")
1172 (version (git-version "0" revision commit))
1173 (source
1174 (origin
1175 (method git-fetch)
1176 (uri (git-reference
1177 (url "https://github.com/webmproject/sjpeg")
1178 (commit commit)))
1179 (file-name (git-file-name name version))
1180 (sha256
1181 (base32 "0r496mp2ylisspwxl4883pzbl0l8qpscd1x9l7sb5nnmknawr868"))))
1182 (build-system cmake-build-system)
1183 (arguments
1184 (list
1185 #:phases
1186 #~(modify-phases %standard-phases
1187 (add-after 'unpack 'patch-cmake
1188 (lambda _
1189 ;; Enable building shared libraries.
1190 (substitute* "CMakeLists.txt"
1191 (("add_library\\(sjpeg " all)
1192 (string-append all "SHARED ")))))
1193 (add-before 'check 'patch-tests
1194 (lambda _
1195 (with-directory-excursion "../source/tests"
1196 (substitute* '("test_cmd.sh" "test_png_jpg.sh")
1197 (("\\.\\./examples") "../../build")))))
1198 (replace 'check
1199 (lambda* (#:key tests? #:allow-other-keys)
1200 (when tests?
1201 (with-directory-excursion "../source/tests"
1202 (invoke "./test_cmd.sh")
1203 (invoke "./test_png_jpg.sh"))))))))
1204 (inputs (list freeglut libjpeg-turbo libpng zlib))
1205 (home-page "https://github.com/webmproject/sjpeg")
1206 (synopsis "Simple JPEG encoder")
1207 (description
1208 "sjpeg is a simple encoding library for encoding baseline JPEG files.
1209It is also a command-line tool that takes PNG or JPEG images as input to
1210produce JPEG files.")
1211 (license license:asl2.0))))
1212
1213(define-public openjpeg-data
1214 (package
1215 (name "openjpeg-data")
1216 (version "2021.09.26")
1217 (source
1218 (origin
1219 (method git-fetch)
1220 (uri
1221 (git-reference
1222 (url "https://github.com/uclouvain/openjpeg-data")
1223 (commit "1f3d093030f9a0b43353ec6b48500f65786ff57a")))
1224 (file-name (git-file-name name version))
1225 (sha256
1226 (base32 "13jpdaqk7mngk0xw6xbh9zgipip6n25spvqd97hwpfna1zyh8lzh"))))
1227 (build-system copy-build-system)
1228 (synopsis "Test files for OpenJPEG")
1229 (description "OpenJPEG-Data contains all files required to run the openjpeg
1230test suite, including conformance tests (following Rec. ITU-T T.803 | ISO/IEC
123115444-4 procedures), non-regression tests and unit tests.")
1232 (home-page "https://github.com/uclouvain/openjpeg-data")
1233 (license license:bsd-2)))
1234
1235(define-public openjpeg
1236 (package
1237 (name "openjpeg")
1238 (version "2.5.0")
1239 (source
1240 (origin
1241 (method git-fetch)
1242 (uri (git-reference
1243 (url "https://github.com/uclouvain/openjpeg")
1244 (commit (string-append "v" version))))
1245 (file-name (git-file-name name version))
1246 (sha256
1247 (base32 "0xvcxlzqlylnjsyl1j64d7rgzv68ihm4qy6fpdrix3xzbqb3fjpz"))))
1248 (build-system cmake-build-system)
1249 (arguments
1250 `(#:configure-flags
1251 (list
1252 "-DBUILD_STATIC_LIBS=OFF"
1253 "-DBUILD_UNIT_TESTS=ON"
1254 (string-append "-DOPJ_DATA_ROOT="
1255 (assoc-ref %build-inputs "openjpeg-data")))
1256 #:phases
1257 (modify-phases %standard-phases
1258 (add-after 'unpack 'disable-failing-tests
1259 (lambda _
1260 ;; To be re-enabled after upstream fixes the bug,
1261 ;; https://github.com/uclouvain/openjpeg/issues/1264
1262 (substitute* "tests/CMakeLists.txt"
1263 (("add_subdirectory\\(nonregression\\)")
1264 ""))
1265 ;; These tests fail on all architectures except x86_64
1266 (substitute* "tests/conformance/CMakeLists.txt"
1267 ;; 4, 5, 6 fail
1268 (("numFileC1P0 RANGE 1 16") "numFileC1P0 RANGE 7 16")
1269 ;; 2, 3, 4, 5 fail
1270 (("numFileC1P1 RANGE 1 7") "numFileC1P1 1 6 7")
1271 ;; 2, 3 fail
1272 (("numFileJP2 RANGE 1 9") "numFileJP2 RANGE 4 9")
1273 ;; All fail
1274 (("subsampling.*") "")
1275 (("zoo.*") "")))))))
1276 (native-inputs
1277 (list openjpeg-data)) ; Files for test-suite
1278 (inputs
1279 (list lcms libpng libtiff zlib))
1280 (synopsis "OPENJPEG Library and Applications")
1281 (description "OpenJPEG is an implementation of JPEG 2000 codec written in C
1282language. It has been developed in order to promote the use of JPEG 2000, a
1283still-image compression standard from the Joint Photographic Experts Group
1284(JPEG). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a
1285JPEG 2000 Reference Software.")
1286 (home-page "https://github.com/uclouvain/openjpeg")
1287 (license license:bsd-2)))
1288
1289(define jp2k-test-codestreams
1290 (origin
1291 (method git-fetch)
1292 (uri (git-reference
1293 (url "https://github.com/aous72/jp2k_test_codestreams")
1294 (commit "eda0844b9f3be47d9b64194bcea5eb1ac2285e39")))
1295 (sha256
1296 (base32 "1sci4a4dvgrgmrf942zdf0hqhcx30a5lffwfy6r3hya35l3q8q8f"))))
1297
1298(define-public openjph
1299 (package
1300 (name "openjph")
1301 (version "0.27.3")
1302 (source
1303 (origin
1304 (method git-fetch)
1305 (uri (git-reference
1306 (url "https://github.com/aous72/OpenJPH")
1307 (commit version)))
1308 (file-name (git-file-name name version))
1309 (sha256
1310 (base32 "1knygwn4bf6n53qr12w05yava7464x3c70rf5r20sz8adjcfccvx"))))
1311 (build-system cmake-build-system)
1312 (arguments
1313 (list
1314 #:configure-flags
1315 #~(if #$(%current-target-system)
1316 '()
1317 '("-DOJPH_BUILD_TESTS=ON"))
1318 #:phases
1319 #~(modify-phases %standard-phases
1320 (add-after 'unpack 'patch-cmake
1321 (lambda _
1322 (substitute* "tests/CMakeLists.txt"
1323 (("^FetchContent_MakeAvailable\\(googletest\\)")
1324 #$(if (%current-target-system)
1325 ""
1326 "find_package(GTest REQUIRED)"))
1327 (("^FetchContent_MakeAvailable\\(jp2k_test_codestreams\\).*")
1328 ""))))
1329 #$@(if (%current-target-system)
1330 #~()
1331 #~((add-before 'check 'unpack-jp2k-test-codestreams
1332 (lambda _
1333 (copy-recursively #$jp2k-test-codestreams
1334 "tests/jp2k_test_codestreams"))))))))
1335 (native-inputs (if (%current-target-system)
1336 '()
1337 (list googletest)))
1338 (inputs (list libtiff))
1339 (home-page "https://github.com/aous72/OpenJPH")
1340 (synopsis "JPEG2000 Part-15 (or JPH or HTJ2K) implementation")
1341 (description
1342 "OpenJPH is an implementation of @acronym{HTJ2K, High-throughput JPEG2000},
1343also known as JPH, JPEG2000 Part 15, ISO/IEC 15444-15, and ITU-T T.814.")
1344 (license license:bsd-2)))
1345
1346(define-public openslide
1347 (package
1348 (name "openslide")
1349 (version "4.0.0")
1350 (source
1351 (origin
1352 (method git-fetch)
1353 (uri (git-reference
1354 (url "https://github.com/openslide/openslide")
1355 (commit (string-append "v" version))))
1356 (file-name (git-file-name name version))
1357 (sha256
1358 (base32 "00gc530g0lxm2lhwq249w97021w1v1y9ybqs2z5l1z922s15rhl2"))))
1359 (build-system meson-build-system)
1360 (inputs (list cairo
1361 gdk-pixbuf
1362 glib
1363 libdicom
1364 libjpeg-turbo
1365 libpng
1366 libtiff
1367 libxml2
1368 openjpeg
1369 sqlite
1370 zlib
1371 zstd))
1372 (native-inputs (list pkg-config))
1373 (home-page "https://openslide.org/")
1374 (synopsis "C library for reading slide image files")
1375 (description
1376 "OpenSlide is a C library for reading whole slide image files (also known
1377as virtual slides). It provides a consistent and simple API for reading files
1378from multiple vendors.")
1379 (license license:lgpl2.1)))
1380
1381(define-public giflib
1382 (package
1383 (name "giflib")
1384 (version "5.2.1")
1385 (source (origin
1386 (method url-fetch)
1387 (uri (string-append "mirror://sourceforge/giflib/giflib-"
1388 version ".tar.gz"))
1389 (sha256
1390 (base32
1391 "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii"))))
1392 (build-system gnu-build-system)
1393 (outputs '("bin" ; utility programs
1394 "out")) ; library
1395 (arguments
1396 `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
1397 (string-append "PREFIX="
1398 (assoc-ref %outputs "out"))
1399 (string-append "BINDIR="
1400 (assoc-ref %outputs "bin") "/bin"))
1401 #:phases
1402 (modify-phases %standard-phases
1403 (add-after 'unpack 'disable-html-doc-gen
1404 (lambda _
1405 (substitute* "doc/Makefile"
1406 (("^all: allhtml manpages") ""))
1407 #t))
1408 (delete 'configure)
1409 (add-after 'install 'install-manpages
1410 (lambda* (#:key outputs #:allow-other-keys)
1411 (let* ((bin (assoc-ref outputs "bin"))
1412 (man1dir (string-append bin "/share/man/man1")))
1413 (mkdir-p man1dir)
1414 (for-each (lambda (file)
1415 (let ((base (basename file)))
1416 (format #t "installing `~a' to `~a'~%"
1417 base man1dir)
1418 (copy-file file
1419 (string-append
1420 man1dir "/" base))))
1421 (find-files "doc" "\\.1"))
1422 #t))))))
1423 (synopsis "Tools and library for working with GIF images")
1424 (description
1425 "GIFLIB is a library for reading and writing GIF images. It is API and
1426ABI compatible with libungif which was in wide use while the LZW compression
1427algorithm was patented. Tools are also included to convert, manipulate,
1428compose, and analyze GIF images.")
1429 (home-page "http://giflib.sourceforge.net/")
1430 (license license:x11)))
1431
1432(define-public libuemf
1433 (package
1434 (name "libuemf")
1435 (version "0.2.7")
1436 (source (origin
1437 (method url-fetch)
1438 (uri (string-append "mirror://sourceforge/libuemf/libUEMF-"
1439 version ".tar.gz"))
1440 (sha256
1441 (base32
1442 "05djs99vqf067x81xfpskh7a66y5x7b4mmjavybcy7swnm0swg7v"))))
1443 (build-system cmake-build-system)
1444 (arguments
1445 `(#:phases
1446 (modify-phases %standard-phases
1447 ;; Overriding CMAKE_INSTALL_PREFIX is not a good idea.
1448 (add-after 'unpack 'fix-CMakeLists.txt
1449 (lambda _
1450 (substitute* "CMakeLists.txt"
1451 ((".*SET\\(CMAKE_INSTALL_PREFIX.*") ""))
1452 #t))
1453 (delete 'check)
1454 (add-after 'install 'check
1455 (lambda* (#:key inputs outputs #:allow-other-keys)
1456 (let* ((out (assoc-ref outputs "out"))
1457 (bin (string-append out "/bin"))
1458 (sources (string-append "../libUEMF-" ,version))
1459 (drm-tools (assoc-ref inputs "drm-tools"))
1460 (extract (string-append drm-tools "/bin/extract"))
1461 (execinput (string-append drm-tools "/bin/execinput")))
1462 (with-directory-excursion sources
1463 (substitute* "testit.sh"
1464 (("^EPATH=.*")
1465 (format #f "EPATH=~a~%" bin))
1466 (("`which diff`")
1467 "diff")
1468 (("^EXTRACT=.*")
1469 (format #f "EXTRACT=~a~%" extract))
1470 (("^EXECINPUT=.*")
1471 (format #f "EXECINPUT=~a~%" execinput)))
1472 (invoke "sh" "testit.sh"))))))))
1473 (native-inputs (list drm-tools)) ;for tests
1474 (home-page "https://libuemf.sourceforge.net/")
1475 (synopsis "Library for working with WFM, EMF and EMF+ images")
1476 (description "The libUEMF library is a portable C99 implementation for
1477reading and writing @acronym{WFM, Windows Metafile}, @acronym{EMF, Enhanced
1478Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
1479 (license license:gpl2+)))
1480
1481(define-public libungif
1482 (package
1483 (name "libungif")
1484 (version "4.1.4")
1485 (source (origin
1486 (method url-fetch)
1487 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
1488 "libungif-" version "/libungif-"
1489 version ".tar.bz2"))
1490 (sha256
1491 (base32
1492 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
1493 (build-system gnu-build-system)
1494 (inputs (list perl)) ;package ships some perl tools
1495 (home-page "http://giflib.sourceforge.net/")
1496 (synopsis "GIF decompression library")
1497 (description
1498 "libungif is the old GIF decompression library by the GIFLIB project.")
1499 (license license:expat)))
1500
1501(define-public imlib2
1502 (package
1503 (name "imlib2")
1504 (version "1.10.0")
1505 (source (origin
1506 (method url-fetch)
1507 (uri (string-append
1508 "mirror://sourceforge/enlightenment/imlib2-src/" version
1509 "/imlib2-" version ".tar.xz"))
1510 (sha256
1511 (base32
1512 "1fnbh6vj0d9l1c2bzw9psxh3wnlbr1nlfzi16w60hp48gj9ilz3j"))))
1513 (build-system gnu-build-system)
1514 (arguments
1515 '(#:configure-flags (list "--disable-static")))
1516 (native-inputs
1517 (list pkg-config))
1518 (inputs
1519 (list bzip2
1520 freetype
1521 giflib
1522 libid3tag
1523 libjpeg-turbo
1524 libpng
1525 libtiff
1526 libx11
1527 libxext
1528 libwebp))
1529 (home-page "https://sourceforge.net/projects/enlightenment/")
1530 (synopsis
1531 "Loading, saving, rendering and manipulating image files")
1532 (description
1533 "Imlib2 is a library that does image file loading and saving as well as
1534rendering, manipulation, arbitrary polygon support, etc.
1535
1536It does ALL of these operations FAST. Imlib2 also tries to be highly
1537intelligent about doing them, so writing naive programs can be done easily,
1538without sacrificing speed.
1539
1540This is a complete rewrite over the Imlib 1.x series. The architecture is
1541more modular, simple, and flexible.")
1542 (license license:imlib2)))
1543
1544(define-public imlib2-1.7
1545 (package
1546 (inherit imlib2)
1547 (version "1.7.1")
1548 (source (origin
1549 (method url-fetch)
1550 (uri (string-append
1551 "mirror://sourceforge/enlightenment/imlib2-src/" version
1552 "/imlib2-" version ".tar.bz2"))
1553 (sha256
1554 (base32
1555 "01y45cdml2dr9cqgybrgxr86sd77d1qfa1gzclzy1j6bkminlfh3"))))))
1556
1557(define-public giblib
1558 (package
1559 (name "giblib")
1560 (version "1.2.4")
1561 (source (origin
1562 (method url-fetch)
1563 (uri (list
1564 (string-append
1565 "http://linuxbrit.co.uk/downloads/giblib-"
1566 version ".tar.gz")
1567 (string-append
1568 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
1569 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
1570 version ".tar.gz")
1571 (string-append
1572 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
1573 "files/giblib/giblib-" version ".tar.gz")))
1574 (sha256
1575 (base32
1576 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
1577 (build-system gnu-build-system)
1578 (inputs
1579 (list libx11
1580 ;; Needs an old imlib2 with the 'imlib2-config' program.
1581 imlib2-1.7))
1582 (home-page
1583 ;; This vanished page is universally accepted as giblib's home despite not
1584 ;; mentioning the package once.
1585 (string-append "https://web.archive.org/web/20140907071208/"
1586 "https://linuxbrit.co.uk/software/"))
1587 (synopsis "Wrapper library for imlib2")
1588 (description
1589 "Giblib is a simple library which wraps imlib2's context API, avoiding
1590all the context_get/set calls, adds fontstyles to the truetype renderer and
1591supplies a generic doubly-linked list and some string functions.")
1592 ;; This license removes a clause about X Consortium from the original
1593 ;; X11 license.
1594 (license (license:x11-style "file://COPYING"
1595 "See 'COPYING' in the distribution."))))
1596
1597(define-public freeimage
1598 (package
1599 (name "freeimage")
1600 (version "3.18.0")
1601 (source (origin
1602 (method url-fetch)
1603 (uri (string-append
1604 "mirror://sourceforge/freeimage/Source%20Distribution/"
1605 version "/FreeImage"
1606 (string-concatenate (string-split version #\.))
1607 ".zip"))
1608 (sha256
1609 (base32
1610 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
1611 (modules '((guix build utils)))
1612 (snippet
1613 '(begin
1614 (for-each
1615 (lambda (dir)
1616 (delete-file-recursively (string-append "Source/" dir)))
1617 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
1618 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
1619 (patches
1620 (append
1621 (search-patches "freeimage-unbundle.patch"
1622 "freeimage-libtiff-compat.patch"
1623 "freeimage-CVE-2020-21428.patch"
1624 "freeimage-CVE-2020-22524.patch"
1625 "freeimage-libraw-0.21-compat.patch")
1626 ;; Take one patch from Arch Linux that adds LibRaw 0.20 compatibility.
1627 (list (origin
1628 (method url-fetch)
1629 (uri "https://raw.githubusercontent.com/archlinux\
1630/svntogit-community/ca3e6a52f5a46dec87cbf85e9d84fe370e282c8c/trunk\
1631/freeimage-libraw-0.20.patch")
1632 (file-name "freeimage-libraw-compat.patch")
1633 (sha256
1634 (base32
1635 "0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
1636 (build-system gnu-build-system)
1637 (arguments
1638 (list
1639 #:phases
1640 #~(modify-phases %standard-phases
1641 ;; According to Fedora these files depend on private headers, but their
1642 ;; presence is required for building, so we replace them with empty files.
1643 (add-after 'unpack 'delete-unbuildable-files
1644 (lambda _
1645 (for-each (lambda (file)
1646 (delete-file file)
1647 (close (open file O_CREAT)))
1648 '("Source/FreeImage/PluginG3.cpp"
1649 "Source/FreeImageToolkit/JPEGTransform.cpp"))))
1650 ;; These scripts generate the Makefiles.
1651 (replace 'configure
1652 (lambda _
1653 (invoke "sh" "gensrclist.sh")
1654 (invoke "sh" "genfipsrclist.sh")))
1655 (add-before 'build 'patch-makefile
1656 (lambda* (#:key outputs #:allow-other-keys)
1657 (substitute* "Makefile.gnu"
1658 (("/usr") (assoc-ref outputs "out"))
1659 (("-o root -g root") "")))))
1660 #:make-flags
1661 #~(let ((jxrlib (search-input-directory %build-inputs "include/jxrlib")))
1662 (list (string-append "CC=" #$(cc-for-target))
1663 ;; We need '-fpermissive' for Source/FreeImage.h.
1664 ;; libjxr doesn't have a pkg-config file.
1665 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden "
1666 "-fpermissive -I" jxrlib)))
1667 #:tests? #f)) ; no check target
1668 (native-inputs
1669 (list pkg-config unzip))
1670 (inputs
1671 (list libjpeg-turbo
1672 libjxr
1673 libpng
1674 libraw
1675 libtiff
1676 libwebp
1677 openexr-2
1678 openjpeg
1679 zlib))
1680 (synopsis "Library for handling popular graphics image formats")
1681 (description
1682 "FreeImage is a library for developers who would like to support popular
1683graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1684 (license (list license:gpl2+ license:gpl3+)) ;dual-licensed
1685 (home-page "https://freeimage.sourceforge.io/")))
1686
1687(define-public freeimagere
1688 (let ((commit "97e3a992298d1b4c7d87c79ca3c8a735837b628e")
1689 (revision "0"))
1690 (package
1691 (name "freeimagere")
1692 (version (git-version "4.2.0" revision commit))
1693 (source (origin
1694 (method git-fetch)
1695 (uri (git-reference
1696 (url "https://github.com/agruzdev/FreeImageRe")
1697 (commit commit)))
1698 (file-name (git-file-name name version))
1699 (sha256
1700 (base32
1701 "1lx94mgbwzhgi5hrj9dinaizyxlwvapfiz5c58bifkgpy3ab58an"))
1702 (modules '((guix build utils)))
1703 (snippet '(delete-file-recursively "3rdParty"))))
1704 (build-system cmake-build-system)
1705 ;; The libjxr support depends on the bundled 3rdParty/LibJXR source.
1706 (arguments
1707 (list
1708 #:tests? #f ;also disabled upstream
1709 #:cmake cmake-minimal-4
1710 #:configure-flags
1711 #~(list
1712 "-DUSE_SYSTEM_LIBS=ON"
1713 "-DFREEIMAGE_WITH_LIBJXR=OFF" ;relies on bundled 3rdParty
1714 "-DFREEIMAGE_WITH_LIBOPENJPEG=OFF" ;not packaged
1715 "-DFREEIMAGE_WITH_LIBJPEGXL=OFF" ;not packaged
1716 "-DFREEIMAGE_WITH_LIBJPEG_TRANSFORMS=OFF" ;requires private headers
1717 "-DFREEIMAGE_WITH_LIBTIFF=OFF"))) ;requires private headers
1718 (native-inputs (list pkg-config))
1719 (inputs
1720 (list libheif
1721 libjpeg-turbo
1722 libpng
1723 libraw
1724 libwebp
1725 openexr
1726 openjph
1727 yato
1728 zlib))
1729 (home-page "https://github.com/agruzdev/FreeImageRe")
1730 (synopsis "Library for handling popular graphics image formats")
1731 (description "FreeImage Re(surrected) is a fork of FreeImage, a library
1732that supports popular graphics image formats like PNG, BMP, JPEG, TIFF and
1733others.")
1734 (license (list license:gpl3+ license:gpl2+))))) ;dual-licensed
1735
1736(define-public ggg
1737 (package
1738 (name "ggg")
1739 (version "0.6.1")
1740 (source
1741 (origin
1742 (method git-fetch)
1743 (uri (git-reference
1744 (url "https://codeberg.org/jjba23/ggg.git")
1745 (commit (string-append "v" version))))
1746 (file-name (git-file-name name version))
1747 (sha256
1748 (base32 "0asrvc7fzyavv8xmrb0pbqqv35z8bhcl4si0xwj9xndbificx7li"))))
1749 (build-system guile-build-system)
1750 (arguments
1751 (list
1752 #:source-directory "src"
1753 #:modules '((guix build guile-build-system)
1754 (guix build utils)
1755 (ice-9 match))
1756 #:phases
1757 #~(modify-phases %standard-phases
1758 (add-before 'build 'install-program-files
1759 (lambda _
1760 (let ((bin (string-append #$output "/bin"))
1761 (share (string-append #$output "/share")))
1762 (install-file "resources/help.txt"
1763 (string-append share "/resources"))
1764 (copy-recursively "resources/svg-paths"
1765 (string-append share "/resources/svg-paths"))
1766 (install-file "scripts/ggg" bin)
1767 (chmod (string-append bin "/ggg") #o755))))
1768 (add-after 'unpack 'fix-paths
1769 (lambda* (#:key inputs #:allow-other-keys)
1770 (for-each (match-lambda
1771 ((pattern program format-string)
1772 (substitute* "scripts/ggg"
1773 ((pattern)
1774 (format #f format-string
1775 (search-input-file inputs
1776 (string-append "bin/"
1777 program)))))))
1778 '(("readlink -f " "readlink" "~s -f ")
1779 ("realpath " "realpath" "~s ")
1780 ("dirname " "dirname" "~s ")
1781 ("getopt " "getopt" "~s ")
1782 ("exec guile " "guile" "exec ~s ")))
1783 (for-each (match-lambda
1784 ((pattern program format-string)
1785 (substitute* "src/ggg/main.scm"
1786 ((pattern)
1787 (format #f format-string
1788 (search-input-file inputs
1789 (string-append "bin/"
1790 program)))))))
1791 '(("convert -quality 100" "convert" "~a -quality 100"))))))))
1792 (inputs
1793 (list guile-3.0
1794 bash-minimal
1795 imagemagick
1796 coreutils-minimal
1797 util-linux))
1798 (synopsis "GGG is a SVG image generator for project and web badges")
1799 (description
1800 "GGG (Guile Glyph Generator) is a command-line utility
1801that allows you to generate pretty images/badges which can be used for
1802your projects, announcing tech used, sponsoring and appreciating
1803other projects, distinguishing versions of things supported, etc.
1804
1805GGG is highly configurable, reads Scheme files where you define your tasks,
1806and supports badges between one and three parts. It leverages SVG generation
1807from Lisp and S-expressions, building pixel perfect badges.")
1808 (home-page "https://codeberg.org/jjba23/ggg")
1809 (license license:agpl3+)))
1810
1811(define-public vigra
1812 (package
1813 (name "vigra")
1814 (version "1.12.2")
1815 (source
1816 (origin
1817 (method git-fetch)
1818 (uri (git-reference
1819 (url "https://github.com/ukoethe/vigra")
1820 (commit (string-append "Version-"
1821 (string-join (string-split version #\.)
1822 "-")))))
1823 (file-name (git-file-name name version))
1824 (sha256
1825 (base32 "0x6qcsbjxp2alxqxsngs8a22fdi7pi2ylv9q4l1jgmypn0svkqqk"))))
1826 (build-system cmake-build-system)
1827 (arguments
1828 (list
1829 #:configure-flags
1830 #~(list "-Wno-dev" ;suppress developer mode with lots of warnings
1831 (string-append
1832 "-DVIGRANUMPY_INSTALL_DIR=" #$output "/lib/python"
1833 #$(version-major+minor (package-version python))
1834 "/site-packages")
1835 ;; OpenEXR is not enabled by default.
1836 "-DWITH_OPENEXR=1"
1837 ;; Fix rounding error on 32-bit machines
1838 "-DCMAKE_C_FLAGS=-ffloat-store"
1839 ;; The header files of ilmbase are not found when included
1840 ;; by the header files of openexr, and an explicit flag
1841 ;; needs to be set.
1842 (string-append "-DCMAKE_CXX_FLAGS=-I"
1843 (assoc-ref %build-inputs "ilmbase")
1844 "/include/OpenEXR" " -ffloat-store")
1845 ;; Tests are not built by default.
1846 "-DAUTOBUILD_TESTS=ON"
1847 ;; Disable running tests during the build.
1848 "-DAUTOEXEC_TESTS=OFF")))
1849 (inputs (list boost
1850 fftw
1851 fftwf
1852 hdf5
1853 ilmbase ;propagated by openexr, but needed explicitly
1854 ;to create a configure-flag
1855 libjpeg-turbo
1856 libpng
1857 libtiff
1858 openexr-2
1859 python-wrapper
1860 python-numpy
1861 zlib))
1862 (native-inputs (list doxygen python-sphinx))
1863 (synopsis "Computer vision library")
1864 (description
1865 "VIGRA stands for Vision with Generic Algorithms. It is an image
1866 processing and analysis library that puts its main emphasis on customizable
1867 algorithms and data structures. It is particularly strong for
1868 multi-dimensional image processing.")
1869 (license license:expat)
1870 (home-page "https://ukoethe.github.io/vigra/")
1871 (properties '((max-silent-time . 7200))))) ;2 hours, to avoid timing out
1872
1873(define-public vigra-c
1874 (let* ((commit "49f53191a12fe91d4e2fd177d22af167571c71d8")
1875 (revision "2"))
1876 (package
1877 (name "vigra-c")
1878 (version (git-version "0.0.0" revision commit))
1879 (home-page "https://github.com/BSeppke/vigra_c")
1880 (source (origin
1881 (method git-fetch)
1882 (uri (git-reference
1883 (url home-page)
1884 (commit commit)))
1885 (sha256
1886 (base32
1887 "04ch1jhk4zjf1fpsyp8ldzjp8l9bx025zq0vskjx1clb3ncn305x"))
1888 (file-name (git-file-name name version))))
1889 (build-system cmake-build-system)
1890 (arguments
1891 `(#:tests? #f)) ; No test target.
1892 (native-inputs
1893 (list doxygen))
1894 (inputs
1895 (list fftw fftwf hdf5 vigra))
1896 (synopsis "C interface to the VIGRA computer vision library")
1897 (description
1898 "This package provides a C interface to the VIGRA C++ computer vision
1899library. It is designed primarily to ease the implementation of higher-level
1900language bindings to VIGRA.")
1901 (license license:expat))))
1902
1903(define-public libwebp
1904 (package
1905 (name "libwebp")
1906 (version "1.3.2")
1907 (source
1908 (origin
1909 ;; No tarballs are provided for >0.6.1.
1910 (method git-fetch)
1911 (uri (git-reference
1912 (url "https://chromium.googlesource.com/webm/libwebp")
1913 (commit (string-append "v" version))))
1914 (file-name (git-file-name name version))
1915 (sha256
1916 (base32
1917 "1x37795gpc63g1ma9kqw4q3dikwhrjklixqzjjsj6viqksa19z41"))))
1918 (build-system gnu-build-system)
1919 (inputs
1920 (list freeglut
1921 giflib
1922 libjpeg-turbo
1923 libpng
1924 libtiff))
1925 (native-inputs
1926 (list autoconf automake libtool))
1927 (arguments
1928 '(#:configure-flags '("--enable-libwebpmux"
1929 "--enable-libwebpdemux"
1930 "--enable-libwebpdecoder"
1931 "--disable-static")))
1932 (home-page "https://developers.google.com/speed/webp/")
1933 (synopsis "Lossless and lossy image compression")
1934 (description
1935 "WebP is a new image format that provides lossless and lossy compression
1936for images. WebP lossless images are 26% smaller in size compared to
1937PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1938equivalent SSIM index. WebP supports lossless transparency (also known as
1939alpha channel) with just 22% additional bytes. Transparency is also supported
1940with lossy compression and typically provides 3x smaller file sizes compared
1941to PNG when lossy compression is acceptable for the red/green/blue color
1942channels.")
1943 (license license:bsd-3)))
1944
1945(define-public libmng
1946 (package
1947 (name "libmng")
1948 (version "2.0.3")
1949 (source (origin
1950 (method url-fetch)
1951 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1952 version "/" name "-" version ".tar.xz"))
1953 (sha256
1954 (base32
1955 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1956 (build-system gnu-build-system)
1957 (arguments
1958 (if (and (target-riscv64?)
1959 (%current-target-system))
1960 (list #:phases
1961 #~(modify-phases %standard-phases
1962 (add-after 'unpack 'update-config-scripts
1963 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1964 ;; Replace outdated config.guess and config.sub.
1965 (for-each (lambda (file)
1966 (install-file
1967 (search-input-file
1968 (or native-inputs inputs)
1969 (string-append "/bin/" file)) "."))
1970 '("config.guess" "config.sub"))))))
1971 '()))
1972 (native-inputs
1973 (if (and (target-riscv64?)
1974 (%current-target-system))
1975 (list config)
1976 '()))
1977 (propagated-inputs
1978 ;; These are all in the 'Libs.private' field of libmng.pc.
1979 (list lcms libjpeg-turbo zlib))
1980 (home-page "https://www.libmng.com/")
1981 (synopsis "Library for handling MNG files")
1982 (description
1983 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1984 (license license:bsd-3)))
1985
1986(define-public exiv2
1987 (package
1988 (name "exiv2")
1989 (version "0.28.8")
1990 (source
1991 (origin
1992 (method git-fetch)
1993 (uri (git-reference
1994 (url "https://github.com/exiv2/exiv2")
1995 (commit (string-append "v" version))))
1996 (file-name (git-file-name name version))
1997 (sha256
1998 (base32 "1jj88acjqs8l2s8av1b2mmmh7aha9js7pmx0r288mnsfs2abw1zm"))))
1999 (build-system cmake-build-system)
2000 (arguments
2001 (list
2002 #:tests? #f ;no tests
2003 #:configure-flags
2004 #~(list "-DEXIV2_BUILD_UNIT_TESTS=ON"
2005 ;; darktable needs BMFF to support
2006 ;; CR3 files.
2007 "-DEXIV2_ENABLE_BMFF=ON")
2008 #:modules '((guix build cmake-build-system)
2009 ((guix build gnu-build-system) #:prefix gnu:)
2010 (guix build utils))
2011 #:phases
2012 #~(modify-phases %standard-phases
2013 (add-after 'unpack 'patch-gcc-reference
2014 (lambda _
2015 ;; _GLIBCXX_ASSERTIONS brings reference to GCC.
2016 (substitute* "cmake/compilerFlags.cmake"
2017 (("add_compile_options[(]-Wp,-D_GLIBCXX_ASSERTIONS[)]")
2018 ""))))
2019 (add-after 'install 'delete-static-libraries
2020 (lambda* (#:key outputs #:allow-other-keys)
2021 (let* ((out (assoc-ref outputs "out"))
2022 (lib (string-append out "/lib")))
2023 (for-each delete-file (find-files lib "\\.a$")))))
2024 (replace 'check
2025 (lambda* (#:rest args)
2026 (apply (assoc-ref gnu:%standard-phases 'check)
2027 #:test-target "tests" args)))
2028
2029 #$@(if (or (target-ppc64le?)
2030 (target-aarch64?)
2031 (target-riscv64?))
2032 '((add-after 'unpack 'adjust-tests
2033 (lambda _
2034 ;; Adjust test on ppc64 and aarch64, where no exception
2035 ;; is raised and thus the return value is different. See
2036 ;; <https://github.com/Exiv2/exiv2/issues/365> and
2037 ;; <https://github.com/Exiv2/exiv2/issues/933>.
2038 (substitute* "tests/bugfixes/github/test_CVE_2018_12265.py"
2039 (("\\$uncaught_exception \\$addition_overflow_message\n") "")
2040 (("retval = \\[1\\]") "retval = [0]")))))
2041 '()))))
2042 (propagated-inputs
2043 (list brotli expat libinih zlib))
2044 (native-inputs
2045 (list googletest python))
2046 (home-page "https://www.exiv2.org/")
2047 (synopsis "Library and command-line utility to manage image metadata")
2048 (description
2049 "Exiv2 is a C++ library and a command line utility to manage image
2050metadata. It provides fast and easy read and write access to the Exif, IPTC
2051and XMP metadata of images in various formats.")
2052
2053 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
2054 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
2055 ;; The core is GPLv2+:
2056 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
2057 (license license:gpl2+)))
2058
2059(define-public exiv2-static
2060 (package
2061 (inherit exiv2)
2062 (arguments
2063 (substitute-keyword-arguments arguments
2064 ((#:phases phases)
2065 #~(modify-phases #$phases
2066 (delete 'delete-static-libraries)))))))
2067
2068(define-public exiv2-0.27
2069 (package/inherit exiv2
2070 (name (package-name exiv2))
2071 (version "0.27.7")
2072 (source
2073 (origin
2074 (method git-fetch)
2075 (uri (git-reference
2076 (url "https://github.com/exiv2/exiv2")
2077 (commit (string-append "v" version))))
2078 (file-name (git-file-name name version))
2079 (sha256
2080 (base32 "1a3g7qly75zidj2xjfx1548h6az8sda79cpwvfknsjy3n8d5aay7"))))))
2081
2082(define-public jasper
2083 (package
2084 (name "jasper")
2085 (version "2.0.33")
2086 (source (origin
2087 (method git-fetch)
2088 (uri (git-reference
2089 (url "https://github.com/mdadams/jasper")
2090 (commit (string-append "version-" version))))
2091 (file-name (git-file-name name version))
2092 (sha256
2093 (base32
2094 "0p3fj89gkhd2ys5ci75cwb6p7rvb2pf52jd8c9d4g76qp846njnx"))))
2095 (build-system cmake-build-system)
2096 (inputs
2097 (list libjpeg-turbo))
2098 (synopsis "JPEG-2000 library")
2099 (description "The JasPer Project is an initiative to provide a reference
2100implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
2101ISO/IEC 15444-1).")
2102 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
2103 (license (license:x11-style "file://LICENSE"))))
2104
2105(define-public zimg
2106 (package
2107 (name "zimg")
2108 (version "3.0.5")
2109 (source
2110 (origin
2111 (method git-fetch)
2112 (uri (git-reference
2113 (url "https://github.com/sekrit-twc/zimg")
2114 (commit (string-append "release-" version))))
2115 (file-name (git-file-name name version))
2116 (sha256
2117 (base32 "1vhwnhmrd217bf0iw8xvgqp762xnzjvac7w0nk58pj6f54fal90c"))))
2118 (build-system gnu-build-system)
2119 (native-inputs
2120 (list autoconf automake libtool))
2121 (synopsis "Scaling, colorspace conversion, and dithering library")
2122 (description "Zimg implements the commonly required image processing basics
2123of scaling, colorspace conversion, and depth conversion. A simple API enables
2124conversion between any supported formats to operate with minimal knowledge from
2125the programmer.")
2126 (home-page "https://github.com/sekrit-twc/zimg")
2127 ;; test/extra/ contains musl-libm,
2128 ;; which is MIT/expat licensed, but only used for tests
2129 (license license:wtfpl2)))
2130
2131(define-public perceptualdiff
2132 (package
2133 (name "perceptualdiff")
2134 (version "1.3")
2135 (source
2136 (origin
2137 (method git-fetch)
2138 (uri (git-reference
2139 (url "https://github.com/myint/perceptualdiff")
2140 (commit (string-append "v" version))))
2141 (file-name (git-file-name name version))
2142 (sha256
2143 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
2144 (build-system cmake-build-system)
2145 (inputs (list freeimage))
2146 (arguments
2147 '(#:phases (modify-phases %standard-phases
2148 (add-after 'unpack 'fix-tests
2149 ;; cmake-build-system uses a build/ directory outside
2150 ;; of the source tree, one level higher than expected
2151 (lambda _
2152 (substitute* "test/run_tests.bash"
2153 (("../build") "../../build"))
2154 #t)))))
2155 (home-page "https://github.com/myint/perceptualdiff")
2156 (synopsis "Perceptual image comparison utility")
2157 (description "PerceptualDiff visually compares two images to determine
2158whether they look alike. It uses a computational model of the human visual
2159system to detect similarities. This allows it too see beyond irrelevant
2160differences in file encoding, image quality, and other small variations.")
2161 (license license:gpl2+)))
2162
2163(define-public steghide
2164 (package
2165 (name "steghide")
2166 (version "0.5.1")
2167 (source (origin
2168 (method url-fetch)
2169 (uri (string-append "mirror://sourceforge/steghide/steghide/"
2170 version "/steghide-" version ".tar.bz2"))
2171 (sha256
2172 (base32
2173 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
2174 (patches (list (search-patch "steghide-fixes.patch")))))
2175 (build-system gnu-build-system)
2176 (arguments
2177 (list #:make-flags
2178 #~(list "CXXFLAGS=-fpermissive") ; required for MHashPP.cc
2179 #:phases
2180 #~(modify-phases %standard-phases
2181 (add-before 'configure 'set-perl-search-path
2182 (lambda _
2183 ;; Work around "dotless @INC" build failure.
2184 (setenv "PERL5LIB"
2185 (string-append (getcwd) "/tests:"
2186 (getenv "PERL5LIB"))))))))
2187 (native-inputs
2188 (list gettext-minimal libtool perl))
2189 (inputs
2190 (list libjpeg-turbo libmhash libmcrypt zlib))
2191 (home-page "https://steghide.sourceforge.net")
2192 (synopsis "`Hide' (nonconfidential) data in image or audio files")
2193 (description
2194 "Steghide is a program to `hide' data in various kinds of image and audio
2195files. This practice is known as @dfn{steganography}, but the method used by
2196steghide is not very secure and should not be used where security is at stake.
2197Even if a password is used, steghide offers little plausible deniability.
2198
2199Nonetheless, neither color nor sample frequencies are changed, making the
2200embedding resistant against first-order statistical tests not aimed
2201specifically at this tool.")
2202 (license license:gpl2+)))
2203
2204(define-public optipng
2205 (package
2206 (name "optipng")
2207 (version "0.7.7")
2208 (source
2209 (origin
2210 (method url-fetch)
2211 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
2212 version ".tar.gz"))
2213 (sha256
2214 (base32
2215 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
2216 (modules '((guix build utils)))
2217 (snippet
2218 '(begin
2219 (delete-file-recursively "src/libpng")
2220 (delete-file-recursively "src/zlib")
2221 #t))))
2222 (build-system gnu-build-system)
2223 (inputs
2224 (list libpng zlib))
2225 (arguments
2226 '(#:phases
2227 (modify-phases %standard-phases
2228 (replace 'configure
2229 (lambda* (#:key outputs #:allow-other-keys)
2230 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
2231 (invoke "sh" "configure"
2232 (string-append "--prefix=" (assoc-ref outputs "out"))
2233 "-with-system-libs")
2234 #t)))))
2235 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
2236 (description "OptiPNG is a PNG optimizer that recompresses image
2237files to a smaller size, without losing any information. This program
2238also converts external formats (BMP, GIF, PNM and TIFF) to optimized
2239PNG, and performs PNG integrity checks and corrections.")
2240 (home-page "https://optipng.sourceforge.net/")
2241 (license license:zlib)))
2242
2243(define-public imgp
2244 (package
2245 (name "imgp")
2246 ;; 2.9 was released in 2023
2247 (properties '((commit . "00b2b520964f22ca5b6e0c7d7cb07ce7a755cea7")
2248 (revision . "0")))
2249 (version (git-version "2.9"
2250 (assoc-ref properties 'revision)
2251 (assoc-ref properties 'commit)))
2252 (source
2253 (origin
2254 (method git-fetch)
2255 (uri (git-reference
2256 (url "https://github.com/jarun/imgp")
2257 (commit (assoc-ref properties 'commit))))
2258 (file-name (git-file-name name version))
2259 (sha256
2260 (base32 "1rgm52agxrc8sirm72ksg6c2zpibjh4kvx1b2c59vx5inb33kfdh"))))
2261 (build-system pyproject-build-system)
2262 (arguments
2263 (list #:test-backend #~'custom
2264 ;; There are no actual tests, taken from project's Makefile.
2265 #:test-flags #~(list "-m" "imgp" "--help")))
2266 (native-inputs
2267 (list python-setuptools))
2268 (inputs
2269 (list python-pillow))
2270 (home-page "https://github.com/jarun/imgp")
2271 (synopsis "High-performance CLI batch image resizer & rotator")
2272 (description
2273 "@code{imgp} is a command line image resizer and rotator for JPEG and PNG
2274images. It can resize (or thumbnail) and rotate thousands of images in a go
2275while saving significantly on storage.
2276
2277This package may optionally be built with @code{python-pillow-simd} in place
2278of @code{python-pillow} for SIMD parallelism.")
2279 (license license:gpl3+)))
2280
2281(define-public pngsuite
2282 (package
2283 (name "pngsuite")
2284 (version "2017jul19")
2285 (source
2286 (origin
2287 (method url-fetch/tarbomb)
2288 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
2289 version ".tgz"))
2290 (sha256
2291 (base32
2292 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
2293 (build-system gnu-build-system)
2294 (arguments
2295 '(#:tests? #f ; there is no test target
2296 #:license-file-regexp "PngSuite.LICENSE"
2297 #:phases
2298 (modify-phases %standard-phases
2299 (replace 'install
2300 (lambda* (#:key outputs #:allow-other-keys)
2301 (let ((out (assoc-ref outputs "out")))
2302 (copy-recursively "." (string-append out "/"))
2303 #t)))
2304 (delete 'build)
2305 (delete 'configure))))
2306 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
2307 (synopsis "Example PNGs for use in test suites")
2308 (description "Collection of graphics images created to test PNG
2309applications like viewers, converters and editors. As far as that is
2310possible, all formats supported by the PNG standard are represented.")
2311 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
2312use, copy, modify and distribute these images for any purpose and without fee
2313is hereby granted."))))
2314
2315(define-public qoi
2316 (let ((commit "6fff9b70dd79b12f808b0acc5cb44fde9998725e")
2317 (revision "0"))
2318 (package
2319 (name "qoi")
2320 (version (git-version "0.0.0" revision commit))
2321 (source
2322 (origin
2323 (method git-fetch)
2324 (uri (git-reference
2325 (url "https://github.com/phoboslab/qoi")
2326 (commit commit)))
2327 (file-name (git-file-name name version))
2328 (sha256
2329 (base32 "078zasncyylgnwx6br82nkjssl82wygz6fh8zm65fbfpadzfa3x7"))))
2330 (build-system copy-build-system)
2331 (arguments
2332 (list
2333 #:install-plan
2334 #~'(("qoi.h" "include/"))
2335 #:tests? #f)) ;No tests
2336 (home-page "https://qoiformat.org")
2337 (synopsis "Library for the QOI image format")
2338 (description
2339 "This package provides a library for the QOI image format, offering
2340fast, lossless image compression.")
2341 (license license:expat))))
2342
2343(define-public libjpeg-turbo
2344 (package
2345 (name "libjpeg-turbo")
2346 (version "2.1.4")
2347 (source (origin
2348 (method url-fetch)
2349 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
2350 version "/libjpeg-turbo-" version ".tar.gz"))
2351 (sha256
2352 (base32
2353 "0arl61ici38ann5xjidwdzkhmjdp1r95x4x4zinnh4qs2fhjdvfk"))))
2354 (build-system cmake-build-system)
2355 (native-inputs
2356 (list nasm))
2357 (arguments
2358 (list #:configure-flags
2359 #~'("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
2360 "-DENABLE_STATIC=0"
2361 ;; djpeg-shared-3x2-float-prog-cmp fails on some systems.
2362 #$@(if (or (target-ppc32?)
2363 (target-riscv64?))
2364 '("-DFLOATTEST=NO")
2365 '()))))
2366 (home-page "https://libjpeg-turbo.org/")
2367 (synopsis "SIMD-accelerated JPEG image handling library")
2368 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
2369JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
2370x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
2371its highly-optimized Huffman coding routines allow it to outperform libjpeg by
2372a significant amount.
2373libjpeg-turbo implements both the traditional libjpeg API and the less powerful
2374but more straightforward TurboJPEG API, and provides a full-featured Java
2375interface. It supports color space extensions that allow it to compress from
2376and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
2377 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
2378 (license (list license:bsd-3 ;the TurboJPEG API library and programs
2379 license:ijg ;the libjpeg library and associated tools
2380 license:zlib)))) ;the libjpeg-turbo SIMD extensions
2381
2382(define-public libjpeg-turbo-3
2383 (package
2384 (inherit libjpeg-turbo)
2385 (name "libjpeg-turbo")
2386 (version "3.1.2")
2387 (source (origin
2388 (method url-fetch)
2389 (uri (string-append "https://github.com/" name "/" name
2390 "/releases/download/" version "/" name
2391 "-" version ".tar.gz"))
2392 (sha256
2393 (base32
2394 "1kyhczwa17qp8ik3v876yjqsf4zrjj0z3464j04fak269cii404g"))))))
2395
2396(define-public nifticlib
2397 ;; Warning: The version of the test data may not match the package version.
2398 (let* ((nifti-test-data-version "3.0.2")
2399 (nifti-test-data-file (git-file-name "nifti-test-data"
2400 nifti-test-data-version)))
2401 (package
2402 (name "nifticlib")
2403 (version "3.0.1")
2404 (source (origin
2405 (method git-fetch)
2406 (uri (git-reference
2407 (url "https://github.com/NIFTI-Imaging/nifti_clib")
2408 (commit (string-append "v" version))))
2409 (file-name (git-file-name name version))
2410 (sha256
2411 (base32
2412 "0hamm6nvbjdjjd5md4jahzvn5559frigxaiybnjkh59ckxwb1hy4"))))
2413 (build-system cmake-build-system)
2414 (arguments
2415 (list
2416 #:configure-flags
2417 #~(append
2418 (list "-DBUILD_SHARED_LIBS=ON"
2419 "-DDOWNLOAD_TEST_DATA=OFF"
2420 ;; Test data directory must be writeable.
2421 (string-append "-Dfetch_testing_data_SOURCE_DIR="
2422 (canonicalize-path ".") "/source/test-data")
2423 "-DUSE_CIFTI_CODE=ON")
2424 ;; Unable to generate manual pages via help2man when cross-compiling.
2425 (if #$(%current-target-system)
2426 '()
2427 (list "-DNIFTI_INSTALL_NO_DOCS=FALSE")))
2428 #:phases
2429 #~(modify-phases %standard-phases
2430 (add-after 'unpack 'set-version
2431 (lambda _
2432 (substitute* "CMakeLists.txt"
2433 (("0.0.0.0") #$version))))
2434 (add-after 'unpack 'prepare-test-data
2435 (lambda* (#:key tests? #:allow-other-keys)
2436 (when tests?
2437 (copy-recursively #$(this-package-native-input
2438 nifti-test-data-file)
2439 "test-data"))))
2440 (add-after 'unpack 'patch-tests
2441 (lambda* (#:key tests? #:allow-other-keys)
2442 (when tests?
2443 (substitute* (string-append "nifti2/nifti_regress_test/"
2444 "cmake_testscripts/"
2445 "install_linking_test.sh")
2446 (("real_easy") "source/real_easy")))))
2447 (delete 'check)
2448 (add-after 'install 'check
2449 (lambda args
2450 ;; The 'install_linking' test invokes this package's binaries.
2451 (setenv "PATH" (string-append (getenv "PATH") ":"
2452 #$output "/bin"))
2453 (apply (assoc-ref %standard-phases 'check) args))))))
2454 (inputs (list expat zlib))
2455 (native-inputs
2456 (append
2457 (list
2458 (origin
2459 (method git-fetch)
2460 (uri (git-reference
2461 (url "https://github.com/NIFTI-Imaging/nifti-test-data")
2462 (commit (string-append "v" nifti-test-data-version))))
2463 (file-name nifti-test-data-file)
2464 (sha256
2465 (base32 "0jdm8amix7pvfb1zmrb89f7izji2s8fpbfncgamczsngc11yfgcp"))))
2466 (if (%current-target-system)
2467 '()
2468 (list help2man))))
2469 (synopsis
2470 "C libraries for reading and writing files in @acronym{NIfTI, Neuroimaging
2471Informatics Technology Initiative} formats")
2472 (description
2473 "@code{Nifti_clib} is a set of I/O libraries for reading and writing files
2474in the nifti-1, nifti-2, and (to some degree) cifti file formats. These are
2475binary file formats for storing medical image data, e.g. @acronym{MRI, magnetic
2476resonance imaging} and @acronym{fMRI, functional MRI} brain images.")
2477 (home-page "https://github.com/NIFTI-Imaging/nifti_clib")
2478 (license license:public-domain))))
2479
2480(define-public niftilib
2481 (deprecated-package "niftilib" nifticlib))
2482
2483(define-public mini
2484 (package
2485 (name "mini")
2486 (version "0.9.17")
2487 (source (origin
2488 (method git-fetch)
2489 (uri (git-reference
2490 (url "https://github.com/pulzed/mINI")
2491 (commit version)))
2492 (file-name (git-file-name name version))
2493 (sha256
2494 (base32
2495 "0n4c4dsmycp9pgaykc7rpgrgs23nb5gc9fb4agq95fdfpphdarm4"))))
2496 (build-system gnu-build-system)
2497 (arguments
2498 (list #:phases
2499 #~(modify-phases %standard-phases
2500 (delete 'build)
2501 (delete 'configure)
2502 (replace 'check
2503 (lambda* (#:key tests? #:allow-other-keys)
2504 (when tests?
2505 (with-directory-excursion "tests"
2506 (for-each (lambda (test)
2507 (let ((test-name (basename test
2508 ".cpp")))
2509 (invoke "./build.sh" test-name)
2510 (invoke "./run.sh" test-name)))
2511 (find-files "." ".cpp"))))))
2512 (replace 'install
2513 (lambda _
2514 (install-file "src/mini/ini.h"
2515 (string-append #$output "/include/mini")))))))
2516 (home-page "https://github.com/pulzed/mINI")
2517 (synopsis "INI file reader and writer header library")
2518 (description
2519 "This is a tiny, header-only C++ library for manipulating INI files.")
2520 (license license:expat)))
2521
2522(define-public picket
2523 (package
2524 (name "picket")
2525 (version "1.3")
2526 (source (origin
2527 (method git-fetch)
2528 (uri (git-reference
2529 (url "https://github.com/rajter/picket")
2530 (commit (string-append "v" version))))
2531 (file-name (git-file-name name version))
2532 (sha256
2533 (base32
2534 "1zhpynyakjx9nc51b1j80b4y3138p3l380kp1cqmmjx2n9430144"))
2535 (snippet '(begin
2536 ;; bundled mINI header library.
2537 (delete-file "src/cfg/ini.h")))))
2538 (native-inputs (list pkg-config))
2539 (inputs (list gtkmm-3 mini))
2540 (arguments
2541 (list #:tests? #f
2542 #:phases #~(modify-phases %standard-phases
2543 (add-after 'unpack 'fix-mini-includes
2544 (lambda _
2545 (substitute* '("src/cfg/config.h"
2546 "src/cfg/config.cpp")
2547 (("#include \"ini.h\"")
2548 "#include \"mini/ini.h\""))
2549 (substitute* "src/main.cpp"
2550 (("/usr")
2551 #$output))))
2552 (add-after 'unpack 'fix-cmake-paths
2553 (lambda* (#:key inputs #:allow-other-keys)
2554 (substitute* "CMakeLists.txt"
2555 (("src/cfg/ini.h")
2556 (search-input-file inputs
2557 "/include/mini/ini.h"))
2558 (("/usr/")
2559 #$output)))))))
2560 (build-system cmake-build-system)
2561 (home-page "https://github.com/rajter/picket")
2562 (synopsis "Screen color picker with custom format output")
2563 (description
2564 "Picket is a screen color picker that includes a magnifier and supports
2565custom formats for representing color values..")
2566 (license license:gpl3+)))
2567
2568(define-public gpick
2569 (package
2570 (name "gpick")
2571 (version "0.2.6")
2572 (source
2573 (origin
2574 (method git-fetch)
2575 (uri (git-reference
2576 (url "https://github.com/thezbyg/gpick")
2577 (commit (string-append name "-" version))))
2578 (file-name (git-file-name name version))
2579 (sha256
2580 (base32 "0nl89gca5nmbyycv5rl5bm6k7facapdk4pab9pl949aa3cjw9bk7"))))
2581 (build-system scons-build-system)
2582 (arguments
2583 (list
2584 #:tests? #f
2585 #:scons-flags
2586 #~(list (string-append "DESTDIR=" %output))
2587 #:phases
2588 #~(modify-phases %standard-phases
2589 (add-before 'build 'fix-lua-reference
2590 (lambda _
2591 (substitute* "SConscript"
2592 (("lua5.2")
2593 "lua-5.2")))))))
2594 (native-inputs (list boost-1.83 gettext-minimal pkg-config ragel))
2595 (inputs (list expat gtk+-2 lua-5.2))
2596 (home-page "http://www.gpick.org/")
2597 (synopsis "Color picker")
2598 (description "Gpick is an advanced color picker and palette editing tool.")
2599 (license license:bsd-3)))
2600
2601(define-public libiptcdata
2602 (package
2603 (name "libiptcdata")
2604 (version "1.0.5")
2605 (source (origin
2606 (method url-fetch)
2607 (uri (string-append "https://github.com/ianw/libiptcdata"
2608 "/releases/download/release_"
2609 (string-join (string-split version #\.) "_")
2610 "/" name "-" version ".tar.gz"))
2611 (sha256
2612 (base32
2613 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
2614 (build-system gnu-build-system)
2615 (home-page "https://github.com/ianw/libiptcdata")
2616 (synopsis "IPTC metadata manipulation library")
2617 (description
2618 "Libiptcdata is a C library for manipulating the International Press
2619Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
2620such as images. This metadata can include captions and keywords, often used by
2621popular photo management applications. The library provides routines for
2622parsing, viewing, modifying, and saving this metadata.")
2623 (license license:lgpl2.0+)))
2624
2625(define-public flameshot
2626 (package
2627 (name "flameshot")
2628 (version "13.3.0")
2629 (source
2630 (origin
2631 (method git-fetch)
2632 (uri (git-reference
2633 (url "https://github.com/flameshot-org/flameshot")
2634 (commit (string-append "v" version))))
2635 (file-name (git-file-name name version))
2636 (sha256
2637 (base32
2638 "1v9xsivq9wnj7x1gr877a40xi6j672h9j82c5nkih9b64jg0naj7"))))
2639 (build-system qt-build-system)
2640 (arguments
2641 (list
2642 #:qtbase qtbase
2643 #:tests? #f ;no tests
2644 #:configure-flags
2645 #~(list "-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
2646 "-DUSE_BUNDLED_KDSINGLEAPPLICATION=OFF"
2647 "-DDISABLE_UPDATE_CHECKER=ON")))
2648 (native-inputs (list qttools))
2649 (inputs (list kdsingleapplication qtcolorwidgets qtsvg))
2650 (home-page "https://github.com/flameshot-org/flameshot")
2651 (synopsis "Powerful yet simple to use screenshot software")
2652 (description "Flameshot is a screenshot program.
2653Features:
2654
2655@itemize
2656@item Customizable appearance.
2657@item Easy to use.
2658@item In-app screenshot edition.
2659@item DBus interface.
2660@item Upload to Imgur.
2661@end itemize\n")
2662 (license license:gpl3+)))
2663
2664(define-public swappy
2665 (package
2666 (name "swappy")
2667 (version "1.8.0")
2668 (source
2669 (origin
2670 (method git-fetch)
2671 (uri (git-reference
2672 (url "https://github.com/jtheoof/swappy")
2673 (commit (string-append "v" version))))
2674 (file-name (git-file-name name version))
2675 (sha256
2676 (base32 "0drihlsc193dzffnllpjwhq5n6j7m5pix1wxgnkgp4x3nvmvkxxc"))))
2677 (build-system meson-build-system)
2678 (native-inputs
2679 (list pkg-config scdoc
2680 `(,glib "bin"))) ; for 'glib-compile-resources'
2681 (inputs
2682 (list gtk+ libnotify gettext-minimal))
2683 (propagated-inputs
2684 ;; Needed to properly render the icons.
2685 (list font-awesome))
2686 (home-page "https://github.com/jtheoof/swappy")
2687 (synopsis "Grab and edit on the fly snapshots of a Wayland compositor")
2688 (description
2689 "@command{swappy} is a command-line utility to take and edit screenshots
2690of Wayland desktops. Works great with grim, slurp and sway. But can easily
2691work with other screen copy tools that can output a final PNG image to
2692stdout.")
2693 (license license:expat)))
2694
2695(define-public gifsicle
2696 (package
2697 (name "gifsicle")
2698 (version "1.95")
2699 (source
2700 (origin
2701 (method git-fetch)
2702 (uri (git-reference
2703 (url "https://github.com/kohler/gifsicle")
2704 (commit (string-append "v" version))))
2705 (file-name (git-file-name name version))
2706 (sha256
2707 (base32 "1wvsf2kv90bqpyxcjilir4zgmaga0xjg96vnn7rzq4fkjx8pb3yg"))
2708 (modules '((guix build utils)))
2709 (snippet '(begin (substitute* "configure.ac"
2710 (("2.72") "2.69"))))))
2711 (build-system gnu-build-system)
2712 (arguments
2713 (list
2714 #:phases
2715 #~(modify-phases %standard-phases
2716 (add-before 'check 'patch-tests
2717 (lambda _
2718 (substitute* "test/testie"
2719 (("/usr/bin/perl")
2720 (which "perl"))
2721 (("/bin/sh")
2722 (which "sh"))
2723 (("/bin/rm")
2724 (which "rm"))))))))
2725 (native-inputs
2726 (list
2727 autoconf automake
2728 perl)) ; only for tests
2729 (inputs (list libx11))
2730 (home-page "https://www.lcdf.org/gifsicle/")
2731 (synopsis "Edit GIF images and animations")
2732 (description "Gifsicle is a command-line GIF image manipulation tool that:
2733
2734@itemize
2735@item Provides a batch mode for changing GIFs in place.
2736@item Prints detailed information about GIFs, including comments.
2737@item Control over interlacing, comments, looping, transparency, etc.
2738@item Creates well-behaved GIFs: removes redundant colors, only uses local color
2739tables, etc.
2740@item Shrinks colormaps and change images to use the Web-safe palette.
2741@item Optimizes GIF animations, or unoptimizes them for easier editing.
2742@end itemize
2743
2744Two other programs are included with Gifsicle: @command{gifview} is a
2745lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
2746identical visual appearance.")
2747 (license license:gpl2+)))
2748
2749(define-public jp2a
2750 (package
2751 (name "jp2a")
2752 (version "1.1.1")
2753 (source
2754 (origin
2755 (method url-fetch)
2756 (uri (string-append "https://github.com/Talinx/jp2a/releases/download/v"
2757 version "/jp2a-" version ".tar.gz"))
2758 (sha256
2759 (base32
2760 "10kwhh1a0ivrzagl2vcxrbqmlr2q8x29ymqwzchpiriy6xqxck8l"))))
2761 (build-system gnu-build-system)
2762 (inputs
2763 (list curl libpng libjpeg-turbo ncurses))
2764 (native-inputs
2765 (list doxygen))
2766 (home-page "https://csl.name/jp2a/")
2767 (synopsis "Convert JPEG images to ASCII")
2768 (description
2769 "Jp2a is a small utility that converts JPEG images to ASCII.")
2770 (license license:gpl2)))
2771
2772(define-public grim
2773 (package
2774 (name "grim")
2775 (version "1.5.0")
2776 (source
2777 (origin
2778 (method git-fetch)
2779 (uri (git-reference
2780 (url "https://gitlab.freedesktop.org/emersion/grim/")
2781 (commit (string-append "v" version))))
2782 (file-name (git-file-name name version))
2783 (sha256
2784 (base32 "1rabva3x203hbsnmad6zrvlpxadmxw1zmd42i3pjk05pnk73mym0"))))
2785 (build-system meson-build-system)
2786 (native-inputs (append (if (%current-target-system)
2787 ;; For wayland-scanner.
2788 (list pkg-config-for-build wayland)
2789 '())
2790 (list pkg-config scdoc)))
2791 (inputs (list pixman libpng libjpeg-turbo wayland wayland-protocols))
2792 (home-page "https://gitlab.freedesktop.org/emersion/grim")
2793 (synopsis "Create screenshots from a Wayland compositor")
2794 (description "grim can create screenshots from a Wayland compositor.")
2795 (license license:expat)))
2796
2797(define-public slurp
2798 (package
2799 (name "slurp")
2800 (version "1.5.0")
2801 (source
2802 (origin
2803 (method git-fetch)
2804 (uri (git-reference
2805 (url "https://github.com/emersion/slurp")
2806 (commit (string-append "v" version))))
2807 (file-name (git-file-name name version))
2808 (sha256
2809 (base32 "0wlml42c3shma50bsvqzll7p3zn251jaf0jm59q2idks8gg1zkyq"))))
2810 (build-system meson-build-system)
2811 (native-inputs
2812 (append (if (%current-target-system)
2813 ;; for wayland-scanner
2814 (list wayland pkg-config-for-build)
2815 '())
2816 (list pkg-config scdoc)))
2817 (inputs
2818 (list cairo libxkbcommon wayland wayland-protocols))
2819 (home-page "https://github.com/emersion/slurp")
2820 (synopsis "Select a region in a Wayland compositor")
2821 (description "Slurp can select a region in a Wayland compositor and print it
2822to the standard output. It works well together with grim.")
2823 (license license:expat)))
2824
2825(define-public sng
2826 (package
2827 (name "sng")
2828 (version "1.1.0")
2829 (source
2830 (origin
2831 (method url-fetch)
2832 (uri (string-append "mirror://sourceforge/sng/sng-"
2833 version ".tar.gz"))
2834 (sha256
2835 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
2836 (build-system gnu-build-system)
2837 (arguments
2838 `(#:phases
2839 (modify-phases %standard-phases
2840 (add-before 'check 'link-pngsuite
2841 ;; tests expect pngsuite in source dir
2842 (lambda* (#:key inputs #:allow-other-keys)
2843 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
2844 #t)))
2845 #:configure-flags
2846 (list (string-append "--with-rgbtxt="
2847 (assoc-ref %build-inputs "xorg-rgb")
2848 "/share/X11/rgb.txt"))))
2849 (inputs (list xorg-rgb libpng))
2850 (native-inputs (list pngsuite))
2851 (home-page "https://sng.sourceforge.net")
2852 (synopsis "Markup language for representing PNG contents")
2853 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
2854specifically to represent the entire contents of a PNG (Portable Network
2855Graphics) file in an editable form. Thus, SNGs representing elaborate
2856graphics images and ancillary chunk data can be readily generated or modified
2857using only text tools.
2858
2859SNG is implemented by a compiler/decompiler called sng that
2860losslessly translates between SNG and PNG.")
2861 (license license:zlib)))
2862
2863(define-public blurhash
2864 (package
2865 (name "blurhash")
2866 (version "0.2.0")
2867 (source
2868 (origin
2869 (method git-fetch)
2870 (uri (git-reference
2871 (url "https://github.com/Nheko-Reborn/blurhash")
2872 (commit (string-append "v" version))))
2873 (file-name (git-file-name name version))
2874 (sha256
2875 (base32 "0hx15fspava43z47kv17ivxv56g03fb2zf45dl07v3shickqxw0x"))))
2876 (build-system meson-build-system)
2877 (native-inputs
2878 (list doctest pkg-config))
2879 (home-page "https://github.com/Nheko-Reborn/blurhash")
2880 (synopsis "C++ blurhash encoder/decoder")
2881 (description "Simple encoder and decoder for blurhashes. Contains a
2882command line program as well as a shared library.")
2883 (license license:boost1.0)))
2884
2885(define-public lodepng
2886 ;; There are no tags in the repository, so we take the version as defined in
2887 ;; lodepng.cpp.
2888 (let ((commit "48e5364ef48ec2408f44c727657ac1b6703185f8")
2889 (revision "1")
2890 (version "20200215"))
2891 (package
2892 (name "lodepng")
2893 (version (git-version version revision commit))
2894 (source (origin
2895 (method git-fetch)
2896 (uri (git-reference
2897 (url "https://github.com/lvandeve/lodepng")
2898 (commit commit)))
2899 (sha256
2900 (base32
2901 "1a1x8ag2scanzb2066jm9hg2y9kaa3wmpgmz10l1x9bkpik612lw"))
2902 (file-name (git-file-name name version))))
2903 (build-system gnu-build-system)
2904 (arguments
2905 '(#:phases
2906 (modify-phases %standard-phases
2907 (delete 'configure)
2908 (replace 'build
2909 (lambda _
2910 (setenv "CXXFLAGS" "-fPIC")
2911 (invoke "make" "lodepng.o")
2912 (invoke "make" "lodepng_util.o")
2913 (invoke "g++" "-fPIC" "-O3"
2914 "-o" "liblodepng.so"
2915 "-shared" "lodepng.o" "lodepng_util.o")
2916 #t))
2917 (replace 'check
2918 (lambda _
2919 (invoke "make" "unittest")
2920 (invoke "./unittest")
2921 #t))
2922 (replace 'install
2923 (lambda* (#:key outputs #:allow-other-keys)
2924 (let* ((out (assoc-ref outputs "out"))
2925 (doc (string-append out "/share/doc"))
2926 (lib (string-append out "/lib"))
2927 (include (string-append out "/include")))
2928 (install-file "lodepng.h" include)
2929 (install-file "lodepng_util.h" include)
2930 (install-file "liblodepng.so" lib)
2931 (install-file "README.md" doc)
2932 #t))))))
2933 (home-page "https://lodev.org/lodepng/")
2934 (synopsis "PNG encoder and decoder in C and C++, without dependencies")
2935 (description "LodePNG is a PNG image decoder and encoder, all in one,
2936no dependency or linkage required. It's made for C (ISO C90), and has a C++
2937wrapper with a more convenient interface on top.")
2938 (license license:zlib))))
2939
2940(define-public lodepng/c
2941 (package/inherit lodepng
2942 (name "lodepng-c")
2943 (arguments
2944 (substitute-keyword-arguments arguments
2945 ((#:make-flags _ '())
2946 #~(list (string-append "CC=" #$(cc-for-target))
2947 "CFLAGS=-fPIC"))
2948 ((#:phases phases)
2949 #~(modify-phases #$phases
2950 (add-after 'unpack 'patch
2951 (lambda _
2952 (rename-file "lodepng.cpp" "lodepng.c")))
2953 ;; The unittest target requires the <vector> header which is
2954 ;; available only for C++.
2955 (delete 'check)
2956 (replace 'build
2957 (lambda* (#:key (make-flags '()) #:allow-other-keys)
2958 (apply invoke "make" "lodepng.o" make-flags)
2959 (invoke #$(cc-for-target) "-fPIC" "-O3"
2960 "-o" "liblodepng.so"
2961 "-shared" "lodepng.o")))
2962 (replace 'install
2963 (lambda _
2964 (install-file "lodepng.h" (string-append #$output "/include"))
2965 (install-file "liblodepng.so" (string-append #$output "/lib"))
2966 (install-file "README.md"
2967 (string-append #$output
2968 "/share/doc/lodepng"))))))))
2969 (properties '((upstream-name . "lodepng")))))
2970
2971(define-public icoutils
2972 (package
2973 (name "icoutils")
2974 (version "0.32.3")
2975 (source
2976 (origin
2977 (method url-fetch)
2978 (uri (string-append
2979 "mirror://savannah/icoutils/icoutils-" version ".tar.bz2"))
2980 (sha256
2981 (base32 "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp"))))
2982 (build-system gnu-build-system)
2983 (inputs
2984 (list libpng perl))
2985 (propagated-inputs
2986 (list perl-libwww))
2987 (home-page "https://www.nongnu.org/icoutils/")
2988 (synopsis "Extract and convert bitmaps from Windows icon and cursor files")
2989 (description "Icoutils are a set of program for extracting and converting
2990bitmaps from Microsoft Windows icon and cursor files. These files usually
2991have the extension @code{.ico} or @code{.cur}, but they can also be embedded
2992in executables and libraries (@code{.dll}-files). (Such embedded files are
2993referred to as resources.)
2994
2995Conversion of these files to and from PNG images is done @command{icotool}.
2996@command{extresso} automates these tasks with the help of special resource
2997scripts. Resources such can be extracted from MS Windows executable and
2998library files with @command{wrestool}.
2999
3000This package can be used to create @code{favicon.ico} files for web sites.")
3001 (license license:gpl3+)))
3002
3003(define-public libavif
3004 (package
3005 (name "libavif")
3006 (version "1.0.4")
3007 (source (origin
3008 (method git-fetch)
3009 (uri (git-reference
3010 (url "https://github.com/AOMediaCodec/libavif")
3011 (commit (string-append "v" version))))
3012 (file-name (git-file-name name version))
3013 (sha256
3014 (base32
3015 "0k72q7yvfdn92wkslyifw14319nm981a8r3kd84i4ylxmrkgi0zm"))))
3016 (build-system cmake-build-system)
3017 (arguments
3018 (list
3019 #:modules '((guix build cmake-build-system)
3020 (guix build utils)
3021 (srfi srfi-26))
3022 #:configure-flags
3023 #~(list "-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
3024 #$@(if (this-package-input "rav1e")
3025 '("-DAVIF_CODEC_RAV1E=ON")
3026 '())
3027 "-DAVIF_BUILD_TESTS=ON" "-DAVIF_ENABLE_GTEST=ON"
3028 "-DAVIF_BUILD_APPS=ON" "-DAVIF_BUILD_GDK_PIXBUF=ON")
3029 #:phases
3030 #~(modify-phases %standard-phases
3031 (add-before 'configure 'patch-thumbnailer
3032 (lambda _
3033 (substitute* "contrib/gdk-pixbuf/avif.thumbnailer.in"
3034 (("@CMAKE_INSTALL_FULL_BINDIR@/gdk-pixbuf-thumbnailer")
3035 (string-append #$gdk-pixbuf "/bin/gdk-pixbuf-thumbnailer")))))
3036 (add-after 'install 'install-readme
3037 (lambda _
3038 (let ((doc (string-append #$output "/share/doc/libavif-"
3039 #$(package-version this-package))))
3040 (install-file "../source/README.md" doc))))
3041 (add-after 'install 'split
3042 (lambda _
3043 (let* ((avifenc (string-append #$output "/bin/avifenc"))
3044 (avifenc* (string-append #$output:tools "/bin/avifenc"))
3045 (avifdec (string-append #$output "/bin/avifdec"))
3046 (avifdec* (string-append #$output:tools "/bin/avifdec"))
3047
3048 (thumbnailer (string-append
3049 #$output
3050 "/share/thumbnailers/avif.thumbnailer"))
3051 (thumbnailer* (string-append
3052 #$output:pixbuf-loader
3053 "/share/thumbnailers/avif.thumbnailer"))
3054 (pixbuf-loader (string-append
3055 #$output
3056 "/lib/gdk-pixbuf-2.0/2.10.0/loaders/"
3057 "libpixbufloader-avif.so"))
3058 (pixbuf-loader* (string-append
3059 #$output:pixbuf-loader
3060 "/lib/gdk-pixbuf-2.0/2.10.0/loaders/"
3061 "libpixbufloader-avif.so")))
3062 (mkdir-p (string-append #$output:tools "/bin"))
3063 (for-each (compose mkdir-p
3064 (cut string-append
3065 #$output:pixbuf-loader <>))
3066 '("/share/thumbnailers"
3067 "/lib/gdk-pixbuf-2.0/2.10.0/loaders/"))
3068
3069 (for-each (lambda (old new)
3070 (copy-file old new)
3071 (delete-file old)
3072 (chmod new #o555))
3073 (list avifenc avifdec
3074 thumbnailer pixbuf-loader)
3075 (list avifenc* avifdec*
3076 thumbnailer* pixbuf-loader*))))))))
3077 (native-inputs (list googletest pkg-config))
3078 (inputs
3079 (append
3080 (if (member (%current-system) (package-transitive-supported-systems rav1e))
3081 (list rav1e) '())
3082 (list dav1d libaom zlib libpng libjpeg-turbo gdk-pixbuf)))
3083 (outputs (list "out"
3084 "tools" ; avifenc & avifdec
3085 "pixbuf-loader"))
3086 (synopsis "Encode and decode AVIF files")
3087 (description "Libavif is a C implementation of @acronym{AVIF, the AV1 Image
3088File Format}. It can encode and decode all YUV formats and bit depths supported
3089by AOM, including with alpha.")
3090 (home-page "https://github.com/AOMediaCodec/libavif")
3091 (license (list license:bsd-2))))
3092
3093(define-public libheif
3094 (package
3095 (name "libheif")
3096 (version "1.23.1")
3097 (source
3098 (origin
3099 (method git-fetch)
3100 (uri (git-reference
3101 (url "https://github.com/strukturag/libheif")
3102 (commit (string-append "v" version))))
3103 (file-name (git-file-name name version))
3104 (sha256
3105 (base32 "1asr4zvj7h1nywzwmq6dby1ark4709q8rada45z1r9g5zw511s53"))))
3106 (build-system cmake-build-system)
3107 (native-inputs
3108 (list autoconf automake libtool pkg-config))
3109 (inputs
3110 (list gdk-pixbuf ; optional
3111 libjpeg-turbo
3112 libpng))
3113 ;; Propagated to satisfy 'libheif.pc'.
3114 (propagated-inputs
3115 (list dav1d libaom libde265 libx264 openh264 x265))
3116 (home-page "https://github.com/strukturag/libheif")
3117 (synopsis "HEIF and AVIF file format decoder and encoder")
3118 (description
3119 "@code{libheif} is an ISO/IEC 23008-12:2017 HEIF and AVIF (AV1 Image File
3120Format) file format decoder and encoder.")
3121 (license license:lgpl3+)))
3122
3123(define libjxl-testdata
3124 (origin
3125 (method git-fetch)
3126 (uri (git-reference
3127 (url "https://github.com/libjxl/testdata")
3128 (commit "ff8d743aaba05b3014f17e5475e576242fa979fc")))
3129 (sha256
3130 (base32 "05nba2h0m74n5f9jzl3vzvnj74fj3si09ncwk2dqg41qdc49d1ng"))))
3131
3132(define-public libjxl
3133 (package
3134 (name "libjxl")
3135 (version "0.11.2")
3136 (outputs (list "out" "pixbuf-loader"))
3137 (source
3138 (origin
3139 (method git-fetch)
3140 (uri (git-reference
3141 (url "https://github.com/libjxl/libjxl")
3142 (commit (string-append "v" version))))
3143 (file-name (git-file-name name version))
3144 (sha256
3145 (base32 "0a6fg2v81rqsbrzi97x1d7wadcikh2fizr64rsza668cwvsk631q"))))
3146 (build-system cmake-build-system)
3147 (arguments
3148 (list
3149 #:configure-flags
3150 #~'("-DJPEGXL_FORCE_SYSTEM_GTEST=true"
3151 "-DJPEGXL_FORCE_SYSTEM_BROTLI=true"
3152 "-DJPEGXL_FORCE_SYSTEM_LCMS2=true"
3153 "-DJPEGXL_FORCE_SYSTEM_HWY=true"
3154 "-DJPEGXL_BUNDLE_LIBPNG=false"
3155 "-DJPEGXL_ENABLE_PLUGINS=true")
3156 #:phases
3157 #~(modify-phases %standard-phases
3158 #$@(cond
3159 ((target-riscv64?)
3160 #~((add-after 'unpack 'fix-atomic
3161 (lambda _
3162 (substitute* "lib/jxl/enc_xyb.cc"
3163 (("#include \"lib/jxl/enc_xyb.h\"" a)
3164 (string-append a "\n#include <atomic>")))))))
3165 ((target-x86-32?)
3166 #~((add-after 'unpack 'loosen-test-parameter
3167 (lambda _
3168 ;; This test fails likely due to a floating point
3169 ;; rounding difference.
3170 (substitute* "lib/jxl/color_management_test.cc"
3171 (("8\\.7e-4") "8.7e-3"))))))
3172 (#t
3173 #~()))
3174 (add-after 'unpack 'patch-dependencies
3175 (lambda* (#:key inputs #:allow-other-keys)
3176 (with-directory-excursion "third_party"
3177 ;; HACK: Create dummy files to pretend the bundled sjpeg and
3178 ;; skcms exist.
3179 (apply invoke "touch"
3180 '("sjpeg/CMakeLists.txt"
3181 "sjpeg/COPYING"
3182 "skcms/skcms.h"
3183 "skcms/LICENSE"))
3184 (substitute* "CMakeLists.txt"
3185 (("include\\(skcms\\.cmake\\)")
3186 "find_library(SKCMS_LIB NAMES skcms REQUIRED)")
3187 (("include\\(sjpeg\\.cmake\\)")
3188 "find_package(sjpeg REQUIRED)")))
3189 (with-directory-excursion "lib"
3190 (substitute* "jxl_cms.cmake"
3191 (("target_link_skcms\\(jxl_cms\\)")
3192 "target_link_libraries(jxl_cms PRIVATE ${SKCMS_LIB})"))
3193 (substitute* "jxl_extras.cmake"
3194 (("\\.\\.\\/third_party\\/sjpeg\\/src")
3195 (dirname (search-input-file inputs "src/sjpegi.h")))))))
3196 (add-after 'unpack 'unpack-testdata
3197 (lambda _
3198 (rmdir "testdata")
3199 (copy-recursively #$libjxl-testdata "testdata")))
3200 (add-after 'install 'split
3201 (lambda _
3202 (for-each
3203 (lambda (path)
3204 (let ((old (string-append #$output path))
3205 (new (string-append #$output:pixbuf-loader path)))
3206 (install-file old (dirname new))
3207 (delete-file old)
3208 (chmod new #o555)))
3209 '("/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jxl.so"
3210 "/share/thumbnailers/jxl.thumbnailer")))))))
3211 (native-inputs
3212 (list asciidoc
3213 doxygen
3214 googletest
3215 pkg-config
3216 python
3217 (package-source sjpeg))) ;for sjpegi.h
3218 (inputs
3219 (list freeglut
3220 gdk-pixbuf
3221 gflags
3222 giflib
3223 imath
3224 lcms
3225 libavif
3226 libjpeg-turbo
3227 libpng
3228 libwebp
3229 openexr
3230 sjpeg
3231 skcms
3232 zlib))
3233 ;; These are in Requires.private of libjxl.pc.
3234 (propagated-inputs
3235 (list brotli google-highway))
3236 (home-page "https://github.com/libjxl/libjxl")
3237 (synopsis "JPEG XL image format reference implementation")
3238 (description "This package contains a reference implementation of JPEG XL
3239(encoder and decoder).")
3240 (properties
3241 `((output-synopsis "pixbuf-loader" "gdk-pixbuf loader for the JXL format")))
3242 (license license:bsd-3)))
3243
3244(define-public mtpaint
3245 (package
3246 (name "mtpaint")
3247 ;; The author neither releases tarballs nor uses git version tags.
3248 ;; Instead, author puts version in git commit title.
3249 (version "3.50.12")
3250 (source
3251 (origin
3252 (method git-fetch)
3253 (uri (git-reference
3254 (url "https://github.com/wjaguar/mtPaint")
3255 (commit "7cae5d663ed835a365d89a535536c39e18862a83")))
3256 (file-name (git-file-name name version))
3257 (sha256
3258 (base32 "0rcblsdikn5659gzqwq3xdws5k03xyvd4yj7r0rm78daamki1wsv"))))
3259 (build-system gnu-build-system)
3260 (native-inputs
3261 (list
3262 gettext-minimal
3263 perl
3264 pkg-config
3265 which))
3266 (inputs
3267 (list
3268 glib
3269 gtk+
3270 imlib2
3271 libjpeg-turbo
3272 libpng
3273 libtiff
3274 libungif
3275 libwebp
3276 openjpeg
3277 lcms
3278 zlib))
3279 (arguments
3280 (list
3281 #:tests? #f ; no test suite
3282 #:phases
3283 #~(modify-phases %standard-phases
3284 (replace 'configure
3285 ;; Do not use "--enable-fast-install".
3286 (lambda _
3287 (invoke "./configure"
3288 (string-append "--prefix=" #$output)
3289 "intl" "man"))))))
3290 (home-page "https://mtpaint.sourceforge.net/")
3291 (synopsis "Create pixel art and manipulate digital images")
3292 (description
3293 "Mtpaint is a graphic editing program which uses the GTK+ toolkit.
3294It can create and edit indexed palette or 24bit RGB images, offers basic
3295painting and palette manipulation tools. It also handles JPEG, JPEG2000,
3296GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
3297 (license license:gpl3+)))
3298
3299(define-public mypaint
3300 (package
3301 (name "mypaint")
3302 ;; The latest changes contains support for Python 3.12+.
3303 (properties '((commit . "35aa9d33cd3deba6cafea6d8fc901b5a1d161ceb")
3304 (revision . "0")))
3305 (version (git-version "2.0.1"
3306 (assoc-ref properties 'revision)
3307 (assoc-ref properties 'commit)))
3308 (source
3309 (origin
3310 (method git-fetch)
3311 (uri (git-reference
3312 (url "https://github.com/mypaint/mypaint")
3313 (commit (assoc-ref properties 'commit))))
3314 (file-name (git-file-name name version))
3315 (sha256
3316 (base32 "1p1i799dzpx0zr7chkz0pjdq9l32ahckgyagbiw82c27mwxqabfh"))))
3317 (build-system pyproject-build-system)
3318 (arguments
3319 (list
3320 #:imported-modules `(,@%pyproject-build-system-modules
3321 (guix build glib-or-gtk-build-system))
3322 #:modules '((guix build pyproject-build-system)
3323 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
3324 (guix build utils))
3325 #:phases
3326 #~(modify-phases %standard-phases
3327 (add-after 'install 'move-assets-to-data
3328 ;; XXX: Check why.
3329 ;;
3330 ;; ERROR: gui.application: Missing icon 'org.mypaint.MyPaint':
3331 ;; check that mypaint icons have been installed into
3332 ;; /gnu/store/<...>/data/icons
3333 ;;
3334 ;; gi.repository.GLib.GError: g-file-error-quark: Failed to open
3335 ;; file
3336 ;; “/gnu/store/<...>/data/mypaint/pixmaps/cursor_color_picker.png”:
3337 ;; No such file or directory (4)
3338 (lambda _
3339 (let* ((data (string-append #$output "/data"))
3340 (data-icons (string-append data "/icons"))
3341 (data-mypaint (string-append data "/mypaint"))
3342 (icons (string-append #$output "/icons"))
3343 (mypaint (string-append #$output "/mypaint")))
3344 (mkdir-p data-icons)
3345 (mkdir-p data-mypaint)
3346 (copy-recursively icons data-icons)
3347 (copy-recursively mypaint data-mypaint)
3348 (delete-file-recursively icons)
3349 (delete-file-recursively mypaint))))
3350 (add-after 'install 'glib-or-gtk-wrap
3351 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
3352 (add-after 'install 'wrap-program
3353 (lambda* (#:key outputs inputs #:allow-other-keys)
3354 (wrap-program (string-append #$output "/bin/mypaint")
3355 `("GI_TYPELIB_PATH" ":" prefix
3356 (,(getenv "GI_TYPELIB_PATH"))))))
3357 (add-before 'check 'pre-check
3358 (lambda _
3359 ;; Need to get the 'lib' in 'build/'.
3360 (delete-file-recursively "lib")
3361 ;; Tests need writing access
3362 (setenv "HOME" "/tmp"))))))
3363 (native-inputs
3364 (list gettext-minimal
3365 gobject-introspection
3366 pkg-config
3367 python-pytest
3368 python-setuptools
3369 swig))
3370 (inputs
3371 (list bash-minimal
3372 gdk-pixbuf
3373 gtk+
3374 hicolor-icon-theme
3375 json-c
3376 lcms
3377 libmypaint-next
3378 libpng
3379 (librsvg-for-system)
3380 mypaint-brushes
3381 python-numpy
3382 python-pycairo
3383 python-pygobject))
3384 (home-page "https://mypaint.org/")
3385 (synopsis "Fast and simple painting app for artists")
3386 (description
3387 "MyPaint is a simple drawing and painting program that works well with
3388Wacom-style graphics tablets.")
3389 (license license:gpl2+)))
3390
3391(define-public phockup
3392 (package
3393 (name "phockup")
3394 (version "1.13.0")
3395 (source
3396 (origin
3397 (method git-fetch)
3398 (uri (git-reference
3399 (url "https://github.com/ivandokov/phockup")
3400 (commit version)))
3401 (file-name (git-file-name name version))
3402 (sha256
3403 (base32 "1kwz2qy8mx0j25g3gyda08qaz5rgwm6vycsrqhgkd5cqqz76bbmc"))))
3404 (build-system copy-build-system)
3405 (arguments
3406 `(#:install-plan '(("src" "share/phockup/")
3407 ("phockup.py" "share/phockup/"))
3408 #:phases
3409 (modify-phases %standard-phases
3410 (add-after 'unpack 'configure
3411 (lambda* (#:key inputs #:allow-other-keys)
3412 (substitute* (list "src/dependency.py"
3413 "src/exif.py")
3414 (("'exiftool")
3415 (string-append "'" (search-input-file inputs "bin/exiftool"))))))
3416 (add-before 'install 'check
3417 (lambda* (#:key tests? #:allow-other-keys)
3418 (when tests?
3419 ;; Test without PATH to make sure ‘exiftool’ is properly found.
3420 (let ((path (getenv "PATH"))
3421 (pytest (which "pytest")))
3422 (setenv "PATH" "")
3423 (invoke pytest)
3424 (setenv "PATH" path)))))
3425 (add-after 'install 'install-bin
3426 (lambda* (#:key outputs #:allow-other-keys)
3427 (let ((out (assoc-ref outputs "out")))
3428 (mkdir (string-append out "/bin"))
3429 (symlink (string-append out "/share/phockup/phockup.py")
3430 (string-append out "/bin/phockup")))))
3431 (add-after 'install-bin 'wrap-program
3432 (lambda* (#:key inputs outputs #:allow-other-keys)
3433 (let ((out (assoc-ref outputs "out")))
3434 (wrap-program (string-append out "/bin/phockup")
3435 `("GUIX_PYTHONPATH" prefix
3436 ,(search-path-as-string->list
3437 (getenv "GUIX_PYTHONPATH"))))))))))
3438 (inputs
3439 (list bash-minimal perl-image-exiftool python python-tqdm))
3440 (native-inputs
3441 (list python-pytest python-pytest-mock python-pytest-socket))
3442 (home-page "https://github.com/ivandokov/phockup")
3443 (synopsis "Organize photos and videos in folders")
3444 (description "Phockup is a media sorting tool that uses creation date and
3445time information in photos and videos to organize them into folders by year,
3446month and day. All files which are not images or videos or those which do not
3447have creation date information will be placed in a folder called
3448@file{unknown}.")
3449 (license license:expat)))
3450
3451(define-public spng
3452 (package
3453 (name "spng")
3454 (version "0.7.2")
3455 (source (origin
3456 (method git-fetch)
3457 (uri (git-reference
3458 (url "https://github.com/randy408/libspng")
3459 (commit (string-append "v" version))))
3460 (file-name (git-file-name name version))
3461 (sha256
3462 (base32
3463 "0src9ii9w9afz2vgridn9r38pa6888myk28x2bjw0ynw5xcd62hs"))))
3464 (build-system meson-build-system)
3465 (inputs (list zlib))
3466 (native-inputs (list libpng))
3467 (home-page "https://libspng.org")
3468 (synopsis "Simple PNG loading library")
3469 (description
3470 "@code{libspng} is a simple C library for loading Portable Network
3471Graphics (PNGs), intended as an easy-to-use replacement for @code{libpng}.")
3472 (license license:bsd-2)
3473 ;; Supports SSE on x86-64 and NEON on AArch64.
3474 (properties '((tunable? . #t)))))
3475
3476(define-public libsixel
3477 (package
3478 (name "libsixel")
3479 (version "1.10.5")
3480 (source
3481 (origin
3482 (method git-fetch)
3483 (uri (git-reference
3484 (url "https://github.com/libsixel/libsixel")
3485 (commit (string-append "v" version))))
3486 (file-name (git-file-name name version))
3487 (sha256
3488 (base32 "1j85p8s5cy7vz1ph9vsvcmxdrr8yi57pgv8vz1xp6dr715jc3g51"))))
3489 (build-system meson-build-system)
3490 (arguments
3491 (list
3492 #:build-type "release"
3493 #:configure-flags #~(list "--buildtype=plain"
3494 "-Dtests=enabled"
3495 "-Dlibcurl=disabled"
3496 "-Dgdk-pixbuf2=enabled"
3497 "-Dbashcompletiondir=etc/bash_completion.d")))
3498 (native-inputs (list pkg-config))
3499 (inputs (list libjpeg-turbo libpng python))
3500 ;; pkg-config's "Requires.private" need gdk-pixbuf. TODO: Remove it when
3501 ;; we use pkgconf.
3502 (propagated-inputs (list gdk-pixbuf))
3503 (home-page "https://github.com/libsixel/libsixel")
3504 (synopsis
3505 "Encoder and decoder implementation for DEC SIXEL graphics")
3506 (description
3507 "LibSIXEL is a an encoder/decoder implementation for DEC SIXEL graphics,
3508and some converter programs. SIXEL is one of image formats for printer and
3509terminal imaging introduced by @acronym{DEC, Digital Equipment Corp.}. Its
3510data scheme is represented as a terminal-friendly escape sequence. So if you
3511want to view a SIXEL image file, all you have to do is @command{cat} it to
3512your terminal.")
3513 (license license:expat)))
3514
3515(define-public libyuv
3516 (package
3517 (name "libyuv")
3518 (version "1922")
3519 (source
3520 (origin
3521 (method git-fetch)
3522 (uri (git-reference
3523 (url "https://chromium.googlesource.com/libyuv/libyuv")
3524 ;; corresponds to version increase in include/libyuv/version.h
3525 (commit "500f45652c459cfccd20f83f297eb66cb7b015cb")))
3526 (sha256
3527 (base32 "0lmmag8rlpsbq5qg7cv89dcm5j7r0rbbsmjnkg8f5ld29mdd50y3"))))
3528 (build-system cmake-build-system)
3529 (arguments
3530 (list
3531 #:configure-flags
3532 #~(list "-DUNIT_TEST=ON")
3533 #:phases
3534 #~(modify-phases %standard-phases
3535 (replace 'check
3536 (lambda _
3537 ;; tests are configured in GN instead of ctest
3538 ;; invoke them manually
3539 (invoke "./libyuv_unittest"))))))
3540 (inputs (list libjpeg-turbo))
3541 (native-inputs (list googletest))
3542 (home-page "https://chromium.googlesource.com/libyuv/libyuv/")
3543 (synopsis "YUV scaling and conversion functionality")
3544 (description "libyuv is an open source project that includes YUV scaling and
3545conversion functionality. It can:
3546@itemize
3547@item Scale YUV to prepare content for compression, with point, bilinear or box
3548filter.
3549@item Convert to YUV from webcam formats for compression.
3550@item Convert to RGB formats for rendering/effects.
3551@item Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode.
3552@end itemize")
3553 (license license:expat)))
3554
3555(define-public libyuv-prev
3556 (package
3557 (inherit libyuv)
3558 (version "2021.4")
3559 (properties `((superseded . ,libyuv)))))