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