all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bruno Victal <mirai@makinata.eu>
To: 60825@debbugs.gnu.org
Cc: Bruno Victal <mirai@makinata.eu>
Subject: [bug#60825] [PATCH 2/2] gnu: libavif: Add pixbuf-loader output.
Date: Sun, 15 Jan 2023 01:51:17 +0000	[thread overview]
Message-ID: <500cb9f665aa9454cc9f4e06bb631f129c0e02a5.1673747078.git.mirai@makinata.eu> (raw)
In-Reply-To: <23872b75712660593afaa19c0498c7782e0a2b79.1673747078.git.mirai@makinata.eu>

* gnu/packages/image.scm (libavif)[arguments]: Build gdk-pixbuf loader.
[outputs]: Add 'pixbuf-loader' output.
[inputs]: Add gdk-pixbuf.
[native-inputs]: Add pkg-config.
---

This output builds and "should work" but it doesn't do anything because our shared-mime-info is too outdated to include image/avif.

 gnu/packages/image.scm | 41 +++++++++++++++++++++++++++++++++--------
 1 file changed, 33 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 0618c13460..65f388e7bd 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -34,7 +34,7 @@
 ;;; Copyright © 2021 Alexandr Vityazev <avityazev@posteo.org>
 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
 ;;; Copyright © 2022 ( <paren@disroot.org>
-;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
+;;; Copyright © 2022-2023 Bruno Victal <mirai@makinata.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2170,15 +2170,23 @@ (define-public libavif
     (build-system cmake-build-system)
     (arguments
      (list
+      #:modules '((guix build cmake-build-system)
+                  (guix build utils)
+                  (srfi srfi-26))
       #:configure-flags
       #~(list "-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
               #$@(if (this-package-input "rav1e")
                    '("-DAVIF_CODEC_RAV1E=ON")
                    '())
               "-DAVIF_BUILD_TESTS=ON" "-DAVIF_ENABLE_GTEST=ON"
-              "-DAVIF_BUILD_APPS=ON")
+              "-DAVIF_BUILD_APPS=ON" "-DAVIF_BUILD_GDK_PIXBUF=ON")
       #:phases
       #~(modify-phases %standard-phases
+          (add-before 'configure 'patch-thumbnailer
+            (lambda _
+              (substitute* "contrib/gdk-pixbuf/avif.thumbnailer.in"
+                (("@CMAKE_INSTALL_FULL_BINDIR@/gdk-pixbuf-thumbnailer")
+                 (string-append #$gdk-pixbuf "/bin/gdk-pixbuf-thumbnailer")))))
           (add-after 'install 'install-readme
             (lambda _
               (let ((doc (string-append #$output "/share/doc/libavif-" #$version)))
@@ -2188,23 +2196,40 @@ (define-public libavif
               (let* ((avifenc  (string-append #$output       "/bin/avifenc"))
                      (avifenc* (string-append #$output:tools "/bin/avifenc"))
                      (avifdec  (string-append #$output       "/bin/avifdec"))
-                     (avifdec* (string-append #$output:tools "/bin/avifdec")))
+                     (avifdec* (string-append #$output:tools "/bin/avifdec"))
+
+                     (thumbnailer    (string-append #$output
+                                                    "/share/thumbnailers/avif.thumbnailer"))
+                     (thumbnailer*   (string-append #$output:pixbuf-loader
+                                                    "/share/thumbnailers/avif.thumbnailer"))
+                     (pixbuf-loader  (string-append #$output
+                                                    "/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-avif.so"))
+                     (pixbuf-loader* (string-append #$output:pixbuf-loader
+                                                    "/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-avif.so")))
                 (mkdir-p (string-append #$output:tools "/bin"))
+                (for-each (compose mkdir-p
+                                   (cut string-append
+                                        #$output:pixbuf-loader <>))
+                          '("/share/thumbnailers"
+                            "/lib/gdk-pixbuf-2.0/2.10.0/loaders/"))
 
                 (for-each (lambda (old new)
                             (copy-file old new)
                             (delete-file old)
                             (chmod new #o555))
-                          (list avifenc avifdec)
-                          (list avifenc* avifdec*))))))))
-    (native-inputs (list googletest))
+                          (list avifenc avifdec
+                                thumbnailer pixbuf-loader)
+                          (list avifenc* avifdec*
+                                thumbnailer* pixbuf-loader*))))))))
+    (native-inputs (list googletest pkg-config))
     (inputs
      (append
       (if (member (%current-system) (package-transitive-supported-systems rav1e))
         (list rav1e) '())
-      (list dav1d libaom zlib libpng libjpeg-turbo)))
+      (list dav1d libaom zlib libpng libjpeg-turbo gdk-pixbuf)))
     (outputs (list "out"
-                   "tools"))  ; avifenc & avifdec
+                   "tools"  ; avifenc & avifdec
+                   "pixbuf-loader"))
     (synopsis "Encode and decode AVIF files")
     (description "Libavif is a C implementation of @acronym{AVIF, the AV1 Image
 File Format}.  It can encode and decode all YUV formats and bit depths supported
-- 
2.38.1





  reply	other threads:[~2023-01-15  1:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-15  1:45 [bug#60825] [PATCH 1/2] gnu: libavif: Update to 0.11.1 Bruno Victal
2023-01-15  1:51 ` Bruno Victal [this message]
2023-02-11 20:43   ` bug#60825: [PATCH 2/2] gnu: libavif: Add pixbuf-loader output Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=500cb9f665aa9454cc9f4e06bb631f129c0e02a5.1673747078.git.mirai@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=60825@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.