diff mbox series

[2/7] package/libheif: new package

Message ID 20230708200447.3919009-2-bernd@kuhls.net
State Accepted
Headers show
Series [1/7] package/libde265: new package | expand

Commit Message

Bernd Kuhls July 8, 2023, 8:04 p.m. UTC
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/libheif/Config.in    | 14 +++++++++
 package/libheif/libheif.hash |  3 ++
 package/libheif/libheif.mk   | 59 ++++++++++++++++++++++++++++++++++++
 5 files changed, 78 insertions(+)
 create mode 100644 package/libheif/Config.in
 create mode 100644 package/libheif/libheif.hash
 create mode 100644 package/libheif/libheif.mk

Comments

Thomas Petazzoni July 30, 2023, 10:26 a.m. UTC | #1
Hello Bernd,

I've applied, but I have some comments below. Giuliu, there is also a
question for you.

On Sat,  8 Jul 2023 22:04:42 +0200
Bernd Kuhls <bernd@kuhls.net> wrote:

> diff --git a/package/libheif/Config.in b/package/libheif/Config.in
> new file mode 100644
> index 0000000000..9ce507fd24
> --- /dev/null
> +++ b/package/libheif/Config.in
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_LIBHEIF
> +	bool "libheif"
> +	# avoid build error
> +	# Internal error in emit_expr_encoded at dw2gencfi.c:215
> +	depends on !BR2_m68k_cf

Giulio, do we have a BR2_TOOLCHAIN_HAS_..._BUG for this? Are other
packages affected by this? I see quite a few BR2_m68k_cf conditionals
sprinkled all over the places in Buildroot.

> +	depends on BR2_INSTALL_LIBSTDCPP

I've added a dependency on gcc >= 4.8, because this package uses C++11.
I have verified it builds fine with GCC 4.8.

Applied with this tweak.

Thanks!

Thomas
Giulio Benetti July 30, 2023, 10:56 a.m. UTC | #2
Hi Thomas, All,

On 30/07/23 12:26, Thomas Petazzoni via buildroot wrote:
> Hello Bernd,
> 
> I've applied, but I have some comments below. Giuliu, there is also a
> question for you.
> 
> On Sat,  8 Jul 2023 22:04:42 +0200
> Bernd Kuhls <bernd@kuhls.net> wrote:
> 
>> diff --git a/package/libheif/Config.in b/package/libheif/Config.in
>> new file mode 100644
>> index 0000000000..9ce507fd24
>> --- /dev/null
>> +++ b/package/libheif/Config.in
>> @@ -0,0 +1,14 @@
>> +config BR2_PACKAGE_LIBHEIF
>> +	bool "libheif"
>> +	# avoid build error
>> +	# Internal error in emit_expr_encoded at dw2gencfi.c:215
>> +	depends on !BR2_m68k_cf
> 
> Giulio, do we have a BR2_TOOLCHAIN_HAS_..._BUG for this? Are other
> packages affected by this? I see quite a few BR2_m68k_cf conditionals
> sprinkled all over the places in Buildroot.

there is a possible toolchain gcc bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79509

but they point this to be a binutils bug, so I'm going to open a bug
in Sourceware. I can't find it already, so yes, it must be open.
We then need to add a BR2_TOOLCHAIN_HAS_BINUTILS_BUG_ and then I can
check against it with the workaround(-fno-dwarf2-cfi-asm) and see if
someone will fix it in binutils and backport patches.
BUT I see only now that for BR2_m68k_cf C/CXXFLAGS have by default
-fno-dwarf2-cfi-asm enabled and if that doesn't make the trick I need
to find another work-around, or maybe it's completely another bug at
this point. Soon I'll be on holidays and I will have more time so
I will look into it.

Best regards
Thomas Petazzoni July 30, 2023, 11:25 a.m. UTC | #3
On Sun, 30 Jul 2023 12:56:42 +0200
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> there is a possible toolchain gcc bug:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79509
> 
> but they point this to be a binutils bug, so I'm going to open a bug
> in Sourceware. I can't find it already, so yes, it must be open.
> We then need to add a BR2_TOOLCHAIN_HAS_BINUTILS_BUG_ and then I can
> check against it with the workaround(-fno-dwarf2-cfi-asm) and see if
> someone will fix it in binutils and backport patches.
> BUT I see only now that for BR2_m68k_cf C/CXXFLAGS have by default
> -fno-dwarf2-cfi-asm enabled and if that doesn't make the trick I need
> to find another work-around, or maybe it's completely another bug at
> this point. Soon I'll be on holidays and I will have more time so
> I will look into it.

