git: fd79d20f7c26 - main - graphics/krita: chase libheif update

From: Max Brazhnikov <makc_at_FreeBSD.org>
Date: Fri, 06 Jan 2023 14:41:45 UTC
The branch main has been updated by makc:

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

commit fd79d20f7c26c82c03d9ab3dc41d94791119bd2b
Author:     Max Brazhnikov <makc@FreeBSD.org>
AuthorDate: 2023-01-06 14:39:31 +0000
Commit:     Max Brazhnikov <makc@FreeBSD.org>
CommitDate: 2023-01-06 14:39:31 +0000

    graphics/krita: chase libheif update
    
    - Add patch from upstream to fix build with libheif-1.14.1
---
 graphics/krita/Makefile                 |  2 +-
 graphics/krita/files/patch-git_e9184281 | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/graphics/krita/Makefile b/graphics/krita/Makefile
index b86904b7d656..45da384491de 100644
--- a/graphics/krita/Makefile
+++ b/graphics/krita/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	krita
 DISTVERSION=	5.1.3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	graphics kde
 MASTER_SITES=	KDE/stable/${PORTNAME}/${DISTVERSION}
 DIST_SUBDIR=	KDE/${PORTNAME}
diff --git a/graphics/krita/files/patch-git_e9184281 b/graphics/krita/files/patch-git_e9184281
new file mode 100644
index 000000000000..4ea688709d74
--- /dev/null
+++ b/graphics/krita/files/patch-git_e9184281
@@ -0,0 +1,28 @@
+diff --git a/plugins/impex/heif/HeifExport.cpp b/plugins/impex/heif/HeifExport.cpp
+index c7376a6798aa6ba364fa414864086b00b9cbf3a1..c46db548bb979391166c545fc913bd0f8ff90eda 100644
+--- plugins/impex/heif/HeifExport.cpp
++++ plugins/impex/heif/HeifExport.cpp
+@@ -403,7 +403,11 @@ KisImportExportErrorCode HeifExport::convert(KisDocument *document, QIODevice *i
+            nclxDescription.set_full_range_flag(true);
+            nclxDescription.set_matrix_coefficients(heif_matrix_coefficients_RGB_GBR);
+            if (convertToRec2020) {
++#if LIBHEIF_HAVE_VERSION(1, 14, 1)
++               nclxDescription.set_color_primaries(heif_color_primaries_ITU_R_BT_2020_2_and_2100_0);
++#else
+                nclxDescription.set_color_primaties(heif_color_primaries_ITU_R_BT_2020_2_and_2100_0);
++#endif
+            } else {
+                const ColorPrimaries primaries =
+                    image->colorSpace()->profile()->getColorPrimaries();
+@@ -413,7 +417,11 @@ KisImportExportErrorCode HeifExport::convert(KisDocument *document, QIODevice *i
+                KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(
+                    primaries >= PRIMARIES_ADOBE_RGB_1998,
+                    ImportExportCodes::FormatColorSpaceUnsupported);
++#if LIBHEIF_HAVE_VERSION(1, 14, 1)
++               nclxDescription.set_color_primaries(heif_color_primaries(primaries));
++#else
+                nclxDescription.set_color_primaties(heif_color_primaries(primaries));
++#endif
+            }
+ 
+            if (conversionPolicy == ConversionPolicy::ApplyPQ) {