projects/guix·blob java-team · refs

1473 lines · 54.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2017-2022 Ludovic Courtès <[email protected]>
3;;; Copyright © 2014 Ian Denhardt <[email protected]>
4;;; Copyright © 2015, 2016 Alex Kost <[email protected]>
5;;; Copyright © 2016-2021, 2023 Efraim Flashner <[email protected]>
6;;; Copyright © 2017 Alex Griffin <[email protected]>
7;;; Copyright © 2017 Nikita <[email protected]>
8;;; Copyright © 2017 Mathieu Othacehe <[email protected]>
9;;; Copyright © 2017 nee <[email protected]>
10;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email protected]>
11;;; Copyright © 2018, 2019 Ricardo Wurmus <[email protected]>
12;;; Copyright © 2019, 2022, 2023, 2025 Nicolas Goaziou <[email protected]>
13;;; Copyright © 2019, 2020, 2022 Guy Fleury Iteriteka <[email protected]>
14;;; Copyright © 2019 Pierre Langlois <[email protected]>
15;;; Copyright © 2020 Peng Mei Yu <[email protected]>
16;;; Copyright © 2020 R Veera Kumar <[email protected]>
17;;; Copyright © 2020 Pierre Neidhardt <[email protected]>
18;;; Copyright © 2021 LibreMiami <[email protected]>
19;;; Copyright © 2021 Rovanion Luckey <[email protected]>
20;;; Copyright © 2021 Xinglu Chen <[email protected]>
21;;; Copyright © 2021 Stefan Reichör <[email protected]>
22;;; Copyright © 2021 Raghav Gururajan <[email protected]>
23;;; Copyright © 2021 jgart <[email protected]>
24;;; Copyright © 2021 Guillaume Le Vaillant <[email protected]>
25;;; Copyright © 2021 Vagrant Cascadian <[email protected]>
26;;; Copyright © 2021 Zheng Junjie <[email protected]>
27;;; Copyright © 2021 dissent <[email protected]>
28;;; Copyright © 2022 Michael Rohleder <[email protected]>
29;;; Copyright © 2022, 2023 Maxim Cournoyer <[email protected]>
30;;; Copyright © 2022 Tomasz Jeneralczyk <[email protected]>
31;;; Copyright © 2022 Cairn <[email protected]>
32;;; Copyright © 2023 Florian Pelz <[email protected]>
33;;; Copyright © 2024 Artyom V. Poptsov <[email protected]>
34;;; Copyright © 2025 Ashish SHUKLA <[email protected]>
35;;; Copyright © 2025 Mathieu Laparie <[email protected]>
36;;; Copyright © 2025 Joaquín Aguirrezabalaga <[email protected]>
37;;; Copyright © 2025 pinoaffe <[email protected]>
38;;; Copyright © 2025 Zhu Zihao <[email protected]>
39;;; Copyright © 2025 Vinicius Monego <[email protected]>
40;;; Copyright © 2025 Igorj Gorjaĉev <[email protected]>
41;;; Copyright © 2026 Daniel Littlewood <[email protected]>
42;;; Copyright © 2026 Luis Guilherme Coelho <[email protected]>
43;;;
44;;; This file is part of GNU Guix.
45;;;
46;;; GNU Guix is free software; you can redistribute it and/or modify it
47;;; under the terms of the GNU General Public License as published by
48;;; the Free Software Foundation; either version 3 of the License, or (at
49;;; your option) any later version.
50;;;
51;;; GNU Guix is distributed in the hope that it will be useful, but
52;;; WITHOUT ANY WARRANTY; without even the implied warranty of
53;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54;;; GNU General Public License for more details.
55;;;
56;;; You should have received a copy of the GNU General Public License
57;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
58
59(define-module (gnu packages image-viewers)
60 #:use-module ((guix licenses) #:prefix license:)
61 #:use-module (guix download)
62 #:use-module (guix gexp)
63 #:use-module (guix git-download)
64 #:use-module (guix packages)
65 #:use-module (guix utils)
66 #:use-module (guix build-system gnu)
67 #:use-module (guix build-system cmake)
68 #:use-module (guix build-system copy)
69 #:use-module (guix build-system go)
70 #:use-module (guix build-system meson)
71 #:use-module (guix build-system pyproject)
72 #:use-module (guix build-system qt)
73 #:use-module (gnu packages autotools)
74 #:use-module (gnu packages algebra)
75 #:use-module (gnu packages animation)
76 #:use-module (gnu packages backup)
77 #:use-module (gnu packages base)
78 #:use-module (gnu packages bash)
79 #:use-module (gnu packages boost)
80 #:use-module (gnu packages check)
81 #:use-module (gnu packages cmake)
82 #:use-module (gnu packages compression)
83 #:use-module (gnu packages cpp)
84 #:use-module (gnu packages curl)
85 #:use-module (gnu packages documentation)
86 #:use-module (gnu packages djvu)
87 #:use-module (gnu packages fontutils)
88 #:use-module (gnu packages freedesktop)
89 #:use-module (gnu packages gawk)
90 #:use-module (gnu packages gcc)
91 #:use-module (gnu packages gettext)
92 #:use-module (gnu packages ghostscript)
93 #:use-module (gnu packages gl)
94 #:use-module (gnu packages glib)
95 #:use-module (gnu packages gnome)
96 #:use-module (gnu packages golang-build)
97 #:use-module (gnu packages golang-xyz)
98 #:use-module (gnu packages gstreamer)
99 #:use-module (gnu packages gtk)
100 #:use-module (gnu packages graphics)
101 #:use-module (gnu packages haskell-xyz)
102 #:use-module (gnu packages image)
103 #:use-module (gnu packages image-processing)
104 #:use-module (gnu packages imagemagick)
105 #:use-module (gnu packages kde-frameworks)
106 #:use-module (gnu packages linux)
107 #:use-module (gnu packages logging)
108 #:use-module (gnu packages lua)
109 #:use-module (gnu packages maths)
110 #:use-module (gnu packages ncurses)
111 #:use-module (gnu packages oneapi)
112 #:use-module (gnu packages pdf)
113 #:use-module (gnu packages perl)
114 #:use-module (gnu packages perl-check)
115 #:use-module (gnu packages photo)
116 #:use-module (gnu packages pkg-config)
117 #:use-module (gnu packages pretty-print)
118 #:use-module (gnu packages profiling)
119 #:use-module (gnu packages python)
120 #:use-module (gnu packages python-build)
121 #:use-module (gnu packages python-check)
122 #:use-module (gnu packages python-compression)
123 #:use-module (gnu packages python-crypto)
124 #:use-module (gnu packages python-web)
125 #:use-module (gnu packages python-xyz)
126 #:use-module (gnu packages qt)
127 #:use-module (gnu packages sqlite)
128 #:use-module (gnu packages suckless)
129 #:use-module (gnu packages stb)
130 #:use-module (gnu packages tls)
131 #:use-module (gnu packages terminals)
132 #:use-module (gnu packages upnp)
133 #:use-module (gnu packages version-control)
134 #:use-module (gnu packages video)
135 #:use-module (gnu packages vim)
136 #:use-module (gnu packages web)
137 #:use-module (gnu packages xdisorg)
138 #:use-module (gnu packages xml)
139 #:use-module (gnu packages xorg)
140 #:use-module (gnu packages))
141
142(define-public swayimg
143 (package
144 (name "swayimg")
145 (version "5.5")
146 (source
147 (origin
148 (method git-fetch)
149 (uri (git-reference
150 (url "https://github.com/artemsen/swayimg")
151 (commit (string-append "v" version))))
152 (file-name (git-file-name name version))
153 (sha256
154 (base32 "13agacba9vxpa59nvnpzzf8fx8298v4yz1il25abfz0sw5r5bb1x"))))
155 (build-system meson-build-system)
156 (arguments
157 `(#:configure-flags '(,(string-append "-Dversion=" version))))
158 (native-inputs (list pkg-config))
159 (inputs (list bash-completion
160 exiv2
161 fontconfig
162 freetype
163 giflib
164 ijg-libjpeg
165 imath
166 json-c
167 libavif
168 libheif
169 libjxl
170 libpng
171 librsvg
172 libtiff
173 libwebp
174 libxkbcommon
175 luajit
176 openexr
177 wayland
178 wayland-protocols))
179 (home-page "https://github.com/artemsen/swayimg")
180 (synopsis "Customizable and lightweight image viewer for Wayland")
181 (description
182 "Swayimg is a fully customizable and lightweight image viewer for Wayland
183based display servers. It supports the most popular image formats (JPEG, JPEG
184XL, PNG, GIF, SVG, WebP, HEIF/AVIF, AV1F/AVIFS, TIFF, EXR, BMP, PNM, TGA, QOI,
185DICOM, Farbfeld). It has fully customizable keyboard bindings, colors, and
186many other parameters. It also supports loading images from files and pipes,
187and provides gallery and viewer modes with slideshow and animation support.
188It also includes a Sway integration mode: the application creates an overlay
189above the currently active window, which gives the illusion that you are
190opening the image directly in a terminal window.")
191 (license license:expat)))
192
193(define-public ytfzf
194 (package
195 (name "ytfzf")
196 (version "2.6.2")
197 (home-page "https://github.com/pystardust/ytfzf")
198 (source
199 (origin
200 (method git-fetch)
201 (uri
202 (git-reference
203 (url home-page)
204 (commit (string-append "v" version))))
205 (file-name (git-file-name name version))
206 (sha256
207 (base32 "05zcs0avyjn1dlxxsrc47ld3iddls22g1bc4mk0g8ldxvcwra05g"))))
208 (build-system gnu-build-system)
209 (arguments
210 (list
211 #:tests? #f ;no test suite
212 #:make-flags
213 #~(list (string-append "PREFIX=" #$output))
214 #:phases
215 #~(modify-phases %standard-phases
216 (delete 'configure)
217 (add-after 'install 'install-addons
218 (lambda _
219 (invoke "make" "addons"
220 (string-append "PREFIX=" #$output))))
221 (add-after 'install 'wrap-program
222 (lambda* (#:key inputs #:allow-other-keys)
223 (wrap-program (string-append #$output "/bin/ytfzf")
224 `("PATH" ":" prefix
225 ,(map (lambda (input)
226 (string-append (assoc-ref inputs input) "/bin"))
227 '("bash" "catimg" "chafa" "coreutils" "curl"
228 "dmenu" "fzf" "gawk" "grep" "jp2a" "jq"
229 "libnotify" "mpv" "ncurses" "ueberzug"
230 "sed" "util-linux" "yt-dlp")))
231 `("YTFZF_SYSTEM_ADDON_DIR" ":" =
232 ,(list (string-append #$output "/share/ytfzf/addons")))))))))
233 (inputs
234 (list bash
235 catimg
236 chafa
237 coreutils
238 curl
239 dmenu
240 fzf
241 gawk
242 grep
243 jp2a
244 jq
245 libnotify
246 mpv
247 ncurses
248 perl ;for convert-ascii-escape.pl
249 ueberzug
250 sed
251 util-linux
252 yt-dlp))
253 (synopsis "Watch PeerTube or YouTube videos from the terminal")
254 (description "@code{ytfzf} is a POSIX script that helps you find PeerTube or
255YouTube videos without requiring API and opens/downloads them using mpv/ytdl.")
256 (license license:gpl3+)))
257
258(define-public feh
259 (package
260 (name "feh")
261 (version "3.11.3")
262 (home-page "https://feh.finalrewind.org/")
263 (source (origin
264 (method url-fetch)
265 (uri (string-append home-page
266 name "-" version ".tar.bz2"))
267 (sha256
268 (base32
269 "0qqha3k1pivrw8kr6alk3l92qh75cgynb4vsvg024fa359cs7k7j"))))
270 (build-system gnu-build-system)
271 (arguments
272 (list #:phases
273 #~(modify-phases %standard-phases
274 (delete 'configure)) ; no configure script
275 #:test-target "test"
276 #:make-flags
277 #~(list (string-append "CC=" #$(cc-for-target))
278 (string-append "PREFIX=" #$output)
279 "exif=1"
280 "inotify=1"
281 "magic=1")))
282 (native-inputs
283 (list perl perl-test-command))
284 (inputs (list curl
285 imlib2
286 libexif
287 libpng
288 libx11
289 libxinerama
290 libxt))
291 (native-search-paths
292 ;; Feh allows overriding the libcurl builtin CA path (unset in Guix)
293 ;; with the same variable as the `curl` command line HTTP tool.
294 (list (search-path-specification
295 (variable "CURL_CA_BUNDLE")
296 (file-type 'regular)
297 (separator #f) ;single entry
298 (files '("etc/ssl/certs/ca-certificates.crt")))))
299 (synopsis "Fast and light imlib2-based image viewer")
300 (description
301 "feh is an X11 image viewer aimed mostly at console users.
302Unlike most other viewers, it does not have a fancy GUI, but simply
303displays images. It can also be used to set the desktop wallpaper.
304It is controlled via commandline arguments and configurable key/mouse
305actions.")
306
307 ;; The license is really the Expat license, with additional wording in the
308 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
309 ;; software packages that this Software was used."
310 (license (license:x11-style
311 "file://COPYING"
312 "See 'COPYING' in the distribution."))))
313
314(define-public geeqie
315 (package
316 (name "geeqie")
317 (version "2.7")
318 (source (origin
319 (method git-fetch)
320 (uri (git-reference
321 (url "https://github.com/BestImageViewer/geeqie")
322 (commit (string-append "v" version))))
323 (sha256
324 (base32
325 "139ffzqqq79d3k5q99r8i1jr9v9vfwv89dkh6vvw1mdnv6b3s9n8"))
326 (file-name (git-file-name name version))))
327 (build-system meson-build-system)
328 (arguments
329 (list
330 #:glib-or-gtk? #t
331 #:phases
332 #~(modify-phases %standard-phases
333 ;; Disable test which requires binaries not present
334 ;; in the Guix repository.
335 (add-after 'unpack 'disable-failing-test
336 (lambda _
337 (substitute* "meson.build"
338 (("test\\('Ancillary files'.*") "")))))))
339 (inputs
340 (list djvulibre
341 evince
342 exiv2
343 ffmpegthumbnailer
344 gtk+
345 gspell
346 lcms
347 libarchive
348 libchamplain
349 libheif
350 libjpeg-turbo
351 libpng
352 libraw
353 libtiff
354 libjxl
355 poppler
356 libwebp))
357 (native-inputs
358 (list `(,glib "bin") ; glib-gettextize
359 gsettings-desktop-schemas
360 intltool
361 pkg-config
362 python ; for tests
363 python-lxml ; for tests
364 xxd
365 yelp-tools))
366 (home-page "https://www.geeqie.org/")
367 (synopsis "Lightweight GTK+ based image viewer")
368 (description
369 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
370systems. It features: EXIF, IPTC and XMP metadata browsing and editing
371interoperability; easy integration with other software; geeqie works on files
372and directories, there is no need to import images; fast preview for many raw
373image formats; tools for image comparison, sorting and managing photo
374collection. Geeqie was initially based on GQview.")
375 (license license:gpl2+)))
376
377(define-public gpicview
378 (package
379 (name "gpicview")
380 (version "0.3.1")
381 (source (origin
382 (method url-fetch)
383 (uri (string-append
384 "https://github.com/lxde/releases/raw/refs/heads/master/releases/"
385 name "-" version ".tar.xz"))
386 (sha256
387 (base32
388 "0k7anzzaarzi4dmp4g4hrvy3wmzs2whqkrw6gisq2bnb0gl5dj0b"))))
389 (build-system gnu-build-system)
390 (arguments (list #:configure-flags #~(list "--enable-gtk3")))
391 (inputs (list gtk+ libjpeg-turbo))
392 (native-inputs (list intltool pkg-config))
393 (synopsis "Simple and fast image viewer for X")
394 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
395It is the default image viewer on LXDE desktop environment.")
396 (home-page "https://lxde.sourceforge.net/gpicview/")
397 (license license:gpl2+)))
398
399(define-public qimgv
400 (package
401 (name "qimgv")
402 (version "1.0.3-alpha")
403 (source
404 (origin
405 (method git-fetch)
406 (uri (git-reference
407 (url "https://github.com/easymodo/qimgv")
408 (commit (string-append "v" version))))
409 (file-name (git-file-name name version))
410 (sha256
411 (base32
412 "05mk3vdqk4vzg8phqfkxy167iqycahlw1n69nx5myfp5rjii4wvw"))))
413 (build-system cmake-build-system)
414 (arguments (list #:tests? #f)) ;no tests
415 (native-inputs
416 (list exiv2
417 mpv
418 opencv
419 pkg-config
420 qtbase
421 qtsvg
422 qttools))
423 (home-page "https://github.com/easymodo/qimgv")
424 (synopsis "Qt image viewer with optional video support")
425 (description
426 "Qimgv is a configurable Qt image viewer, with optional video support.")
427 (license license:gpl3+)))
428
429(define-public sxiv
430 (package
431 (name "sxiv")
432 (version "26")
433 (source (origin
434 (method git-fetch)
435 (uri (git-reference
436 (url "https://github.com/muennich/sxiv")
437 (commit (string-append "v" version))))
438 (file-name (git-file-name name version))
439 (sha256
440 (base32
441 "0xaawlfdy7b277m38mgg4423kd7p1ffn0dq4hciqs6ivbb3q9c4f"))))
442 (build-system gnu-build-system)
443 (arguments
444 `(#:tests? #f ; no check target
445 #:make-flags
446 (list (string-append "PREFIX=" %output)
447 (string-append "CC=" ,(cc-for-target))
448 ;; Xft.h #includes <ft2build.h> without ‘freetype2/’. The Makefile
449 ;; works around this by hard-coding /usr/include & $PREFIX.
450 (string-append "CPPFLAGS=-I"
451 (assoc-ref %build-inputs "freetype")
452 "/include/freetype2")
453 "V=1")
454 #:phases
455 (modify-phases %standard-phases
456 (delete 'configure) ; no configure script
457 (add-after 'install 'install-desktop-file
458 (lambda* (#:key outputs #:allow-other-keys)
459 (install-file "sxiv.desktop"
460 (string-append (assoc-ref outputs "out")
461 "/share/applications"))
462 #t))
463 (add-after 'install 'install-icons
464 (lambda* (#:key make-flags #:allow-other-keys)
465 (apply invoke "make" "-C" "icon" "install" make-flags))))))
466 (inputs
467 (list freetype
468 giflib
469 imlib2
470 libexif
471 libx11
472 libxft))
473 (home-page "https://github.com/muennich/sxiv")
474 (synopsis "Simple X Image Viewer")
475 (description
476 "sxiv is an alternative to feh and qiv. Its primary goal is to
477provide the most basic features required for fast image viewing. It has
478vi key bindings and works nicely with tiling window managers. Its code
479base should be kept small and clean to make it easy for you to dig into
480it and customize it for your needs.")
481 (license license:gpl2+)))
482
483(define-public nsxiv
484 (package
485 (name "nsxiv")
486 (version "33")
487 (source
488 (origin
489 (method git-fetch)
490 (uri (git-reference
491 (url "https://codeberg.org/nsxiv/nsxiv")
492 (commit (string-append "v" version))))
493 (file-name (git-file-name name version))
494 (sha256
495 (base32 "1y8rsg8q45b1dbm9zrsr0s7v86z95b87cvn7n81nlkj7paj3wnqz"))))
496 (build-system gnu-build-system)
497 (arguments
498 `(#:tests? #f ;no check target
499 #:make-flags
500 (list (string-append "PREFIX=" %output)
501 (string-append "CC=" ,(cc-for-target)))
502 #:phases
503 (modify-phases %standard-phases
504 (delete 'configure) ;no configure script
505 (add-after 'unpack 'fix-paths
506 (lambda* (#:key inputs #:allow-other-keys)
507 ;; Xft.h #includes <ft2build.h> without ‘freetype2/’. The
508 ;; Makefile works around this by hard-coding /usr/include &
509 ;; $PREFIX.
510 (let ((freetype (string-append (assoc-ref inputs "freetype")
511 "/include/freetype2")))
512 (substitute* "Makefile"
513 (("-I/usr/include/freetype2 -I\\$\\(PREFIX\\)/include/freetype2")
514 (string-append "-I" freetype))))))
515 (add-after 'install 'install-desktop-file
516 (lambda* (#:key outputs #:allow-other-keys)
517 (install-file "etc/nsxiv.desktop"
518 (string-append (assoc-ref outputs "out")
519 "/share/applications"))))
520 (add-after 'install 'install-icons
521 (lambda* (#:key make-flags #:allow-other-keys)
522 (apply invoke "make" "install-icon" make-flags))))))
523 (inputs
524 (list freetype
525 giflib
526 imlib2
527 libexif
528 libx11
529 libxft))
530 (home-page "https://github.com/nsxiv/nsxiv")
531 (synopsis "Neo Simple X Image Viewer")
532 (description
533 "nsxiv is a fork of sxiv. Its primary goal is to provide the most basic
534features required for fast image viewing. It has vi key bindings and works
535nicely with tiling window managers. Its code base should be kept small and
536clean to make it easy for you to dig into it and customize it for your
537needs.")
538 (license license:gpl2+)))
539
540(define-public viewnior
541 (package
542 (name "viewnior")
543 (version "1.8")
544 (source
545 (origin
546 (method git-fetch)
547 (uri (git-reference
548 (url "https://github.com/hellosiyan/Viewnior")
549 (commit (string-append name "-" version))))
550 (file-name (git-file-name name version))
551 (sha256
552 (base32 "14qvx1wajncd5ab0207274cwk32f4ipfnlaci6phmah0cwra2did"))))
553 (build-system meson-build-system)
554 (arguments
555 (list #:glib-or-gtk? #t
556 #:phases
557 #~(modify-phases %standard-phases
558 (add-after 'unpack 'patch-source
559 (lambda _
560 ;; Don't create 'icon-theme.cache'
561 (substitute* "meson.build"
562 (("meson.add_install_script*") ""))))
563 (add-after 'glib-or-gtk-wrap 'wrap-pixbuf
564 (lambda* (#:key outputs #:allow-other-keys)
565 (let ((viewnior (string-append #$output "/bin/viewnior")))
566 (wrap-program viewnior
567 ;; Wrap GDK_PIXBUF_MODULE_FILE so viewnior can be used
568 ;; to view JPG, PNG and SVG, without the user needing
569 ;; to install gdk-pixbuf or librsvg.
570 `("GDK_PIXBUF_MODULE_FILE" =
571 (,(getenv "GDK_PIXBUF_MODULE_FILE"))))))))
572 #:tests? #f)) ;no tests
573 (native-inputs
574 (list gettext-minimal
575 `(,glib "bin") ;glib-genmarshal
576 pkg-config
577 shared-mime-info))
578 (inputs
579 (list exiv2-0.27
580 gdk-pixbuf
581 gtk+-2
582 webp-pixbuf-loader))
583 (home-page "https://siyanpanayotov.com/project/viewnior")
584 (synopsis "Simple, fast and elegant image viewer")
585 (description "Viewnior is an image viewer program. Created to be simple,
586fast and elegant. Its minimalistic interface provides more screenspace for
587your images. Among its features are:
588@enumerate
589@item Fullscreen & Slideshow
590@item Rotate, flip, crop, save, delete images
591@item Animation support
592@item Browse only selected images
593@item Navigation window
594@item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
595@item Simple interface
596@item EXIF and IPTC metadata
597@item Configurable mouse actions
598@end enumerate\n")
599 (license license:gpl3+)))
600
601(define-public catimg
602 (package
603 (name "catimg")
604 (version "2.7.0")
605 (source
606 (origin
607 (method git-fetch)
608 (uri (git-reference
609 (url "https://github.com/posva/catimg")
610 (commit version)))
611 (file-name (git-file-name name version))
612 (sha256
613 (base32 "0a2dswbv4xddb2l2d55hc43lzvjwrjs5z9am7v6i0p0mi2fmc89s"))))
614 (build-system cmake-build-system)
615 (arguments
616 `(#:tests? #f ; no tests
617 #:configure-flags
618 ;; Fix compilation with gcc-14
619 '("-DCMAKE_C_FLAGS=-D_DEFAULT_SOURCE")
620 #:phases
621 (modify-phases %standard-phases
622 (add-after 'unpack 'patch-convert
623 (lambda _
624 (substitute* "catimg"
625 ;; By replacing "convert", we also replace the "convert"
626 ;; in the message 'The version of convert is too old, don't
627 ;; expect good results :('. This should not happen, but in
628 ;; practice this error message should not affect us.
629 (("convert") (which "convert")))
630 #t))
631 (add-after 'install 'install-script
632 (lambda* (#:key outputs #:allow-other-keys)
633 ;; The bash script lacks an file extension. We have to rename
634 ;; it so that the C program and the bash script can be happy
635 ;; side by side.
636 (copy-file "../source/catimg"
637 (string-append (assoc-ref outputs "out")
638 "/bin/catimg.sh"))
639 #t)))))
640 (inputs
641 (list imagemagick)) ; for the bash script version
642 (home-page "https://github.com/posva/catimg")
643 (synopsis "Render images in the terminal")
644 (description
645 "Catimg is a little program that prints images in the terminal.
646It supports JPEG, PNG and GIF formats.")
647 (license license:expat)))
648
649(define-public pixterm
650 (package
651 (name "pixterm")
652 (version "1.3.2")
653 (source (origin
654 (method git-fetch)
655 (uri (git-reference
656 (url "https://github.com/eliukblau/pixterm")
657 (commit (string-append "v" version))))
658 (file-name (git-file-name name version))
659 (sha256
660 (base32
661 "08x0pwnl3cyq5f29fxj379p9klzxl85p8jq2595xdz3mhb3pkgsg"))))
662 (build-system go-build-system)
663 (arguments
664 '(#:install-source? #f
665 #:import-path "github.com/eliukblau/pixterm/cmd/pixterm"
666 #:unpack-path "github.com/eliukblau/pixterm"))
667 (inputs (list go-github-com-disintegration-imaging
668 go-github-com-lucasb-eyer-go-colorful
669 go-golang-org-x-image
670 go-golang-org-x-term))
671 (home-page "https://github.com/eliukblau/pixterm")
672 (synopsis "Draw images in your ANSI terminal with true color")
673 (description "PIXterm shows images directly in your terminal, recreating
674the pixels through a combination of ANSI character background color and the
675unicode lower half block element. It supports JPEG, PNG, GIF, BMP, TIFF
676and WebP.")
677 (license license:mpl2.0)))
678
679;; CBR and RAR are currently unsupported, due to non-free dependencies.
680(define-public mcomix
681 (package
682 (name "mcomix")
683 (version "3.1.1")
684 (source
685 (origin
686 (method url-fetch)
687 (uri (string-append "mirror://sourceforge/mcomix/MComix-" version "/"
688 "mcomix-" version ".tar.gz"))
689 (sha256
690 (base32
691 "1y6fps1fbzjc4sdm381432zvrq97iadbz4yyxxsfnzf0ggnsl2m1"))))
692 (build-system pyproject-build-system)
693 (arguments
694 (list
695 #:imported-modules `(,@%pyproject-build-system-modules
696 (guix build glib-or-gtk-build-system))
697 #:modules '((guix build pyproject-build-system)
698 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
699 (guix build utils))
700 #:tests? #f ;no tests
701 #:phases
702 #~(modify-phases %standard-phases
703 (add-after 'unpack 'patch-source
704 (lambda* (#:key inputs #:allow-other-keys)
705 (substitute* "mcomix/archive/sevenzip_external.py"
706 ;; Ensure that 7z is found by hardcoding its absolute path.
707 (("_7z_executable = -1")
708 (format #f "_7z_executable = ~s"
709 (search-input-file inputs "/bin/7z"))))
710 (substitute* "mcomix/image_tools.py"
711 (("assert name not in supported_formats_gdk")
712 "if name in supported_formats_gdk: continue"))))
713 (add-after 'install 'install-data
714 (lambda* (#:key inputs outputs #:allow-other-keys)
715 (with-directory-excursion "mcomix"
716 (for-each
717 (lambda (subdir)
718 (copy-recursively
719 subdir
720 (string-append
721 (site-packages inputs outputs)
722 "/mcomix/" subdir)))
723 '("images" "messages")))))
724 (add-after 'install 'glib-or-gtk-compile-schemas
725 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
726 (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
727 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
728 (add-after 'wrap 'gi-wrap
729 (lambda _
730 (let ((prog (string-append #$output "/bin/mcomix")))
731 (wrap-program prog
732 `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH"))))))))))
733 (native-inputs (list python-setuptools))
734 (inputs (list bash-minimal
735 gobject-introspection
736 gtk+
737 p7zip
738 python
739 python-pillow
740 python-pycairo
741 python-pygobject))
742 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
743 (synopsis "Image viewer for comics")
744 (description "MComix is a customizable image viewer that specializes as
745a comic and manga reader. It supports a variety of container formats
746including CBZ, CB7, CBT, LHA.
747
748For PDF support, install the @emph{mupdf} package.")
749 (license license:gpl2+)))
750
751(define-public qpageview
752 (package
753 (name "qpageview")
754 (version "1.0.5")
755 (source (origin
756 (method git-fetch)
757 (uri (git-reference
758 (url "https://github.com/frescobaldi/qpageview")
759 (commit (string-append "v" version))))
760 (file-name (git-file-name name version))
761 (sha256
762 (base32
763 "0n3qn9n1xmsv9h6s7ddxc1w5r36pjsc8ws0kh52c3ya3jvgnnxm1"))))
764 (build-system pyproject-build-system)
765 (arguments
766 (list #:tests? #f)) ;no tests in repository.
767 (home-page "https://qpageview.org/")
768 (synopsis "Page based document viewer widget for Qt/PyQt")
769 (inputs
770 (list python-pyqt-6 qtbase))
771 (native-inputs (list python-hatchling))
772 (description
773 "@code{qpageview} provides a page based document viewer widget for Qt
774and PyQt. It has a flexible architecture potentionally supporting many
775formats. Currently, it supports SVG documents, images, and, using the
776Poppler-Qt5 binding, PDF documents.")
777 (license license:gpl3+)))
778
779(define-public qview
780 (package
781 (name "qview")
782 (version "7.1")
783 (source
784 (origin
785 (method git-fetch)
786 (uri (git-reference
787 (url "https://github.com/jurplel/qView")
788 (commit version)))
789 (file-name (git-file-name name version))
790 (sha256
791 (base32 "1lpjajgdckjh3a0xs6iqpjfg0p1nhjxy8l7iddbvf110jz0f3i8i"))))
792 (build-system qt-build-system)
793 (arguments
794 (list
795 #:qtbase qtbase
796 #:tests? #f ; test code doesn't compile
797 #:modules '((guix build qt-build-system)
798 ((guix build gnu-build-system) #:prefix gnu:)
799 (guix build utils))
800 #:phases
801 #~(modify-phases %standard-phases
802 (replace 'configure
803 (lambda* (#:key inputs outputs #:allow-other-keys)
804 (invoke "qmake" (string-append "PREFIX=" #$output))
805 (substitute* "Makefile"
806 (("[[:graph:]]+/bin/lrelease")
807 (search-input-file inputs "/bin/lrelease")))))
808 ;; Don't phone home or show "Checking for updates..." in the About
809 ;; menu.
810 (add-before 'build 'disable-auto-update
811 (lambda _
812 (substitute* "src/qvaboutdialog.cpp"
813 (("qvApp->checkUpdates\\(\\);") "")
814 (("updateText\\(\\);") ""))))
815 (replace 'build (assoc-ref gnu:%standard-phases 'build))
816 (replace 'install (assoc-ref gnu:%standard-phases 'install)))))
817 (native-inputs
818 (list qttools))
819 (inputs
820 (list qtbase qtimageformats qtsvg qtwayland))
821 (home-page "https://interversehq.com/qview/")
822 (synopsis "Convenient and minimal image viewer")
823 (description "qView is a Qt image viewer designed with visually
824minimalism and usability in mind. Its features include animated GIF
825controls, file history, rotation/mirroring, and multithreaded
826preloading.")
827 (license license:gpl3+)))
828
829(define-public chafa
830 (package
831 (name "chafa")
832 (version "1.18.0")
833 (source (origin
834 (method url-fetch)
835 (uri (string-append "https://hpjansson.org/chafa/releases/chafa-"
836 version ".tar.xz"))
837 (sha256
838 (base32
839 "1nyakydm8f4kshhdqg35ckfa62nxk54i41npva4jw15q3927ax6d"))))
840 (build-system gnu-build-system)
841 (native-inputs
842 (list pkg-config which))
843 (inputs
844 (list freetype libjpeg-turbo librsvg libtiff libwebp glib imagemagick))
845 (synopsis "Convert images to ANSI/Unicode characters")
846 (description
847 "Chafa is a command-line utility that converts all kinds of images,
848including animated GIFs, into ANSI/Unicode character output that can be
849displayed in a terminal.")
850 (home-page "https://hpjansson.org/chafa/")
851 (license license:lgpl3+)))
852
853(define-public imv
854 (package
855 (name "imv")
856 (version "5.0.1")
857 (source (origin
858 (method git-fetch)
859 (uri (git-reference
860 (url "https://git.sr.ht/~exec64/imv")
861 (commit (string-append "v" version))))
862 (sha256
863 (base32
864 "0fy8kaxi6071j983kb709xsmps8nqg1aa55ach2drdzs33zfr56q"))
865 (file-name (git-file-name name version))))
866 (build-system meson-build-system)
867 (arguments
868 (list #:phases
869 #~(modify-phases %standard-phases
870 (add-after 'install 'record-absolute-file-name
871 (lambda _
872 ;; 'imv-dir' execs 'imv'. Record the absolute file name.
873 (substitute* (string-append #$output "/bin/imv-dir")
874 (("exec imv")
875 (string-append "exec " #$output "/bin/imv"))))))))
876 (native-inputs
877 (list asciidoc
878 cmocka
879 pkg-config))
880 (inputs
881 (list freeimage
882 glu
883 libheif
884 libinih
885 libjpeg-turbo
886 libjxl
887 libnsgif
888 (librsvg-for-system)
889 libtiff
890 libxkbcommon
891 pango
892 wayland
893 wayland-protocols))
894 (synopsis "Image viewer for tiling window managers")
895 (description "@code{imv} is a command line image viewer intended for use
896with tiling window managers. Features include:
897
898@itemize
899@item Native Wayland and X11 support.
900@item Support for dozens of image formats including:
901@itemize
902@item PNG
903@item JPEG
904@item Animated GIFs
905@item SVG
906@item TIFF
907@item Various RAW formats
908@item Photoshop PSD files
909@end itemize
910@item Configurable key bindings and behavior.
911@item Highly scriptable with IPC via imv-msg.
912@end itemize\n")
913 (home-page "https://git.sr.ht/~exec64/imv/")
914 (license license:expat)))
915
916(define-public qiv
917 (package
918 (name "qiv")
919 (version "2.3.3")
920 (source
921 (origin
922 (method url-fetch)
923 (uri (string-append "http://spiegl.de/qiv/download/qiv-"
924 version ".tgz"))
925 (sha256
926 (base32 "011pad6gvmpphiv85yq820w3m79m3spfafarcsrhb2ylwbymy27g"))
927 (modules '((guix build utils)))
928 (snippet
929 '(begin
930 ;; Fix a typo. This can probably be removed on the next update.
931 (substitute* "Makefile"
932 (("\\$\\(PREFIX\\)/man")
933 "$(PREFIX)/share/man"))))))
934 (build-system gnu-build-system)
935 (native-inputs
936 (list pkg-config
937 ;; That is required for testing.
938 xorg-server-for-tests))
939 (inputs
940 (list imlib2
941 glib
942 gtk+-2
943 lcms
944 libjpeg-turbo
945 libtiff
946 libexif
947 libx11
948 libxext))
949 (arguments
950 `(#:phases
951 (modify-phases %standard-phases
952 (delete 'configure) ; no configure script
953 (add-before 'install 'patch-file-start-xserver
954 (lambda* (#:key inputs #:allow-other-keys)
955 ;; patch the file so that qiv runs and exits by itself
956 (substitute* "Makefile"
957 (("./qiv -f ./intro.jpg") "./qiv -f -C -s ./intro.jpg")
958 ;; Fail the build when test fails.
959 (("echo \"-- Test Failed --\"")
960 "(echo \"-- Test Failed --\" ; false)"))
961 ;; There must be a running X server and make install doesn't start one.
962 ;; Therefore we must do it.
963 (system "Xvfb :1 &")
964 (setenv "DISPLAY" ":1"))))
965 #:tests? #f ; there is no check target
966 #:make-flags
967 (list
968 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
969 (home-page "https://spiegl.de/qiv/")
970 (synopsis "Graphical image viewer for X")
971 (description
972 "Quick Image Viewer is a small and fast GDK/Imlib2 image viewer.
973Features include zoom, maxpect, scale down, fullscreen, slideshow, delete,
974brightness/contrast/gamma correction, pan with keyboard and mouse, flip,
975rotate left/right, jump/forward/backward images, filename filter and use it
976to set X desktop background.")
977 (license license:gpl2)))
978
979(define-public pqiv
980 (package
981 (name "pqiv")
982 (version "2.13.2")
983 (source
984 (origin
985 (method git-fetch)
986 (uri (git-reference
987 (url "https://github.com/phillipberndt/pqiv")
988 (commit version)))
989 (file-name (git-file-name name version))
990 (sha256
991 (base32 "1yic98a5j77vkc31qpyyikfgpv1gq36ymqdpc3q4gc5zdmw3r4y2"))))
992 (build-system gnu-build-system)
993 (native-inputs
994 (list pkg-config))
995 (inputs
996 (list ffmpeg
997 gtk+
998 imagemagick
999 libarchive
1000 libspectre
1001 libwebp
1002 poppler))
1003 (arguments
1004 `(#:tests? #f ;no tests
1005 #:phases
1006 (modify-phases %standard-phases
1007 (delete 'configure)) ;no configure script
1008 #:make-flags
1009 (list
1010 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1011 (string-append "CC=" ,(cc-for-target))
1012 (string-append "PKG_CONFIG=" ,(pkg-config-for-target)))))
1013 (home-page "https://www.pberndt.com/Programme/Linux/pqiv")
1014 (synopsis "Powerful image viewer with minimal UI")
1015 (description
1016 "pqiv is a GTK-3 based command-line image viewer with a minimal UI.
1017It is highly customizable, can be fully controlled from scripts, and has
1018support for various file formats including PDF, Postscript, video files and
1019archives.")
1020 (license license:gpl3+)))
1021
1022(define-public nomacs
1023 (package
1024 (name "nomacs")
1025 (version "3.22.0")
1026 (source
1027 (origin
1028 (method git-fetch)
1029 (uri (git-reference
1030 (url "https://github.com/nomacs/nomacs")
1031 (commit version)))
1032 (file-name (git-file-name name version))
1033 (sha256
1034 (base32
1035 "1ps68xxdqz9r7w5cpicj461x06w0p6r54x1cbk38idl0vlrq65ya"))))
1036 (build-system cmake-build-system)
1037 (arguments
1038 `(#:build-type "Release" ; fails to build with debug info
1039 #:configure-flags (list "-DENABLE_TRANSLATIONS=true"
1040 "-DUSE_SYSTEM_QUAZIP=true"
1041 "-DENABLE_QUAZIP=true"
1042 "-DENABLE_OPENCV=true")
1043 #:phases
1044 (modify-phases %standard-phases
1045 (add-after 'unpack 'cd-to-source-dir
1046 (lambda _ (chdir "ImageLounge")))
1047 (replace 'check
1048 (lambda* (#:key tests? #:allow-other-keys)
1049 (when tests? (invoke "make" "check")))))))
1050 (inputs
1051 (list
1052 exiv2
1053 libraw
1054 libtiff
1055 opencv
1056 quazip
1057 qt5compat
1058 qtbase
1059 qtimageformats
1060 qtsvg))
1061 (native-inputs (list googletest pkg-config qttools))
1062 (synopsis "Image viewer supporting all common formats")
1063 (description "Nomacs is a simple to use image lounge featuring
1064semi-transparent widgets that display additional information such as metadata,
1065thumbnails and histograms. It is able to browse images compressed archives
1066and add notes to images.
1067
1068Nomacs includes image manipulation methods for adjusting brightness, contrast,
1069saturation, hue, gamma, and exposure. It has a pseudo color function which
1070allows creating false color images. A unique feature of Nomacs is the
1071synchronization of multiple instances.")
1072 (home-page "https://nomacs.org/")
1073 (license license:gpl3+)))
1074
1075(define-public timg
1076 (package
1077 (name "timg")
1078 (version "1.6.3")
1079 (source
1080 (origin
1081 (method git-fetch)
1082 (uri (git-reference
1083 (url "https://github.com/hzeller/timg")
1084 (commit (string-append "v" version))))
1085 (file-name (git-file-name name version))
1086 (sha256
1087 (base32 "0xr3g6my2n9ry5mqiw1qvf7m0lpmj20h2xsnh75653ha83wqxmhm"))
1088 (modules '((guix build utils)))
1089 (snippet
1090 ;; Remove bundled sources
1091 #~(begin
1092 (delete-file-recursively "third_party") #t))))
1093 (build-system cmake-build-system)
1094 (arguments
1095 (list
1096 #:configure-flags
1097 #~'("-Wno-dev" "-DWITH_OPENSLIDE_SUPPORT=ON")
1098 #:phases
1099 #~(modify-phases %standard-phases
1100 (add-before 'configure 'fix-stb-path
1101 ;; This package expects stb-image to be at stb/stb_image.h, but
1102 ;; Guix puts it at stb_image.h instead
1103 (lambda _
1104 (substitute* "src/CMakeLists.txt"
1105 (("stb/stb")
1106 "stb"))
1107 (substitute* "src/stb-image-source.cc"
1108 (("#include \"stb/stb_image.h\"")
1109 "#include \"stb_image.h\"")))))
1110 #:tests? #f)) ;No tests
1111 (inputs (list cairo
1112 ffmpeg
1113 graphicsmagick
1114 libdeflate
1115 libdicom
1116 libexif
1117 libjpeg-turbo
1118 librsvg
1119 libsixel
1120 libxml2
1121 openjpeg
1122 openslide
1123 poppler
1124 qoi
1125 sqlite
1126 stb-image))
1127 (native-inputs (list git pandoc pkg-config))
1128 (home-page "https://timg.sh/")
1129 (synopsis "Terminal image and video viewer")
1130 (description
1131 "This package provides a user-friendly terminal image viewer that uses
1132graphic capabilities of terminals (Sixel, Kitty or iterm2), or 24-Bit color
1133capabilities and unicode character blocks if these are not available.")
1134 (license license:gpl2)))
1135
1136(define-public xzgv
1137 (package
1138 (name "xzgv")
1139 (version "0.9.2")
1140 (source
1141 (origin
1142 (method url-fetch)
1143 (uri (string-append "mirror://sourceforge/xzgv/"
1144 version "/xzgv-" version ".tar.gz"))
1145 (sha256
1146 (base32 "17l1xr9v07ggwga3vn0z1i4lnwjrr20rr8z1kjbw71aaijxl18i5"))))
1147 (build-system gnu-build-system)
1148 (arguments
1149 `(#:phases
1150 (modify-phases %standard-phases
1151 (add-after 'unpack 'override-target-directory
1152 (lambda* (#:key outputs #:allow-other-keys)
1153 (substitute* "config.mk"
1154 (("/usr/local") (assoc-ref outputs "out")))))
1155 (delete 'configure) ; no configure script
1156 (replace 'install
1157 (lambda* (#:key outputs #:allow-other-keys)
1158 (let* ((out (assoc-ref outputs "out"))
1159 (bin (string-append out "/bin")))
1160 (install-file "src/xzgv" bin))))) ; just install the executable
1161 #:tests? #f)) ; no rule for target 'test'
1162 (native-inputs
1163 (list pkg-config))
1164 (inputs
1165 (list gtk+-2 libexif))
1166 (home-page "https://sourceforge.net/projects/xzgv/")
1167 (synopsis "Picture viewer for X with a thumbnail-based selector")
1168 (description
1169 "xzgv is a fast image viewer that provides extensive keyboard support.")
1170 (license license:gpl2+)))
1171
1172(define-public hydrus-network
1173 (package
1174 (name "hydrus-network")
1175 (version "659") ;upstream has a weekly release cycle
1176 (source
1177 (origin
1178 (method git-fetch)
1179 (uri (git-reference
1180 (url "https://github.com/hydrusnetwork/hydrus")
1181 (commit (string-append "v" version))))
1182 (file-name (git-file-name name version))
1183 (sha256
1184 (base32
1185 "0wvrq747hxdjyfz3nqxf5qyhx7fqz21l94az0f8vvshcqaf51dls"))))
1186 (build-system pyproject-build-system)
1187 (arguments
1188 (list
1189 #:phases
1190 #~(modify-phases %standard-phases
1191 ;; Hydrus is a python program but does not use setup.py or any
1192 ;; other build system to build itself - it's delivered ready to
1193 ;; run from the source.
1194 (replace 'check
1195 (lambda _
1196 (setenv "DISPLAY" ":0")
1197 (setenv "XDG_CACHE_HOME" (getcwd))
1198 (setenv "HOME" (getcwd))
1199 (invoke "xvfb-run" "python" "hydrus_test.py")))
1200 ;; XXX: program help files are not built. Updating
1201 ;; python-pymdown-extensions to its latest version might be the
1202 ;; solution, but this would require also packaging its new build
1203 ;; system that is not present in guix yet.
1204 (delete 'build)
1205 (replace 'install
1206 (lambda _
1207 (let*
1208 ((bin (string-append #$output "/bin"))
1209 (lib (string-append
1210 #$output "/lib/python"
1211 (python-version #$(this-package-input "python"))
1212 "/site-packages"))
1213 (client (string-append bin "/hydrus"))
1214 (server (string-append bin "/hydrus-server")))
1215 (copy-recursively "static" (string-append lib "/static"))
1216 (copy-recursively "hydrus" (string-append lib "/hydrus"))
1217 (mkdir bin)
1218 (copy-file "hydrus_client.py" client)
1219 (chmod client #o555)
1220 (copy-file "hydrus_server.py" server)
1221 (chmod server #o555)))))))
1222 ;; All native-inputs are only needed for the the check phase
1223 (native-inputs (list xvfb-run python-mock python-httmock python-pynose))
1224 ;; All python packages were taken from static/build_files/linux/requirements.txt
1225 (propagated-inputs
1226 (list python-beautifulsoup4
1227 python-cbor2
1228 python-chardet
1229 python-dateparser
1230 python-html5lib
1231 python-lxml
1232 python-lz4
1233 python-numpy
1234 ;; its python bindings are a drop-in replacement
1235 ;; for opencv-python-headless
1236 opencv
1237 python-pillow
1238 python-psutil
1239 python-pyopenssl
1240 python-pyside-6
1241 python-pysocks
1242 python-mpv
1243 python-pyyaml
1244 python-qtpy
1245 python-requests
1246 python-send2trash
1247 python-service-identity
1248 python-twisted))
1249 (inputs (list ffmpeg miniupnpc python))
1250 (synopsis "Organize your media with tags like a dektop booru")
1251 (description
1252 "The hydrus network client is an application written for
1253internet-fluent media nerds who have large image/swf/webm collections.
1254It browses with tags instead of folders, a little like a booru on your desktop.
1255Advanced users can share tags and files anonymously through custom servers that
1256any user may run. Everything is free and privacy is the first concern.")
1257 (home-page "https://hydrusnetwork.github.io/hydrus/")
1258 (license license:wtfpl2)))
1259
1260(define-public ueberzug
1261 (package
1262 (name "ueberzug")
1263 (version "18.3.1")
1264 (source
1265 (origin
1266 (method url-fetch)
1267 (uri (pypi-uri "ueberzug" version))
1268 (sha256
1269 (base32
1270 "1sc05s72gvglsxsw4p0z5h47ygygw5h226vnaakas4ihjq9kiffl"))))
1271 (build-system meson-build-system)
1272 (arguments
1273 (list #:tests? #f)) ; there are no tests
1274 (native-inputs
1275 (list pkg-config))
1276 (inputs
1277 (list libx11 libxext libxres))
1278 (propagated-inputs
1279 (list python-attrs python-docopt python-pillow))
1280 (home-page "https://github.com/ueber-devel/ueberzug/")
1281 (synopsis "Command line util to display images in combination with X11")
1282 (description "Überzug is a command line util which draws images on
1283terminals by using child windows. The advantages of using Überzug are:
1284@itemize
1285@item No race conditions as a new window is created to display images.
1286@item Expose events will be processed, so images will be redrawn on switch
1287workspaces.
1288@item Tmux support (excluding multi pane windows).
1289@item Terminals without the WINDOWID environment variable are supported.
1290@item Chars are used as position - and size unit.
1291@item No memory leak (/ unlimited cache).
1292@end itemize")
1293 (license license:gpl3+)))
1294
1295(define-public ueberzugpp
1296 (package
1297 (name "ueberzugpp")
1298 (version "2.9.10")
1299 (source
1300 (origin
1301 (method git-fetch)
1302 (uri (git-reference
1303 (url "https://github.com/jstkdng/ueberzugpp")
1304 (commit (string-append "v" version))))
1305 (file-name (git-file-name name version))
1306 (sha256
1307 (base32 "1jac2sca4pmcxp8xcvaxhf6j15phyc85gb5n9ymajbahnd4hbcv2"))))
1308 (build-system cmake-build-system)
1309 (arguments
1310 (list #:tests? #f ; no tests
1311 #:configure-flags
1312 #~(list "-DENABLE_OPENCV=ON"
1313 "-DENABLE_X11=ON"
1314 "-DENABLE_WAYLAND=ON")))
1315 (native-inputs
1316 (list extra-cmake-modules
1317 gobject-introspection
1318 pkg-config))
1319 (inputs
1320 (list cairo
1321 chafa
1322 cli11
1323 expat
1324 fftw
1325 fmt-12
1326 imagemagick
1327 imath
1328 lcms
1329 libexif
1330 libgsf
1331 librsvg
1332 libsixel
1333 libwebp
1334 libxcb
1335 matio
1336 nlohmann-json
1337 onetbb
1338 opencv
1339 openexr
1340 openssl
1341 orc
1342 pango
1343 poppler
1344 range-v3
1345 spdlog
1346 vips
1347 wayland
1348 wayland-protocols
1349 xcb-util-image))
1350 (home-page "https://github.com/jstkdng/ueberzugpp")
1351 (synopsis "Drop in replacement for ueberzug written in C++")
1352 (description "Überzug++ is a command line utility written in C++ which
1353allows to draw images on terminals by using X11/Wayland child windows, sixels,
1354 kitty and iterm2.
1355
1356Advantages over @command{w3mimgdisplay}:
1357@itemize
1358@item Support for Wayland: Sway, Hyprland, niri and Wayfire
1359@item No race conditions as a new window is created to display images
1360@item Expose events will be processed, so images will be redrawn on switch
1361workspaces
1362@item Tmux support on X11, Sway and Hyprland
1363@item Terminals without the @env{WINDOWID} environment variable are supported
1364@item Chars are used as position - and size unit
1365@item No memory leak (usage of smart pointers)
1366@item A lot of image formats supported (through OpenCV and libvips).
1367@item GIF and animated WEBP support on X11, Sixel, Sway and hyprland
1368@item Fast image downscaling (through OpenCV and OpenCL)
1369@item Cache resized images for faster viewing
1370@end itemize")
1371 (license license:gpl3)))
1372
1373(define-public vv
1374 (package
1375 (name "vv")
1376 (version "3.2")
1377 (source (origin
1378 (method git-fetch)
1379 (uri (git-reference
1380 (url "https://github.com/wolfpld/vv.git")
1381 (commit (string-append "v" version))))
1382 (file-name (git-file-name name version))
1383 (sha256
1384 (base32
1385 "06vdckkczfp9yzyk6zi4jmq7q8mzs1nvyx2j13b1f1mx7sr63mii"))))
1386 (build-system cmake-build-system)
1387 (arguments
1388 (list #:tests? #f ; no tests.
1389 #:configure-flags
1390 #~ (list "-DMARCH_NATIVE=OFF"
1391 "-DCMAKE_BUILD_TYPE=Release"
1392 "-DCPM_USE_LOCAL_PACKAGES=ON"
1393 "-DCPM_LOCAL_PACKAGES_ONLY=ON"
1394 (string-append "-DCPM_stb_SOURCE="
1395 #$stb-image-resize2
1396 "/include")
1397 (string-append "-DCPM_tracy_SOURCE="
1398 #$(package-source tracy-wayland))
1399 "-DCMAKE_CXX_STANDARD=20"
1400 "-DCMAKE_CXX_STANDARD_REQUIRED=ON")
1401 #:phases
1402 #~(modify-phases %standard-phases
1403 (add-after 'unpack 'patch-dependencies
1404 (lambda* (#:key inputs #:allow-other-keys)
1405 (substitute* "src/image/vector/PdfImage.cpp"
1406 (("\"libpoppler-glib.so\"")
1407 (string-append "\""
1408 (assoc-ref inputs "poppler")
1409 "/lib/libpoppler-glib.so"
1410 "\"")))))
1411 (replace 'install
1412 (lambda _
1413 ;; The provided installer doesn't have:
1414 ;; install(TARGETS vv DESTINATION bin)
1415 ;; So nothing would have been installed.
1416 (install-file "vv" (string-append #$output "/bin")))))))
1417 (native-inputs
1418 (list pkg-config))
1419 (inputs
1420 (list aklomp-base64
1421 cairo
1422 lcms
1423 libexif
1424 libheif
1425 libjpeg-turbo
1426 libjxl
1427 libpng
1428 libraw
1429 librsvg
1430 libsixel
1431 libtiff
1432 libwebp
1433 lz4
1434 openexr
1435 poppler
1436 pugixml
1437 stb-image
1438 zlib))
1439 (synopsis "Image viewer for the terminal")
1440 (description "This package provides a color-correct image viewer for the
1441terminal. Your terminal should support the Kitty Graphics protocol. If it
1442doesn't, it should support the Sixel protocol.")
1443 (properties `((tunable? . #t)))
1444 (home-page "https://wolf.nereid.pl/posts/image-viewer/")
1445 ;; Author tried to make it BSD-3--but it uses a GPL library (poppler)
1446 (license license:gpl2+)))
1447
1448(define-public lsix
1449 (package
1450 (name "lsix")
1451 (version "1.9.1")
1452 (source
1453 (origin
1454 (method git-fetch)
1455 (uri (git-reference
1456 (url "https://github.com/hackerb9/lsix")
1457 (commit version)))
1458 (file-name (git-file-name name version))
1459 (sha256
1460 (base32 "1w4wgnkvvirpgxy00jlpw7p1pcflnwy3rwk5zwh4pkk3igpcdi4s"))))
1461 (build-system copy-build-system)
1462 (arguments
1463 '(#:install-plan '(("lsix" "bin/"))))
1464 (propagated-inputs (list imagemagick))
1465 (home-page "https://github.com/hackerb9/lsix")
1466 (synopsis "Show image thumbnails in the terminal")
1467 (description
1468 "@command{lsix} lists the images in a directory by displaying their thumbnails.
1469Images are displayed in sixel graphics. @command{lsix} automatically detects
1470terminal features and adapts the output to offer the highest quality possible.
1471It can usually display non-bitmap graphics, including PDF. Your terminal should
1472be sixel capable, like @command{xterm -ti vt340}.")
1473 (license license:gpl3+)))