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