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 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
7 ;;; Copyright © 2017 ng0 <ng0@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 Guy Fleury Iteriteka <hoonandon@gmail.com>
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>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages image-viewers)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix packages)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system cmake)
40 #:use-module (guix build-system meson)
41 #:use-module (guix build-system python)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages algebra)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages curl)
48 #:use-module (gnu packages documentation)
49 #:use-module (gnu packages fontutils)
50 #:use-module (gnu packages freedesktop)
51 #:use-module (gnu packages gettext)
52 #:use-module (gnu packages ghostscript)
53 #:use-module (gnu packages gl)
54 #:use-module (gnu packages glib)
55 #:use-module (gnu packages gnome)
56 #:use-module (gnu packages gtk)
57 #:use-module (gnu packages graphics)
58 #:use-module (gnu packages image)
59 #:use-module (gnu packages imagemagick)
60 #:use-module (gnu packages maths)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages perl-check)
63 #:use-module (gnu packages photo)
64 #:use-module (gnu packages pkg-config)
65 #:use-module (gnu packages python)
66 #:use-module (gnu packages python-xyz)
67 #:use-module (gnu packages qt)
68 #:use-module (gnu packages xdisorg)
69 #:use-module (gnu packages xorg)
70 #:use-module (gnu packages))
76 (home-page "https://feh.finalrewind.org/")
79 (uri (string-append home-page
80 name "-" version ".tar.bz2"))
83 "04c8cgwzkax481sz7lbzy23mk79bqmjy3qpvr7vxa4c14mc9k5gk"))))
84 (build-system gnu-build-system)
86 '(#:phases (modify-phases %standard-phases (delete 'configure))
89 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))
93 ("perl-test-command" ,perl-test-command)))
94 (inputs `(("imlib2" ,imlib2)
100 ("libxinerama" ,libxinerama)))
102 ;; Feh allows overriding the libcurl builtin CA path (unset in Guix)
103 ;; with the same variable as the `curl` command line HTTP tool.
104 (package-native-search-paths curl))
105 (synopsis "Fast and light imlib2-based image viewer")
107 "feh is an X11 image viewer aimed mostly at console users.
108 Unlike most other viewers, it does not have a fancy GUI, but simply
109 displays images. It can also be used to set the desktop wallpaper.
110 It is controlled via commandline arguments and configurable key/mouse
113 ;; The license is really the Expat license, with additional wording in the
114 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
115 ;; software packages that this Software was used."
116 (license (license:x11-style
118 "See 'COPYING' in the distribution."))))
120 (define-public geeqie
121 ;; The latest release, 1.4, fails to build with Exiv2 0.27.1. The upstream
122 ;; repo has several fixes for that, so take a snapshot.
123 (let ((commit "c220ddefb1b6b11b54f7598f0d44dd0723325ed4")
127 (version (git-version "1.4" revision commit))
131 (url "https://github.com/BestImageViewer/geeqie")
135 "07424nzrnwbksgalgg1a6ig2snd986w79kca1cfnv1q9kc7x2h3x"))
136 (file-name (git-file-name name version))))
137 (build-system gnu-build-system)
139 `( ;; Enable support for a "map" pane using GPS data.
140 #:configure-flags '("--enable-map")
142 ;; Parallel builds fail with something like:
143 ;; image-load.c:143:9: error: ‘gq_marshal_VOID__INT_INT_INT_INT’ undeclared
144 ;; due to unexpressed makefile dependencies.
148 (modify-phases %standard-phases
149 (add-before 'bootstrap 'pre-bootstrap
151 (define (write-dummy-changelog port)
152 (display "See Git history for a change log.\n" port))
153 ;; Create ChangeLog{,.html} to placate the makefile, which would
154 ;; otherwise require access to the Git repo.
155 (call-with-output-file "ChangeLog"
156 write-dummy-changelog)
157 (call-with-output-file "ChangeLog.html"
158 write-dummy-changelog)
159 (setenv "NOCONFIGURE" "true")
161 ;; Don't try to run 'git' for the version number.
162 (substitute* "configure.ac"
163 (("m4_esyscmd_s\\([^)]+\\)")
164 (string-append "[" ,version "]")))
166 ;; Remove references to non-existent files.
167 (substitute* "po/POTFILES.in"
168 (("^plugins/import/.*") ""))
171 `(("clutter" ,clutter)
172 ("libchamplain" ,libchamplain)
178 `(("autoconf" ,autoconf)
179 ("automake" ,automake)
180 ("glib" ,glib "bin") ; glib-gettextize
181 ("intltool" ,intltool)
182 ("pkg-config" ,pkg-config)))
183 (home-page "http://www.geeqie.org/")
184 (synopsis "Lightweight GTK+ based image viewer")
186 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
187 systems. It features: EXIF, IPTC and XMP metadata browsing and editing
188 interoperability; easy integration with other software; geeqie works on files
189 and directories, there is no need to import images; fast preview for many raw
190 image formats; tools for image comparison, sorting and managing photo
191 collection. Geeqie was initially based on GQview.")
192 (license license:gpl2+))))
194 (define-public gpicview
200 (uri (string-append "mirror://sourceforge/lxde/"
201 "GPicView%20%28image%20Viewer%29/0.2.x/"
202 name "-" version ".tar.xz"))
205 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
206 (build-system gnu-build-system)
207 (inputs `(("gtk+" ,gtk+-2)
208 ("libjpeg" ,libjpeg)))
209 (native-inputs `(("intltool" ,intltool)
210 ("pkg-config" ,pkg-config)))
211 (synopsis "Simple and fast image viewer for X")
212 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
213 It is the default image viewer on LXDE desktop environment.")
214 (home-page "http://lxde.sourceforge.net/gpicview/")
215 (license license:gpl2+)))
224 (url "https://github.com/muennich/sxiv.git")
225 (commit (string-append "v" version))))
226 (file-name (git-file-name name version))
229 "0xaawlfdy7b277m38mgg4423kd7p1ffn0dq4hciqs6ivbb3q9c4f"))))
230 (build-system gnu-build-system)
232 `(#:tests? #f ; no check target
234 (list (string-append "PREFIX=" %output)
236 ;; Xft.h #includes <ft2build.h> without ‘freetype2/’. The Makefile
237 ;; works around this by hard-coding /usr/include & $PREFIX.
238 (string-append "CPPFLAGS=-I"
239 (assoc-ref %build-inputs "freetype")
240 "/include/freetype2")
243 (modify-phases %standard-phases
244 (delete 'configure)))) ; no configure script
246 `(("freetype" ,freetype)
252 (home-page "https://github.com/muennich/sxiv")
253 (synopsis "Simple X Image Viewer")
255 "sxiv is an alternative to feh and qiv. Its primary goal is to
256 provide the most basic features required for fast image viewing. It has
257 vi key bindings and works nicely with tiling window managers. Its code
258 base should be kept small and clean to make it easy for you to dig into
259 it and customize it for your needs.")
260 (license license:gpl2+)))
262 (define-public viewnior
270 (url "https://github.com/hellosiyan/Viewnior.git")
271 (commit (string-append name "-" version))))
272 (file-name (git-file-name name version))
275 "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
276 (build-system meson-build-system)
279 (modify-phases %standard-phases
280 (add-after 'unpack 'patch-source
282 ;; Don't create 'icon-theme.cache'
283 (substitute* "meson.build"
284 (("meson.add_install_script*") ""))
286 #:tests? #f)) ; no tests
288 `(("gettext" ,gettext-minimal)
289 ("glib" ,glib "bin") ; glib-genmarshal
290 ("pkg-config" ,pkg-config)
291 ("shared-mime-info" ,shared-mime-info)))
294 ("gdk-pixbuf" ,gdk-pixbuf)
296 (home-page "http://siyanpanayotov.com/project/viewnior")
297 (synopsis "Simple, fast and elegant image viewer")
298 (description "Viewnior is an image viewer program. Created to be simple,
299 fast and elegant. Its minimalistic interface provides more screenspace for
300 your images. Among its features are:
302 @item Fullscreen & Slideshow
303 @item Rotate, flip, crop, save, delete images
304 @item Animation support
305 @item Browse only selected images
306 @item Navigation window
307 @item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
308 @item Simple interface
309 @item EXIF and IPTC metadata
310 @item Configurable mouse actions
312 (license license:gpl3+)))
314 (define-public catimg
322 (url "https://github.com/posva/catimg.git")
324 (file-name (git-file-name name version))
326 (base32 "0g9ywbgy162wiam9hc3yqpq5q4gyxa8fj4jskr3fdz8z8jjaabzz"))))
327 (build-system cmake-build-system)
329 `(#:tests? #f ; no tests
331 (modify-phases %standard-phases
332 (add-after 'unpack 'patch-convert
334 (substitute* "catimg"
335 ;; By replacing "convert", we also replace the "convert"
336 ;; in the message 'The version of convert is too old, don't
337 ;; expect good results :('. This should not happen, but in
338 ;; practice this error message should not affect us.
339 (("convert") (which "convert")))
341 (add-after 'install 'install-script
342 (lambda* (#:key outputs #:allow-other-keys)
343 ;; The bash script lacks an file extension. We have to rename
344 ;; it so that the C program and the bash script can be happy
346 (copy-file "../source/catimg"
347 (string-append (assoc-ref outputs "out")
351 `(("imagemagick" ,imagemagick))) ; for the bash script version
352 (home-page "https://github.com/posva/catimg")
353 (synopsis "Render images in the terminal")
355 "Catimg is a little program that prints images in the terminal.
356 It supports JPEG, PNG and GIF formats.")
357 (license license:expat)))
359 (define-public luminance-hdr
361 (name "luminance-hdr")
366 "mirror://sourceforge/qtpfsgui/luminance/"
367 version "/luminance-hdr-" version ".tar.bz2"))
370 "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l"))
371 (patches (search-patches "luminance-hdr-qt-printer.patch"))))
372 (build-system cmake-build-system)
374 `(("pkg-config" ,pkg-config)
375 ("qttools" ,qttools)))
378 ("qtdeclarative" ,qtdeclarative)
379 ("qtwebkit" ,qtwebkit)
391 ("libtiff" ,libtiff)))
394 (modify-phases %standard-phases
395 (add-after 'set-paths 'add-ilmbase-include-path
396 (lambda* (#:key inputs #:allow-other-keys)
397 ;; 'OpenEXR.pc' has a -I for IlmBase but 'FindOpenEXR.cmake' does
398 ;; not use 'OpenEXR.pc'. Thus, we need to add
399 ;; "$ilmbase/include/OpenEXR/" to the CPATH.
401 (string-append (assoc-ref inputs "ilmbase")
403 ":" (or (getenv "CPATH") "")))
405 (home-page "http://qtpfsgui.sourceforge.net")
406 (synopsis "High dynamic range (HDR) imaging application")
408 "Luminance HDR (formerly QtPFSGui) is a graphical user interface
409 application that aims to provide a workflow for high dynamic range (HDR)
410 imaging. It supports several HDR and LDR image formats, and it can:
413 @item Create an HDR file from a set of images (formats: JPEG, TIFF 8bit and
414 16bit, RAW) of the same scene taken at different exposure setting;
415 @item Save load HDR images;
416 @item Rotate, resize and crop HDR images;
417 @item Tone-map HDR images;
418 @item Copy EXIF data between sets of images.
420 (license license:gpl2+)))
422 ;; CBR and RAR are currently unsupported, due to non-free dependencies.
423 ;; For optional PDF support, you can install the mupdf package.
424 (define-public mcomix
431 (uri (string-append "mirror://sourceforge/mcomix/MComix-" version
432 "/mcomix-" version ".tar.bz2"))
435 "0fzsf9pklhfs1rzwzj64c0v30b74nk94p93h371rpg45qnfiahvy"))))
436 (build-system python-build-system)
439 ("python2-pillow" ,python2-pillow)
440 ("python2-pygtk" ,python2-pygtk)))
442 ;; Python 2.5 or newer (Python 3 and up is not supported)
444 #:tests? #f ; there are no tests
446 (modify-phases %standard-phases
447 (add-after 'unpack 'configure
448 (lambda* (#:key inputs #:allow-other-keys)
449 (let ((p7zip (assoc-ref inputs "p7zip")))
450 ;; insert absolute path to 7z executable
451 (substitute* "mcomix/archive/sevenzip_external.py"
452 (("_7z_executable = -1")
453 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
455 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
456 (synopsis "Image viewer for comics")
457 (description "MComix is a customizable image viewer that specializes as
458 a comic and manga reader. It supports a variety of container formats
459 including CBZ, CB7, CBT, LHA.")
460 (license license:gpl2+)))
470 (url "https://github.com/jurplel/qView.git")
472 (file-name (git-file-name name version))
474 (base32 "15a91bs3wcqhgf76wzigbn10hayg628j84pq4j2vaxar94ak0vk7"))))
475 (build-system gnu-build-system)
478 (modify-phases %standard-phases
482 ;; Installation process hard-codes "/usr/bin", possibly
484 (add-after 'configure 'fix-install-directory
485 (lambda* (#:key outputs #:allow-other-keys)
486 (let ((out (assoc-ref outputs "out")))
487 (substitute* "Makefile"
488 (("\\$\\(INSTALL_ROOT\\)/usr") out))
490 ;; Don't phone home or show "Checking for updates..." in the
492 (add-before 'build 'disable-auto-update
494 (substitute* "src/qvaboutdialog.cpp"
495 (("ui->updateLabel->setText\\(updateText\\);") "")
496 (("requestUpdates\\(\\);") ""))
501 ("qtimageformats" ,qtimageformats)))
502 (home-page "https://interversehq.com/qview/")
503 (synopsis "Convenient and minimal image viewer")
504 (description "qView is a Qt image viewer designed with visually
505 minimalism and usability in mind. Its features include animated GIF
506 controls, file history, rotation/mirroring, and multithreaded
508 (license license:gpl3+)))
516 (uri (string-append "https://hpjansson.org/chafa/releases/chafa-"
520 "0aa7119514rhsak5i0kgvwllb9z74lnfzfn7dzfhs27fc8cvx1dg"))))
521 (build-system gnu-build-system)
523 `(("pkg-config" ,pkg-config)))
526 ("imagemagick" ,imagemagick)))
527 (synopsis "Convert images to ANSI/Unicode characters")
529 "Chafa is a command-line utility that converts all kinds of images,
530 including animated GIFs, into ANSI/Unicode character output that can be
531 displayed in a terminal.")
532 (home-page "https://hpjansson.org/chafa/")
533 (license license:lgpl3+)))
542 (url "https://github.com/eXeC64/imv")
543 (commit (string-append "v" version))))
546 "0gk8g178i961nn3bls75a8qpv6wvfvav6hd9lxca1skaikd33zdx"))
547 (file-name (git-file-name name version))))
548 (build-system gnu-build-system)
551 (modify-phases %standard-phases
553 (add-after 'install 'record-absolute-file-names
554 (lambda* (#:key outputs #:allow-other-keys)
555 ;; 'imv' is a script that execs 'imv-x11' or 'imv-wayland'.
556 ;; Record their absolute file name.
557 (let* ((out (assoc-ref outputs "out"))
558 (bin (string-append out "/bin")))
559 (substitute* (string-append bin "/imv")
561 (string-append bin "/imv-")))
565 (string-append "PREFIX=" (assoc-ref %outputs "out"))
566 (string-append "CONFIGPREFIX="
567 (assoc-ref %outputs "out") "/etc"))))
569 `(("asciidoc" ,asciidoc)
570 ("freeimage" ,freeimage)
573 ("libxkbcommon" ,libxkbcommon)
575 ("wayland" ,wayland)))
578 ("pkg-config" ,pkg-config)))
579 (synopsis "Image viewer for tiling window managers")
580 (description "@code{imv} is a command line image viewer intended for use
581 with tiling window managers. Features include:
584 @item Native Wayland and X11 support.
585 @item Support for dozens of image formats including:
592 @item Various RAW formats
593 @item Photoshop PSD files
595 @item Configurable key bindings and behavior.
596 @item Highly scriptable with IPC via imv-msg.
598 (home-page "https://github.com/eXeC64/imv")
599 (license license:expat)))
608 (uri (string-append "http://spiegl.de/qiv/download/qiv-"
611 (base32 "1rlf5h67vhj7n1y7jqkm9k115nfnzpwngj3kzqsi2lg676srclv7"))))
612 (build-system gnu-build-system)
614 `(("pkg-config" ,pkg-config)
615 ;; That is required for testing.
616 ("xorg-server" ,xorg-server-for-tests)))
626 ("libxext" ,libxext)))
629 (modify-phases %standard-phases
630 (delete 'configure) ; no configure script
631 (add-before 'install 'patch-file-start-xserver
632 (lambda* (#:key inputs #:allow-other-keys)
633 ;; patch the file so that qiv runs and exits by itself
634 (substitute* "Makefile"
635 (("./qiv -f ./intro.jpg") "./qiv -f -C -s ./intro.jpg")
636 ;; Fail the build when test fails.
637 (("echo \"-- Test Failed --\"")
638 "(echo \"-- Test Failed --\" ; false)"))
639 ;; There must be a running X server and make install doesn't start one.
640 ;; Therefore we must do it.
642 (setenv "DISPLAY" ":1")
644 #:tests? #f ; there is no check target
647 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
648 (home-page "http://spiegl.de/qiv/")
649 (synopsis "Graphical image viewer for X")
651 "Quick Image Viewer is a small and fast GDK/Imlib2 image viewer.
652 Features include zoom, maxpect, scale down, fullscreen, slideshow, delete,
653 brightness/contrast/gamma correction, pan with keyboard and mouse, flip,
654 rotate left/right, jump/forward/backward images, filename filter and use it
655 to set X desktop background.")
656 (license license:gpl2)))