git: b280ef6a26bf - main - graphics/libheif: restore API compatibility.

From: Xin LI <delphij_at_FreeBSD.org>
Date: Tue, 12 Nov 2024 04:15:31 UTC
The branch main has been updated by delphij:

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

commit b280ef6a26bf2cc0c5047f2fff8ca4274148dec3
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2024-11-10 04:46:56 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2024-11-12 04:13:42 +0000

    graphics/libheif: restore API compatibility.
    
    PR:             ports/282675
    Approved by:    maintainer (makc@)
---
 graphics/libheif/Makefile                               |  1 +
 graphics/libheif/files/patch-libheif_api_libheif_heif.h | 11 +++++++++++
 graphics/libheif/files/patch-libheif_context.cc         | 11 +++++++++++
 3 files changed, 23 insertions(+)

diff --git a/graphics/libheif/Makefile b/graphics/libheif/Makefile
index 7bd812b0b51d..d1044a15d943 100644
--- a/graphics/libheif/Makefile
+++ b/graphics/libheif/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	libheif
 DISTVERSION=	1.19.1
+PORTREVISION=	1
 CATEGORIES=	graphics
 MASTER_SITES=	https://github.com/strukturag/${PORTNAME}/releases/download/v${DISTVERSION}/
 
diff --git a/graphics/libheif/files/patch-libheif_api_libheif_heif.h b/graphics/libheif/files/patch-libheif_api_libheif_heif.h
new file mode 100644
index 000000000000..64164273fb82
--- /dev/null
+++ b/graphics/libheif/files/patch-libheif_api_libheif_heif.h
@@ -0,0 +1,11 @@
+--- libheif/api/libheif/heif.h.orig	2024-11-01 10:56:56 UTC
++++ libheif/api/libheif/heif.h
+@@ -2363,7 +2363,7 @@ struct heif_encoding_options
+ 
+   // Set this to the NCLX parameters to be used in the output image or set to NULL
+   // when the same parameters as in the input image should be used.
+-  const struct heif_color_profile_nclx* output_nclx_profile;
++  struct heif_color_profile_nclx* output_nclx_profile;
+ 
+   uint8_t macOS_compatibility_workaround_no_nclx_profile;
+ 
diff --git a/graphics/libheif/files/patch-libheif_context.cc b/graphics/libheif/files/patch-libheif_context.cc
new file mode 100644
index 000000000000..a82b5b02d4f8
--- /dev/null
+++ b/graphics/libheif/files/patch-libheif_context.cc
@@ -0,0 +1,11 @@
+--- libheif/context.cc.orig	2024-11-01 10:56:56 UTC
++++ libheif/context.cc
+@@ -1154,7 +1154,7 @@ Result<std::shared_ptr<ImageItem>> HeifContext::encode
+   heif_encoding_options options = in_options;
+ 
+   if (const auto* nclx = output_image_item->get_forced_output_nclx()) {
+-    options.output_nclx_profile = nclx;
++    options.output_nclx_profile = const_cast<heif_color_profile_nclx*>(nclx);
+   }
+ 
+   Result<std::shared_ptr<HeifPixelImage>> srcImageResult = output_image_item->convert_colorspace_for_encoding(pixel_image,