From patchwork Sun Jan 15 01:51:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 46125 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2BBB627BBE9; Sun, 15 Jan 2023 01:52:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CC57927BBEB for ; Sun, 15 Jan 2023 01:52:08 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGsBp-0003to-AG; Sat, 14 Jan 2023 20:52:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGsBo-0003tf-5w for guix-patches@gnu.org; Sat, 14 Jan 2023 20:52:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGsBm-0006MD-3D for guix-patches@gnu.org; Sat, 14 Jan 2023 20:52:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGsBl-0008Pr-MP for guix-patches@gnu.org; Sat, 14 Jan 2023 20:52:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60825] [PATCH 2/2] gnu: libavif: Add pixbuf-loader output. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Jan 2023 01:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60825 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60825@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 60825-submit@debbugs.gnu.org id=B60825.167374748932312 (code B ref 60825); Sun, 15 Jan 2023 01:52:01 +0000 Received: (at 60825) by debbugs.gnu.org; 15 Jan 2023 01:51:29 +0000 Received: from localhost ([127.0.0.1]:55854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGsBE-0008P2-N0 for submit@debbugs.gnu.org; Sat, 14 Jan 2023 20:51:29 -0500 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]:58446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGsBB-0008Os-Qk for 60825@debbugs.gnu.org; Sat, 14 Jan 2023 20:51:27 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id 1FD5020991 for <60825@debbugs.gnu.org>; Sun, 15 Jan 2023 02:51:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id C57F280096; Sun, 15 Jan 2023 02:51:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id cs9D5AGI5BFr; Sun, 15 Jan 2023 02:51:20 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-118-236.dsl.telepac.pt [85.242.118.236]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 6B92780093; Sun, 15 Jan 2023 02:51:20 +0100 (CET) From: Bruno Victal Date: Sun, 15 Jan 2023 01:51:17 +0000 Message-Id: <500cb9f665aa9454cc9f4e06bb631f129c0e02a5.1673747078.git.mirai@makinata.eu> X-Mailer: git-send-email 2.38.1 In-Reply-To: <23872b75712660593afaa19c0498c7782e0a2b79.1673747078.git.mirai@makinata.eu> References: <23872b75712660593afaa19c0498c7782e0a2b79.1673747078.git.mirai@makinata.eu> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 ;;; Copyright © 2022 Jai Vetrivelan ;;; Copyright © 2022 ( -;;; Copyright © 2022 Bruno Victal +;;; Copyright © 2022-2023 Bruno Victal ;;; ;;; 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