add SDL3_ttf (#12560)

This commit is contained in:
erysdren
2025-07-08 10:55:11 -05:00
committed by GitHub
parent 97dd9a54ce
commit 978e202886

View File

@@ -0,0 +1,83 @@
SUMMARY="A TrueType font rendering library for SDL3"
DESCRIPTION="SDL_ttf is a TrueType font rendering library that is used with \
the SDL library, and almost as portable. It depends on freetype2 to handle \
the TrueType font data. It allows a programmer to use multiple TrueType fonts \
without having to code a font rendering routine themselves. With the power of \
outline fonts and antialiasing, high quality text output can be obtained \
without much effort."
HOMEPAGE="https://github.com/libsdl-org/SDL_ttf"
COPYRIGHT="1997-2025 Sam Lantinga"
LICENSE="Zlib"
REVISION="1"
SOURCE_URI="https://github.com/libsdl-org/SDL_ttf/archive/refs/tags/release-$portVersion.tar.gz"
CHECKSUM_SHA256="ff6b81d3dc39d843cc3ead6dedd68043a79513d266792ea89445547ef4e9b073"
SOURCE_DIR="SDL_ttf-release-$portVersion"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libVersion="0.2.2"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
sdl3_ttf$secondaryArchSuffix = $portVersion compat >= 3.0
lib:libSDL3_ttf$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku${secondaryArchSuffix}
lib:libfreetype$secondaryArchSuffix
lib:libharfbuzz$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libglu$secondaryArchSuffix
lib:libSDL3$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
sdl3_ttf${secondaryArchSuffix}_devel = $portVersion compat >= 3.0
devel:libSDL3_ttf$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
sdl3_ttf$secondaryArchSuffix == $portVersion base
devel:libharfbuzz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libfreetype$secondaryArchSuffix
devel:libGL$secondaryArchSuffix
devel:libglu$secondaryArchSuffix
devel:libharfbuzz$secondaryArchSuffix
devel:libSDL3$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cmake . -Bbuild -GNinja $cmakeDirArgs \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release
ninja -C build
}
INSTALL()
{
ninja -C build install
rm -rf $dataDir
prepareInstalledDevelLib libSDL3_ttf
fixPkgconfig
packageEntries devel \
$developDir \
$libDir/cmake
}