From bd21b799f5d2ca90452b2c4279d2621968cb8b8f Mon Sep 17 00:00:00 2001
From: lightside <lightside@gmx.com>
Date: Tue, 17 Sep 2024 20:50:07 +0200
Subject: [PATCH] devel/upp: Fix build with freetype2 2.13.3

Based on upstream commit 68139e354876013046aac0d1699d7b61ce055d53

Reference:
https://github.com/ultimatepp/ultimatepp/commit/68139e354876013046aac0d1699d7b61ce055d53

PR:		281326
Approved by:	portmgr (blanket, build fix)
---
 devel/upp/Makefile                           |  2 +-
 devel/upp/files/patch-uppsrc_Draw_FontFc.cpp | 28 ++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 devel/upp/files/patch-uppsrc_Draw_FontFc.cpp

diff --git a/devel/upp/Makefile b/devel/upp/Makefile
index 7e36395f7521..2d2b854f9d94 100644
--- a/devel/upp/Makefile
+++ b/devel/upp/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	upp
 DISTVERSION=	15260
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	devel x11-toolkits
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/2020.2/
 DISTNAME=	${PORTNAME}-posix-${PORTVERSION}
diff --git a/devel/upp/files/patch-uppsrc_Draw_FontFc.cpp b/devel/upp/files/patch-uppsrc_Draw_FontFc.cpp
new file mode 100644
index 000000000000..a0d96a2e1110
--- /dev/null
+++ b/devel/upp/files/patch-uppsrc_Draw_FontFc.cpp
@@ -0,0 +1,28 @@
+# Draw: Workaround for backwards incompatibility of FT_Outline
+# https://github.com/ultimatepp/ultimatepp/commit/68139e354876013046aac0d1699d7b61ce055d53
+
+--- uppsrc/Draw/FontFc.cpp.orig	2020-10-16 9:28:02 UTC
++++ uppsrc/Draw/FontFc.cpp
+@@ -290,10 +290,9 @@
+ 	FT_Vector   v_start;
+ 	FT_Vector*  point;
+ 	FT_Vector*  limit;
+-	char*       tags;
+ 	int   n;         // index of contour in outline
+-	char  tag;       // current point's state
+ 	int   first = 0; // index of first point in contour
++
+ 	for(n = 0; n < outline.n_contours; n++) {
+ 		int  last = outline.contours[n];
+ 		limit = outline.points + last;
+@@ -301,8 +300,8 @@
+ 		v_last  = outline.points[last];
+ 		v_control = v_start;
+ 		point = outline.points + first;
+-		tags  = outline.tags  + first;
+-		tag   = FT_CURVE_TAG(tags[0]);
++		const auto *tags  = outline.tags  + first;
++		auto tag   = FT_CURVE_TAG(tags[0]);
+ 		if(tag == FT_CURVE_TAG_CUBIC) return false;
+ 		if(tag == FT_CURVE_TAG_CONIC) {
+ 			if(FT_CURVE_TAG(outline.tags[last]) == FT_CURVE_TAG_ON) {
-- 
GitLab