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)
158 (setenv "NOCONFIGURE" "true")
160 ;; Don't try to run 'git' for the version number.
161 (substitute* "configure.ac"
162 (("m4_esyscmd_s\\([^)]+\\)")
163 (string-append "[" ,version "]")))
165 ;; Remove references to non-existent files.
166 (substitute* "po/POTFILES.in"
167 (("^plugins/import/.*") ""))
170 `(("clutter" ,clutter)
171 ("libchamplain" ,libchamplain)
177 `(("autoconf" ,autoconf)
178 ("automake" ,automake)
179 ("glib" ,glib "bin") ; glib-gettextize
180 ("intltool" ,intltool)
181 ("pkg-config" ,pkg-config)))
182 (home-page "http://www.geeqie.org/")
183 (synopsis "Lightweight GTK+ based image viewer")
185 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
186 systems. It features: EXIF, IPTC and XMP metadata browsing and editing
187 interoperability; easy integration with other software; geeqie works on files
188 and directories, there is no need to import images; fast preview for many raw
189 image formats; tools for image comparison, sorting and managing photo
190 collection. Geeqie was initially based on GQview.")
191 (license license:gpl2+))))
193 (define-public gpicview
199 (uri (string-append "mirror://sourceforge/lxde/"
200 "GPicView%20%28image%20Viewer%29/0.2.x/"
201 name "-" version ".tar.xz"))
204 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
205 (build-system gnu-build-system)
206 (inputs `(("gtk+" ,gtk+-2)
207 ("libjpeg" ,libjpeg)))
208 (native-inputs `(("intltool" ,intltool)
209 ("pkg-config" ,pkg-config)))
210 (synopsis "Simple and fast image viewer for X")
211 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
212 It is the default image viewer on LXDE desktop environment.")
213 (home-page "http://lxde.sourceforge.net/gpicview/")
214 (license license:gpl2+)))
223 (url "https://github.com/muennich/sxiv.git")
224 (commit (string-append "v" version))))
225 (file-name (git-file-name name version))
228 "13s1lfar142hq1j7xld0ri616p4bqs57b17yr4d0b9a9w7liz4hp"))))
229 (build-system gnu-build-system)
231 `(#:tests? #f ; no check target
233 (list (string-append "PREFIX=" %output)
235 ;; Xft.h #includes <ft2build.h> (without ‘freetype2/’). The sxiv
236 ;; Makefile works around this by hard-coding /usr/include instead.
237 (string-append "CPPFLAGS=-I"
238 (assoc-ref %build-inputs "freetype")
239 "/include/freetype2")
242 (modify-phases %standard-phases
243 (delete 'configure)))) ; no configure script
245 `(("freetype" ,freetype)
251 (home-page "https://github.com/muennich/sxiv")
252 (synopsis "Simple X Image Viewer")
254 "sxiv is an alternative to feh and qiv. Its primary goal is to
255 provide the most basic features required for fast image viewing. It has
256 vi key bindings and works nicely with tiling window managers. Its code
257 base should be kept small and clean to make it easy for you to dig into
258 it and customize it for your needs.")
259 (license license:gpl2+)))
261 (define-public viewnior
269 (url "https://github.com/hellosiyan/Viewnior.git")
270 (commit (string-append name "-" version))))
271 (file-name (git-file-name name version))
274 "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
275 (build-system meson-build-system)
278 (modify-phases %standard-phases
279 (add-after 'unpack 'patch-source
281 ;; Don't create 'icon-theme.cache'
282 (substitute* "meson.build"
283 (("meson.add_install_script*") ""))
285 #:tests? #f)) ; no tests
287 `(("gettext" ,gettext-minimal)
288 ("glib" ,glib "bin") ; glib-genmarshal
289 ("pkg-config" ,pkg-config)
290 ("shared-mime-info" ,shared-mime-info)))
293 ("gdk-pixbuf" ,gdk-pixbuf)
295 (home-page "http://siyanpanayotov.com/project/viewnior")
296 (synopsis "Simple, fast and elegant image viewer")
297 (description "Viewnior is an image viewer program. Created to be simple,
298 fast and elegant. Its minimalistic interface provides more screenspace for
299 your images. Among its features are:
301 @item Fullscreen & Slideshow
302 @item Rotate, flip, crop, save, delete images
303 @item Animation support
304 @item Browse only selected images
305 @item Navigation window
306 @item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
307 @item Simple interface
308 @item EXIF and IPTC metadata
309 @item Configurable mouse actions
311 (license license:gpl3+)))
313 (define-public catimg
321 (url "https://github.com/posva/catimg.git")
323 (file-name (git-file-name name version))
325 (base32 "0g9ywbgy162wiam9hc3yqpq5q4gyxa8fj4jskr3fdz8z8jjaabzz"))))
326 (build-system cmake-build-system)
328 `(#:tests? #f ; no tests
330 (modify-phases %standard-phases
331 (add-after 'unpack 'patch-convert
333 (substitute* "catimg"
334 ;; By replacing "convert", we also replace the "convert"
335 ;; in the message 'The version of convert is too old, don't
336 ;; expect good results :('. This should not happen, but in
337 ;; practice this error message should not affect us.
338 (("convert") (which "convert")))
340 (add-after 'install 'install-script
341 (lambda* (#:key outputs #:allow-other-keys)
342 ;; The bash script lacks an file extension. We have to rename
343 ;; it so that the C program and the bash script can be happy
345 (copy-file "../source/catimg"
346 (string-append (assoc-ref outputs "out")
350 `(("imagemagick" ,imagemagick))) ; for the bash script version
351 (home-page "https://github.com/posva/catimg")
352 (synopsis "Render images in the terminal")
354 "Catimg is a little program that prints images in the terminal.
355 It supports JPEG, PNG and GIF formats.")
356 (license license:expat)))
358 (define-public luminance-hdr
360 (name "luminance-hdr")
365 "mirror://sourceforge/qtpfsgui/luminance/"
366 version "/luminance-hdr-" version ".tar.bz2"))
369 "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l"))
370 (patches (search-patches "luminance-hdr-qt-printer.patch"))))
371 (build-system cmake-build-system)
373 `(("pkg-config" ,pkg-config)
374 ("qttools" ,qttools)))
377 ("qtdeclarative" ,qtdeclarative)
378 ("qtwebkit" ,qtwebkit)
390 ("libtiff" ,libtiff)))
393 (modify-phases %standard-phases
394 (add-after 'set-paths 'add-ilmbase-include-path
395 (lambda* (#:key inputs #:allow-other-keys)
396 ;; 'OpenEXR.pc' has a -I for IlmBase but 'FindOpenEXR.cmake' does
397 ;; not use 'OpenEXR.pc'. Thus, we need to add
398 ;; "$ilmbase/include/OpenEXR/" to the CPATH.
400 (string-append (assoc-ref inputs "ilmbase")
402 ":" (or (getenv "CPATH") "")))
404 (home-page "http://qtpfsgui.sourceforge.net")
405 (synopsis "High dynamic range (HDR) imaging application")
407 "Luminance HDR (formerly QtPFSGui) is a graphical user interface
408 application that aims to provide a workflow for high dynamic range (HDR)
409 imaging. It supports several HDR and LDR image formats, and it can:
412 @item Create an HDR file from a set of images (formats: JPEG, TIFF 8bit and
413 16bit, RAW) of the same scene taken at different exposure setting;
414 @item Save load HDR images;
415 @item Rotate, resize and crop HDR images;
416 @item Tone-map HDR images;
417 @item Copy EXIF data between sets of images.
419 (license license:gpl2+)))
421 ;; CBR and RAR are currently unsupported, due to non-free dependencies.
422 ;; For optional PDF support, you can install the mupdf package.
423 (define-public mcomix
430 (uri (string-append "mirror://sourceforge/mcomix/MComix-" version
431 "/mcomix-" version ".tar.bz2"))
434 "0fzsf9pklhfs1rzwzj64c0v30b74nk94p93h371rpg45qnfiahvy"))))
435 (build-system python-build-system)
438 ("python2-pillow" ,python2-pillow)
439 ("python2-pygtk" ,python2-pygtk)))
441 ;; Python 2.5 or newer (Python 3 and up is not supported)
443 #:tests? #f ; there are no tests
445 (modify-phases %standard-phases
446 (add-after 'unpack 'configure
447 (lambda* (#:key inputs #:allow-other-keys)
448 (let ((p7zip (assoc-ref inputs "p7zip")))
449 ;; insert absolute path to 7z executable
450 (substitute* "mcomix/archive/sevenzip_external.py"
451 (("_7z_executable = -1")
452 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
454 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
455 (synopsis "Image viewer for comics")
456 (description "MComix is a customizable image viewer that specializes as
457 a comic and manga reader. It supports a variety of container formats
458 including CBZ, CB7, CBT, LHA.")
459 (license license:gpl2+)))
469 (url "https://github.com/jurplel/qView.git")
471 (file-name (git-file-name name version))
473 (base32 "15a91bs3wcqhgf76wzigbn10hayg628j84pq4j2vaxar94ak0vk7"))))
474 (build-system gnu-build-system)
477 (modify-phases %standard-phases
481 ;; Installation process hard-codes "/usr/bin", possibly
483 (add-after 'configure 'fix-install-directory
484 (lambda* (#:key outputs #:allow-other-keys)
485 (let ((out (assoc-ref outputs "out")))
486 (substitute* "Makefile"
487 (("\\$\\(INSTALL_ROOT\\)/usr") out))
489 ;; Don't phone home or show "Checking for updates..." in the
491 (add-before 'build 'disable-auto-update
493 (substitute* "src/qvaboutdialog.cpp"
494 (("ui->updateLabel->setText\\(updateText\\);") "")
495 (("requestUpdates\\(\\);") ""))
500 ("qtimageformats" ,qtimageformats)))
501 (home-page "https://interversehq.com/qview/")
502 (synopsis "Convenient and minimal image viewer")
503 (description "qView is a Qt image viewer designed with visually
504 minimalism and usability in mind. Its features include animated GIF
505 controls, file history, rotation/mirroring, and multithreaded
507 (license license:gpl3+)))
515 (uri (string-append "https://hpjansson.org/chafa/releases/chafa-"
519 "1hj4vdyczby8h52ff23qxl8ng18p5jy549idngpiddwszf5s4drz"))))
520 (build-system gnu-build-system)
522 `(("pkg-config" ,pkg-config)))
525 ("imagemagick" ,imagemagick)))
526 (synopsis "Convert images to ANSI/Unicode characters")
528 "Chafa is a command-line utility that converts all kinds of images,
529 including animated GIFs, into ANSI/Unicode character output that can be
530 displayed in a terminal.")
531 (home-page "https://hpjansson.org/chafa/")
532 (license license:lgpl3+)))
541 (url "https://github.com/eXeC64/imv")
542 (commit (string-append "v" version))))
545 "0gk8g178i961nn3bls75a8qpv6wvfvav6hd9lxca1skaikd33zdx"))
546 (file-name (git-file-name name version))))
547 (build-system gnu-build-system)
550 (modify-phases %standard-phases
552 (add-after 'install 'record-absolute-file-names
553 (lambda* (#:key outputs #:allow-other-keys)
554 ;; 'imv' is a script that execs 'imv-x11' or 'imv-wayland'.
555 ;; Record their absolute file name.
556 (let* ((out (assoc-ref outputs "out"))
557 (bin (string-append out "/bin")))
558 (substitute* (string-append bin "/imv")
560 (string-append bin "/imv-")))
564 (string-append "PREFIX=" (assoc-ref %outputs "out"))
565 (string-append "CONFIGPREFIX="
566 (assoc-ref %outputs "out") "/etc"))))
568 `(("asciidoc" ,asciidoc)
569 ("freeimage" ,freeimage)
572 ("libxkbcommon" ,libxkbcommon)
574 ("wayland" ,wayland)))
577 ("pkg-config" ,pkg-config)))
578 (synopsis "Image viewer for tiling window managers")
579 (description "@code{imv} is a command line image viewer intended for use
580 with tiling window managers. Features include:
583 @item Native Wayland and X11 support.
584 @item Support for dozens of image formats including:
591 @item Various RAW formats
592 @item Photoshop PSD files
594 @item Configurable key bindings and behavior.
595 @item Highly scriptable with IPC via imv-msg.
597 (home-page "https://github.com/eXeC64/imv")
598 (license license:expat)))