public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Jakov Smolić" <jsmolic@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libheif/, media-libs/libheif/files/
Date: Thu, 28 Jul 2022 09:15:43 +0000 (UTC)	[thread overview]
Message-ID: <1658999747.289889477eb75bb7432c9ef0f414edc6fdbfc625.jsmolic@gentoo> (raw)

commit:     289889477eb75bb7432c9ef0f414edc6fdbfc625
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 28 09:09:46 2022 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Thu Jul 28 09:15:47 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28988947

media-libs/libheif: Fix breakage with dav1d-1.0.0

Closes: https://bugs.gentoo.org/836205
Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 .../libheif/files/libheif-1.12.0-dav1d-1.0.0.patch | 45 +++++++++++++
 media-libs/libheif/libheif-1.12.0-r2.ebuild        | 77 ++++++++++++++++++++++
 2 files changed, 122 insertions(+)

diff --git a/media-libs/libheif/files/libheif-1.12.0-dav1d-1.0.0.patch b/media-libs/libheif/files/libheif-1.12.0-dav1d-1.0.0.patch
new file mode 100644
index 000000000000..d8eb0a54016b
--- /dev/null
+++ b/media-libs/libheif/files/libheif-1.12.0-dav1d-1.0.0.patch
@@ -0,0 +1,45 @@
+https://bugs.gentoo.org/836205
+https://github.com/strukturag/libheif/commit/0f8496f22d284e1a69df12fe0b72f375aed31315
+
+From 0f8496f22d284e1a69df12fe0b72f375aed31315 Mon Sep 17 00:00:00 2001
+From: Dirk Farin <dirk.farin@gmail.com>
+Date: Tue, 5 Apr 2022 12:17:59 +0200
+Subject: [PATCH] fix dav1d decoding: input stream must be flushed with dav1d
+ 1.0.0
+
+---
+ libheif/heif_decoder_dav1d.cc | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/libheif/heif_decoder_dav1d.cc b/libheif/heif_decoder_dav1d.cc
+index a6c42e4f..ecf7382e 100644
+--- a/libheif/heif_decoder_dav1d.cc
++++ b/libheif/heif_decoder_dav1d.cc
+@@ -163,7 +163,10 @@ struct heif_error dav1d_decode_image(void* decoder_raw, struct heif_image** out_
+   Dav1dPicture frame;
+   memset(&frame, 0, sizeof(Dav1dPicture));
+ 
++  bool flushed = false;
++
+   for (;;) {
++
+     int res = dav1d_send_data(decoder->context, &decoder->data);
+     if ((res < 0) && (res != DAV1D_ERR(EAGAIN))) {
+       err = {heif_error_Decoder_plugin_error,
+@@ -173,11 +176,11 @@ struct heif_error dav1d_decode_image(void* decoder_raw, struct heif_image** out_
+     }
+ 
+     res = dav1d_get_picture(decoder->context, &frame);
+-    if (res == DAV1D_ERR(EAGAIN)) {
+-      err = {heif_error_Decoder_plugin_error,
+-             heif_suberror_Unspecified,
+-             kEmptyString};
+-      return err;
++    if (!flushed && res == DAV1D_ERR(EAGAIN)) {
++      if (decoder->data.sz == 0) {
++        flushed = true;
++      }
++      continue;
+     }
+     else if (res < 0) {
+       err = {heif_error_Decoder_plugin_error,

diff --git a/media-libs/libheif/libheif-1.12.0-r2.ebuild b/media-libs/libheif/libheif-1.12.0-r2.ebuild
new file mode 100644
index 000000000000..b2c32a86b402
--- /dev/null
+++ b/media-libs/libheif/libheif-1.12.0-r2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools xdg multilib-minimal
+
+if [[ ${PV} == *9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/strukturag/libheif.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/strukturag/libheif/releases/download/v${PV}/${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+fi
+
+DESCRIPTION="ISO/IEC 23008-12:2017 HEIF file format decoder and encoder"
+HOMEPAGE="https://github.com/strukturag/libheif"
+
+LICENSE="GPL-3"
+SLOT="0/1.12"
+IUSE="+aom gdk-pixbuf go rav1e test +threads x265"
+REQUIRED_USE="test? ( go )"
+RESTRICT="!test? ( test )"
+
+BDEPEND="test? ( dev-lang/go )"
+DEPEND="
+	media-libs/dav1d:=[${MULTILIB_USEDEP}]
+	media-libs/libde265:=[${MULTILIB_USEDEP}]
+	media-libs/libpng:0=[${MULTILIB_USEDEP}]
+	sys-libs/zlib:=[${MULTILIB_USEDEP}]
+	virtual/jpeg:0=[${MULTILIB_USEDEP}]
+	aom? ( >=media-libs/libaom-2.0.0:=[${MULTILIB_USEDEP}] )
+	gdk-pixbuf? ( x11-libs/gdk-pixbuf[${MULTILIB_USEDEP}] )
+	go? ( dev-lang/go )
+	rav1e? ( media-video/rav1e:= )
+	x265? ( media-libs/x265:=[${MULTILIB_USEDEP}] )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-dav1d-1.0.0.patch
+)
+
+src_prepare() {
+	default
+
+	sed -i -e 's:-Werror::' configure.ac || die
+
+	eautoreconf
+
+	# prevent "stat heif-test.go: no such file or directory"
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	export GO111MODULE=auto
+	local econf_args=(
+		--enable-libde265
+		--disable-static
+		$(multilib_is_native_abi && use go || echo --disable-go)
+		$(use_enable aom)
+		$(use_enable gdk-pixbuf)
+		$(use_enable rav1e)
+		$(use_enable threads multithreading)
+		$(use_enable x265)
+	)
+	ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_test() {
+	default
+	emake -C go test
+}
+
+multilib_src_install_all() {
+	einstalldocs
+	find "${ED}" -name '*.la' -delete || die
+}


             reply	other threads:[~2022-07-28  9:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28  9:15 Jakov Smolić [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-08-16  1:26 [gentoo-commits] repo/gentoo:master commit in: media-libs/libheif/, media-libs/libheif/files/ Sam James
2020-08-15  0:57 Sam James

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=1658999747.289889477eb75bb7432c9ef0f414edc6fdbfc625.jsmolic@gentoo \
    --to=jsmolic@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox