summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Pelz <pelzflorian@pelzflorian.de>2023-05-13 12:33:26 +0200
committerFlorian Pelz <pelzflorian@pelzflorian.de>2025-01-16 15:14:33 +0100
commit7aae0e2c159b1612b405a372b18f25fbb58f9d82 (patch)
treeb7703fad0dc66cc821e7ac259cd9a89710f1c15a
parent750b13031bd41661b4375e990e9af76ee304d2b9 (diff)
gnu: viewnior: Support image formats out of the box.
* gnu/packages/image-viewers.scm (viewnior) [inputs]: Add 'webp-pixbuf-loader' for WebP support. [arguments]: Enable 'glib-or-gtk?' to make available GDK_PIXBUF_MODULE_FILE. Wrap viewnior to use it instead of the image loaders installed by the user. Fixes: <https://issues.guix.gnu.org/63427> Change-Id: I86b7c2845af2fc1d3fdf4032b2208493a6868546
-rw-r--r--gnu/packages/image-viewers.scm29
1 files changed, 21 insertions, 8 deletions
diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm
index cb4e903f39..cea11c3e47 100644
--- a/gnu/packages/image-viewers.scm
+++ b/gnu/packages/image-viewers.scm
@@ -27,6 +27,7 @@
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
;;; Copyright © 2022 Cairn <cairn@pm.me>
+;;; Copyright © 2023 Florian Pelz <pelzflorian@pelzflorian.de>
;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -427,13 +428,24 @@ needs.")
(base32 "14qvx1wajncd5ab0207274cwk32f4ipfnlaci6phmah0cwra2did"))))
(build-system meson-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
- (add-after 'unpack 'patch-source
- (lambda _
- ;; Don't create 'icon-theme.cache'
- (substitute* "meson.build"
- (("meson.add_install_script*") "")))))
- #:tests? #f)) ;no tests
+ (list #:glib-or-gtk? #t
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-source
+ (lambda _
+ ;; Don't create 'icon-theme.cache'
+ (substitute* "meson.build"
+ (("meson.add_install_script*") ""))))
+ (add-after 'glib-or-gtk-wrap 'wrap-pixbuf
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((viewnior (string-append #$output "/bin/viewnior")))
+ (wrap-program viewnior
+ ;; Wrap GDK_PIXBUF_MODULE_FILE so viewnior can be used
+ ;; to view JPG, PNG and SVG, without the user needing
+ ;; to install gdk-pixbuf or librsvg.
+ `("GDK_PIXBUF_MODULE_FILE" =
+ (,(getenv "GDK_PIXBUF_MODULE_FILE"))))))))
+ #:tests? #f)) ;no tests
(native-inputs
(list gettext-minimal
`(,glib "bin") ;glib-genmarshal
@@ -442,7 +454,8 @@ needs.")
(inputs
(list exiv2
gdk-pixbuf
- gtk+-2))
+ gtk+-2
+ webp-pixbuf-loader))
(home-page "https://siyanpanayotov.com/project/viewnior")
(synopsis "Simple, fast and elegant image viewer")
(description "Viewnior is an image viewer program. Created to be simple,