# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem      1.0
PortGroup       cmake 1.0
PortGroup       github 1.0

name            SDL3_ttf
github.setup    libsdl-org SDL_ttf 3.2.2 release-
revision        1
categories      devel graphics
license         zlib
maintainers     {jmr @jmroot} openmaintainer
description     add on library for libSDL for rendering TrueType fonts

long_description \
    This library is a wrapper around FreeType and \
    allows rendering TrueType fonts in SDL applications.

github.tarball_from releases
distname        ${name}-${version}

checksums       rmd160 761de5c75d1323c3589412a035b9a0e950289168 \
                sha256 63547d58d0185c833213885b635a2c0548201cc8f301e6587c0be1a67e1e045d

depends_build-append    path:bin/pkg-config:pkgconfig
depends_lib     port:SDL3 \
                port:freetype

cmake.out_of_source yes

configure.args-append  -DSDLTTF_SAMPLES=OFF \
                -DSDLTTF_HARFBUZZ=OFF \
                -DSDLTTF_PLUTOSVG=OFF

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} CHANGES.txt README.md \
        ${destroot}${docdir}
}

variant harfbuzz description {Use harfbuzz for text shaping} {
    depends_lib-append  path:lib/pkgconfig/harfbuzz.pc:harfbuzz
    configure.args-replace  -DSDLTTF_HARFBUZZ=OFF -DSDLTTF_HARFBUZZ=ON
}
