git: 5b0594f2a477 - main - graphics/libheif: Update to 1.17.1

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Sat, 21 Oct 2023 07:29:53 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5b0594f2a47728e296665858d46809ca79d9b060

commit 5b0594f2a47728e296665858d46809ca79d9b060
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-10-21 07:17:41 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-10-21 07:17:45 +0000

    graphics/libheif: Update to 1.17.1
    
    - Replace libde265 with FFmpeg as HEVC decoder
    - Enable JPEG and OpenJPEG 2000 support
    - Disable Doxygen detection
    
    While FFmpeg's default configuration can be a bit on the heavy side
    it's also relatively easy to tailor it to fit your needs and if libheif
    is needed you're likely to have other related ports depending on FFmpeg
    installed. Support is relatively new so there may be bugs lurking.
    Looking back libde265 has also been hit by several CVEs which is another
    reason for the switch.
    
    References:
    https://www.opencve.io/cve?vendor=struktur&product=libde265
    
    PR:             274546
    Reviewed by:    makc (maintainer)
---
 graphics/libheif/Makefile  | 28 +++++++++++++++++++++-------
 graphics/libheif/distinfo  |  6 +++---
 graphics/libheif/pkg-plist |  7 ++++++-
 3 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/graphics/libheif/Makefile b/graphics/libheif/Makefile
index b510c808b295..c670ee180e98 100644
--- a/graphics/libheif/Makefile
+++ b/graphics/libheif/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	libheif
-DISTVERSION=	1.16.1
-PORTREVISION=	2
+DISTVERSION=	1.17.1
 CATEGORIES=	graphics
 MASTER_SITES=	https://github.com/strukturag/${PORTNAME}/releases/download/v${DISTVERSION}/
 
@@ -13,18 +12,24 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 LIB_DEPENDS=	libsharpyuv.so:graphics/webp
 
-USES=		cmake compiler:c++11-lang cpe gettext-runtime gnome \
-		localbase:ldflags pkgconfig
+USES=		cmake:testing compiler:c++11-lang cpe gettext-runtime gnome \
+		localbase:ldflags pathfix pkgconfig
 CPE_VENDOR=	struktur
 USE_GNOME=	gdkpixbuf2 glib20
 USE_LDCONFIG=	yes
 PLIST_SUB=	LIB_VER=${DISTVERSION}
 
-OPTIONS_DEFINE=		AOM DAV1D EXAMPLES LIBDE265 SVTAV1 RAV1E X265
-OPTIONS_DEFAULT=	AOM DAV1D LIBDE265 SVTAV1 X265
+CMAKE_OFF=	BUILD_TESTING \
+		WITH_KVAZAAR
+CMAKE_ON=	CMAKE_DISABLE_FIND_PACKAGE_Doxygen
+
+OPTIONS_DEFINE=	AOM DAV1D EXAMPLES FFMPEG JPEG LIBDE265 \
+		OPENJPEG SVTAV1 RAV1E X265
+OPTIONS_DEFAULT=AOM DAV1D FFMPEG JPEG OPENJPEG SVTAV1 X265
 OPTIONS_SUB=	yes
 
 AOM_DESC=		AV1 encoding/decoding via libaom
+FFMPEG_DESC=		Use FFmpeg (support for HEVC decoding)
 DAV1D_DESC=		Build dav1e decoder
 LIBDE265_DESC=		Use libde265 (support for HEVC decoding)
 SVTAV1_DESC=		Build svt-av1 encoder
@@ -38,12 +43,21 @@ DAV1D_LIB_DEPENDS=	libdav1d.so:multimedia/dav1d
 DAV1D_CMAKE_BOOL=	WITH_DAV1D
 
 EXAMPLES_LIB_DEPENDS=	libpng16.so:graphics/png
-EXAMPLES_USES=		jpeg
 EXAMPLES_CMAKE_BOOL=	WITH_EXAMPLES
+EXAMPLE_IMPLIES=	JPEG
+
+FFMPEG_LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg
+FFMPEG_CMAKE_BOOL=	WITH_FFMPEG_DECODER
+
+JPEG_USES=		jpeg
+JPEG_CMAKE_BOOL=	WITH_JPEG_ENCODER WITH_JPEG_DECODER
 
 LIBDE265_LIB_DEPENDS=	libde265.so:multimedia/libde265
 LIBDE265_CMAKE_BOOL=	WITH_LIBDE265
 
+OPENJPEG_LIB_DEPENDS=	libopenjp2.so:graphics/openjpeg
+OPENJPEG_CMAKE_BOOL=	WITH_OpenJPEG_ENCODER WITH_OpenJPEG_DECODER
+
 SVTAV1_LIB_DEPENDS=	libSvtAv1Enc.so:multimedia/svt-av1
 SVTAV1_CMAKE_BOOL=	WITH_SvtEnc
 
diff --git a/graphics/libheif/distinfo b/graphics/libheif/distinfo
index ff18bb29ad12..3321fda231fa 100644
--- a/graphics/libheif/distinfo
+++ b/graphics/libheif/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1683244302
-SHA256 (libheif-1.16.1.tar.gz) = ac15b54b6d7c315710e156d119b8a1bfc89f29621e99222b2750b1f31c9c3558
-SIZE (libheif-1.16.1.tar.gz) = 1338412
+TIMESTAMP = 1697734701
+SHA256 (libheif-1.17.1.tar.gz) = 97d74c58a346887c1bbf98dcf0322c13b728286153d0f1be2b350f7107e49dba
+SIZE (libheif-1.17.1.tar.gz) = 1430684
diff --git a/graphics/libheif/pkg-plist b/graphics/libheif/pkg-plist
index f394bdd0377f..739b8ae32384 100644
--- a/graphics/libheif/pkg-plist
+++ b/graphics/libheif/pkg-plist
@@ -5,6 +5,8 @@
 include/libheif/heif.h
 include/libheif/heif_cxx.h
 include/libheif/heif_plugin.h
+include/libheif/heif_properties.h
+include/libheif/heif_regions.h
 include/libheif/heif_version.h
 lib/cmake/libheif/libheif-config-%%CMAKE_BUILD_TYPE%%.cmake
 lib/cmake/libheif/libheif-config-version.cmake
@@ -13,8 +15,11 @@ lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders/libpixbufloader-heif.so
 lib/libheif.so
 lib/libheif.so.1
 lib/libheif.so.%%LIB_VER%%
-%%SVTAV1%%lib/libheif/libheif-svtenc.so
+%%DAV1D%%lib/libheif/libheif-dav1d.so
+%%OPENJPEG%%lib/libheif/libheif-j2kdec.so
+%%OPENJPEG%%lib/libheif/libheif-j2kenc.so
 %%RAV1E%%lib/libheif/libheif-rav1e.so
+%%SVTAV1%%lib/libheif/libheif-svtenc.so
 libdata/pkgconfig/libheif.pc
 %%PORTEXAMPLES%%share/man/man1/heif-convert.1.gz
 %%PORTEXAMPLES%%share/man/man1/heif-enc.1.gz