summaryrefslogtreecommitdiff
path: root/media-libs/libheif
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
commit3cf7c3ef441822c889356fd1812ebf2944a59851 (patch)
treec513fe68548b40365c1c2ebfe35c58ad431cdd77 /media-libs/libheif
parent05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff)
gentoo resync : 25.08.2020
Diffstat (limited to 'media-libs/libheif')
-rw-r--r--media-libs/libheif/Manifest14
-rw-r--r--media-libs/libheif/files/heif_test.go155
-rw-r--r--media-libs/libheif/files/libheif-1.7.0-aom.patch46
-rw-r--r--media-libs/libheif/libheif-1.5.1.ebuild13
-rw-r--r--media-libs/libheif/libheif-1.6.1.ebuild11
-rw-r--r--media-libs/libheif/libheif-1.6.2.ebuild76
-rw-r--r--media-libs/libheif/libheif-1.7.0.ebuild70
-rw-r--r--media-libs/libheif/libheif-9999.ebuild22
-rw-r--r--media-libs/libheif/metadata.xml4
9 files changed, 393 insertions, 18 deletions
diff --git a/media-libs/libheif/Manifest b/media-libs/libheif/Manifest
index 52925fe90547..492614c8f433 100644
--- a/media-libs/libheif/Manifest
+++ b/media-libs/libheif/Manifest
@@ -1,6 +1,12 @@
+AUX heif_test.go 4326 BLAKE2B c9995e9caf35db5f936dcfc54592946e81e0fda9e785309526cce40c43c2ae9663d091a30c46adb97602a6ef1921503fd5c1873b8524774dd3f24a2b3c9f64c7 SHA512 af6212a5cf6cb4e96508cc9ce63072c42e3ec36a16192e4bf0ae2ccd3949f0259617aba544c3eeb2816ffb9747d61b4476fa152720cb2ec708153c967ef08e20
+AUX libheif-1.7.0-aom.patch 1530 BLAKE2B 150b86b0b1ed872ff13dfc59933b1aec80d259456666f7bd3fac11d4c5d220349b2ca927f36835e8710f476e1df2ca13c7a5126545c80a2abd0b069953186f18 SHA512 f30474c9f31aa8676352b9848a49699c320ead37a8a59b5c62b98945e520af40fc24fcbf225240c3237cde638d7b274e45dc135a16a3e8a7b278bbafc2cfca3d
DIST libheif-1.5.1.tar.gz 1510087 BLAKE2B 1dd5e913c8913c6b62b770653585f8ccf7cda14c4dd79ff2073bf085da4d730accaef8d0f8008ac941238a7e3e131add1a218e0c78a886847b3bcf253d66c9b6 SHA512 05e32ebff08d5f0e82e9b1107253c27882ae1694150033fe7b3ca07db8c64567f09002081276e92a3b490a63022a1522d577b094a7f489742139758d17f484b8
DIST libheif-1.6.1.tar.gz 1514950 BLAKE2B d658f0c408f9a09eaac890119119327bd3e9c84db785d001b2c7a979b9574a6723403fe063ed6ce77812bface04be124e808fc90c1325c13e3d87f8b46ac0b65 SHA512 5a2104e529d59c23c988b6c0c167f9e7017ff77763eb71fee1c26f97624e9d7e2d0f863123d1886536d37f96ea6b93969a1c53e747672c54a2220aa6f47be1bf
-EBUILD libheif-1.5.1.ebuild 1457 BLAKE2B 083d8e9034d5c4fd5816047ab2e577978b395a13546e3a2d3a747f09c087feb99df885cddf20a0129c3e574bbe981a59c60bfece141505412358214463a4df92 SHA512 79599b18a58d121ffef9b15842c0faa90792d3821fdd9d54a0b2ed2ab81e6c90880230f96137cd21e406d6b254ce1f0b205401d49d0c3a774b6fc923e4b8ce93
-EBUILD libheif-1.6.1.ebuild 1464 BLAKE2B 065ca01588345b31e9f119aaeba6677fa9c126bb9430c1674432dc1094c2261553bdfb7113cc70ccc193552b99a5fc48d962f4c9724f2d4613072b9d40cca3db SHA512 249f96cc76fdca8e0b1df09515f22bdd73f039cc83e3d39d1a62ab9fa2b7f5f6bb0a8116cee3feb1f25e18a7c12eca9bcd1074a6fdc52b4aecc68047ef7ce06a
-EBUILD libheif-9999.ebuild 1464 BLAKE2B 70597a66418d649017792b147e47dee7f69064326b40ca72e37756fd7e778621178dfab5213bbf5f1587b7735235d75d49a3732beb492342692ee57ad0924f6a SHA512 431ba0826e3087c0a95cf3898130ab31bc57ac975a561c0220400e832afa8a93ff0f214223245689488d01e0f681d461b4bbb60f31ce7c5f632f2ecaa8999b5f
-MISC metadata.xml 316 BLAKE2B dcf0d4edec65ba3a6b81a64d7a7d93cf53872a3acd0907ca30e8490f07512dde8e8cec86099352db691fa0e73da5e19d3e6082a9a9ba34c8a7edce93155cf564 SHA512 298555a57208bf6b9e986f3c8b573c2dca354851fa1408a6abd14bddb53f017417c8a63948a2c5d3f47dd4e03de8d0ec667aab16c735d0970976a78a0df43e39
+DIST libheif-1.6.2.tar.gz 1515763 BLAKE2B e7a901394349bc8bbf633a0193d7a08a1cecf7e97a8ac709efb9c2e5e6da387c7fa5e8b551cecf1f67b4e7a7d06f034e64c20d7c55f9a7898c0badb79ed485f7 SHA512 41848c05d88f82827ebdd0662a1870ce8b7899f6a86ef5aa483b301176602da8e69d2c5a49b4d911bc0cac51bdab81a06fd43efae2722092cc09c02119c95f07
+DIST libheif-1.7.0.tar.gz 1526096 BLAKE2B 74b8284875321781d13d17b877eb8291ecdd0fe1700f73a433d3b125a8ee6b33a326310d729e62bac9d9fecfea095f21ef590e711d550dcaac79570b3f917885 SHA512 13c95540fee13f3fba8d8a4f69886bf5563e9fa22c5cd113dbe16d20670b077b5961171e5f9fb0f256cc42c4650e13465c93d3fbb03013997a7fc163463e8b3a
+EBUILD libheif-1.5.1.ebuild 1660 BLAKE2B 955d48d988ea3a8c2685e795eb4ba4b93819b4168adf3bca853ebd8615f059948d5e76f5adff2013877aaa16eb4f97cebdc71c8f183a996a22f276af426c2ebd SHA512 dabb513cb2586114d7db9741a15046c93d30c4793cbe29273a458fb3781768df205b36d2707f33e1d4bbc4c72a2f08e8425ef5546587b57bf1046a5fac58cce4
+EBUILD libheif-1.6.1.ebuild 1667 BLAKE2B 52218a6c045b1bc4acf3ddd233792bdc588050964985f910903b47a2512763d51ac4212acd714c51fccdac181de164458d3d8df7efa94016f3a0f615b3d03e59 SHA512 d2575a6954b26fa4c2221b0b088dcaf01fb5f387e3e32bfee41e36e24cda217e2fbc5ece7ff874b3fcad0ec96a6ee4de478719de27c4af31f9c55219d11c49c9
+EBUILD libheif-1.6.2.ebuild 1672 BLAKE2B 87c53b2ee0a659e36dc9486d84527d1a9c0fe7f0d7e87d9b8c3d4c57315b64be84dab0ce897f795a5b4bdeea27e77b3aa670350370bc15ed466db4d88220f328 SHA512 49fc214c657dbefc3a2b7b5b3a050a32494ce13dc1250bc6877df44476315625d4c10f048ba776262c63e0423f73f4b55a40bdeae096e851501627509b6325a9
+EBUILD libheif-1.7.0.ebuild 1596 BLAKE2B e7b38336980120a2265eb8c70e048986fbe733df54fee6c24195fabd8e27b0cd1837b0cb1f82eb1ac9d493808de1df53ac98b4afaef2ee7ce0c0946d7b174385 SHA512 c0779167e8fa329495352a8f7e081215e34ec51a5737e90bf60d19f664fca56935fa4dbefd591a3ec0c521ccad84a6ac8dc7ec93d7e960fea4ba17b949438fb5
+EBUILD libheif-9999.ebuild 1554 BLAKE2B e81b41fa4bfdf581c40313f5532e421d1a585c35705039f818ef5361c9b4c01499ac5b27b2e14af884d784b0a66566fb7df94cb7e995d43bd8e9113572b6f0d2 SHA512 4084ec9934894657b38efbb616ca085044f9975f39812c94f91b2965ea227d00098c62b257f35bbe12a3f64f41d45d2fe6dd588c1bedab7e1fccd326a36947c4
+MISC metadata.xml 485 BLAKE2B 5e631eaa6f914c0a0d89bfa65a6287b466755d3cdf29461c92ed6ca4b37e673458edf2ffefb84f31b8b86340d153155b6366cc692e7c5d7fadb9461fe43baa84 SHA512 5b88224363374aeafd2b3c5a5d0666d5b22a23a260a65323bce1102b7af6ebe21e7d07c1f0409289abd7c64d2cacb3dc1a4393ee11cbfb0db94acee8481e8fbe
diff --git a/media-libs/libheif/files/heif_test.go b/media-libs/libheif/files/heif_test.go
new file mode 100644
index 000000000000..187d773dea60
--- /dev/null
+++ b/media-libs/libheif/files/heif_test.go
@@ -0,0 +1,155 @@
+/*
+ * GO interface to libheif
+ * Copyright (c) 2018 struktur AG, Joachim Bauch <bauch@struktur.de>
+ *
+ * This file is part of heif, an example application using libheif.
+ *
+ * heif is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * heif is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with heif. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package heif
+
+import (
+ "fmt"
+ "image"
+ "io/ioutil"
+ "os"
+ "path"
+ "testing"
+)
+
+func TestGetVersion(t *testing.T) {
+ version := GetVersion()
+ if version == "" {
+ t.Fatal("Version is missing")
+ }
+}
+
+func CheckHeifImage(t *testing.T, handle *ImageHandle, thumbnail bool) {
+ handle.GetWidth()
+ handle.GetHeight()
+ handle.HasAlphaChannel()
+ handle.HasDepthImage()
+ count := handle.GetNumberOfDepthImages()
+ if ids := handle.GetListOfDepthImageIDs(); len(ids) != count {
+ t.Errorf("Expected %d depth image ids, got %d", count, len(ids))
+ }
+ if !thumbnail {
+ count = handle.GetNumberOfThumbnails()
+ ids := handle.GetListOfThumbnailIDs()
+ if len(ids) != count {
+ t.Errorf("Expected %d thumbnail image ids, got %d", count, len(ids))
+ }
+ for _, id := range ids {
+ if thumb, err := handle.GetThumbnail(id); err != nil {
+ t.Errorf("Could not get thumbnail %d: %s", id, err)
+ } else {
+ CheckHeifImage(t, thumb, true)
+ }
+ }
+ }
+
+ if img, err := handle.DecodeImage(ColorspaceUndefined, ChromaUndefined, nil); err != nil {
+ t.Errorf("Could not decode image: %s", err)
+ } else {
+ img.GetColorspace()
+ img.GetChromaFormat()
+ }
+}
+
+func CheckHeifFile(t *testing.T, ctx *Context) {
+ if count := ctx.GetNumberOfTopLevelImages(); count != 2 {
+ t.Errorf("Expected %d top level images, got %d", 2, count)
+ }
+ if ids := ctx.GetListOfTopLevelImageIDs(); len(ids) != 2 {
+ t.Errorf("Expected %d top level image ids, got %+v", 2, ids)
+ }
+ if _, err := ctx.GetPrimaryImageID(); err != nil {
+ t.Errorf("Expected a primary image, got %s", err)
+ }
+ if handle, err := ctx.GetPrimaryImageHandle(); err != nil {
+ t.Errorf("Could not get primary image handle: %s", err)
+ } else {
+ if !handle.IsPrimaryImage() {
+ t.Error("Expected primary image")
+ }
+ CheckHeifImage(t, handle, false)
+ }
+}
+
+func TestReadFromFile(t *testing.T) {
+ ctx, err := NewContext()
+ if err != nil {
+ t.Fatalf("Can't create context: %s", err)
+ }
+
+ filename := path.Join("..", "..", "examples", "example.heic")
+ if err := ctx.ReadFromFile(filename); err != nil {
+ t.Fatalf("Can't read from %s: %s", filename, err)
+ }
+
+ CheckHeifFile(t, ctx)
+}
+
+func TestReadFromMemory(t *testing.T) {
+ ctx, err := NewContext()
+ if err != nil {
+ t.Fatalf("Can't create context: %s", err)
+ }
+
+ filename := path.Join("..", "..", "examples", "example.heic")
+ data, err := ioutil.ReadFile(filename)
+ if err != nil {
+ t.Fatalf("Can't read file %s: %s", filename, err)
+ }
+ if err := ctx.ReadFromMemory(data); err != nil {
+ t.Fatalf("Can't read from memory: %s", err)
+ }
+ data = nil // Make sure future processing works if "data" is GC'd
+
+ CheckHeifFile(t, ctx)
+}
+
+func TestReadImage(t *testing.T) {
+ filename := path.Join("..", "..", "examples", "example.heic")
+ fp, err := os.Open(filename)
+ if err != nil {
+ t.Fatalf("Could not open %s: %s", filename, err)
+ }
+ defer fp.Close()
+
+ config, format1, err := image.DecodeConfig(fp)
+ if err != nil {
+ t.Fatalf("Could not load image config from %s: %s", filename, err)
+ }
+ if format1 != "heif" {
+ t.Errorf("Expected format heif, got %s", format1)
+ }
+ if _, err := fp.Seek(0, 0); err != nil {
+ t.Fatalf("Could not seek to start of %s: %s", filename, err)
+ }
+
+ img, format2, err := image.Decode(fp)
+ if err != nil {
+ t.Fatalf("Could not load image from %s: %s", filename, err)
+ }
+ if format2 != "heif" {
+ t.Errorf("Expected format heif, got %s", format2)
+ }
+
+ r := img.Bounds()
+ if config.Width != (r.Max.X-r.Min.X) || config.Height != (r.Max.Y-r.Min.Y) {
+ fmt.Printf("Image size %+v does not match config %+v\n", r, config)
+ }
+}
diff --git a/media-libs/libheif/files/libheif-1.7.0-aom.patch b/media-libs/libheif/files/libheif-1.7.0-aom.patch
new file mode 100644
index 000000000000..9dce291f9647
--- /dev/null
+++ b/media-libs/libheif/files/libheif-1.7.0-aom.patch
@@ -0,0 +1,46 @@
+From 331dff0ba58d5265ddcdadeaf5a45c1f0698a388 Mon Sep 17 00:00:00 2001
+From: Jakov Smolic <jakov.smolic@sartura.hr>
+Date: Fri, 14 Aug 2020 22:03:25 +0200
+Subject: [PATCH] Fix building against aom 1.0
+
+Taken from upstream commit:
+https://github.com/strukturag/libheif/commit/6768552c0a99bb2957906be0f369850326486a58
+
+Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>
+---
+ libheif/heif_encoder_aom.cc | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/libheif/heif_encoder_aom.cc b/libheif/heif_encoder_aom.cc
+index 9953e34..669a51a 100644
+--- a/libheif/heif_encoder_aom.cc
++++ b/libheif/heif_encoder_aom.cc
+@@ -502,9 +502,11 @@ struct heif_error aom_encode_image(void* encoder_raw, const struct heif_image* i
+
+
+ // --- configure codec
+-
+- unsigned int aomUsage = (encoder->realtime_mode ? AOM_USAGE_REALTIME : AOM_USAGE_GOOD_QUALITY);
+-
++ unsigned int aomUsage = 0;
++#if defined(AOM_USAGE_REALTIME)
++ // aom 2.0
++ aomUsage = (encoder->realtime_mode ? AOM_USAGE_REALTIME : AOM_USAGE_GOOD_QUALITY);
++#endif
+
+ aom_codec_enc_cfg_t cfg;
+ aom_codec_err_t res = aom_codec_enc_config_default(encoder->iface, &cfg, aomUsage);
+@@ -540,7 +542,10 @@ struct heif_error aom_encode_image(void* encoder_raw, const struct heif_image* i
+ aom_codec_control(&encoder->codec, AOME_SET_CPUUSED, encoder->cpu_used);
+
+ if (encoder->threads > 1) {
++#if defined(AV1E_SET_ROW_MT)
++ // aom 2.0
+ aom_codec_control(&encoder->codec, AV1E_SET_ROW_MT, 1);
++#endif
+ }
+
+ // --- encode frame
+--
+2.26.2
+
diff --git a/media-libs/libheif/libheif-1.5.1.ebuild b/media-libs/libheif/libheif-1.5.1.ebuild
index e737b4ce1e4f..ea2fa1ddafbe 100644
--- a/media-libs/libheif/libheif-1.5.1.ebuild
+++ b/media-libs/libheif/libheif-1.5.1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="7"
+EAPI=7
inherit autotools xdg-utils multilib-minimal
@@ -34,6 +34,10 @@ RDEPEND="${DEPEND}"
src_prepare() {
default
+ # heif_test.go is not included in the tarball
+ # https://github.com/strukturag/libheif/issues/289
+ cp "${FILESDIR}/heif_test.go" "${S}/go/heif" || die
+
sed -i -e 's:-Werror::' \
configure.ac || die
@@ -51,6 +55,11 @@ multilib_src_configure() {
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
+multilib_src_test() {
+ default
+ emake -C go test
+}
+
multilib_src_install_all() {
find "${ED}" -name '*.la' -delete || die
if ! use static-libs ; then
diff --git a/media-libs/libheif/libheif-1.6.1.ebuild b/media-libs/libheif/libheif-1.6.1.ebuild
index bf0048c2ecfc..68966c34be87 100644
--- a/media-libs/libheif/libheif-1.6.1.ebuild
+++ b/media-libs/libheif/libheif-1.6.1.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="7"
+EAPI=7
inherit autotools xdg-utils multilib-minimal
@@ -35,6 +35,10 @@ RDEPEND="${DEPEND}"
src_prepare() {
default
+ # heif_test.go is not included in the tarball
+ # https://github.com/strukturag/libheif/issues/289
+ cp "${FILESDIR}/heif_test.go" "${S}/go/heif" || die
+
sed -i -e 's:-Werror::' configure.ac || die
eautoreconf
@@ -51,6 +55,11 @@ multilib_src_configure() {
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
+multilib_src_test() {
+ default
+ emake -C go test
+}
+
multilib_src_install_all() {
find "${ED}" -name '*.la' -delete || die
if ! use static-libs ; then
diff --git a/media-libs/libheif/libheif-1.6.2.ebuild b/media-libs/libheif/libheif-1.6.2.ebuild
new file mode 100644
index 000000000000..3644fcb74e44
--- /dev/null
+++ b/media-libs/libheif/libheif-1.6.2.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools xdg-utils multilib-minimal
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/strukturag/${PN}.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/strukturag/${PN}/releases/download/v${PV}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~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.6"
+IUSE="static-libs test +threads"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="test? ( dev-lang/go )"
+DEPEND="
+ media-libs/libde265:=[${MULTILIB_USEDEP}]
+ media-libs/libpng:0=[${MULTILIB_USEDEP}]
+ media-libs/x265:=[${MULTILIB_USEDEP}]
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ virtual/jpeg:0=[${MULTILIB_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ default
+
+ # heif_test.go is not included in the tarball
+ # https://github.com/strukturag/libheif/issues/289
+ cp "${FILESDIR}/heif_test.go" "${S}/go/heif" || die
+
+ 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() {
+ local myeconfargs=(
+ $(use_enable threads multithreading)
+ $(use_enable static-libs static)
+ )
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_test() {
+ default
+ emake -C go test
+}
+
+multilib_src_install_all() {
+ find "${ED}" -name '*.la' -delete || die
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}
+
+pkg_postinst() {
+ xdg_mimeinfo_database_update
+}
+
+pkg_postrm() {
+ xdg_mimeinfo_database_update
+}
diff --git a/media-libs/libheif/libheif-1.7.0.ebuild b/media-libs/libheif/libheif-1.7.0.ebuild
new file mode 100644
index 000000000000..3bba1148615d
--- /dev/null
+++ b/media-libs/libheif/libheif-1.7.0.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools xdg-utils multilib-minimal
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/strukturag/${PN}.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/strukturag/${PN}/releases/download/v${PV}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~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.6"
+IUSE="gdk-pixbuf go static-libs test +threads"
+RESTRICT="!test? ( test )"
+
+BDEPEND="test? ( dev-lang/go )"
+DEPEND="
+ media-libs/libde265:=[${MULTILIB_USEDEP}]
+ media-libs/libpng:0=[${MULTILIB_USEDEP}]
+ media-libs/x265:=[${MULTILIB_USEDEP}]
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ virtual/jpeg:0=[${MULTILIB_USEDEP}]
+ gdk-pixbuf? ( x11-libs/gdk-pixbuf )
+ go? ( dev-lang/go )
+"
+RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}"/${P}-aom.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() {
+ local econf_args=(
+ $(multilib_is_native_abi && use_enable go || echo --disable-go)
+ $(use_enable gdk-pixbuf)
+ $(use_enable static-libs static)
+ $(use_enable threads multithreading)
+ )
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_install_all() {
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ xdg_mimeinfo_database_update
+}
+
+pkg_postrm() {
+ xdg_mimeinfo_database_update
+}
diff --git a/media-libs/libheif/libheif-9999.ebuild b/media-libs/libheif/libheif-9999.ebuild
index 6cc971a64be1..3e1aacd0ed3d 100644
--- a/media-libs/libheif/libheif-9999.ebuild
+++ b/media-libs/libheif/libheif-9999.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="7"
+EAPI=7
inherit autotools xdg-utils multilib-minimal
@@ -10,7 +10,7 @@ if [[ ${PV} == "9999" ]] ; then
inherit git-r3
else
SRC_URI="https://github.com/strukturag/${PN}/releases/download/v${PV}/${P}.tar.gz"
- KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
fi
DESCRIPTION="ISO/IEC 23008-12:2017 HEIF file format decoder and encoder"
@@ -18,8 +18,7 @@ HOMEPAGE="https://github.com/strukturag/libheif"
LICENSE="GPL-3"
SLOT="0/1.6"
-IUSE="static-libs test +threads"
-
+IUSE="gdk-pixbuf go static-libs test +threads"
RESTRICT="!test? ( test )"
BDEPEND="test? ( dev-lang/go )"
@@ -29,6 +28,8 @@ DEPEND="
media-libs/x265:=[${MULTILIB_USEDEP}]
sys-libs/zlib:=[${MULTILIB_USEDEP}]
virtual/jpeg:0=[${MULTILIB_USEDEP}]
+ gdk-pixbuf? ( x11-libs/gdk-pixbuf )
+ go? ( dev-lang/go )
"
RDEPEND="${DEPEND}"
@@ -44,18 +45,17 @@ src_prepare() {
}
multilib_src_configure() {
- local myeconfargs=(
- $(use_enable threads multithreading)
+ local econf_args=(
+ $(multilib_is_native_abi && use_enable go || echo --disable-go)
+ $(use_enable gdk-pixbuf)
$(use_enable static-libs static)
+ $(use_enable threads multithreading)
)
- ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
}
multilib_src_install_all() {
find "${ED}" -name '*.la' -delete || die
- if ! use static-libs ; then
- find "${ED}" -name "*.a" -delete || die
- fi
}
pkg_postinst() {
diff --git a/media-libs/libheif/metadata.xml b/media-libs/libheif/metadata.xml
index ee4cf414e0db..f92d3bad5e85 100644
--- a/media-libs/libheif/metadata.xml
+++ b/media-libs/libheif/metadata.xml
@@ -2,6 +2,10 @@
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
+ <use>
+ <flag name='gdk-pixbuf'>Enable <pkg>x11-libs/gdk-pixbuf</pkg> plugin</flag>
+ <flag name='go'>Enable building <pkg>dev-lang/go</pkg> code/examples</flag>
+ </use>
<upstream>
<bugs-to>https://github.com/strukturag/libheif/issues</bugs-to>
<remote-id type="github">strukturag/libheif</remote-id>