gnu: Add perl-test-command.
[jackhill/guix/guix.git] / gnu / packages / image-viewers.scm
CommitLineData
d1a5b200 1;;; GNU Guix --- Functional package management for GNU
e79bfa18 2;;; Copyright © 2013, 2017 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>
ea77385c 5;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
f7e9f1ca 6;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
9016dbc2 7;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
ed3a9ec5 8;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
4ee81d37 9;;; Copyright © 2017 nee <nee-git@hidamari.blue>
eb55f018 10;;;
d1a5b200
AK
11;;; This file is part of GNU Guix.
12;;;
eb55f018
EF
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)
9016dbc2 31 #:use-module (guix build-system cmake)
4ee81d37 32 #:use-module (guix build-system python)
eb55f018 33 #:use-module (gnu packages autotools)
e79bfa18 34 #:use-module (gnu packages algebra)
eb55f018 35 #:use-module (gnu packages base)
e79bfa18
LC
36 #:use-module (gnu packages boost)
37 #:use-module (gnu packages compression)
d1a5b200
AK
38 #:use-module (gnu packages curl)
39 #:use-module (gnu packages ghostscript)
eb55f018
EF
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages gtk)
e79bfa18 43 #:use-module (gnu packages graphics)
023f0fb0 44 #:use-module (gnu packages image)
9016dbc2 45 #:use-module (gnu packages imagemagick)
e79bfa18 46 #:use-module (gnu packages maths)
d1a5b200
AK
47 #:use-module (gnu packages photo)
48 #:use-module (gnu packages pkg-config)
4ee81d37 49 #:use-module (gnu packages python)
e79bfa18
LC
50 #:use-module (gnu packages qt)
51 #:use-module (gnu packages xorg)
52 #:use-module (gnu packages))
d1a5b200
AK
53
54(define-public feh
55 (package
56 (name "feh")
2e957aae 57 (version "2.21")
d1a5b200
AK
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
2e957aae 65 "0azgpr4al2pi4858z4xh4lfz84cvzxw3n426fn7rz6cdj34q212j"))))
d1a5b200
AK
66 (build-system gnu-build-system)
67 (arguments
dc1d3cde
KK
68 '(#:phases (modify-phases %standard-phases (delete 'configure))
69 #:tests? #f ;FIXME: Requires 'perl-test-command'.
70 #:make-flags
71 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))))
d1a5b200
AK
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.
81Unlike most other viewers, it does not have a fancy GUI, but simply
82displays images. It can also be used to set the desktop wallpaper.
83It is controlled via commandline arguments and configurable key/mouse
84actions.")
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
048175e2
LC
107 `(;; Enable support for a "map" pane using GPS data.
108 #:configure-flags '("--enable-map")
109
110 #:phases
d1a5b200
AK
111 (modify-phases %standard-phases
112 (add-after 'unpack 'autogen
113 (lambda _
114 (setenv "NOCONFIGURE" "true")
115 (zero? (system* "sh" "autogen.sh")))))))
116 (inputs
048175e2
LC
117 `(("clutter" ,clutter)
118 ("libchamplain" ,libchamplain)
d1a5b200
AK
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
133systems. It features: EXIF, IPTC and XMP metadata browsing and editing
134interoperability; easy integration with other software; geeqie works on files
135and directories, there is no need to import images; fast preview for many raw
136image formats; tools for image comparison, sorting and managing photo
137collection. Geeqie was initially based on GQview.")
138 (license license:gpl2+)))
139
ed3a9ec5
MO
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.
159It is the default image viewer on LXDE desktop environment.")
160 (home-page "http://lxde.sourceforge.net/gpicview/")
161 (license license:gpl2+)))
162
d1a5b200
AK
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")
dc1d3cde
KK
181 ;; no configure phase
182 #:phases (modify-phases %standard-phases (delete 'configure))))
d1a5b200
AK
183 (inputs
184 `(("libx11" ,libx11)
185 ("imlib2" ,imlib2)
186 ("giflib" ,giflib)
187 ("libexif" ,libexif)))
188 (home-page "https://github.com/muennich/sxiv")
189 (synopsis "Simple X Image Viewer")
190 (description
191 "sxiv is an alternative to feh and qiv. Its primary goal is to
192provide the most basic features required for fast image viewing. It has
193vi key bindings and works nicely with tiling window managers. Its code
194base should be kept small and clean to make it easy for you to dig into
195it and customize it for your needs.")
196 (license license:gpl2+)))
eb55f018
EF
197
198(define-public viewnior
199 (package
200 (name "viewnior")
201 (version "1.6")
202 (source
203 (origin
204 (method url-fetch)
205 (uri (string-append "https://github.com/xsisqox/Viewnior/archive/"
206 name "-" version ".tar.gz"))
207 (sha256
208 (base32
209 "18309qjgwak3kn228z3p3nx7yxasqgzx69v3rgc23hf161nky0c9"))))
210 (build-system gnu-build-system)
211 (arguments
212 '(#:phases
213 (modify-phases %standard-phases
214 (add-after 'unpack 'autogen
215 (lambda _
ea77385c
EF
216 (zero? (system* "sh" "autogen.sh"))))
217 (add-before 'install 'skip-gtk-update-icon-cache
218 (lambda _
219 ;; Don't create 'icon-theme.cache'
220 (substitute* (find-files "data" "^Makefile$")
221 (("gtk-update-icon-cache") (which "true")))
222 #t)))))
eb55f018
EF
223 (native-inputs
224 `(("automake" ,automake)
225 ("autoconf" ,autoconf)
226 ("intltool" ,intltool)
227 ("glib" ,glib "bin") ; glib-genmarshal
228 ("gnome-common" ,gnome-common)
229 ("libtool" ,libtool)
230 ("pkg-config" ,pkg-config)
231 ("shared-mime-info" ,shared-mime-info)
232 ("which" ,which)))
233 (inputs
234 `(("exiv2" ,exiv2)
235 ("gdk-pixbuf" ,gdk-pixbuf)
236 ("gtk+-2" ,gtk+-2)))
237 (home-page "http://siyanpanayotov.com/project/viewnior/")
238 (synopsis "Simple, fast and elegant image viewer")
239 (description "Viewnior is an image viewer program. Created to be simple,
240fast and elegant. Its minimalistic interface provides more screenspace for
241your images. Among its features are:
242@enumerate
243@item Fullscreen & Slideshow
244@item Rotate, flip, crop, save, delete images
245@item Animation support
246@item Browse only selected images
247@item Navigation window
248@item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
249@item Simple interface
250@item EXIF and IPTC metadata
251@item Configurable mouse actions
252@end enumerate\n")
253 (license license:gpl3+)))
9016dbc2 254
255(define-public catimg
256 (package
257 (name "catimg")
ddde3f6b 258 (version "2.4.0")
9016dbc2 259 (source
260 (origin
261 (method url-fetch)
262 (uri (string-append "https://github.com/posva/catimg/archive"
263 "/v" version ".tar.gz"))
264 (file-name (string-append name "-" version ".tar.gz"))
265 (sha256
266 (base32
ddde3f6b 267 "1rwgbq2imd5l4nql5hrz7rr5f4gz8aad1amlf0j3cxir8slpbd1y"))))
9016dbc2 268 (build-system cmake-build-system)
269 (arguments
1e5c056c 270 `(#:tests? #f ; no tests
9016dbc2 271 #:phases
272 (modify-phases %standard-phases
273 (replace 'configure
274 (lambda* (#:key inputs #:allow-other-keys)
275 (let* ((magic (assoc-ref %build-inputs "imagemagick"))
276 (convert (string-append magic "/bin/convert")))
277 (substitute* "catimg"
278 ;; By replacing "convert", we also replace the "convert"
279 ;; in the message 'The version of convert is too old, don't
1e5c056c 280 ;; expect good results :('. This should not happen, but in
9016dbc2 281 ;; practice this error message should not affect us.
282 (("convert") convert))
283 #t)))
284 (replace 'build
285 (lambda _
1e5c056c
TGR
286 (let* ((out (assoc-ref %outputs "out"))
287 (man (string-append out "/share/man/man1")))
288 (zero? (system* "cmake"
289 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
290 (string-append "-DMAN_OUTPUT_PATH=" man)
291 "."))
292 (zero? (system* "make")))))
9016dbc2 293 (add-before 'install 'install-script
294 (lambda* (#:key outputs #:allow-other-keys)
1e5c056c 295 ;; The bash script lacks an file extension. We have to rename
9016dbc2 296 ;; it so that the C program and the bash script can be happy
297 ;; side by side.
298 (let* ((out (assoc-ref outputs "out"))
299 (bin (string-append out "/bin")))
300 (install-file "catimg" bin)
301 (rename-file (string-append bin "/catimg")
302 (string-append bin "/catimg.sh"))
303 #t))))))
304 (inputs
1e5c056c 305 `(("imagemagick" ,imagemagick))) ; for the bash script version
9016dbc2 306 (home-page "https://github.com/posva/catimg")
307 (synopsis "Render images in the terminal")
308 (description
309 "Catimg is a little program that prints images in the terminal.
310It supports JPEG, PNG and GIF formats.")
311 (license license:expat)))
e79bfa18
LC
312
313(define-public luminance-hdr
314 (package
315 (name "luminance-hdr")
316 (version "2.4.0")
317 (source (origin
318 (method url-fetch)
319 (uri (string-append
320 "mirror://sourceforge/qtpfsgui/luminance/"
321 version "/luminance-hdr-" version ".tar.bz2"))
322 (sha256
323 (base32
324 "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l"))
325 (patches (search-patches "luminance-hdr-qt-printer.patch"))))
326 (build-system cmake-build-system)
327 (native-inputs
328 `(("pkg-config" ,pkg-config)
329 ("qttools" ,qttools)))
330 (inputs
331 `(("qtbase" ,qtbase)
332 ("qtdeclarative" ,qtdeclarative)
333 ("qtwebkit" ,qtwebkit)
334 ("boost" ,boost)
335 ;; ("gtest" ,gtest)
336 ("libraw" ,libraw)
337 ("zlib" ,zlib)
338 ("exiv2" ,exiv2)
339 ("libpng" ,libpng)
340 ("libjpeg" ,libjpeg)
341 ("lcms" ,lcms)
342 ("openexr" ,openexr)
343 ("fftw" ,fftwf)
344 ("gsl" ,gsl)
345 ("libtiff" ,libtiff)))
346 (arguments
347 '(#:phases
348 (modify-phases %standard-phases
349 (add-after 'set-paths 'add-ilmbase-include-path
350 (lambda* (#:key inputs #:allow-other-keys)
351 ;; 'OpenEXR.pc' has a -I for IlmBase but 'FindOpenEXR.cmake' does
352 ;; not use 'OpenEXR.pc'. Thus, we need to add
353 ;; "$ilmbase/include/OpenEXR/" to the CPATH.
354 (setenv "CPATH"
355 (string-append (assoc-ref inputs "ilmbase")
356 "/include/OpenEXR"
357 ":" (or (getenv "CPATH") "")))
358 #t)))))
359 (home-page "http://qtpfsgui.sourceforge.net")
360 (synopsis "High dynamic range (HDR) imaging application")
361 (description
362 "Luminance HDR (formerly QtPFSGui) is a graphical user interface
363application that aims to provide a workflow for high dynamic range (HDR)
364imaging. It supports several HDR and LDR image formats, and it can:
365
366@itemize
367@item Create an HDR file from a set of images (formats: JPEG, TIFF 8bit and
36816bit, RAW) of the same scene taken at different exposure setting;
369@item Save load HDR images;
370@item Rotate, resize and crop HDR images;
371@item Tone-map HDR images;
372@item Copy EXIF data between sets of images.
373@end itemize\n")
374 (license license:gpl2+)))
4ee81d37 375
376;; CBR and RAR are currently unsupported, due to non-free dependencies.
377;; For optional PDF support, you can install the mupdf package.
378(define-public mcomix
379 (package
380 (name "mcomix")
381 (version "1.2.1")
382 (source
383 (origin
384 (method url-fetch)
385 (uri (string-append "mirror://sourceforge/mcomix/MComix-" version
386 "/mcomix-" version ".tar.bz2"))
387 (sha256
388 (base32
389 "0fzsf9pklhfs1rzwzj64c0v30b74nk94p93h371rpg45qnfiahvy"))))
390 (build-system python-build-system)
391 (inputs
392 `(("p7zip" ,p7zip)
393 ("python2-pillow" ,python2-pillow)
394 ("python2-pygtk" ,python2-pygtk)))
395 (arguments
396 ;; Python 2.5 or newer (Python 3 and up is not supported)
397 `(#:python ,python-2
398 #:phases
399 (modify-phases %standard-phases
400 (add-after 'unpack 'configure
401 (lambda* (#:key inputs #:allow-other-keys)
402 (let ((p7zip (assoc-ref inputs "p7zip")))
403 ;; insert absolute path to 7z executable
404 (substitute* "mcomix/archive/sevenzip_external.py"
405 (("_7z_executable = -1")
406 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
407 #t)))))
408 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
409 (synopsis "Image viewer for comics")
410 (description "MComix is a customizable image viewer that specializes as
411a comic and manga reader. It supports a variety of container formats
412including CBZ, CB7, CBT, LHA.")
413 (license license:gpl2+)))