git: d5effbf65083 - main - graphics/libavif: update to 1.1.0

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sat, 13 Jul 2024 00:47:55 UTC
The branch main has been updated by jbeich:

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

commit d5effbf65083c49bce25935ead2c964e2734560a
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2024-07-11 14:39:50 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-07-13 00:46:00 +0000

    graphics/libavif: update to 1.1.0
    
    - Enable LIBYUV after https://github.com/AOMediaCodec/libavif/commit/e82375f55af1
    - Drop _BOOL helpers after https://github.com/AOMediaCodec/libavif/commit/f7ce88269830
    
    Changes:        https://github.com/AOMediaCodec/libavif/releases/tag/v1.0.4
    Reported by:    GitHub (watch releases)
---
 graphics/libavif/Makefile                   | 30 +++++++++++++++++++----------
 graphics/libavif/distinfo                   |  8 +++++---
 graphics/libavif/files/patch-CMakeLists.txt | 17 ++++++++++++++++
 graphics/libavif/pkg-plist                  |  3 ++-
 4 files changed, 44 insertions(+), 14 deletions(-)

diff --git a/graphics/libavif/Makefile b/graphics/libavif/Makefile
index 571e02dee398..879d4eb3e70a 100644
--- a/graphics/libavif/Makefile
+++ b/graphics/libavif/Makefile
@@ -1,9 +1,11 @@
 PORTNAME=	libavif
 DISTVERSIONPREFIX=	v
-DISTVERSION=	1.0.4
-PORTREVISION=	1
+DISTVERSION=	1.1.0
 CATEGORIES=	graphics
 
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
+PATCHFILES+=	78b64375550e.patch:-p1 # https://github.com/AOMediaCodec/libavif/pull/2263
+
 MAINTAINER=	jbeich@FreeBSD.org
 COMMENT=	Library for encoding and decoding .avif files
 WWW=		https://github.com/AOMediaCodec/libavif
@@ -22,31 +24,37 @@ USE_LDCONFIG=	yes
 GH_ACCOUNT=	AOMediaCodec
 CMAKE_ON=	AVIF_BUILD_APPS
 CMAKE_TESTING_ON=	AVIF_BUILD_TESTS
+CMAKE_TESTING_ARGS=	-DAVIF_GTEST:STRING=SYSTEM
 
 OPTIONS_DEFINE=	AOM DAV1D GAV1 LIBSHARPYUV LIBYUV PIXBUF RAV1E SVTAV1
-OPTIONS_DEFAULT=AOM DAV1D PIXBUF
+OPTIONS_DEFAULT=AOM DAV1D LIBYUV PIXBUF
 OPTIONS_SUB=	yes
 
 AOM_DESC=		AV1 encoding/decoding via libaom
 AOM_LIB_DEPENDS=	libaom.so:multimedia/aom
-AOM_CMAKE_BOOL=		AVIF_CODEC_AOM
+AOM_CMAKE_ON=		-DAVIF_CODEC_AOM:STRING=SYSTEM
+AOM_CMAKE_OFF=		-DAVIF_CODEC_AOM:STRING=OFF
 
 DAV1D_DESC=		AV1 decoding via libdav1d
 DAV1D_LIB_DEPENDS=	libdav1d.so:multimedia/dav1d
-DAV1D_CMAKE_BOOL=	AVIF_CODEC_DAV1D
+DAV1D_CMAKE_ON=		-DAVIF_CODEC_DAV1D:STRING=SYSTEM
+DAV1D_CMAKE_OFF=	-DAVIF_CODEC_DAV1D:STRING=OFF
 
 GAV1_DESC=		AV1 decoding via libgav1
 GAV1_LIB_DEPENDS=	libgav1.so:multimedia/libgav1
-GAV1_CMAKE_BOOL=	AVIF_CODEC_LIBGAV1
+GAV1_CMAKE_ON=		-DAVIF_CODEC_LIBGAV1:STRING=SYSTEM
+GAV1_CMAKE_OFF=		-DAVIF_CODEC_LIBGAV1:STRING=OFF
 
 LIBSHARPYUV_DESC=		Colorspace conversion via libsharpyuv
 LIBSHARPYUV_LIB_DEPENDS=	libsharpyuv.so:graphics/webp
-LIBSHARPYUV_CMAKE_BOOL_OFF=	CMAKE_DISABLE_FIND_PACKAGE_libsharpyuv
+LIBSHARPYUV_CMAKE_ON=		-DAVIF_LIBSHARPYUV:STRING=SYSTEM
+LIBSHARPYUV_CMAKE_OFF=		-DAVIF_LIBSHARPYUV:STRING=OFF
 
 LIBYUV_DESC=		Colorspace conversion via libyuv
 LIBYUV_BUILD_DEPENDS=	libyuv>=0.0.1774:graphics/libyuv
 LIBYUV_LIB_DEPENDS=	libyuv.so:graphics/libyuv
