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