1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
4 ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
5 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
7 ;;; Copyright © 2017 Nikita <nikita@n0.is>
8 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
9 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
10 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
13 ;;; Copyright © 2019, 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
14 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
15 ;;; Copyright © 2020 Peng Mei Yu <pengmeiyu@riseup.net>
16 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
17 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages image-viewers)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix packages)
39 #:use-module (guix utils)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system meson)
43 #:use-module (guix build-system python)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages algebra)
46 #:use-module (gnu packages boost)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages curl)
50 #:use-module (gnu packages documentation)
51 #:use-module (gnu packages fontutils)
52 #:use-module (gnu packages freedesktop)
53 #:use-module (gnu packages gettext)
54 #:use-module (gnu packages ghostscript)
55 #:use-module (gnu packages gl)
56 #:use-module (gnu packages glib)
57 #:use-module (gnu packages gnome)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages graphics)
60 #:use-module (gnu packages image)
61 #:use-module (gnu packages imagemagick)
62 #:use-module (gnu packages maths)
63 #:use-module (gnu packages perl)
64 #:use-module (gnu packages perl-check)
65 #:use-module (gnu packages photo)
66 #:use-module (gnu packages pkg-config)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages python-xyz)
69 #:use-module (gnu packages qt)
70 #:use-module (gnu packages xdisorg)
71 #:use-module (gnu packages xorg)
72 #:use-module (gnu packages))
78 (home-page "https://feh.finalrewind.org/")
81 (uri (string-append home-page
82 name "-" version ".tar.bz2"))
85 "07jklibpi4ig9pbdrwhllsfffxn2h8xf4ma36qii00w4hb69v3rq"))))
86 (build-system gnu-build-system)
88 '(#:phases (modify-phases %standard-phases (delete 'configure))
91 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))
96 ("perl-test-command" ,perl-test-command)))
97 (inputs `(("imlib2" ,imlib2)
103 ("libxinerama" ,libxinerama)))
105 ;; Feh allows overriding the libcurl builtin CA path (unset in Guix)
106 ;; with the same variable as the `curl` command line HTTP tool.
107 (package-native-search-paths curl))
108 (synopsis "Fast and light imlib2-based image viewer")
110 "feh is an X11 image viewer aimed mostly at console users.
111 Unlike most other viewers, it does not have a fancy GUI, but simply
112 displays images. It can also be used to set the desktop wallpaper.
113 It is controlled via commandline arguments and configurable key/mouse
116 ;; The license is really the Expat license, with additional wording in the
117 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
118 ;; software packages that this Software was used."
119 (license (license:x11-style
121 "See 'COPYING' in the distribution."))))
123 (define-public geeqie
130 (url "https://github.com/BestImageViewer/geeqie")
131 (commit (string-append "v" version))))
134 "0nf45sh3pwsv98sppcrqj81b6mdi31n1sbc7gn88m8mhpfp1qq6k"))
135 (file-name (git-file-name name version))))
136 (build-system gnu-build-system)
138 `( ;; Enable support for a "map" pane using GPS data.
139 #:configure-flags '("--enable-map"
142 `(("clutter" ,clutter)
143 ("libchamplain" ,libchamplain)
149 `(("autoconf" ,autoconf)
150 ("automake" ,automake)
151 ("glib" ,glib "bin") ; glib-gettextize
152 ("intltool" ,intltool)
153 ("pkg-config" ,pkg-config)))
154 (home-page "http://www.geeqie.org/")
155 (synopsis "Lightweight GTK+ based image viewer")
157 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
158 systems. It features: EXIF, IPTC and XMP metadata browsing and editing
159 interoperability; easy integration with other software; geeqie works on files
160 and directories, there is no need to import images; fast preview for many raw
161 image formats; tools for image comparison, sorting and managing photo
162 collection. Geeqie was initially based on GQview.")
163 (license license:gpl2+)))
165 (define-public gpicview
171 (uri (string-append "mirror://sourceforge/lxde/"
172 "GPicView%20%28image%20Viewer%29/0.2.x/"
173 name "-" version ".tar.xz"))
176 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
177 (build-system gnu-build-system)
178 (inputs `(("gtk+" ,gtk+-2)
179 ("libjpeg" ,libjpeg-turbo)))
180 (native-inputs `(("intltool" ,intltool)
181 ("pkg-config" ,pkg-config)))
182 (synopsis "Simple and fast image viewer for X")
183 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
184 It is the default image viewer on LXDE desktop environment.")
185 (home-page "http://lxde.sourceforge.net/gpicview/")
186 (license license:gpl2+)))
195 (url "https://github.com/muennich/sxiv")
196 (commit (string-append "v" version))))
197 (file-name (git-file-name name version))
200 "0xaawlfdy7b277m38mgg4423kd7p1ffn0dq4hciqs6ivbb3q9c4f"))))
201 (build-system gnu-build-system)
203 `(#:tests? #f ; no check target
205 (list (string-append "PREFIX=" %output)
206 (string-append "CC=" ,(cc-for-target))
207 ;; Xft.h #includes <ft2build.h> without ‘freetype2/’. The Makefile
208 ;; works around this by hard-coding /usr/include & $PREFIX.
209 (string-append "CPPFLAGS=-I"
210 (assoc-ref %build-inputs "freetype")
211 "/include/freetype2")
214 (modify-phases %standard-phases
215 (delete 'configure) ; no configure script
216 (add-after 'install 'install-desktop-file
217 (lambda* (#:key outputs #:allow-other-keys)
218 (install-file "sxiv.desktop"
219 (string-append (assoc-ref outputs "out")
220 "/share/applications"))
222 (add-after 'install 'install-icons
223 (lambda* (#:key make-flags #:allow-other-keys)
224 (apply invoke "make" "-C" "icon" "install" make-flags))))))
226 `(("freetype" ,freetype)
232 (home-page "https://github.com/muennich/sxiv")
233 (synopsis "Simple X Image Viewer")
235 "sxiv is an alternative to feh and qiv. Its primary goal is to
236 provide the most basic features required for fast image viewing. It has
237 vi key bindings and works nicely with tiling window managers. Its code
238 base should be kept small and clean to make it easy for you to dig into
239 it and customize it for your needs.")
240 (license license:gpl2+)))
242 (define-public viewnior
250 (url "https://github.com/hellosiyan/Viewnior")
251 (commit (string-append name "-" version))))
252 (file-name (git-file-name name version))
255 "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
256 (build-system meson-build-system)
259 (modify-phases %standard-phases
260 (add-after 'unpack 'patch-source
262 ;; Don't create 'icon-theme.cache'
263 (substitute* "meson.build"
264 (("meson.add_install_script*") ""))
266 #:tests? #f)) ; no tests
268 `(("gettext" ,gettext-minimal)
269 ("glib" ,glib "bin") ; glib-genmarshal
270 ("pkg-config" ,pkg-config)
271 ("shared-mime-info" ,shared-mime-info)))
274 ("gdk-pixbuf" ,gdk-pixbuf)
276 (home-page "http://siyanpanayotov.com/project/viewnior")
277 (synopsis "Simple, fast and elegant image viewer")
278 (description "Viewnior is an image viewer program. Created to be simple,
279 fast and elegant. Its minimalistic interface provides more screenspace for
280 your images. Among its features are:
282 @item Fullscreen & Slideshow
283 @item Rotate, flip, crop, save, delete images
284 @item Animation support
285 @item Browse only selected images
286 @item Navigation window
287 @item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
288 @item Simple interface
289 @item EXIF and IPTC metadata
290 @item Configurable mouse actions
292 (license license:gpl3+)))
294 (define-public catimg
302 (url "https://github.com/posva/catimg")
304 (file-name (git-file-name name version))
306 (base32 "0g9ywbgy162wiam9hc3yqpq5q4gyxa8fj4jskr3fdz8z8jjaabzz"))))
307 (build-system cmake-build-system)
309 `(#:tests? #f ; no tests
311 (modify-phases %standard-phases
312 (add-after 'unpack 'patch-convert
314 (substitute* "catimg"
315 ;; By replacing "convert", we also replace the "convert"
316 ;; in the message 'The version of convert is too old, don't
317 ;; expect good results :('. This should not happen, but in
318 ;; practice this error message should not affect us.
319 (("convert") (which "convert")))
321 (add-after 'install 'install-script
322 (lambda* (#:key outputs #:allow-other-keys)
323 ;; The bash script lacks an file extension. We have to rename
324 ;; it so that the C program and the bash script can be happy
326 (copy-file "../source/catimg"
327 (string-append (assoc-ref outputs "out")
331 `(("imagemagick" ,imagemagick))) ; for the bash script version
332 (home-page "https://github.com/posva/catimg")
333 (synopsis "Render images in the terminal")
335 "Catimg is a little program that prints images in the terminal.
336 It supports JPEG, PNG and GIF formats.")
337 (license license:expat)))
339 (define-public luminance-hdr
341 (name "luminance-hdr")
346 "mirror://sourceforge/qtpfsgui/luminance/"
347 version "/luminance-hdr-" version ".tar.bz2"))
350 "188q0l63nfasqfvwbq4mwx2vh7wsfi2bq9n5nksddspl1qz01lnp"))))
351 (build-system cmake-build-system)
353 `(("pkg-config" ,pkg-config)
354 ("qttools" ,qttools)))
357 ("qtdeclarative" ,qtdeclarative)
359 ("qtwebkit" ,qtwebkit)
367 ("libjpeg" ,libjpeg-turbo)
372 ("libtiff" ,libtiff)))
374 '(#:tests? #f ;XXX: some tests fail to compile
376 (modify-phases %standard-phases
377 (add-after 'set-paths 'add-ilmbase-include-path
378 (lambda* (#:key inputs #:allow-other-keys)
379 ;; 'OpenEXR.pc' has a -I for IlmBase but 'FindOpenEXR.cmake' does
380 ;; not use 'OpenEXR.pc'. Thus, we need to add
381 ;; "$ilmbase/include/OpenEXR/" to the CPATH.
383 (string-append (assoc-ref inputs "ilmbase")
385 ":" (or (getenv "CPATH") "")))
387 (home-page "http://qtpfsgui.sourceforge.net")
388 (synopsis "High dynamic range (HDR) imaging application")
390 "Luminance HDR (formerly QtPFSGui) is a graphical user interface
391 application that aims to provide a workflow for high dynamic range (HDR)
392 imaging. It supports several HDR and LDR image formats, and it can:
395 @item Create an HDR file from a set of images (formats: JPEG, TIFF 8bit and
396 16bit, RAW) of the same scene taken at different exposure setting;
397 @item Save load HDR images;
398 @item Rotate, resize and crop HDR images;
399 @item Tone-map HDR images;
400 @item Copy EXIF data between sets of images.
402 (license license:gpl2+)))
404 ;; CBR and RAR are currently unsupported, due to non-free dependencies.
405 (define-public mcomix
406 ;; Official mcomix hasn't been updated since 2016, it's broken with
407 ;; python-pillow 6+ and only supports Python 2. We use fork instead.
408 (let ((commit "fea55a7a9369569eefed72209eed830409c4af98"))
411 (version (git-version "1.2.1" "1" commit))
416 (url "https://github.com/multiSnow/mcomix3")
418 (file-name (git-file-name name version))
421 "05zl0dkjwbdcm2zlk4nz9w33amlqj8pbf32a8ymshc2356fqhhi5"))))
422 (build-system python-build-system)
425 ("python-pillow" ,python-pillow)
426 ("python-pygobject" ,python-pygobject)
427 ("python-pycairo" ,python-pycairo)))
429 `(#:tests? #f ; FIXME: How do we run tests?
431 (modify-phases %standard-phases
432 (add-after 'unpack 'configure
433 (lambda* (#:key inputs #:allow-other-keys)
434 (let ((p7zip (assoc-ref inputs "p7zip")))
435 ;; insert absolute path to 7z executable
436 (substitute* "mcomix/mcomix/archive/sevenzip_external.py"
437 (("_7z_executable = -1")
438 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
441 (lambda* (#:key outputs #:allow-other-keys)
442 (let* ((out (assoc-ref outputs "out"))
443 (pyver ,(version-major+minor (package-version python)))
444 (lib (string-append out "/lib/python" pyver)))
445 (invoke (which "python") "installer.py" "--srcdir=mcomix"
446 (string-append "--target=" lib))
447 (rename-file (string-append lib "/mcomix")
448 (string-append lib "/site-packages"))
451 (lambda* (#:key outputs #:allow-other-keys)
452 (let* ((out (assoc-ref outputs "out"))
453 (share (string-append out "/share"))
454 (bin (string-append out "/bin"))
455 (pyver ,(version-major+minor (package-version python)))
456 (lib (string-append out "/lib/python" pyver "/site-packages")))
458 (rename-file (string-append lib "/mcomixstarter.py")
459 (string-append bin "/mcomix"))
460 (rename-file (string-append lib "/comicthumb.py")
461 (string-append bin "/comicthumb"))
462 (install-file "mime/mcomix.desktop"
463 (string-append share "/applications"))
464 (install-file "mime/mcomix.appdata.xml"
465 (string-append share "/metainfo"))
466 (install-file "mime/mcomix.xml"
467 (string-append share "/mime/packages"))
468 (install-file "mime/comicthumb.thumbnailer"
469 (string-append share "/thumbnailers"))
470 (install-file "man/mcomix.1" (string-append share "/man/man1"))
471 (install-file "man/comicthumb.1" (string-append share "/man/man1"))
475 (format #f "mcomix/mcomix/images/~sx~s/mcomix.png" size size)
476 (format #f "~a/icons/hicolor/~sx~s/apps/" share size size))
480 (format #f "mime/icons/~sx~s/application-x-~a.png" size size ext)
481 (format #f "~a/icons/hicolor/~sx~s/mimetypes/"
483 '("cb7" "cbr" "cbt" "cbz")))
486 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
487 (synopsis "Image viewer for comics")
488 (description "MComix is a customizable image viewer that specializes as
489 a comic and manga reader. It supports a variety of container formats
490 including CBZ, CB7, CBT, LHA.
492 For PDF support, install the @emph{mupdf} package.")
493 (license license:gpl2+))))
503 (url "https://github.com/jurplel/qView")
505 (file-name (git-file-name name version))
507 (base32 "15a91bs3wcqhgf76wzigbn10hayg628j84pq4j2vaxar94ak0vk7"))))
508 (build-system gnu-build-system)
511 (modify-phases %standard-phases
515 ;; Installation process hard-codes "/usr/bin", possibly
517 (add-after 'configure 'fix-install-directory
518 (lambda* (#:key outputs #:allow-other-keys)
519 (let ((out (assoc-ref outputs "out")))
520 (substitute* "Makefile"
521 (("\\$\\(INSTALL_ROOT\\)/usr") out))
523 ;; Don't phone home or show "Checking for updates..." in the
525 (add-before 'build 'disable-auto-update
527 (substitute* "src/qvaboutdialog.cpp"
528 (("ui->updateLabel->setText\\(updateText\\);") "")
529 (("requestUpdates\\(\\);") ""))
534 ("qtimageformats" ,qtimageformats)))
535 (home-page "https://interversehq.com/qview/")
536 (synopsis "Convenient and minimal image viewer")
537 (description "qView is a Qt image viewer designed with visually
538 minimalism and usability in mind. Its features include animated GIF
539 controls, file history, rotation/mirroring, and multithreaded
541 (license license:gpl3+)))
549 (uri (string-append "https://hpjansson.org/chafa/releases/chafa-"
553 "18rb82bfqj1sj2g4irazx4lwq9q4b4k7my1r0q714vf9yhs41ls6"))))
554 (build-system gnu-build-system)
556 `(("pkg-config" ,pkg-config)))
558 `(("freetype" ,freetype)
559 ("libjpeg" ,libjpeg-turbo)
561 ("imagemagick" ,imagemagick)))
562 (synopsis "Convert images to ANSI/Unicode characters")
564 "Chafa is a command-line utility that converts all kinds of images,
565 including animated GIFs, into ANSI/Unicode character output that can be
566 displayed in a terminal.")
567 (home-page "https://hpjansson.org/chafa/")
568 (license license:lgpl3+)))
577 (url "https://github.com/eXeC64/imv")
578 (commit (string-append "v" version))))
581 "0gk8g178i961nn3bls75a8qpv6wvfvav6hd9lxca1skaikd33zdx"))
582 (file-name (git-file-name name version))))
583 (build-system gnu-build-system)
586 (modify-phases %standard-phases
588 (add-after 'install 'record-absolute-file-names
589 (lambda* (#:key outputs #:allow-other-keys)
590 ;; 'imv' is a script that execs 'imv-x11' or 'imv-wayland'.
591 ;; Record their absolute file name.
592 (let* ((out (assoc-ref outputs "out"))
593 (bin (string-append out "/bin")))
594 (substitute* (string-append bin "/imv")
596 (string-append bin "/imv-")))
600 (string-append "PREFIX=" (assoc-ref %outputs "out"))
601 (string-append "CONFIGPREFIX="
602 (assoc-ref %outputs "out") "/etc"))))
604 `(("asciidoc" ,asciidoc)
605 ("freeimage" ,freeimage)
608 ("libxkbcommon" ,libxkbcommon)
610 ("wayland" ,wayland)))
613 ("pkg-config" ,pkg-config)))
614 (synopsis "Image viewer for tiling window managers")
615 (description "@code{imv} is a command line image viewer intended for use
616 with tiling window managers. Features include:
619 @item Native Wayland and X11 support.
620 @item Support for dozens of image formats including:
627 @item Various RAW formats
628 @item Photoshop PSD files
630 @item Configurable key bindings and behavior.
631 @item Highly scriptable with IPC via imv-msg.
633 (home-page "https://github.com/eXeC64/imv")
634 (license license:expat)))
643 (uri (string-append "http://spiegl.de/qiv/download/qiv-"
646 (base32 "1rlf5h67vhj7n1y7jqkm9k115nfnzpwngj3kzqsi2lg676srclv7"))))
647 (build-system gnu-build-system)
649 `(("pkg-config" ,pkg-config)
650 ;; That is required for testing.
651 ("xorg-server" ,xorg-server-for-tests)))
657 ("libjpeg" ,libjpeg-turbo)
661 ("libxext" ,libxext)))
664 (modify-phases %standard-phases
665 (delete 'configure) ; no configure script
666 (add-before 'install 'patch-file-start-xserver
667 (lambda* (#:key inputs #:allow-other-keys)
668 ;; patch the file so that qiv runs and exits by itself
669 (substitute* "Makefile"
670 (("./qiv -f ./intro.jpg") "./qiv -f -C -s ./intro.jpg")
671 ;; Fail the build when test fails.
672 (("echo \"-- Test Failed --\"")
673 "(echo \"-- Test Failed --\" ; false)"))
674 ;; There must be a running X server and make install doesn't start one.
675 ;; Therefore we must do it.
677 (setenv "DISPLAY" ":1")
679 #:tests? #f ; there is no check target
682 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
683 (home-page "http://spiegl.de/qiv/")
684 (synopsis "Graphical image viewer for X")
686 "Quick Image Viewer is a small and fast GDK/Imlib2 image viewer.
687 Features include zoom, maxpect, scale down, fullscreen, slideshow, delete,
688 brightness/contrast/gamma correction, pan with keyboard and mouse, flip,
689 rotate left/right, jump/forward/backward images, filename filter and use it
690 to set X desktop background.")
691 (license license:gpl2)))