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
This commit is contained in:
Florian Pelz 2023-05-13 12:33:26 +02:00
parent 750b13031b
commit 7aae0e2c15
No known key found for this signature in database
GPG key ID: 300888CB39C63817

View file

@ -27,6 +27,7 @@
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl> ;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
;;; Copyright © 2022 Cairn <cairn@pm.me> ;;; Copyright © 2022 Cairn <cairn@pm.me>
;;; Copyright © 2023 Florian Pelz <pelzflorian@pelzflorian.de>
;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com> ;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
@ -427,13 +428,24 @@ (define-public viewnior
(base32 "14qvx1wajncd5ab0207274cwk32f4ipfnlaci6phmah0cwra2did")))) (base32 "14qvx1wajncd5ab0207274cwk32f4ipfnlaci6phmah0cwra2did"))))
(build-system meson-build-system) (build-system meson-build-system)
(arguments (arguments
'(#:phases (modify-phases %standard-phases (list #:glib-or-gtk? #t
(add-after 'unpack 'patch-source #:phases
(lambda _ #~(modify-phases %standard-phases
;; Don't create 'icon-theme.cache' (add-after 'unpack 'patch-source
(substitute* "meson.build" (lambda _
(("meson.add_install_script*") ""))))) ;; Don't create 'icon-theme.cache'
#:tests? #f)) ;no tests (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 (native-inputs
(list gettext-minimal (list gettext-minimal
`(,glib "bin") ;glib-genmarshal `(,glib "bin") ;glib-genmarshal
@ -442,7 +454,8 @@ (define-public viewnior
(inputs (inputs
(list exiv2 (list exiv2
gdk-pixbuf gdk-pixbuf
gtk+-2)) gtk+-2
webp-pixbuf-loader))
(home-page "https://siyanpanayotov.com/project/viewnior") (home-page "https://siyanpanayotov.com/project/viewnior")
(synopsis "Simple, fast and elegant image viewer") (synopsis "Simple, fast and elegant image viewer")
(description "Viewnior is an image viewer program. Created to be simple, (description "Viewnior is an image viewer program. Created to be simple,