diff mbox series

[meta-oe,3/5] libsdl2-ttf: Upgrade to 2.20.2

Message ID 20230302083116.1332448-3-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,1/5] pkcs11-helper: Update to latest tip of trunk | expand

Commit Message

Khem Raj March 2, 2023, 8:31 a.m. UTC
Fix build with clang16 while here

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...ction-signatures-to-match-without-ca.patch | 69 +++++++++++++++++++
 ...l2-ttf_2.20.1.bb => libsdl2-ttf_2.20.2.bb} |  7 +-
 2 files changed, 73 insertions(+), 3 deletions(-)
 create mode 100644 meta-oe/recipes-graphics/libsdl/libsdl2-ttf/0001-freetype-Fix-function-signatures-to-match-without-ca.patch
 rename meta-oe/recipes-graphics/libsdl/{libsdl2-ttf_2.20.1.bb => libsdl2-ttf_2.20.2.bb} (76%)
diff mbox series

Patch

diff --git a/meta-oe/recipes-graphics/libsdl/libsdl2-ttf/0001-freetype-Fix-function-signatures-to-match-without-ca.patch b/meta-oe/recipes-graphics/libsdl/libsdl2-ttf/0001-freetype-Fix-function-signatures-to-match-without-ca.patch
new file mode 100644
index 0000000000..8cb76c35d6
--- /dev/null
+++ b/meta-oe/recipes-graphics/libsdl/libsdl2-ttf/0001-freetype-Fix-function-signatures-to-match-without-ca.patch
@@ -0,0 +1,69 @@ 
+From 6c52693d264ca3dc8e15a92f56cf3a636639bb6c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
+Date: Fri, 28 Oct 2022 22:17:15 +0300
+Subject: [PATCH] freetype: Fix function signatures to match without casts
+
+Clang 16 has got a new stricter warning for casts of function types
+(see https://github.com/llvm/llvm-project/commit/1aad641c793090b4d036c03e737df2ebe2c32c57).
+
+This new warning gets included as part of the existing error
+diagnostic setting of -Wcast-function-type.
+
+This fixes errors like these:
+
+../src/hb-ft.cc:1011:34: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
+    ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
+                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Backport [https://github.com/harfbuzz/harfbuzz/commit/d88269c827895b38f99f7cf741fa60210d4d5169]
+---
+ src/hb-ft.cc | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/src/hb-ft.cc b/src/hb-ft.cc
+index a6beb9f0f..a35e75b18 100644
+--- a/src/hb-ft.cc
++++ b/src/hb-ft.cc
+@@ -729,8 +729,9 @@ hb_ft_face_create_referenced (FT_Face ft_face)
+ }
+ 
+ static void
+-hb_ft_face_finalize (FT_Face ft_face)
++hb_ft_face_finalize (void *arg)
+ {
++  FT_Face ft_face = (FT_Face) arg;
+   hb_face_destroy ((hb_face_t *) ft_face->generic.data);
+ }
+ 
+@@ -762,7 +763,7 @@ hb_ft_face_create_cached (FT_Face ft_face)
+       ft_face->generic.finalizer (ft_face);
+ 
+     ft_face->generic.data = hb_ft_face_create (ft_face, nullptr);
+-    ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
++    ft_face->generic.finalizer = hb_ft_face_finalize;
+   }
+ 
+   return hb_face_reference ((hb_face_t *) ft_face->generic.data);
+@@ -949,8 +950,9 @@ get_ft_library ()
+ }
+ 
+ static void
+-_release_blob (FT_Face ft_face)
++_release_blob (void *arg)
+ {
++  FT_Face ft_face = (FT_Face) arg;
+   hb_blob_destroy ((hb_blob_t *) ft_face->generic.data);
+ }
+ 
+@@ -1032,7 +1034,7 @@ hb_ft_font_set_funcs (hb_font_t *font)
+ #endif
+ 
+   ft_face->generic.data = blob;
+-  ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob;
++  ft_face->generic.finalizer = _release_blob;
+ 
+   _hb_ft_font_set_funcs (font, ft_face, true);
+   hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING);
+-- 
+2.39.2
+
diff --git a/meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.1.bb b/meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.2.bb
similarity index 76%
rename from meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.1.bb
rename to meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.2.bb
index b8732b4c86..7d352f4218 100644
--- a/meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.1.bb
+++ b/meta-oe/recipes-graphics/libsdl/libsdl2-ttf_2.20.2.bb
@@ -2,17 +2,18 @@  SUMMARY = "Simple DirectMedia Layer truetype font library"
 SECTION = "libs"
 DEPENDS = "libsdl2 freetype virtual/egl"
 LICENSE = "Zlib"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=771dca8728b18d39b130e19b36514371"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a41cbf59bdea749fe34c1af6d3615f68"
 
 SRC_URI = " \
     git://github.com/libsdl-org/SDL_ttf.git;branch=release-2.20.x;protocol=https \
     git://github.com/libsdl-org/freetype.git;branch=VER-2-12-1-SDL;destsuffix=git/external/freetype;name=freetype;protocol=https \
     git://github.com/libsdl-org/harfbuzz.git;branch=2.9.1-SDL;destsuffix=git/external/harfbuzz;name=harfbuzz;protocol=https \
+    file://0001-freetype-Fix-function-signatures-to-match-without-ca.patch;patchdir=external/harfbuzz \
     file://automake_foreign.patch \
 "
-SRCREV = "0a652b598625d16ea7016665095cb1e9bce9ef4f"
+SRCREV = "89d1692fd8fe91a679bb943d377bfbd709b52c23"
 SRCREV_freetype = "6fc77cee03e078e97afcee0c0e06a2d3274b9a29"
-SRCREV_harfbuzz = "6022fe2f68d028ee178284f297b3902ffdf65b03"
+SRCREV_harfbuzz = "43931e3e596c04044861770b831c8f9452e2d3b0"
 
 S = "${WORKDIR}/git"