-LIBYUV_CMAKE_BOOL_OFF=	CMAKE_DISABLE_FIND_PACKAGE_libyuv
+LIBYUV_CMAKE_ON=	-DAVIF_LIBYUV:STRING=SYSTEM
+LIBYUV_CMAKE_OFF=	-DAVIF_LIBYUV:STRING=OFF
 
 PIXBUF_USES=		gnome
 PIXBUF_USE=		GNOME=gdkpixbuf2
@@ -54,10 +62,12 @@ PIXBUF_CMAKE_BOOL=	AVIF_BUILD_GDK_PIXBUF
 
 RAV1E_DESC=		AV1 encoding via librav1e
 RAV1E_LIB_DEPENDS=	librav1e.so:multimedia/librav1e
-RAV1E_CMAKE_BOOL=	AVIF_CODEC_RAV1E
+RAV1E_CMAKE_ON=		-DAVIF_CODEC_RAV1E:STRING=SYSTEM
+RAV1E_CMAKE_OFF=	-DAVIF_CODEC_RAV1E:STRING=OFF
 
 SVTAV1_DESC=		AV1 encoding via SVT-AV1
 SVTAV1_LIB_DEPENDS=	libSvtAv1Enc.so:multimedia/svt-av1
-SVTAV1_CMAKE_BOOL=	AVIF_CODEC_SVT
+SVTAV1_CMAKE_ON=	-DAVIF_CODEC_SVT:STRING=SYSTEM
+SVTAV1_CMAKE_OFF=	-DAVIF_CODEC_SVT:STRING=OFF
 
 .include <bsd.port.mk>
diff --git a/graphics/libavif/distinfo b/graphics/libavif/distinfo
index 63456f458276..85eb09d13a8e 100644
--- a/graphics/libavif/distinfo
+++ b/graphics/libavif/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1707394709
-SHA256 (AOMediaCodec-libavif-v1.0.4_GH0.tar.gz) = dc56708c83a4b934a8af2b78f67f866ba2fb568605c7cf94312acf51ee57d146
-SIZE (AOMediaCodec-libavif-v1.0.4_GH0.tar.gz) = 10575992
+TIMESTAMP = 1720708790
+SHA256 (AOMediaCodec-libavif-v1.1.0_GH0.tar.gz) = edb31951005d7a143be1724f24825809599a4832073add50eaf987733defb5c8
+SIZE (AOMediaCodec-libavif-v1.1.0_GH0.tar.gz) = 13642536
+SHA256 (78b64375550e.patch) = 15fbdcaab58a697e5c2b2ad3006bfb17da5f09525a900650fe8ba1a7439c459b
+SIZE (78b64375550e.patch) = 8930
diff --git a/graphics/libavif/files/patch-CMakeLists.txt b/graphics/libavif/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..9499cf8b0e9c
--- /dev/null
+++ b/graphics/libavif/files/patch-CMakeLists.txt
@@ -0,0 +1,17 @@
+https://github.com/AOMediaCodec/libavif/issues/2264
+
+--- CMakeLists.txt.orig	2024-07-11 14:39:50 UTC
++++ CMakeLists.txt
+@@ -168,10 +168,8 @@ function(avif_target_link_library target)
+     if(NOT install_target)
+         set(install_target ${target})
+     endif()
+-    # The transitive dependency is an export link library if it is a shared
+-    # library, or if it is a static library in a static build
+-    get_target_property(target_type ${target} TYPE)
+-    if(target_type STREQUAL "SHARED_LIBRARY" OR NOT BUILD_SHARED_LIBS)
++    # The transitive dependency is needed in a static build.
++    if(NOT BUILD_SHARED_LIBS)
+         target_link_libraries(avif PUBLIC $<INSTALL_INTERFACE:${install_target}>)
+     endif()
+ endfunction()
diff --git a/graphics/libavif/pkg-plist b/graphics/libavif/pkg-plist
index 1148a2930dda..300c3d45e705 100644
--- a/graphics/libavif/pkg-plist
+++ b/graphics/libavif/pkg-plist
@@ -1,12 +1,13 @@
 bin/avifdec
 bin/avifenc
 include/avif/avif.h
+include/avif/avif_cxx.h
 lib/cmake/libavif/libavif-config-%%CMAKE_BUILD_TYPE%%.cmake
 lib/cmake/libavif/libavif-config-version.cmake
 lib/cmake/libavif/libavif-config.cmake
 %%PIXBUF%%lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders/libpixbufloader-avif.so
 lib/libavif.so
 lib/libavif.so.16
-lib/libavif.so.16.0.4
+lib/libavif.so.16.1.0
 libdata/pkgconfig/libavif.pc
 %%PIXBUF%%share/thumbnailers/avif.thumbnailer