gnu: Add eclib.
[jackhill/guix/guix.git] / gnu / packages / image-viewers.scm
CommitLineData
d1a5b200 1;;; GNU Guix --- Functional package management for GNU
e784e256 2;;; Copyright © 2013, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
d1a5b200
AK
3;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
4;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
307cdd66 5;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
f7e9f1ca 6;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
47956fa0 7;;; Copyright © 2017 ng0 <ng0@n0.is>
ed3a9ec5 8;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
4ee81d37 9;;; Copyright © 2017 nee <nee-git@hidamari.blue>
51a8fc8b 10;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
027f97b1 11;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
87036462 12;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
eb55f018 13;;;
d1a5b200
AK
14;;; This file is part of GNU Guix.
15;;;
eb55f018
EF
16;;; GNU Guix is free software; you can redistribute it and/or modify it
17;;; under the terms of the GNU General Public License as published by
18;;; the Free Software Foundation; either version 3 of the License, or (at
19;;; your option) any later version.
20;;;
21;;; GNU Guix is distributed in the hope that it will be useful, but
22;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24;;; GNU General Public License for more details.
25;;;
26;;; You should have received a copy of the GNU General Public License
27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29(define-module (gnu packages image-viewers)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix download)
92f08e14 32 #:use-module (guix git-download)
eb55f018
EF
33 #:use-module (guix packages)
34 #:use-module (guix build-system gnu)
9016dbc2 35 #:use-module (guix build-system cmake)
307cdd66 36 #:use-module (guix build-system meson)
4ee81d37 37 #:use-module (guix build-system python)
eb55f018 38 #:use-module (gnu packages autotools)
e79bfa18 39 #:use-module (gnu packages algebra)
e79bfa18
LC
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages compression)
d1a5b200 42 #:use-module (gnu packages curl)
6c162d0e 43 #:use-module (gnu packages fontutils)
307cdd66 44 #:use-module (gnu packages gettext)
d1a5b200 45 #:use-module (gnu packages ghostscript)
eb55f018
EF
46 #:use-module (gnu packages glib)
47 #:use-module (gnu packages gnome)
48 #:use-module (gnu packages gtk)
e79bfa18 49 #:use-module (gnu packages graphics)
023f0fb0 50 #:use-module (gnu packages image)
9016dbc2 51 #:use-module (gnu packages imagemagick)
e79bfa18 52 #:use-module (gnu packages maths)
83a7a88f 53 #:use-module (gnu packages perl)
5ccde207 54 #:use-module (gnu packages perl-check)
d1a5b200
AK
55 #:use-module (gnu packages photo)
56 #:use-module (gnu packages pkg-config)
4ee81d37 57 #:use-module (gnu packages python)
44d10b1f 58 #:use-module (gnu packages python-xyz)
e79bfa18
LC
59 #:use-module (gnu packages qt)
60 #:use-module (gnu packages xorg)
61 #:use-module (gnu packages))
d1a5b200
AK
62
63(define-public feh
64 (package
65 (name "feh")
fa212dec 66 (version "3.1.3")
d1a5b200
AK
67 (home-page "https://feh.finalrewind.org/")
68 (source (origin
69 (method url-fetch)
70 (uri (string-append home-page
71 name "-" version ".tar.bz2"))
72 (sha256
73 (base32
fa212dec 74 "1vsnxf4as3vyzjfhd8frzb1a8i7wnq7ck5ljx7qxqrnfqvxl1s4z"))))
d1a5b200
AK
75 (build-system gnu-build-system)
76 (arguments
dc1d3cde 77 '(#:phases (modify-phases %standard-phases (delete 'configure))
83a7a88f 78 #:test-target "test"
dc1d3cde 79 #:make-flags
0de33cb3
LF
80 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))
81 "exif=1")))
83a7a88f
MB
82 (native-inputs
83 `(("perl" ,perl)
84 ("perl-test-command" ,perl-test-command)))
d1a5b200
AK
85 (inputs `(("imlib2" ,imlib2)
86 ("curl" ,curl)
0de33cb3 87 ("libexif" ,libexif)
d1a5b200
AK
88 ("libpng" ,libpng)
89 ("libxt" ,libxt)
90 ("libx11" ,libx11)
91 ("libxinerama" ,libxinerama)))
3c41b992
MB
92 (native-search-paths
93 ;; Feh allows overriding the libcurl builtin CA path (unset in Guix)
94 ;; with the same variable as the `curl` command line HTTP tool.
dc138d6d 95 (package-native-search-paths curl))
d1a5b200
AK
96 (synopsis "Fast and light imlib2-based image viewer")
97 (description
98 "feh is an X11 image viewer aimed mostly at console users.
99Unlike most other viewers, it does not have a fancy GUI, but simply
100displays images. It can also be used to set the desktop wallpaper.
101It is controlled via commandline arguments and configurable key/mouse
102actions.")
103
104 ;; The license is really the Expat license, with additional wording in the
105 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
106 ;; software packages that this Software was used."
107 (license (license:x11-style
108 "file://COPYING"
109 "See 'COPYING' in the distribution."))))
110
111(define-public geeqie
112 (package
113 (name "geeqie")
e784e256 114 (version "1.4")
d1a5b200
AK
115 (source (origin
116 (method url-fetch)
117 (uri (string-append "https://github.com/BestImageViewer/geeqie/"
118 "releases/download/v" version "/geeqie-"
119 version ".tar.xz"))
120 (sha256
121 (base32
e784e256 122 "0ciygvcxb78pqg59r6p061mkbpvkgv2rv3r79j3kgv3kalb3ln2w"))))
d1a5b200
AK
123 (build-system gnu-build-system)
124 (arguments
048175e2
LC
125 `(;; Enable support for a "map" pane using GPS data.
126 #:configure-flags '("--enable-map")
127
128 #:phases
d1a5b200 129 (modify-phases %standard-phases
027f97b1 130 (add-before 'bootstrap 'pre-bootstrap
d1a5b200 131 (lambda _
e784e256
LC
132 (define (write-dummy-changelog port)
133 (display "See Git history for a change log.\n" port))
e784e256
LC
134 ;; Create ChangeLog{,.html} to placate the makefile, which would
135 ;; otherwise require access to the Git repo.
136 (call-with-output-file "ChangeLog"
137 write-dummy-changelog)
138 (call-with-output-file "ChangeLog.html"
139 write-dummy-changelog)
027f97b1
RW
140 (setenv "NOCONFIGURE" "true")
141 #t)))))
d1a5b200 142 (inputs
048175e2
LC
143 `(("clutter" ,clutter)
144 ("libchamplain" ,libchamplain)
d1a5b200
AK
145 ("lcms" ,lcms)
146 ("exiv2" ,exiv2)
147 ("libpng" ,libpng)
5d3f16e4 148 ("gtk+" ,gtk+)))
d1a5b200
AK
149 (native-inputs
150 `(("autoconf" ,autoconf)
151 ("automake" ,automake)
152 ("glib" ,glib "bin") ; glib-gettextize
153 ("intltool" ,intltool)
154 ("pkg-config" ,pkg-config)))
155 (home-page "http://www.geeqie.org/")
156 (synopsis "Lightweight GTK+ based image viewer")
157 (description
158 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
159systems. It features: EXIF, IPTC and XMP metadata browsing and editing
160interoperability; easy integration with other software; geeqie works on files
161and directories, there is no need to import images; fast preview for many raw
162image formats; tools for image comparison, sorting and managing photo
163collection. Geeqie was initially based on GQview.")
164 (license license:gpl2+)))
165
ed3a9ec5
MO
166(define-public gpicview
167 (package
168 (name "gpicview")
169 (version "0.2.5")
170 (source (origin
171 (method url-fetch)
172 (uri (string-append "mirror://sourceforge/lxde/"
173 "GPicView%20%28image%20Viewer%29/0.2.x/"
174 name "-" version ".tar.xz"))
175 (sha256
176 (base32
177 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
178 (build-system gnu-build-system)
179 (inputs `(("gtk+" ,gtk+-2)
180 ("libjpeg" ,libjpeg)))
181 (native-inputs `(("intltool" ,intltool)
182 ("pkg-config" ,pkg-config)))
183 (synopsis "Simple and fast image viewer for X")
184 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
185It is the default image viewer on LXDE desktop environment.")
186 (home-page "http://lxde.sourceforge.net/gpicview/")
187 (license license:gpl2+)))
188
d1a5b200
AK
189(define-public sxiv
190 (package
191 (name "sxiv")
56d2007e 192 (version "25")
d1a5b200 193 (source (origin
92f08e14
RW
194 (method git-fetch)
195 (uri (git-reference
196 (url "https://github.com/muennich/sxiv.git")
197 (commit (string-append "v" version))))
198 (file-name (git-file-name name version))
d1a5b200
AK
199 (sha256
200 (base32
56d2007e 201 "13s1lfar142hq1j7xld0ri616p4bqs57b17yr4d0b9a9w7liz4hp"))))
d1a5b200
AK
202 (build-system gnu-build-system)
203 (arguments
6c162d0e
TGR
204 `(#:tests? #f ; no check target
205 #:make-flags
206 (list (string-append "PREFIX=" %output)
207 "CC=gcc"
208 ;; Xft.h #includes <ft2build.h> (without ‘freetype2/’). The sxiv
209 ;; Makefile works around this by hard-coding /usr/include instead.
56d2007e 210 (string-append "CPPFLAGS=-I"
6c162d0e
TGR
211 (assoc-ref %build-inputs "freetype")
212 "/include/freetype2")
213 "V=1")
214 #:phases
215 (modify-phases %standard-phases
216 (delete 'configure)))) ; no configure script
d1a5b200 217 (inputs
6c162d0e 218 `(("freetype" ,freetype)
d1a5b200 219 ("giflib" ,giflib)
6c162d0e
TGR
220 ("imlib2" ,imlib2)
221 ("libexif" ,libexif)
222 ("libx11" ,libx11)
223 ("libxft" ,libxft)))
d1a5b200
AK
224 (home-page "https://github.com/muennich/sxiv")
225 (synopsis "Simple X Image Viewer")
226 (description
227 "sxiv is an alternative to feh and qiv. Its primary goal is to
228provide the most basic features required for fast image viewing. It has
229vi key bindings and works nicely with tiling window managers. Its code
230base should be kept small and clean to make it easy for you to dig into
231it and customize it for your needs.")
232 (license license:gpl2+)))
eb55f018
EF
233
234(define-public viewnior
235 (package
236 (name "viewnior")
307cdd66 237 (version "1.7")
eb55f018
EF
238 (source
239 (origin
83541fb6
EF
240 (method git-fetch)
241 (uri (git-reference
242 (url "https://github.com/hellosiyan/Viewnior.git")
243 (commit (string-append name "-" version))))
244 (file-name (git-file-name name version))
eb55f018
EF
245 (sha256
246 (base32
83541fb6 247 "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
307cdd66 248 (build-system meson-build-system)
eb55f018
EF
249 (arguments
250 '(#:phases
251 (modify-phases %standard-phases
307cdd66 252 (add-after 'unpack 'patch-source
ea77385c
EF
253 (lambda _
254 ;; Don't create 'icon-theme.cache'
307cdd66
EF
255 (substitute* "meson.build"
256 (("meson.add_install_script*") ""))
257 #t)))
258 #:tests? #f)) ; no tests
eb55f018 259 (native-inputs
307cdd66 260 `(("gettext" ,gettext-minimal)
eb55f018 261 ("glib" ,glib "bin") ; glib-genmarshal
eb55f018 262 ("pkg-config" ,pkg-config)
307cdd66 263 ("shared-mime-info" ,shared-mime-info)))
eb55f018
EF
264 (inputs
265 `(("exiv2" ,exiv2)
266 ("gdk-pixbuf" ,gdk-pixbuf)
267 ("gtk+-2" ,gtk+-2)))
307cdd66 268 (home-page "http://siyanpanayotov.com/project/viewnior")
eb55f018
EF
269 (synopsis "Simple, fast and elegant image viewer")
270 (description "Viewnior is an image viewer program. Created to be simple,
271fast and elegant. Its minimalistic interface provides more screenspace for
272your images. Among its features are:
273@enumerate
274@item Fullscreen & Slideshow
275@item Rotate, flip, crop, save, delete images
276@item Animation support
277@item Browse only selected images
278@item Navigation window
279@item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
280@item Simple interface
281@item EXIF and IPTC metadata
282@item Configurable mouse actions
283@end enumerate\n")
284 (license license:gpl3+)))
9016dbc2 285
286(define-public catimg
287 (package
288 (name "catimg")
cdee738e 289 (version "2.5.0")
9016dbc2 290 (source
291 (origin
6f6f9267
RW
292 (method git-fetch)
293 (uri (git-reference
294 (url "https://github.com/posva/catimg.git")
cdee738e 295 (commit version)))
6f6f9267 296 (file-name (git-file-name name version))
9016dbc2 297 (sha256
cdee738e 298 (base32 "0n74iczzgxrcq3zpa7ndycb9rinm829yvf81c747q4ngv5q6pzcm"))))
9016dbc2 299 (build-system cmake-build-system)
300 (arguments
1e5c056c 301 `(#:tests? #f ; no tests
9016dbc2 302 #:phases
303 (modify-phases %standard-phases
e2f47efe 304 (add-after 'unpack 'patch-convert
9016dbc2 305 (lambda _
e2f47efe
RW
306 (substitute* "catimg"
307 ;; By replacing "convert", we also replace the "convert"
308 ;; in the message 'The version of convert is too old, don't
309 ;; expect good results :('. This should not happen, but in
310 ;; practice this error message should not affect us.
311 (("convert") (which "convert")))
312 #t))
313 (add-after 'install 'install-script
9016dbc2 314 (lambda* (#:key outputs #:allow-other-keys)
1e5c056c 315 ;; The bash script lacks an file extension. We have to rename
9016dbc2 316 ;; it so that the C program and the bash script can be happy
317 ;; side by side.
e2f47efe
RW
318 (copy-file "../source/catimg"
319 (string-append (assoc-ref outputs "out")
320 "/bin/catimg.sh"))
321 #t)))))
9016dbc2 322 (inputs
1e5c056c 323 `(("imagemagick" ,imagemagick))) ; for the bash script version
9016dbc2 324 (home-page "https://github.com/posva/catimg")
325 (synopsis "Render images in the terminal")
326 (description
327 "Catimg is a little program that prints images in the terminal.
328It supports JPEG, PNG and GIF formats.")
329 (license license:expat)))
e79bfa18
LC
330
331(define-public luminance-hdr
332 (package
333 (name "luminance-hdr")
334 (version "2.4.0")
335 (source (origin
336 (method url-fetch)
337 (uri (string-append
338 "mirror://sourceforge/qtpfsgui/luminance/"
339 version "/luminance-hdr-" version ".tar.bz2"))
340 (sha256
341 (base32
342 "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l"))
343 (patches (search-patches "luminance-hdr-qt-printer.patch"))))
344 (build-system cmake-build-system)
345 (native-inputs
346 `(("pkg-config" ,pkg-config)
347 ("qttools" ,qttools)))
348 (inputs
349 `(("qtbase" ,qtbase)
350 ("qtdeclarative" ,qtdeclarative)
351 ("qtwebkit" ,qtwebkit)
352 ("boost" ,boost)
353 ;; ("gtest" ,gtest)
354 ("libraw" ,libraw)
355 ("zlib" ,zlib)
356 ("exiv2" ,exiv2)
357 ("libpng" ,libpng)
358 ("libjpeg" ,libjpeg)
359 ("lcms" ,lcms)
360 ("openexr" ,openexr)
361 ("fftw" ,fftwf)
362 ("gsl" ,gsl)
363 ("libtiff" ,libtiff)))
364 (arguments
365 '(#:phases
366 (modify-phases %standard-phases
367 (add-after 'set-paths 'add-ilmbase-include-path
368 (lambda* (#:key inputs #:allow-other-keys)
369 ;; 'OpenEXR.pc' has a -I for IlmBase but 'FindOpenEXR.cmake' does
370 ;; not use 'OpenEXR.pc'. Thus, we need to add
371 ;; "$ilmbase/include/OpenEXR/" to the CPATH.
372 (setenv "CPATH"
373 (string-append (assoc-ref inputs "ilmbase")
374 "/include/OpenEXR"
375 ":" (or (getenv "CPATH") "")))
376 #t)))))
377 (home-page "http://qtpfsgui.sourceforge.net")
378 (synopsis "High dynamic range (HDR) imaging application")
379 (description
380 "Luminance HDR (formerly QtPFSGui) is a graphical user interface
381application that aims to provide a workflow for high dynamic range (HDR)
382imaging. It supports several HDR and LDR image formats, and it can:
383
384@itemize
385@item Create an HDR file from a set of images (formats: JPEG, TIFF 8bit and
38616bit, RAW) of the same scene taken at different exposure setting;
387@item Save load HDR images;
388@item Rotate, resize and crop HDR images;
389@item Tone-map HDR images;
390@item Copy EXIF data between sets of images.
391@end itemize\n")
392 (license license:gpl2+)))
4ee81d37 393
394;; CBR and RAR are currently unsupported, due to non-free dependencies.
395;; For optional PDF support, you can install the mupdf package.
396(define-public mcomix
397 (package
398 (name "mcomix")
399 (version "1.2.1")
400 (source
401 (origin
402 (method url-fetch)
403 (uri (string-append "mirror://sourceforge/mcomix/MComix-" version
404 "/mcomix-" version ".tar.bz2"))
405 (sha256
406 (base32
407 "0fzsf9pklhfs1rzwzj64c0v30b74nk94p93h371rpg45qnfiahvy"))))
408 (build-system python-build-system)
409 (inputs
410 `(("p7zip" ,p7zip)
411 ("python2-pillow" ,python2-pillow)
412 ("python2-pygtk" ,python2-pygtk)))
413 (arguments
414 ;; Python 2.5 or newer (Python 3 and up is not supported)
415 `(#:python ,python-2
21169e31 416 #:tests? #f ; there are no tests
4ee81d37 417 #:phases
418 (modify-phases %standard-phases
419 (add-after 'unpack 'configure
420 (lambda* (#:key inputs #:allow-other-keys)
421 (let ((p7zip (assoc-ref inputs "p7zip")))
422 ;; insert absolute path to 7z executable
423 (substitute* "mcomix/archive/sevenzip_external.py"
424 (("_7z_executable = -1")
425 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
426 #t)))))
427 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
428 (synopsis "Image viewer for comics")
429 (description "MComix is a customizable image viewer that specializes as
430a comic and manga reader. It supports a variety of container formats
431including CBZ, CB7, CBT, LHA.")
432 (license license:gpl2+)))
87036462
NG
433
434(define-public qview
435 (package
436 (name "qview")
437 (version "2.0")
438 (source (origin
439 (method git-fetch)
440 (uri (git-reference
441 (url "https://github.com/jurplel/qView.git")
442 (commit version)))
443 (sha256
444 (base32
445 "1s29hz44rb5dwzq8d4i4bfg77dr0v3ywpvidpa6xzg7hnnv3mhi5"))))
446 (build-system gnu-build-system)
447 (arguments
448 `(#:phases
449 (modify-phases %standard-phases
450 (replace 'configure
451 (lambda _
452 (invoke "qmake")))
453 ;; Installation process hard-codes "/usr/bin", possibly
454 ;; prefixed.
455 (add-after 'configure 'fix-install-directory
456 (lambda* (#:key outputs #:allow-other-keys)
457 (let ((out (assoc-ref outputs "out")))
458 (substitute* "Makefile"
459 (("\\$\\(INSTALL_ROOT\\)/usr") out))
460 #t)))
461 ;; Don't phone home or show "Checking for updates..." in the
462 ;; About menu.
463 (add-before 'build 'disable-auto-update
464 (lambda _
465 (substitute* "src/qvaboutdialog.cpp"
466 (("ui->updateLabel->setText\\(updateText\\);") "")
467 (("requestUpdates\\(\\);") ""))
468 #t)))))
469 (inputs
470 `(("qtbase" ,qtbase)
471 ("qtsvg" ,qtsvg)
472 ("qtimageformats" ,qtimageformats)))
473 (home-page "https://interversehq.com/qview/")
474 (synopsis "Convenient and minimal image viewer")
475 (description "qView is a Qt image viewer designed with visually
476minimalism and usability in mind. Its features include animated GIF
477controls, file history, rotation/mirroring, and multithreaded
478preloading.")
479 (license license:gpl3+)))