gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / image-viewers.scm
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, 2021 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–2021 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>
18 ;;; Copyright © 2021 Rovanion Luckey <rovanion.luckey@gmail.com>
19 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
20 ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
21 ;;;
22 ;;; This file is part of GNU Guix.
23 ;;;
24 ;;; GNU Guix is free software; you can redistribute it and/or modify it
25 ;;; under the terms of the GNU General Public License as published by
26 ;;; the Free Software Foundation; either version 3 of the License, or (at
27 ;;; your option) any later version.
28 ;;;
29 ;;; GNU Guix is distributed in the hope that it will be useful, but
30 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ;;; GNU General Public License for more details.
33 ;;;
34 ;;; You should have received a copy of the GNU General Public License
35 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36
37 (define-module (gnu packages image-viewers)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix packages)
42 #:use-module (guix utils)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system meson)
46 #:use-module (guix build-system python)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages algebra)
49 #:use-module (gnu packages boost)
50 #:use-module (gnu packages check)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages curl)
53 #:use-module (gnu packages documentation)
54 #:use-module (gnu packages fontutils)
55 #:use-module (gnu packages freedesktop)
56 #:use-module (gnu packages gettext)
57 #:use-module (gnu packages ghostscript)
58 #:use-module (gnu packages gl)
59 #:use-module (gnu packages glib)
60 #:use-module (gnu packages gnome)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages graphics)
63 #:use-module (gnu packages image)
64 #:use-module (gnu packages image-processing)
65 #:use-module (gnu packages imagemagick)
66 #:use-module (gnu packages maths)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages perl-check)
69 #:use-module (gnu packages photo)
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages python-xyz)
73 #:use-module (gnu packages qt)
74 #:use-module (gnu packages xdisorg)
75 #:use-module (gnu packages xorg)
76 #:use-module (gnu packages))
77
78 (define-public feh
79 (package
80 (name "feh")
81 (version "3.6.3")
82 (home-page "https://feh.finalrewind.org/")
83 (source (origin
84 (method url-fetch)
85 (uri (string-append home-page
86 name "-" version ".tar.bz2"))
87 (sha256
88 (base32
89 "1d13x8hmvpdc5f5rj4l29ha7iz7wvqxjlvh6il04wq8igzrj0x23"))))
90 (build-system gnu-build-system)
91 (arguments
92 '(#:phases (modify-phases %standard-phases (delete 'configure))
93 #:test-target "test"
94 #:make-flags
95 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))
96 "exif=1"
97 "inotify=1")))
98 (native-inputs
99 `(("perl" ,perl)
100 ("perl-test-command" ,perl-test-command)))
101 (inputs `(("imlib2" ,imlib2)
102 ("curl" ,curl)
103 ("libexif" ,libexif)
104 ("libpng" ,libpng)
105 ("libxt" ,libxt)
106 ("libx11" ,libx11)
107 ("libxinerama" ,libxinerama)))
108 (native-search-paths
109 ;; Feh allows overriding the libcurl builtin CA path (unset in Guix)
110 ;; with the same variable as the `curl` command line HTTP tool.
111 (package-native-search-paths curl))
112 (synopsis "Fast and light imlib2-based image viewer")
113 (description
114 "feh is an X11 image viewer aimed mostly at console users.
115 Unlike most other viewers, it does not have a fancy GUI, but simply
116 displays images. It can also be used to set the desktop wallpaper.
117 It is controlled via commandline arguments and configurable key/mouse
118 actions.")
119
120 ;; The license is really the Expat license, with additional wording in the
121 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
122 ;; software packages that this Software was used."
123 (license (license:x11-style
124 "file://COPYING"
125 "See 'COPYING' in the distribution."))))
126
127 (define-public geeqie
128 (package
129 (name "geeqie")
130 (version "1.5")
131 (source (origin
132 (method git-fetch)
133 (uri (git-reference
134 (url "https://github.com/BestImageViewer/geeqie")
135 (commit (string-append "v" version))))
136 (sha256
137 (base32
138 "0nf45sh3pwsv98sppcrqj81b6mdi31n1sbc7gn88m8mhpfp1qq6k"))
139 (file-name (git-file-name name version))))
140 (build-system gnu-build-system)
141 (arguments
142 `( ;; Enable support for a "map" pane using GPS data.
143 #:configure-flags '("--enable-map"
144 "--enable-gtk3")))
145 (inputs
146 `(("clutter" ,clutter)
147 ("libchamplain" ,libchamplain)
148 ("lcms" ,lcms)
149 ("exiv2" ,exiv2)
150 ("libpng" ,libpng)
151 ("gtk+" ,gtk+)))
152 (native-inputs
153 `(("autoconf" ,autoconf)
154 ("automake" ,automake)
155 ("glib" ,glib "bin") ; glib-gettextize
156 ("intltool" ,intltool)
157 ("pkg-config" ,pkg-config)))
158 (home-page "http://www.geeqie.org/")
159 (synopsis "Lightweight GTK+ based image viewer")
160 (description
161 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
162 systems. It features: EXIF, IPTC and XMP metadata browsing and editing
163 interoperability; easy integration with other software; geeqie works on files
164 and directories, there is no need to import images; fast preview for many raw
165 image formats; tools for image comparison, sorting and managing photo
166 collection. Geeqie was initially based on GQview.")
167 (license license:gpl2+)))
168
169 (define-public gpicview
170 (package
171 (name "gpicview")
172 (version "0.2.5")
173 (source (origin
174 (method url-fetch)
175 (uri (string-append "mirror://sourceforge/lxde/"
176 "GPicView%20%28image%20Viewer%29/0.2.x/"
177 name "-" version ".tar.xz"))
178 (sha256
179 (base32
180 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
181 (build-system gnu-build-system)
182 (inputs `(("gtk+" ,gtk+-2)
183 ("libjpeg" ,libjpeg-turbo)))
184 (native-inputs `(("intltool" ,intltool)
185 ("pkg-config" ,pkg-config)))
186 (synopsis "Simple and fast image viewer for X")
187 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
188 It is the default image viewer on LXDE desktop environment.")
189 (home-page "http://lxde.sourceforge.net/gpicview/")
190 (license license:gpl2+)))
191
192 (define-public sxiv
193 (package
194 (name "sxiv")
195 (version "26")
196 (source (origin
197 (method git-fetch)
198 (uri (git-reference
199 (url "https://github.com/muennich/sxiv")
200 (commit (string-append "v" version))))
201 (file-name (git-file-name name version))
202 (sha256
203 (base32
204 "0xaawlfdy7b277m38mgg4423kd7p1ffn0dq4hciqs6ivbb3q9c4f"))))
205 (build-system gnu-build-system)
206 (arguments
207 `(#:tests? #f ; no check target
208 #:make-flags
209 (list (string-append "PREFIX=" %output)
210 (string-append "CC=" ,(cc-for-target))
211 ;; Xft.h #includes <ft2build.h> without ‘freetype2/’. The Makefile
212 ;; works around this by hard-coding /usr/include & $PREFIX.
213 (string-append "CPPFLAGS=-I"
214 (assoc-ref %build-inputs "freetype")
215 "/include/freetype2")
216 "V=1")
217 #:phases
218 (modify-phases %standard-phases
219 (delete 'configure) ; no configure script
220 (add-after 'install 'install-desktop-file
221 (lambda* (#:key outputs #:allow-other-keys)
222 (install-file "sxiv.desktop"
223 (string-append (assoc-ref outputs "out")
224 "/share/applications"))
225 #t))
226 (add-after 'install 'install-icons
227 (lambda* (#:key make-flags #:allow-other-keys)
228 (apply invoke "make" "-C" "icon" "install" make-flags))))))
229 (inputs
230 `(("freetype" ,freetype)
231 ("giflib" ,giflib)
232 ("imlib2" ,imlib2)
233 ("libexif" ,libexif)
234 ("libx11" ,libx11)
235 ("libxft" ,libxft)))
236 (home-page "https://github.com/muennich/sxiv")
237 (synopsis "Simple X Image Viewer")
238 (description
239 "sxiv is an alternative to feh and qiv. Its primary goal is to
240 provide the most basic features required for fast image viewing. It has
241 vi key bindings and works nicely with tiling window managers. Its code
242 base should be kept small and clean to make it easy for you to dig into
243 it and customize it for your needs.")
244 (license license:gpl2+)))
245
246 (define-public viewnior
247 (package
248 (name "viewnior")
249 (version "1.7")
250 (source
251 (origin
252 (method git-fetch)
253 (uri (git-reference
254 (url "https://github.com/hellosiyan/Viewnior")
255 (commit (string-append name "-" version))))
256 (file-name (git-file-name name version))
257 (sha256
258 (base32
259 "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
260 (build-system meson-build-system)
261 (arguments
262 '(#:phases
263 (modify-phases %standard-phases
264 (add-after 'unpack 'patch-source
265 (lambda _
266 ;; Don't create 'icon-theme.cache'
267 (substitute* "meson.build"
268 (("meson.add_install_script*") ""))
269 #t)))
270 #:tests? #f)) ; no tests
271 (native-inputs
272 `(("gettext" ,gettext-minimal)
273 ("glib" ,glib "bin") ; glib-genmarshal
274 ("pkg-config" ,pkg-config)
275 ("shared-mime-info" ,shared-mime-info)))
276 (inputs
277 `(("exiv2" ,exiv2)
278 ("gdk-pixbuf" ,gdk-pixbuf)
279 ("gtk+-2" ,gtk+-2)))
280 (home-page "http://siyanpanayotov.com/project/viewnior")
281 (synopsis "Simple, fast and elegant image viewer")
282 (description "Viewnior is an image viewer program. Created to be simple,
283 fast and elegant. Its minimalistic interface provides more screenspace for
284 your images. Among its features are:
285 @enumerate
286 @item Fullscreen & Slideshow
287 @item Rotate, flip, crop, save, delete images
288 @item Animation support
289 @item Browse only selected images
290 @item Navigation window
291 @item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
292 @item Simple interface
293 @item EXIF and IPTC metadata
294 @item Configurable mouse actions
295 @end enumerate\n")
296 (license license:gpl3+)))
297
298 (define-public catimg
299 (package
300 (name "catimg")
301 (version "2.7.0")
302 (source
303 (origin
304 (method git-fetch)
305 (uri (git-reference
306 (url "https://github.com/posva/catimg")
307 (commit version)))
308 (file-name (git-file-name name version))
309 (sha256
310 (base32 "0a2dswbv4xddb2l2d55hc43lzvjwrjs5z9am7v6i0p0mi2fmc89s"))))
311 (build-system cmake-build-system)
312 (arguments
313 `(#:tests? #f ; no tests
314 #:phases
315 (modify-phases %standard-phases
316 (add-after 'unpack 'patch-convert
317 (lambda _
318 (substitute* "catimg"
319 ;; By replacing "convert", we also replace the "convert"
320 ;; in the message 'The version of convert is too old, don't
321 ;; expect good results :('. This should not happen, but in
322 ;; practice this error message should not affect us.
323 (("convert") (which "convert")))
324 #t))
325 (add-after 'install 'install-script
326 (lambda* (#:key outputs #:allow-other-keys)
327 ;; The bash script lacks an file extension. We have to rename
328 ;; it so that the C program and the bash script can be happy
329 ;; side by side.
330 (copy-file "../source/catimg"
331 (string-append (assoc-ref outputs "out")
332 "/bin/catimg.sh"))
333 #t)))))
334 (inputs
335 `(("imagemagick" ,imagemagick))) ; for the bash script version
336 (home-page "https://github.com/posva/catimg")
337 (synopsis "Render images in the terminal")
338 (description
339 "Catimg is a little program that prints images in the terminal.
340 It supports JPEG, PNG and GIF formats.")
341 (license license:expat)))
342
343 (define-public luminance-hdr
344 (package
345 (name "luminance-hdr")
346 (version "2.6.0")
347 (source (origin
348 (method url-fetch)
349 (uri (string-append
350 "mirror://sourceforge/qtpfsgui/luminance/"
351 version "/luminance-hdr-" version ".tar.bz2"))
352 (sha256
353 (base32
354 "188q0l63nfasqfvwbq4mwx2vh7wsfi2bq9n5nksddspl1qz01lnp"))))
355 (build-system cmake-build-system)
356 (native-inputs
357 `(("pkg-config" ,pkg-config)
358 ("qttools" ,qttools)))
359 (inputs
360 `(("qtbase" ,qtbase)
361 ("qtdeclarative" ,qtdeclarative)
362 ("qtsvg" ,qtsvg)
363 ("qtwebkit" ,qtwebkit)
364 ("boost" ,boost)
365 ("eigen" ,eigen)
366 ;; ("gtest" ,gtest)
367 ("libraw" ,libraw)
368 ("zlib" ,zlib)
369 ("exiv2" ,exiv2)
370 ("libpng" ,libpng)
371 ("libjpeg" ,libjpeg-turbo)
372 ("lcms" ,lcms)
373 ("openexr" ,openexr)
374 ("fftw" ,fftwf)
375 ("gsl" ,gsl)
376 ("libtiff" ,libtiff)))
377 (arguments
378 '(#:tests? #f ;XXX: some tests fail to compile
379 #:phases
380 (modify-phases %standard-phases
381 (add-after 'set-paths 'add-ilmbase-include-path
382 (lambda* (#:key inputs #:allow-other-keys)
383 ;; 'OpenEXR.pc' has a -I for IlmBase but 'FindOpenEXR.cmake' does
384 ;; not use 'OpenEXR.pc'. Thus, we need to add
385 ;; "$ilmbase/include/OpenEXR/" to the CPATH.
386 (setenv "CPATH"
387 (string-append (assoc-ref inputs "ilmbase")
388 "/include/OpenEXR"
389 ":" (or (getenv "CPATH") "")))
390 #t)))))
391 (home-page "http://qtpfsgui.sourceforge.net")
392 (synopsis "High dynamic range (HDR) imaging application")
393 (description
394 "Luminance HDR (formerly QtPFSGui) is a graphical user interface
395 application that aims to provide a workflow for high dynamic range (HDR)
396 imaging. It supports several HDR and LDR image formats, and it can:
397
398 @itemize
399 @item Create an HDR file from a set of images (formats: JPEG, TIFF 8bit and
400 16bit, RAW) of the same scene taken at different exposure setting;
401 @item Save load HDR images;
402 @item Rotate, resize and crop HDR images;
403 @item Tone-map HDR images;
404 @item Copy EXIF data between sets of images.
405 @end itemize\n")
406 (license license:gpl2+)))
407
408 ;; CBR and RAR are currently unsupported, due to non-free dependencies.
409 (define-public mcomix
410 ;; Official mcomix hasn't been updated since 2016, it's broken with
411 ;; python-pillow 6+ and only supports Python 2. We use fork instead.
412 (let ((commit "fea55a7a9369569eefed72209eed830409c4af98"))
413 (package
414 (name "mcomix")
415 (version (git-version "1.2.1" "1" commit))
416 (source
417 (origin
418 (method git-fetch)
419 (uri (git-reference
420 (url "https://github.com/multiSnow/mcomix3")
421 (commit commit)))
422 (file-name (git-file-name name version))
423 (sha256
424 (base32
425 "05zl0dkjwbdcm2zlk4nz9w33amlqj8pbf32a8ymshc2356fqhhi5"))))
426 (build-system python-build-system)
427 (inputs
428 `(("p7zip" ,p7zip)
429 ("python-pillow" ,python-pillow)
430 ("python-pygobject" ,python-pygobject)
431 ("python-pycairo" ,python-pycairo)))
432 (arguments
433 `(#:tests? #f ; FIXME: How do we run tests?
434 #:phases
435 (modify-phases %standard-phases
436 (add-after 'unpack 'configure
437 (lambda* (#:key inputs #:allow-other-keys)
438 (let ((p7zip (assoc-ref inputs "p7zip")))
439 ;; insert absolute path to 7z executable
440 (substitute* "mcomix/mcomix/archive/sevenzip_external.py"
441 (("_7z_executable = -1")
442 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
443 #t))
444 (replace 'build
445 (lambda* (#:key outputs #:allow-other-keys)
446 (let* ((out (assoc-ref outputs "out"))
447 (pyver ,(version-major+minor (package-version python)))
448 (lib (string-append out "/lib/python" pyver)))
449 (invoke (which "python") "installer.py" "--srcdir=mcomix"
450 (string-append "--target=" lib))
451 (rename-file (string-append lib "/mcomix")
452 (string-append lib "/site-packages"))
453 #t)))
454 (replace 'install
455 (lambda* (#:key outputs #:allow-other-keys)
456 (let* ((out (assoc-ref outputs "out"))
457 (share (string-append out "/share"))
458 (bin (string-append out "/bin"))
459 (pyver ,(version-major+minor (package-version python)))
460 (lib (string-append out "/lib/python" pyver "/site-packages")))
461 (mkdir-p bin)
462 (rename-file (string-append lib "/mcomixstarter.py")
463 (string-append bin "/mcomix"))
464 (rename-file (string-append lib "/comicthumb.py")
465 (string-append bin "/comicthumb"))
466 (install-file "mime/mcomix.desktop"
467 (string-append share "/applications"))
468 (install-file "mime/mcomix.appdata.xml"
469 (string-append share "/metainfo"))
470 (install-file "mime/mcomix.xml"
471 (string-append share "/mime/packages"))
472 (install-file "mime/comicthumb.thumbnailer"
473 (string-append share "/thumbnailers"))
474 (install-file "man/mcomix.1" (string-append share "/man/man1"))
475 (install-file "man/comicthumb.1" (string-append share "/man/man1"))
476 (for-each
477 (lambda (size)
478 (install-file
479 (format #f "mcomix/mcomix/images/~sx~s/mcomix.png" size size)
480 (format #f "~a/icons/hicolor/~sx~s/apps/" share size size))
481 (for-each
482 (lambda (ext)
483 (install-file
484 (format #f "mime/icons/~sx~s/application-x-~a.png" size size ext)
485 (format #f "~a/icons/hicolor/~sx~s/mimetypes/"
486 share size size)))
487 '("cb7" "cbr" "cbt" "cbz")))
488 '(16 22 24 32 48))
489 #t))))))
490 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
491 (synopsis "Image viewer for comics")
492 (description "MComix is a customizable image viewer that specializes as
493 a comic and manga reader. It supports a variety of container formats
494 including CBZ, CB7, CBT, LHA.
495
496 For PDF support, install the @emph{mupdf} package.")
497 (license license:gpl2+))))
498
499 (define-public qview
500 (package
501 (name "qview")
502 (version "4.0")
503 (source
504 (origin
505 (method git-fetch)
506 (uri (git-reference
507 (url "https://github.com/jurplel/qView")
508 (commit version)))
509 (file-name (git-file-name name version))
510 (sha256
511 (base32 "15n9cq7w3ckinnx38hvncxrbkv4qm4k51sal41q4y0pkvhmafhnr"))))
512 (build-system gnu-build-system)
513 (arguments
514 `(#:phases
515 (modify-phases %standard-phases
516 (replace 'configure
517 (lambda* (#:key outputs #:allow-other-keys)
518 (let ((out (assoc-ref outputs "out")))
519 (invoke "qmake" (string-append "PREFIX=" out)))))
520 ;; Don't phone home or show "Checking for updates..." in the About
521 ;; menu.
522 (add-before 'build 'disable-auto-update
523 (lambda _
524 (substitute* "src/qvaboutdialog.cpp"
525 (("qvApp->checkUpdates\\(\\);") "")
526 (("updateText\\(\\);") ""))
527 #t)))))
528 (inputs
529 `(("qtbase" ,qtbase)
530 ("qtsvg" ,qtsvg)
531 ("qtimageformats" ,qtimageformats)))
532 (home-page "https://interversehq.com/qview/")
533 (synopsis "Convenient and minimal image viewer")
534 (description "qView is a Qt image viewer designed with visually
535 minimalism and usability in mind. Its features include animated GIF
536 controls, file history, rotation/mirroring, and multithreaded
537 preloading.")
538 (license license:gpl3+)))
539
540 (define-public chafa
541 (package
542 (name "chafa")
543 (version "1.4.1")
544 (source (origin
545 (method url-fetch)
546 (uri (string-append "https://hpjansson.org/chafa/releases/chafa-"
547 version ".tar.xz"))
548 (sha256
549 (base32
550 "18rb82bfqj1sj2g4irazx4lwq9q4b4k7my1r0q714vf9yhs41ls6"))))
551 (build-system gnu-build-system)
552 (native-inputs
553 `(("pkg-config" ,pkg-config)))
554 (inputs
555 `(("freetype" ,freetype)
556 ("libjpeg" ,libjpeg-turbo)
557 ("glib" ,glib)
558 ("imagemagick" ,imagemagick)))
559 (synopsis "Convert images to ANSI/Unicode characters")
560 (description
561 "Chafa is a command-line utility that converts all kinds of images,
562 including animated GIFs, into ANSI/Unicode character output that can be
563 displayed in a terminal.")
564 (home-page "https://hpjansson.org/chafa/")
565 (license license:lgpl3+)))
566
567 (define-public imv
568 (package
569 (name "imv")
570 (version "4.1.0")
571 (source (origin
572 (method git-fetch)
573 (uri (git-reference
574 (url "https://github.com/eXeC64/imv")
575 (commit (string-append "v" version))))
576 (sha256
577 (base32
578 "0gk8g178i961nn3bls75a8qpv6wvfvav6hd9lxca1skaikd33zdx"))
579 (file-name (git-file-name name version))))
580 (build-system gnu-build-system)
581 (arguments
582 '(#:phases
583 (modify-phases %standard-phases
584 (delete 'configure)
585 (add-after 'install 'record-absolute-file-names
586 (lambda* (#:key outputs #:allow-other-keys)
587 ;; 'imv' is a script that execs 'imv-x11' or 'imv-wayland'.
588 ;; Record their absolute file name.
589 (let* ((out (assoc-ref outputs "out"))
590 (bin (string-append out "/bin")))
591 (substitute* (string-append bin "/imv")
592 (("imv-")
593 (string-append bin "/imv-")))
594 #t))))
595 #:make-flags
596 (list "CC=gcc"
597 (string-append "PREFIX=" (assoc-ref %outputs "out"))
598 (string-append "CONFIGPREFIX="
599 (assoc-ref %outputs "out") "/etc"))))
600 (inputs
601 `(("asciidoc" ,asciidoc)
602 ("freeimage" ,freeimage)
603 ("glu" ,glu)
604 ("librsvg" ,librsvg)
605 ("libxkbcommon" ,libxkbcommon)
606 ("pango" ,pango)
607 ("wayland" ,wayland)))
608 (native-inputs
609 `(("cmocka" ,cmocka)
610 ("pkg-config" ,pkg-config)))
611 (synopsis "Image viewer for tiling window managers")
612 (description "@code{imv} is a command line image viewer intended for use
613 with tiling window managers. Features include:
614
615 @itemize
616 @item Native Wayland and X11 support.
617 @item Support for dozens of image formats including:
618 @itemize
619 @item PNG
620 @item JPEG
621 @item Animated GIFs
622 @item SVG
623 @item TIFF
624 @item Various RAW formats
625 @item Photoshop PSD files
626 @end itemize
627 @item Configurable key bindings and behavior.
628 @item Highly scriptable with IPC via imv-msg.
629 @end itemize\n")
630 (home-page "https://github.com/eXeC64/imv")
631 (license license:expat)))
632
633 (define-public qiv
634 (package
635 (name "qiv")
636 (version "2.3.1")
637 (source
638 (origin
639 (method url-fetch)
640 (uri (string-append "http://spiegl.de/qiv/download/qiv-"
641 version ".tgz"))
642 (sha256
643 (base32 "1rlf5h67vhj7n1y7jqkm9k115nfnzpwngj3kzqsi2lg676srclv7"))))
644 (build-system gnu-build-system)
645 (native-inputs
646 `(("pkg-config" ,pkg-config)
647 ;; That is required for testing.
648 ("xorg-server" ,xorg-server-for-tests)))
649 (inputs
650 `(("imlib2" ,imlib2)
651 ("glib" ,glib)
652 ("gtk+" ,gtk+-2)
653 ("lcms" ,lcms)
654 ("libjpeg" ,libjpeg-turbo)
655 ("libtiff" ,libtiff)
656 ("libexif" ,libexif)
657 ("libx11" ,libx11)
658 ("libxext" ,libxext)))
659 (arguments
660 `(#:phases
661 (modify-phases %standard-phases
662 (delete 'configure) ; no configure script
663 (add-before 'install 'patch-file-start-xserver
664 (lambda* (#:key inputs #:allow-other-keys)
665 ;; patch the file so that qiv runs and exits by itself
666 (substitute* "Makefile"
667 (("./qiv -f ./intro.jpg") "./qiv -f -C -s ./intro.jpg")
668 ;; Fail the build when test fails.
669 (("echo \"-- Test Failed --\"")
670 "(echo \"-- Test Failed --\" ; false)"))
671 ;; There must be a running X server and make install doesn't start one.
672 ;; Therefore we must do it.
673 (system "Xvfb :1 &")
674 (setenv "DISPLAY" ":1")
675 #t)))
676 #:tests? #f ; there is no check target
677 #:make-flags
678 (list
679 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
680 (home-page "http://spiegl.de/qiv/")
681 (synopsis "Graphical image viewer for X")
682 (description
683 "Quick Image Viewer is a small and fast GDK/Imlib2 image viewer.
684 Features include zoom, maxpect, scale down, fullscreen, slideshow, delete,
685 brightness/contrast/gamma correction, pan with keyboard and mouse, flip,
686 rotate left/right, jump/forward/backward images, filename filter and use it
687 to set X desktop background.")
688 (license license:gpl2)))
689
690 (define-public nomacs
691 (package
692 (name "nomacs")
693 (version "3.16.224")
694 (source
695 (origin
696 (method git-fetch)
697 (uri (git-reference
698 (url "https://github.com/nomacs/nomacs")
699 (commit version)))
700 (file-name (git-file-name name version))
701 (sha256
702 (base32
703 "05d4hqg0gl3g9s2xf1hr7mc7g4cqarcap4nzxxa51fsphw2b8x16"))))
704 (build-system cmake-build-system)
705 (arguments
706 `(#:build-type "Release" ; fails to build with debug info
707 #:configure-flags (list "-DENABLE_TRANSLATIONS=true"
708 "-DUSE_SYSTEM_QUAZIP=true"
709 "-DENABLE_OPENCV=true")
710 #:tests? #f ; no rule for target 'test'
711 #:phases
712 (modify-phases %standard-phases
713 (add-after 'unpack 'copy-plugins
714 (lambda* (#:key inputs #:allow-other-keys)
715 (copy-recursively (assoc-ref inputs "plugins")
716 "ImageLounge/plugins")))
717 (add-after 'copy-plugins 'cd-to-source-dir
718 (lambda _ (chdir "ImageLounge") #t)))))
719 (inputs
720 `(("plugins"
721 ,(origin
722 (method git-fetch)
723 (uri (git-reference
724 (url "https://github.com/nomacs/nomacs-plugins")
725 (commit "3.16")))
726 (sha256
727 (base32
728 "1cpdwhfvaxm970nwdc1hc13848a85pqqi176m9xpa3krla9qskml"))))
729 ("exiv2" ,exiv2)
730 ("libraw" ,libraw)
731 ("libtiff" ,libtiff)
732 ("opencv" ,opencv)
733 ("python" ,python-wrapper)
734 ("quazip" ,quazip)
735 ("qtbase" ,qtbase)
736 ("qtsvg" ,qtsvg)))
737 (native-inputs
738 `(("pkg-config" ,pkg-config)
739 ("qtlinguist" ,qttools)))
740 (synopsis "Image viewer supporting all common formats")
741 (description "Nomacs is a simple to use image lounge featuring
742 semi-transparent widgets that display additional information such as metadata,
743 thumbnails and histograms. It is able to browse images compressed archives
744 and add notes to images.
745
746 Nomacs includes image manipulation methods for adjusting brightness, contrast,
747 saturation, hue, gamma, and exposure. It has a pseudo color function which
748 allows creating false color images. A unique feature of Nomacs is the
749 synchronization of multiple instances.")
750 (home-page "https://nomacs.org/")
751 (license license:gpl3+)))
752
753 (define-public xzgv
754 (package
755 (name "xzgv")
756 (version "0.9.2")
757 (source
758 (origin
759 (method url-fetch)
760 (uri (string-append "mirror://sourceforge/xzgv/"
761 version "/xzgv-" version ".tar.gz"))
762 (sha256
763 (base32 "17l1xr9v07ggwga3vn0z1i4lnwjrr20rr8z1kjbw71aaijxl18i5"))))
764 (build-system gnu-build-system)
765 (arguments
766 `(#:phases
767 (modify-phases %standard-phases
768 (add-after 'unpack 'override-target-directory
769 (lambda* (#:key outputs #:allow-other-keys)
770 (substitute* "config.mk"
771 (("/usr/local") (assoc-ref outputs "out")))))
772 (delete 'configure) ; no configure script
773 (replace 'install
774 (lambda* (#:key outputs #:allow-other-keys)
775 (let* ((out (assoc-ref outputs "out"))
776 (bin (string-append out "/bin")))
777 (install-file "src/xzgv" bin))))) ; just install the executable
778 #:tests? #f)) ; no rule for target 'test'
779 (native-inputs
780 `(("pkg-config" ,pkg-config)))
781 (inputs
782 `(("gtk+" ,gtk+-2)
783 ("libexif" ,libexif)))
784 (home-page "https://sourceforge.net/projects/xzgv/")
785 (synopsis "Picture viewer for X with a thumbnail-based selector")
786 (description
787 "xzgv is a fast image viewer that provides extensive keyboard support.")
788 (license license:gpl2+)))