image-viewers.scm 16 KB

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