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 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>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages image-viewers)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix packages)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system cmake)
39 #:use-module (guix build-system meson)
40 #:use-module (guix build-system python)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages algebra)
43 #:use-module (gnu packages boost)
44 #:use-module (gnu packages check)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages curl)
47 #:use-module (gnu packages documentation)
48 #:use-module (gnu packages fontutils)
49 #:use-module (gnu packages freedesktop)
50 #:use-module (gnu packages gettext)
51 #:use-module (gnu packages ghostscript)
52 #:use-module (gnu packages gl)
53 #:use-module (gnu packages glib)
54 #:use-module (gnu packages gnome)
55 #:use-module (gnu packages gtk)
56 #:use-module (gnu packages graphics)
57 #:use-module (gnu packages image)
58 #:use-module (gnu packages imagemagick)
59 #:use-module (gnu packages maths)
60 #:use-module (gnu packages perl)
61 #:use-module (gnu packages perl-check)
62 #:use-module (gnu packages photo)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages python)
65 #:use-module (gnu packages python-xyz)
66 #:use-module (gnu packages qt)
67 #:use-module (gnu packages xdisorg)
68 #:use-module (gnu packages xorg)
69 #:use-module (gnu packages))
75 (home-page "https://feh.finalrewind.org/")
78 (uri (string-append home-page
79 name "-" version ".tar.bz2"))
82 "04c8cgwzkax481sz7lbzy23mk79bqmjy3qpvr7vxa4c14mc9k5gk"))))
83 (build-system gnu-build-system)
85 '(#:phases (modify-phases %standard-phases (delete 'configure))
88 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))
92 ("perl-test-command" ,perl-test-command)))
93 (inputs `(("imlib2" ,imlib2)
99 ("libxinerama" ,libxinerama)))
101 ;; Feh allows overriding the libcurl builtin CA path (unset in Guix)
102 ;; with the same variable as the `curl` command line HTTP tool.
103 (package-native-search-paths curl))
104 (synopsis "Fast and light imlib2-based image viewer")
106 "feh is an X11 image viewer aimed mostly at console users.
107 Unlike most other viewers, it does not have a fancy GUI, but simply
108 displays images. It can also be used to set the desktop wallpaper.
109 It is controlled via commandline arguments and configurable key/mouse
112 ;; The license is really the Expat license, with additional wording in the
113 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
114 ;; software packages that this Software was used."
115 (license (license:x11-style
117 "See 'COPYING' in the distribution."))))
119 (define-public geeqie
120 ;; The latest release, 1.4, fails to build with Exiv2 0.27.1. The upstream
121 ;; repo has several fixes for that, so take a snapshot.
122 (let ((commit "c220ddefb1b6b11b54f7598f0d44dd0723325ed4")
126 (version (git-version "1.4" revision commit))
130 (url "https://github.com/BestImageViewer/geeqie")
134 "07424nzrnwbksgalgg1a6ig2snd986w79kca1cfnv1q9kc7x2h3x"))
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")
141 ;; Parallel builds fail with something like:
142 ;; image-load.c:143:9: error: ‘gq_marshal_VOID__INT_INT_INT_INT’ undeclared
143 ;; due to unexpressed makefile dependencies.
147 (modify-phases %standard-phases
148 (add-before 'bootstrap 'pre-bootstrap
150 (define (write-dummy-changelog port)
151 (display "See Git history for a change log.\n" port))
152 ;; Create ChangeLog{,.html} to placate the makefile, which would
153 ;; otherwise require access to the Git repo.
154 (call-with-output-file "ChangeLog"
155 write-dummy-changelog)
156 (call-with-output-file "ChangeLog.html"
157 write-dummy-changelog)
159 ;; Don't try to run 'git' for the version number.
160 (substitute* "configure.ac"
161 (("m4_esyscmd_s\\([^)]+\\)")
162 (string-append "[" ,version "]")))
164 ;; Remove references to non-existent files.
165 (substitute* "po/POTFILES.in"
166 (("^plugins/import/.*") ""))
169 `(("clutter" ,clutter)
170 ("libchamplain" ,libchamplain)
176 `(("autoconf" ,autoconf)
177 ("automake" ,automake)
178 ("glib" ,glib "bin") ; glib-gettextize
179 ("intltool" ,intltool)
180 ("pkg-config" ,pkg-config)))
181 (home-page "http://www.geeqie.org/")
182 (synopsis "Lightweight GTK+ based image viewer")
184 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
185 systems. It features: EXIF, IPTC and XMP metadata browsing and editing
186 interoperability; easy integration with other software; geeqie works on files
187 and directories, there is no need to import images; fast preview for many raw
188 image formats; tools for image comparison, sorting and managing photo
189 collection. Geeqie was initially based on GQview.")
190 (license license:gpl2+))))
192 (define-public gpicview
198 (uri (string-append "mirror://sourceforge/lxde/"
199 "GPicView%20%28image%20Viewer%29/0.2.x/"
200 name "-" version ".tar.xz"))
203 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
204 (build-system gnu-build-system)
205 (inputs `(("gtk+" ,gtk+-2)
206 ("libjpeg" ,libjpeg-turbo)))
207 (native-inputs `(("intltool" ,intltool)
208 ("pkg-config" ,pkg-config)))
209 (synopsis "Simple and fast image viewer for X")
210 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
211 It is the default image viewer on LXDE desktop environment.")
212 (home-page "http://lxde.sourceforge.net/gpicview/")
213 (license license:gpl2+)))
222 (url "https://github.com/muennich/sxiv.git")
223 (commit (string-append "v" version))))
224 (file-name (git-file-name name version))
227 "13s1lfar142hq1j7xld0ri616p4bqs57b17yr4d0b9a9w7liz4hp"))))
228 (build-system gnu-build-system)
230 `(#:tests? #f ; no check target
232 (list (string-append "PREFIX=" %output)
234 ;; Xft.h #includes <ft2build.h> (without ‘freetype2/’). The sxiv
235 ;; Makefile works around this by hard-coding /usr/include instead.
236 (string-append "CPPFLAGS=-I"
237 (assoc-ref %build-inputs "freetype")
238 "/include/freetype2")
241 (modify-phases %standard-phases
242 (delete 'configure)))) ; no configure script
244 `(("freetype" ,freetype)
250 (home-page "https://github.com/muennich/sxiv")
251 (synopsis "Simple X Image Viewer")
253 "sxiv is an alternative to feh and qiv. Its primary goal is to
254 provide the most basic features required for fast image viewing. It has
255 vi key bindings and works nicely with tiling window managers. Its code
256 base should be kept small and clean to make it easy for you to dig into
257 it and customize it for your needs.")
258 (license license:gpl2+)))
260 (define-public viewnior
268 (url "https://github.com/hellosiyan/Viewnior.git")
269 (commit (string-append name "-" version))))
270 (file-name (git-file-name name version))
273 "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
274 (build-system meson-build-system)
277 (modify-phases %standard-phases
278 (add-after 'unpack 'patch-source
280 ;; Don't create 'icon-theme.cache'
281 (substitute* "meson.build"
282 (("meson.add_install_script*") ""))
284 #:tests? #f)) ; no tests
286 `(("gettext" ,gettext-minimal)
287 ("glib" ,glib "bin") ; glib-genmarshal
288 ("pkg-config" ,pkg-config)
289 ("shared-mime-info" ,shared-mime-info)))
292 ("gdk-pixbuf" ,gdk-pixbuf)
294 (home-page "http://siyanpanayotov.com/project/viewnior")
295 (synopsis "Simple, fast and elegant image viewer")
296 (description "Viewnior is an image viewer program. Created to be simple,
297 fast and elegant. Its minimalistic interface provides more screenspace for
298 your images. Among its features are:
300 @item Fullscreen & Slideshow
301 @item Rotate, flip, crop, save, delete images
302 @item Animation support
303 @item Browse only selected images
304 @item Navigation window
305 @item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
306 @item Simple interface
307 @item EXIF and IPTC metadata
308 @item Configurable mouse actions
310 (license license:gpl3+)))
312 (define-public catimg
320 (url "https://github.com/posva/catimg.git")
322 (file-name (git-file-name name version))
324 (base32 "0g9ywbgy162wiam9hc3yqpq5q4gyxa8fj4jskr3fdz8z8jjaabzz"))))
325 (build-system cmake-build-system)
327 `(#:tests? #f ; no tests
329 (modify-phases %standard-phases
330 (add-after 'unpack 'patch-convert
332 (substitute* "catimg"
333 ;; By replacing "convert", we also replace the "convert"
334 ;; in the message 'The version of convert is too old, don't
335 ;; expect good results :('. This should not happen, but in
336 ;; practice this error message should not affect us.
337 (("convert") (which "convert")))
339 (add-after 'install 'install-script
340 (lambda* (#:key outputs #:allow-other-keys)
341 ;; The bash script lacks an file extension. We have to rename
342 ;; it so that the C program and the bash script can be happy
344 (copy-file "../source/catimg"
345 (string-append (assoc-ref outputs "out")
349 `(("imagemagick" ,imagemagick))) ; for the bash script version
350 (home-page "https://github.com/posva/catimg")
351 (synopsis "Render images in the terminal")
353 "Catimg is a little program that prints images in the terminal.
354 It supports JPEG, PNG and GIF formats.")
355 (license license:expat)))
357 (define-public luminance-hdr
359 (name "luminance-hdr")
364 "mirror://sourceforge/qtpfsgui/luminance/"
365 version "/luminance-hdr-" version ".tar.bz2"))
368 "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l"))
369 (patches (search-patches "luminance-hdr-qt-printer.patch"))))
370 (build-system cmake-build-system)
372 `(("pkg-config" ,pkg-config)
373 ("qttools" ,qttools)))
376 ("qtdeclarative" ,qtdeclarative)
377 ("qtwebkit" ,qtwebkit)
384 ("libjpeg" ,libjpeg-turbo)
389 ("libtiff" ,libtiff)))
392 (modify-phases %standard-phases
393 (add-after 'set-paths 'add-ilmbase-include-path
394 (lambda* (#:key inputs #:allow-other-keys)
395 ;; 'OpenEXR.pc' has a -I for IlmBase but 'FindOpenEXR.cmake' does
396 ;; not use 'OpenEXR.pc'. Thus, we need to add
397 ;; "$ilmbase/include/OpenEXR/" to the CPATH.
399 (string-append (assoc-ref inputs "ilmbase")
401 ":" (or (getenv "CPATH") "")))
403 (home-page "http://qtpfsgui.sourceforge.net")
404 (synopsis "High dynamic range (HDR) imaging application")
406 "Luminance HDR (formerly QtPFSGui) is a graphical user interface
407 application that aims to provide a workflow for high dynamic range (HDR)
408 imaging. It supports several HDR and LDR image formats, and it can:
411 @item Create an HDR file from a set of images (formats: JPEG, TIFF 8bit and
412 16bit, RAW) of the same scene taken at different exposure setting;
413 @item Save load HDR images;
414 @item Rotate, resize and crop HDR images;
415 @item Tone-map HDR images;
416 @item Copy EXIF data between sets of images.
418 (license license:gpl2+)))
420 ;; CBR and RAR are currently unsupported, due to non-free dependencies.
421 ;; For optional PDF support, you can install the mupdf package.
422 (define-public mcomix
429 (uri (string-append "mirror://sourceforge/mcomix/MComix-" version
430 "/mcomix-" version ".tar.bz2"))
433 "0fzsf9pklhfs1rzwzj64c0v30b74nk94p93h371rpg45qnfiahvy"))))
434 (build-system python-build-system)
437 ("python2-pillow" ,python2-pillow)
438 ("python2-pygtk" ,python2-pygtk)))
440 ;; Python 2.5 or newer (Python 3 and up is not supported)
442 #:tests? #f ; there are no tests
444 (modify-phases %standard-phases
445 (add-after 'unpack 'configure
446 (lambda* (#:key inputs #:allow-other-keys)
447 (let ((p7zip (assoc-ref inputs "p7zip")))
448 ;; insert absolute path to 7z executable
449 (substitute* "mcomix/archive/sevenzip_external.py"
450 (("_7z_executable = -1")
451 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
453 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
454 (synopsis "Image viewer for comics")
455 (description "MComix is a customizable image viewer that specializes as
456 a comic and manga reader. It supports a variety of container formats
457 including CBZ, CB7, CBT, LHA.")
458 (license license:gpl2+)))
468 (url "https://github.com/jurplel/qView.git")
470 (file-name (git-file-name name version))
472 (base32 "15a91bs3wcqhgf76wzigbn10hayg628j84pq4j2vaxar94ak0vk7"))))
473 (build-system gnu-build-system)
476 (modify-phases %standard-phases
480 ;; Installation process hard-codes "/usr/bin", possibly
482 (add-after 'configure 'fix-install-directory
483 (lambda* (#:key outputs #:allow-other-keys)
484 (let ((out (assoc-ref outputs "out")))
485 (substitute* "Makefile"
486 (("\\$\\(INSTALL_ROOT\\)/usr") out))
488 ;; Don't phone home or show "Checking for updates..." in the
490 (add-before 'build 'disable-auto-update
492 (substitute* "src/qvaboutdialog.cpp"
493 (("ui->updateLabel->setText\\(updateText\\);") "")
494 (("requestUpdates\\(\\);") ""))
499 ("qtimageformats" ,qtimageformats)))
500 (home-page "https://interversehq.com/qview/")
501 (synopsis "Convenient and minimal image viewer")
502 (description "qView is a Qt image viewer designed with visually
503 minimalism and usability in mind. Its features include animated GIF
504 controls, file history, rotation/mirroring, and multithreaded
506 (license license:gpl3+)))
514 (uri (string-append "https://hpjansson.org/chafa/releases/chafa-"
518 "1hj4vdyczby8h52ff23qxl8ng18p5jy549idngpiddwszf5s4drz"))))
519 (build-system gnu-build-system)
521 `(("pkg-config" ,pkg-config)))
524 ("imagemagick" ,imagemagick)))
525 (synopsis "Convert images to ANSI/Unicode characters")
527 "Chafa is a command-line utility that converts all kinds of images,
528 including animated GIFs, into ANSI/Unicode character output that can be
529 displayed in a terminal.")
530 (home-page "https://hpjansson.org/chafa/")
531 (license license:lgpl3+)))
540 (url "https://github.com/eXeC64/imv")
541 (commit (string-append "v" version))))
544 "0gk8g178i961nn3bls75a8qpv6wvfvav6hd9lxca1skaikd33zdx"))
545 (file-name (git-file-name name version))))
546 (build-system gnu-build-system)
549 (modify-phases %standard-phases
551 (add-after 'install 'record-absolute-file-names
552 (lambda* (#:key outputs #:allow-other-keys)
553 ;; 'imv' is a script that execs 'imv-x11' or 'imv-wayland'.
554 ;; Record their absolute file name.
555 (let* ((out (assoc-ref outputs "out"))
556 (bin (string-append out "/bin")))
557 (substitute* (string-append bin "/imv")
559 (string-append bin "/imv-")))
563 (string-append "PREFIX=" (assoc-ref %outputs "out"))
564 (string-append "CONFIGPREFIX="
565 (assoc-ref %outputs "out") "/etc"))))
567 `(("asciidoc" ,asciidoc)
568 ("freeimage" ,freeimage)
571 ("libxkbcommon" ,libxkbcommon)
573 ("wayland" ,wayland)))
576 ("pkg-config" ,pkg-config)))
577 (synopsis "Image viewer for tiling window managers")
578 (description "@code{imv} is a command line image viewer intended for use
579 with tiling window managers. Features include:
582 @item Native Wayland and X11 support.
583 @item Support for dozens of image formats including:
590 @item Various RAW formats
591 @item Photoshop PSD files
593 @item Configurable key bindings and behavior.
594 @item Highly scriptable with IPC via imv-msg.
596 (home-page "https://github.com/eXeC64/imv")
597 (license license:expat)))