gnu: Add texlive-latex-etoolbox.
[jackhill/guix/guix.git] / gnu / packages / image-viewers.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017 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 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
7 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
8 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
9 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages image-viewers)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix download)
29 #:use-module (guix packages)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system cmake)
32 #:use-module (guix build-system python)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages algebra)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages boost)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages curl)
39 #:use-module (gnu packages ghostscript)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages graphics)
44 #:use-module (gnu packages image)
45 #:use-module (gnu packages imagemagick)
46 #:use-module (gnu packages maths)
47 #:use-module (gnu packages photo)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages python)
50 #:use-module (gnu packages qt)
51 #:use-module (gnu packages xorg)
52 #:use-module (gnu packages))
53
54 (define-public feh
55 (package
56 (name "feh")
57 (version "2.19")
58 (home-page "https://feh.finalrewind.org/")
59 (source (origin
60 (method url-fetch)
61 (uri (string-append home-page
62 name "-" version ".tar.bz2"))
63 (sha256
64 (base32
65 "1sfhr6628xpj9p6bqihdq35y139x2gmrpydjlrwsl1rs77c2bgnf"))))
66 (build-system gnu-build-system)
67 (arguments
68 '(#:phases (alist-delete 'configure %standard-phases)
69 #:tests? #f
70 #:make-flags
71 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))))
72 (inputs `(("imlib2" ,imlib2)
73 ("curl" ,curl)
74 ("libpng" ,libpng)
75 ("libxt" ,libxt)
76 ("libx11" ,libx11)
77 ("libxinerama" ,libxinerama)))
78 (synopsis "Fast and light imlib2-based image viewer")
79 (description
80 "feh is an X11 image viewer aimed mostly at console users.
81 Unlike most other viewers, it does not have a fancy GUI, but simply
82 displays images. It can also be used to set the desktop wallpaper.
83 It is controlled via commandline arguments and configurable key/mouse
84 actions.")
85
86 ;; The license is really the Expat license, with additional wording in the
87 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
88 ;; software packages that this Software was used."
89 (license (license:x11-style
90 "file://COPYING"
91 "See 'COPYING' in the distribution."))))
92
93 (define-public geeqie
94 (package
95 (name "geeqie")
96 (version "1.3")
97 (source (origin
98 (method url-fetch)
99 (uri (string-append "https://github.com/BestImageViewer/geeqie/"
100 "releases/download/v" version "/geeqie-"
101 version ".tar.xz"))
102 (sha256
103 (base32
104 "0gzc82sy66pbsmq7lnmq4y37zqad1zfwfls3ik3dmfm8s5nmcvsb"))))
105 (build-system gnu-build-system)
106 (arguments
107 `(;; Enable support for a "map" pane using GPS data.
108 #:configure-flags '("--enable-map")
109
110 #:phases
111 (modify-phases %standard-phases
112 (add-after 'unpack 'autogen
113 (lambda _
114 (setenv "NOCONFIGURE" "true")
115 (zero? (system* "sh" "autogen.sh")))))))
116 (inputs
117 `(("clutter" ,clutter)
118 ("libchamplain" ,libchamplain)
119 ("lcms" ,lcms)
120 ("exiv2" ,exiv2)
121 ("libpng" ,libpng)
122 ("gtk+" ,gtk+-2)))
123 (native-inputs
124 `(("autoconf" ,autoconf)
125 ("automake" ,automake)
126 ("glib" ,glib "bin") ; glib-gettextize
127 ("intltool" ,intltool)
128 ("pkg-config" ,pkg-config)))
129 (home-page "http://www.geeqie.org/")
130 (synopsis "Lightweight GTK+ based image viewer")
131 (description
132 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
133 systems. It features: EXIF, IPTC and XMP metadata browsing and editing
134 interoperability; easy integration with other software; geeqie works on files
135 and directories, there is no need to import images; fast preview for many raw
136 image formats; tools for image comparison, sorting and managing photo
137 collection. Geeqie was initially based on GQview.")
138 (license license:gpl2+)))
139
140 (define-public gpicview
141 (package
142 (name "gpicview")
143 (version "0.2.5")
144 (source (origin
145 (method url-fetch)
146 (uri (string-append "mirror://sourceforge/lxde/"
147 "GPicView%20%28image%20Viewer%29/0.2.x/"
148 name "-" version ".tar.xz"))
149 (sha256
150 (base32
151 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
152 (build-system gnu-build-system)
153 (inputs `(("gtk+" ,gtk+-2)
154 ("libjpeg" ,libjpeg)))
155 (native-inputs `(("intltool" ,intltool)
156 ("pkg-config" ,pkg-config)))
157 (synopsis "Simple and fast image viewer for X")
158 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
159 It is the default image viewer on LXDE desktop environment.")
160 (home-page "http://lxde.sourceforge.net/gpicview/")
161 (license license:gpl2+)))
162
163 (define-public sxiv
164 (package
165 (name "sxiv")
166 (version "1.3.2")
167 (source (origin
168 (method url-fetch)
169 (uri (string-append
170 "https://github.com/muennich/sxiv/archive/v"
171 version ".tar.gz"))
172 (file-name (string-append name "-" version ".tar.gz"))
173 (sha256
174 (base32
175 "0lxnd33gaw4drhdwbkk94wzrjyhh64d57jq2ps7ffmqgizg6hlwz"))))
176 (build-system gnu-build-system)
177 (arguments
178 '(#:tests? #f ; no check target
179 #:make-flags (list (string-append "PREFIX=" %output)
180 "CC=gcc")
181 #:phases (alist-delete
182 'configure ; no configure phase
183 %standard-phases)))
184 (inputs
185 `(("libx11" ,libx11)
186 ("imlib2" ,imlib2)
187 ("giflib" ,giflib)
188 ("libexif" ,libexif)))
189 (home-page "https://github.com/muennich/sxiv")
190 (synopsis "Simple X Image Viewer")
191 (description
192 "sxiv is an alternative to feh and qiv. Its primary goal is to
193 provide the most basic features required for fast image viewing. It has
194 vi key bindings and works nicely with tiling window managers. Its code
195 base should be kept small and clean to make it easy for you to dig into
196 it and customize it for your needs.")
197 (license license:gpl2+)))
198
199 (define-public viewnior
200 (package
201 (name "viewnior")
202 (version "1.6")
203 (source
204 (origin
205 (method url-fetch)
206 (uri (string-append "https://github.com/xsisqox/Viewnior/archive/"
207 name "-" version ".tar.gz"))
208 (sha256
209 (base32
210 "18309qjgwak3kn228z3p3nx7yxasqgzx69v3rgc23hf161nky0c9"))))
211 (build-system gnu-build-system)
212 (arguments
213 '(#:phases
214 (modify-phases %standard-phases
215 (add-after 'unpack 'autogen
216 (lambda _
217 (zero? (system* "sh" "autogen.sh")))))))
218 (native-inputs
219 `(("automake" ,automake)
220 ("autoconf" ,autoconf)
221 ("intltool" ,intltool)
222 ("glib" ,glib "bin") ; glib-genmarshal
223 ("gnome-common" ,gnome-common)
224 ("libtool" ,libtool)
225 ("pkg-config" ,pkg-config)
226 ("shared-mime-info" ,shared-mime-info)
227 ("which" ,which)))
228 (inputs
229 `(("exiv2" ,exiv2)
230 ("gdk-pixbuf" ,gdk-pixbuf)
231 ("gtk+-2" ,gtk+-2)))
232 (home-page "http://siyanpanayotov.com/project/viewnior/")
233 (synopsis "Simple, fast and elegant image viewer")
234 (description "Viewnior is an image viewer program. Created to be simple,
235 fast and elegant. Its minimalistic interface provides more screenspace for
236 your images. Among its features are:
237 @enumerate
238 @item Fullscreen & Slideshow
239 @item Rotate, flip, crop, save, delete images
240 @item Animation support
241 @item Browse only selected images
242 @item Navigation window
243 @item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
244 @item Simple interface
245 @item EXIF and IPTC metadata
246 @item Configurable mouse actions
247 @end enumerate\n")
248 (license license:gpl3+)))
249
250 (define-public catimg
251 (package
252 (name "catimg")
253 (version "2.3.2")
254 (source
255 (origin
256 (method url-fetch)
257 (uri (string-append "https://github.com/posva/catimg/archive"
258 "/v" version ".tar.gz"))
259 (file-name (string-append name "-" version ".tar.gz"))
260 (sha256
261 (base32
262 "0n78sl8mxyky9zcih2znzcnb9dbfmvmrdwzj73jcxfh531cgcpi9"))))
263 (build-system cmake-build-system)
264 (arguments
265 `(#:tests? #f ; no tests
266 #:phases
267 (modify-phases %standard-phases
268 (replace 'configure
269 (lambda* (#:key inputs #:allow-other-keys)
270 (let* ((magic (assoc-ref %build-inputs "imagemagick"))
271 (convert (string-append magic "/bin/convert")))
272 (substitute* "catimg"
273 ;; By replacing "convert", we also replace the "convert"
274 ;; in the message 'The version of convert is too old, don't
275 ;; expect good results :('. This should not happen, but in
276 ;; practice this error message should not affect us.
277 (("convert") convert))
278 #t)))
279 (replace 'build
280 (lambda _
281 (let* ((out (assoc-ref %outputs "out"))
282 (man (string-append out "/share/man/man1")))
283 (zero? (system* "cmake"
284 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
285 (string-append "-DMAN_OUTPUT_PATH=" man)
286 "."))
287 (zero? (system* "make")))))
288 (add-before 'install 'install-script
289 (lambda* (#:key outputs #:allow-other-keys)
290 ;; The bash script lacks an file extension. We have to rename
291 ;; it so that the C program and the bash script can be happy
292 ;; side by side.
293 (let* ((out (assoc-ref outputs "out"))
294 (bin (string-append out "/bin")))
295 (install-file "catimg" bin)
296 (rename-file (string-append bin "/catimg")
297 (string-append bin "/catimg.sh"))
298 #t))))))
299 (inputs
300 `(("imagemagick" ,imagemagick))) ; for the bash script version
301 (home-page "https://github.com/posva/catimg")
302 (synopsis "Render images in the terminal")
303 (description
304 "Catimg is a little program that prints images in the terminal.
305 It supports JPEG, PNG and GIF formats.")
306 (license license:expat)))
307
308 (define-public luminance-hdr
309 (package
310 (name "luminance-hdr")
311 (version "2.4.0")
312 (source (origin
313 (method url-fetch)
314 (uri (string-append
315 "mirror://sourceforge/qtpfsgui/luminance/"
316 version "/luminance-hdr-" version ".tar.bz2"))
317 (sha256
318 (base32
319 "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l"))
320 (patches (search-patches "luminance-hdr-qt-printer.patch"))))
321 (build-system cmake-build-system)
322 (native-inputs
323 `(("pkg-config" ,pkg-config)
324 ("qttools" ,qttools)))
325 (inputs
326 `(("qtbase" ,qtbase)
327 ("qtdeclarative" ,qtdeclarative)
328 ("qtwebkit" ,qtwebkit)
329 ("boost" ,boost)
330 ;; ("gtest" ,gtest)
331 ("libraw" ,libraw)
332 ("zlib" ,zlib)
333 ("exiv2" ,exiv2)
334 ("libpng" ,libpng)
335 ("libjpeg" ,libjpeg)
336 ("lcms" ,lcms)
337 ("openexr" ,openexr)
338 ("fftw" ,fftwf)
339 ("gsl" ,gsl)
340 ("libtiff" ,libtiff)))
341 (arguments
342 '(#:phases
343 (modify-phases %standard-phases
344 (add-after 'set-paths 'add-ilmbase-include-path
345 (lambda* (#:key inputs #:allow-other-keys)
346 ;; 'OpenEXR.pc' has a -I for IlmBase but 'FindOpenEXR.cmake' does
347 ;; not use 'OpenEXR.pc'. Thus, we need to add
348 ;; "$ilmbase/include/OpenEXR/" to the CPATH.
349 (setenv "CPATH"
350 (string-append (assoc-ref inputs "ilmbase")
351 "/include/OpenEXR"
352 ":" (or (getenv "CPATH") "")))
353 #t)))))
354 (home-page "http://qtpfsgui.sourceforge.net")
355 (synopsis "High dynamic range (HDR) imaging application")
356 (description
357 "Luminance HDR (formerly QtPFSGui) is a graphical user interface
358 application that aims to provide a workflow for high dynamic range (HDR)
359 imaging. It supports several HDR and LDR image formats, and it can:
360
361 @itemize
362 @item Create an HDR file from a set of images (formats: JPEG, TIFF 8bit and
363 16bit, RAW) of the same scene taken at different exposure setting;
364 @item Save load HDR images;
365 @item Rotate, resize and crop HDR images;
366 @item Tone-map HDR images;
367 @item Copy EXIF data between sets of images.
368 @end itemize\n")
369 (license license:gpl2+)))
370
371 ;; CBR and RAR are currently unsupported, due to non-free dependencies.
372 ;; For optional PDF support, you can install the mupdf package.
373 (define-public mcomix
374 (package
375 (name "mcomix")
376 (version "1.2.1")
377 (source
378 (origin
379 (method url-fetch)
380 (uri (string-append "mirror://sourceforge/mcomix/MComix-" version
381 "/mcomix-" version ".tar.bz2"))
382 (sha256
383 (base32
384 "0fzsf9pklhfs1rzwzj64c0v30b74nk94p93h371rpg45qnfiahvy"))))
385 (build-system python-build-system)
386 (inputs
387 `(("p7zip" ,p7zip)
388 ("python2-pillow" ,python2-pillow)
389 ("python2-pygtk" ,python2-pygtk)))
390 (arguments
391 ;; Python 2.5 or newer (Python 3 and up is not supported)
392 `(#:python ,python-2
393 #:phases
394 (modify-phases %standard-phases
395 (add-after 'unpack 'configure
396 (lambda* (#:key inputs #:allow-other-keys)
397 (let ((p7zip (assoc-ref inputs "p7zip")))
398 ;; insert absolute path to 7z executable
399 (substitute* "mcomix/archive/sevenzip_external.py"
400 (("_7z_executable = -1")
401 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
402 #t)))))
403 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
404 (synopsis "Image viewer for comics")
405 (description "MComix is a customizable image viewer that specializes as
406 a comic and manga reader. It supports a variety of container formats
407 including CBZ, CB7, CBT, LHA.")
408 (license license:gpl2+)))