libsdl2-ttf: update and build with cmake

Signed-off-by: Markus Volk <f_l_k@t-online.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Markus Volk
2025-04-21 11:48:29 +02:00
committed by Khem Raj
parent 5be79c75a6
commit dbb9c319a8
4 changed files with 14 additions and 127 deletions
@@ -1,69 +0,0 @@
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
@@ -1,23 +0,0 @@
From 6ec375eaafc43a2b3c30a0e0e49447d231d81a67 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 9 May 2017 00:57:10 -0700
---
Upstream-Status: Pending
Makefile.am | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 8568dd2..5efc91e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,8 @@ ACLOCAL_AMFLAGS = -I acinclude
lib_LTLIBRARIES = libSDL2_ttf.la
+AUTOMAKE_OPTIONS = foreign
+
libSDL2_ttfincludedir = $(includedir)/SDL2
libSDL2_ttfinclude_HEADERS = \
SDL_ttf.h
@@ -1,35 +0,0 @@
SUMMARY = "Simple DirectMedia Layer truetype font library"
SECTION = "libs"
DEPENDS = "libsdl2 freetype virtual/egl"
LICENSE = "Zlib"
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 = "89d1692fd8fe91a679bb943d377bfbd709b52c23"
SRCREV_freetype = "6fc77cee03e078e97afcee0c0e06a2d3274b9a29"
SRCREV_harfbuzz = "43931e3e596c04044861770b831c8f9452e2d3b0"
SRCREV_FORMAT .= "_freetype_harfbuzz"
S = "${WORKDIR}/git"
inherit autotools pkgconfig features_check
# links to libGL.so
REQUIRED_DISTRO_FEATURES += "opengl"
do_configure:prepend() {
# Removing these files fixes a libtool version mismatch.
MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
for i in ${MACROS}; do
rm -f ${S}/acinclude/$i
done
}
ASNEEDED = ""
@@ -0,0 +1,14 @@
SUMMARY = "Simple DirectMedia Layer truetype font library"
SECTION = "libs"
DEPENDS = "libsdl2 freetype virtual/egl"
LICENSE = "Zlib"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=fbb0010b2f7cf6e8a13bcac1ef4d2455"
SRC_URI = "http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${PV}.tar.gz"
SRC_URI[sha256sum] = "0b2bf1e7b6568adbdbc9bb924643f79d9dedafe061fa1ed687d1d9ac4e453bfd"
inherit cmake pkgconfig
S = "${UNPACKDIR}/SDL2_ttf-${PV}"
FILES:${PN} += "${datadir}/licenses"