Commit | Line | Data |
---|---|---|
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> |
a0570377 | 13 | ;;; Copyright © 2019, 2020 Guy Fleury Iteriteka <gfleury@disroot.org> |
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") | |
866ce943 | 77 | (version "3.4.1") |
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 | |
866ce943 | 85 | "0yvvj1s7ayn0lwils582smwkmckdk0gij5c58g45n4xh981n693q")))) |
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. | |
110 | Unlike most other viewers, it does not have a fancy GUI, but simply | |
111 | displays images. It can also be used to set the desktop wallpaper. | |
112 | It is controlled via commandline arguments and configurable key/mouse | |
113 | actions.") | |
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 | |
e3e757ed LC |
123 | (package |
124 | (name "geeqie") | |
125 | (version "1.5") | |
126 | (source (origin | |
127 | (method git-fetch) | |
128 | (uri (git-reference | |
129 | (url "https://github.com/BestImageViewer/geeqie") | |
130 | (commit (string-append "v" version)))) | |
131 | (sha256 | |
132 | (base32 | |
133 | "0nf45sh3pwsv98sppcrqj81b6mdi31n1sbc7gn88m8mhpfp1qq6k")) | |
134 | (file-name (git-file-name name version)))) | |
135 | (build-system gnu-build-system) | |
136 | (arguments | |
137 | `( ;; Enable support for a "map" pane using GPS data. | |
138 | #:configure-flags '("--enable-map" | |
139 | "--enable-gtk3"))) | |
140 | (inputs | |
141 | `(("clutter" ,clutter) | |
142 | ("libchamplain" ,libchamplain) | |
143 | ("lcms" ,lcms) | |
144 | ("exiv2" ,exiv2) | |
145 | ("libpng" ,libpng) | |
146 | ("gtk+" ,gtk+))) | |
147 | (native-inputs | |
148 | `(("autoconf" ,autoconf) | |
149 | ("automake" ,automake) | |
150 | ("glib" ,glib "bin") ; glib-gettextize | |
151 | ("intltool" ,intltool) | |
152 | ("pkg-config" ,pkg-config))) | |
153 | (home-page "http://www.geeqie.org/") | |
154 | (synopsis "Lightweight GTK+ based image viewer") | |
155 | (description | |
156 | "Geeqie is a lightweight GTK+ based image viewer for Unix like operating | |
d1a5b200 AK |
157 | systems. It features: EXIF, IPTC and XMP metadata browsing and editing |
158 | interoperability; easy integration with other software; geeqie works on files | |
159 | and directories, there is no need to import images; fast preview for many raw | |
160 | image formats; tools for image comparison, sorting and managing photo | |
161 | collection. Geeqie was initially based on GQview.") | |
e3e757ed | 162 | (license license:gpl2+))) |
d1a5b200 | 163 | |
ed3a9ec5 MO |
164 | (define-public gpicview |
165 | (package | |
166 | (name "gpicview") | |
167 | (version "0.2.5") | |
168 | (source (origin | |
169 | (method url-fetch) | |
170 | (uri (string-append "mirror://sourceforge/lxde/" | |
171 | "GPicView%20%28image%20Viewer%29/0.2.x/" | |
172 | name "-" version ".tar.xz")) | |
173 | (sha256 | |
174 | (base32 | |
175 | "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq")))) | |
176 | (build-system gnu-build-system) | |
177 | (inputs `(("gtk+" ,gtk+-2) | |
4bd428a7 | 178 | ("libjpeg" ,libjpeg-turbo))) |
ed3a9ec5 MO |
179 | (native-inputs `(("intltool" ,intltool) |
180 | ("pkg-config" ,pkg-config))) | |
181 | (synopsis "Simple and fast image viewer for X") | |
182 | (description "gpicview is a lightweight GTK+ 2.x based image viewer. | |
183 | It is the default image viewer on LXDE desktop environment.") | |
184 | (home-page "http://lxde.sourceforge.net/gpicview/") | |
185 | (license license:gpl2+))) | |
186 | ||
d1a5b200 AK |
187 | (define-public sxiv |
188 | (package | |
189 | (name "sxiv") | |
6420cab3 | 190 | (version "26") |
d1a5b200 | 191 | (source (origin |
92f08e14 RW |
192 | (method git-fetch) |
193 | (uri (git-reference | |
b0e7b699 | 194 | (url "https://github.com/muennich/sxiv") |
92f08e14 RW |
195 | (commit (string-append "v" version)))) |
196 | (file-name (git-file-name name version)) | |
d1a5b200 AK |
197 | (sha256 |
198 | (base32 | |
6420cab3 | 199 | "0xaawlfdy7b277m38mgg4423kd7p1ffn0dq4hciqs6ivbb3q9c4f")))) |
d1a5b200 AK |
200 | (build-system gnu-build-system) |
201 | (arguments | |
6c162d0e TGR |
202 | `(#:tests? #f ; no check target |
203 | #:make-flags | |
204 | (list (string-append "PREFIX=" %output) | |
205 | "CC=gcc" | |
6420cab3 TGR |
206 | ;; Xft.h #includes <ft2build.h> without ‘freetype2/’. The Makefile |
207 | ;; works around this by hard-coding /usr/include & $PREFIX. | |
56d2007e | 208 | (string-append "CPPFLAGS=-I" |
6c162d0e TGR |
209 | (assoc-ref %build-inputs "freetype") |
210 | "/include/freetype2") | |
211 | "V=1") | |
212 | #:phases | |
213 | (modify-phases %standard-phases | |
214 | (delete 'configure)))) ; no configure script | |
d1a5b200 | 215 | (inputs |
6c162d0e | 216 | `(("freetype" ,freetype) |
d1a5b200 | 217 | ("giflib" ,giflib) |
6c162d0e TGR |
218 | ("imlib2" ,imlib2) |
219 | ("libexif" ,libexif) | |
220 | ("libx11" ,libx11) | |
221 | ("libxft" ,libxft))) | |
d1a5b200 AK |
222 | (home-page "https://github.com/muennich/sxiv") |
223 | (synopsis "Simple X Image Viewer") | |
224 | (description | |
225 | "sxiv is an alternative to feh and qiv. Its primary goal is to | |
226 | provide the most basic features required for fast image viewing. It has | |
227 | vi key bindings and works nicely with tiling window managers. Its code | |
228 | base should be kept small and clean to make it easy for you to dig into | |
229 | it and customize it for your needs.") | |
230 | (license license:gpl2+))) | |
eb55f018 EF |
231 | |
232 | (define-public viewnior | |
233 | (package | |
234 | (name "viewnior") | |
307cdd66 | 235 | (version "1.7") |
eb55f018 EF |
236 | (source |
237 | (origin | |
83541fb6 EF |
238 | (method git-fetch) |
239 | (uri (git-reference | |
b0e7b699 | 240 | (url "https://github.com/hellosiyan/Viewnior") |
83541fb6 EF |
241 | (commit (string-append name "-" version)))) |
242 | (file-name (git-file-name name version)) | |
eb55f018 EF |
243 | (sha256 |
244 | (base32 | |
83541fb6 | 245 | "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig")))) |
307cdd66 | 246 | (build-system meson-build-system) |
eb55f018 EF |
247 | (arguments |
248 | '(#:phases | |
249 | (modify-phases %standard-phases | |
307cdd66 | 250 | (add-after 'unpack 'patch-source |
ea77385c EF |
251 | (lambda _ |
252 | ;; Don't create 'icon-theme.cache' | |
307cdd66 EF |
253 | (substitute* "meson.build" |
254 | (("meson.add_install_script*") "")) | |
255 | #t))) | |
256 | #:tests? #f)) ; no tests | |
eb55f018 | 257 | (native-inputs |
307cdd66 | 258 | `(("gettext" ,gettext-minimal) |
eb55f018 | 259 | ("glib" ,glib "bin") ; glib-genmarshal |
eb55f018 | 260 | ("pkg-config" ,pkg-config) |
307cdd66 | 261 | ("shared-mime-info" ,shared-mime-info))) |
eb55f018 EF |
262 | (inputs |
263 | `(("exiv2" ,exiv2) | |
264 | ("gdk-pixbuf" ,gdk-pixbuf) | |
265 | ("gtk+-2" ,gtk+-2))) | |
307cdd66 | 266 | (home-page "http://siyanpanayotov.com/project/viewnior") |
eb55f018 EF |
267 | (synopsis "Simple, fast and elegant image viewer") |
268 | (description "Viewnior is an image viewer program. Created to be simple, | |
269 | fast and elegant. Its minimalistic interface provides more screenspace for | |
270 | your images. Among its features are: | |
271 | @enumerate | |
272 | @item Fullscreen & Slideshow | |
273 | @item Rotate, flip, crop, save, delete images | |
274 | @item Animation support | |
275 | @item Browse only selected images | |
276 | @item Navigation window | |
277 | @item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen) | |
278 | @item Simple interface | |
279 | @item EXIF and IPTC metadata | |
280 | @item Configurable mouse actions | |
281 | @end enumerate\n") | |
282 | (license license:gpl3+))) | |
9016dbc2 | 283 | |
284 | (define-public catimg | |
285 | (package | |
286 | (name "catimg") | |
0e773da0 | 287 | (version "2.6.0") |
9016dbc2 | 288 | (source |
289 | (origin | |
6f6f9267 RW |
290 | (method git-fetch) |
291 | (uri (git-reference | |
b0e7b699 | 292 | (url "https://github.com/posva/catimg") |
cdee738e | 293 | (commit version))) |
6f6f9267 | 294 | (file-name (git-file-name name version)) |
9016dbc2 | 295 | (sha256 |
0e773da0 | 296 | (base32 "0g9ywbgy162wiam9hc3yqpq5q4gyxa8fj4jskr3fdz8z8jjaabzz")))) |
9016dbc2 | 297 | (build-system cmake-build-system) |
298 | (arguments | |
1e5c056c | 299 | `(#:tests? #f ; no tests |
9016dbc2 | 300 | #:phases |
301 | (modify-phases %standard-phases | |
e2f47efe | 302 | (add-after 'unpack 'patch-convert |
9016dbc2 | 303 | (lambda _ |
e2f47efe RW |
304 | (substitute* "catimg" |
305 | ;; By replacing "convert", we also replace the "convert" | |
306 | ;; in the message 'The version of convert is too old, don't | |
307 | ;; expect good results :('. This should not happen, but in | |
308 | ;; practice this error message should not affect us. | |
309 | (("convert") (which "convert"))) | |
310 | #t)) | |
311 | (add-after 'install 'install-script | |
9016dbc2 | 312 | (lambda* (#:key outputs #:allow-other-keys) |
1e5c056c | 313 | ;; The bash script lacks an file extension. We have to rename |
9016dbc2 | 314 | ;; it so that the C program and the bash script can be happy |
315 | ;; side by side. | |
e2f47efe RW |
316 | (copy-file "../source/catimg" |
317 | (string-append (assoc-ref outputs "out") | |
318 | "/bin/catimg.sh")) | |
319 | #t))))) | |
9016dbc2 | 320 | (inputs |
1e5c056c | 321 | `(("imagemagick" ,imagemagick))) ; for the bash script version |
9016dbc2 | 322 | (home-page "https://github.com/posva/catimg") |
323 | (synopsis "Render images in the terminal") | |
324 | (description | |
325 | "Catimg is a little program that prints images in the terminal. | |
326 | It supports JPEG, PNG and GIF formats.") | |
327 | (license license:expat))) | |
e79bfa18 LC |
328 | |
329 | (define-public luminance-hdr | |
330 | (package | |
331 | (name "luminance-hdr") | |
beb7a281 | 332 | (version "2.6.0") |
e79bfa18 LC |
333 | (source (origin |
334 | (method url-fetch) | |
335 | (uri (string-append | |
336 | "mirror://sourceforge/qtpfsgui/luminance/" | |
337 | version "/luminance-hdr-" version ".tar.bz2")) | |
338 | (sha256 | |
339 | (base32 | |
beb7a281 | 340 | "188q0l63nfasqfvwbq4mwx2vh7wsfi2bq9n5nksddspl1qz01lnp")))) |
e79bfa18 LC |
341 | (build-system cmake-build-system) |
342 | (native-inputs | |
343 | `(("pkg-config" ,pkg-config) | |
344 | ("qttools" ,qttools))) | |
345 | (inputs | |
346 | `(("qtbase" ,qtbase) | |
347 | ("qtdeclarative" ,qtdeclarative) | |
beb7a281 | 348 | ("qtsvg" ,qtsvg) |
e79bfa18 LC |
349 | ("qtwebkit" ,qtwebkit) |
350 | ("boost" ,boost) | |
beb7a281 | 351 | ("eigen" ,eigen) |
e79bfa18 LC |
352 | ;; ("gtest" ,gtest) |
353 | ("libraw" ,libraw) | |
354 | ("zlib" ,zlib) | |
355 | ("exiv2" ,exiv2) | |
356 | ("libpng" ,libpng) | |
4bd428a7 | 357 | ("libjpeg" ,libjpeg-turbo) |
e79bfa18 LC |
358 | ("lcms" ,lcms) |
359 | ("openexr" ,openexr) | |
360 | ("fftw" ,fftwf) | |
361 | ("gsl" ,gsl) | |
362 | ("libtiff" ,libtiff))) | |
363 | (arguments | |
beb7a281 MB |
364 | '(#:tests? #f ;XXX: some tests fail to compile |
365 | #:phases | |
e79bfa18 LC |
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 | |
381 | application that aims to provide a workflow for high dynamic range (HDR) | |
382 | imaging. 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 | |
386 | 16bit, 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. | |
4ee81d37 | 395 | (define-public mcomix |
e5afc63b PN |
396 | ;; Official mcomix hasn't been updated since 2016, it's broken with |
397 | ;; python-pillow 6+ and only supports Python 2. We use fork instead. | |
398 | (let ((commit "fea55a7a9369569eefed72209eed830409c4af98")) | |
399 | (package | |
400 | (name "mcomix") | |
401 | (version (git-version "1.2.1" "1" commit)) | |
402 | (source | |
403 | (origin | |
404 | (method git-fetch) | |
405 | (uri (git-reference | |
406 | (url "https://github.com/multiSnow/mcomix3") | |
407 | (commit commit))) | |
408 | (file-name (git-file-name name version)) | |
409 | (sha256 | |
410 | (base32 | |
411 | "05zl0dkjwbdcm2zlk4nz9w33amlqj8pbf32a8ymshc2356fqhhi5")))) | |
412 | (build-system python-build-system) | |
413 | (inputs | |
414 | `(("p7zip" ,p7zip) | |
415 | ("python-pillow" ,python-pillow) | |
416 | ("python-pygobject" ,python-pygobject) | |
417 | ("python-pycairo" ,python-pycairo))) | |
418 | (arguments | |
419 | `(#:tests? #f ; FIXME: How do we run tests? | |
420 | #:phases | |
421 | (modify-phases %standard-phases | |
422 | (add-after 'unpack 'configure | |
423 | (lambda* (#:key inputs #:allow-other-keys) | |
424 | (let ((p7zip (assoc-ref inputs "p7zip"))) | |
425 | ;; insert absolute path to 7z executable | |
426 | (substitute* "mcomix/mcomix/archive/sevenzip_external.py" | |
427 | (("_7z_executable = -1") | |
428 | (string-append "_7z_executable = u'" p7zip "/bin/7z'")))) | |
429 | #t)) | |
430 | (replace 'build | |
431 | (lambda* (#:key outputs #:allow-other-keys) | |
432 | (let* ((out (assoc-ref outputs "out")) | |
433 | (pyver ,(version-major+minor (package-version python))) | |
434 | (lib (string-append out "/lib/python" pyver))) | |
435 | (invoke (which "python") "installer.py" "--srcdir=mcomix" | |
436 | (string-append "--target=" lib)) | |
437 | (rename-file (string-append lib "/mcomix") | |
438 | (string-append lib "/site-packages")) | |
439 | #t))) | |
440 | (replace 'install | |
441 | (lambda* (#:key outputs #:allow-other-keys) | |
442 | (let* ((out (assoc-ref outputs "out")) | |
443 | (share (string-append out "/share")) | |
444 | (bin (string-append out "/bin")) | |
445 | (pyver ,(version-major+minor (package-version python))) | |
446 | (lib (string-append out "/lib/python" pyver "/site-packages"))) | |
447 | (mkdir-p bin) | |
448 | (rename-file (string-append lib "/mcomixstarter.py") | |
449 | (string-append bin "/mcomix")) | |
450 | (rename-file (string-append lib "/comicthumb.py") | |
451 | (string-append bin "/comicthumb")) | |
452 | (install-file "mime/mcomix.desktop" | |
453 | (string-append share "/applications")) | |
454 | (install-file "mime/mcomix.appdata.xml" | |
455 | (string-append share "/metainfo")) | |
456 | (install-file "mime/mcomix.xml" | |
457 | (string-append share "/mime/packages")) | |
458 | (install-file "mime/comicthumb.thumbnailer" | |
459 | (string-append share "/thumbnailers")) | |
460 | (install-file "man/mcomix.1" (string-append share "/man/man1")) | |
461 | (install-file "man/comicthumb.1" (string-append share "/man/man1")) | |
462 | (for-each | |
463 | (lambda (size) | |
464 | (install-file | |
465 | (format #f "mcomix/mcomix/images/~sx~s/mcomix.png" size size) | |
466 | (format #f "~a/icons/hicolor/~sx~s/apps/" share size size)) | |
467 | (for-each | |
468 | (lambda (ext) | |
469 | (install-file | |
470 | (format #f "mime/icons/~sx~s/application-x-~a.png" size size ext) | |
471 | (format #f "~a/icons/hicolor/~sx~s/mimetypes/" | |
472 | share size size))) | |
473 | '("cb7" "cbr" "cbt" "cbz"))) | |
474 | '(16 22 24 32 48)) | |
475 | #t)))))) | |
476 | (home-page "https://sourceforge.net/p/mcomix/wiki/Home/") | |
477 | (synopsis "Image viewer for comics") | |
478 | (description "MComix is a customizable image viewer that specializes as | |
4ee81d37 | 479 | a comic and manga reader. It supports a variety of container formats |
e5afc63b PN |
480 | including CBZ, CB7, CBT, LHA. |
481 | ||
482 | For PDF support, install the @emph{mupdf} package.") | |
483 | (license license:gpl2+)))) | |
87036462 NG |
484 | |
485 | (define-public qview | |
486 | (package | |
487 | (name "qview") | |
4f620bbf NG |
488 | (version "3.0") |
489 | (source | |
490 | (origin | |
491 | (method git-fetch) | |
492 | (uri (git-reference | |
b0e7b699 | 493 | (url "https://github.com/jurplel/qView") |
4f620bbf NG |
494 | (commit version))) |
495 | (file-name (git-file-name name version)) | |
496 | (sha256 | |
497 | (base32 "15a91bs3wcqhgf76wzigbn10hayg628j84pq4j2vaxar94ak0vk7")))) | |
87036462 NG |
498 | (build-system gnu-build-system) |
499 | (arguments | |
500 | `(#:phases | |
501 | (modify-phases %standard-phases | |
502 | (replace 'configure | |
503 | (lambda _ | |
504 | (invoke "qmake"))) | |
505 | ;; Installation process hard-codes "/usr/bin", possibly | |
506 | ;; prefixed. | |
507 | (add-after 'configure 'fix-install-directory | |
508 | (lambda* (#:key outputs #:allow-other-keys) | |
509 | (let ((out (assoc-ref outputs "out"))) | |
510 | (substitute* "Makefile" | |
511 | (("\\$\\(INSTALL_ROOT\\)/usr") out)) | |
512 | #t))) | |
513 | ;; Don't phone home or show "Checking for updates..." in the | |
514 | ;; About menu. | |
515 | (add-before 'build 'disable-auto-update | |
516 | (lambda _ | |
517 | (substitute* "src/qvaboutdialog.cpp" | |
518 | (("ui->updateLabel->setText\\(updateText\\);") "") | |
519 | (("requestUpdates\\(\\);") "")) | |
520 | #t))))) | |
521 | (inputs | |
522 | `(("qtbase" ,qtbase) | |
523 | ("qtsvg" ,qtsvg) | |
524 | ("qtimageformats" ,qtimageformats))) | |
525 | (home-page "https://interversehq.com/qview/") | |
526 | (synopsis "Convenient and minimal image viewer") | |
527 | (description "qView is a Qt image viewer designed with visually | |
528 | minimalism and usability in mind. Its features include animated GIF | |
529 | controls, file history, rotation/mirroring, and multithreaded | |
530 | preloading.") | |
531 | (license license:gpl3+))) | |
52bb05c7 | 532 | |
533 | (define-public chafa | |
534 | (package | |
535 | (name "chafa") | |
a0570377 | 536 | (version "1.4.1") |
52bb05c7 | 537 | (source (origin |
538 | (method url-fetch) | |
539 | (uri (string-append "https://hpjansson.org/chafa/releases/chafa-" | |
540 | version ".tar.xz")) | |
541 | (sha256 | |
542 | (base32 | |
a0570377 | 543 | "18rb82bfqj1sj2g4irazx4lwq9q4b4k7my1r0q714vf9yhs41ls6")))) |
52bb05c7 | 544 | (build-system gnu-build-system) |
545 | (native-inputs | |
546 | `(("pkg-config" ,pkg-config))) | |
547 | (inputs | |
a0570377 | 548 | `(("freetype" ,freetype) |
549 | ("libjpeg" ,libjpeg-turbo) | |
550 | ("glib" ,glib) | |
52bb05c7 | 551 | ("imagemagick" ,imagemagick))) |
552 | (synopsis "Convert images to ANSI/Unicode characters") | |
553 | (description | |
554 | "Chafa is a command-line utility that converts all kinds of images, | |
555 | including animated GIFs, into ANSI/Unicode character output that can be | |
556 | displayed in a terminal.") | |
557 | (home-page "https://hpjansson.org/chafa/") | |
558 | (license license:lgpl3+))) | |
cd819b45 PMY |
559 | |
560 | (define-public imv | |
561 | (package | |
562 | (name "imv") | |
563 | (version "4.1.0") | |
564 | (source (origin | |
565 | (method git-fetch) | |
566 | (uri (git-reference | |
567 | (url "https://github.com/eXeC64/imv") | |
568 | (commit (string-append "v" version)))) | |
569 | (sha256 | |
570 | (base32 | |
571 | "0gk8g178i961nn3bls75a8qpv6wvfvav6hd9lxca1skaikd33zdx")) | |
572 | (file-name (git-file-name name version)))) | |
573 | (build-system gnu-build-system) | |
574 | (arguments | |
575 | '(#:phases | |
576 | (modify-phases %standard-phases | |
51c87770 LC |
577 | (delete 'configure) |
578 | (add-after 'install 'record-absolute-file-names | |
579 | (lambda* (#:key outputs #:allow-other-keys) | |
580 | ;; 'imv' is a script that execs 'imv-x11' or 'imv-wayland'. | |
581 | ;; Record their absolute file name. | |
582 | (let* ((out (assoc-ref outputs "out")) | |
583 | (bin (string-append out "/bin"))) | |
584 | (substitute* (string-append bin "/imv") | |
585 | (("imv-") | |
586 | (string-append bin "/imv-"))) | |
587 | #t)))) | |
cd819b45 PMY |
588 | #:make-flags |
589 | (list "CC=gcc" | |
590 | (string-append "PREFIX=" (assoc-ref %outputs "out")) | |
591 | (string-append "CONFIGPREFIX=" | |
592 | (assoc-ref %outputs "out") "/etc")))) | |
593 | (inputs | |
594 | `(("asciidoc" ,asciidoc) | |
595 | ("freeimage" ,freeimage) | |
596 | ("glu" ,glu) | |
597 | ("librsvg" ,librsvg) | |
598 | ("libxkbcommon" ,libxkbcommon) | |
599 | ("pango" ,pango) | |
600 | ("wayland" ,wayland))) | |
601 | (native-inputs | |
602 | `(("cmocka" ,cmocka) | |
603 | ("pkg-config" ,pkg-config))) | |
604 | (synopsis "Image viewer for tiling window managers") | |
605 | (description "@code{imv} is a command line image viewer intended for use | |
606 | with tiling window managers. Features include: | |
607 | ||
608 | @itemize | |
609 | @item Native Wayland and X11 support. | |
610 | @item Support for dozens of image formats including: | |
611 | @itemize | |
612 | @item PNG | |
613 | @item JPEG | |
614 | @item Animated GIFs | |
615 | @item SVG | |
616 | @item TIFF | |
617 | @item Various RAW formats | |
618 | @item Photoshop PSD files | |
619 | @end itemize | |
620 | @item Configurable key bindings and behavior. | |
621 | @item Highly scriptable with IPC via imv-msg. | |
622 | @end itemize\n") | |
623 | (home-page "https://github.com/eXeC64/imv") | |
624 | (license license:expat))) | |
e2bd0af3 VK |
625 | |
626 | (define-public qiv | |
627 | (package | |
628 | (name "qiv") | |
629 | (version "2.3.1") | |
630 | (source | |
631 | (origin | |
632 | (method url-fetch) | |
633 | (uri (string-append "http://spiegl.de/qiv/download/qiv-" | |
634 | version ".tgz")) | |
635 | (sha256 | |
636 | (base32 "1rlf5h67vhj7n1y7jqkm9k115nfnzpwngj3kzqsi2lg676srclv7")))) | |
637 | (build-system gnu-build-system) | |
638 | (native-inputs | |
639 | `(("pkg-config" ,pkg-config) | |
640 | ;; That is required for testing. | |
641 | ("xorg-server" ,xorg-server-for-tests))) | |
642 | (inputs | |
643 | `(("imlib2" ,imlib2) | |
644 | ("glib" ,glib) | |
645 | ("gtk+" ,gtk+-2) | |
646 | ("lcms" ,lcms) | |
27783023 | 647 | ("libjpeg" ,libjpeg-turbo) |
e2bd0af3 VK |
648 | ("libtiff" ,libtiff) |
649 | ("libexif" ,libexif) | |
650 | ("libx11" ,libx11) | |
651 | ("libxext" ,libxext))) | |
652 | (arguments | |
653 | `(#:phases | |
654 | (modify-phases %standard-phases | |
655 | (delete 'configure) ; no configure script | |
656 | (add-before 'install 'patch-file-start-xserver | |
657 | (lambda* (#:key inputs #:allow-other-keys) | |
658 | ;; patch the file so that qiv runs and exits by itself | |
659 | (substitute* "Makefile" | |
660 | (("./qiv -f ./intro.jpg") "./qiv -f -C -s ./intro.jpg") | |
661 | ;; Fail the build when test fails. | |
662 | (("echo \"-- Test Failed --\"") | |
663 | "(echo \"-- Test Failed --\" ; false)")) | |
664 | ;; There must be a running X server and make install doesn't start one. | |
665 | ;; Therefore we must do it. | |
666 | (system "Xvfb :1 &") | |
667 | (setenv "DISPLAY" ":1") | |
668 | #t))) | |
669 | #:tests? #f ; there is no check target | |
670 | #:make-flags | |
671 | (list | |
672 | (string-append "PREFIX=" (assoc-ref %outputs "out"))))) | |
673 | (home-page "http://spiegl.de/qiv/") | |
674 | (synopsis "Graphical image viewer for X") | |
675 | (description | |
676 | "Quick Image Viewer is a small and fast GDK/Imlib2 image viewer. | |
677 | Features include zoom, maxpect, scale down, fullscreen, slideshow, delete, | |
678 | brightness/contrast/gamma correction, pan with keyboard and mouse, flip, | |
679 | rotate left/right, jump/forward/backward images, filename filter and use it | |
680 | to set X desktop background.") | |
681 | (license license:gpl2))) |