gnu: Add wl-clipboard.
[jackhill/guix/guix.git] / gnu / packages / image-viewers.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017, 2018 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 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
7 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
8 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
9 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
10 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages image-viewers)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix packages)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system meson)
36 #:use-module (guix build-system python)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages algebra)
39 #:use-module (gnu packages boost)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages curl)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages gettext)
44 #:use-module (gnu packages ghostscript)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages gnome)
47 #:use-module (gnu packages gtk)
48 #:use-module (gnu packages graphics)
49 #:use-module (gnu packages image)
50 #:use-module (gnu packages imagemagick)
51 #:use-module (gnu packages maths)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages perl-check)
54 #:use-module (gnu packages photo)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages qt)
58 #:use-module (gnu packages xorg)
59 #:use-module (gnu packages))
60
61 (define-public feh
62 (package
63 (name "feh")
64 (version "3.1.1")
65 (home-page "https://feh.finalrewind.org/")
66 (source (origin
67 (method url-fetch)
68 (uri (string-append home-page
69 name "-" version ".tar.bz2"))
70 (sha256
71 (base32
72 "1sy8z6rv5sy1bhk3846hgfdy96wdi874yr2fnxfprks46qp29l31"))))
73 (build-system gnu-build-system)
74 (arguments
75 '(#:phases (modify-phases %standard-phases (delete 'configure))
76 #:test-target "test"
77 #:make-flags
78 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))
79 "exif=1")))
80 (native-inputs
81 `(("perl" ,perl)
82 ("perl-test-command" ,perl-test-command)))
83 (inputs `(("imlib2" ,imlib2)
84 ("curl" ,curl)
85 ("libexif" ,libexif)
86 ("libpng" ,libpng)
87 ("libxt" ,libxt)
88 ("libx11" ,libx11)
89 ("libxinerama" ,libxinerama)))
90 (native-search-paths
91 ;; Feh allows overriding the libcurl builtin CA path (unset in Guix)
92 ;; with the same variable as the `curl` command line HTTP tool.
93 (package-native-search-paths curl))
94 (synopsis "Fast and light imlib2-based image viewer")
95 (description
96 "feh is an X11 image viewer aimed mostly at console users.
97 Unlike most other viewers, it does not have a fancy GUI, but simply
98 displays images. It can also be used to set the desktop wallpaper.
99 It is controlled via commandline arguments and configurable key/mouse
100 actions.")
101
102 ;; The license is really the Expat license, with additional wording in the
103 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
104 ;; software packages that this Software was used."
105 (license (license:x11-style
106 "file://COPYING"
107 "See 'COPYING' in the distribution."))))
108
109 (define-public geeqie
110 (package
111 (name "geeqie")
112 (version "1.4")
113 (source (origin
114 (method url-fetch)
115 (uri (string-append "https://github.com/BestImageViewer/geeqie/"
116 "releases/download/v" version "/geeqie-"
117 version ".tar.xz"))
118 (sha256
119 (base32
120 "0ciygvcxb78pqg59r6p061mkbpvkgv2rv3r79j3kgv3kalb3ln2w"))))
121 (build-system gnu-build-system)
122 (arguments
123 `(;; Enable support for a "map" pane using GPS data.
124 #:configure-flags '("--enable-map")
125
126 #:phases
127 (modify-phases %standard-phases
128 (add-after 'unpack 'autogen
129 (lambda _
130 (define (write-dummy-changelog port)
131 (display "See Git history for a change log.\n" port))
132
133 (setenv "NOCONFIGURE" "true")
134
135 ;; Create ChangeLog{,.html} to placate the makefile, which would
136 ;; otherwise require access to the Git repo.
137 (call-with-output-file "ChangeLog"
138 write-dummy-changelog)
139 (call-with-output-file "ChangeLog.html"
140 write-dummy-changelog)
141
142 (zero? (system* "sh" "autogen.sh")))))))
143 (inputs
144 `(("clutter" ,clutter)
145 ("libchamplain" ,libchamplain)
146 ("lcms" ,lcms)
147 ("exiv2" ,exiv2)
148 ("libpng" ,libpng)
149 ("gtk+" ,gtk+-2)))
150 (native-inputs
151 `(("autoconf" ,autoconf)
152 ("automake" ,automake)
153 ("glib" ,glib "bin") ; glib-gettextize
154 ("intltool" ,intltool)
155 ("pkg-config" ,pkg-config)))
156 (home-page "http://www.geeqie.org/")
157 (synopsis "Lightweight GTK+ based image viewer")
158 (description
159 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
160 systems. It features: EXIF, IPTC and XMP metadata browsing and editing
161 interoperability; easy integration with other software; geeqie works on files
162 and directories, there is no need to import images; fast preview for many raw
163 image formats; tools for image comparison, sorting and managing photo
164 collection. Geeqie was initially based on GQview.")
165 (license license:gpl2+)))
166
167 (define-public gpicview
168 (package
169 (name "gpicview")
170 (version "0.2.5")
171 (source (origin
172 (method url-fetch)
173 (uri (string-append "mirror://sourceforge/lxde/"
174 "GPicView%20%28image%20Viewer%29/0.2.x/"
175 name "-" version ".tar.xz"))
176 (sha256
177 (base32
178 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
179 (build-system gnu-build-system)
180 (inputs `(("gtk+" ,gtk+-2)
181 ("libjpeg" ,libjpeg)))
182 (native-inputs `(("intltool" ,intltool)
183 ("pkg-config" ,pkg-config)))
184 (synopsis "Simple and fast image viewer for X")
185 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
186 It is the default image viewer on LXDE desktop environment.")
187 (home-page "http://lxde.sourceforge.net/gpicview/")
188 (license license:gpl2+)))
189
190 (define-public sxiv
191 (package
192 (name "sxiv")
193 (version "24")
194 (source (origin
195 (method git-fetch)
196 (uri (git-reference
197 (url "https://github.com/muennich/sxiv.git")
198 (commit (string-append "v" version))))
199 (file-name (git-file-name name version))
200 (sha256
201 (base32
202 "020n1bdxbzqncprh8a4rnjzc4frp335yxbqh5w6dr970f7n5qm8d"))))
203 (build-system gnu-build-system)
204 (arguments
205 `(#:tests? #f ; no check target
206 #:make-flags
207 (list (string-append "PREFIX=" %output)
208 "CC=gcc"
209 ;; Xft.h #includes <ft2build.h> (without ‘freetype2/’). The sxiv
210 ;; Makefile works around this by hard-coding /usr/include instead.
211 (string-append "DEF_CPPFLAGS=-I"
212 (assoc-ref %build-inputs "freetype")
213 "/include/freetype2")
214 "V=1")
215 #:phases
216 (modify-phases %standard-phases
217 (delete 'configure)))) ; no configure script
218 (inputs
219 `(("freetype" ,freetype)
220 ("giflib" ,giflib)
221 ("imlib2" ,imlib2)
222 ("libexif" ,libexif)
223 ("libx11" ,libx11)
224 ("libxft" ,libxft)))
225 (home-page "https://github.com/muennich/sxiv")
226 (synopsis "Simple X Image Viewer")
227 (description
228 "sxiv is an alternative to feh and qiv. Its primary goal is to
229 provide the most basic features required for fast image viewing. It has
230 vi key bindings and works nicely with tiling window managers. Its code
231 base should be kept small and clean to make it easy for you to dig into
232 it and customize it for your needs.")
233 (license license:gpl2+)))
234
235 (define-public viewnior
236 (package
237 (name "viewnior")
238 (version "1.7")
239 (source
240 (origin
241 (method git-fetch)
242 (uri (git-reference
243 (url "https://github.com/hellosiyan/Viewnior.git")
244 (commit (string-append name "-" version))))
245 (file-name (git-file-name name version))
246 (sha256
247 (base32
248 "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
249 (build-system meson-build-system)
250 (arguments
251 '(#:phases
252 (modify-phases %standard-phases
253 (add-after 'unpack 'patch-source
254 (lambda _
255 ;; Don't create 'icon-theme.cache'
256 (substitute* "meson.build"
257 (("meson.add_install_script*") ""))
258 #t)))
259 #:tests? #f)) ; no tests
260 (native-inputs
261 `(("gettext" ,gettext-minimal)
262 ("glib" ,glib "bin") ; glib-genmarshal
263 ("pkg-config" ,pkg-config)
264 ("shared-mime-info" ,shared-mime-info)))
265 (inputs
266 `(("exiv2" ,exiv2)
267 ("gdk-pixbuf" ,gdk-pixbuf)
268 ("gtk+-2" ,gtk+-2)))
269 (home-page "http://siyanpanayotov.com/project/viewnior")
270 (synopsis "Simple, fast and elegant image viewer")
271 (description "Viewnior is an image viewer program. Created to be simple,
272 fast and elegant. Its minimalistic interface provides more screenspace for
273 your images. Among its features are:
274 @enumerate
275 @item Fullscreen & Slideshow
276 @item Rotate, flip, crop, save, delete images
277 @item Animation support
278 @item Browse only selected images
279 @item Navigation window
280 @item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
281 @item Simple interface
282 @item EXIF and IPTC metadata
283 @item Configurable mouse actions
284 @end enumerate\n")
285 (license license:gpl3+)))
286
287 (define-public catimg
288 (package
289 (name "catimg")
290 (version "2.4.0")
291 (source
292 (origin
293 (method git-fetch)
294 (uri (git-reference
295 (url "https://github.com/posva/catimg.git")
296 (commit (string-append "v" version))))
297 (file-name (git-file-name name version))
298 (sha256
299 (base32
300 "1sk74nfc1aklg784pzknr37dyz4k7h9fck3mifpn43rav5qy2zpy"))))
301 (build-system cmake-build-system)
302 (arguments
303 `(#:tests? #f ; no tests
304 #:phases
305 (modify-phases %standard-phases
306 (replace 'configure
307 (lambda* (#:key inputs #:allow-other-keys)
308 (let* ((magic (assoc-ref %build-inputs "imagemagick"))
309 (convert (string-append magic "/bin/convert")))
310 (substitute* "catimg"
311 ;; By replacing "convert", we also replace the "convert"
312 ;; in the message 'The version of convert is too old, don't
313 ;; expect good results :('. This should not happen, but in
314 ;; practice this error message should not affect us.
315 (("convert") convert))
316 #t)))
317 (replace 'build
318 (lambda _
319 (let* ((out (assoc-ref %outputs "out"))
320 (man (string-append out "/share/man/man1")))
321 (zero? (system* "cmake"
322 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
323 (string-append "-DMAN_OUTPUT_PATH=" man)
324 "."))
325 (zero? (system* "make")))))
326 (add-before '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 (let* ((out (assoc-ref outputs "out"))
332 (bin (string-append out "/bin")))
333 (install-file "catimg" bin)
334 (rename-file (string-append bin "/catimg")
335 (string-append bin "/catimg.sh"))
336 #t))))))
337 (inputs
338 `(("imagemagick" ,imagemagick))) ; for the bash script version
339 (home-page "https://github.com/posva/catimg")
340 (synopsis "Render images in the terminal")
341 (description
342 "Catimg is a little program that prints images in the terminal.
343 It supports JPEG, PNG and GIF formats.")
344 (license license:expat)))
345
346 (define-public luminance-hdr
347 (package
348 (name "luminance-hdr")
349 (version "2.4.0")
350 (source (origin
351 (method url-fetch)
352 (uri (string-append
353 "mirror://sourceforge/qtpfsgui/luminance/"
354 version "/luminance-hdr-" version ".tar.bz2"))
355 (sha256
356 (base32
357 "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l"))
358 (patches (search-patches "luminance-hdr-qt-printer.patch"))))
359 (build-system cmake-build-system)
360 (native-inputs
361 `(("pkg-config" ,pkg-config)
362 ("qttools" ,qttools)))
363 (inputs
364 `(("qtbase" ,qtbase)
365 ("qtdeclarative" ,qtdeclarative)
366 ("qtwebkit" ,qtwebkit)
367 ("boost" ,boost)
368 ;; ("gtest" ,gtest)
369 ("libraw" ,libraw)
370 ("zlib" ,zlib)
371 ("exiv2" ,exiv2)
372 ("libpng" ,libpng)
373 ("libjpeg" ,libjpeg)
374 ("lcms" ,lcms)
375 ("openexr" ,openexr)
376 ("fftw" ,fftwf)
377 ("gsl" ,gsl)
378 ("libtiff" ,libtiff)))
379 (arguments
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 ;; For optional PDF support, you can install the mupdf package.
411 (define-public mcomix
412 (package
413 (name "mcomix")
414 (version "1.2.1")
415 (source
416 (origin
417 (method url-fetch)
418 (uri (string-append "mirror://sourceforge/mcomix/MComix-" version
419 "/mcomix-" version ".tar.bz2"))
420 (sha256
421 (base32
422 "0fzsf9pklhfs1rzwzj64c0v30b74nk94p93h371rpg45qnfiahvy"))))
423 (build-system python-build-system)
424 (inputs
425 `(("p7zip" ,p7zip)
426 ("python2-pillow" ,python2-pillow)
427 ("python2-pygtk" ,python2-pygtk)))
428 (arguments
429 ;; Python 2.5 or newer (Python 3 and up is not supported)
430 `(#:python ,python-2
431 #:tests? #f ; there are no tests
432 #:phases
433 (modify-phases %standard-phases
434 (add-after 'unpack 'configure
435 (lambda* (#:key inputs #:allow-other-keys)
436 (let ((p7zip (assoc-ref inputs "p7zip")))
437 ;; insert absolute path to 7z executable
438 (substitute* "mcomix/archive/sevenzip_external.py"
439 (("_7z_executable = -1")
440 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
441 #t)))))
442 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
443 (synopsis "Image viewer for comics")
444 (description "MComix is a customizable image viewer that specializes as
445 a comic and manga reader. It supports a variety of container formats
446 including CBZ, CB7, CBT, LHA.")
447 (license license:gpl2+)))