Thanks for the feedback. I don't think we really need to find a
workaround, as I don't think we care much about m68k_cf support. It's
just that I prefer to have a clear relationship between an exclusion in
Buildroot (don't build this package) and a gcc or binutils bug, rather
than random architecture exclusions.

Thanks!

Thomas
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 53a58923e3..f4a8011223 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -380,6 +380,7 @@  F:	package/libglew/
 F:	package/libglfw/
 F:	package/libglu/
 F:	package/libhdhomerun/
+F:	package/libheif/
 F:	package/libilbc/
 F:	package/libks/
 F:	package/libldns/
diff --git a/package/Config.in b/package/Config.in
index 58d02a5918..2b9ae471ea 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1840,6 +1840,7 @@  menu "Multimedia"
 	source "package/libdvdread/Config.in"
 	source "package/libebml/Config.in"
 	source "package/libhdhomerun/Config.in"
+	source "package/libheif/Config.in"
 	source "package/libimxvpuapi/Config.in"
 	source "package/libmatroska/Config.in"
 	source "package/libmms/Config.in"
diff --git a/package/libheif/Config.in b/package/libheif/Config.in
new file mode 100644
index 0000000000..9ce507fd24
--- /dev/null
+++ b/package/libheif/Config.in
@@ -0,0 +1,14 @@ 
+config BR2_PACKAGE_LIBHEIF
+	bool "libheif"
+	# avoid build error
+	# Internal error in emit_expr_encoded at dw2gencfi.c:215
+	depends on !BR2_m68k_cf
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  libheif is an HEIF and AVIF file format decoder and encoder.
+
+	  https://github.com/strukturag/libheif
+
+comment "libheif needs a toolchain w/ C++"
+	depends on !BR2_m68k_cf
+	depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/package/libheif/libheif.hash b/package/libheif/libheif.hash
new file mode 100644
index 0000000000..50152abde5
--- /dev/null
+++ b/package/libheif/libheif.hash
@@ -0,0 +1,3 @@ 
+# Locally computed:
+sha256  7f97e4205c0bd9f9b8560536c8bd2e841d1c9a6d610401eb3eb87ed9cdfe78ea  libheif-1.16.2.tar.gz
+sha256  b2eb4f6588b005bebac44cfb2dfd23f6a16c5ca9b8a619a315158b0215a917a3  COPYING
diff --git a/package/libheif/libheif.mk b/package/libheif/libheif.mk
new file mode 100644
index 0000000000..9c6c2829cf
--- /dev/null
+++ b/package/libheif/libheif.mk
@@ -0,0 +1,59 @@ 
+################################################################################
+#
+# libheif
+#
+################################################################################
+
+LIBHEIF_VERSION = 1.16.2
+LIBHEIF_SITE = https://github.com/strukturag/libheif/releases/download/v$(LIBHEIF_VERSION)
+LIBHEIF_LICENSE = LGPL-3.0+
+LIBHEIF_LICENSE_FILES = COPYING
+LIBHEIF_INSTALL_STAGING = YES
+LIBHEIF_CONF_OPTS = \
+	-DCMAKE_CXX_FLAGS="-std=c++11" \
+	-DENABLE_PLUGIN_LOADING=OFF \
+	-DWITH_AOM_DECODER=OFF \
+	-DWITH_AOM_ENCODER=OFF \
+	-DWITH_DEFLATE_HEADER_COMPRESSION=OFF \
+	-DWITH_EXAMPLES=OFF \
+	-DWITH_GDK_PIXBUF=OFF \
+	-DWITH_LIBSHARPYUV=OFF \
+	-DWITH_RAV1E=OFF \
+	-DWITH_REDUCED_VISIBILITY=ON \
+	-DWITH_SvtEnc=OFF
+
+ifeq ($(BR2_PACKAGE_DAV1D),y)
+LIBHEIF_CONF_OPTS += -DWITH_DAV1D=ON
+LIBHEIF_DEPENDENCIES += dav1d
+else
+LIBHEIF_CONF_OPTS += -DWITH_DAV1D=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LIBDE265),y)
+LIBHEIF_CONF_OPTS += -DWITH_LIBDE265=ON
+LIBHEIF_DEPENDENCIES += libde265
+else
+LIBHEIF_CONF_OPTS += -DWITH_LIBDE265=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_X265),y)
+LIBHEIF_CONF_OPTS += -DWITH_X265=ON
+LIBHEIF_DEPENDENCIES += x265
+else
+LIBHEIF_CONF_OPTS += -DWITH_X265=OFF
+endif
+
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+LIBHEIF_CONF_OPTS += -DENABLE_MULTITHREADING_SUPPORT=ON
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_64735),y)
+LIBHEIF_CONF_OPTS += -DENABLE_PARALLEL_TILE_DECODING=OFF
+else
+LIBHEIF_CONF_OPTS += -DENABLE_PARALLEL_TILE_DECODING=ON
+endif
+else
+LIBHEIF_CONF_OPTS += \
+	-DENABLE_MULTITHREADING_SUPPORT=OFF \
+	-DENABLE_PARALLEL_TILE_DECODING=OFF
+endif
+
+$(eval $(cmake-package))