summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-08-16 02:25:42 +0100
committerSam James <sam@gentoo.org>2022-08-16 02:26:13 +0100
commitff3eca2e2ab83585c60588c2a6270eab833b8a4f (patch)
tree90c42b8f8b32a2332ba42aeb79ca3c2f1fc18594 /media-libs/libheif
parentmedia-libs/libheif: conditionally build tests (diff)
downloadgentoo-ff3eca2e2ab83585c60588c2a6270eab833b8a4f.tar.gz
gentoo-ff3eca2e2ab83585c60588c2a6270eab833b8a4f.tar.bz2
gentoo-ff3eca2e2ab83585c60588c2a6270eab833b8a4f.zip
media-libs/libheif: fix bashism in configure
Revbump for the fix given it affects some odd visibility logic, so we'll be careful. Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/libheif')
-rw-r--r--media-libs/libheif/files/libheif-1.12.0-fix-bashism.patch37
-rw-r--r--media-libs/libheif/libheif-1.12.0-r3.ebuild79
-rw-r--r--media-libs/libheif/libheif-9999.ebuild4
3 files changed, 120 insertions, 0 deletions
diff --git a/media-libs/libheif/files/libheif-1.12.0-fix-bashism.patch b/media-libs/libheif/files/libheif-1.12.0-fix-bashism.patch
new file mode 100644
index 000000000000..3d4d12495051
--- /dev/null
+++ b/media-libs/libheif/files/libheif-1.12.0-fix-bashism.patch
@@ -0,0 +1,37 @@
+https://github.com/strukturag/libheif/pull/660
+
+From a50ef159794ff66fc0a03d5269b1c36a000673ea Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Tue, 16 Aug 2022 02:23:13 +0100
+Subject: [PATCH] configure.ac: fix bashism
+
+configure scripts need to be runnable with a POSIX-compliant /bin/sh.
+
+On many (but not all!) systems, /bin/sh is provided by Bash, so errors
+like this aren't spotted. Notably Debian defaults to /bin/sh provided
+by dash which doesn't tolerate such bashisms as '=='.
+
+This retains compatibility with bash.
+
+Fixes errors/warnings like:
+```
+checking for pthread_create in -lpthread... yes
+checking for simple visibility declarations... yes
+/var/tmp/portage/media-libs/libheif-1.12.0-r2/work/libheif-1.12.0/configure: 18821: test: x: unexpected operator
+checking pkg-config is at least version 0.9.0... yes
+checking for aom... yes
+```
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/configure.ac
++++ b/configure.ac
+@@ -85,7 +85,7 @@ AS_IF([test "x$enable_tests" = "xyes"], [
+ HAVE_VISIBILITY=0
+ CFLAG_VISIBILITY=
+ ])
+-AM_CONDITIONAL([HAVE_TESTS], [test "x$HAVE_TESTS" == "x1"])
++AM_CONDITIONAL([HAVE_TESTS], [test "x$HAVE_TESTS" = "x1"])
+
+ AM_CONDITIONAL([HAVE_VISIBILITY], [test "x$HAVE_VISIBILITY" != "x0"])
+ if eval "test x$enable_visibility = x" ; then enable_visibility=yes ; fi
+
diff --git a/media-libs/libheif/libheif-1.12.0-r3.ebuild b/media-libs/libheif/libheif-1.12.0-r3.ebuild
new file mode 100644
index 000000000000..08b2005689dd
--- /dev/null
+++ b/media-libs/libheif/libheif-1.12.0-r3.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+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 ~loong ~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}]
+ media-libs/libjpeg-turbo: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
+ "${FILESDIR}"/${PN}-1.12.0-fix-bashism.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 test tests)
+ $(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
+}
diff --git a/media-libs/libheif/libheif-9999.ebuild b/media-libs/libheif/libheif-9999.ebuild
index a193a851d4da..e7ee0500a762 100644
--- a/media-libs/libheif/libheif-9999.ebuild
+++ b/media-libs/libheif/libheif-9999.ebuild
@@ -36,6 +36,10 @@ DEPEND="
x265? ( media-libs/x265:=[${MULTILIB_USEDEP}] )"
RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.12.0-fix-bashism.patch
+)
+
src_prepare() {
default