commit:     ad07271c36015504213352376e00e0df2ec81a2e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 23 11:23:23 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep 23 11:23:23 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad07271c

games-engines/scummvm: fix build w/ freetype-2.13.3

Closes: https://bugs.gentoo.org/938014
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/scummvm-2.8.1-freetype-2.13.3.patch      | 59 ++++++++++++++++++++++
 games-engines/scummvm/scummvm-2.8.1-r1.ebuild      |  4 ++
 2 files changed, 63 insertions(+)

diff --git a/games-engines/scummvm/files/scummvm-2.8.1-freetype-2.13.3.patch 
b/games-engines/scummvm/files/scummvm-2.8.1-freetype-2.13.3.patch
new file mode 100644
index 000000000000..3498c17857e0
--- /dev/null
+++ b/games-engines/scummvm/files/scummvm-2.8.1-freetype-2.13.3.patch
@@ -0,0 +1,59 @@
+https://bugs.gentoo.org/938014
+https://github.com/scummvm/scummvm/pull/6046
+
+From 391aa847c20bae4827fd8e868267a0cf4fc72df4 Mon Sep 17 00:00:00 2001
+From: antoniou79 <[email protected]>
+Date: Wed, 14 Aug 2024 22:50:32 +0300
+Subject: [PATCH] AGS: Support for FreeType 2.13.3 changes to FT_Outline struct
+
+FreeType 2.13.3 changed a few types of the struct members for FT_Outline 
struct to unsigned
+
+This is the relevant commit from the FreeType source (github):
+https://github.com/freetype/freetype/commit/2a7bb4596f566a34fd53932af0ef53b956459d25
+--- a/engines/ags/lib/freetype-2.1.3/autohint/ahglyph.cpp
++++ b/engines/ags/lib/freetype-2.1.3/autohint/ahglyph.cpp
+@@ -296,7 +296,11 @@ void ah_outline_save(AH_Outline outline, AH_Loader 
gloader) {
+       AH_Point point = outline->points;
+       AH_Point point_limit = point + outline->num_points;
+       FT_Vector *vec = gloader->current.outline.points;
++#if (FREETYPE_MAJOR * 1000 + FREETYPE_MINOR) * 1000 + FREETYPE_PATCH < 2013003
+       char *tag = gloader->current.outline.tags;
++#else
++      unsigned char *tag = gloader->current.outline.tags;
++#endif
+ 
+       /* we assume that the glyph loader has already been checked for storage 
*/
+       for (; point < point_limit; point++, vec++, tag++) {
+@@ -408,8 +412,11 @@ FT_Error ah_outline_load(AH_Outline outline, FT_Face 
face) {
+ 
+               /* compute Bezier flags */
+               {
++#if (FREETYPE_MAJOR * 1000 + FREETYPE_MINOR) * 1000 + FREETYPE_PATCH < 2013003
+                       char *tag = source->tags;
+-
++#else
++                      unsigned char *tag = source->tags;
++#endif
+                       for (point = points; point < point_limit; point++, 
tag++) {
+                               switch (FT_CURVE_TAG(*tag)) {
+                               case FT_CURVE_TAG_CONIC:
+@@ -457,12 +464,17 @@ FT_Error ah_outline_load(AH_Outline outline, FT_Face 
face) {
+               {
+                       AH_Point *contour = outline->contours;
+                       AH_Point *contour_limit = contour + 
outline->num_contours;
++#if (FREETYPE_MAJOR * 1000 + FREETYPE_MINOR) * 1000 + FREETYPE_PATCH < 2013003
+                       short *end = source->contours;
+                       short idx = 0;
++#else
++                      unsigned short *end = source->contours;
++                      unsigned short idx = 0;
++#endif
+ 
+                       for (; contour < contour_limit; contour++, end++) {
+                               contour[0] = points + idx;
+-                              idx = (short)(end[0] + 1);
++                              idx = end[0] + 1;
+                       }
+               }
+ 
+

diff --git a/games-engines/scummvm/scummvm-2.8.1-r1.ebuild 
b/games-engines/scummvm/scummvm-2.8.1-r1.ebuild
index 062895592e49..2d7c8e7c8b65 100644
--- a/games-engines/scummvm/scummvm-2.8.1-r1.ebuild
+++ b/games-engines/scummvm/scummvm-2.8.1-r1.ebuild
@@ -71,6 +71,10 @@ BDEPEND="
        x86? ( dev-lang/nasm )
 "
 
+PATCHES=(
+       "${FILESDIR}"/${P}-freetype-2.13.3.patch
+)
+
 src_prepare() {
        default
 

Reply via email to