gnu: fontconfig: Add replacement with font-dejavu instead of gs-fonts.
[jackhill/guix/guix.git] / gnu / packages / image-viewers.scm
CommitLineData
d1a5b200 1;;; GNU Guix --- Functional package management for GNU
51c87770 2;;; Copyright © 2013, 2017, 2018, 2019, 2020 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>
0e773da0 5;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
f7e9f1ca 6;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
3c986a7d 7;;; Copyright © 2017 Nikita <nikita@n0.is>
ed3a9ec5 8;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
4ee81d37 9;;; Copyright © 2017 nee <nee-git@hidamari.blue>
6420cab3 10;;; Copyright © 2018, 2019, 2020 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>
52bb05c7 13;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
9943d238 14;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
cd819b45 15;;; Copyright © 2020 Peng Mei Yu <pengmeiyu@riseup.net>
e2bd0af3 16;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
e5afc63b 17;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
eb55f018 18;;;
d1a5b200
AK
19;;; This file is part of GNU Guix.
20;;;
eb55f018
EF
21;;; GNU Guix is free software; you can redistribute it and/or modify it
22;;; under the terms of the GNU General Public License as published by
23;;; the Free Software Foundation; either version 3 of the License, or (at
24;;; your option) any later version.
25;;;
26;;; GNU Guix is distributed in the hope that it will be useful, but
27;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29;;; GNU General Public License for more details.
30;;;
31;;; You should have received a copy of the GNU General Public License
32;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34(define-module (gnu packages image-viewers)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix download)
92f08e14 37 #:use-module (guix git-download)
eb55f018 38 #:use-module (guix packages)
e5afc63b 39 #:use-module (guix utils)
eb55f018 40 #:use-module (guix build-system gnu)
9016dbc2 41 #:use-module (guix build-system cmake)
307cdd66 42 #:use-module (guix build-system meson)
4ee81d37 43 #:use-module (guix build-system python)
eb55f018 44 #:use-module (gnu packages autotools)
e79bfa18 45 #:use-module (gnu packages algebra)
e79bfa18 46 #:use-module (gnu packages boost)
cd819b45 47 #:use-module (gnu packages check)
e79bfa18 48 #:use-module (gnu packages compression)
d1a5b200 49 #:use-module (gnu packages curl)
cd819b45 50 #:use-module (gnu packages documentation)
6c162d0e 51 #:use-module (gnu packages fontutils)
cd819b45 52 #:use-module (gnu packages freedesktop)
307cdd66 53 #:use-module (gnu packages gettext)
d1a5b200 54 #:use-module (gnu packages ghostscript)
cd819b45 55 #:use-module (gnu packages gl)
eb55f018
EF
56 #:use-module (gnu packages glib)
57 #:use-module (gnu packages gnome)
58 #:use-module (gnu packages gtk)
e79bfa18 59 #:use-module (gnu packages graphics)
023f0fb0 60 #:use-module (gnu packages image)
9016dbc2 61 #:use-module (gnu packages imagemagick)
e79bfa18 62 #:use-module (gnu packages maths)
83a7a88f 63 #:use-module (gnu packages perl)
5ccde207 64 #:use-module (gnu packages perl-check)
d1a5b200
AK
65 #:use-module (gnu packages photo)
66 #:use-module (gnu packages pkg-config)
4ee81d37 67 #:use-module (gnu packages python)
44d10b1f 68 #:use-module (gnu packages python-xyz)
e79bfa18 69 #:use-module (gnu packages qt)
cd819b45 70 #:use-module (gnu packages xdisorg)
e79bfa18
LC
71 #:use-module (gnu packages xorg)
72 #:use-module (gnu packages))
d1a5b200
AK
73
74(define-public feh
75 (package
76 (name "feh")
d6ba96c8 77 (version "3.4")
d1a5b200
AK
78 (home-page "https://feh.finalrewind.org/")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append home-page
82 name "-" version ".tar.bz2"))
83 (sha256
84 (base32
d6ba96c8 85 "0r83zincbfnk8g13xwm2qaccml9srnwlsmpc1f0nhwjkqyjmqm0q"))))
d1a5b200
AK
86 (build-system gnu-build-system)
87 (arguments
dc1d3cde 88 '(#:phases (modify-phases %standard-phases (delete 'configure))
83a7a88f 89 #:test-target "test"
dc1d3cde 90 #:make-flags
0de33cb3
LF
91 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))
92 "exif=1")))
83a7a88f
MB
93 (native-inputs
94 `(("perl" ,perl)
95 ("perl-test-command" ,perl-test-command)))
d1a5b200
AK
96 (inputs `(("imlib2" ,imlib2)
97 ("curl" ,curl)
0de33cb3 98 ("libexif" ,libexif)
d1a5b200
AK
99 ("libpng" ,libpng)
100 ("libxt" ,libxt)
101 ("libx11" ,libx11)
102 ("libxinerama" ,libxinerama)))
3c41b992
MB
103 (native-search-paths
104 ;; Feh allows overriding the libcurl builtin CA path (unset in Guix)
105 ;; with the same variable as the `curl` command line HTTP tool.
dc138d6d 106 (package-native-search-paths curl))
d1a5b200
AK
107 (synopsis "Fast and light imlib2-based image viewer")
108 (description
109 "feh is an X11 image viewer aimed mostly at console users.
110Unlike most other viewers, it does not have a fancy GUI, but simply
111displays images. It can also be used to set the desktop wallpaper.
112It is controlled via commandline arguments and configurable key/mouse
113actions.")
114
115 ;; The license is really the Expat license, with additional wording in the
116 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
117 ;; software packages that this Software was used."
118 (license (license:x11-style
119 "file://COPYING"
120 "See 'COPYING' in the distribution."))))
121
122(define-public geeqie
9156396f
LC
123 ;; The latest release, 1.4, fails to build with Exiv2 0.27.1. The upstream
124 ;; repo has several fixes for that, so take a snapshot.
125 (let ((commit "c220ddefb1b6b11b54f7598f0d44dd0723325ed4")
126 (revision "1"))
127 (package
128 (name "geeqie")
129 (version (git-version "1.4" revision commit))
130 (source (origin
131 (method git-fetch)
132 (uri (git-reference
133 (url "https://github.com/BestImageViewer/geeqie")
134 (commit commit)))
135 (sha256
136 (base32
137 "07424nzrnwbksgalgg1a6ig2snd986w79kca1cfnv1q9kc7x2h3x"))
138 (file-name (git-file-name name version))))
139 (build-system gnu-build-system)
140 (arguments
141 `( ;; Enable support for a "map" pane using GPS data.
142 #:configure-flags '("--enable-map")
048175e2 143
198f560f
LC
144 ;; Parallel builds fail with something like:
145 ;; image-load.c:143:9: error: ‘gq_marshal_VOID__INT_INT_INT_INT’ undeclared
146 ;; due to unexpressed makefile dependencies.
147 #:parallel-build? #f
148
9156396f
LC
149 #:phases
150 (modify-phases %standard-phases
151 (add-before 'bootstrap 'pre-bootstrap
152 (lambda _
153 (define (write-dummy-changelog port)
154 (display "See Git history for a change log.\n" port))
155 ;; Create ChangeLog{,.html} to placate the makefile, which would
156 ;; otherwise require access to the Git repo.
157 (call-with-output-file "ChangeLog"
158 write-dummy-changelog)
159 (call-with-output-file "ChangeLog.html"
160 write-dummy-changelog)
9156396f
LC
161
162 ;; Don't try to run 'git' for the version number.
163 (substitute* "configure.ac"
164 (("m4_esyscmd_s\\([^)]+\\)")
165 (string-append "[" ,version "]")))
166
167 ;; Remove references to non-existent files.
168 (substitute* "po/POTFILES.in"
169 (("^plugins/import/.*") ""))
170 #t)))))
171 (inputs
172 `(("clutter" ,clutter)
173 ("libchamplain" ,libchamplain)
174 ("lcms" ,lcms)
175 ("exiv2" ,exiv2)
176 ("libpng" ,libpng)
177 ("gtk+" ,gtk+)))
178 (native-inputs
179 `(("autoconf" ,autoconf)
180 ("automake" ,automake)
181 ("glib" ,glib "bin") ; glib-gettextize
182 ("intltool" ,intltool)
183 ("pkg-config" ,pkg-config)))
184 (home-page "http://www.geeqie.org/")
185 (synopsis "Lightweight GTK+ based image viewer")
186 (description
187 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
d1a5b200
AK
188systems. It features: EXIF, IPTC and XMP metadata browsing and editing
189interoperability; easy integration with other software; geeqie works on files
190and directories, there is no need to import images; fast preview for many raw
191image formats; tools for image comparison, sorting and managing photo
192collection. Geeqie was initially based on GQview.")
9156396f 193 (license license:gpl2+))))
d1a5b200 194
ed3a9ec5
MO
195(define-public gpicview
196 (package
197 (name "gpicview")
198 (version "0.2.5")
199 (source (origin
200 (method url-fetch)
201 (uri (string-append "mirror://sourceforge/lxde/"
202 "GPicView%20%28image%20Viewer%29/0.2.x/"
203 name "-" version ".tar.xz"))
204 (sha256
205 (base32
206 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
207 (build-system gnu-build-system)
208 (inputs `(("gtk+" ,gtk+-2)
4bd428a7 209 ("libjpeg" ,libjpeg-turbo)))
ed3a9ec5
MO
210 (native-inputs `(("intltool" ,intltool)
211 ("pkg-config" ,pkg-config)))
212 (synopsis "Simple and fast image viewer for X")
213 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
214It is the default image viewer on LXDE desktop environment.")
215 (home-page "http://lxde.sourceforge.net/gpicview/")
216 (license license:gpl2+)))
217
d1a5b200
AK
218(define-public sxiv
219 (package
220 (name "sxiv")
6420cab3 221 (version "26")
d1a5b200 222 (source (origin
92f08e14
RW
223 (method git-fetch)
224 (uri (git-reference
225 (url "https://github.com/muennich/sxiv.git")
226 (commit (string-append "v" version))))
227 (file-name (git-file-name name version))
d1a5b200
AK
228 (sha256
229 (base32
6420cab3 230 "0xaawlfdy7b277m38mgg4423kd7p1ffn0dq4hciqs6ivbb3q9c4f"))))
d1a5b200
AK
231 (build-system gnu-build-system)
232 (arguments
6c162d0e
TGR
233 `(#:tests? #f ; no check target
234 #:make-flags
235 (list (string-append "PREFIX=" %output)
236 "CC=gcc"
6420cab3
TGR
237 ;; Xft.h #includes <ft2build.h> without ‘freetype2/’. The Makefile
238 ;; works around this by hard-coding /usr/include & $PREFIX.
56d2007e 239 (string-append "CPPFLAGS=-I"
6c162d0e
TGR
240 (assoc-ref %build-inputs "freetype")
241 "/include/freetype2")
242 "V=1")
243 #:phases
244 (modify-phases %standard-phases
245 (delete 'configure)))) ; no configure script
d1a5b200 246 (inputs
6c162d0e 247 `(("freetype" ,freetype)
d1a5b200 248 ("giflib" ,giflib)
6c162d0e
TGR
249 ("imlib2" ,imlib2)
250 ("libexif" ,libexif)
251 ("libx11" ,libx11)
252 ("libxft" ,libxft)))
d1a5b200
AK
253 (home-page "https://github.com/muennich/sxiv")
254 (synopsis "Simple X Image Viewer")
255 (description
256 "sxiv is an alternative to feh and qiv. Its primary goal is to
257provide the most basic features required for fast image viewing. It has
258vi key bindings and works nicely with tiling window managers. Its code
259base should be kept small and clean to make it easy for you to dig into
260it and customize it for your needs.")
261 (license license:gpl2+)))
eb55f018
EF
262
263(define-public viewnior
264 (package
265 (name "viewnior")
307cdd66 266 (version "1.7")
eb55f018
EF
267 (source
268 (origin
83541fb6
EF
269 (method git-fetch)
270 (uri (git-reference
271 (url "https://github.com/hellosiyan/Viewnior.git")
272 (commit (string-append name "-" version))))
273 (file-name (git-file-name name version))
eb55f018
EF
274 (sha256
275 (base32
83541fb6 276 "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
307cdd66 277 (build-system meson-build-system)
eb55f018
EF
278 (arguments
279 '(#:phases
280 (modify-phases %standard-phases
307cdd66 281 (add-after 'unpack 'patch-source
ea77385c
EF
282 (lambda _
283 ;; Don't create 'icon-theme.cache'
307cdd66
EF
284 (substitute* "meson.build"
285 (("meson.add_install_script*") ""))
286 #t)))
287 #:tests? #f)) ; no tests
eb55f018 288 (native-inputs
307cdd66 289 `(("gettext" ,gettext-minimal)
eb55f018 290 ("glib" ,glib "bin") ; glib-genmarshal
eb55f018 291 ("pkg-config" ,pkg-config)
307cdd66 292 ("shared-mime-info" ,shared-mime-info)))
eb55f018
EF
293 (inputs
294 `(("exiv2" ,exiv2)
295 ("gdk-pixbuf" ,gdk-pixbuf)
296 ("gtk+-2" ,gtk+-2)))
307cdd66 297 (home-page "http://siyanpanayotov.com/project/viewnior")
eb55f018
EF
298 (synopsis "Simple, fast and elegant image viewer")
299 (description "Viewnior is an image viewer program. Created to be simple,
300fast and elegant. Its minimalistic interface provides more screenspace for
301your images. Among its features are:
302@enumerate
303@item Fullscreen & Slideshow
304@item Rotate, flip, crop, save, delete images
305@item Animation support
306@item Browse only selected images
307@item Navigation window
308@item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
309@item Simple interface
310@item EXIF and IPTC metadata
311@item Configurable mouse actions
312@end enumerate\n")
313 (license license:gpl3+)))
9016dbc2 314
315(define-public catimg
316 (package
317 (name "catimg")
0e773da0 318 (version "2.6.0")
9016dbc2 319 (source
320 (origin
6f6f9267
RW
321 (method git-fetch)
322 (uri (git-reference
323 (url "https://github.com/posva/catimg.git")
cdee738e 324 (commit version)))
6f6f9267 325 (file-name (git-file-name name version))
9016dbc2 326 (sha256
0e773da0 327 (base32 "0g9ywbgy162wiam9hc3yqpq5q4gyxa8fj4jskr3fdz8z8jjaabzz"))))
9016dbc2 328 (build-system cmake-build-system)
329 (arguments
1e5c056c 330 `(#:tests? #f ; no tests
9016dbc2 331 #:phases
332 (modify-phases %standard-phases
e2f47efe 333 (add-after 'unpack 'patch-convert
9016dbc2 334 (lambda _
e2f47efe
RW
335 (substitute* "catimg"
336 ;; By replacing "convert", we also replace the "convert"
337 ;; in the message 'The version of convert is too old, don't
338 ;; expect good results :('. This should not happen, but in
339 ;; practice this error message should not affect us.
340 (("convert") (which "convert")))
341 #t))
342 (add-after 'install 'install-script
9016dbc2 343 (lambda* (#:key outputs #:allow-other-keys)
1e5c056c 344 ;; The bash script lacks an file extension. We have to rename
9016dbc2 345 ;; it so that the C program and the bash script can be happy
346 ;; side by side.
e2f47efe
RW
347 (copy-file "../source/catimg"
348 (string-append (assoc-ref outputs "out")
349 "/bin/catimg.sh"))
350 #t)))))
9016dbc2 351 (inputs
1e5c056c 352 `(("imagemagick" ,imagemagick))) ; for the bash script version
9016dbc2 353 (home-page "https://github.com/posva/catimg")
354 (synopsis "Render images in the terminal")
355 (description
356 "Catimg is a little program that prints images in the terminal.
357It supports JPEG, PNG and GIF formats.")
358 (license license:expat)))
e79bfa18
LC
359
360(define-public luminance-hdr
361 (package
362 (name "luminance-hdr")
363 (version "2.4.0")
364 (source (origin
365 (method url-fetch)
366 (uri (string-append
367 "mirror://sourceforge/qtpfsgui/luminance/"
368 version "/luminance-hdr-" version ".tar.bz2"))
369 (sha256
370 (base32
371 "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l"))
372 (patches (search-patches "luminance-hdr-qt-printer.patch"))))
373 (build-system cmake-build-system)
374 (native-inputs
375 `(("pkg-config" ,pkg-config)
376 ("qttools" ,qttools)))
377 (inputs
378 `(("qtbase" ,qtbase)
379 ("qtdeclarative" ,qtdeclarative)
380 ("qtwebkit" ,qtwebkit)
381 ("boost" ,boost)
382 ;; ("gtest" ,gtest)
383 ("libraw" ,libraw)
384 ("zlib" ,zlib)
385 ("exiv2" ,exiv2)
386 ("libpng" ,libpng)
4bd428a7 387 ("libjpeg" ,libjpeg-turbo)
e79bfa18
LC
388 ("lcms" ,lcms)
389 ("openexr" ,openexr)
390 ("fftw" ,fftwf)
391 ("gsl" ,gsl)
392 ("libtiff" ,libtiff)))
393 (arguments
394 '(#:phases
395 (modify-phases %standard-phases
396 (add-after 'set-paths 'add-ilmbase-include-path
397 (lambda* (#:key inputs #:allow-other-keys)
398 ;; 'OpenEXR.pc' has a -I for IlmBase but 'FindOpenEXR.cmake' does
399 ;; not use 'OpenEXR.pc'. Thus, we need to add
400 ;; "$ilmbase/include/OpenEXR/" to the CPATH.
401 (setenv "CPATH"
402 (string-append (assoc-ref inputs "ilmbase")
403 "/include/OpenEXR"
404 ":" (or (getenv "CPATH") "")))
405 #t)))))
406 (home-page "http://qtpfsgui.sourceforge.net")
407 (synopsis "High dynamic range (HDR) imaging application")
408 (description
409 "Luminance HDR (formerly QtPFSGui) is a graphical user interface
410application that aims to provide a workflow for high dynamic range (HDR)
411imaging. It supports several HDR and LDR image formats, and it can:
412
413@itemize
414@item Create an HDR file from a set of images (formats: JPEG, TIFF 8bit and
41516bit, RAW) of the same scene taken at different exposure setting;
416@item Save load HDR images;
417@item Rotate, resize and crop HDR images;
418@item Tone-map HDR images;
419@item Copy EXIF data between sets of images.
420@end itemize\n")
421 (license license:gpl2+)))
4ee81d37 422
423;; CBR and RAR are currently unsupported, due to non-free dependencies.
4ee81d37 424(define-public mcomix
e5afc63b
PN
425 ;; Official mcomix hasn't been updated since 2016, it's broken with
426 ;; python-pillow 6+ and only supports Python 2. We use fork instead.
427 (let ((commit "fea55a7a9369569eefed72209eed830409c4af98"))
428 (package
429 (name "mcomix")
430 (version (git-version "1.2.1" "1" commit))
431 (source
432 (origin
433 (method git-fetch)
434 (uri (git-reference
435 (url "https://github.com/multiSnow/mcomix3")
436 (commit commit)))
437 (file-name (git-file-name name version))
438 (sha256
439 (base32
440 "05zl0dkjwbdcm2zlk4nz9w33amlqj8pbf32a8ymshc2356fqhhi5"))))
441 (build-system python-build-system)
442 (inputs
443 `(("p7zip" ,p7zip)
444 ("python-pillow" ,python-pillow)
445 ("python-pygobject" ,python-pygobject)
446 ("python-pycairo" ,python-pycairo)))
447 (arguments
448 `(#:tests? #f ; FIXME: How do we run tests?
449 #:phases
450 (modify-phases %standard-phases
451 (add-after 'unpack 'configure
452 (lambda* (#:key inputs #:allow-other-keys)
453 (let ((p7zip (assoc-ref inputs "p7zip")))
454 ;; insert absolute path to 7z executable
455 (substitute* "mcomix/mcomix/archive/sevenzip_external.py"
456 (("_7z_executable = -1")
457 (string-append "_7z_executable = u'" p7zip "/bin/7z'"))))
458 #t))
459 (replace 'build
460 (lambda* (#:key outputs #:allow-other-keys)
461 (let* ((out (assoc-ref outputs "out"))
462 (pyver ,(version-major+minor (package-version python)))
463 (lib (string-append out "/lib/python" pyver)))
464 (invoke (which "python") "installer.py" "--srcdir=mcomix"
465 (string-append "--target=" lib))
466 (rename-file (string-append lib "/mcomix")
467 (string-append lib "/site-packages"))
468 #t)))
469 (replace 'install
470 (lambda* (#:key outputs #:allow-other-keys)
471 (let* ((out (assoc-ref outputs "out"))
472 (share (string-append out "/share"))
473 (bin (string-append out "/bin"))
474 (pyver ,(version-major+minor (package-version python)))
475 (lib (string-append out "/lib/python" pyver "/site-packages")))
476 (mkdir-p bin)
477 (rename-file (string-append lib "/mcomixstarter.py")
478 (string-append bin "/mcomix"))
479 (rename-file (string-append lib "/comicthumb.py")
480 (string-append bin "/comicthumb"))
481 (install-file "mime/mcomix.desktop"
482 (string-append share "/applications"))
483 (install-file "mime/mcomix.appdata.xml"
484 (string-append share "/metainfo"))
485 (install-file "mime/mcomix.xml"
486 (string-append share "/mime/packages"))
487 (install-file "mime/comicthumb.thumbnailer"
488 (string-append share "/thumbnailers"))
489 (install-file "man/mcomix.1" (string-append share "/man/man1"))
490 (install-file "man/comicthumb.1" (string-append share "/man/man1"))
491 (for-each
492 (lambda (size)
493 (install-file
494 (format #f "mcomix/mcomix/images/~sx~s/mcomix.png" size size)
495 (format #f "~a/icons/hicolor/~sx~s/apps/" share size size))
496 (for-each
497 (lambda (ext)
498 (install-file
499 (format #f "mime/icons/~sx~s/application-x-~a.png" size size ext)
500 (format #f "~a/icons/hicolor/~sx~s/mimetypes/"
501 share size size)))
502 '("cb7" "cbr" "cbt" "cbz")))
503 '(16 22 24 32 48))
504 #t))))))
505 (home-page "https://sourceforge.net/p/mcomix/wiki/Home/")
506 (synopsis "Image viewer for comics")
507 (description "MComix is a customizable image viewer that specializes as
4ee81d37 508a comic and manga reader. It supports a variety of container formats
e5afc63b
PN
509including CBZ, CB7, CBT, LHA.
510
511For PDF support, install the @emph{mupdf} package.")
512 (license license:gpl2+))))
87036462
NG
513
514(define-public qview
515 (package
516 (name "qview")
4f620bbf
NG
517 (version "3.0")
518 (source
519 (origin
520 (method git-fetch)
521 (uri (git-reference
522 (url "https://github.com/jurplel/qView.git")
523 (commit version)))
524 (file-name (git-file-name name version))
525 (sha256
526 (base32 "15a91bs3wcqhgf76wzigbn10hayg628j84pq4j2vaxar94ak0vk7"))))
87036462
NG
527 (build-system gnu-build-system)
528 (arguments
529 `(#:phases
530 (modify-phases %standard-phases
531 (replace 'configure
532 (lambda _
533 (invoke "qmake")))
534 ;; Installation process hard-codes "/usr/bin", possibly
535 ;; prefixed.
536 (add-after 'configure 'fix-install-directory
537 (lambda* (#:key outputs #:allow-other-keys)
538 (let ((out (assoc-ref outputs "out")))
539 (substitute* "Makefile"
540 (("\\$\\(INSTALL_ROOT\\)/usr") out))
541 #t)))
542 ;; Don't phone home or show "Checking for updates..." in the
543 ;; About menu.
544 (add-before 'build 'disable-auto-update
545 (lambda _
546 (substitute* "src/qvaboutdialog.cpp"
547 (("ui->updateLabel->setText\\(updateText\\);") "")
548 (("requestUpdates\\(\\);") ""))
549 #t)))))
550 (inputs
551 `(("qtbase" ,qtbase)
552 ("qtsvg" ,qtsvg)
553 ("qtimageformats" ,qtimageformats)))
554 (home-page "https://interversehq.com/qview/")
555 (synopsis "Convenient and minimal image viewer")
556 (description "qView is a Qt image viewer designed with visually
557minimalism and usability in mind. Its features include animated GIF
558controls, file history, rotation/mirroring, and multithreaded
559preloading.")
560 (license license:gpl3+)))
52bb05c7 561
562(define-public chafa
563 (package
564 (name "chafa")
f73c1a48 565 (version "1.2.2")
52bb05c7 566 (source (origin
567 (method url-fetch)
568 (uri (string-append "https://hpjansson.org/chafa/releases/chafa-"
569 version ".tar.xz"))
570 (sha256
571 (base32
f73c1a48 572 "0aa7119514rhsak5i0kgvwllb9z74lnfzfn7dzfhs27fc8cvx1dg"))))
52bb05c7 573 (build-system gnu-build-system)
574 (native-inputs
575 `(("pkg-config" ,pkg-config)))
576 (inputs
577 `(("glib" ,glib)
578 ("imagemagick" ,imagemagick)))
579 (synopsis "Convert images to ANSI/Unicode characters")
580 (description
581 "Chafa is a command-line utility that converts all kinds of images,
582including animated GIFs, into ANSI/Unicode character output that can be
583displayed in a terminal.")
584 (home-page "https://hpjansson.org/chafa/")
585 (license license:lgpl3+)))
cd819b45
PMY
586
587(define-public imv
588 (package
589 (name "imv")
590 (version "4.1.0")
591 (source (origin
592 (method git-fetch)
593 (uri (git-reference
594 (url "https://github.com/eXeC64/imv")
595 (commit (string-append "v" version))))
596 (sha256
597 (base32
598 "0gk8g178i961nn3bls75a8qpv6wvfvav6hd9lxca1skaikd33zdx"))
599 (file-name (git-file-name name version))))
600 (build-system gnu-build-system)
601 (arguments
602 '(#:phases
603 (modify-phases %standard-phases
51c87770
LC
604 (delete 'configure)
605 (add-after 'install 'record-absolute-file-names
606 (lambda* (#:key outputs #:allow-other-keys)
607 ;; 'imv' is a script that execs 'imv-x11' or 'imv-wayland'.
608 ;; Record their absolute file name.
609 (let* ((out (assoc-ref outputs "out"))
610 (bin (string-append out "/bin")))
611 (substitute* (string-append bin "/imv")
612 (("imv-")
613 (string-append bin "/imv-")))
614 #t))))
cd819b45
PMY
615 #:make-flags
616 (list "CC=gcc"
617 (string-append "PREFIX=" (assoc-ref %outputs "out"))
618 (string-append "CONFIGPREFIX="
619 (assoc-ref %outputs "out") "/etc"))))
620 (inputs
621 `(("asciidoc" ,asciidoc)
622 ("freeimage" ,freeimage)
623 ("glu" ,glu)
624 ("librsvg" ,librsvg)
625 ("libxkbcommon" ,libxkbcommon)
626 ("pango" ,pango)
627 ("wayland" ,wayland)))
628 (native-inputs
629 `(("cmocka" ,cmocka)
630 ("pkg-config" ,pkg-config)))
631 (synopsis "Image viewer for tiling window managers")
632 (description "@code{imv} is a command line image viewer intended for use
633with tiling window managers. Features include:
634
635@itemize
636@item Native Wayland and X11 support.
637@item Support for dozens of image formats including:
638@itemize
639@item PNG
640@item JPEG
641@item Animated GIFs
642@item SVG
643@item TIFF
644@item Various RAW formats
645@item Photoshop PSD files
646@end itemize
647@item Configurable key bindings and behavior.
648@item Highly scriptable with IPC via imv-msg.
649@end itemize\n")
650 (home-page "https://github.com/eXeC64/imv")
651 (license license:expat)))
e2bd0af3
VK
652
653(define-public qiv
654 (package
655 (name "qiv")
656 (version "2.3.1")
657 (source
658 (origin
659 (method url-fetch)
660 (uri (string-append "http://spiegl.de/qiv/download/qiv-"
661 version ".tgz"))
662 (sha256
663 (base32 "1rlf5h67vhj7n1y7jqkm9k115nfnzpwngj3kzqsi2lg676srclv7"))))
664 (build-system gnu-build-system)
665 (native-inputs
666 `(("pkg-config" ,pkg-config)
667 ;; That is required for testing.
668 ("xorg-server" ,xorg-server-for-tests)))
669 (inputs
670 `(("imlib2" ,imlib2)
671 ("glib" ,glib)
672 ("gtk+" ,gtk+-2)
673 ("lcms" ,lcms)
27783023 674 ("libjpeg" ,libjpeg-turbo)
e2bd0af3
VK
675 ("libtiff" ,libtiff)
676 ("libexif" ,libexif)
677 ("libx11" ,libx11)
678 ("libxext" ,libxext)))
679 (arguments
680 `(#:phases
681 (modify-phases %standard-phases
682 (delete 'configure) ; no configure script
683 (add-before 'install 'patch-file-start-xserver
684 (lambda* (#:key inputs #:allow-other-keys)
685 ;; patch the file so that qiv runs and exits by itself
686 (substitute* "Makefile"
687 (("./qiv -f ./intro.jpg") "./qiv -f -C -s ./intro.jpg")
688 ;; Fail the build when test fails.
689 (("echo \"-- Test Failed --\"")
690 "(echo \"-- Test Failed --\" ; false)"))
691 ;; There must be a running X server and make install doesn't start one.
692 ;; Therefore we must do it.
693 (system "Xvfb :1 &")
694 (setenv "DISPLAY" ":1")
695 #t)))
696 #:tests? #f ; there is no check target
697 #:make-flags
698 (list
699 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
700 (home-page "http://spiegl.de/qiv/")
701 (synopsis "Graphical image viewer for X")
702 (description
703 "Quick Image Viewer is a small and fast GDK/Imlib2 image viewer.
704Features include zoom, maxpect, scale down, fullscreen, slideshow, delete,
705brightness/contrast/gamma correction, pan with keyboard and mouse, flip,
706rotate left/right, jump/forward/backward images, filename filter and use it
707to set X desktop background.")
708 (license license:gpl2)))