# -*- 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           github 1.0

github.setup        nothings stb 2c980bb59875b0d32144a71867fbdebb2f77cd20
github.tarball_from archive
version             20260802
revision            0

categories          devel
platforms           any
supported_archs     noarch
license             {public-domain MIT}
maintainers         {judaew @judaew} openmaintainer

description         \
    Single-file public domain (or MIT licensed) libraries for C/C++.
long_description    {*}${description}

checksums           rmd160 90763422fb474bd3b11b4c17dd99ad2dd1c7d8ff \
                    sha256 9a955b1b49a4410088a2e0ee2a9c057c3c907d0c1d75454144cb980aca0ba515 \
                    size 1516086

use_configure       no
build {}

destroot {
    xinstall -d ${destroot}${prefix}/include/${name}
    xinstall -m 0644 {*}[glob ${worksrcpath}/*.h] \
        ${destroot}${prefix}/include/${name}
    xinstall -m 0644 {*}[glob ${worksrcpath}/*.c] \
        ${destroot}${prefix}/include/${name}

    xinstall -d ${destroot}${prefix}/share/pkgconfig
    xinstall -m 0644 ${filespath}/stb.pc.in \
        ${destroot}${prefix}/share/pkgconfig/stb.pc
    reinplace "s|@PREFIX@|${prefix}|g; s|@VERSION@|${version}|g" \
        ${destroot}${prefix}/share/pkgconfig/stb.pc

    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 -W ${worksrcpath} README.md LICENSE SECURITY.md \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 {*}[glob ${worksrcpath}/docs/*] \
        ${destroot}${prefix}/share/doc/${name}
}
