gnu: Add gpicview.
[jackhill/guix/guix.git] / gnu / packages / image-viewers.scm
CommitLineData
d1a5b200
AK
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
4;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
eb55f018 5;;; Copyright © 2016 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>
eb55f018 9;;;
d1a5b200
AK
10;;; This file is part of GNU Guix.
11;;;
eb55f018
EF
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25(define-module (gnu packages image-viewers)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix download)
28 #:use-module (guix packages)
29 #:use-module (guix build-system gnu)
9016dbc2 30 #:use-module (guix build-system cmake)
eb55f018
EF
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
d1a5b200
AK
33 #:use-module (gnu packages curl)
34 #:use-module (gnu packages ghostscript)
eb55f018
EF
35 #:use-module (gnu packages glib)
36 #:use-module (gnu packages gnome)
37 #:use-module (gnu packages gtk)
023f0fb0 38 #:use-module (gnu packages image)
9016dbc2 39 #:use-module (gnu packages imagemagick)
d1a5b200
AK
40 #:use-module (gnu packages photo)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages xorg))
43
44(define-public feh
45 (package
46 (name "feh")
fdcc9163 47 (version "2.18.3")
d1a5b200
AK
48 (home-page "https://feh.finalrewind.org/")
49 (source (origin
50 (method url-fetch)
51 (uri (string-append home-page
52 name "-" version ".tar.bz2"))
53 (sha256
54 (base32
fdcc9163 55 "0qq567d0g181k6llr6p759lnni39va5xakjqngd6063fm73nhbyq"))))
d1a5b200
AK
56 (build-system gnu-build-system)
57 (arguments
58 '(#:phases (alist-delete 'configure %standard-phases)
59 #:tests? #f
60 #:make-flags
61 (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))))
62 (inputs `(("imlib2" ,imlib2)
63 ("curl" ,curl)
64 ("libpng" ,libpng)
65 ("libxt" ,libxt)
66 ("libx11" ,libx11)
67 ("libxinerama" ,libxinerama)))
68 (synopsis "Fast and light imlib2-based image viewer")
69 (description
70 "feh is an X11 image viewer aimed mostly at console users.
71Unlike most other viewers, it does not have a fancy GUI, but simply
72displays images. It can also be used to set the desktop wallpaper.
73It is controlled via commandline arguments and configurable key/mouse
74actions.")
75
76 ;; The license is really the Expat license, with additional wording in the
77 ;; 2nd paragraph: "acknowledgment shall be given in the documentation and
78 ;; software packages that this Software was used."
79 (license (license:x11-style
80 "file://COPYING"
81 "See 'COPYING' in the distribution."))))
82
83(define-public geeqie
84 (package
85 (name "geeqie")
86 (version "1.3")
87 (source (origin
88 (method url-fetch)
89 (uri (string-append "https://github.com/BestImageViewer/geeqie/"
90 "releases/download/v" version "/geeqie-"
91 version ".tar.xz"))
92 (sha256
93 (base32
94 "0gzc82sy66pbsmq7lnmq4y37zqad1zfwfls3ik3dmfm8s5nmcvsb"))))
95 (build-system gnu-build-system)
96 (arguments
97 `(#:phases
98 (modify-phases %standard-phases
99 (add-after 'unpack 'autogen
100 (lambda _
101 (setenv "NOCONFIGURE" "true")
102 (zero? (system* "sh" "autogen.sh")))))))
103 (inputs
104 `(;; ("libchamplain" ,libchamplain)
105 ("lcms" ,lcms)
106 ("exiv2" ,exiv2)
107 ("libpng" ,libpng)
108 ("gtk+" ,gtk+-2)))
109 (native-inputs
110 `(("autoconf" ,autoconf)
111 ("automake" ,automake)
112 ("glib" ,glib "bin") ; glib-gettextize
113 ("intltool" ,intltool)
114 ("pkg-config" ,pkg-config)))
115 (home-page "http://www.geeqie.org/")
116 (synopsis "Lightweight GTK+ based image viewer")
117 (description
118 "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
119systems. It features: EXIF, IPTC and XMP metadata browsing and editing
120interoperability; easy integration with other software; geeqie works on files
121and directories, there is no need to import images; fast preview for many raw
122image formats; tools for image comparison, sorting and managing photo
123collection. Geeqie was initially based on GQview.")
124 (license license:gpl2+)))
125
ed3a9ec5
MO
126(define-public gpicview
127 (package
128 (name "gpicview")
129 (version "0.2.5")
130 (source (origin
131 (method url-fetch)
132 (uri (string-append "mirror://sourceforge/lxde/"
133 "GPicView%20%28image%20Viewer%29/0.2.x/"
134 name "-" version ".tar.xz"))
135 (sha256
136 (base32
137 "0hi9v0rdx47nys0wvm9xasdrafa34r5kq6crb074a0ipwmc60iiq"))))
138 (build-system gnu-build-system)
139 (inputs `(("gtk+" ,gtk+-2)
140 ("libjpeg" ,libjpeg)))
141 (native-inputs `(("intltool" ,intltool)
142 ("pkg-config" ,pkg-config)))
143 (synopsis "Simple and fast image viewer for X")
144 (description "gpicview is a lightweight GTK+ 2.x based image viewer.
145It is the default image viewer on LXDE desktop environment.")
146 (home-page "http://lxde.sourceforge.net/gpicview/")
147 (license license:gpl2+)))
148
d1a5b200
AK
149(define-public sxiv
150 (package
151 (name "sxiv")
152 (version "1.3.2")
153 (source (origin
154 (method url-fetch)
155 (uri (string-append
156 "https://github.com/muennich/sxiv/archive/v"
157 version ".tar.gz"))
158 (file-name (string-append name "-" version ".tar.gz"))
159 (sha256
160 (base32
161 "0lxnd33gaw4drhdwbkk94wzrjyhh64d57jq2ps7ffmqgizg6hlwz"))))
162 (build-system gnu-build-system)
163 (arguments
164 '(#:tests? #f ; no check target
165 #:make-flags (list (string-append "PREFIX=" %output)
166 "CC=gcc")
167 #:phases (alist-delete
168 'configure ; no configure phase
169 %standard-phases)))
170 (inputs
171 `(("libx11" ,libx11)
172 ("imlib2" ,imlib2)
173 ("giflib" ,giflib)
174 ("libexif" ,libexif)))
175 (home-page "https://github.com/muennich/sxiv")
176 (synopsis "Simple X Image Viewer")
177 (description
178 "sxiv is an alternative to feh and qiv. Its primary goal is to
179provide the most basic features required for fast image viewing. It has
180vi key bindings and works nicely with tiling window managers. Its code
181base should be kept small and clean to make it easy for you to dig into
182it and customize it for your needs.")
183 (license license:gpl2+)))
eb55f018
EF
184
185(define-public viewnior
186 (package
187 (name "viewnior")
188 (version "1.6")
189 (source
190 (origin
191 (method url-fetch)
192 (uri (string-append "https://github.com/xsisqox/Viewnior/archive/"
193 name "-" version ".tar.gz"))
194 (sha256
195 (base32
196 "18309qjgwak3kn228z3p3nx7yxasqgzx69v3rgc23hf161nky0c9"))))
197 (build-system gnu-build-system)
198 (arguments
199 '(#:phases
200 (modify-phases %standard-phases
201 (add-after 'unpack 'autogen
202 (lambda _
203 (zero? (system* "sh" "autogen.sh")))))))
204 (native-inputs
205 `(("automake" ,automake)
206 ("autoconf" ,autoconf)
207 ("intltool" ,intltool)
208 ("glib" ,glib "bin") ; glib-genmarshal
209 ("gnome-common" ,gnome-common)
210 ("libtool" ,libtool)
211 ("pkg-config" ,pkg-config)
212 ("shared-mime-info" ,shared-mime-info)
213 ("which" ,which)))
214 (inputs
215 `(("exiv2" ,exiv2)
216 ("gdk-pixbuf" ,gdk-pixbuf)
217 ("gtk+-2" ,gtk+-2)))
218 (home-page "http://siyanpanayotov.com/project/viewnior/")
219 (synopsis "Simple, fast and elegant image viewer")
220 (description "Viewnior is an image viewer program. Created to be simple,
221fast and elegant. Its minimalistic interface provides more screenspace for
222your images. Among its features are:
223@enumerate
224@item Fullscreen & Slideshow
225@item Rotate, flip, crop, save, delete images
226@item Animation support
227@item Browse only selected images
228@item Navigation window
229@item Set image as wallpaper (Gnome 2, Gnome 3, XFCE, LXDE, FluxBox, Nitrogen)
230@item Simple interface
231@item EXIF and IPTC metadata
232@item Configurable mouse actions
233@end enumerate\n")
234 (license license:gpl3+)))
9016dbc2 235
236(define-public catimg
237 (package
238 (name "catimg")
1e5c056c 239 (version "2.2.2")
9016dbc2 240 (source
241 (origin
242 (method url-fetch)
243 (uri (string-append "https://github.com/posva/catimg/archive"
244 "/v" version ".tar.gz"))
245 (file-name (string-append name "-" version ".tar.gz"))
246 (sha256
247 (base32
1e5c056c 248 "1abkhrhw4r221lwn2vb8in3vmp6gxn3qlv34cqndr55v5gdpb9qz"))))
9016dbc2 249 (build-system cmake-build-system)
250 (arguments
1e5c056c 251 `(#:tests? #f ; no tests
9016dbc2 252 #:phases
253 (modify-phases %standard-phases
254 (replace 'configure
255 (lambda* (#:key inputs #:allow-other-keys)
256 (let* ((magic (assoc-ref %build-inputs "imagemagick"))
257 (convert (string-append magic "/bin/convert")))
258 (substitute* "catimg"
259 ;; By replacing "convert", we also replace the "convert"
260 ;; in the message 'The version of convert is too old, don't
1e5c056c 261 ;; expect good results :('. This should not happen, but in
9016dbc2 262 ;; practice this error message should not affect us.
263 (("convert") convert))
264 #t)))
265 (replace 'build
266 (lambda _
1e5c056c
TGR
267 (let* ((out (assoc-ref %outputs "out"))
268 (man (string-append out "/share/man/man1")))
269 (zero? (system* "cmake"
270 (string-append "-DCMAKE_INSTALL_PREFIX=" out)
271 (string-append "-DMAN_OUTPUT_PATH=" man)
272 "."))
273 (zero? (system* "make")))))
9016dbc2 274 (add-before 'install 'install-script
275 (lambda* (#:key outputs #:allow-other-keys)
1e5c056c 276 ;; The bash script lacks an file extension. We have to rename
9016dbc2 277 ;; it so that the C program and the bash script can be happy
278 ;; side by side.
279 (let* ((out (assoc-ref outputs "out"))
280 (bin (string-append out "/bin")))
281 (install-file "catimg" bin)
282 (rename-file (string-append bin "/catimg")
283 (string-append bin "/catimg.sh"))
284 #t))))))
285 (inputs
1e5c056c 286 `(("imagemagick" ,imagemagick))) ; for the bash script version
9016dbc2 287 (home-page "https://github.com/posva/catimg")
288 (synopsis "Render images in the terminal")
289 (description
290 "Catimg is a little program that prints images in the terminal.
291It supports JPEG, PNG and GIF formats.")
292 (license license:expat)))