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