# -*- 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        msteinert bstring 1.0.3 v
github.tarball_from releases
revision            0

categories          textproc devel
license             BSD
maintainers         {@trodemaster icloud.com:manuals-unread2u} openmaintainer

description         The Better String Library for C
long_description    ${name} is a fork of Paul Hsieh's Better String Library. \
                    It provides a comprehensive string library for C with \
                    features like autotools build system, updated test suite \
                    based on Check, Valgrind integration, and continuous \
                    integration via GitHub Actions.

homepage            https://github.com/msteinert/bstring

checksums           rmd160  e43549dabb94d9b7703c7b762b5fba95f4b398ef \
                    sha256  f6162a784beae8919fc60328a1bbe620573b31224d33c7d59583724f54646a3d \
                    size    511108

depends_build       path:bin/pkg-config:pkgconfig

use_autoreconf      yes

variant tests description "Build and run tests" {
    depends_lib-append  port:check
    configure.args-append --enable-tests
    test.run            yes
    test.target         check
}

post-destroot {
    # Install documentation
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} README.md COPYING \
        ${destroot}${prefix}/share/doc/${name}
}
